diff --git a/power/power-mode.cpp b/power/power-mode.cpp index abc47fe..cad725e 100644 --- a/power/power-mode.cpp +++ b/power/power-mode.cpp @@ -9,15 +9,6 @@ #include #include -// defines from drivers/input/touchscreen/xiaomi/xiaomi_touch.h -#define SET_CUR_VALUE 0 -#define Touch_Doubletap_Mode 14 - -#define TOUCH_DEV_PATH "/dev/xiaomi-touch" -#define TOUCH_ID 0 -#define TOUCH_MAGIC 0x5400 -#define TOUCH_IOC_SETMODE TOUCH_MAGIC + SET_CUR_VALUE - namespace aidl { namespace android { namespace hardware { @@ -40,10 +31,7 @@ bool isDeviceSpecificModeSupported(Mode type, bool* _aidl_return) { bool setDeviceSpecificMode(Mode type, bool enabled) { switch (type) { case Mode::DOUBLE_TAP_TO_WAKE: { - int fd = open(TOUCH_DEV_PATH, O_RDWR); - int arg[3] = {TOUCH_ID, Touch_Doubletap_Mode, enabled ? 1 : 0}; - ioctl(fd, TOUCH_IOC_SETMODE, &arg); - close(fd); + ::android::base::WriteStringToFile(enabled ? "cc1" : "cc2", TAP_TO_WAKE_NODE, true); return true; } default: diff --git a/rootdir/etc/init/hw/init.project.rc b/rootdir/etc/init/hw/init.project.rc index be38c25..c9f57e8 100644 --- a/rootdir/etc/init/hw/init.project.rc +++ b/rootdir/etc/init/hw/init.project.rc @@ -6,9 +6,9 @@ on init mkdir /mnt/media_rw/usbotg 0700 media_rw media_rw mkdir /storage/usbotg 0700 root root - # Set xiaomi touch permissions - chown system system /dev/xiaomi-touch - chmod 0660 /dev/xiaomi-touch + # Set gesture touch permissions + chown system system /proc/gesture_function + chmod 0660 /proc/gesture_function on post-fs-data