WM's AppWindowToken.updateReportedVisibilityLocked() may not report
nowVisible if the app has animation set. So nowVisibible could be false
for a while after the app is already on screen. If we finish the app in
this state, we still need to wait for next app to be visible.
bug:
28019637
Change-Id: I4f9f8e138f5d011a9ab393913159ed2978d26e0d
// First things first: if this activity is currently visible,
// and the resumed activity is not yet visible, then hold off on
// finishing until the resumed one becomes visible.
- if (mode == FINISH_AFTER_VISIBLE && r.nowVisible) {
+ if (mode == FINISH_AFTER_VISIBLE && (r.visible || r.nowVisible)) {
if (!mStackSupervisor.mStoppingActivities.contains(r)) {
addToStopping(r, false /* immediate */);
}