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
This commit is contained in:
mpodolian
2024-12-19 16:59:09 -08:00
parent 5f5b1a3f56
commit 91cf7b3fc4
@@ -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();
}
/**