From 79cad7881cc781adbc0217a4e825a1bd5f5a414b Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Thu, 20 Jan 2022 20:41:41 -0800 Subject: [PATCH] Remove IMMS#MSG_UNBIND_INPUT This CL inlines InputMethodManagerService#MSG_UNBIND_INPUT handler as it has always been executed from the calling thread. There should be no observable behavior change. Bug: 215609403 Test: presubmit Change-Id: Ic0bc0768bf6d42b84c2e36353c822f748508e838 --- .../InputMethodManagerService.java | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java index bfe2c2a1c907d..16794217bbc75 100644 --- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java @@ -221,7 +221,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub private static final int MSG_SHOW_IM_SUBTYPE_PICKER = 1; private static final int MSG_SHOW_IM_CONFIG = 3; - private static final int MSG_UNBIND_INPUT = 1000; private static final int MSG_BIND_INPUT = 1010; private static final int MSG_SHOW_SOFT_INPUT = 1020; private static final int MSG_HIDE_SOFT_INPUT = 1030; @@ -2201,8 +2200,11 @@ public class InputMethodManagerService extends IInputMethodManager.Stub mBoundToMethod = false; IInputMethod curMethod = getCurMethodLocked(); if (curMethod != null) { - executeOrSendMessage(curMethod, mCaller.obtainMessageO( - MSG_UNBIND_INPUT, curMethod)); + try { + curMethod.unbindInput(); + } catch (RemoteException e) { + // There is nothing interesting about the method dying. + } } } mCurClient = null; @@ -2248,8 +2250,11 @@ public class InputMethodManagerService extends IInputMethodManager.Stub mBoundToMethod = false; IInputMethod curMethod = getCurMethodLocked(); if (curMethod != null) { - executeOrSendMessage(curMethod, mCaller.obtainMessageO( - MSG_UNBIND_INPUT, curMethod)); + try { + curMethod.unbindInput(); + } catch (RemoteException e) { + // There is nothing interesting about the method dying. + } } } @@ -4222,13 +4227,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub // --------------------------------------------------------- - case MSG_UNBIND_INPUT: - try { - ((IInputMethod)msg.obj).unbindInput(); - } catch (RemoteException e) { - // There is nothing interesting about the method dying. - } - return true; case MSG_BIND_INPUT: args = (SomeArgs)msg.obj; try {