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

Commit 1ad95f06 authored by Felipe Leme's avatar Felipe Leme
Browse files

Improved logging on autofill authentication.

These are particular useful when the service created a wrong authentication
result.

Bug: 77641784
Test: manual verification

Change-Id: I420c8ff88137b9e410cbaff56f10a6a70d8311e5
parent b44f8b9e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1435,7 +1435,9 @@ public final class AutofillManager {
        // set the EXTRA_AUTHENTICATION_RESULT extra, but it could cause weird results if the
        // service set the extra and returned RESULT_CANCELED...

        if (sDebug) Log.d(TAG, "onAuthenticationResult(): d=" + data);
        if (sDebug) {
            Log.d(TAG, "onAuthenticationResult(): id= " + authenticationId + ", data=" + data);
        }

        synchronized (mLock) {
            if (!isActiveLocked()) {
+5 −1
Original line number Diff line number Diff line
@@ -993,6 +993,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
        final int requestId = AutofillManager.getRequestIdFromAuthenticationId(authenticationId);
        final FillResponse authenticatedResponse = mResponses.get(requestId);
        if (authenticatedResponse == null || data == null) {
            Slog.w(TAG, "no authenticated response");
            removeSelf();
            return;
        }
@@ -1003,6 +1004,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
        if (datasetIdx != AutofillManager.AUTHENTICATION_ID_DATASET_ID_UNDEFINED) {
            final Dataset dataset = authenticatedResponse.getDatasets().get(datasetIdx);
            if (dataset == null) {
                Slog.w(TAG, "no dataset with index " + datasetIdx + " on fill response");
                removeSelf();
                return;
            }
@@ -1012,7 +1014,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
        final Bundle newClientState = data.getBundle(AutofillManager.EXTRA_CLIENT_STATE);
        if (sDebug) {
            Slog.d(TAG, "setAuthenticationResultLocked(): result=" + result
                    + ", clientState=" + newClientState);
                    + ", clientState=" + newClientState + ", authenticationId=" + authenticationId);
        }
        if (result instanceof FillResponse) {
            logAuthenticationStatusLocked(requestId, MetricsEvent.AUTOFILL_AUTHENTICATED);
@@ -1029,6 +1031,8 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
                authenticatedResponse.getDatasets().set(datasetIdx, dataset);
                autoFill(requestId, datasetIdx, dataset, false);
            } else {
                Slog.w(TAG, "invalid index (" + datasetIdx + ") for authentication id "
                        + authenticationId);
                logAuthenticationStatusLocked(requestId,
                        MetricsEvent.AUTOFILL_INVALID_DATASET_AUTHENTICATION);
            }