From 6c3d857fab687b9945adfd1250ed7b8beff05cdc Mon Sep 17 00:00:00 2001 From: Michal Brzezinski Date: Mon, 9 May 2022 15:41:19 +0100 Subject: [PATCH] Fixing notifications not visible in split shade after rotations When rotating from split shade to portrait and back, some calculations of notifications height, padding etc were broken because they are only refreshed when qsExpansion is 0 (QS is collapsed). When QS was expanded in portrait and rotated back to split shade, QS expansion state was never refreshed in NSSL (so still 1) and that means some calculations never happened. In NSSL we still want to pretend QS are collapsed so notifcations are fully functioning but we want to make sure this information is refreshed when changing state to split shade. This fix might not be required anymore after changing behaviour of shade rotation - from split shade going to collapsed QS in portrait - but still seems like serious bug waiting to happen in some other cases we don't yet know about. Fixes: 230481309 Test: open shade in split shade -> rotate to portrait (QS should be expanded) -> rotate back to split shade -> notifications should be visible Change-Id: I1926e988d77a5ca6732567ae29ec4f17b32c324c --- .../statusbar/phone/NotificationPanelViewController.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java index 98a711d122fca..bd0e9993cf4f5 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java @@ -2314,9 +2314,12 @@ public class NotificationPanelViewController extends PanelViewController { mScrimController.setQsPosition(qsExpansionFraction, qsPanelBottomY); setQSClippingBounds(); - // Only need to notify the notification stack when we're not in split screen mode. If we - // do, then the notification panel starts scrolling along with the QS. - if (!mShouldUseSplitNotificationShade) { + if (mShouldUseSplitNotificationShade) { + // In split shade we want to pretend that QS are always collapsed so their behaviour and + // interactions don't influence notifications as they do in portrait. But we want to set + // 0 explicitly in case we're rotating from non-split shade with QS expansion of 1. + mNotificationStackScrollLayoutController.setQsExpansionFraction(0); + } else { mNotificationStackScrollLayoutController.setQsExpansionFraction(qsExpansionFraction); }