From 1ba43f4ce5ef705f78315f4bf215d9bfe52271ce Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Mon, 4 Nov 2019 22:56:22 +0100 Subject: [PATCH] Simplify matching for lenovo dt2w --- rw-system.sh | 2 +- sepolicy/lenovo.te | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 sepolicy/lenovo.te diff --git a/rw-system.sh b/rw-system.sh index 0e018de..fb59a3a 100644 --- a/rw-system.sh +++ b/rw-system.sh @@ -118,7 +118,7 @@ changeKeylayout() { changed=true fi - if getprop ro.vendor.build.fingerprint |grep -iq -E -e '^Lenovo/kunlun';then + if getprop ro.vendor.build.fingerprint |grep -iq -E -e '^Lenovo/' && [ -f /sys/devices/virtual/touch/tp_dev/gesture_on ];then cp /system/phh/lenovo-synaptics_dsx.kl /mnt/phh/keylayout/synaptics_dsx.kl chmod 0644 /mnt/phh/keylayout/synaptics_dsx.kl changed=true diff --git a/sepolicy/lenovo.te b/sepolicy/lenovo.te new file mode 100644 index 0000000..19e3314 --- /dev/null +++ b/sepolicy/lenovo.te @@ -0,0 +1,4 @@ +type sysfs_tp, file_type; + +#Allow treble_app access to /sys/devices/virtual/touch/tp_dev/gesture_on +allow system_app sysfs_tp:file rw_file_perms;