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

Commit ab8238e2 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Don't trigger new partition on fields from SaveInfo" into oc-dev

parents 5cb3d6be 6d24c30d
Loading
Loading
Loading
Loading
+34 −14
Original line number Original line Diff line number Diff line
@@ -846,6 +846,21 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
                setViewStatesLocked(response, dataset, state);
                setViewStatesLocked(response, dataset, state);
            }
            }
        }
        }
        final SaveInfo saveInfo = response.getSaveInfo();
        if (saveInfo != null) {
            final AutofillId[] requiredIds = saveInfo.getRequiredIds();
            for (int i = 0; i < requiredIds.length; i++) {
                final AutofillId id = requiredIds[i];
                createOrUpdateViewStateLocked(id, state, null);
            }
            final AutofillId[] optionalIds = saveInfo.getOptionalIds();
            if (optionalIds != null) {
                for (int i = 0; i < optionalIds.length; i++) {
                    final AutofillId id = optionalIds[i];
                    createOrUpdateViewStateLocked(id, state, null);
                }
            }
        }
    }
    }


    /**
    /**
@@ -857,6 +872,15 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
        final ArrayList<AutofillValue> values = dataset.getFieldValues();
        final ArrayList<AutofillValue> values = dataset.getFieldValues();
        for (int j = 0; j < ids.size(); j++) {
        for (int j = 0; j < ids.size(); j++) {
            final AutofillId id = ids.get(j);
            final AutofillId id = ids.get(j);
            final AutofillValue value = values.get(j);
            final ViewState viewState = createOrUpdateViewStateLocked(id, state, value);
            if (response != null) {
                viewState.setResponse(response);
            }
        }
    }

    private ViewState createOrUpdateViewStateLocked(AutofillId id, int state,AutofillValue value) {
        ViewState viewState = mViewStates.get(id);
        ViewState viewState = mViewStates.get(id);
        if (viewState != null)  {
        if (viewState != null)  {
            viewState.setState(state);
            viewState.setState(state);
@@ -868,13 +892,9 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
            mViewStates.put(id, viewState);
            mViewStates.put(id, viewState);
        }
        }
        if ((state & ViewState.STATE_AUTOFILLED) != 0) {
        if ((state & ViewState.STATE_AUTOFILLED) != 0) {
                viewState.setAutofilledValue(values.get(j));
            viewState.setAutofilledValue(value);
            }

            if (response != null) {
                viewState.setResponse(response);
            }
        }
        }
        return viewState;
    }
    }


    /**
    /**