From c2e5bfca50b2db59f0dbf1e4bcf86f1a6c78489b Mon Sep 17 00:00:00 2001 From: Johannes Gallmann Date: Mon, 20 Mar 2023 12:38:51 +0100 Subject: [PATCH] Fix taskbar linger above notification shade Remarks: 1. I think the correct fix for this would be to have the Taskbar z-ordered below the notification shade. That however seems to be difficult because there are cases when the taskbar window must be above the notification shade. 2. This CL improves the behaviour by starting the taskbar disappear animation when the notification panel is half expanded instead of waiting for the full expansion. This improves the UX when expanding the shade slowly. When expanding the shade quickly, this CL does unfortunately not significantly improve the UX. 3. I believe that the `SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED` and `SYSUI_STATE_QUICK_SETTINGS_EXPANDED` flags can be replaced by the newly introduced one. But since this would pose the risk of introducing new bugs, I did not do that in this CL. It is my intention to create a CL with that replacement in udc. Bug: 272621219 Test: Manual, i.e. observe Taskbar behaviour when pulling down notification shade and expanding quick settings Change-Id: Ic79d3f41ed224cb1abdbac9011c6d27e0f458ec2 --- .../android/launcher3/taskbar/TaskbarActivityContext.java | 8 +++----- .../android/launcher3/taskbar/TaskbarStashController.java | 6 ++---- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java index 77a9d780b0..e27e979ccd 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java @@ -30,8 +30,7 @@ import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLA import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_FULLSCREEN; import static com.android.launcher3.taskbar.TaskbarManager.FLAG_HIDE_NAVBAR_WINDOW; import static com.android.launcher3.testing.shared.ResourceUtils.getBoolByName; -import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED; -import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_QUICK_SETTINGS_EXPANDED; +import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_VISIBLE; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_VOICE_INTERACTION_WINDOW_SHOWING; import android.animation.AnimatorSet; @@ -571,9 +570,8 @@ public class TaskbarActivityContext extends BaseTaskbarContext { public void updateSysuiStateFlags(int systemUiStateFlags, boolean fromInit) { mControllers.navbarButtonsViewController.updateStateForSysuiFlags(systemUiStateFlags, fromInit); - int shadeExpandedFlags = SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED - | SYSUI_STATE_QUICK_SETTINGS_EXPANDED; - onNotificationShadeExpandChanged((systemUiStateFlags & shadeExpandedFlags) != 0, fromInit); + boolean isShadeVisible = (systemUiStateFlags & SYSUI_STATE_NOTIFICATION_PANEL_VISIBLE) != 0; + onNotificationShadeExpandChanged(isShadeVisible, fromInit); mControllers.taskbarViewController.setRecentsButtonDisabled( mControllers.navbarButtonsViewController.isRecentsDisabled() || isNavBarKidsModeActive()); diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java index d26fbc4459..b142f9ee35 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java @@ -32,8 +32,7 @@ import static com.android.launcher3.util.FlagDebugUtils.appendFlag; import static com.android.launcher3.util.FlagDebugUtils.formatFlagChange; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SHOWING; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SWITCHER_SHOWING; -import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED; -import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_QUICK_SETTINGS_EXPANDED; +import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_VISIBLE; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_SCREEN_PINNING; import android.animation.Animator; @@ -907,8 +906,7 @@ public class TaskbarStashController implements TaskbarControllers.LoggableTaskba long startDelay = 0; updateStateForFlag(FLAG_STASHED_IN_APP_SYSUI, hasAnyFlag(systemUiStateFlags, - SYSUI_STATE_QUICK_SETTINGS_EXPANDED - | SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED)); + SYSUI_STATE_NOTIFICATION_PANEL_VISIBLE)); updateStateForFlag(FLAG_STASHED_SYSUI, hasAnyFlag(systemUiStateFlags, SYSUI_STATE_SCREEN_PINNING)); updateStateForFlag(FLAG_STASHED_DEVICE_LOCKED,