Add sepolicy to support lights HAL

Bug: 230288032
Test: atest VtsHalLightTargetTest
Change-Id: I4fd54341d4ef6a91cb84f0881725985f05abf2d5
This commit is contained in:
Chungjui Fan 2022-06-08 21:55:56 +08:00
parent 904d1b1e5b
commit 24d426e003
4 changed files with 14 additions and 0 deletions

2
vendor/file.te vendored Normal file
View file

@ -0,0 +1,2 @@
# Privacy LED
type persist_leds_file, file_type, vendor_persist_type;

View file

@ -10,3 +10,7 @@
# Wifi
/dev/wlan u:object_r:vendor_wlan_device:s0
# Privacy LED
/vendor/bin/hw/android\.hardware\.lights-service\.tangorpro u:object_r:hal_light_default_exec:s0
/mnt/vendor/persist/led(/.*)? u:object_r:persist_leds_file:s0

View file

@ -14,3 +14,6 @@ genfscon proc /nvt_selftest u:object_
# system suspend wakeup files
genfscon sysfs /devices/platform/google,dock/power_supply/dock/wakeup u:object_r:sysfs_wakeup:s0
# Privacy LED
genfscon sysfs /devices/platform/pwmleds/leds/green/brightness u:object_r:sysfs_leds:s0

5
vendor/hal_lights.te vendored Normal file
View file

@ -0,0 +1,5 @@
allow hal_light_default sysfs_leds:dir search;
allow hal_light_default sysfs_leds:file rw_file_perms;
allow hal_light_default mnt_vendor_file:dir search;
allow hal_light_default persist_file:dir search;
r_dir_file(hal_light_default, persist_leds_file);