diff options
| author | Yohei Yukawa <yukawa@google.com> | 2017-02-11 20:57:10 -0800 |
|---|---|---|
| committer | Yohei Yukawa <yukawa@google.com> | 2017-02-11 20:57:10 -0800 |
| commit | f7526b58960608887b064670bb42f41aa28b8f41 (patch) | |
| tree | f54083d77cb507466e56120a8996450dccc6a14d /core/java/android/inputmethodservice/IInputMethodWrapper.java | |
| parent | 9a49f85ae4ae45343838b189cdfd884ffabbd5ff (diff) | |
Merge restartInput into startInput in internal IPC
This is the 2nd attempt to merge restartInput into startInput in
internal IPC after fixing the mistake in new parameter order in
the previous CL [1].
As a preparation to start tracking all the event flows that
cause InputMethodManagerService#setImeWindowStatus(), this CL
merges an internal IPC method IInputMethod#restartInput() into
IInputMethod#startInput() in favor of simplicity.
This is a refactoring CL that should have no behavior change.
[1]: Ifda6f74ac1b1370d9e9a9fe60354b692121fdcb9
1a5838e966eab7a9f0dca71cabbc9922babb995e
Test: Set true to InputMethodService#DEBUG and make sure startInput()
and restartInput() are called in the following scenario.
1. Complete the setup wizard.
2. adb shell am start -a android.app.action.SET_NEW_PASSWORD
3. Proceed to "Choose your password" page
4. Make sure startInput() gets called.
5. Type "aaaa" then hit "CONTINUE" button.
6. Make sure restartInput() gets called.
Bug: 35079353
Change-Id: I476d0cf8cbb0a0134941854f9337d9ad15e66a71
Diffstat (limited to 'core/java/android/inputmethodservice/IInputMethodWrapper.java')
| -rw-r--r-- | core/java/android/inputmethodservice/IInputMethodWrapper.java | 44 |
1 files changed, 14 insertions, 30 deletions
diff --git a/core/java/android/inputmethodservice/IInputMethodWrapper.java b/core/java/android/inputmethodservice/IInputMethodWrapper.java index 167d5a09a2dc..bc407504a20d 100644 --- a/core/java/android/inputmethodservice/IInputMethodWrapper.java +++ b/core/java/android/inputmethodservice/IInputMethodWrapper.java @@ -61,7 +61,6 @@ 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; @@ -164,26 +163,19 @@ class IInputMethodWrapper extends IInputMethod.Stub inputMethod.unbindInput(); return; case DO_START_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.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 + final SomeArgs args = (SomeArgs) msg.obj; + final int missingMethods = msg.arg1; + final boolean restarting = msg.arg2 != 0; + final IInputContext inputContext = (IInputContext) args.arg1; + final EditorInfo info = (EditorInfo) args.arg2; + final InputConnection ic = inputContext != null ? new InputConnectionWrapper(mTarget, inputContext, missingMethods) : null; - EditorInfo info = (EditorInfo)args.arg2; info.makeCompatible(mTargetSdkVersion); - inputMethod.restartInput(ic, info); + if (restarting) { + inputMethod.restartInput(ic, info); + } else { + inputMethod.startInput(ic, info); + } args.recycle(); return; } @@ -265,17 +257,9 @@ class IInputMethodWrapper extends IInputMethod.Stub @Override public void startInput(IInputContext inputContext, @InputConnectionInspector.MissingMethodFlags final int missingMethods, - 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)); + EditorInfo attribute, boolean restarting) { + mCaller.executeOrSendMessage(mCaller.obtainMessageIIOO(DO_START_INPUT, + missingMethods, restarting ? 1 : 0, inputContext, attribute)); } @Override |
