Loading services/autofill/java/com/android/server/autofill/Session.java +21 −5 Original line number Diff line number Diff line Loading @@ -1206,7 +1206,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState // - not autofilled but matches a dataset value -> manuallyFilledIds if ((state & ViewState.STATE_CHANGED) != 0) { // Check if autofilled value was changed if ((state & ViewState.STATE_AUTOFILLED) != 0) { if ((state & ViewState.STATE_AUTOFILLED_ONCE) != 0) { final String datasetId = viewState.getDatasetId(); if (datasetId == null) { // Sanity check - should never happen. Loading Loading @@ -2181,12 +2181,28 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState // Must check if this update was caused by autofilling the view, in which // case we just update the value, but not the UI. final AutofillValue filledValue = viewState.getAutofilledValue(); if (filledValue != null && filledValue.equals(value)) { if (filledValue != null) { if (filledValue.equals(value)) { if (sVerbose) { Slog.v(TAG, "ignoring autofilled change on id " + id); } viewState.resetState(ViewState.STATE_CHANGED); return; } else { if ((viewState.id.equals(this.mCurrentViewId)) && (viewState.getState() & ViewState.STATE_AUTOFILLED) != 0) { // Remove autofilled state once field is changed after autofilling. if (sVerbose) { Slog.v(TAG, "field changed after autofill on id " + id); } viewState.resetState(ViewState.STATE_AUTOFILLED); final ViewState currentView = mViewStates.get(mCurrentViewId); currentView.maybeCallOnFillReady(flags); } } } // Update the internal state... viewState.setState(ViewState.STATE_CHANGED); Loading services/autofill/java/com/android/server/autofill/ViewState.java +6 −1 Original line number Diff line number Diff line Loading @@ -69,8 +69,10 @@ final class ViewState { public static final int STATE_RESTARTED_SESSION = 0x100; /** View is the URL bar of a package on compat mode. */ public static final int STATE_URL_BAR = 0x200; /** View was asked to autofil but failed to do so. */ /** View was asked to autofill but failed to do so. */ public static final int STATE_AUTOFILL_FAILED = 0x400; /** View has been autofilled at least once. */ public static final int STATE_AUTOFILLED_ONCE = 0x800; public final AutofillId id; Loading Loading @@ -161,6 +163,9 @@ final class ViewState { } else { mState |= state; } if (state == STATE_AUTOFILLED) { mState |= STATE_AUTOFILLED_ONCE; } } void resetState(int state) { Loading Loading
services/autofill/java/com/android/server/autofill/Session.java +21 −5 Original line number Diff line number Diff line Loading @@ -1206,7 +1206,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState // - not autofilled but matches a dataset value -> manuallyFilledIds if ((state & ViewState.STATE_CHANGED) != 0) { // Check if autofilled value was changed if ((state & ViewState.STATE_AUTOFILLED) != 0) { if ((state & ViewState.STATE_AUTOFILLED_ONCE) != 0) { final String datasetId = viewState.getDatasetId(); if (datasetId == null) { // Sanity check - should never happen. Loading Loading @@ -2181,12 +2181,28 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState // Must check if this update was caused by autofilling the view, in which // case we just update the value, but not the UI. final AutofillValue filledValue = viewState.getAutofilledValue(); if (filledValue != null && filledValue.equals(value)) { if (filledValue != null) { if (filledValue.equals(value)) { if (sVerbose) { Slog.v(TAG, "ignoring autofilled change on id " + id); } viewState.resetState(ViewState.STATE_CHANGED); return; } else { if ((viewState.id.equals(this.mCurrentViewId)) && (viewState.getState() & ViewState.STATE_AUTOFILLED) != 0) { // Remove autofilled state once field is changed after autofilling. if (sVerbose) { Slog.v(TAG, "field changed after autofill on id " + id); } viewState.resetState(ViewState.STATE_AUTOFILLED); final ViewState currentView = mViewStates.get(mCurrentViewId); currentView.maybeCallOnFillReady(flags); } } } // Update the internal state... viewState.setState(ViewState.STATE_CHANGED); Loading
services/autofill/java/com/android/server/autofill/ViewState.java +6 −1 Original line number Diff line number Diff line Loading @@ -69,8 +69,10 @@ final class ViewState { public static final int STATE_RESTARTED_SESSION = 0x100; /** View is the URL bar of a package on compat mode. */ public static final int STATE_URL_BAR = 0x200; /** View was asked to autofil but failed to do so. */ /** View was asked to autofill but failed to do so. */ public static final int STATE_AUTOFILL_FAILED = 0x400; /** View has been autofilled at least once. */ public static final int STATE_AUTOFILLED_ONCE = 0x800; public final AutofillId id; Loading Loading @@ -161,6 +163,9 @@ final class ViewState { } else { mState |= state; } if (state == STATE_AUTOFILLED) { mState |= STATE_AUTOFILLED_ONCE; } } void resetState(int state) { Loading