From 96e3fd6713ea2e316195cf0b4db41256dced35f2 Mon Sep 17 00:00:00 2001 From: Ats Jenk Date: Fri, 28 Mar 2025 13:30:43 -0700 Subject: [PATCH] Tell WMShell when bubble bar is active or not active Use new Bubbles aidl method to tell WMShell when bubble bar is used or not used. Allows to better handle cases where taskbar (and bubble bar) get recreated during rotation. Bug: 357115534 Test: open an app, expand bubble bar, rotate device, check bubble remains expanded Flag: com.android.wm.shell.enable_bubble_bar Change-Id: I1c77eecb2b574b3d9b33aadafd1585e1aca26bdb --- .../com/android/launcher3/taskbar/TaskbarManagerImpl.java | 5 +++-- .../launcher3/taskbar/bubbles/BubbleBarController.java | 7 ++++--- quickstep/src/com/android/quickstep/SystemUiProxy.kt | 7 +++++++ 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarManagerImpl.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarManagerImpl.java index dabad1f73a..86fba3677c 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarManagerImpl.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarManagerImpl.java @@ -785,8 +785,9 @@ public class TaskbarManagerImpl implements DisplayDecorationListener { + " dp.isTaskbarPresent=" + (dp == null ? "null" : dp.isTaskbarPresent) + " displayExists=" + displayExists, displayId); if (!isTaskbarEnabled || !isLargeScreenTaskbar || !displayExists) { - SystemUiProxy.INSTANCE.get(mBaseContext) - .notifyTaskbarStatus(/* visible */ false, /* stashed */ false); + SystemUiProxy systemUiProxy = SystemUiProxy.INSTANCE.get(mBaseContext); + systemUiProxy.notifyTaskbarStatus(/* visible */ false, /* stashed */ false); + systemUiProxy.setHasBubbleBar(false); if (!isTaskbarEnabled || !displayExists) { debugTaskbarManager( "recreateTaskbarForDisplay: exiting bc (!isTaskbarEnabled || " diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java index 5ddbe032f9..58f63b2593 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java @@ -221,6 +221,7 @@ public class BubbleBarController extends IBubblesListener.Stub { mBubbleBarViewController.getBubbleBarLocation()); if (sBubbleBarEnabled) { mSystemUiProxy.setBubblesListener(this); + mSystemUiProxy.setHasBubbleBar(true); } }); } @@ -352,9 +353,6 @@ public class BubbleBarController extends IBubblesListener.Stub { BubbleBarBubble newlySelected = mBubbles.get(update.selectedBubbleKey); if (newlySelected != null) { bubbleToSelect = newlySelected; - } else { - Log.w(TAG, "trying to select bubble that doesn't exist:" - + update.selectedBubbleKey); } } } @@ -423,6 +421,9 @@ public class BubbleBarController extends IBubblesListener.Stub { for (int i = update.currentBubbles.size() - 1; i >= 0; i--) { BubbleBarBubble bubble = update.currentBubbles.get(i); if (bubble != null) { + if (bubble.getKey().equals(update.selectedBubbleKey)) { + bubbleToSelect = bubble; + } addBubbleInternally(bubble, isExpanding, suppressAnimation); if (isCollapsed && bubbleToSelect == null) { // If we're collapsed, the most recently added bubble will be selected. diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.kt b/quickstep/src/com/android/quickstep/SystemUiProxy.kt index 448d529c2f..26731c9f50 100644 --- a/quickstep/src/com/android/quickstep/SystemUiProxy.kt +++ b/quickstep/src/com/android/quickstep/SystemUiProxy.kt @@ -698,6 +698,13 @@ class SystemUiProxy @Inject constructor(@ApplicationContext private val context: } } + /** Tells SysUI whether bubble bar is used or not. */ + fun setHasBubbleBar(hasBubbleBar: Boolean) { + executeWithErrorLog({ "Failed call setHasBubbleBar" }) { + bubbles?.setHasBubbleBar(hasBubbleBar) + } + } + // // Splitscreen //