From 862cd6725fcf133f95f6bf1b8a9acca9d740c41a Mon Sep 17 00:00:00 2001 From: Chang-An Chen Date: Sat, 18 Jan 2020 09:59:45 +0800 Subject: [PATCH] [ALPS03869354] fix tpd auto test fail in factory mode [Detail] Fix tpd auto test fail in factory mode due to sysfs nodes are not allowed to read directly. [Solution] update touch setting sysfs policy and add to factory mode MTK-Commit-Id: d8733ca0938653098f5ec1f5462c1723d8f67894 Change-Id: I3fb6a46cfbf02fe050174501a2606404a53bb2ad CR-Id: ALPS03869354 Feature: [Android Default] CapTouch --- non_plat/factory.te | 4 ++++ non_plat/file.te | 6 +++++- non_plat/meta_tst.te | 6 ++++++ plat_private/file_contexts | 1 + 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/non_plat/factory.te b/non_plat/factory.te index 7b27040..52367cc 100644 --- a/non_plat/factory.te +++ b/non_plat/factory.te @@ -349,3 +349,7 @@ allow factory audiohal_prop:property_service set; # For Accdet data permission allow factory sysfs:file { read open }; + +# For touch auto test +allow factory sysfs_tpd_setting:dir search; +allow factory sysfs_tpd_setting:file { read getattr open }; diff --git a/non_plat/file.te b/non_plat/file.te index e80c9c3..7c6b8d0 100644 --- a/non_plat/file.te +++ b/non_plat/file.te @@ -270,4 +270,8 @@ type sysfs_pump_express, fs_type, sysfs_type; type mediadrm_vendor_data_file, file_type, data_file_type; # mtk usb hal -type sysfs_dual_role_usb20, fs_type, sysfs_type; \ No newline at end of file +type sysfs_dual_role_usb20, fs_type, sysfs_type; + +# Touch parameters file +type sysfs_tpd_setting, fs_type, sysfs_type; + diff --git a/non_plat/meta_tst.te b/non_plat/meta_tst.te index 86ff33d..9e7c34e 100644 --- a/non_plat/meta_tst.te +++ b/non_plat/meta_tst.te @@ -375,3 +375,9 @@ allow meta_tst nvram_agent_binder:binder call; # Operation: P migration # Purpose : Allow meta_tst to write misc partition allow meta_tst block_device:dir search; + +# Date : W18.24 +# Operation: P migration +# Purpose : Allow meta_tst to access tpd sysfs nodes for CTP test +allow meta_tst sysfs_tpd_setting:dir search; +allow meta_tst sysfs_tpd_setting:file { read getattr open }; diff --git a/plat_private/file_contexts b/plat_private/file_contexts index a4ef9ea..4e8c24b 100644 --- a/plat_private/file_contexts +++ b/plat_private/file_contexts @@ -44,5 +44,6 @@ /sys/devices/virtual/timed_output/vibrator(/.*)? u:object_r:sysfs_vibrator:s0 /sys/devices/platform/leds-mt65xx/leds(/.*)? u:object_r:sysfs_leds:s0 /sys/devices/platform/odm/odm:vibrator@0/leds/vibrator(/.*)? u:object_r:sysfs_vibrator:s0 +/sys/module/tpd_setting(/.*)? u:object_r:sysfs_tpd_setting:s0 /sys/block/mmcblk0rpmb/size u:object_r:access_sys_file:s0