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

Commit da94c6b8 authored by Feng Cao's avatar Feng Cao Committed by Automerger Merge Worker
Browse files

Merge "Make autofill manager service to not clear inline suggestions when IME...

Merge "Make autofill manager service to not clear inline suggestions when IME input finishes" into rvc-dev am: 7e38991b am: 4712de29 am: e6d11f4d am: 6eb16e91

Original change: undetermined

Change-Id: I7c7e0f29f8e5e235e5296d2c9d2f4a1d65c723b3
parents 3d8c92d8 6eb16e91
Loading
Loading
Loading
Loading
+2 −12
Original line number Diff line number Diff line
@@ -40,7 +40,6 @@ import com.android.server.autofill.ui.InlineFillUi;
import com.android.server.inputmethod.InputMethodManagerInternal;

import java.lang.ref.WeakReference;
import java.util.Collections;
import java.util.Optional;
import java.util.function.Consumer;

@@ -209,18 +208,9 @@ final class AutofillInlineSuggestionsRequestSession {
        if (mDestroyed || mResponseCallback == null) {
            return;
        }
        if (!mImeInputStarted && mPreviousResponseIsNotEmpty) {
            // 1. if previous response is not empty, and IME is just disconnected from the view,
            // then send empty response to make sure existing responses don't stick around.
            // Although the inline suggestions should disappear when IME hides which removes them
            // from the view hierarchy, but we still send an empty response to indicate that the
            // previous suggestions are invalid now.
            if (sVerbose) Slog.v(TAG, "Send empty inline response");
            updateResponseToImeUncheckLocked(new InlineSuggestionsResponse(Collections.EMPTY_LIST));
            mPreviousResponseIsNotEmpty = false;
        } else if (mImeInputViewStarted && mInlineFillUi != null && match(mAutofillId,
        if (mImeInputViewStarted && mInlineFillUi != null && match(mAutofillId,
                mImeCurrentFieldId)) {
            // 2. if IME is visible, and response is not null, send the response
            // if IME is visible, and response is not null, send the response
            InlineSuggestionsResponse response = mInlineFillUi.getInlineSuggestionsResponse();
            boolean isEmptyResponse = response.getInlineSuggestions().isEmpty();
            if (isEmptyResponse && !mPreviousResponseIsNotEmpty) {