summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Wale Ogunwale <ogunwale@google.com> 2016-05-23 09:10:24 -0700
committer Wale Ogunwale <ogunwale@google.com> 2016-05-23 09:10:24 -0700
commit8c09c7dd7a8838383a94ef85974a8ff0841dd8c5 (patch)
tree097453a0cd58deefec3fa2710c809764f09913fa
parentd86ac8116bfc64c61d8124ff8d3e92be5e55cd3e (diff)
Fixed flicker when docking task from recents.
Regression introduced by ag/1044640 where we don't want recents to the visible if it's stack isn't fullscreen or focused. However, it is possible for switching the home stack to not-fullscreen to prolonged while transitioning to split-screen mode from recents. We now check for if the docked stack exists which is a better indicator we are in split-screen mode regardless of if the stask is fullscreen. Bug: 28882948 Bug: 28246419 Change-Id: I54c02cc1486e7b5bf6a20dd0706c9bfe3f40a953
-rw-r--r--services/core/java/com/android/server/am/ActivityStack.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index 3811b616a7f2..9718ae86d42e 100644
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -1819,22 +1819,24 @@ final class ActivityStack {
private boolean shouldBeVisible(ActivityRecord r, boolean behindTranslucentActivity,
boolean stackVisibleBehind, ActivityRecord visibleBehind,
boolean behindFullscreenActivity) {
- // mLaunchingBehind: Activities launching behind are at the back of the task stack
- // but must be drawn initially for the animation as though they were visible.
- final boolean activityVisibleBehind =
- (behindTranslucentActivity || stackVisibleBehind) && visibleBehind == r;
if (!okToShowLocked(r)) {
return false;
}
+ // mLaunchingBehind: Activities launching behind are at the back of the task stack
+ // but must be drawn initially for the animation as though they were visible.
+ final boolean activityVisibleBehind =
+ (behindTranslucentActivity || stackVisibleBehind) && visibleBehind == r;
+
boolean isVisible =
!behindFullscreenActivity || r.mLaunchTaskBehind || activityVisibleBehind;
if (isVisible && r.isRecentsActivity()) {
- // Recents activity can only be visible if the home stack isn't fullscreen or is the
- // focused stack.
- isVisible = !mFullscreen || mStackSupervisor.isFocusedStack(this);
+ // Recents activity can only be visible if the home stack is the focused stack or we are
+ // in split-screen mode.
+ isVisible = mStackSupervisor.getStack(DOCKED_STACK_ID) != null
+ || mStackSupervisor.isFocusedStack(this);
}
return isVisible;