summaryrefslogtreecommitdiff
path: root/core/java/android/inputmethodservice/IInputMethodWrapper.java
diff options
context:
space:
mode:
authorTarandeep Singh <tarandeep@google.com>2020-02-20 17:20:19 -0800
committerTaran Singh <tarandeep@google.com>2020-02-27 04:13:25 +0000
commit4fe5b654a1e420fd66781b09223a1c25f9a06aeb (patch)
tree3fcea4617625f7b4c439266c96684570eaafabfb /core/java/android/inputmethodservice/IInputMethodWrapper.java
parentd506a78e94594be701b2a061cb48b5e2f5cf3908 (diff)
Pipe windowToken for hideSoftInput
Pipe the windowToken of the window requesting hideSoftInput just like we did it for showSoftInput [1]. This calls hideInsets on the correct display when control target is different from IME target e.g. ActivityView. Also hideInsets should be called on InsetsControlTarget instead which was originally attempted in [2] [1]: Ia49e23dd077d264a58d28a7b8acffde54b7db187 [2]: I7133e151a1037c42b275b97857936437a7a6725f Bug: 149870112 Bug: 133381284 Test: Manually using steps mentioned in bug. Change-Id: Ia596a392eb73ae46debd097151c8c9a7edd59833
Diffstat (limited to 'core/java/android/inputmethodservice/IInputMethodWrapper.java')
-rw-r--r--core/java/android/inputmethodservice/IInputMethodWrapper.java23
1 files changed, 15 insertions, 8 deletions
diff --git a/core/java/android/inputmethodservice/IInputMethodWrapper.java b/core/java/android/inputmethodservice/IInputMethodWrapper.java
index f0b1eaa9f257..b52b437b4557 100644
--- a/core/java/android/inputmethodservice/IInputMethodWrapper.java
+++ b/core/java/android/inputmethodservice/IInputMethodWrapper.java
@@ -219,22 +219,29 @@ class IInputMethodWrapper extends IInputMethod.Stub
case DO_REVOKE_SESSION:
inputMethod.revokeSession((InputMethodSession)msg.obj);
return;
- case DO_SHOW_SOFT_INPUT:
- SomeArgs args = (SomeArgs)msg.obj;
+ case DO_SHOW_SOFT_INPUT: {
+ final SomeArgs args = (SomeArgs)msg.obj;
inputMethod.showSoftInputWithToken(
msg.arg1, (ResultReceiver) args.arg2, (IBinder) args.arg1);
+ args.recycle();
return;
- case DO_HIDE_SOFT_INPUT:
- inputMethod.hideSoftInput(msg.arg1, (ResultReceiver)msg.obj);
+ }
+ case DO_HIDE_SOFT_INPUT: {
+ final SomeArgs args = (SomeArgs) msg.obj;
+ inputMethod.hideSoftInputWithToken(msg.arg1, (ResultReceiver) args.arg2,
+ (IBinder) args.arg1);
+ args.recycle();
return;
+ }
case DO_CHANGE_INPUTMETHOD_SUBTYPE:
inputMethod.changeInputMethodSubtype((InputMethodSubtype)msg.obj);
return;
case DO_CREATE_INLINE_SUGGESTIONS_REQUEST:
- args = (SomeArgs) msg.obj;
+ final SomeArgs args = (SomeArgs) msg.obj;
inputMethod.onCreateInlineSuggestionsRequest(
(InlineSuggestionsRequestInfo) args.arg1,
(IInlineSuggestionsRequestCallback) args.arg2);
+ args.recycle();
return;
}
@@ -380,9 +387,9 @@ class IInputMethodWrapper extends IInputMethod.Stub
@BinderThread
@Override
- public void hideSoftInput(int flags, ResultReceiver resultReceiver) {
- mCaller.executeOrSendMessage(mCaller.obtainMessageIO(DO_HIDE_SOFT_INPUT,
- flags, resultReceiver));
+ public void hideSoftInput(IBinder hideInputToken, int flags, ResultReceiver resultReceiver) {
+ mCaller.executeOrSendMessage(mCaller.obtainMessageIOO(DO_HIDE_SOFT_INPUT,
+ flags, hideInputToken, resultReceiver));
}
@BinderThread