Bladeren bron

sm8450-common: Enable single_tap sensor and set permissions for touch sensors

Change-Id: I777ed71ecc5dc502182567bc7e1166605251af93
Arian 9 maanden geleden
bovenliggende
commit
7004d0df09

+ 3 - 0
overlay/FrameworksResXiaomi/res/values/config.xml

@@ -10,6 +10,9 @@
     <!-- Doze: should the TYPE_PICK_UP_GESTURE sensor be used as a pulse signal. -->
     <bool name="config_dozePulsePickup">true</bool>
 
+    <!-- Type of the tap sensor. Empty if tap is not supported. -->
+    <string name="config_dozeTapSensorType" translatable="false">org.lineageos.sensor.single_tap</string>
+
     <!-- Power Management: Specifies whether to decouple the auto-suspend state of the
          device from the display on/off state.
 

+ 3 - 0
properties/vendor.prop

@@ -202,6 +202,9 @@ ro.vendor.radio.build_profile=u-stable
 # RCS
 persist.vendor.rcs.singlereg.feature=1
 
+# Sensors
+ro.vendor.sensors.xiaomi.single_tap=true
+
 # SSR
 persist.vendor.ssr.restart_level=ALL_ENABLE
 

+ 6 - 0
rootdir/etc/init.touch_report.rc

@@ -103,6 +103,12 @@ on boot
     chmod 0664 /sys/class/touch/touch_dev/abnormal_event
     chown system system /sys/class/touch/touch_dev/abnormal_event
 
+    chown system system /sys/class/touch/touch_dev/fod_longpress_gesture_enabled
+    chmod 0660 /sys/class/touch/touch_dev/fod_longpress_gesture_enabled
+
+    chown system system /sys/class/touch/touch_dev/gesture_single_tap_enabled
+    chmod 0660 /sys/class/touch/touch_dev/gesture_single_tap_enabled
+
 service touch_report /vendor/bin/touch_report
     class hal
     user system

+ 5 - 0
sepolicy/vendor/genfs_contexts

@@ -6,6 +6,11 @@ genfscon sysfs /devices/platform/soc/soc:xm_battmngr/power_supply/usb u:object_r
 # Fingerprint
 genfscon sysfs /devices/platform/soc/soc:fingerprint_fpc u:object_r:vendor_sysfs_fingerprint:s0
 
+# Sensors
+genfscon sysfs /devices/virtual/touch/touch_dev/fod_longpress_gesture_enabled u:object_r:vendor_sysfs_sensors:s0
+genfscon sysfs /devices/virtual/touch/touch_dev/gesture_single_tap_enabled u:object_r:vendor_sysfs_sensors:s0
+genfscon sysfs /devices/virtual/touch/touch_dev/gesture_single_tap_state u:object_r:vendor_sysfs_sensors:s0
+
 # Suspend
 genfscon sysfs /devices/platform/soc/3000000.remoteproc-adsp/remoteproc/remoteproc2/3000000.remoteproc-adsp:glink-edge/3000000.remoteproc-adsp:glink-edge.adsp_apps.-1.-1/wakeup u:object_r:sysfs_wakeup:s0
 genfscon sysfs /devices/platform/soc/884000.i2c/i2c-3/3-005a/wakeup u:object_r:sysfs_wakeup:s0