diff --git a/private/file_contexts b/private/file_contexts index 0ca1c5880b3053c2e7c2410b9c3cf3b23e3bcc7b..16ecbf047935c7eb4a51a8d5834da089b1f33934 100644 --- a/private/file_contexts +++ b/private/file_contexts @@ -419,6 +419,7 @@ ############################# # sysfs files # +/sys/class/leds(/.*)? u:object_r:sysfs_leds:s0 /sys/devices/platform/nfc-power/nfc_power -- u:object_r:sysfs_nfc_power_writable:s0 /sys/devices/system/cpu(/.*)? u:object_r:sysfs_devices_system_cpu:s0 /sys/devices/virtual/block/zram\d+(/.*)? u:object_r:sysfs_zram:s0 diff --git a/public/file.te b/public/file.te index a113948159cfb2398b6c8e4dbc43c816b26a221d..527e496bf97b279d874dae453f5e4a08dc3c8ead 100644 --- a/public/file.te +++ b/public/file.te @@ -32,6 +32,7 @@ type sysfs, fs_type, sysfs_type, mlstrustedobject; type sysfs_uio, sysfs_type, fs_type; type sysfs_batteryinfo, fs_type, sysfs_type; type sysfs_bluetooth_writable, fs_type, sysfs_type, mlstrustedobject; +type sysfs_leds, fs_type, sysfs_type; type sysfs_hwrandom, fs_type, sysfs_type; type sysfs_nfc_power_writable, fs_type, sysfs_type, mlstrustedobject; type sysfs_wake_lock, fs_type, sysfs_type; diff --git a/public/hal_light.te b/public/hal_light.te index 4fb38b8c71bbb031d58a72c3617dd58e4bef3cf3..145b02e7f68af0504d39ba7743dd1d2a3f193aa7 100644 --- a/public/hal_light.te +++ b/public/hal_light.te @@ -1,2 +1,6 @@ # call into system_server process (callbacks) binder_call(hal_light, system_server) + +allow hal_light sysfs_leds:lnk_file read; +allow hal_light sysfs_leds:file rw_file_perms; +allow hal_light sysfs_leds:dir r_dir_perms;