From 05ef774e6e09b5d3ff033025e78bf00ebc6486b9 Mon Sep 17 00:00:00 2001 From: Liran Binyamin Date: Tue, 11 Jul 2023 17:12:00 -0400 Subject: [PATCH] Don't show the bubble bar when it is empty Sometimes the bubble bar shows when the launcher process starts up even when there are no bubbles. bubblesShowingOnHome is set to true when the launcher transitions into Home, but that state also triggers a call to showBubbleBar() which will eventually set the visibility on the bar. During initialization we also call setHiddenForNoBubbles to hide the bubble bar if it's empty, but these events happen separately so the bar may or may not be hidden. This change avoids calling showBubbleBar when setBubblesShowingOnHome is called and the bar is invisible. Instead the bubble bar will become visible once bubbles are added. Fixes: 290608658 Test: manual - Toggle bubbles off and back on in settings - Restart launcher - Observe the bubble bar is not displayed Change-Id: I30640764d7b6eae64e1c5b5c687760465bf9a7b1 --- .../launcher3/taskbar/bubbles/BubbleStashController.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleStashController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleStashController.java index 5177d932f1..348ec53c65 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleStashController.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleStashController.java @@ -125,6 +125,12 @@ public class BubbleStashController { public void setBubblesShowingOnHome(boolean onHome) { if (mBubblesShowingOnHome != onHome) { mBubblesShowingOnHome = onHome; + + if (!mBarViewController.isBubbleBarVisible()) { + // if the bubble bar is not visible, there are no bubbles, so just return. + return; + } + if (mBubblesShowingOnHome) { showBubbleBar(/* expanded= */ false); // When transitioning from app to home the stash animator may already have been