Fix focused application handle. (DO NOT MERGE)
Fix a bug where we were always setting the focused application
handle to NULL. This broke ANR processing while starting
applications and caused input events to be dropped while
starting applications.
Bug: 4174573
Change-Id: Ice7ce3a2b65219568a8227fc1383bafb294666b5
diff --git a/services/jni/com_android_server_InputManager.cpp b/services/jni/com_android_server_InputManager.cpp
index a86b5bd..3fb76e4 100644
--- a/services/jni/com_android_server_InputManager.cpp
+++ b/services/jni/com_android_server_InputManager.cpp
@@ -606,6 +606,7 @@
android_server_InputApplication_toNative(env, applicationObj, &application);
if (application.inputApplicationHandle != NULL) {
mInputManager->getDispatcher()->setFocusedApplication(&application);
+ return;
}
}
mInputManager->getDispatcher()->setFocusedApplication(NULL);