From 91cf7b3fc4855d998b407c96bf4d4446be40dff2 Mon Sep 17 00:00:00 2001 From: mpodolian Date: Thu, 19 Dec 2024 16:59:09 -0800 Subject: [PATCH] Fix hotseat QSB squished issue Added logic to do not adjust hotseat and QSB if the bubble bar is not visible. Test: Manual. Unfold foldable device, open bubbles test application, trigger bubble via adb, wait until bubble bar is stashed, unfold the device, go back to the home screen. Observe hotseat and QSB are not squished. Flag: com.android.wm.shell.enable_bubble_bar Fixes: 384903202 Change-Id: Ib03e02d977de6357069470171952afb20c681f20 --- .../taskbar/LauncherTaskbarUIController.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java index 7d75286312..3d30cee1b7 100644 --- a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java +++ b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java @@ -41,6 +41,7 @@ import com.android.launcher3.logging.InstanceId; import com.android.launcher3.logging.InstanceIdSequence; import com.android.launcher3.model.data.ItemInfo; import com.android.launcher3.taskbar.bubbles.BubbleBarController; +import com.android.launcher3.taskbar.bubbles.BubbleControllers; import com.android.launcher3.uioverrides.QuickstepLauncher; import com.android.launcher3.util.DisplayController; import com.android.launcher3.util.MultiPropertyFactory; @@ -87,7 +88,7 @@ public class LauncherTaskbarUIController extends TaskbarUIController { private final DeviceProfile.OnDeviceProfileChangeListener mOnDeviceProfileChangeListener = dp -> { onStashedInAppChanged(dp); - adjustHotseatForBubbleBar(); + postAdjustHotseatForBubbleBar(); if (mControllers != null && mControllers.taskbarViewController != null) { mControllers.taskbarViewController.onRotationChanged(dp); } @@ -273,13 +274,16 @@ public class LauncherTaskbarUIController extends TaskbarUIController { } } - private void adjustHotseatForBubbleBar() { + private void postAdjustHotseatForBubbleBar() { Hotseat hotseat = mLauncher.getHotseat(); - if (mControllers.bubbleControllers.isEmpty() || hotseat == null) return; - boolean hiddenForBubbles = - mControllers.bubbleControllers.get().bubbleBarViewController.isHiddenForNoBubbles(); - if (hiddenForBubbles) return; - hotseat.post(() -> adjustHotseatForBubbleBar(/* isBubbleBarVisible= */ true)); + if (hotseat == null || !isBubbleBarVisible()) return; + hotseat.post(() -> adjustHotseatForBubbleBar(isBubbleBarVisible())); + } + + private boolean isBubbleBarVisible() { + BubbleControllers bubbleControllers = mControllers.bubbleControllers.orElse(null); + return bubbleControllers != null + && bubbleControllers.bubbleBarViewController.isBubbleBarVisible(); } /**