From 9693d40ed15336cb03bf414ff4e3495ed038ca51 Mon Sep 17 00:00:00 2001 From: Prabir Pradhan Date: Wed, 5 Apr 2023 23:54:06 +0000 Subject: [PATCH 1/2] Notify InputListener when there an changes to input devices There are now more than one input listener stages that need to know when the devices change. Notify listeners directly instead of routing it through the policy. Bug: 275726706 Test: atest inputflinger_tests Change-Id: I61549260e538bfd32e98c78c631b0142b85136df --- .../core/jni/com_android_server_input_InputManagerService.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/services/core/jni/com_android_server_input_InputManagerService.cpp b/services/core/jni/com_android_server_input_InputManagerService.cpp index d64b5a17b33d9..553ea0d87c8e7 100644 --- a/services/core/jni/com_android_server_input_InputManagerService.cpp +++ b/services/core/jni/com_android_server_input_InputManagerService.cpp @@ -760,7 +760,6 @@ void NativeInputManager::ensureSpriteControllerLocked() REQUIRES(mLock) { void NativeInputManager::notifyInputDevicesChanged(const std::vector& inputDevices) { ATRACE_CALL(); - mInputManager->getBlocker().notifyInputDevicesChanged(inputDevices); JNIEnv* env = jniEnv(); size_t count = inputDevices.size(); From 7a82f9ab2c566fef65bab717f558b633a7715a79 Mon Sep 17 00:00:00 2001 From: Prabir Pradhan Date: Thu, 6 Apr 2023 00:04:15 +0000 Subject: [PATCH 2/2] Dump all native input components from InputManager This makes it so that we don't have to expose all native components to NativeInputManager just to dump them. This also means we no longer have to expose the UnwantedInteractionBlocker to NativeInputManager. Bug: 275726706 Test: build Change-Id: Ibf12b6774e3f8e2bc9cbcb54706030aa70ad4e59 --- .../com_android_server_input_InputManagerService.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/services/core/jni/com_android_server_input_InputManagerService.cpp b/services/core/jni/com_android_server_input_InputManagerService.cpp index 553ea0d87c8e7..1510bd037a548 100644 --- a/services/core/jni/com_android_server_input_InputManagerService.cpp +++ b/services/core/jni/com_android_server_input_InputManagerService.cpp @@ -485,17 +485,7 @@ void NativeInputManager::dump(std::string& dump) { } dump += "\n"; - mInputManager->getReader().dump(dump); - dump += "\n"; - - mInputManager->getBlocker().dump(dump); - dump += "\n"; - - mInputManager->getProcessor().dump(dump); - dump += "\n"; - - mInputManager->getDispatcher().dump(dump); - dump += "\n"; + mInputManager->dump(dump); } bool NativeInputManager::checkAndClearExceptionFromCallback(JNIEnv* env, const char* methodName) {