Fix shell-transit to legacy app-cancel metrics

When it performs a no-op, it should notify metrics-logger of
activity launch cancellations. Was blindly reporting everything
to start, now just report visible stuff.

This also fixes a problem during teardown where transition
collection wasn't waiting for pending pause.

Bug: 183993924
Test: atest ActivityMetricsLoggerTests
Change-Id: Ie0d4aea89b7e32744fdbd56a39d6266154015d32
This commit is contained in:
Evan Rosky
2021-08-03 20:02:42 -07:00
parent 92b3263924
commit f1204289fa
2 changed files with 3 additions and 1 deletions

View File

@@ -1340,6 +1340,8 @@ class TaskFragment extends WindowContainer<WindowContainer> {
} else {
prev.schedulePauseTimeout();
// Unset readiness since we now need to wait until this pause is complete.
mAtmService.getTransitionController().setReady(this, false /* ready */);
return true;
}

View File

@@ -657,7 +657,7 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
ArrayMap<WindowContainer, Integer> reasons = new ArrayMap<>();
for (int i = mParticipants.size() - 1; i >= 0; --i) {
ActivityRecord r = mParticipants.valueAt(i).asActivityRecord();
if (r == null) continue;
if (r == null || !r.mVisibleRequested) continue;
// At this point, r is "ready", but if it's not "ALL ready" then it is probably only
// ready due to starting-window.
reasons.put(r, (r.mStartingData instanceof SplashScreenStartingData