Prevent processing touch after receiving an invalid tracking id
Touch driver would send an INVALID_TRACKING_ID value when touch
released from touch screen. That tells input framework should send an
up or pointer up event and stop processing the pointer, so if any
unexpected data is also updating from driver side, we have to prevent
it becomes as a valid pointer.
Bug: 190460965
Bug: 190144579
Bug: 190860244
Bug: 188375341
Test: atest inputflingger_tests
Change-Id: Iee15ab7f7edd19f0cfe1ee27dcaf17c301e8f780
diff --git a/services/inputflinger/reader/mapper/TouchInputMapper.cpp b/services/inputflinger/reader/mapper/TouchInputMapper.cpp
index 6050238..962d8d2 100644
--- a/services/inputflinger/reader/mapper/TouchInputMapper.cpp
+++ b/services/inputflinger/reader/mapper/TouchInputMapper.cpp
@@ -1471,6 +1471,13 @@
next.rawPointerData.canceledIdBits.value);
#endif
+ if (!next.rawPointerData.touchingIdBits.isEmpty() &&
+ !next.rawPointerData.hoveringIdBits.isEmpty() &&
+ last.rawPointerData.hoveringIdBits != next.rawPointerData.hoveringIdBits) {
+ ALOGI("Multi-touch contains some hovering ids 0x%08x",
+ next.rawPointerData.hoveringIdBits.value);
+ }
+
processRawTouches(false /*timeout*/);
}