diff --git a/file.te b/file.te index eb25377e8b3bd97a07f0a18b86d49e5d2c33bc3e..25bdb2bc9f23d21aa400b8a14c76195aa2b6edfd 100644 --- a/file.te +++ b/file.te @@ -22,6 +22,7 @@ type selinuxfs, fs_type, mlstrustedobject; type cgroup, fs_type, mlstrustedobject; type sysfs, fs_type, sysfs_type, mlstrustedobject; type sysfs_writable, fs_type, sysfs_type, mlstrustedobject; +type sysfs_batteryinfo, fs_type, sysfs_type; type sysfs_bluetooth_writable, fs_type, sysfs_type, mlstrustedobject; type sysfs_nfc_power_writable, fs_type, sysfs_type, mlstrustedobject; type sysfs_wake_lock, fs_type, sysfs_type; diff --git a/healthd.te b/healthd.te index 48be64d99f612e76d6301b5c811f23f257775887..d09eab49021eaa68ae4a83e8d685f004466c94f1 100644 --- a/healthd.te +++ b/healthd.te @@ -16,6 +16,8 @@ binder_call(healthd, system_server) # TODO: Split into a separate type? allow healthd sysfs:file write; +allow healthd sysfs_batteryinfo:file r_file_perms; + ### ### healthd: charger mode ### diff --git a/shell.te b/shell.te index 28e713889afbf76f3e92fc7eccae1f56b85cd6b9..487f14c9b89c7a8dcde93634b906c0b06fc37d52 100644 --- a/shell.te +++ b/shell.te @@ -119,6 +119,9 @@ allow shell bootchart_data_file:file create_file_perms; # Make sure strace works for the non-privileged shell user allow shell self:process ptrace; +# allow shell to get battery info +allow shell sysfs_batteryinfo:file r_file_perms; + # Allow access to ion memory allocation device. allow shell ion_device:chr_file rw_file_perms;