Wait for next app to be visible if current activity is marked visible

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
This commit is contained in:
Chong Zhang
2016-04-25 13:17:53 -07:00
parent 5e40748d3f
commit 592bf0b7d5

View File

@@ -3457,7 +3457,7 @@ final class ActivityStack {
// 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 */);
}