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

Commit 10017115 authored by Feng Cao's avatar Feng Cao Committed by Android (Google) Code Review
Browse files

Merge "Fix augmented autofill to not send multiple request on the same field" into rvc-dev

parents 37aa4739 8aee9bc7
Loading
Loading
Loading
Loading
+18 −12
Original line number Diff line number Diff line
@@ -2459,19 +2459,25 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
                    return;
                }

                if (!isSameViewEntered
                        && (flags & FLAG_MANUAL_REQUEST) == 0
                        && mAugmentedAutofillableIds != null
                        && mAugmentedAutofillableIds.contains(id)) {
                    // View was already reported when server could not handle a response, but it
                if ((flags & FLAG_MANUAL_REQUEST) == 0) {
                    // Not a manual request
                    if (mAugmentedAutofillableIds != null && mAugmentedAutofillableIds.contains(
                            id)) {
                        // Regular autofill handled the view and returned null response, but it
                        // triggered augmented autofill

                    if (sDebug) Slog.d(TAG, "updateLocked(" + id + "): augmented-autofillable");

                    // ...then trigger the augmented autofill UI
                        if (!isSameViewEntered) {
                            if (sDebug) Slog.d(TAG, "trigger augmented autofill.");
                            triggerAugmentedAutofillLocked();
                        } else {
                            if (sDebug) Slog.d(TAG, "skip augmented autofill for same view.");
                        }
                        return;
                    } else if (mForAugmentedAutofillOnly && isSameViewEntered) {
                        // Regular autofill is disabled.
                        if (sDebug) Slog.d(TAG, "skip augmented autofill for same view.");
                        return;
                    }
                }

                if (requestNewFillResponseOnViewEnteredIfNecessaryLocked(id, viewState, flags)) {
                    return;