Allow touch if some pointers are MT_TOOL_PALM
We would cancel all touch when we recevied MT_TOOL_PALM because it
becomes accidental touch, and that would break user gesture when
another non-palm pointer is still active.
- Send ACTION_POINTER_UP with AKEY_EVENT_FLAG_CANCELED when recevie
MT_TOOL_PALM if at least 2 pointers are active.
- Send ACTION_CANEL when receive MT_TOOL_PALM if only one pointer.
- Add test caseis for touch cancel scenarios, to test it would keep
dispatching non-palm event.
Test: atest inputflinger_tests
Bug: 137221719
Change-Id: Ife35a692c71e45159bfcc771317dff47fa764dda
diff --git a/services/inputflinger/tests/UinputDevice.cpp b/services/inputflinger/tests/UinputDevice.cpp
index 0659511..7fec2c8 100644
--- a/services/inputflinger/tests/UinputDevice.cpp
+++ b/services/inputflinger/tests/UinputDevice.cpp
@@ -179,6 +179,11 @@
injectEvent(EV_SYN, SYN_REPORT, 0);
}
+void UinputTouchScreen::sendPointerUp() {
+ sendTrackingId(0xffffffff);
+ injectEvent(EV_SYN, SYN_REPORT, 0);
+}
+
void UinputTouchScreen::sendUp() {
sendTrackingId(0xffffffff);
injectEvent(EV_KEY, BTN_TOUCH, 0);