Fixed the navigation bar placement on device restart.

Moved logic that adjusts the hotseat position from the constructor of
the NavbarButtonsViewController to onTaskbarLayoutChange() method that
is called from the TaskbarViewController TaskbarView layout change
listener.

Test: Manual:
Moved the bubble bar to the default right position. Rebooted the device.
Navigation bar was placed on the left side of the screen.
Flag: com.android.wm.shell.enable_bubble_bar_in_persistent_task_bar
Bug: 367829539

Change-Id: Ife0c48a72b318d6051b7b09bde13818546e65d98
This commit is contained in:
mpodolian
2024-09-17 18:05:37 -07:00
parent e58dad0821
commit b79e1742bd
2 changed files with 16 additions and 10 deletions
@@ -400,12 +400,6 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
}
};
mSeparateWindowParent.recreateControllers();
if (com.android.wm.shell.Flags.enableBubbleBarInPersistentTaskBar()
&& mControllers.bubbleControllers.isPresent()) {
BubbleBarLocation bubblesLocation = mControllers.bubbleControllers.get()
.bubbleBarViewController.getBubbleBarLocation();
onBubbleBarLocationUpdated(bubblesLocation);
}
}
private void initButtons(ViewGroup navContainer, ViewGroup endContainer,
@@ -1223,6 +1217,16 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
return (int) navBarTargetStartX - mNavButtonContainer.getLeft();
}
/** Adjusts the navigation buttons layout position according to the bubble bar location. */
public void onTaskbarLayoutChange() {
if (com.android.wm.shell.Flags.enableBubbleBarInPersistentTaskBar()
&& mControllers.bubbleControllers.isPresent()) {
BubbleBarLocation bubblesLocation = mControllers.bubbleControllers.get()
.bubbleBarViewController.getBubbleBarLocation();
onBubbleBarLocationUpdated(bubblesLocation);
}
}
private class RotationButtonListener implements RotationButton.RotationButtonUpdatesCallback {
@Override
public void onVisibilityChanged(boolean isVisible) {