From 11b09341738634bb44be10fda192685a8672a9e4 Mon Sep 17 00:00:00 2001 From: Qiangming Xia Date: Sat, 18 Jan 2020 09:46:33 +0800 Subject: [PATCH] [ALPS03909938] sensor: merge sensor code [Detail] Merge sensor code to P MTK-Commit-Id: 62fa3d9f1b1a2004298003749f883ba3f693aac2 Change-Id: I72dc1f819fee5076b7524235810361aa0f01b6ba Signed-off-by: Qiangming Xia CR-Id: ALPS03909938 Feature: Sensor Hub --- non_plat/device.te | 1 + non_plat/file_contexts | 1 + non_plat/mtk_hal_sensors.te | 12 ++++++++++++ 3 files changed, 14 insertions(+) diff --git a/non_plat/device.te b/non_plat/device.te index ef1cd6a..53ce03c 100644 --- a/non_plat/device.te +++ b/non_plat/device.te @@ -232,6 +232,7 @@ type gyroscope_device, dev_type; type barometer_device,dev_type; type humidity_device,dev_type; type biometric_device,dev_type; +type sensorlist_device,dev_type; ########################## # Sensor Devices Start # diff --git a/non_plat/file_contexts b/non_plat/file_contexts index e0f45d4..26bb7aa 100644 --- a/non_plat/file_contexts +++ b/non_plat/file_contexts @@ -346,6 +346,7 @@ /dev/hwmsensor(/.*)? u:object_r:hwmsensor_device:s0 /dev/msensor(/.*)? u:object_r:msensor_device:s0 /dev/biometric(/.*)? u:object_r:biometric_device:s0 +/dev/sensorlist(/.*)? u:object_r:sensorlist_device:s0 ########################## # Sensor Devices Start # diff --git a/non_plat/mtk_hal_sensors.te b/non_plat/mtk_hal_sensors.te index 52a6c8c..1670d70 100644 --- a/non_plat/mtk_hal_sensors.te +++ b/non_plat/mtk_hal_sensors.te @@ -11,6 +11,17 @@ hwbinder_use(mtk_hal_sensors) # call into system_server process (callbacks) binder_call(mtk_hal_sensors, system_server) +# graphics allocator +allow mtk_hal_sensors hal_graphics_allocator_default:fd use; + +# gpu device +allow mtk_hal_sensors gpu_device:dir create_dir_perms; +allow mtk_hal_sensors gpu_device:chr_file rw_file_perms; +allow mtk_hal_sensors dri_device:chr_file rw_file_perms; + +# ion device +allow mtk_hal_sensors ion_device:dir create_dir_perms; +allow mtk_hal_sensors ion_device:chr_file rw_file_perms; # system file allow mtk_hal_sensors system_file:dir read; allow mtk_hal_sensors system_file:dir open; @@ -29,6 +40,7 @@ hal_server_domain(mtk_hal_sensors, hal_sensors); #allow mtk_hal_sensors hidl_base_hwservice:hwservice_manager add; # Access sensor bio devices +allow mtk_hal_sensors sensorlist_device:chr_file rw_file_perms; allow mtk_hal_sensors m_acc_misc_device:chr_file rw_file_perms; allow mtk_hal_sensors m_als_misc_device:chr_file rw_file_perms; allow mtk_hal_sensors m_ps_misc_device:chr_file rw_file_perms;