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

Commit dbd54dea authored by Simranjit Kohli's avatar Simranjit Kohli
Browse files

Implement additional logging for FieldClassification

Bug: 298208475
Test: m (build) and tested manually the presennce of the log, and the value.
Change-Id: I4828c551695f55092a2bf65f6bd7a121bdc74148
parent 999851ca
Loading
Loading
Loading
Loading
+39 −2
Original line number Original line Diff line number Diff line
@@ -17,12 +17,19 @@
package com.android.server.autofill;
package com.android.server.autofill;


import static com.android.internal.util.FrameworkStatsLog.AUTOFILL_FIELD_CLASSIFICATION_EVENT_REPORTED;
import static com.android.internal.util.FrameworkStatsLog.AUTOFILL_FIELD_CLASSIFICATION_EVENT_REPORTED;
import static com.android.internal.util.FrameworkStatsLog.AUTOFILL_FIELD_CLASSIFICATION_EVENT_REPORTED__STATUS__STATUS_CANCELLED;
import static com.android.internal.util.FrameworkStatsLog.AUTOFILL_FIELD_CLASSIFICATION_EVENT_REPORTED__STATUS__STATUS_FAIL;
import static com.android.internal.util.FrameworkStatsLog.AUTOFILL_FIELD_CLASSIFICATION_EVENT_REPORTED__STATUS__STATUS_SUCCESS;
import static com.android.internal.util.FrameworkStatsLog.AUTOFILL_FIELD_CLASSIFICATION_EVENT_REPORTED__STATUS__STATUS_UNKNOWN;
import static com.android.server.autofill.Helper.sVerbose;
import static com.android.server.autofill.Helper.sVerbose;


import android.annotation.IntDef;
import android.util.Slog;
import android.util.Slog;


import com.android.internal.util.FrameworkStatsLog;
import com.android.internal.util.FrameworkStatsLog;


import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Optional;
import java.util.Optional;


/**
/**
@@ -36,6 +43,29 @@ public final class FieldClassificationEventLogger {
        mEventInternal = Optional.empty();
        mEventInternal = Optional.empty();
    }
    }


    public static final int STATUS_SUCCESS =
            AUTOFILL_FIELD_CLASSIFICATION_EVENT_REPORTED__STATUS__STATUS_SUCCESS;
    public static final int STATUS_UNKNOWN =
            AUTOFILL_FIELD_CLASSIFICATION_EVENT_REPORTED__STATUS__STATUS_UNKNOWN;
    public static final int STATUS_FAIL =
            AUTOFILL_FIELD_CLASSIFICATION_EVENT_REPORTED__STATUS__STATUS_FAIL;
    public static final int STATUS_CANCELLED =
            AUTOFILL_FIELD_CLASSIFICATION_EVENT_REPORTED__STATUS__STATUS_CANCELLED;

    /**
     * Status of the FieldClassification IPC request. These are wrappers around
     * {@link com.android.os.AtomsProto.AutofillFieldClassificationEventReported.FieldClassificationRequestStatus}.
     */
    @IntDef(prefix = {"STATUS"}, value = {
            STATUS_UNKNOWN,
            STATUS_SUCCESS,
            STATUS_FAIL,
            STATUS_CANCELLED
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface FieldClassificationStatus {
    }

    /**
    /**
     * A factory constructor to create FieldClassificationEventLogger.
     * A factory constructor to create FieldClassificationEventLogger.
     */
     */
@@ -112,7 +142,7 @@ public final class FieldClassificationEventLogger {
    /**
    /**
     * Set status as long as mEventInternal presents.
     * Set status as long as mEventInternal presents.
     */
     */
    public void maybeSetRequestStatus(int status) {
    public void maybeSetRequestStatus(@FieldClassificationStatus int status) {
        mEventInternal.ifPresent(event -> {
        mEventInternal.ifPresent(event -> {
            event.mStatus = status;
            event.mStatus = status;
        });
        });
@@ -140,7 +170,14 @@ public final class FieldClassificationEventLogger {
        if (sVerbose) {
        if (sVerbose) {
            Slog.v(TAG, "Log AutofillFieldClassificationEventReported:"
            Slog.v(TAG, "Log AutofillFieldClassificationEventReported:"
                    + " mLatencyClassificationRequestMillis="
                    + " mLatencyClassificationRequestMillis="
                    + event.mLatencyClassificationRequestMillis);
                    + event.mLatencyClassificationRequestMillis
                    + " mCountClassifications=" + event.mCountClassifications
                    + " mSessionId=" + event.mSessionId
                    + " mRequestId=" + event.mRequestId
                    + " mNextFillRequestId=" + event.mNextFillRequestId
                    + " mAppPackageUid=" + event.mAppPackageUid
                    + " mStatus=" + event.mStatus
                    + " mIsSessionGc=" + event.mIsSessionGc);
        }
        }
        FrameworkStatsLog.write(
        FrameworkStatsLog.write(
                AUTOFILL_FIELD_CLASSIFICATION_EVENT_REPORTED,
                AUTOFILL_FIELD_CLASSIFICATION_EVENT_REPORTED,
+17 −15
Original line number Original line Diff line number Diff line
@@ -211,15 +211,25 @@ public final class PresentationStatsEventLogger {
    public static final int DETECTION_PREFER_PCC =
    public static final int DETECTION_PREFER_PCC =
            AUTOFILL_FILL_RESPONSE_REPORTED__DETECTION_PREFERENCE__DETECTION_PREFER_PCC;
            AUTOFILL_FILL_RESPONSE_REPORTED__DETECTION_PREFERENCE__DETECTION_PREFER_PCC;
    private final int mSessionId;
    private final int mSessionId;

    /**
     * For app_package_uid.
     */
    private final int mCallingAppUid;
    private Optional<PresentationStatsEventInternal> mEventInternal;
    private Optional<PresentationStatsEventInternal> mEventInternal;


    private PresentationStatsEventLogger(int sessionId) {
    private PresentationStatsEventLogger(int sessionId, int callingAppUid) {
        mSessionId = sessionId;
        mSessionId = sessionId;
        mCallingAppUid = callingAppUid;
        mEventInternal = Optional.empty();
        mEventInternal = Optional.empty();
    }
    }


    public static PresentationStatsEventLogger forSessionId(int sessionId) {
    /**
        return new PresentationStatsEventLogger(sessionId);
     * Create PresentationStatsEventLogger, populated with sessionId and the callingAppUid
     */
    public static PresentationStatsEventLogger createPresentationLog(
            int sessionId, int callingAppUid) {
        return new PresentationStatsEventLogger(sessionId, callingAppUid);
    }
    }


    public void startNewEvent() {
    public void startNewEvent() {
@@ -517,15 +527,6 @@ public final class PresentationStatsEventLogger {
        });
        });
    }
    }


    /**
     * Set app_package_uid as long as mEventInternal presents.
     */
    public void maybeSetAppPackageUid(int uid) {
        mEventInternal.ifPresent(event -> {
            event.mAppPackageUid = uid;
        });
    }

    public void logAndEndEvent() {
    public void logAndEndEvent() {
        if (!mEventInternal.isPresent()) {
        if (!mEventInternal.isPresent()) {
            Slog.w(TAG, "Shouldn't be logging AutofillPresentationEventReported again for same "
            Slog.w(TAG, "Shouldn't be logging AutofillPresentationEventReported again for same "
@@ -564,7 +565,9 @@ public final class PresentationStatsEventLogger {
                    + " mAvailablePccCount=" + event.mAvailablePccCount
                    + " mAvailablePccCount=" + event.mAvailablePccCount
                    + " mAvailablePccOnlyCount=" + event.mAvailablePccOnlyCount
                    + " mAvailablePccOnlyCount=" + event.mAvailablePccOnlyCount
                    + " mSelectedDatasetPickedReason=" + event.mSelectedDatasetPickedReason
                    + " mSelectedDatasetPickedReason=" + event.mSelectedDatasetPickedReason
                    + " mDetectionPreference=" + event.mDetectionPreference);
                    + " mDetectionPreference=" + event.mDetectionPreference
                    + " mFieldClassificationRequestId=" + event.mFieldClassificationRequestId
                    + " mAppPackageUid=" + mCallingAppUid);
        }
        }


        // TODO(b/234185326): Distinguish empty responses from other no presentation reasons.
        // TODO(b/234185326): Distinguish empty responses from other no presentation reasons.
@@ -603,7 +606,7 @@ public final class PresentationStatsEventLogger {
                event.mSelectedDatasetPickedReason,
                event.mSelectedDatasetPickedReason,
                event.mDetectionPreference,
                event.mDetectionPreference,
                event.mFieldClassificationRequestId,
                event.mFieldClassificationRequestId,
                event.mAppPackageUid);
                mCallingAppUid);
        mEventInternal = Optional.empty();
        mEventInternal = Optional.empty();
    }
    }


@@ -637,7 +640,6 @@ public final class PresentationStatsEventLogger {
        @DatasetPickedReason int mSelectedDatasetPickedReason = PICK_REASON_UNKNOWN;
        @DatasetPickedReason int mSelectedDatasetPickedReason = PICK_REASON_UNKNOWN;
        @DetectionPreference int mDetectionPreference = DETECTION_PREFER_UNKNOWN;
        @DetectionPreference int mDetectionPreference = DETECTION_PREFER_UNKNOWN;
        int mFieldClassificationRequestId = -1;
        int mFieldClassificationRequestId = -1;
        int mAppPackageUid = -1;


        PresentationStatsEventInternal() {}
        PresentationStatsEventInternal() {}
    }
    }
+43 −9
Original line number Original line Diff line number Diff line
@@ -69,6 +69,9 @@ final class RemoteFieldClassificationService
        void onClassificationRequestFailure(int requestId, @Nullable CharSequence message);
        void onClassificationRequestFailure(int requestId, @Nullable CharSequence message);
        void onClassificationRequestTimeout(int requestId);
        void onClassificationRequestTimeout(int requestId);
        void onServiceDied(@NonNull RemoteFieldClassificationService service);
        void onServiceDied(@NonNull RemoteFieldClassificationService service);
        void logFieldClassificationEvent(
                long startTime, @NonNull FieldClassificationResponse response,
                @FieldClassificationEventLogger.FieldClassificationStatus int status);
    }
    }


    RemoteFieldClassificationService(Context context, ComponentName serviceName,
    RemoteFieldClassificationService(Context context, ComponentName serviceName,
@@ -149,15 +152,24 @@ final class RemoteFieldClassificationService
                                new IFieldClassificationCallback.Stub() {
                                new IFieldClassificationCallback.Stub() {
                                    @Override
                                    @Override
                                    public void onCancellable(ICancellationSignal cancellation) {
                                    public void onCancellable(ICancellationSignal cancellation) {
                                        logLatency(startTime);
                                        if (sDebug) {
                                        if (sDebug) {
                                            Log.d(TAG, "onCancellable");
                                            Log.d(TAG, "onCancellable");
                                        }
                                        }
                                        FieldClassificationServiceCallbacks
                                                fieldClassificationServiceCallbacks =
                                                Helper.weakDeref(
                                                        fieldClassificationServiceCallbacksWeakRef,
                                                        TAG, "onCancellable "
                                                );
                                        logFieldClassificationEvent(
                                                startTime,
                                                fieldClassificationServiceCallbacks,
                                                FieldClassificationEventLogger.STATUS_CANCELLED,
                                                null);
                                    }
                                    }


                                    @Override
                                    @Override
                                    public void onSuccess(FieldClassificationResponse response) {
                                    public void onSuccess(FieldClassificationResponse response) {
                                        logLatency(startTime);
                                        if (sDebug) {
                                        if (sDebug) {
                                            if (Build.IS_DEBUGGABLE) {
                                            if (Build.IS_DEBUGGABLE) {
                                                Slog.d(TAG, "onSuccess Response: " + response);
                                                Slog.d(TAG, "onSuccess Response: " + response);
@@ -179,6 +191,11 @@ final class RemoteFieldClassificationService
                                                                fieldClassificationServiceCallbacksWeakRef,
                                                                fieldClassificationServiceCallbacksWeakRef,
                                                                TAG, "onSuccess "
                                                                TAG, "onSuccess "
                                                        );
                                                        );
                                        logFieldClassificationEvent(
                                                startTime,
                                                fieldClassificationServiceCallbacks,
                                                FieldClassificationEventLogger.STATUS_SUCCESS,
                                                response);
                                        if (fieldClassificationServiceCallbacks == null) {
                                        if (fieldClassificationServiceCallbacks == null) {
                                            return;
                                            return;
                                        }
                                        }
@@ -188,7 +205,6 @@ final class RemoteFieldClassificationService


                                    @Override
                                    @Override
                                    public void onFailure() {
                                    public void onFailure() {
                                        logLatency(startTime);
                                        if (sDebug) {
                                        if (sDebug) {
                                            Slog.d(TAG, "onFailure");
                                            Slog.d(TAG, "onFailure");
                                        }
                                        }
@@ -198,6 +214,11 @@ final class RemoteFieldClassificationService
                                                                fieldClassificationServiceCallbacksWeakRef,
                                                                fieldClassificationServiceCallbacksWeakRef,
                                                                TAG, "onFailure "
                                                                TAG, "onFailure "
                                                        );
                                                        );
                                        logFieldClassificationEvent(
                                                startTime,
                                                fieldClassificationServiceCallbacks,
                                                FieldClassificationEventLogger.STATUS_FAIL,
                                                null);
                                        if (fieldClassificationServiceCallbacks == null) {
                                        if (fieldClassificationServiceCallbacks == null) {
                                            return;
                                            return;
                                        }
                                        }
@@ -215,11 +236,24 @@ final class RemoteFieldClassificationService
                                }));
                                }));
    }
    }


    private void logLatency(long startTime) {
    private void logFieldClassificationEvent(
        final FieldClassificationEventLogger logger = FieldClassificationEventLogger.createLogger();
            long startTime,
            @Nullable FieldClassificationServiceCallbacks fieldClassificationServiceCallbacks,
            @FieldClassificationEventLogger.FieldClassificationStatus int status,
            FieldClassificationResponse response) {
        if (fieldClassificationServiceCallbacks == null) {
            final FieldClassificationEventLogger logger =
                    FieldClassificationEventLogger.createLogger();
            logger.startNewLogForRequest();
            logger.startNewLogForRequest();
            logger.maybeSetLatencyMillis(
            logger.maybeSetLatencyMillis(
                    SystemClock.elapsedRealtime() - startTime);
                    SystemClock.elapsedRealtime() - startTime);
            logger.maybeSetSessionGc(true);
            logger.maybeSetRequestStatus(status);
            logger.logAndEndEvent();
            logger.logAndEndEvent();
        } else {
            fieldClassificationServiceCallbacks.logFieldClassificationEvent(
                    startTime, response, status);
        }

    }
    }
}
}
+52 −4
Original line number Original line Diff line number Diff line
@@ -53,8 +53,8 @@ import static com.android.server.autofill.FillRequestEventLogger.TRIGGER_REASON_
import static com.android.server.autofill.FillRequestEventLogger.TRIGGER_REASON_SERVED_FROM_CACHED_RESPONSE;
import static com.android.server.autofill.FillRequestEventLogger.TRIGGER_REASON_SERVED_FROM_CACHED_RESPONSE;
import static com.android.server.autofill.FillResponseEventLogger.AVAILABLE_COUNT_WHEN_FILL_REQUEST_FAILED_OR_TIMEOUT;
import static com.android.server.autofill.FillResponseEventLogger.AVAILABLE_COUNT_WHEN_FILL_REQUEST_FAILED_OR_TIMEOUT;
import static com.android.server.autofill.FillResponseEventLogger.DETECTION_PREFER_AUTOFILL_PROVIDER;
import static com.android.server.autofill.FillResponseEventLogger.DETECTION_PREFER_AUTOFILL_PROVIDER;
import static com.android.server.autofill.FillResponseEventLogger.DETECTION_PREFER_UNKNOWN;
import static com.android.server.autofill.FillResponseEventLogger.DETECTION_PREFER_PCC;
import static com.android.server.autofill.FillResponseEventLogger.DETECTION_PREFER_PCC;
import static com.android.server.autofill.FillResponseEventLogger.DETECTION_PREFER_UNKNOWN;
import static com.android.server.autofill.FillResponseEventLogger.HAVE_SAVE_TRIGGER_ID;
import static com.android.server.autofill.FillResponseEventLogger.HAVE_SAVE_TRIGGER_ID;
import static com.android.server.autofill.FillResponseEventLogger.RESPONSE_STATUS_FAILURE;
import static com.android.server.autofill.FillResponseEventLogger.RESPONSE_STATUS_FAILURE;
import static com.android.server.autofill.FillResponseEventLogger.RESPONSE_STATUS_SESSION_DESTROYED;
import static com.android.server.autofill.FillResponseEventLogger.RESPONSE_STATUS_SESSION_DESTROYED;
@@ -228,6 +228,8 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState


    private static final String PCC_HINTS_DELIMITER = ",";
    private static final String PCC_HINTS_DELIMITER = ",";
    public static final String EXTRA_KEY_DETECTIONS = "detections";
    public static final String EXTRA_KEY_DETECTIONS = "detections";
    private static final int DEFAULT__FILL_REQUEST_ID_SNAPSHOT = -2;
    private static final int DEFAULT__FIELD_CLASSIFICATION_REQUEST_ID_SNAPSHOT = -2;


    final Object mLock;
    final Object mLock;


@@ -411,6 +413,20 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
    @GuardedBy("mLock")
    @GuardedBy("mLock")
    private long mUiShownTime;
    private long mUiShownTime;


    /**
     * Tracks the value of the fill request id at the time of issuing request for field
     * classification.
     */
    @GuardedBy("mLock")
    private int mFillRequestIdSnapshot = DEFAULT__FILL_REQUEST_ID_SNAPSHOT;

    /**
     * Tracks the value of the field classification id at the time of issuing request for fill
     * request.
     */
    @GuardedBy("mLock")
    private int mFieldClassificationIdSnapshot = DEFAULT__FIELD_CLASSIFICATION_REQUEST_ID_SNAPSHOT;

    @GuardedBy("mLock")
    @GuardedBy("mLock")
    private final LocalLog mUiLatencyHistory;
    private final LocalLog mUiLatencyHistory;


@@ -660,6 +676,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
            if (mPendingFillRequest == null) {
            if (mPendingFillRequest == null) {
                return;
                return;
            }
            }
            mFieldClassificationIdSnapshot = sIdCounterForPcc.get();


            if (mWaitForInlineRequest) {
            if (mWaitForInlineRequest) {
                if (mPendingInlineSuggestionsRequest == null) {
                if (mPendingInlineSuggestionsRequest == null) {
@@ -1215,6 +1232,8 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
                    + ", flags=" + flags);
                    + ", flags=" + flags);
        }
        }
        mPresentationStatsEventLogger.maybeSetRequestId(requestId);
        mPresentationStatsEventLogger.maybeSetRequestId(requestId);
        mPresentationStatsEventLogger.maybeSetFieldClassificationRequestId(
                mFieldClassificationIdSnapshot);
        mFillRequestEventLogger.maybeSetRequestId(requestId);
        mFillRequestEventLogger.maybeSetRequestId(requestId);
        mFillRequestEventLogger.maybeSetAutofillServiceUid(getAutofillServiceUid());
        mFillRequestEventLogger.maybeSetAutofillServiceUid(getAutofillServiceUid());
        if (mSessionFlags.mInlineSupportedByService) {
        if (mSessionFlags.mInlineSupportedByService) {
@@ -1284,6 +1303,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
    @GuardedBy("mLock")
    @GuardedBy("mLock")
    private void requestAssistStructureForPccLocked(int flags) {
    private void requestAssistStructureForPccLocked(int flags) {
        if (!mClassificationState.shouldTriggerRequest()) return;
        if (!mClassificationState.shouldTriggerRequest()) return;
        mFillRequestIdSnapshot = sIdCounter.get();
        mClassificationState.updatePendingRequest();
        mClassificationState.updatePendingRequest();
        // Get request id
        // Get request id
        int requestId;
        int requestId;
@@ -1368,7 +1388,8 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
        mStartTime = SystemClock.elapsedRealtime();
        mStartTime = SystemClock.elapsedRealtime();
        mLatencyBaseTime = mStartTime;
        mLatencyBaseTime = mStartTime;
        mRequestCount = 0;
        mRequestCount = 0;
        mPresentationStatsEventLogger = PresentationStatsEventLogger.forSessionId(sessionId);
        mPresentationStatsEventLogger = PresentationStatsEventLogger.createPresentationLog(
                sessionId, uid);
        mFillRequestEventLogger = FillRequestEventLogger.forSessionId(sessionId);
        mFillRequestEventLogger = FillRequestEventLogger.forSessionId(sessionId);
        mFillResponseEventLogger = FillResponseEventLogger.forSessionId(sessionId);
        mFillResponseEventLogger = FillResponseEventLogger.forSessionId(sessionId);
        mSessionCommittedEventLogger = SessionCommittedEventLogger.forSessionId(sessionId);
        mSessionCommittedEventLogger = SessionCommittedEventLogger.forSessionId(sessionId);
@@ -4206,6 +4227,8 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
                if (viewState.getResponse() != null) {
                if (viewState.getResponse() != null) {
                    FillResponse response = viewState.getResponse();
                    FillResponse response = viewState.getResponse();
                    mPresentationStatsEventLogger.maybeSetRequestId(response.getRequestId());
                    mPresentationStatsEventLogger.maybeSetRequestId(response.getRequestId());
                    mPresentationStatsEventLogger.maybeSetFieldClassificationRequestId(
                            mFieldClassificationIdSnapshot);
                    mPresentationStatsEventLogger.maybeSetAvailableCount(
                    mPresentationStatsEventLogger.maybeSetAvailableCount(
                            response.getDatasets(), mCurrentViewId);
                            response.getDatasets(), mCurrentViewId);
                }
                }
@@ -4375,6 +4398,8 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
    public void onFillReady(@NonNull FillResponse response, @NonNull AutofillId filledId,
    public void onFillReady(@NonNull FillResponse response, @NonNull AutofillId filledId,
            @Nullable AutofillValue value, int flags) {
            @Nullable AutofillValue value, int flags) {
        synchronized (mLock) {
        synchronized (mLock) {
            mPresentationStatsEventLogger.maybeSetFieldClassificationRequestId(
                    mFieldClassificationIdSnapshot);
            if (mDestroyed) {
            if (mDestroyed) {
                Slog.w(TAG, "Call to Session#onFillReady() rejected - session: "
                Slog.w(TAG, "Call to Session#onFillReady() rejected - session: "
                        + id + " destroyed");
                        + id + " destroyed");
@@ -5266,6 +5291,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState


        List<Dataset> datasetList = newResponse.getDatasets();
        List<Dataset> datasetList = newResponse.getDatasets();


        mPresentationStatsEventLogger.maybeSetFieldClassificationRequestId(sIdCounterForPcc.get());
        mPresentationStatsEventLogger.maybeSetAvailableCount(datasetList, mCurrentViewId);
        mPresentationStatsEventLogger.maybeSetAvailableCount(datasetList, mCurrentViewId);
        mFillResponseEventLogger.maybeSetDatasetsCountAfterPotentialPccFiltering(datasetList);
        mFillResponseEventLogger.maybeSetDatasetsCountAfterPotentialPccFiltering(datasetList);


@@ -6308,7 +6334,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
        return serviceInfo == null ? Process.INVALID_UID : serviceInfo.applicationInfo.uid;
        return serviceInfo == null ? Process.INVALID_UID : serviceInfo.applicationInfo.uid;
    }
    }


    // FieldClassificationServiceCallbacks
    // FieldClassificationServiceCallbacks start
    public void onClassificationRequestSuccess(@Nullable FieldClassificationResponse response) {
    public void onClassificationRequestSuccess(@Nullable FieldClassificationResponse response) {
        mClassificationState.updateResponseReceived(response);
        mClassificationState.updateResponseReceived(response);
    }
    }
@@ -6329,6 +6355,28 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
            // forceRemoveFromServiceLocked();
            // forceRemoveFromServiceLocked();
        }
        }
    }
    }
    // DetectionServiceCallbacks end

    @Override
    public void logFieldClassificationEvent(
            long startTime, FieldClassificationResponse response,
            @FieldClassificationEventLogger.FieldClassificationStatus int status) {
        final FieldClassificationEventLogger logger = FieldClassificationEventLogger.createLogger();
        logger.startNewLogForRequest();
        logger.maybeSetLatencyMillis(
                SystemClock.elapsedRealtime() - startTime);
        logger.maybeSetAppPackageUid(uid);
        logger.maybeSetNextFillRequestId(mFillRequestIdSnapshot + 1);
        logger.maybeSetRequestId(sIdCounterForPcc.get());
        logger.maybeSetSessionId(id);
        int count = -1;
        if (response != null) {
            count = response.getClassifications().size();
        }
        logger.maybeSetRequestStatus(status);
        logger.maybeSetCountClassifications(count);
        logger.logAndEndEvent();
        mFillRequestIdSnapshot = DEFAULT__FILL_REQUEST_ID_SNAPSHOT;
    }
    // FieldClassificationServiceCallbacks end


}
}