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

This commit is contained in:
Feng Cao
2020-03-04 00:50:39 +00:00
committed by Android (Google) Code Review

View File

@@ -2459,18 +2459,24 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
return; return;
} }
if (!isSameViewEntered if ((flags & FLAG_MANUAL_REQUEST) == 0) {
&& (flags & FLAG_MANUAL_REQUEST) == 0 // Not a manual request
&& mAugmentedAutofillableIds != null if (mAugmentedAutofillableIds != null && mAugmentedAutofillableIds.contains(
&& mAugmentedAutofillableIds.contains(id)) { id)) {
// View was already reported when server could not handle a response, but it // Regular autofill handled the view and returned null response, but it
// triggered augmented autofill // triggered augmented autofill
if (!isSameViewEntered) {
if (sDebug) Slog.d(TAG, "updateLocked(" + id + "): augmented-autofillable"); if (sDebug) Slog.d(TAG, "trigger augmented autofill.");
triggerAugmentedAutofillLocked();
// ...then trigger the augmented autofill UI } else {
triggerAugmentedAutofillLocked(); if (sDebug) Slog.d(TAG, "skip augmented autofill for same view.");
return; }
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)) { if (requestNewFillResponseOnViewEnteredIfNecessaryLocked(id, viewState, flags)) {