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

Commit a957038f authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Remove last transition info after it is logged

Otherwise if the activity calls Activity#reportFullyDrawn every
time after it is created, the metrics will be reported again
with unexpected values if it is relaunched, e.g. rotation change.

Bug: 123355661
Test: No "Fully drawn" log by activity relaunched
Change-Id: I16bd816c8f0af8c28c2b2ac38994d9daa9c0ba96
parent 5f6672f1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -978,6 +978,7 @@ class ActivityMetricsLogger {
        final TransitionInfoSnapshot infoSnapshot =
                new TransitionInfoSnapshot(info, r, (int) startupTimeMs);
        BackgroundThread.getHandler().post(() -> logAppFullyDrawn(infoSnapshot));
        mLastTransitionInfo.remove(r);

        if (!info.isInterestingToLoggerAndObserver()) {
            return infoSnapshot;