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

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

Merge "Add launch type in activity startup trace"

parents ee7c5dda fac98037
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -237,9 +237,21 @@ class ActivityMetricsLogger {
            if (mAssociatedTransitionInfo == null) {
                launchResult = ":failed";
            } else {
                launchResult = (abort ? ":canceled:" : mAssociatedTransitionInfo.mProcessSwitch
                        ? ":completed:" : ":completed-same-process:")
                        + mAssociatedTransitionInfo.mLastLaunchedActivity.packageName;
                final String status;
                if (abort) {
                    status = ":canceled:";
                } else if (!mAssociatedTransitionInfo.mProcessSwitch) {
                    status = ":completed-same-process:";
                } else {
                    if (endInfo.mTransitionType == TYPE_TRANSITION_HOT_LAUNCH) {
                        status = ":completed-hot:";
                    } else if (endInfo.mTransitionType == TYPE_TRANSITION_WARM_LAUNCH) {
                        status = ":completed-warm:";
                    } else {
                        status = ":completed-cold:";
                    }
                }
                launchResult = status + mAssociatedTransitionInfo.mLastLaunchedActivity.packageName;
            }
            // Put a supplement trace as the description of the async trace with the same id.
            Trace.instant(Trace.TRACE_TAG_ACTIVITY_MANAGER, mTraceName + launchResult);