1*e4a36f41SAndroid Build Coastguard Worker# healthd - battery/charger monitoring service daemon 2*e4a36f41SAndroid Build Coastguard Workertype healthd, domain; 3*e4a36f41SAndroid Build Coastguard Workertype healthd_exec, system_file_type, exec_type, file_type; 4*e4a36f41SAndroid Build Coastguard Worker 5*e4a36f41SAndroid Build Coastguard Worker# Write to /dev/kmsg 6*e4a36f41SAndroid Build Coastguard Workerallow healthd kmsg_device:chr_file rw_file_perms; 7*e4a36f41SAndroid Build Coastguard Worker 8*e4a36f41SAndroid Build Coastguard Worker# Read access to pseudo filesystems. 9*e4a36f41SAndroid Build Coastguard Workerallow healthd sysfs_type:dir search; 10*e4a36f41SAndroid Build Coastguard Worker# Allow to read /sys/class/power_supply directory. 11*e4a36f41SAndroid Build Coastguard Workerallow healthd sysfs:dir r_dir_perms; 12*e4a36f41SAndroid Build Coastguard Workerr_dir_file(healthd, rootfs) 13*e4a36f41SAndroid Build Coastguard Workerr_dir_file(healthd, cgroup) 14*e4a36f41SAndroid Build Coastguard Workerr_dir_file(healthd, cgroup_v2) 15*e4a36f41SAndroid Build Coastguard Worker 16*e4a36f41SAndroid Build Coastguard Workerallow healthd self:global_capability_class_set { sys_tty_config }; 17*e4a36f41SAndroid Build Coastguard Workerallow healthd self:global_capability_class_set sys_boot; 18*e4a36f41SAndroid Build Coastguard Workerdontaudit healthd self:global_capability_class_set sys_resource; 19*e4a36f41SAndroid Build Coastguard Worker 20*e4a36f41SAndroid Build Coastguard Workerallow healthd self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl; 21*e4a36f41SAndroid Build Coastguard Worker 22*e4a36f41SAndroid Build Coastguard Workerwakelock_use(healthd) 23*e4a36f41SAndroid Build Coastguard Worker 24*e4a36f41SAndroid Build Coastguard Workerhal_client_domain(healthd, hal_health) 25*e4a36f41SAndroid Build Coastguard Worker 26*e4a36f41SAndroid Build Coastguard Worker# Read/write to /sys/power/state 27*e4a36f41SAndroid Build Coastguard Workerallow healthd sysfs_power:file rw_file_perms; 28*e4a36f41SAndroid Build Coastguard Worker 29*e4a36f41SAndroid Build Coastguard Worker# TODO: added to match above sysfs rule. Remove me? 30*e4a36f41SAndroid Build Coastguard Workerallow healthd sysfs_usb:file write; 31*e4a36f41SAndroid Build Coastguard Worker 32*e4a36f41SAndroid Build Coastguard Workerr_dir_file(healthd, sysfs_batteryinfo) 33*e4a36f41SAndroid Build Coastguard Worker 34*e4a36f41SAndroid Build Coastguard Worker### 35*e4a36f41SAndroid Build Coastguard Worker### healthd: charger mode 36*e4a36f41SAndroid Build Coastguard Worker### 37*e4a36f41SAndroid Build Coastguard Worker 38*e4a36f41SAndroid Build Coastguard Worker# Read /sys/fs/pstore/console-ramoops 39*e4a36f41SAndroid Build Coastguard Worker# Don't worry about overly broad permissions for now, as there's 40*e4a36f41SAndroid Build Coastguard Worker# only one file in /sys/fs/pstore 41*e4a36f41SAndroid Build Coastguard Workerallow healthd pstorefs:dir r_dir_perms; 42*e4a36f41SAndroid Build Coastguard Workerallow healthd pstorefs:file r_file_perms; 43*e4a36f41SAndroid Build Coastguard Worker 44*e4a36f41SAndroid Build Coastguard Workerallow healthd graphics_device:dir r_dir_perms; 45*e4a36f41SAndroid Build Coastguard Workerallow healthd graphics_device:chr_file rw_file_perms; 46*e4a36f41SAndroid Build Coastguard Workerallow healthd input_device:dir r_dir_perms; 47*e4a36f41SAndroid Build Coastguard Workerallow healthd input_device:chr_file r_file_perms; 48*e4a36f41SAndroid Build Coastguard Workerallow healthd tty_device:chr_file rw_file_perms; 49*e4a36f41SAndroid Build Coastguard Workerallow healthd ashmem_device:chr_file execute; 50*e4a36f41SAndroid Build Coastguard Workerallow healthd proc_sysrq:file rw_file_perms; 51