From 1d7494b4a597032d4271eaf9d95080a04128bc6e Mon Sep 17 00:00:00 2001 From: Liran Binyamin Date: Wed, 12 Jul 2023 12:29:12 -0400 Subject: [PATCH] Check that the bubble bar has bubbles before showing it ag/24024252 relied on the bubble bar being invisible to indicate that the bar is empty. But that assumption was wrong. The bubble bar gets hidden when the device is locked. The result is that unlocking the device leaves the bubble bar stashed. This change actually verifies whether the bubble bar is empty before showing it. Fixes: 290608658 Test: Manual: - Have some bubbles in the bar - Lock the device and unlock - Observe that the bubble bar is unstashed Change-Id: I4ca5c10e0cec57d3c6b4e056e06ebcf04aa1571a --- .../launcher3/taskbar/bubbles/BubbleBarViewController.java | 5 +++++ .../launcher3/taskbar/bubbles/BubbleStashController.java | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java index ca0c4cc206..8e7fda8671 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java @@ -140,6 +140,11 @@ public class BubbleBarViewController { return mBarView.getVisibility() == VISIBLE; } + /** Whether the bubble bar has bubbles. */ + public boolean hasBubbles() { + return mBubbleBarController.getSelectedBubbleKey() != null; + } + /** * The bounds of the bubble bar. */ diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleStashController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleStashController.java index 348ec53c65..9b7db916cd 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleStashController.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleStashController.java @@ -126,8 +126,8 @@ public class BubbleStashController { if (mBubblesShowingOnHome != onHome) { mBubblesShowingOnHome = onHome; - if (!mBarViewController.isBubbleBarVisible()) { - // if the bubble bar is not visible, there are no bubbles, so just return. + if (!mBarViewController.hasBubbles()) { + // if there are no bubbles, there's nothing to show, so just return. return; }