Fix single field highlighting for autofill.

Bug: 150953184
Test: manual verification
Change-Id: I0519fe7c1d1d08cbee4c1703c1ad263a6eb7ef20
This commit is contained in:
Adam He
2020-03-25 13:30:24 -07:00
parent 65b857a25c
commit e2dbbce0dd
2 changed files with 3 additions and 2 deletions

View File

@@ -3474,7 +3474,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
/**
* Flag indicating the field should not have yellow highlight when autofilled.
*/
private static final int PFLAG4_AUTOFILL_HIDE_HIGHLIGHT = 0x100;
private static final int PFLAG4_AUTOFILL_HIDE_HIGHLIGHT = 0x200;
/* End of masks for mPrivateFlags4 */

View File

@@ -1242,9 +1242,10 @@ public final class AutofillManager {
if (mLastAutofilledData.containsKey(id)) {
value = view.getAutofillValue();
valueWasRead = true;
final boolean hideHighlight = mLastAutofilledData.keySet().size() == 1;
if (Objects.equals(mLastAutofilledData.get(id), value)) {
view.setAutofilled(true, false);
view.setAutofilled(true, hideHighlight);
} else {
view.setAutofilled(false, false);
mLastAutofilledData.remove(id);