Loading services/core/java/com/android/server/InputMethodManagerService.java +11 −17 Original line number Diff line number Diff line Loading @@ -204,8 +204,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub static final int MSG_START_INPUT = 2000; static final int MSG_START_VR_INPUT = 2010; static final int MSG_ADD_CLIENT = 2980; static final int MSG_REMOVE_CLIENT = 2990; static final int MSG_UNBIND_CLIENT = 3000; static final int MSG_BIND_CLIENT = 3010; static final int MSG_SET_ACTIVE = 3020; Loading Loading @@ -1302,7 +1300,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub @Override public void onStart() { LocalServices.addService(InputMethodManagerInternal.class, new LocalServiceImpl(mService.mHandler)); new LocalServiceImpl(mService)); publishBinderService(Context.INPUT_METHOD_SERVICE, mService); } Loading Loading @@ -3394,15 +3392,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub return true; } // --------------------------------------------------------- case MSG_ADD_CLIENT: addClient((ClientState) msg.obj); return true; case MSG_REMOVE_CLIENT: removeClient((IInputMethodClient) msg.obj); return true; // --------------------------------------------------------- case MSG_UNBIND_CLIENT: Loading Loading @@ -4395,23 +4384,28 @@ public class InputMethodManagerService extends IInputMethodManager.Stub } private static final class LocalServiceImpl extends InputMethodManagerInternal { @NonNull private final InputMethodManagerService mService; @NonNull private final Handler mHandler; LocalServiceImpl(@NonNull final Handler handler) { mHandler = handler; LocalServiceImpl(@NonNull InputMethodManagerService service) { mService = service; mHandler = service.mHandler; } @Override public void addClient(IInputMethodClient client, IInputContext inputContext, int uid, int pid) { mHandler.sendMessage(mHandler.obtainMessage(MSG_ADD_CLIENT, new ClientState(client, inputContext, uid, pid))); // Work around Bug 113877122: We need to handle this synchronously. Otherwise, some // IMM binder calls from the client process before we register this client. mService.addClient(new ClientState(client, inputContext, uid, pid)); } @Override public void removeClient(IInputMethodClient client) { mHandler.sendMessage(mHandler.obtainMessage(MSG_REMOVE_CLIENT, client)); // Handle this synchronously to be consistent with addClient(). mService.removeClient(client); } @Override Loading services/core/java/com/android/server/inputmethod/InputMethodManagerInternal.java +8 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,10 @@ public abstract class InputMethodManagerInternal { /** * Called by the window manager service when a client process is being attached to the window * manager service. * * <p>The caller must not have WindowManagerService lock. This method internally acquires * InputMethodManagerService lock.</p> * * @param client {@link android.os.Binder} proxy that is associated with the singleton instance * of {@link android.view.inputmethod.InputMethodManager} that runs on the client * process Loading @@ -42,6 +46,10 @@ public abstract class InputMethodManagerInternal { /** * Called by the window manager service when a client process is being attached to the window * manager service. * * <p>The caller must not have WindowManagerService lock. This method internally acquires * InputMethodManagerService lock.</p> * * @param client {@link android.os.Binder} proxy that is associated with the singleton instance * of {@link android.view.inputmethod.InputMethodManager} that runs on the client * process Loading Loading
services/core/java/com/android/server/InputMethodManagerService.java +11 −17 Original line number Diff line number Diff line Loading @@ -204,8 +204,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub static final int MSG_START_INPUT = 2000; static final int MSG_START_VR_INPUT = 2010; static final int MSG_ADD_CLIENT = 2980; static final int MSG_REMOVE_CLIENT = 2990; static final int MSG_UNBIND_CLIENT = 3000; static final int MSG_BIND_CLIENT = 3010; static final int MSG_SET_ACTIVE = 3020; Loading Loading @@ -1302,7 +1300,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub @Override public void onStart() { LocalServices.addService(InputMethodManagerInternal.class, new LocalServiceImpl(mService.mHandler)); new LocalServiceImpl(mService)); publishBinderService(Context.INPUT_METHOD_SERVICE, mService); } Loading Loading @@ -3394,15 +3392,6 @@ public class InputMethodManagerService extends IInputMethodManager.Stub return true; } // --------------------------------------------------------- case MSG_ADD_CLIENT: addClient((ClientState) msg.obj); return true; case MSG_REMOVE_CLIENT: removeClient((IInputMethodClient) msg.obj); return true; // --------------------------------------------------------- case MSG_UNBIND_CLIENT: Loading Loading @@ -4395,23 +4384,28 @@ public class InputMethodManagerService extends IInputMethodManager.Stub } private static final class LocalServiceImpl extends InputMethodManagerInternal { @NonNull private final InputMethodManagerService mService; @NonNull private final Handler mHandler; LocalServiceImpl(@NonNull final Handler handler) { mHandler = handler; LocalServiceImpl(@NonNull InputMethodManagerService service) { mService = service; mHandler = service.mHandler; } @Override public void addClient(IInputMethodClient client, IInputContext inputContext, int uid, int pid) { mHandler.sendMessage(mHandler.obtainMessage(MSG_ADD_CLIENT, new ClientState(client, inputContext, uid, pid))); // Work around Bug 113877122: We need to handle this synchronously. Otherwise, some // IMM binder calls from the client process before we register this client. mService.addClient(new ClientState(client, inputContext, uid, pid)); } @Override public void removeClient(IInputMethodClient client) { mHandler.sendMessage(mHandler.obtainMessage(MSG_REMOVE_CLIENT, client)); // Handle this synchronously to be consistent with addClient(). mService.removeClient(client); } @Override Loading
services/core/java/com/android/server/inputmethod/InputMethodManagerInternal.java +8 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,10 @@ public abstract class InputMethodManagerInternal { /** * Called by the window manager service when a client process is being attached to the window * manager service. * * <p>The caller must not have WindowManagerService lock. This method internally acquires * InputMethodManagerService lock.</p> * * @param client {@link android.os.Binder} proxy that is associated with the singleton instance * of {@link android.view.inputmethod.InputMethodManager} that runs on the client * process Loading @@ -42,6 +46,10 @@ public abstract class InputMethodManagerInternal { /** * Called by the window manager service when a client process is being attached to the window * manager service. * * <p>The caller must not have WindowManagerService lock. This method internally acquires * InputMethodManagerService lock.</p> * * @param client {@link android.os.Binder} proxy that is associated with the singleton instance * of {@link android.view.inputmethod.InputMethodManager} that runs on the client * process Loading