File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -970,14 +970,17 @@ void InputDispatcher::resumeAfterTargetsNotReadyTimeoutLocked(nsecs_t newTimeout
970970 // Give up.
971971 mInputTargetWaitTimeoutExpired = true ;
972972
973- // Release the touch targets.
974- mTouchState .reset ();
975-
976973 // Input state will not be realistic. Mark it out of sync.
977974 if (inputChannel.get ()) {
978975 ssize_t connectionIndex = getConnectionIndexLocked (inputChannel);
979976 if (connectionIndex >= 0 ) {
980977 sp<Connection> connection = mConnectionsByFd .valueAt (connectionIndex);
978+ sp<InputWindowHandle> windowHandle = connection->inputWindowHandle ;
979+
980+ if (windowHandle != NULL ) {
981+ mTouchState .removeWindow (windowHandle);
982+ }
983+
981984 if (connection->status == Connection::STATUS_NORMAL) {
982985 CancelationOptions options (CancelationOptions::CANCEL_ALL_EVENTS,
983986 " application not responding" );
@@ -4146,6 +4149,15 @@ void InputDispatcher::TouchState::addOrUpdateWindow(const sp<InputWindowHandle>&
41464149 touchedWindow.pointerIds = pointerIds;
41474150}
41484151
4152+ void InputDispatcher::TouchState::removeWindow (const sp<InputWindowHandle>& windowHandle) {
4153+ for (size_t i = 0 ; i < windows.size (); i++) {
4154+ if (windows.itemAt (i).windowHandle == windowHandle) {
4155+ windows.removeAt (i);
4156+ return ;
4157+ }
4158+ }
4159+ }
4160+
41494161void InputDispatcher::TouchState::filterNonAsIsTouchWindows () {
41504162 for (size_t i = 0 ; i < windows.size (); ) {
41514163 TouchedWindow& window = windows.editItemAt (i);
Original file line number Diff line number Diff line change @@ -926,6 +926,7 @@ class InputDispatcher : public InputDispatcherInterface {
926926 void copyFrom (const TouchState& other);
927927 void addOrUpdateWindow (const sp<InputWindowHandle>& windowHandle,
928928 int32_t targetFlags, BitSet32 pointerIds);
929+ void removeWindow (const sp<InputWindowHandle>& windowHandle);
929930 void filterNonAsIsTouchWindows ();
930931 sp<InputWindowHandle> getFirstForegroundWindowHandle () const ;
931932 bool isSlippery () const ;
You can’t perform that action at this time.
0 commit comments