diff options
| author | Feng Cao <fengcao@google.com> | 2019-12-23 12:46:58 -0800 |
|---|---|---|
| committer | Feng Cao <fengcao@google.com> | 2019-12-27 11:04:02 -0800 |
| commit | ec3f84a899015c3a83d6431b116f8a1cb7569099 (patch) | |
| tree | d698d6b86ea9d71c36023835b935492b04c07357 /core/java/android/inputmethodservice/InputMethodService.java | |
| parent | c2517eeebadc08de9c2d1680eb6d9fd7b4ed29de (diff) | |
Make InputMethodService to never reuse the inline suggestion response callback.
Test: manual
Bug: 146903532
Change-Id: I7bc007fb3009897cba57e63edbc67cef541f0e05
Diffstat (limited to 'core/java/android/inputmethodservice/InputMethodService.java')
| -rw-r--r-- | core/java/android/inputmethodservice/InputMethodService.java | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java index 7da7dc120dcb..a45f70316953 100644 --- a/core/java/android/inputmethodservice/InputMethodService.java +++ b/core/java/android/inputmethodservice/InputMethodService.java @@ -450,9 +450,6 @@ public class InputMethodService extends AbstractInputMethodService { @Nullable private InlineSuggestionsRequestInfo mInlineSuggestionsRequestInfo = null; - @Nullable - private InlineSuggestionsResponseCallbackImpl mInlineSuggestionsResponseCallback = null; - private final Handler mHandler = new Handler(Looper.getMainLooper(), null, true); final ViewTreeObserver.OnComputeInternalInsetsListener mInsetsComputer = info -> { @@ -752,14 +749,12 @@ public class InputMethodService extends AbstractInputMethodService { Log.w(TAG, "onCreateInlineSuggestionsRequest() returned null request"); requestCallback.onInlineSuggestionsUnsupported(); } else { - if (mInlineSuggestionsResponseCallback == null) { - mInlineSuggestionsResponseCallback = - new InlineSuggestionsResponseCallbackImpl(this, - mInlineSuggestionsRequestInfo.mComponentName, - mInlineSuggestionsRequestInfo.mFocusedId); - } + final IInlineSuggestionsResponseCallback inlineSuggestionsResponseCallback = + new InlineSuggestionsResponseCallbackImpl(this, + mInlineSuggestionsRequestInfo.mComponentName, + mInlineSuggestionsRequestInfo.mFocusedId); requestCallback.onInlineSuggestionsRequest(request, - mInlineSuggestionsResponseCallback); + inlineSuggestionsResponseCallback); } } catch (RemoteException e) { Log.w(TAG, "makeInlinedSuggestionsRequest() remote exception:" + e); |
