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

Commit 9ee439b9 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Send empty response to IME when autofill session is destroyed" into...

Merge "Send empty response to IME when autofill session is destroyed" into rvc-dev am: 756740d9 am: 617c3eae am: e801f632 am: 54f3c002

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11825554

Change-Id: I408754229e887393459494a5b1b6e5964a55f1bb
parents 08ee1098 54f3c002
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -77,8 +77,8 @@ final class AutofillInlineSessionController {
        if (mSession != null) {
            // Destroy the existing session.
            mSession.destroySessionLocked();
            mInlineFillUi = null;
        }
        mInlineFillUi = null;
        // TODO(b/151123764): consider reusing the same AutofillInlineSession object for the
        // same field.
        mSession = new AutofillInlineSuggestionsRequestSession(mInputMethodManagerInternal, mUserId,
@@ -86,6 +86,22 @@ final class AutofillInlineSessionController {
        mSession.onCreateInlineSuggestionsRequestLocked();
    }

    /**
     * Destroys the current session. May send an empty response to IME to clear the suggestions if
     * the focus didn't change to a different field.
     *
     * @param autofillId the currently focused view from the autofill session
     */
    @GuardedBy("mLock")
    void destroyLocked(@NonNull AutofillId autofillId) {
        if (mSession != null) {
            mSession.onInlineSuggestionsResponseLocked(InlineFillUi.emptyUi(autofillId));
            mSession.destroySessionLocked();
            mSession = null;
        }
        mInlineFillUi = null;
    }

    /**
     * Returns the {@link InlineSuggestionsRequest} provided by IME for the last request.
     *
+3 −0
Original line number Diff line number Diff line
@@ -3702,6 +3702,9 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
        unlinkClientVultureLocked();
        mUi.destroyAll(mPendingSaveUi, this, true);
        mUi.clearCallback(this);
        if (mCurrentViewId != null) {
            mInlineSessionController.destroyLocked(mCurrentViewId);
        }
        mDestroyed = true;

        // Log metrics