From ae6322b4b539ac3c4aed77febc2f5ff3bf2b0f3a Mon Sep 17 00:00:00 2001 From: mpodolian Date: Mon, 12 May 2025 15:01:24 -0700 Subject: [PATCH] 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 --- .../android/launcher3/taskbar/TaskbarControllers.java | 3 ++- .../android/launcher3/taskbar/TaskbarSharedState.java | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java index ef002fcd85..f24bd28330 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarControllers.java @@ -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); diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarSharedState.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarSharedState.java index d963229bc7..a69df4ad0c 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarSharedState.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarSharedState.java @@ -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];