From ba395508c583a852d91f0f5895ccb75a8d8d0502 Mon Sep 17 00:00:00 2001 From: Mady Mellor Date: Thu, 10 Mar 2022 22:54:17 +0000 Subject: [PATCH] Fix an issue where bubbles didn't collapse onTaskMovedToFront I noticed when opening settings while stack is expanded wouldn't cause the stack to collapse. This was because we skipped the collapse if the shade was expanded. I don't think there's any reason to be doing this, I think this was accidentally added during the refactor to move bubbles into shell. Test: manual - have bubbles expanded, pull down the shade, tap on the settings gear or long press on a tile, ensure that when the settings screen opens that the stack collapsed Bug: 223635739 Change-Id: Ia3476e694a8e64c95eed63dea4a3729e83766683 --- .../wm/shell/bubbles/BubbleController.java | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java index d0138a4882953..d2a1c55d1c29c 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java @@ -383,23 +383,15 @@ public class BubbleController { mTaskStackListener.addListener(new TaskStackListenerCallback() { @Override public void onTaskMovedToFront(int taskId) { - if (mSysuiProxy == null) { - return; - } - - mSysuiProxy.isNotificationShadeExpand((expand) -> { - mMainExecutor.execute(() -> { - int expandedId = INVALID_TASK_ID; - if (mStackView != null && mStackView.getExpandedBubble() != null - && isStackExpanded() && !mStackView.isExpansionAnimating() - && !expand) { - expandedId = mStackView.getExpandedBubble().getTaskId(); - } - - if (expandedId != INVALID_TASK_ID && expandedId != taskId) { - mBubbleData.setExpanded(false); - } - }); + mMainExecutor.execute(() -> { + int expandedId = INVALID_TASK_ID; + if (mStackView != null && mStackView.getExpandedBubble() != null + && isStackExpanded() && !mStackView.isExpansionAnimating()) { + expandedId = mStackView.getExpandedBubble().getTaskId(); + } + if (expandedId != INVALID_TASK_ID && expandedId != taskId) { + mBubbleData.setExpanded(false); + } }); }