Add hidraw device sepolicy for headtracking

Test: make and incoming HID data from Pixel Buds Pro
Bug: 276163506
Change-Id: I10833e215962ad007ad32a0d713e9b37ae888fdb
This commit is contained in:
kuanyuhuang 2023-04-26 09:18:01 +00:00
parent dd9d69e132
commit 477d58d695
5 changed files with 9 additions and 6 deletions

View file

@ -2,6 +2,3 @@ type sg_device, dev_type;
type vendor_toe_device, dev_type;
type lwis_device, dev_type;
type rls_device, dev_type;
# Raw HID device
type hidraw_device, dev_type;

View file

@ -49,6 +49,3 @@
# Persist
/mnt/vendor/persist/sensors/registry(/.*)? u:object_r:persist_sensor_reg_file:s0
/mnt/vendor/persist/uwb(/.*)? u:object_r:persist_uwb_file:s0
# Raw HID device
/dev/hidraw[0-9]* u:object_r:hidraw_device:s0

3
vendor/device.te vendored
View file

@ -20,3 +20,6 @@ type st54spi_device, dev_type;
# OTA
type sda_block_device, dev_type;
# Raw HID device
type hidraw_device, dev_type;

View file

@ -177,3 +177,6 @@
/dev/dma_heap/vscaler-secure u:object_r:vscaler_secure_heap_device:s0
/dev/dma_heap/vstream-secure u:object_r:dmabuf_system_secure_heap_device:s0
/dev/uci u:object_r:uci_device:s0
# Raw HID device
/dev/hidraw[0-9]* u:object_r:hidraw_device:s0

View file

@ -46,6 +46,9 @@ binder_call(hal_sensors_default, system_server);
# Allow access for dynamic sensor properties.
get_prop(hal_sensors_default, vendor_dynamic_sensor_prop)
# Allow access to raw HID devices for dynamic sensors.
allow hal_sensors_default hidraw_device:chr_file rw_file_perms;
# Allow access to the display info for ALS.
allow hal_sensors_default sysfs_display:file rw_file_perms;