From bfe4503e9e85fb22394fb4bdfb644d081b85c240 Mon Sep 17 00:00:00 2001 From: Toni Barzic Date: Fri, 23 May 2025 16:43:18 +0000 Subject: [PATCH] Fix a crash on home with autostashed taskbar Check whether autostash is disabled after init due to dependency on destkop mode controller when taskbar is shown on home with enable_desktop_taskbar_on_freeform_displays flag disabled. Bug: 419824639 Test: see repro steps in the linked bug Flag: EXEMPT bugfix Change-Id: I53a1f00cef705f291c5e79c32d6508c5d832d45e --- .../launcher3/taskbar/TaskbarStashController.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java index 1abcaa093a..9be949998e 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java @@ -376,11 +376,14 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba mTaskbarBackgroundAlphaForStash.setValue(shouldHideTaskbarBackground ? 0 : 1); - // if taskbar should auto stash attempt to start timeout. - if (shouldAllowTaskbarToAutoStash()) { - tryStartTaskbarTimeout(); - } notifyStashChange(/* visible */ false, /* stashed */ isStashedInApp()); + + mControllers.runAfterInit(() -> { + // if taskbar should auto stash attempt to start timeout. + if (shouldAllowTaskbarToAutoStash()) { + tryStartTaskbarTimeout(); + } + }); } /**