diff options
| author | 2024-10-25 12:54:04 +0000 | |
|---|---|---|
| committer | 2024-11-01 09:24:27 +0000 | |
| commit | 5181be0400f8f37a573d0cafab240c805476a9b0 (patch) | |
| tree | ecccd033273cf566a7135df1b35e855a67ad4a6a | |
| parent | d2e98330f147d981c4238548b0253c75b975c866 (diff) | |
[flexiglass] Verify that NSSL#mQsExpansionFraction is not accessed
NSSL doesn't need to combine multiple sources to know the shade expansion fraction with flexiglass.
Bug: 296118689
Test: run sysui with, and without flexiglass
Flag: EXEMPT mechanical refactor
Change-Id: I0f7a1220a56a4184b38241ee610591497df1a15b
2 files changed, 22 insertions, 10 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java index f02f7f736668..57af8ea19722 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java @@ -797,7 +797,7 @@ public class NotificationStackScrollLayout && !onKeyguard() && mUpcomingStatusBarState != StatusBarState.KEYGUARD // quick settings don't affect notifications when not in full screen - && (mQsExpansionFraction != 1 || !mQsFullScreen) + && (getQsExpansionFraction() != 1 || !mQsFullScreen) && !mScreenOffAnimationController.shouldHideNotificationsFooter() && !mIsRemoteInputActive; } @@ -1528,7 +1528,7 @@ public class NotificationStackScrollLayout float fraction = mAmbientState.getExpansionFraction(); // If we are on quick settings, we need to quickly hide it to show the bouncer to avoid an // overlap. Otherwise, we maintain the normal fraction for smoothness. - if (mAmbientState.isBouncerInTransit() && mQsExpansionFraction > 0f) { + if (mAmbientState.isBouncerInTransit() && getQsExpansionFraction() > 0f) { fraction = BouncerPanelExpansionCalculator.aboutToShowBouncerProgress(fraction); } final float stackY = MathUtils.lerp(0, endTopPosition, fraction); @@ -1552,7 +1552,7 @@ public class NotificationStackScrollLayout } updateInterpolatedStackHeight(endHeight, fraction); } else { - if (mQsExpansionFraction <= 0 && !shouldSkipHeightUpdate()) { + if (getQsExpansionFraction() <= 0 && !shouldSkipHeightUpdate()) { final float endHeight = updateStackEndHeight( getHeight(), getEmptyBottomMarginInternal(), getTopPadding()); updateInterpolatedStackHeight(endHeight, fraction); @@ -1705,7 +1705,7 @@ public class NotificationStackScrollLayout stackHeight = (int) height; } else { stackHeight = (int) NotificationUtils.interpolate(stackStartPosition, - stackEndPosition, mQsExpansionFraction); + stackEndPosition, getQsExpansionFraction()); } } } else { @@ -5271,17 +5271,22 @@ public class NotificationStackScrollLayout return mQsFullScreen; } + private float getQsExpansionFraction() { + SceneContainerFlag.assertInLegacyMode(); + return mQsExpansionFraction; + } + public void setQsExpansionFraction(float qsExpansionFraction) { SceneContainerFlag.assertInLegacyMode(); - boolean footerAffected = mQsExpansionFraction != qsExpansionFraction - && (mQsExpansionFraction == 1 || qsExpansionFraction == 1); + boolean footerAffected = getQsExpansionFraction() != qsExpansionFraction + && (getQsExpansionFraction() == 1 || qsExpansionFraction == 1); mQsExpansionFraction = qsExpansionFraction; updateUseRoundedRectClipping(); // If notifications are scrolled, // clear out scrollY by the time we push notifications offscreen if (getOwnScrollY() > 0) { - setOwnScrollY((int) MathUtils.lerp(getOwnScrollY(), 0, mQsExpansionFraction)); + setOwnScrollY((int) MathUtils.lerp(getOwnScrollY(), 0, getQsExpansionFraction())); } if (!FooterViewRefactor.isEnabled() && footerAffected) { updateFooter(); @@ -5514,7 +5519,6 @@ public class NotificationStackScrollLayout println(pw, "suppressChildrenMeasureLayout", mSuppressChildrenMeasureAndLayout); println(pw, "scrollY", mAmbientState.getScrollY()); println(pw, "showShelfOnly", mShouldShowShelfOnly); - println(pw, "qsExpandFraction", mQsExpansionFraction); println(pw, "isCurrentUserSetup", mIsCurrentUserSetup); println(pw, "hideAmount", mAmbientState.getHideAmount()); println(pw, "ambientStateSwipingUp", mAmbientState.isSwipingUp()); @@ -5550,6 +5554,7 @@ public class NotificationStackScrollLayout println(pw, "contentHeight", getContentHeight()); println(pw, "topPadding", getTopPadding()); println(pw, "maxTopPadding", getMaxTopPadding()); + println(pw, "qsExpandFraction", getQsExpansionFraction()); } }); pw.println(); @@ -5622,7 +5627,9 @@ public class NotificationStackScrollLayout pw.println("mIsCurrentUserSetup: " + mIsCurrentUserSetup); pw.println("onKeyguard: " + onKeyguard()); pw.println("mUpcomingStatusBarState: " + mUpcomingStatusBarState); - pw.println("mQsExpansionFraction: " + mQsExpansionFraction); + if (!SceneContainerFlag.isEnabled()) { + pw.println("QsExpansionFraction: " + getQsExpansionFraction()); + } pw.println("mQsFullScreen: " + mQsFullScreen); pw.println( "mScreenOffAnimationController" @@ -6246,7 +6253,8 @@ public class NotificationStackScrollLayout if (SceneContainerFlag.isEnabled()) return; // We don't want to clip notifications when QS is expanded, because incoming heads up on // the bottom would be clipped otherwise - boolean qsAllowsClipping = mQsExpansionFraction < 0.5f || mShouldUseSplitNotificationShade; + boolean qsAllowsClipping = + getQsExpansionFraction() < 0.5f || mShouldUseSplitNotificationShade; boolean clip = mIsExpanded && qsAllowsClipping; if (clip != mShouldUseRoundedRectClipping) { mShouldUseRoundedRectClipping = clip; diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java index 57fad83da8b9..6069b4409ec9 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java @@ -610,6 +610,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) + @DisableSceneContainer public void testUpdateFooter_remoteInput() { setBarStateForTest(StatusBarState.SHADE); mStackScroller.setCurrentUserSetup(true); @@ -643,6 +644,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) + @DisableSceneContainer public void testUpdateFooter_oneClearableNotification() { setBarStateForTest(StatusBarState.SHADE); mStackScroller.setCurrentUserSetup(true); @@ -659,6 +661,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) + @DisableSceneContainer public void testUpdateFooter_withoutHistory() { setBarStateForTest(StatusBarState.SHADE); mStackScroller.setCurrentUserSetup(true); @@ -692,6 +695,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase { @Test @DisableFlags({FooterViewRefactor.FLAG_NAME, NotifRedesignFooter.FLAG_NAME}) + @DisableSceneContainer public void testUpdateFooter_oneNonClearableNotification() { setBarStateForTest(StatusBarState.SHADE); mStackScroller.setCurrentUserSetup(true); |