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

Commit c469f760 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Do not abort launch logger by invisible drawn activity" into rvc-qpr-dev

parents 2884b150 c0f0e1b2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -264,7 +264,7 @@ class ActivityMetricsLogger {
                return;
            }
            mLastLaunchedActivity = r;
            if (!r.noDisplay) {
            if (!r.noDisplay && !r.mDrawn) {
                if (DEBUG_METRICS) Slog.i(TAG, "Add pending draw " + r);
                mPendingDrawActivities.add(r);
            }
@@ -546,7 +546,7 @@ class ActivityMetricsLogger {
                    + " processSwitch=" + processSwitch + " info=" + info);
        }

        if (launchedActivity.mDrawn) {
        if (launchedActivity.mDrawn && launchedActivity.isVisible()) {
            // Launched activity is already visible. We cannot measure windows drawn delay.
            abort(info, "launched activity already visible");
            return;
+16 −0
Original line number Diff line number Diff line
@@ -311,6 +311,22 @@ public class ActivityMetricsLaunchObserverTests extends ActivityTestsBase {
        verifyNoMoreInteractions(mLaunchObserver);
    }

    @Test
    public void testActivityDrawnBeforeTransition() {
        mTopActivity.setVisible(false);
        notifyActivityLaunching(mTopActivity.intent);
        // Assume the activity is launched the second time consecutively. The drawn event is from
        // the first time (omitted in test) launch that is earlier than transition.
        mTopActivity.mDrawn = true;
        notifyWindowsDrawn(mTopActivity);
        notifyActivityLaunched(START_SUCCESS, mTopActivity);
        // If the launching activity was drawn when starting transition, the launch event should
        // be reported successfully.
        notifyTransitionStarting(mTopActivity);

        verifyOnActivityLaunchFinished(mTopActivity);
    }

    @Test
    public void testActivityRecordProtoIsNotTooBig() {
        // The ActivityRecordProto must not be too big, otherwise converting it at runtime