Simplify matching for lenovo dt2w

This commit is contained in:
Pierre-Hugues Husson 2019-11-04 22:56:22 +01:00
parent dcb6f64f42
commit 1ba43f4ce5
2 changed files with 5 additions and 1 deletions

View File

@ -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

4
sepolicy/lenovo.te Normal file
View File

@ -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;