From 98742a58710b2feaee0b8fd27bf47e6f1427df57 Mon Sep 17 00:00:00 2001 From: Wale Ogunwale Date: Tue, 12 Jul 2016 10:29:12 -0700 Subject: [PATCH] Do remove starting windows for activities in an invisible stack Depending on app launch timing it is possible for the initializing activity that is the top of an invisible stack to still have its starting window visible since we skip removing orphaned starting window for the top activity in a stack. We now remove starting windows for all activities in an invisible stack. Bug: 28173906 Change-Id: Ie5284c9681d06969f647cbe46a77dd072ca61435 --- .../core/java/com/android/server/am/ActivityStack.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java index a10266483834e..eb02dc34e1a27 100644 --- a/services/core/java/com/android/server/am/ActivityStack.java +++ b/services/core/java/com/android/server/am/ActivityStack.java @@ -2051,6 +2051,14 @@ final class ActivityStack { // We don't want to clear starting window for activities that aren't behind fullscreen // activities as we need to display their starting window until they are done initializing. boolean behindFullscreenActivity = false; + + if (getStackVisibilityLocked(null) == STACK_INVISIBLE) { + // The stack is not visible, so no activity in it should be displaying a starting + // window. Mark all activities below top and behind fullscreen. + aboveTop = false; + behindFullscreenActivity = true; + } + for (int taskNdx = mTaskHistory.size() - 1; taskNdx >= 0; --taskNdx) { final ArrayList activities = mTaskHistory.get(taskNdx).mActivities; for (int activityNdx = activities.size() - 1; activityNdx >= 0; --activityNdx) {