Loading services/inputflinger/dispatcher/InputDispatcher.cpp +8 −2 Original line number Diff line number Diff line Loading @@ -1266,14 +1266,20 @@ void InputDispatcher::dispatchPointerCaptureChangedLocked( // Disable Pointer Capture token = mWindowTokenWithPointerCapture; mWindowTokenWithPointerCapture = nullptr; if (mFocusedWindowRequestedPointerCapture) { mFocusedWindowRequestedPointerCapture = false; setPointerCaptureLocked(false); } } auto channel = getInputChannelLocked(token); if (channel == nullptr) { // Window has gone away, clean up Pointer Capture state. mWindowTokenWithPointerCapture = nullptr; if (mFocusedWindowRequestedPointerCapture) { mFocusedWindowRequestedPointerCapture = false; setPointerCaptureLocked(false); } return; } InputTarget target; Loading services/inputflinger/tests/InputDispatcher_test.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -4172,6 +4172,7 @@ TEST_F(InputDispatcherPointerCaptureTests, UnexpectedStateChangeDisablesPointerC notifyPointerCaptureChanged(true); // Ensure that Pointer Capture is disabled. mFakePolicy->waitForSetPointerCapture(false); mWindow->consumeCaptureEvent(false); mWindow->assertNoEvents(); } Loading Loading
services/inputflinger/dispatcher/InputDispatcher.cpp +8 −2 Original line number Diff line number Diff line Loading @@ -1266,14 +1266,20 @@ void InputDispatcher::dispatchPointerCaptureChangedLocked( // Disable Pointer Capture token = mWindowTokenWithPointerCapture; mWindowTokenWithPointerCapture = nullptr; if (mFocusedWindowRequestedPointerCapture) { mFocusedWindowRequestedPointerCapture = false; setPointerCaptureLocked(false); } } auto channel = getInputChannelLocked(token); if (channel == nullptr) { // Window has gone away, clean up Pointer Capture state. mWindowTokenWithPointerCapture = nullptr; if (mFocusedWindowRequestedPointerCapture) { mFocusedWindowRequestedPointerCapture = false; setPointerCaptureLocked(false); } return; } InputTarget target; Loading
services/inputflinger/tests/InputDispatcher_test.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -4172,6 +4172,7 @@ TEST_F(InputDispatcherPointerCaptureTests, UnexpectedStateChangeDisablesPointerC notifyPointerCaptureChanged(true); // Ensure that Pointer Capture is disabled. mFakePolicy->waitForSetPointerCapture(false); mWindow->consumeCaptureEvent(false); mWindow->assertNoEvents(); } Loading