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

Commit 19706671 authored by Simranjit Kohli's avatar Simranjit Kohli Committed by Automerger Merge Worker
Browse files

Merge "PCC Authentication Fix authentication where the Provider may supply...

Merge "PCC Authentication Fix authentication where the Provider may supply results by setting in hints. Similar to what we support for onFillResponse, providers can set response for types initially requested for PCC." into udc-dev am: 842ad4a5

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23049643



Change-Id: If076aa355f012ad397da6e3e2841d0923a956463
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 5b34ff02 842ad4a5
Loading
Loading
Loading
Loading
+17 −6
Original line number Diff line number Diff line
@@ -1581,6 +1581,13 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
        // TODO(b/266379948): Ideally wait for PCC request to finish for a while more
        // (say 100ms) before proceeding further on.

        processResponseLockedForPcc(response, response.getClientState(), requestFlags);
    }


    @GuardedBy("mLock")
    private void processResponseLockedForPcc(@NonNull FillResponse response,
            @Nullable Bundle newClientState, int flags) {
        if (DBG) {
            Slog.d(TAG, "DBG: Initial response: " + response);
        }
@@ -1588,12 +1595,15 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
            response = getEffectiveFillResponse(response);
            if (isEmptyResponse(response)) {
                // Treat it as a null response.
                processNullResponseLocked(requestId, requestFlags);
                processNullResponseLocked(
                        response != null ? response.getRequestId() : 0,
                        flags);
                return;
            }
            if (DBG) {
                Slog.d(TAG, "DBG: Processed response: " + response);
            }
            processResponseLocked(response, null, requestFlags);
            processResponseLocked(response, newClientState, flags);
        }
    }

@@ -2490,7 +2500,10 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
                    if (sDebug) Slog.d(TAG,  "Updating client state from auth dataset");
                    mClientState = newClientState;
                }
                final Dataset dataset = (Dataset) result;
                Dataset dataset = (Dataset) result;
                FillResponse temp = new FillResponse.Builder().addDataset(dataset).build();
                temp = getEffectiveFillResponse(temp);
                dataset = temp.getDatasets().get(0);
                final Dataset oldDataset = authenticatedResponse.getDatasets().get(datasetIdx);
                if (!isAuthResultDatasetEphemeral(oldDataset, data)) {
                    authenticatedResponse.getDatasets().set(datasetIdx, dataset);
@@ -4665,10 +4678,8 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
        setViewStatesLocked(oldResponse, ViewState.STATE_INITIAL, true);
        // Move over the id
        newResponse.setRequestId(oldResponse.getRequestId());
        // Replace the old response
        mResponses.put(newResponse.getRequestId(), newResponse);
        // Now process the new response
        processResponseLocked(newResponse, newClientState, 0);
        processResponseLockedForPcc(newResponse, newClientState, 0);
    }

    @GuardedBy("mLock")