Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b3ae628d authored by Vishnu Nair's avatar Vishnu Nair
Browse files

FocusResolver: Clean up focus requests and results when a display is removed

Prevents FocusResolver from leaking focus requests and results as
displays are added and removed.

Test: atest inputflinger_tests
Fixes: 188008394
Change-Id: I09d0e39615ed09958801f126d33742d0a634949a
parent ccc98b8d
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -997,10 +997,7 @@ void NativeInputManager::getDispatcherConfiguration(InputDispatcherConfiguration
}

void NativeInputManager::displayRemoved(JNIEnv* env, int32_t displayId) {
    // Set an empty list to remove all handles from the specific display.
    std::vector<sp<InputWindowHandle>> windowHandles;
    mInputManager->getDispatcher()->setInputWindows({{displayId, windowHandles}});
    mInputManager->getDispatcher()->setFocusedApplication(displayId, nullptr);
    mInputManager->getDispatcher()->displayRemoved(displayId);
}

void NativeInputManager::setFocusedApplication(JNIEnv* env, int32_t displayId,