Also check idle to handle stopping activities

Animating activity may not have nowVisible=true (see
WindowSgtate#updateReportedVisibility) but it may be
already idle.

This restores the same condition as before commit edc4294.

Bug: 185807984
Test: atest DreamManagerServiceTests# \
            testStartTurnScreenOnActivityDoesWake
Change-Id: Iaaffb80bd9e1e339d36034bdb6a369562f59a41c
This commit is contained in:
Riddle Hsu
2021-04-20 14:54:20 +08:00
parent f98e690f9e
commit d854e004da

View File

@@ -2118,8 +2118,14 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
}
void scheduleProcessStoppingAndFinishingActivitiesIfNeeded() {
if ((!mStoppingActivities.isEmpty() || !mFinishingActivities.isEmpty())
&& !mHandler.hasMessages(PROCESS_STOPPING_AND_FINISHING_MSG)
if (mStoppingActivities.isEmpty() && mFinishingActivities.isEmpty()) {
return;
}
if (mRootWindowContainer.allResumedActivitiesIdle()) {
scheduleIdle();
return;
}
if (!mHandler.hasMessages(PROCESS_STOPPING_AND_FINISHING_MSG)
&& mRootWindowContainer.allResumedActivitiesVisible()) {
mHandler.sendEmptyMessage(PROCESS_STOPPING_AND_FINISHING_MSG);
}