Home | History | Annotate | Download | only in public
      1 # charger seclabel is specified in init.rc since
      2 # it lives in the rootfs and has no unique file type.
      3 type charger, domain;
      4 
      5 # Write to /dev/kmsg
      6 allow charger kmsg_device:chr_file rw_file_perms;
      7 
      8 # Read access to pseudo filesystems.
      9 r_dir_file(charger, rootfs)
     10 r_dir_file(charger, cgroup)
     11 
     12 # Allow to read /sys/class/power_supply directory
     13 allow charger sysfs_type:dir r_dir_perms;
     14 
     15 allow charger self:global_capability_class_set { sys_tty_config };
     16 allow charger self:global_capability_class_set sys_boot;
     17 
     18 wakelock_use(charger)
     19 
     20 allow charger self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl;
     21 
     22 # Read/write to /sys/power/state
     23 allow charger sysfs_power:file rw_file_perms;
     24 
     25 r_dir_file(charger, sysfs_batteryinfo)
     26 
     27 # Read /sys/fs/pstore/console-ramoops
     28 # Don't worry about overly broad permissions for now, as there's
     29 # only one file in /sys/fs/pstore
     30 allow charger pstorefs:dir r_dir_perms;
     31 allow charger pstorefs:file r_file_perms;
     32 
     33 allow charger graphics_device:dir r_dir_perms;
     34 allow charger graphics_device:chr_file rw_file_perms;
     35 allow charger input_device:dir r_dir_perms;
     36 allow charger input_device:chr_file r_file_perms;
     37 allow charger tty_device:chr_file rw_file_perms;
     38 allow charger proc_sysrq:file rw_file_perms;
     39 
     40 # charger needs to tell init to continue the boot
     41 # process when running in charger mode.
     42 set_prop(charger, system_prop)
     43 set_prop(charger, exported_system_prop)
     44 set_prop(charger, exported2_system_prop)
     45 set_prop(charger, exported3_system_prop)
     46