Clear bubble bar saved states if bubble bar controllers not present.

Added logic to clear bubble bar related portion of the shared state to
prevent bubble bar being expanded after device unfolded back. If sysui
restores the expanded view, there is no harm in clearing the saved
state, but if it fails to restore, we would at least have the bubble bar
in the not-expanded state.

Bug: 416297086
Test: Manual. Create any bubble and expanded when device is unfolded.
Fold the device and unfold it back. Observe expanded bubble is closed.
Test: Manual. Be folded, expand bubbles unfold bubbles remain expanded
Flag: EXEMPT - bug fix

Change-Id: I13448c48137cc944ec506bdd48ec630634ed120c
This commit is contained in:
mpodolian
2025-05-12 15:01:24 -07:00
parent d03c7e64e2
commit ae6322b4b5
2 changed files with 12 additions and 1 deletions

View File

@@ -177,7 +177,8 @@ public class TaskbarControllers {
taskbarOverlayController.init(this);
taskbarAllAppsController.init(this, sharedState.allAppsVisible);
navButtonController.init(this);
bubbleControllers.ifPresent(controllers -> controllers.init(sharedState, this));
bubbleControllers.ifPresentOrElse(controllers -> controllers.init(sharedState, this),
sharedState::clearBubbleData);
taskbarInsetsController.init(this);
voiceInteractionWindowController.init(this);
taskbarRecentAppsController.init(this, sharedState.recentTasksBeforeTaskbarRecreate);

View File

@@ -92,6 +92,16 @@ public class TaskbarSharedState {
return bubbleInfoItems != null && !bubbleInfoItems.isEmpty();
}
/** Clears stored bubble bar data. */
public void clearBubbleData() {
bubbleInfoItems = null;
selectedBubbleKey = null;
bubbleBarLocation = null;
bubbleBarExpanded = false;
bubbleBarStashed = false;
suppressedBubbleInfoItems = null;
}
// LauncherTaskbarUIController#mTaskbarInAppDisplayProgressMultiProp
public float[] inAppDisplayProgressMultiPropValues = new float[DISPLAY_PROGRESS_COUNT];