Do not animate bubble bar for initial state [2/N]

Initial state for bubble bar does not need to be animated.
Especially if it is sent after rotation. In that case we do not want it
to animate.
When launcher is rotated, taskbar is recreated. After getting recreated,
we receive the initial state from WMShell for the bubbles again. Part of
the initial state is whether bubble bar is expanded or not.

Bug: 357115534
Flag: com.android.wm.shell.enable_bubble_bar
Test: rotate device
Change-Id: I859b73597c8f286069f384dcdea0e3a5296e0073
This commit is contained in:
Ats Jenk
2025-04-23 16:30:37 -07:00
parent 416f80dc82
commit f1f507e8c3
3 changed files with 73 additions and 36 deletions
@@ -1298,15 +1298,25 @@ public class BubbleBarViewController {
* Sets whether the bubble bar should be expanded. This method is used in response to UI events
* from SystemUI.
*/
public void setExpandedFromSysui(boolean isExpanded) {
public void setExpandedFromSysui(boolean isExpanded, boolean animate) {
if (isNewBubbleAnimationRunningOrPending() && isExpanded) {
mBubbleBarViewAnimator.expandedWhileAnimating();
return;
}
if (!isExpanded) {
mBubbleStashController.stashBubbleBar();
if (animate) {
if (!isExpanded) {
mBubbleStashController.stashBubbleBar();
} else {
mBubbleStashController.showBubbleBar(true /* expand the bubbles */);
}
} else {
mBubbleStashController.showBubbleBar(true /* expand the bubbles */);
if (!isExpanded) {
mBubbleStashController.stashBubbleBarImmediate();
} else {
mBubbleStashController.showBubbleBarImmediate();
mBarView.setExpanded(true);
adjustTaskbarAndHotseatToBubbleBarState(true);
}
}
}