Distinguish process-switch for launch trace

So the perfetto processor won't recognize in-app transition
as an app startup.

Bug: 231612200
Test: Launch Settings from launcher and enter sub settings.
      There will be 2 "launching: com.android.settings" but
      only one trace at "Android App Startups".
Change-Id: I14a4fc1981e69dd27e2a5027f519db2dab4fff9f
This commit is contained in:
Riddle Hsu
2022-05-16 19:08:07 +08:00
parent 659341ffd4
commit a55436d37b

View File

@@ -212,7 +212,8 @@ class ActivityMetricsLogger {
if (mAssociatedTransitionInfo == null) {
launchResult = ":failed";
} else {
launchResult = (abort ? ":canceled:" : ":completed:")
launchResult = (abort ? ":canceled:" : mAssociatedTransitionInfo.mProcessSwitch
? ":completed:" : ":completed-same-process:")
+ mAssociatedTransitionInfo.mLastLaunchedActivity.packageName;
}
// Put a supplement trace as the description of the async trace with the same id.