From 11c5c9cd8e1b15c1c5ee116bf24c598198beb182 Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Fri, 21 Jan 2022 07:42:17 -0800 Subject: [PATCH] Remove IMMS#MSG_START_HANDWRITING This CL inlines InputMethodManagerService#MSG_START_HANDWRITING handler as it has always been executed from the calling thread. There should be no observable behavior change. Bug: 215609403 Test: presubmit Change-Id: Ia28f7ed55e59d9cfda98338a2a94550a6a477102 --- .../inputmethod/InputMethodManagerService.java | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java index acf88af730a14..5375cdcce282c 100644 --- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java @@ -225,7 +225,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub private static final int MSG_REMOVE_IME_SURFACE = 1060; private static final int MSG_REMOVE_IME_SURFACE_FROM_WINDOW = 1061; private static final int MSG_UPDATE_IME_WINDOW_STATUS = 1070; - private static final int MSG_START_HANDWRITING = 1100; private static final int MSG_START_INPUT = 2000; @@ -3100,9 +3099,13 @@ public class InputMethodManagerService extends IInputMethodManager.Stub return; } if (DEBUG) Slog.v(TAG, "Client requesting Stylus Handwriting to be started"); - if (getCurMethodLocked() != null) { - executeOrSendMessage(getCurMethodLocked(), mCaller.obtainMessageIO( - MSG_START_HANDWRITING, ++mHwRequestId, getCurMethodLocked())); + final IInputMethod curMethod = getCurMethodLocked(); + if (curMethod != null) { + try { + curMethod.canStartStylusHandwriting(++mHwRequestId); + } catch (RemoteException e) { + Slog.w(TAG, "RemoteException calling canStartStylusHandwriting(): ", e); + } } } finally { Binder.restoreCallingIdentity(ident); @@ -4420,13 +4423,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub } return true; } - case MSG_START_HANDWRITING: - try { - (((IInputMethod) msg.obj)).canStartStylusHandwriting(msg.arg1); - } catch (RemoteException e) { - Slog.w(TAG, "RemoteException calling canStartStylusHandwriting(): ", e); - } - return true; } return false; }