Home | History | Annotate | Download | only in public
      1 # healthd - battery/charger monitoring service daemon
      2 type healthd, domain;
      3 type healthd_exec, exec_type, file_type;
      4 
      5 # Write to /dev/kmsg
      6 allow healthd kmsg_device:chr_file rw_file_perms;
      7 
      8 # Read access to pseudo filesystems.
      9 allow healthd sysfs_type:dir search;
     10 r_dir_file(healthd, rootfs)
     11 r_dir_file(healthd, cgroup)
     12 
     13 # Read access to system files for passthrough HALs in
     14 # /{system,vendor,odm}/lib[64]/hw/
     15 r_dir_file(healthd, system_file)
     16 
     17 allow healthd self:global_capability_class_set { sys_tty_config };
     18 allow healthd self:global_capability_class_set sys_boot;
     19 
     20 allow healthd self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl;
     21 
     22 wakelock_use(healthd)
     23 
     24 hal_client_domain(healthd, hal_health)
     25 
     26 # Read/write to /sys/power/state
     27 allow healthd sysfs_power:file rw_file_perms;
     28 
     29 # TODO: added to match above sysfs rule. Remove me?
     30 allow healthd sysfs_usb:file write;
     31 
     32 r_dir_file(healthd, sysfs_batteryinfo)
     33 
     34 ###
     35 ### healthd: charger mode
     36 ###
     37 
     38 # Read /sys/fs/pstore/console-ramoops
     39 # Don't worry about overly broad permissions for now, as there's
     40 # only one file in /sys/fs/pstore
     41 allow healthd pstorefs:dir r_dir_perms;
     42 allow healthd pstorefs:file r_file_perms;
     43 
     44 allow healthd graphics_device:dir r_dir_perms;
     45 allow healthd graphics_device:chr_file rw_file_perms;
     46 allow healthd input_device:dir r_dir_perms;
     47 allow healthd input_device:chr_file r_file_perms;
     48 allow healthd tty_device:chr_file rw_file_perms;
     49 allow healthd ashmem_device:chr_file execute;
     50 allow healthd self:process execmem;
     51 allow healthd proc_sysrq:file rw_file_perms;
     52 
     53 # Healthd needs to tell init to continue the boot
     54 # process when running in charger mode.
     55 set_prop(healthd, system_prop)
     56 set_prop(healthd, exported_system_prop)
     57 set_prop(healthd, exported2_system_prop)
     58 set_prop(healthd, exported3_system_prop)
     59