From 592bf0b7d54a236f85d969b9599245f7d0542609 Mon Sep 17 00:00:00 2001 From: Chong Zhang Date: Mon, 25 Apr 2016 13:17:53 -0700 Subject: [PATCH] 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 --- services/core/java/com/android/server/am/ActivityStack.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java index 5249131ae0ac6..a7c994b3c8074 100644 --- a/services/core/java/com/android/server/am/ActivityStack.java +++ b/services/core/java/com/android/server/am/ActivityStack.java @@ -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 */); }