Fix hotseat layout on device rotation.

When rotating the device, a few issues were causing improper hotseat
layout:

- BubbleBarController receives an initial configuration before the UI
controller is set.
- The updated device profile, including the correct `isQsbInline` value,
arrives after all controllers are recreated, and the UI controller is
not informed of the device profile update.

Added logic to carry over the bubble bar bubble visibility state to the
new UI controller. Included a call to notify the UI controller of the
device profile update.

Fixes: 378400160
Flag: com.android.wm.shell.enable_bubble_bar
Test: Manual. Have a Tangor device in landscape orientation with the
bubble bar. Rotate the device - observe hotseat and QSB are reduced in
width. Dismiss the bubble bar - observe hotseat and QSB extends to the
full width.
video: http://recall/-/gx8ASgewUeUS3QYohfrd1J/e8e1ZFRQlbHQtUlCXVJbFJ

Change-Id: If180b01c8cdb329cd45d084af63a986c08cf65a1
This commit is contained in:
mpodolian
2024-11-13 15:17:59 -08:00
parent 4785a5e24e
commit b563271ff5
3 changed files with 20 additions and 9 deletions

View File

@@ -221,10 +221,13 @@ public class TaskbarControllers {
uiController = newUiController;
uiController.init(this);
uiController.updateStateForSysuiFlags(mSharedState.sysuiStateFlags);
// if bubble controllers are present take bubble bar location, else set it to null
// if bubble controllers are present configure the UI controller
bubbleControllers.ifPresentOrElse(bubbleControllers -> {
BubbleBarLocation location =
bubbleControllers.bubbleBarViewController.getBubbleBarLocation();
boolean hiddenForBubbles =
bubbleControllers.bubbleBarViewController.isHiddenForNoBubbles();
uiController.adjustHotseatForBubbleBar(!hiddenForBubbles);
uiController.onBubbleBarLocationUpdated(location);
}, () -> uiController.onBubbleBarLocationUpdated(null));
// Notify that the ui controller has changed