Reset fingers and buttons in GestureConverter::reset
Previously, calling reset didn't really reset anything, which could have
resulted in an inconsistent event stream (e.g. fake fingers that were
put down but never raised).
Bug: 251196347
Bug: 259547750
Test: atest inputflinger_tests
Test: scroll, swipe, and pinch on a touchpad, check dispatched events
Change-Id: If95cde96f1974bf7c98009c68e2637686bff96cc
diff --git a/services/inputflinger/reader/mapper/TouchpadInputMapper.cpp b/services/inputflinger/reader/mapper/TouchpadInputMapper.cpp
index 4c56b05..5e63e48 100644
--- a/services/inputflinger/reader/mapper/TouchpadInputMapper.cpp
+++ b/services/inputflinger/reader/mapper/TouchpadInputMapper.cpp
@@ -256,8 +256,9 @@
std::list<NotifyArgs> TouchpadInputMapper::reset(nsecs_t when) {
mStateConverter.reset();
- mGestureConverter.reset();
- return InputMapper::reset(when);
+ std::list<NotifyArgs> out = mGestureConverter.reset(when);
+ out += InputMapper::reset(when);
+ return out;
}
std::list<NotifyArgs> TouchpadInputMapper::process(const RawEvent* rawEvent) {