diff --git a/sepolicy/common/file_contexts b/sepolicy/common/file_contexts index e5d59f2..ff831fb 100644 --- a/sepolicy/common/file_contexts +++ b/sepolicy/common/file_contexts @@ -30,7 +30,6 @@ /data/cam_socket3 u:object_r:camera_socket:s0 # sysfs -/sys/devices/battery.[0-9]+/power_supply/battery(/.*)? u:object_r:sysfs_batteryinfo:s0 /sys/devices/platform/bcm[0-9]+_bluetooth/rfkill/rfkill0/state u:object_r:sysfs_bluetooth_writable:s0 /sys/devices/virtual/camera(/.*)? u:object_r:sysfs_camera:s0 /sys/devices/virtual/input(/.*)? u:object_r:sysfs_input:s0 @@ -38,6 +37,12 @@ /sys/module/dhd/parameters/firmware_path u:object_r:sysfs_wifi_writeable:s0 /sys/module/dhd/parameters/nvram_path u:object_r:sysfs_wifi_writeable:s0 +# sysfs - battery/charger +/sys/devices/battery\.[0-9]+/power_supply(/.*)? u:object_r:sysfs_batteryinfo:s0 +/sys/devices/i2c\.[0-9]+/i2c-[0-9]+/[0-9]+-[a-z0-9]+/max[a-z0-9]+-charger/power_supply(/.*)? u:object_r:sysfs_batteryinfo:s0 +/sys/devices/i2c\.[0-9]+/i2c-[0-9]+/[0-9]+-[a-z0-9]+/power_supply(/.*)? u:object_r:sysfs_batteryinfo:s0 +/sys/devices/msm_dwc3/power_supply(/.*)? u:object_r:sysfs_batteryinfo:s0 + # sysfs - graphics/panel /sys/class/mhl(/.*)? u:object_r:sysfs_graphics:s0 /sys/devices/mdp\.[0-9](/.*)? u:object_r:sysfs_graphics:s0 diff --git a/sepolicy/common/hal_sensors_default.te b/sepolicy/common/hal_sensors_default.te index 58621ff..46b4d6f 100644 --- a/sepolicy/common/hal_sensors_default.te +++ b/sepolicy/common/hal_sensors_default.te @@ -1,11 +1,18 @@ -allow hal_sensors_default sysfs_graphics:dir search; -allow hal_sensors_default sysfs_graphics:file r_file_perms; +allow hal_sensors_default { + sysfs_batteryinfo + sysfs_graphics +}:dir search; allow hal_sensors_default { sysfs_iio sysfs_input }:dir r_dir_perms; +allow hal_sensors_default { + sysfs_batteryinfo + sysfs_graphics +}:file r_file_perms; + allow hal_sensors_default { sysfs_iio sysfs_input diff --git a/sepolicy/common/init.te b/sepolicy/common/init.te index 8d014e7..14cb253 100644 --- a/sepolicy/common/init.te +++ b/sepolicy/common/init.te @@ -5,6 +5,7 @@ allow init sysfs_input:file rw_file_perms; allow init sysfs_graphics:file r_file_perms; allow init { + sysfs_batteryinfo sysfs_graphics sysfs_iio sysfs_input