Remove IMMS#MSG_INITIALIZE_IME

This CL inlines

  InputMethodManagerService#MSG_INITIALIZE_IME

handler as it has always been executed from the calling thread.

There should be no observable behavior change.

Bug: 215609403
Test: presubmit
Change-Id: If2806df9cef00cbe7612085b6afa7800f5d9d930
This commit is contained in:
Yohei Yukawa
2022-01-21 07:41:14 -08:00
parent 5a2018e61b
commit dd333ffc23
2 changed files with 14 additions and 24 deletions

View File

@@ -309,8 +309,8 @@ final class InputMethodBindingController {
if (DEBUG) Slog.v(TAG, "Initiating attach with token: " + mCurToken);
final InputMethodInfo info = mMethodMap.get(mSelectedMethodId);
mSupportsStylusHw = info.supportsStylusHandwriting();
mService.executeOrSendInitializeIme(mCurMethod, mCurToken,
info.getConfigChanges(), mSupportsStylusHw);
mService.initializeImeLocked(mCurMethod, mCurToken, info.getConfigChanges(),
mSupportsStylusHw);
mService.scheduleNotifyImeUidToAudioService(mCurMethodUid);
mService.reRequestCurrentClientSessionLocked();
}

View File

@@ -222,7 +222,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
private static final int MSG_SHOW_IM_CONFIG = 3;
private static final int MSG_HIDE_CURRENT_INPUT_METHOD = 1035;
private static final int MSG_INITIALIZE_IME = 1040;
private static final int MSG_CREATE_SESSION = 1050;
private static final int MSG_REMOVE_IME_SURFACE = 1060;
private static final int MSG_REMOVE_IME_SURFACE_FROM_WINDOW = 1061;
@@ -2519,11 +2518,19 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
}
}
@AnyThread
void executeOrSendInitializeIme(@NonNull IInputMethod inputMethod, @NonNull IBinder token,
@GuardedBy("ImfLock.class")
void initializeImeLocked(@NonNull IInputMethod inputMethod, @NonNull IBinder token,
@android.content.pm.ActivityInfo.Config int configChanges, boolean supportStylusHw) {
executeOrSendMessage(inputMethod, mCaller.obtainMessageIOOO(MSG_INITIALIZE_IME,
configChanges, inputMethod, token, supportStylusHw));
if (DEBUG) {
Slog.v(TAG, "Sending attach of token: " + token + " for display: "
+ mCurTokenDisplayId);
}
try {
inputMethod.initializeInternal(token,
new InputMethodPrivilegedOperationsImpl(this, token), configChanges,
supportStylusHw);
} catch (RemoteException e) {
}
}
@AnyThread
@@ -4248,23 +4255,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
}
return true;
case MSG_INITIALIZE_IME:
args = (SomeArgs)msg.obj;
try {
if (DEBUG) {
synchronized (ImfLock.class) {
Slog.v(TAG, "Sending attach of token: " + args.arg2 + " for display: "
+ mCurTokenDisplayId);
}
}
final IBinder token = (IBinder) args.arg2;
((IInputMethod) args.arg1).initializeInternal(token,
new InputMethodPrivilegedOperationsImpl(this, token),
msg.arg1, (boolean) args.arg3);
} catch (RemoteException e) {
}
args.recycle();
return true;
case MSG_CREATE_SESSION: {
args = (SomeArgs)msg.obj;
IInputMethod method = (IInputMethod)args.arg1;