From 040e6899941e9c285e99f370e42cd983f11e0b0f Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Thu, 20 Jan 2022 20:40:59 -0800 Subject: [PATCH] Remove IMMS#MSG_SHOW_IM_SUBTYPE_ENABLER This CL inlines InputMethodManagerService#MSG_SHOW_IM_SUBTYPE_ENABLER handler as it has always been executed from the calling thread. There should be no observable behavior change, except for the case InputMethodManagerService#getCurMethodLocked() was returning null and the client process was receiving NPE, which should no longer happen. Bug: 215609403 Test: presubmit Change-Id: I868af935ffdc794669c5cb5d0437c919533ac2ab --- .../server/inputmethod/InputMethodManagerService.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java index 25cb11f905a1b..bfe2c2a1c907d 100644 --- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java @@ -219,7 +219,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub } private static final int MSG_SHOW_IM_SUBTYPE_PICKER = 1; - private static final int MSG_SHOW_IM_SUBTYPE_ENABLER = 2; private static final int MSG_SHOW_IM_CONFIG = 3; private static final int MSG_UNBIND_INPUT = 1000; @@ -3694,8 +3693,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub if (!calledFromValidUserLocked()) { return; } - executeOrSendMessage(getCurMethodLocked(), mCaller.obtainMessageO( - MSG_SHOW_IM_SUBTYPE_ENABLER, inputMethodId)); + showInputMethodAndSubtypeEnabler(inputMethodId); } } @@ -4218,10 +4216,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub mMenuController.showInputMethodMenu(showAuxSubtypes, displayId); return true; - case MSG_SHOW_IM_SUBTYPE_ENABLER: - showInputMethodAndSubtypeEnabler((String)msg.obj); - return true; - case MSG_SHOW_IM_CONFIG: showConfigureInputMethods(); return true;