summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Vishnu Nair <vishnun@google.com> 2021-06-18 17:30:51 -0700
committer Vishnu Nair <vishnun@google.com> 2021-06-18 17:30:51 -0700
commitb3ae628daf413b155b5515856041c31f04a68598 (patch)
tree0ad9c6d31a863b74c0f7c2d86836f26fa1a1640f
parentccc98b8d6e6498ea4fffc3ca99a7681435c9bed1 (diff)
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
-rw-r--r--services/core/jni/com_android_server_input_InputManagerService.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/services/core/jni/com_android_server_input_InputManagerService.cpp b/services/core/jni/com_android_server_input_InputManagerService.cpp
index e13ef99e17dd..a94ad4ad7ef2 100644
--- a/services/core/jni/com_android_server_input_InputManagerService.cpp
+++ b/services/core/jni/com_android_server_input_InputManagerService.cpp
@@ -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,