InputDispatcher: Allow spy window to receive entire gesture after pilfer
After a spy window pilfers pointers, it should be albe to receive any
new pointers within its touchable bounds.
Bug: 217376964
Test: atest inputflinger_tests
Change-Id: Iab8360f2f8e3db978cf6c68f19a538b28f7dfac1
diff --git a/services/inputflinger/dispatcher/InputDispatcher.cpp b/services/inputflinger/dispatcher/InputDispatcher.cpp
index a1ac229..dc46f30 100644
--- a/services/inputflinger/dispatcher/InputDispatcher.cpp
+++ b/services/inputflinger/dispatcher/InputDispatcher.cpp
@@ -1987,7 +1987,7 @@
TouchState tempTouchState;
if (const auto it = mTouchStatesByDisplay.find(displayId); it != mTouchStatesByDisplay.end()) {
oldState = &(it->second);
- tempTouchState.copyFrom(*oldState);
+ tempTouchState = *oldState;
}
bool isSplit = tempTouchState.split;
@@ -5510,9 +5510,9 @@
ALOGI("Channel %s is stealing touch from %s", requestingChannel->getName().c_str(),
canceledWindows.c_str());
- // Then clear the current touch state so we stop dispatching to them as well.
- state.split = false;
+ // Prevent the gesture from being sent to any other windows.
state.filterWindowsExcept(token);
+ state.preventNewTargets = true;
return OK;
}