Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d6821a11 authored by Ethan Yonker's avatar Ethan Yonker Committed by Dees Troy
Browse files

Add TW_IGNORE_ABS_MT_TRACKING_ID

Fixes touch on Oppo R7 Plus

Oppo R7 Plus, when recovery is flashed and booted from the actual
recovery partition, the digitizer sends some extra touch data for
up to 10 different touch slots even if no actual touch is present
for those slots (ABS_MT_SLOT). This patch allows TWRP to handle
touch data properly for this device and maybe others.

Change-Id: I8f9171b605566788b674b3d4d96bd9f2f65736c2
parent 89583ef0
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -97,6 +97,10 @@ ifeq ($(TW_IGNORE_MT_POSITION_0), true)
LOCAL_CFLAGS += -DTW_IGNORE_MT_POSITION_0
endif

ifeq ($(TW_IGNORE_ABS_MT_TRACKING_ID), true)
LOCAL_CFLAGS += -DTW_IGNORE_ABS_MT_TRACKING_ID
endif

ifneq ($(TW_INPUT_BLACKLIST),)
  LOCAL_CFLAGS += -DTW_INPUT_BLACKLIST=$(TW_INPUT_BLACKLIST)
endif
+10 −0
Original line number Diff line number Diff line
@@ -545,6 +545,12 @@ static int vk_modify(struct ev *e, struct input_event *ev)
            break;

        case ABS_MT_TRACKING_ID: //39
#ifdef TW_IGNORE_ABS_MT_TRACKING_ID
#ifdef _EVENT_LOGGING
            printf("EV: %s => EV_ABS ABS_MT_TRACKING_ID %d ignored\n", e->deviceName, ev->value);
#endif
            return 1;
#endif
            if (ev->value < 0) {
                e->mt_p.x = 0;
                e->mt_p.y = 0;
@@ -581,6 +587,10 @@ static int vk_modify(struct ev *e, struct input_event *ev)
            printf("EV: %s => EV_ABS ABS_MT_DISTANCE %d\n", e->deviceName, ev->value);
			return 1;
            break;
        case ABS_MT_SLOT:
            printf("EV: %s => ABS_MT_SLOT %d\n", e->deviceName, ev->value);
			return 1;
			break;
#endif

        default: