summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2018-03-20 21:20:52 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2018-03-20 21:20:52 +0000
commit651667cea110fe4278bbbca8c6819fb4a9e7798f (patch)
tree3c6e04ed57e2aa59ac47f36850d34613eab10b2f
parent22159e86d322bf332983730db964abbbd1bd185f (diff)
parenta594510bdca5829a1422909c5230735cacba75d5 (diff)
Merge "Fixed Save logic so it's not triggered when field was not autofilled." into pi-dev
-rw-r--r--services/autofill/java/com/android/server/autofill/Session.java22
1 files changed, 18 insertions, 4 deletions
diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java
index 755fc54fb6d6..7f5761516302 100644
--- a/services/autofill/java/com/android/server/autofill/Session.java
+++ b/services/autofill/java/com/android/server/autofill/Session.java
@@ -1438,11 +1438,25 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
final AutofillValue filledValue = viewState.getAutofilledValue();
if (!value.equals(filledValue)) {
- if (sDebug) {
- Slog.d(TAG, "found a change on required " + id + ": " + filledValue
- + " => " + value);
+ boolean changed = true;
+ if (filledValue == null) {
+ // Dataset was not autofilled, make sure initial value didn't change.
+ final AutofillValue initialValue = getValueFromContextsLocked(id);
+ if (initialValue != null && initialValue.equals(value)) {
+ if (sDebug) {
+ Slog.d(TAG, "id " + id + " is part of dataset but initial value "
+ + "didn't change: " + value);
+ }
+ changed = false;
+ }
+ }
+ if (changed) {
+ if (sDebug) {
+ Slog.d(TAG, "found a change on required " + id + ": " + filledValue
+ + " => " + value);
+ }
+ atLeastOneChanged = true;
}
- atLeastOneChanged = true;
}
}
}