1# charger seclabel is specified in init.rc since
2# it lives in the rootfs and has no unique file type.
3type charger, domain;
4
5# Write to /dev/kmsg
6allow charger kmsg_device:chr_file rw_file_perms;
7
8# Read access to pseudo filesystems.
9r_dir_file(charger, rootfs)
10r_dir_file(charger, cgroup)
11
12# Allow to read /sys/class/power_supply directory
13allow charger sysfs_type:dir r_dir_perms;
14
15allow charger self:global_capability_class_set { sys_tty_config };
16allow charger self:global_capability_class_set sys_boot;
17
18wakelock_use(charger)
19
20allow charger self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl;
21
22# Read/write to /sys/power/state
23allow charger sysfs_power:file rw_file_perms;
24
25r_dir_file(charger, sysfs_batteryinfo)
26
27# Read /sys/fs/pstore/console-ramoops
28# Don't worry about overly broad permissions for now, as there's
29# only one file in /sys/fs/pstore
30allow charger pstorefs:dir r_dir_perms;
31allow charger pstorefs:file r_file_perms;
32
33allow charger graphics_device:dir r_dir_perms;
34allow charger graphics_device:chr_file rw_file_perms;
35allow charger input_device:dir r_dir_perms;
36allow charger input_device:chr_file r_file_perms;
37allow charger tty_device:chr_file rw_file_perms;
38allow charger proc_sysrq:file rw_file_perms;
39
40# charger needs to tell init to continue the boot
41# process when running in charger mode.
42set_prop(charger, system_prop)
43set_prop(charger, exported_system_prop)
44set_prop(charger, exported2_system_prop)
45set_prop(charger, exported3_system_prop)
46