From 7d28df80e8923285fddee0a46341726b7c27d416 Mon Sep 17 00:00:00 2001 From: Ats Jenk Date: Wed, 23 Apr 2025 16:08:19 -0700 Subject: [PATCH] Bubble bar to ignore launcher state changes after destroy When device is rotated, launcher is recreated and the existing controllers are destroyed. As part of handling the destroy signal, LauncherTaskbarUIController updates the launcher state to in-app. This launcher state change is handled by BubbleStashController which in turn notifies BubbleBarViewController that bubble bar should be collapsed. BubbleBarViewController then notifies WMShell that bubble bar should be collapsed. And that state is stored in WMShell. This causes bubble bar to collapse when it is expanded on home screen and device is rotated. Fix this by checking if the TaskbarActivityContext is already destroyed when a launcher state change happens. And if it is, ignore those state changes. Bug: 357115534 Test: expand bubble bar on home screen, rotate device, check that bubble bar remains expanded Flag: com.android.wm.shell.enable_bubble_bar Change-Id: I7e019f8d1fd7935582d84a99d3afa3ffadd92799 --- .../launcher3/taskbar/TaskbarLauncherStateController.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java index f44cae927d..a97893f75a 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java @@ -505,6 +505,10 @@ public class TaskbarLauncherStateController { + ", toAlignment: " + toAlignment); } mControllers.bubbleControllers.ifPresent(controllers -> { + // Ignore state changes when taskbar is destroyed + if (mControllers.taskbarActivityContext.isDestroyed()) { + return; + } // Show the bubble bar when on launcher home (hotseat icons visible) or in overview boolean onOverview = isInLauncher && mLauncherState == LauncherState.OVERVIEW; boolean hotseatIconsVisible = isInLauncher && mLauncherState.areElementsVisible(