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

Commit 09a55d33 authored by Felipe Leme's avatar Felipe Leme Committed by android-build-merger
Browse files

Merge "Fixed Save logic so it's not triggered when field was not autofilled." into pi-dev

am: 651667ce

Change-Id: Ic451775af3bf26f9f34f5f4e3e09ed88d1d3121f
parents d7dcadae 651667ce
Loading
Loading
Loading
Loading
+18 −4
Original line number Diff line number Diff line
@@ -1438,6 +1438,19 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
                final AutofillValue filledValue = viewState.getAutofilledValue();

                if (!value.equals(filledValue)) {
                    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);
@@ -1446,6 +1459,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
                    }
                }
            }
        }

        final AutofillId[] optionalIds = saveInfo.getOptionalIds();
        if (allRequiredAreNotEmpty) {