2016-11-01 21:49:10 +01:00
|
|
|
type charger, domain;
|
2018-09-08 00:05:33 +02:00
|
|
|
type charger_exec, system_file_type, exec_type, file_type;
|
2016-11-01 21:49:10 +01:00
|
|
|
|
|
|
|
# Write to /dev/kmsg
|
|
|
|
allow charger kmsg_device:chr_file rw_file_perms;
|
|
|
|
|
|
|
|
# Read access to pseudo filesystems.
|
|
|
|
r_dir_file(charger, rootfs)
|
|
|
|
r_dir_file(charger, cgroup)
|
|
|
|
|
2018-01-19 00:36:07 +01:00
|
|
|
# Allow to read /sys/class/power_supply directory
|
|
|
|
allow charger sysfs_type:dir r_dir_perms;
|
|
|
|
|
2017-11-09 23:51:26 +01:00
|
|
|
allow charger self:global_capability_class_set { sys_tty_config };
|
|
|
|
allow charger self:global_capability_class_set sys_boot;
|
2016-11-01 21:49:10 +01:00
|
|
|
|
|
|
|
wakelock_use(charger)
|
|
|
|
|
|
|
|
allow charger self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl;
|
|
|
|
|
2017-11-15 02:40:11 +01:00
|
|
|
# Read/write to /sys/power/state
|
|
|
|
allow charger sysfs_power:file rw_file_perms;
|
2016-11-01 21:49:10 +01:00
|
|
|
|
2017-10-17 00:54:49 +02:00
|
|
|
r_dir_file(charger, sysfs_batteryinfo)
|
2016-11-01 21:49:10 +01:00
|
|
|
|
|
|
|
# Read /sys/fs/pstore/console-ramoops
|
|
|
|
# Don't worry about overly broad permissions for now, as there's
|
|
|
|
# only one file in /sys/fs/pstore
|
|
|
|
allow charger pstorefs:dir r_dir_perms;
|
|
|
|
allow charger pstorefs:file r_file_perms;
|
|
|
|
|
|
|
|
allow charger graphics_device:dir r_dir_perms;
|
|
|
|
allow charger graphics_device:chr_file rw_file_perms;
|
|
|
|
allow charger input_device:dir r_dir_perms;
|
|
|
|
allow charger input_device:chr_file r_file_perms;
|
|
|
|
allow charger tty_device:chr_file rw_file_perms;
|
|
|
|
allow charger proc_sysrq:file rw_file_perms;
|
|
|
|
|
|
|
|
# charger needs to tell init to continue the boot
|
|
|
|
# process when running in charger mode.
|
|
|
|
set_prop(charger, system_prop)
|
2017-10-19 09:54:49 +02:00
|
|
|
set_prop(charger, exported_system_prop)
|
|
|
|
set_prop(charger, exported2_system_prop)
|
|
|
|
set_prop(charger, exported3_system_prop)
|
2019-07-08 19:57:46 +02:00
|
|
|
|
|
|
|
get_prop(charger, charger_prop)
|