From b967adf753d87252fe45808a257c449093f397d6 Mon Sep 17 00:00:00 2001 From: Mady Mellor Date: Mon, 13 Jun 2022 16:12:17 -0700 Subject: [PATCH] Fix an issue where tasks moving to front would collapse the stack. ag/18759417 introduced a new call to onTaskMovedToFront which impacted some bubbles behavior, basically while switching bubbles the "background" app now appears to move to the front for a moment which causes bubbles to be collapsed. The fix is to flip the flag for bubbles switching a bit sooner than we already do. Test: manual - have some bubbles, visit each of them once (i.e. have the activity launched), then visit them all again => verify all the bubbles can be visited both times and the stack doesn't collapse. Bug: 235781358 Change-Id: Id0674cafd92d5aeb802a0da77a679996e7041b74 --- .../src/com/android/wm/shell/bubbles/BubbleStackView.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java index 0e8dc63943a60..0a334140d6161 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java @@ -2220,11 +2220,10 @@ public class BubbleStackView extends FrameLayout private void animateSwitchBubbles() { // If we're no longer expanded, this is meaningless. if (!mIsExpanded) { + mIsBubbleSwitchAnimating = false; return; } - mIsBubbleSwitchAnimating = true; - // The surface contains a screenshot of the animating out bubble, so we just need to animate // it out (and then release the GraphicBuffer). PhysicsAnimator.getInstance(mAnimatingOutSurfaceContainer).cancel(); @@ -2838,6 +2837,7 @@ public class BubbleStackView extends FrameLayout }, 0); if (!mIsExpansionAnimating) { + mIsBubbleSwitchAnimating = true; mSurfaceSynchronizer.syncSurfaceAndRun(() -> { post(this::animateSwitchBubbles); });