Remove the per display window handles when the display is removed.

When a dispaly is removed, need to call input dispatcher to remove the
per display window handles.

Bug: 188008394
Test: Enable multi display and launch apps, monitor dumpsys input.
Change-Id: I82aa19a1c8731b5896f17fb326775baf7681d258
This commit is contained in:
Chris Ye
2021-05-18 18:13:05 -07:00
parent a91e5123fc
commit b85faac612

View File

@@ -999,6 +999,7 @@ 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);
}
void NativeInputManager::setFocusedApplication(JNIEnv* env, int32_t displayId,