Revert "InputReader: Clear the multi-touch state when the device is reset"
This reverts commit f8d9e440558f4dfb13ef41e23f41f30092297582.
Reason for revert: b/316593362
Test: atest inputflinger_tests
Bug: b/316593362
Change-Id: Idfbf2091febba12c0e92a39bedb56b1058b85047
diff --git a/services/inputflinger/reader/mapper/MultiTouchInputMapper.cpp b/services/inputflinger/reader/mapper/MultiTouchInputMapper.cpp
index 5a74a42..2dd05f5 100644
--- a/services/inputflinger/reader/mapper/MultiTouchInputMapper.cpp
+++ b/services/inputflinger/reader/mapper/MultiTouchInputMapper.cpp
@@ -35,10 +35,12 @@
MultiTouchInputMapper::~MultiTouchInputMapper() {}
std::list<NotifyArgs> MultiTouchInputMapper::reset(nsecs_t when) {
- // TODO(b/291626046): Sync the MT state with the kernel using EVIOCGMTSLOTS.
- mMultiTouchMotionAccumulator.reset(getDeviceContext());
- mPointerIdBits.clear();
-
+ // The evdev multi-touch protocol does not allow userspace applications to query the initial or
+ // current state of the pointers at any time. This means if we clear our accumulated state when
+ // resetting the input mapper, there's no way to rebuild the full initial state of the pointers.
+ // We can only wait for updates to all the pointers and axes. Rather than clearing the state and
+ // rebuilding the state from scratch, we work around this kernel API limitation by never
+ // fully clearing any state specific to the multi-touch protocol.
return TouchInputMapper::reset(when);
}