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

Commit 29dd7455 authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "Clear invisible undrawn activities when reporting drawn" into sc-v2-dev

parents a790ce39 a3beedb3
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -703,6 +703,7 @@ class ActivityMetricsLogger {
        // Always calculate the delay because the caller may need to know the individual drawn time.
        // Always calculate the delay because the caller may need to know the individual drawn time.
        info.mWindowsDrawnDelayMs = info.calculateDelay(timestampNs);
        info.mWindowsDrawnDelayMs = info.calculateDelay(timestampNs);
        info.removePendingDrawActivity(r);
        info.removePendingDrawActivity(r);
        info.updatePendingDraw(false /* keepInitializing */);
        final TransitionInfoSnapshot infoSnapshot = new TransitionInfoSnapshot(info);
        final TransitionInfoSnapshot infoSnapshot = new TransitionInfoSnapshot(info);
        if (info.mLoggedTransitionStarting && info.allDrawn()) {
        if (info.mLoggedTransitionStarting && info.allDrawn()) {
            done(false /* abort */, info, "notifyWindowsDrawn - all windows drawn", timestampNs);
            done(false /* abort */, info, "notifyWindowsDrawn - all windows drawn", timestampNs);
+10 −0
Original line number Original line Diff line number Diff line
@@ -475,6 +475,16 @@ public class ActivityMetricsLaunchObserverTests extends WindowTestsBase {
        transitToDrawnAndVerifyOnLaunchFinished(mTopActivity);
        transitToDrawnAndVerifyOnLaunchFinished(mTopActivity);
    }
    }


    @Test
    public void testConsecutiveLaunch() {
        mTrampolineActivity.setState(ActivityRecord.State.INITIALIZING, "test");
        onActivityLaunched(mTrampolineActivity);
        mActivityMetricsLogger.notifyActivityLaunching(mTopActivity.intent,
                mTrampolineActivity /* caller */, mTrampolineActivity.getUid());
        notifyActivityLaunched(START_SUCCESS, mTopActivity);
        transitToDrawnAndVerifyOnLaunchFinished(mTopActivity);
    }

    @Test
    @Test
    public void testConsecutiveLaunchNewTask() {
    public void testConsecutiveLaunchNewTask() {
        final IBinder launchCookie = mock(IBinder.class);
        final IBinder launchCookie = mock(IBinder.class);