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

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

Merge "Autofill: Add logs for better debugging" into main

parents 4f7007cf b7ca92d0
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2364,6 +2364,7 @@ public final class AutofillManager {

        synchronized (mLock) {
            if (!isActiveLocked()) {
                Log.w(TAG, "onAuthenticationResult(): sessionId=" + mSessionId + " not active");
                return;
            }
            mState = STATE_ACTIVE;
@@ -2380,6 +2381,7 @@ public final class AutofillManager {
            }
            if (data == null) {
                // data is set to null when result is not RESULT_OK
                Log.i(TAG, "onAuthenticationResult(): empty intent");
                return;
            }

+15 −1
Original line number Diff line number Diff line
@@ -2770,6 +2770,10 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
                    + id + " destroyed");
            return;
        }
        if (sDebug) {
            Slog.d(TAG, "setAuthenticationResultLocked(): id= " + authenticationId
                    + ", data=" + data);
        }
        final int requestId = AutofillManager.getRequestIdFromAuthenticationId(authenticationId);
        if (requestId == AUGMENTED_AUTOFILL_REQUEST_ID) {
            setAuthenticationResultForAugmentedAutofillLocked(data, authenticationId);
@@ -2823,12 +2827,18 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
                    + ", clientState=" + newClientState + ", authenticationId=" + authenticationId);
        }
        if (result instanceof FillResponse) {
            if (sDebug) {
                Slog.d(TAG, "setAuthenticationResultLocked(): received FillResponse from"
                        + " authentication flow");
            }
            logAuthenticationStatusLocked(requestId, MetricsEvent.AUTOFILL_AUTHENTICATED);
            mPresentationStatsEventLogger.maybeSetAuthenticationResult(
                AUTHENTICATION_RESULT_SUCCESS);
            replaceResponseLocked(authenticatedResponse, (FillResponse) result, newClientState);
        } else if (result instanceof GetCredentialResponse) {
            if (sDebug) {
                Slog.d(TAG, "Received GetCredentialResponse from authentication flow");
            }
            boolean isCredmanCallbackInvoked = false;
            if (Flags.autofillCredmanIntegration()) {
                GetCredentialResponse response = (GetCredentialResponse) result;
@@ -2843,6 +2853,10 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
                }
            }
        } else if (result instanceof Dataset) {
            if (sDebug) {
                Slog.d(TAG, "setAuthenticationResultLocked(): received Dataset from"
                        + " authentication flow");
            }
            if (datasetIdx != AutofillManager.AUTHENTICATION_ID_DATASET_ID_UNDEFINED) {
                logAuthenticationStatusLocked(requestId,
                        MetricsEvent.AUTOFILL_DATASET_AUTHENTICATED);