From 031570278fb5361a75580486d55fa7ddd73120b4 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Wed, 19 Jul 2017 11:58:59 -0700 Subject: [PATCH] Disregard closing activities when blocking previous activities. - Extending the check added in ag/2468582, if a translucent assistant is started on top of a fullscreen activity and subsequently launches another fullscreen activity, then returning to the assistant should not preclude the otherwise visible fullscreen activity under the assistant. To do that, this logic should only stop checking for the visibility of the activities if the task is not finishing and will return to another task (otherwise this results in a black screen). Bug: 37527727 Bug: 63581322 Test: android.server.cts.ActivityManagerAssistantStackTests Test: go/wm-smoke Change-Id: Ib935b6023b55bda0797f7cb9849595d821ef7d11 --- .../core/java/com/android/server/am/ActivityStack.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java index 777a368874404..51e0e3bfd0220 100644 --- a/services/core/java/com/android/server/am/ActivityStack.java +++ b/services/core/java/com/android/server/am/ActivityStack.java @@ -1912,9 +1912,11 @@ class ActivityStack extends ConfigurationContai } else if (mStackId == FULLSCREEN_WORKSPACE_STACK_ID) { if (DEBUG_VISIBILITY) Slog.v(TAG_VISIBILITY, "Skipping after task=" + task + " returning to non-application type=" + task.getTaskToReturnTo()); - // Once we reach a fullscreen task that should return to another task, then no - // other activities behind that one should be visible. - if (task.getTaskToReturnTo() != APPLICATION_ACTIVITY_TYPE) { + // Once we reach a fullscreen stack task that has a running activity and should + // return to another stack task, then no other activities behind that one should + // be visible. + if (task.topRunningActivityLocked() != null && + task.getTaskToReturnTo() != APPLICATION_ACTIVITY_TYPE) { behindFullscreenActivity = true; } }