From f233e0a787c2805de4e9c9c1e695b30e7d49b974 Mon Sep 17 00:00:00 2001 From: Michal Brzezinski Date: Mon, 30 Jan 2023 18:41:31 +0000 Subject: [PATCH] Fixing mQsVisible state in split shade mQsVisible/qsVisible was always true in split shade and that's not expected by its consumers. It also means that part of the code was dead path for several months so I deleted that. The main problem was calculateQsBottomPosition always returning max value. This function looks like the value changes linearly but for split shade qsExpansion is either 0 or 1. And for 0, it still returned fully expanded QS value. Fixes: 267190489 Test: testing different split shade transitions: unlocked->shade, keyguard->shade, locked shade -> bouncer, keyguard -> bouncer etc Change-Id: Id06bb2b92e6d1648236ab45fa0d4de662ebf219c --- .../NotificationPanelViewController.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java index 392a851290de7..f846f57c53dda 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java @@ -3132,17 +3132,11 @@ public final class NotificationPanelViewController implements Dumpable { } // The padding on this area is large enough that we can use a cheaper clipping strategy mKeyguardStatusViewController.setClipBounds(clipStatusView ? mLastQsClipBounds : null); - if (!qsVisible && mSplitShadeEnabled) { - // On the lockscreen when qs isn't visible, we don't want the bounds of the shade to - // be visible, otherwise you can see the bounds once swiping up to see bouncer - mScrimController.setNotificationsBounds(0, 0, 0, 0); - } else { - // Increase the height of the notifications scrim when not in split shade - // (e.g. portrait tablet) so the rounded corners are not visible at the bottom, - // in this case they are rendered off-screen - final int notificationsScrimBottom = mSplitShadeEnabled ? bottom : bottom + radius; - mScrimController.setNotificationsBounds(left, top, right, notificationsScrimBottom); - } + // Increase the height of the notifications scrim when not in split shade + // (e.g. portrait tablet) so the rounded corners are not visible at the bottom, + // in this case they are rendered off-screen + final int notificationsScrimBottom = mSplitShadeEnabled ? bottom : bottom + radius; + mScrimController.setNotificationsBounds(left, top, right, notificationsScrimBottom); if (mSplitShadeEnabled) { mKeyguardStatusBarViewController.setNoTopClipping(); @@ -3203,6 +3197,12 @@ public final class NotificationPanelViewController implements Dumpable { private int calculateQsBottomPosition(float qsExpansionFraction) { if (mTransitioningToFullShadeProgress > 0.0f) { return mTransitionToFullShadeQSPosition; + } else if (mSplitShadeEnabled) { + // in split shade - outside lockscreen transition handled above - we simply jump between + // two qs expansion values - either shade is closed and qs expansion is 0 or shade is + // open and qs expansion is 1 + int qsBottomTarget = mQs.getDesiredHeight() + mLargeScreenShadeHeaderHeight; + return qsExpansionFraction > 0 ? qsBottomTarget : 0; } else { int qsBottomYFrom = (int) getHeaderTranslation() + mQs.getQsMinExpansionHeight(); int expandedTopMargin = mUseLargeScreenShadeHeader ? mLargeScreenShadeHeaderHeight : 0;