From b85faac61272a5de87de8a1511405312a767488f Mon Sep 17 00:00:00 2001 From: Chris Ye Date: Tue, 18 May 2021 18:13:05 -0700 Subject: [PATCH] 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 --- .../core/jni/com_android_server_input_InputManagerService.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/services/core/jni/com_android_server_input_InputManagerService.cpp b/services/core/jni/com_android_server_input_InputManagerService.cpp index cca62b9a7274e..9aefa92c4445a 100644 --- a/services/core/jni/com_android_server_input_InputManagerService.cpp +++ b/services/core/jni/com_android_server_input_InputManagerService.cpp @@ -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> windowHandles; mInputManager->getDispatcher()->setInputWindows({{displayId, windowHandles}}); + mInputManager->getDispatcher()->setFocusedApplication(displayId, nullptr); } void NativeInputManager::setFocusedApplication(JNIEnv* env, int32_t displayId,