Loading core/java/android/inputmethodservice/IInputMethodWrapper.java +25 −9 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ class IInputMethodWrapper extends IInputMethod.Stub private static final int DO_SET_INPUT_CONTEXT = 20; private static final int DO_UNSET_INPUT_CONTEXT = 30; private static final int DO_START_INPUT = 32; private static final int DO_RESTART_INPUT = 34; private static final int DO_CREATE_SESSION = 40; private static final int DO_SET_SESSION_ENABLED = 45; private static final int DO_REVOKE_SESSION = 50; Loading Loading @@ -165,17 +166,24 @@ class IInputMethodWrapper extends IInputMethod.Stub case DO_START_INPUT: { SomeArgs args = (SomeArgs)msg.obj; int missingMethods = msg.arg1; boolean restarting = msg.arg2 != 0; IInputContext inputContext = (IInputContext)args.arg1; InputConnection ic = inputContext != null ? new InputConnectionWrapper(mTarget, inputContext, missingMethods) : null; EditorInfo info = (EditorInfo)args.arg2; info.makeCompatible(mTargetSdkVersion); if (restarting) { inputMethod.restartInput(ic, info); } else { inputMethod.startInput(ic, info); args.recycle(); return; } case DO_RESTART_INPUT: { SomeArgs args = (SomeArgs)msg.obj; int missingMethods = msg.arg1; IInputContext inputContext = (IInputContext)args.arg1; InputConnection ic = inputContext != null ? new InputConnectionWrapper(mTarget, inputContext, missingMethods) : null; EditorInfo info = (EditorInfo)args.arg2; info.makeCompatible(mTargetSdkVersion); inputMethod.restartInput(ic, info); args.recycle(); return; } Loading Loading @@ -257,9 +265,17 @@ class IInputMethodWrapper extends IInputMethod.Stub @Override public void startInput(IInputContext inputContext, @InputConnectionInspector.MissingMethodFlags final int missingMethods, EditorInfo attribute, boolean restarting) { mCaller.executeOrSendMessage(mCaller.obtainMessageIIOO(DO_START_INPUT, missingMethods, restarting ? 1 : 0, inputContext, attribute)); EditorInfo attribute) { mCaller.executeOrSendMessage(mCaller.obtainMessageIOO(DO_START_INPUT, missingMethods, inputContext, attribute)); } @Override public void restartInput(IInputContext inputContext, @InputConnectionInspector.MissingMethodFlags final int missingMethods, EditorInfo attribute) { mCaller.executeOrSendMessage(mCaller.obtainMessageIOO(DO_RESTART_INPUT, missingMethods, inputContext, attribute)); } @Override Loading core/java/com/android/internal/view/IInputMethod.aidl +3 −2 Original line number Diff line number Diff line Loading @@ -38,8 +38,9 @@ oneway interface IInputMethod { void unbindInput(); void startInput(in IInputContext inputContext, int missingMethods, in EditorInfo attribute, boolean restarting); void startInput(in IInputContext inputContext, int missingMethods, in EditorInfo attribute); void restartInput(in IInputContext inputContext, int missingMethods, in EditorInfo attribute); void createSession(in InputChannel channel, IInputSessionCallback callback); Loading services/core/java/com/android/server/InputMethodManagerService.java +24 −5 Original line number Diff line number Diff line Loading @@ -175,6 +175,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub static final int MSG_CREATE_SESSION = 1050; static final int MSG_START_INPUT = 2000; static final int MSG_RESTART_INPUT = 2010; static final int MSG_UNBIND_CLIENT = 3000; static final int MSG_BIND_CLIENT = 3010; Loading Loading @@ -1339,9 +1340,15 @@ public class InputMethodManagerService extends IInputMethodManager.Stub mBoundToMethod = true; } final SessionState session = mCurClient.curSession; executeOrSendMessage(session.method, mCaller.obtainMessageIIOOO( MSG_START_INPUT, initial ? 0 : 1 /* restarting */, mCurInputContextMissingMethods, session, mCurInputContext, mCurAttribute)); if (initial) { executeOrSendMessage(session.method, mCaller.obtainMessageIOOO( MSG_START_INPUT, mCurInputContextMissingMethods, session, mCurInputContext, mCurAttribute)); } else { executeOrSendMessage(session.method, mCaller.obtainMessageIOOO( MSG_RESTART_INPUT, mCurInputContextMissingMethods, session, mCurInputContext, mCurAttribute)); } if (mShowRequested) { if (DEBUG) Slog.v(TAG, "Attach new input asks to show input"); showCurrentInputLocked(getAppShowFlags(), null); Loading Loading @@ -2890,13 +2897,25 @@ public class InputMethodManagerService extends IInputMethodManager.Stub case MSG_START_INPUT: { int missingMethods = msg.arg1; boolean restarting = msg.arg2 != 0; args = (SomeArgs) msg.obj; try { SessionState session = (SessionState) args.arg1; setEnabledSessionInMainThread(session); session.method.startInput((IInputContext) args.arg2, missingMethods, (EditorInfo) args.arg3, restarting); (EditorInfo) args.arg3); } catch (RemoteException e) { } args.recycle(); return true; } case MSG_RESTART_INPUT: { int missingMethods = msg.arg1; args = (SomeArgs) msg.obj; try { SessionState session = (SessionState) args.arg1; setEnabledSessionInMainThread(session); session.method.restartInput((IInputContext) args.arg2, missingMethods, (EditorInfo) args.arg3); } catch (RemoteException e) { } args.recycle(); Loading Loading
core/java/android/inputmethodservice/IInputMethodWrapper.java +25 −9 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ class IInputMethodWrapper extends IInputMethod.Stub private static final int DO_SET_INPUT_CONTEXT = 20; private static final int DO_UNSET_INPUT_CONTEXT = 30; private static final int DO_START_INPUT = 32; private static final int DO_RESTART_INPUT = 34; private static final int DO_CREATE_SESSION = 40; private static final int DO_SET_SESSION_ENABLED = 45; private static final int DO_REVOKE_SESSION = 50; Loading Loading @@ -165,17 +166,24 @@ class IInputMethodWrapper extends IInputMethod.Stub case DO_START_INPUT: { SomeArgs args = (SomeArgs)msg.obj; int missingMethods = msg.arg1; boolean restarting = msg.arg2 != 0; IInputContext inputContext = (IInputContext)args.arg1; InputConnection ic = inputContext != null ? new InputConnectionWrapper(mTarget, inputContext, missingMethods) : null; EditorInfo info = (EditorInfo)args.arg2; info.makeCompatible(mTargetSdkVersion); if (restarting) { inputMethod.restartInput(ic, info); } else { inputMethod.startInput(ic, info); args.recycle(); return; } case DO_RESTART_INPUT: { SomeArgs args = (SomeArgs)msg.obj; int missingMethods = msg.arg1; IInputContext inputContext = (IInputContext)args.arg1; InputConnection ic = inputContext != null ? new InputConnectionWrapper(mTarget, inputContext, missingMethods) : null; EditorInfo info = (EditorInfo)args.arg2; info.makeCompatible(mTargetSdkVersion); inputMethod.restartInput(ic, info); args.recycle(); return; } Loading Loading @@ -257,9 +265,17 @@ class IInputMethodWrapper extends IInputMethod.Stub @Override public void startInput(IInputContext inputContext, @InputConnectionInspector.MissingMethodFlags final int missingMethods, EditorInfo attribute, boolean restarting) { mCaller.executeOrSendMessage(mCaller.obtainMessageIIOO(DO_START_INPUT, missingMethods, restarting ? 1 : 0, inputContext, attribute)); EditorInfo attribute) { mCaller.executeOrSendMessage(mCaller.obtainMessageIOO(DO_START_INPUT, missingMethods, inputContext, attribute)); } @Override public void restartInput(IInputContext inputContext, @InputConnectionInspector.MissingMethodFlags final int missingMethods, EditorInfo attribute) { mCaller.executeOrSendMessage(mCaller.obtainMessageIOO(DO_RESTART_INPUT, missingMethods, inputContext, attribute)); } @Override Loading
core/java/com/android/internal/view/IInputMethod.aidl +3 −2 Original line number Diff line number Diff line Loading @@ -38,8 +38,9 @@ oneway interface IInputMethod { void unbindInput(); void startInput(in IInputContext inputContext, int missingMethods, in EditorInfo attribute, boolean restarting); void startInput(in IInputContext inputContext, int missingMethods, in EditorInfo attribute); void restartInput(in IInputContext inputContext, int missingMethods, in EditorInfo attribute); void createSession(in InputChannel channel, IInputSessionCallback callback); Loading
services/core/java/com/android/server/InputMethodManagerService.java +24 −5 Original line number Diff line number Diff line Loading @@ -175,6 +175,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub static final int MSG_CREATE_SESSION = 1050; static final int MSG_START_INPUT = 2000; static final int MSG_RESTART_INPUT = 2010; static final int MSG_UNBIND_CLIENT = 3000; static final int MSG_BIND_CLIENT = 3010; Loading Loading @@ -1339,9 +1340,15 @@ public class InputMethodManagerService extends IInputMethodManager.Stub mBoundToMethod = true; } final SessionState session = mCurClient.curSession; executeOrSendMessage(session.method, mCaller.obtainMessageIIOOO( MSG_START_INPUT, initial ? 0 : 1 /* restarting */, mCurInputContextMissingMethods, session, mCurInputContext, mCurAttribute)); if (initial) { executeOrSendMessage(session.method, mCaller.obtainMessageIOOO( MSG_START_INPUT, mCurInputContextMissingMethods, session, mCurInputContext, mCurAttribute)); } else { executeOrSendMessage(session.method, mCaller.obtainMessageIOOO( MSG_RESTART_INPUT, mCurInputContextMissingMethods, session, mCurInputContext, mCurAttribute)); } if (mShowRequested) { if (DEBUG) Slog.v(TAG, "Attach new input asks to show input"); showCurrentInputLocked(getAppShowFlags(), null); Loading Loading @@ -2890,13 +2897,25 @@ public class InputMethodManagerService extends IInputMethodManager.Stub case MSG_START_INPUT: { int missingMethods = msg.arg1; boolean restarting = msg.arg2 != 0; args = (SomeArgs) msg.obj; try { SessionState session = (SessionState) args.arg1; setEnabledSessionInMainThread(session); session.method.startInput((IInputContext) args.arg2, missingMethods, (EditorInfo) args.arg3, restarting); (EditorInfo) args.arg3); } catch (RemoteException e) { } args.recycle(); return true; } case MSG_RESTART_INPUT: { int missingMethods = msg.arg1; args = (SomeArgs) msg.obj; try { SessionState session = (SessionState) args.arg1; setEnabledSessionInMainThread(session); session.method.restartInput((IInputContext) args.arg2, missingMethods, (EditorInfo) args.arg3); } catch (RemoteException e) { } args.recycle(); Loading