qllow priv-app to access Pixel power HAL extension.

SELinux issues to solve:

native  : aion.cc:780 Error loading lib_aion_buffer.so dlopen failed: library "pixel-power-ext-V1-ndk_platform.so" not found: needed by /vendor/lib64/lib_aion_buffer.so in namespace sphal

05-23 10:11:32.055   420   420 E SELinux : avc:  denied  { find } for pid=6630 uid=10089 name=android.hardware.power.IPower/default scontext=u:r:priv_app:s0:c512,c768 tcontext=u:object_r:hal_power_service:s0 tclass=service_manager permissive=0

Bug: 187373665
Test: Passed, procedure listed in b/187373665#comment8 with forrest.
Change-Id: Ice7c69bca4a029a61ca1ccb7087ea01948ae5f24
This commit is contained in:
Sung-fang Tsai 2021-05-22 15:22:47 +00:00
parent 61843906c0
commit 985aa698c7
2 changed files with 4 additions and 0 deletions

View file

@ -7,3 +7,6 @@ allow priv_app edgetpu_nnapi_service:service_manager find;
# Allows privileged applications to access the EdgeTPU device, except open,
# which is guarded by the EdgeTPU service.
allow priv_app edgetpu_device:chr_file { getattr read write ioctl map };
# Allows privileged applications to access the PowerHAL.
hal_client_domain(priv_app, hal_power)

View file

@ -177,6 +177,7 @@
/data/vendor/camera(/.*)? u:object_r:vendor_camera_data_file:s0
/vendor/lib(64)?/lib_aion_buffer\.so u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/libGralloc4Wrapper\.so u:object_r:same_process_hal_file:s0
/vendor/lib(64)?/pixel-power-ext-V1-ndk_platform\.so u:object_r:same_process_hal_file:s0
/dev/stmvl53l1_ranging u:object_r:rls_device:s0