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

Commit 2ed1c1d7 authored by Daniel Kim's avatar Daniel Kim Committed by Android (Google) Code Review
Browse files

Merge "Log Fill Response metric for secondary provider" into main

parents 6bf8e9bd 7210ff45
Loading
Loading
Loading
Loading
+30 −0
Original line number Original line Diff line number Diff line
@@ -1735,6 +1735,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState


        processResponseLockedForPcc(response, response.getClientState(), requestFlags);
        processResponseLockedForPcc(response, response.getClientState(), requestFlags);
        mFillResponseEventLogger.maybeSetLatencyResponseProcessingMillis();
        mFillResponseEventLogger.maybeSetLatencyResponseProcessingMillis();
        mFillResponseEventLogger.logAndEndEvent();
    }
    }




@@ -1847,6 +1848,33 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
            return;
            return;
        }
        }
        synchronized (mLock) {
        synchronized (mLock) {
            // TODO(b/319913595): refactor logging for fill response for primary and secondary
            //  providers
            // Start a new FillResponse logger for the success case.
            mFillResponseEventLogger.startLogForNewResponse();
            mFillResponseEventLogger.maybeSetRequestId(fillResponse.getRequestId());
            mFillResponseEventLogger.maybeSetAppPackageUid(uid);
            mFillResponseEventLogger.maybeSetResponseStatus(RESPONSE_STATUS_SUCCESS);
            mFillResponseEventLogger.startResponseProcessingTime();
            // Time passed since session was created
            final long fillRequestReceivedRelativeTimestamp =
                    SystemClock.elapsedRealtime() - mLatencyBaseTime;
            mPresentationStatsEventLogger.maybeSetFillResponseReceivedTimestampMs(
                    (int) (fillRequestReceivedRelativeTimestamp));
            mFillResponseEventLogger.maybeSetLatencyFillResponseReceivedMillis(
                    (int) (fillRequestReceivedRelativeTimestamp));
            if (mDestroyed) {
                Slog.w(TAG, "Call to Session#onSecondaryFillResponse() rejected - session: "
                        + id + " destroyed");
                mFillResponseEventLogger.maybeSetResponseStatus(RESPONSE_STATUS_SESSION_DESTROYED);
                mFillResponseEventLogger.logAndEndEvent();
                return;
            }

            List<Dataset> datasetList = fillResponse.getDatasets();
            int datasetCount = (datasetList == null) ? 0 : datasetList.size();
            mFillResponseEventLogger.maybeSetTotalDatasetsProvided(datasetCount);
            mFillResponseEventLogger.maybeSetAvailableCount(datasetCount);
            if (mSecondaryResponses == null) {
            if (mSecondaryResponses == null) {
                mSecondaryResponses = new SparseArray<>(2);
                mSecondaryResponses = new SparseArray<>(2);
            }
            }
@@ -1859,6 +1887,8 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
            if (currentView != null) {
            if (currentView != null) {
                currentView.maybeCallOnFillReady(flags);
                currentView.maybeCallOnFillReady(flags);
            }
            }
            mFillResponseEventLogger.maybeSetLatencyResponseProcessingMillis();
            mFillResponseEventLogger.logAndEndEvent();
        }
        }
    }
    }