Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec3f84a8 authored by Feng Cao's avatar Feng Cao
Browse files

Make InputMethodService to never reuse the inline suggestion response callback.

Test: manual
Bug: 146903532

Change-Id: I7bc007fb3009897cba57e63edbc67cef541f0e05
parent c2517eee
Loading
Loading
Loading
Loading
+5 −10
Original line number Diff line number Diff line
@@ -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 =
                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);