From c4c5987b650fade80ed1c4e9b34f50de2e23988c Mon Sep 17 00:00:00 2001 From: Michal Brzezinski Date: Fri, 18 Nov 2022 14:20:57 +0000 Subject: [PATCH] Making sure QS are visible when expanding shade with heads-up notification QS was not visible because we were not updating QS expansion when heads up notification motion was in progress. Now we will do it when swiping down, so after going below starting movement position. Fixes: 259447896 Test: show heads up notification -> swipe down on it -> QS should be visible throughout the whole down motion Change-Id: Id54d7ac289fdd5bb527d9aa985e2bff90c4a4307 --- .../shade/NotificationPanelViewController.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java index e68182ef85c9c..a319bdc5deab4 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java @@ -463,7 +463,11 @@ public final class NotificationPanelViewController implements Dumpable { private boolean mQsTouchAboveFalsingThreshold; private int mQsFalsingThreshold; - /** Indicates drag starting height when swiping down or up on heads-up notifications */ + /** + * Indicates drag starting height when swiping down or up on heads-up notifications. + * This usually serves as a threshold from when shade expansion should really start. Otherwise + * this value would be height of shade and it will be immediately expanded to some extent. + */ private int mHeadsUpStartHeight; private HeadsUpTouchHelper mHeadsUpTouchHelper; private boolean mListenForHeadsUp; @@ -3386,9 +3390,12 @@ public final class NotificationPanelViewController implements Dumpable { && mQsExpansionAnimator == null && !mQsExpansionFromOverscroll; boolean goingBetweenClosedShadeAndExpandedQs = mQsExpandImmediate || collapsingShadeFromExpandedQs; - // we don't want to update QS expansion when HUN is visible because then the whole shade is - // initially hidden, even though it has non-zero height - if (goingBetweenClosedShadeAndExpandedQs && !mHeadsUpManager.isTrackingHeadsUp()) { + // in split shade we react when HUN is visible only if shade height is over HUN start + // height - which means user is swiping down. Otherwise shade QS will either not show at all + // with HUN movement or it will blink when touching HUN initially + boolean qsShouldExpandWithHeadsUp = !mSplitShadeEnabled + || (!mHeadsUpManager.isTrackingHeadsUp() || expandedHeight > mHeadsUpStartHeight); + if (goingBetweenClosedShadeAndExpandedQs && qsShouldExpandWithHeadsUp) { float qsExpansionFraction; if (mSplitShadeEnabled) { qsExpansionFraction = 1;