AML: Rollback calculation of launch time temporally

If a trampoline activity becomes invisible before it reporting
drawn, it should be excluded from the condition of all-drawn.

Bug: 132736359
Test: atest ActivityMetricsLaunchObserverTests
Change-Id: I61b76546e9b3aa977f4d1969d709c64240e7ed5d
This commit is contained in:
Riddle Hsu
2019-10-22 18:41:51 +08:00
parent f9527fd0ed
commit 99f2acdb4d
2 changed files with 2 additions and 7 deletions

View File

@@ -187,7 +187,8 @@ class ActivityMetricsLogger {
private int startingWindowDelayMs = INVALID_DELAY;
private int bindApplicationDelayMs = INVALID_DELAY;
private int reason = APP_TRANSITION_TIMEOUT;
private int numUndrawnActivities;
// TODO(b/132736359) The number may need to consider the visibility change.
private int numUndrawnActivities = 1;
private boolean loggedStartingWindowDrawn;
private boolean launchTraceActive;
@@ -201,9 +202,6 @@ class ActivityMetricsLogger {
return;
}
launchedActivity = r;
if (!r.noDisplay) {
numUndrawnActivities++;
}
}
}

View File

@@ -208,9 +208,6 @@ public class ActivityMetricsLaunchObserverTests extends ActivityTestsBase {
notifyWindowsDrawn(mTrampolineActivity);
assertWithMessage("Trampoline activity is drawn but the top activity is not yet")
.that(mActivityMetricsLogger.allWindowsDrawn()).isFalse();
notifyWindowsDrawn(mTopActivity);
verifyAsync(mLaunchObserver).onActivityLaunchFinished(eqProto(mTrampolineActivity),