AML: Do not merge launch events on different displays
Generally multi-display is visually independent, so the launch
events on different displays should be tracked separately.
Bug: 123355661
Bug: 135197913
Test: atest ActivityMetricsLaunchObserverTests# \
testConsecutiveLaunchOnDifferentDisplay
Change-Id: I84e1e800654a440782ff9a85124449ce6d8078ba
diff --git a/services/core/java/com/android/server/wm/ActivityMetricsLogger.java b/services/core/java/com/android/server/wm/ActivityMetricsLogger.java
index c8357e2..1c010c7 100644
--- a/services/core/java/com/android/server/wm/ActivityMetricsLogger.java
+++ b/services/core/java/com/android/server/wm/ActivityMetricsLogger.java
@@ -543,9 +543,10 @@
return;
}
- if (info != null) {
- // If we are already in an existing transition, only update the activity name, but not
- // the other attributes.
+ if (info != null
+ && info.mLastLaunchedActivity.mDisplayContent == launchedActivity.mDisplayContent) {
+ // If we are already in an existing transition on the same display, only update the
+ // activity name, but not the other attributes.
if (DEBUG_METRICS) Slog.i(TAG, "notifyActivityLaunched update launched activity");
// Coalesce multiple (trampoline) activities from a single sequence together.