Allow the sensor HAL to access raw HID devices.

Bug: 195964858
Test: Paired a Sony PS4 controller and verified that it's discovered by
 the dynamic sensor HAL.
Test: See details in testing done comment in
 https://googleplex-android-review.git.corp.google.com/15847652 .
Change-Id: Ic0bdd711d066a9793eba305102e9a850e3973856
This commit is contained in:
Erik Staats 2021-09-16 15:03:31 -07:00
parent a592fb52c3
commit d60ebc5327
3 changed files with 11 additions and 0 deletions

View file

@ -52,6 +52,9 @@ allow hal_sensors_default sysfs_aoc_dumpstate:file r_file_perms;
# Allow access for dynamic sensor properties. # Allow access for dynamic sensor properties.
get_prop(hal_sensors_default, vendor_dynamic_sensor_prop) 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;
# #
# Suez type enforcements. # Suez type enforcements.
# #

View file

@ -55,3 +55,7 @@ type amcs_device, dev_type;
# Battery history # Battery history
type battery_history_device, dev_type; type battery_history_device, dev_type;
# Raw HID device
type hidraw_device, dev_type;

View file

@ -441,3 +441,7 @@
/vendor/lib64/android\.frameworks\.stats-V1-ndk_platform\.so u:object_r:same_process_hal_file:s0 /vendor/lib64/android\.frameworks\.stats-V1-ndk_platform\.so u:object_r:same_process_hal_file:s0
/vendor/lib64/vendor-pixelatoms-cpp\.so u:object_r:same_process_hal_file:s0 /vendor/lib64/vendor-pixelatoms-cpp\.so u:object_r:same_process_hal_file:s0
/vendor/lib64/libprotobuf-cpp-lite-3\.9\.1\.so u:object_r:same_process_hal_file:s0 /vendor/lib64/libprotobuf-cpp-lite-3\.9\.1\.so u:object_r:same_process_hal_file:s0
# Raw HID device
/dev/hidraw[0-9]* u:object_r:hidraw_device:s0