Loading services/core/java/com/android/server/wm/ActivityMetricsLogger.java +2 −2 Original line number Diff line number Diff line Loading @@ -288,7 +288,7 @@ class ActivityMetricsLogger { return; } mLastLaunchedActivity = r; if (!r.noDisplay) { if (!r.noDisplay && !r.isReportedDrawn()) { if (DEBUG_METRICS) Slog.i(TAG, "Add pending draw " + r); mPendingDrawActivities.add(r); } Loading Loading @@ -576,7 +576,7 @@ class ActivityMetricsLogger { + " processSwitch=" + processSwitch + " info=" + info); } if (launchedActivity.isReportedDrawn()) { if (launchedActivity.isReportedDrawn() && launchedActivity.isVisible()) { // Launched activity is already visible. We cannot measure windows drawn delay. abort(info, "launched activity already visible"); return; Loading services/tests/wmtests/src/com/android/server/wm/ActivityMetricsLaunchObserverTests.java +16 −0 Original line number Diff line number Diff line Loading @@ -350,6 +350,22 @@ public class ActivityMetricsLaunchObserverTests extends WindowTestsBase { 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. doReturn(true).when(mTopActivity).isReportedDrawn(); 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 Loading Loading
services/core/java/com/android/server/wm/ActivityMetricsLogger.java +2 −2 Original line number Diff line number Diff line Loading @@ -288,7 +288,7 @@ class ActivityMetricsLogger { return; } mLastLaunchedActivity = r; if (!r.noDisplay) { if (!r.noDisplay && !r.isReportedDrawn()) { if (DEBUG_METRICS) Slog.i(TAG, "Add pending draw " + r); mPendingDrawActivities.add(r); } Loading Loading @@ -576,7 +576,7 @@ class ActivityMetricsLogger { + " processSwitch=" + processSwitch + " info=" + info); } if (launchedActivity.isReportedDrawn()) { if (launchedActivity.isReportedDrawn() && launchedActivity.isVisible()) { // Launched activity is already visible. We cannot measure windows drawn delay. abort(info, "launched activity already visible"); return; Loading
services/tests/wmtests/src/com/android/server/wm/ActivityMetricsLaunchObserverTests.java +16 −0 Original line number Diff line number Diff line Loading @@ -350,6 +350,22 @@ public class ActivityMetricsLaunchObserverTests extends WindowTestsBase { 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. doReturn(true).when(mTopActivity).isReportedDrawn(); 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 Loading