diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java index 833a7eff6c743..f7905e8dd6d0b 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java @@ -1778,7 +1778,7 @@ public final class NotificationPanelViewController implements Dumpable { if (animate && !isFullyCollapsed()) { animateCloseQs(true); } else { - mQsController.closeQs(); + closeQsIfPossible(); } mNotificationStackScrollLayoutController.setOverScrollAmount(0f, true /* onTop */, animate, !animate /* cancelAnimators */); @@ -4030,9 +4030,17 @@ public final class NotificationPanelViewController implements Dumpable { return mExpandingFromHeadsUp; } - /** TODO: remove need for this delegate (b/254870148) */ - public void closeQs() { - mQsController.closeQs(); + /** + * We don't always want to close QS when requested as shade might be in a different state + * already e.g. when going from collapse to expand very quickly. In that case StatusBar + * window might send signal to collapse QS but we might be already expanding and in split + * shade QS are always expanded + */ + private void closeQsIfPossible() { + boolean openOrOpening = isShadeFullyOpen() || isExpanding(); + if (!(mSplitShadeEnabled && openOrOpening)) { + mQsController.closeQs(); + } } /** TODO: remove need for this delegate (b/254870148) */ diff --git a/packages/SystemUI/src/com/android/systemui/shade/QuickSettingsController.java b/packages/SystemUI/src/com/android/systemui/shade/QuickSettingsController.java index 07a65e3bcb7c4..a8378df819687 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/QuickSettingsController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/QuickSettingsController.java @@ -663,8 +663,15 @@ public class QuickSettingsController { mDozing = dozing; } - /** set QS state to closed */ + /** + * This method closes QS but in split shade it should be used only in special cases: to make + * sure QS closes when shade is closed as well. Otherwise it will result in QS disappearing + * from split shade + */ public void closeQs() { + if (mSplitShadeEnabled) { + mShadeLog.d("Closing QS while in split shade"); + } cancelExpansionAnimation(); setExpansionHeight(getMinExpansionHeight()); // qsExpandImmediate is a safety latch in case we're calling closeQS while we're in the diff --git a/packages/SystemUI/src/com/android/systemui/shade/ShadeControllerImpl.java b/packages/SystemUI/src/com/android/systemui/shade/ShadeControllerImpl.java index 026673adb86b1..c1369935db542 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/ShadeControllerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/shade/ShadeControllerImpl.java @@ -270,8 +270,6 @@ public final class ShadeControllerImpl implements ShadeController { // Ensure the panel is fully collapsed (just in case; bug 6765842, 7260868) mNotificationPanelViewController.collapsePanel(false, false, 1.0f); - mNotificationPanelViewController.closeQs(); - mExpandedVisible = false; notifyVisibilityChanged(false);