From 65e6cbe685420f81be667ec3807cb2720db23807 Mon Sep 17 00:00:00 2001 From: Jamie Garside Date: Fri, 15 Oct 2021 15:59:09 +0100 Subject: [PATCH] Don't pass QS expand state to NPVC in split shade mode. NotificationPanelViewController responds to the QS expansion by moving the notifications around on screen (seemingly, to scroll back to the top when the QS is coming on screen). We don't want this in split shade though, as it will cause the notifications on one pane to move, while the QS is expanding in the other pane (and when the QS is opened/closed with the arrow, the notifications to snap to the top). As an aside, I'm not sure if the "scroll notifications to top" codepath is ever actually used; the notification scroller has to be at the top to open the QS on SC+. Still, I've done it this way as I'm assuming there's some behaviour that I've not come across that allows the user to open the QS while the notifications panel is visible. Note that on a configuration change, setQsExpansionFraction is called again, so this doesn't appear to do anything strange when the device is rotated. Bug: 191666641 Test: Manually verified. Change-Id: I709d2c58792b733cc63dea807c5c39a594662534 --- .../phone/NotificationPanelViewController.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 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 8c8e4e7e86315..13118a0f2b16f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java @@ -2162,7 +2162,7 @@ public class NotificationPanelViewController extends PanelViewController { mQs.setExpanded(mQsExpanded); } - private void setQsExpansion(float height) { + void setQsExpansion(float height) { height = Math.min(Math.max(height, mQsMinExpansionHeight), mQsMaxExpansionHeight); mQsFullyExpanded = height == mQsMaxExpansionHeight && mQsMaxExpansionHeight != 0; if (height > mQsMinExpansionHeight && !mQsExpanded && !mStackScrollerOverscrolling @@ -2206,7 +2206,13 @@ public class NotificationPanelViewController extends PanelViewController { int qsPanelBottomY = calculateQsBottomPosition(qsExpansionFraction); mScrimController.setQsPosition(qsExpansionFraction, qsPanelBottomY); setQSClippingBounds(); - mNotificationStackScrollLayoutController.setQsExpansionFraction(qsExpansionFraction); + + // 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) { + mNotificationStackScrollLayoutController.setQsExpansionFraction(qsExpansionFraction); + } + mDepthController.setQsPanelExpansion(qsExpansionFraction); }