1# healthd - battery/charger monitoring service daemon
2type healthd, domain;
3type healthd_exec, 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;
10r_dir_file(healthd, rootfs)
11r_dir_file(healthd, cgroup)
12
13# Read access to system files for passthrough HALs in
14# /{system,vendor,odm}/lib[64]/hw/
15r_dir_file(healthd, system_file)
16
17allow healthd self:global_capability_class_set { sys_tty_config };
18allow healthd self:global_capability_class_set sys_boot;
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 self:process execmem;
51allow 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.
55set_prop(healthd, system_prop)
56set_prop(healthd, exported_system_prop)
57set_prop(healthd, exported2_system_prop)
58set_prop(healthd, exported3_system_prop)
59