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

Commit 8f506950 authored by Simranjit Kohli's avatar Simranjit Kohli Committed by Android (Google) Code Review
Browse files

Merge "[Autofill PCC Detection] Provide detection info during save." into udc-dev

parents 61f4503d 2373682f
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -225,6 +225,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
    private static final String EXTRA_REQUEST_ID = "android.service.autofill.extra.REQUEST_ID";

    private static final String PCC_HINTS_DELIMITER = ",";
    public static final String EXTRA_KEY_DETECTIONS = "detections";

    final Object mLock;

@@ -3653,6 +3654,17 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState

        final ArrayList<FillContext> contexts = mergePreviousSessionLocked( /* forSave= */ true);

        FieldClassificationResponse fieldClassificationResponse =
                mClassificationState.mLastFieldClassificationResponse;
        if (mService.isPccClassificationEnabled()
                && fieldClassificationResponse != null
                && !fieldClassificationResponse.getClassifications().isEmpty()) {
            if (mClientState == null) {
                mClientState = new Bundle();
            }
            mClientState.putParcelableArrayList(EXTRA_KEY_DETECTIONS, new ArrayList<>(
                    fieldClassificationResponse.getClassifications()));
        }
        final SaveRequest saveRequest =
                new SaveRequest(contexts, mClientState, mSelectedDatasetIds);
        mRemoteFillService.onSaveRequest(saveRequest);