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