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) 14r_dir_file(healthd, cgroup_v2) 15 16allow healthd self:global_capability_class_set { sys_tty_config }; 17allow healthd self:global_capability_class_set sys_boot; 18dontaudit healthd self:global_capability_class_set sys_resource; 19 20allow healthd self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl; 21 22wakelock_use(healthd) 23 24hal_client_domain(healthd, hal_health) 25 26# Read/write to /sys/power/state 27allow healthd sysfs_power:file rw_file_perms; 28 29# TODO: added to match above sysfs rule. Remove me? 30allow healthd sysfs_usb:file write; 31 32r_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 41allow healthd pstorefs:dir r_dir_perms; 42allow healthd pstorefs:file r_file_perms; 43 44allow healthd graphics_device:dir r_dir_perms; 45allow healthd graphics_device:chr_file rw_file_perms; 46allow healthd input_device:dir r_dir_perms; 47allow healthd input_device:chr_file r_file_perms; 48allow healthd tty_device:chr_file rw_file_perms; 49allow healthd ashmem_device:chr_file execute; 50allow healthd proc_sysrq:file rw_file_perms; 51