From a7821390e221e5d5a75be009c06ae850d02ba1ff Mon Sep 17 00:00:00 2001 From: Liran Binyamin Date: Mon, 8 Jul 2024 09:59:26 -0400 Subject: [PATCH] Fix squished hotseat due to bubbles Hotseat supports adjusting its layout to make room for bubbles when needed. There are 2 events that trigger this: 1. When Hotseat's layout is reset, it checks for whether bubbles are showing. 2. When Bubble Bar visibility changes it notifies hotseat so that it can update itself. Folding the device is recreated triggers both hotseat layout reset and recreation of taskbar, but the order in which these happen is not guaranteed. Sometimes hotseat checks for the status of bubble bar which may be visible if taskbar hasn't been recreated yet. This change makes sure that hotseat updates itself after taskbar is recreated and the ui controller is set, so that it cleans up any adjustments it may have if bubbles are not visible. Flag: com.android.wm.shell.enable_bubble_bar Fixes: 349430356 Test: manual - unfold the device - create bubbles - observe hotseat adjusts itself for the bubble bar - fold the device - observe bubble bar is gone and hotseat shows correctly Change-Id: I58d925c178b02c22583488ae081d478bbbbccc8c --- .../android/launcher3/taskbar/TaskbarActivityContext.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java index 21a826870e..bd7f40cc0a 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java @@ -792,6 +792,11 @@ public class TaskbarActivityContext extends BaseTaskbarContext { */ public void setUIController(@NonNull TaskbarUIController uiController) { mControllers.setUiController(uiController); + if (mControllers.bubbleControllers.isEmpty()) { + // if the bubble bar was visible in a previous configuration of taskbar and is being + // recreated now without bubbles, clean up any bubble bar adjustments from hotseat + bubbleBarVisibilityChanged(/* isVisible= */ false); + } } /**