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: I10eb4d211f614559167f110000dcec3c8df5e3c8
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/QuickStepContract.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/QuickStepContract.java
index 2e22bfb..56fc970 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/QuickStepContract.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/QuickStepContract.java
@@ -121,6 +121,8 @@
// Whether the screen is currently transitioning into the state indicated by
// SYSUI_STATE_SCREEN_ON.
public static final int SYSUI_STATE_SCREEN_TRANSITION = 1 << 29;
+ // The notification panel expansion fraction is > 0
+ public static final int SYSUI_STATE_NOTIFICATION_PANEL_VISIBLE = 1 << 30;
// Mask for SystemUiStateFlags to isolate SYSUI_STATE_SCREEN_ON and
// SYSUI_STATE_SCREEN_TRANSITION, to match SCREEN_STATE_*
diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
index ad8ae75..8febbbe 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
@@ -36,6 +36,7 @@
import static com.android.systemui.shade.ShadeExpansionStateManagerKt.STATE_OPEN;
import static com.android.systemui.shade.ShadeExpansionStateManagerKt.STATE_OPENING;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED;
+import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_VISIBLE;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_QUICK_SETTINGS_EXPANDED;
import static com.android.systemui.statusbar.StatusBarState.KEYGUARD;
import static com.android.systemui.statusbar.StatusBarState.SHADE;
@@ -3396,7 +3397,9 @@
Log.d(TAG, "Updating panel sysui state flags: fullyExpanded="
+ isFullyExpanded() + " inQs=" + mQsController.getExpanded());
}
- mSysUiState.setFlag(SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED,
+ mSysUiState
+ .setFlag(SYSUI_STATE_NOTIFICATION_PANEL_VISIBLE, getExpandedFraction() > 0)
+ .setFlag(SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED,
isFullyExpanded() && !mQsController.getExpanded())
.setFlag(SYSUI_STATE_QUICK_SETTINGS_EXPANDED,
isFullyExpanded() && mQsController.getExpanded()).commitUpdate(mDisplayId);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
index 1913025..f4f79c2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
@@ -1442,16 +1442,16 @@
private void onPanelExpansionChanged(ShadeExpansionChangeEvent event) {
float fraction = event.getFraction();
boolean tracking = event.getTracking();
- boolean isExpanded = event.getExpanded();
dispatchPanelExpansionForKeyguardDismiss(fraction, tracking);
+ if (getNotificationPanelViewController() != null) {
+ getNotificationPanelViewController().updateSystemUiStateFlags();
+ }
+
if (fraction == 0 || fraction == 1) {
if (getNavigationBarView() != null) {
getNavigationBarView().onStatusBarPanelStateChanged();
}
- if (getNotificationPanelViewController() != null) {
- getNotificationPanelViewController().updateSystemUiStateFlags();
- }
}
}