From 1f3edaab039be1f6729859b62b7919ba09cec374 Mon Sep 17 00:00:00 2001 From: Yohei Yukawa Date: Mon, 17 Jan 2022 15:00:05 -0800 Subject: Inline InputMethodManagerService.MethodCallback This CL inlines InputMethodManagerService.MethodCallback as it is semantically a single-method callback. This is a mechanical refactoring. There should be no behavior change. Bug: 192412909 Test: presubmit Change-Id: I3d110b905cc9b461d228735c2c5824ed54dceb08 --- .../inputmethod/InputMethodManagerService.java | 35 +++++++--------------- 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java index 9dfa142cea1e..ec49b4768b74 100644 --- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java +++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java @@ -1464,29 +1464,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub } } - private static final class MethodCallback extends IInputSessionCallback.Stub { - private final InputMethodManagerService mParentIMMS; - private final IInputMethod mMethod; - private final InputChannel mChannel; - - MethodCallback(InputMethodManagerService imms, IInputMethod method, - InputChannel channel) { - mParentIMMS = imms; - mMethod = method; - mChannel = channel; - } - - @Override - public void sessionCreated(IInputMethodSession session) { - final long ident = Binder.clearCallingIdentity(); - try { - mParentIMMS.onSessionCreated(mMethod, session, mChannel); - } finally { - Binder.restoreCallingIdentity(ident); - } - } - } - private static final class UserSwitchHandlerTask implements Runnable { final InputMethodManagerService mService; @@ -2607,7 +2584,17 @@ public class InputMethodManagerService extends IInputMethodManager.Stub IInputMethod curMethod = getCurMethodLocked(); executeOrSendMessage(curMethod, mCaller.obtainMessageOOO( MSG_CREATE_SESSION, curMethod, channels[1], - new MethodCallback(this, curMethod, channels[0]))); + new IInputSessionCallback.Stub() { + @Override + public void sessionCreated(IInputMethodSession session) { + final long ident = Binder.clearCallingIdentity(); + try { + onSessionCreated(curMethod, session, channels[0]); + } finally { + Binder.restoreCallingIdentity(ident); + } + } + })); } } -- cgit v1.2.3-59-g8ed1b