Loading packages/SystemUI/src/com/android/systemui/shade/QuickSettingsController.java +61 −5 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import static com.android.systemui.shade.NotificationPanelViewController.FLING_E import static com.android.systemui.shade.NotificationPanelViewController.FLING_HIDE; import static com.android.systemui.shade.NotificationPanelViewController.QS_PARALLAX_AMOUNT; import static com.android.systemui.statusbar.StatusBarState.KEYGUARD; import static com.android.systemui.statusbar.StatusBarState.SHADE; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; Loading Loading @@ -246,6 +247,12 @@ public class QuickSettingsController { /** The duration of the notification bounds animation. */ private long mNotificationBoundsAnimationDuration; /** TODO(b/273591201): remove after bug resolved */ private int mLastClippingTopBound; private int mLastNotificationsTopPadding; private int mLastNotificationsClippingTopBound; private int mLastNotificationsClippingTopBoundNssl; private final Region mInterceptRegion = new Region(); /** The end bounds of a clipping animation. */ private final Rect mClippingAnimationEndBounds = new Rect(); Loading Loading @@ -610,7 +617,7 @@ public class QuickSettingsController { float appearAmount = mNotificationStackScrollLayoutController .calculateAppearFraction(mShadeExpandedHeight); float startHeight = -getExpansionHeight(); if (mBarState == StatusBarState.SHADE) { if (mBarState == SHADE) { // Small parallax as we pull down and clip QS startHeight = -getExpansionHeight() * QS_PARALLAX_AMOUNT; } Loading Loading @@ -1086,6 +1093,7 @@ public class QuickSettingsController { mClippingAnimationEndBounds.left, fraction); int animTop = (int) MathUtils.lerp(startTop, mClippingAnimationEndBounds.top, fraction); logClippingTopBound("interpolated top bound", top); int animRight = (int) MathUtils.lerp(startRight, mClippingAnimationEndBounds.right, fraction); int animBottom = (int) MathUtils.lerp(startBottom, Loading Loading @@ -1205,6 +1213,8 @@ public class QuickSettingsController { // the screen without clipping. return -mAmbientState.getStackTopMargin(); } else { logNotificationsClippingTopBound(qsTop, mNotificationStackScrollLayoutController.getTop()); return qsTop - mNotificationStackScrollLayoutController.getTop(); } } Loading @@ -1227,6 +1237,7 @@ public class QuickSettingsController { /** Calculate top padding for notifications */ public float calculateNotificationsTopPadding(boolean isShadeExpanding, int keyguardNotificationStaticPadding, float expandedFraction) { float topPadding; boolean keyguardShowing = mBarState == KEYGUARD; if (mSplitShadeEnabled) { return keyguardShowing Loading @@ -1243,19 +1254,27 @@ public class QuickSettingsController { int maxQsPadding = getMaxExpansionHeight(); int max = keyguardShowing ? Math.max( keyguardNotificationStaticPadding, maxQsPadding) : maxQsPadding; return (int) MathUtils.lerp((float) getMinExpansionHeight(), topPadding = (int) MathUtils.lerp((float) getMinExpansionHeight(), (float) max, expandedFraction); logNotificationsTopPadding("keyguard and expandImmediate", topPadding); return topPadding; } else if (isSizeChangeAnimationRunning()) { return Math.max((int) mSizeChangeAnimator.getAnimatedValue(), topPadding = Math.max((int) mSizeChangeAnimator.getAnimatedValue(), keyguardNotificationStaticPadding); logNotificationsTopPadding("size change animation running", topPadding); return topPadding; } else if (keyguardShowing) { // We can only do the smoother transition on Keyguard when we also are not collapsing // from a scrolled quick settings. return MathUtils.lerp((float) keyguardNotificationStaticPadding, topPadding = MathUtils.lerp((float) keyguardNotificationStaticPadding, (float) (getMaxExpansionHeight()), computeExpansionFraction()); logNotificationsTopPadding("keyguard", topPadding); return topPadding; } else { return mQsFrameTranslateController.getNotificationsTopPadding( topPadding = mQsFrameTranslateController.getNotificationsTopPadding( mExpansionHeight, mNotificationStackScrollLayoutController); logNotificationsTopPadding("default case", topPadding); return topPadding; } } Loading Loading @@ -1302,6 +1321,38 @@ public class QuickSettingsController { - mAmbientState.getScrollY()); } /** TODO(b/273591201): remove after bug resolved */ private void logNotificationsTopPadding(String message, float rawPadding) { int padding = ((int) rawPadding / 10) * 10; if (mBarState != KEYGUARD && padding != mLastNotificationsTopPadding && !mExpanded) { mLastNotificationsTopPadding = padding; mShadeLog.logNotificationsTopPadding(message, padding); } } /** TODO(b/273591201): remove after bug resolved */ private void logClippingTopBound(String message, int top) { top = (top / 10) * 10; if (mBarState != KEYGUARD && mShadeExpandedFraction == 1 && top != mLastClippingTopBound && !mExpanded) { mLastClippingTopBound = top; mShadeLog.logClippingTopBound(message, top); } } /** TODO(b/273591201): remove after bug resolved */ private void logNotificationsClippingTopBound(int top, int nsslTop) { top = (top / 10) * 10; nsslTop = (nsslTop / 10) * 10; if (mBarState == SHADE && mShadeExpandedFraction == 1 && (top != mLastNotificationsClippingTopBound || nsslTop != mLastNotificationsClippingTopBoundNssl) && !mExpanded) { mLastNotificationsClippingTopBound = top; mLastNotificationsClippingTopBoundNssl = nsslTop; mShadeLog.logNotificationsClippingTopBound(top, nsslTop); } } private int calculateTopClippingBound(int qsPanelBottomY) { int top; if (mSplitShadeEnabled) { Loading @@ -1311,6 +1362,7 @@ public class QuickSettingsController { // If we're transitioning, let's use the actual value. The else case // can be wrong during transitions when waiting for the keyguard to unlock top = mTransitionToFullShadePosition; logClippingTopBound("set while transitioning to full shade", top); } else { final float notificationTop = getEdgePosition(); if (mBarState == KEYGUARD) { Loading @@ -1319,8 +1371,10 @@ public class QuickSettingsController { // this should go away once we unify the stackY position and don't have // to do this min anymore below. top = qsPanelBottomY; logClippingTopBound("bypassing keyguard", top); } else { top = (int) Math.min(qsPanelBottomY, notificationTop); logClippingTopBound("keyguard default case", top); } } else { top = (int) notificationTop; Loading @@ -1328,12 +1382,14 @@ public class QuickSettingsController { } // TODO (b/265193930): remove dependency on NPVC top += mPanelViewControllerLazy.get().getOverStretchAmount(); logClippingTopBound("including overstretch", top); // Correction for instant expansion caused by HUN pull down/ float minFraction = mPanelViewControllerLazy.get().getMinFraction(); if (minFraction > 0f && minFraction < 1f) { float realFraction = (mShadeExpandedFraction - minFraction) / (1f - minFraction); top *= MathUtils.saturate(realFraction / minFraction); logClippingTopBound("after adjusted fraction", top); } } return top; Loading packages/SystemUI/src/com/android/systemui/shade/ShadeLogger.kt +36 −0 Original line number Diff line number Diff line Loading @@ -280,4 +280,40 @@ class ShadeLogger @Inject constructor(@ShadeLog private val buffer: LogBuffer) { { "Split shade state changed: split shade ${if (bool1) "enabled" else "disabled"}" } ) } fun logNotificationsTopPadding(message: String, padding: Int) { buffer.log( TAG, LogLevel.VERBOSE, { str1 = message int1 = padding }, { "QSC NotificationsTopPadding $str1: $int1"} ) } fun logClippingTopBound(message: String, top: Int) { buffer.log( TAG, LogLevel.VERBOSE, { str1 = message int1 = top }, { "QSC ClippingTopBound $str1: $int1" } ) } fun logNotificationsClippingTopBound(top: Int, nsslTop: Int) { buffer.log( TAG, LogLevel.VERBOSE, { int1 = top int2 = nsslTop }, { "QSC NotificationsClippingTopBound set to $int1 - $int2" } ) } } Loading
packages/SystemUI/src/com/android/systemui/shade/QuickSettingsController.java +61 −5 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import static com.android.systemui.shade.NotificationPanelViewController.FLING_E import static com.android.systemui.shade.NotificationPanelViewController.FLING_HIDE; import static com.android.systemui.shade.NotificationPanelViewController.QS_PARALLAX_AMOUNT; import static com.android.systemui.statusbar.StatusBarState.KEYGUARD; import static com.android.systemui.statusbar.StatusBarState.SHADE; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; Loading Loading @@ -246,6 +247,12 @@ public class QuickSettingsController { /** The duration of the notification bounds animation. */ private long mNotificationBoundsAnimationDuration; /** TODO(b/273591201): remove after bug resolved */ private int mLastClippingTopBound; private int mLastNotificationsTopPadding; private int mLastNotificationsClippingTopBound; private int mLastNotificationsClippingTopBoundNssl; private final Region mInterceptRegion = new Region(); /** The end bounds of a clipping animation. */ private final Rect mClippingAnimationEndBounds = new Rect(); Loading Loading @@ -610,7 +617,7 @@ public class QuickSettingsController { float appearAmount = mNotificationStackScrollLayoutController .calculateAppearFraction(mShadeExpandedHeight); float startHeight = -getExpansionHeight(); if (mBarState == StatusBarState.SHADE) { if (mBarState == SHADE) { // Small parallax as we pull down and clip QS startHeight = -getExpansionHeight() * QS_PARALLAX_AMOUNT; } Loading Loading @@ -1086,6 +1093,7 @@ public class QuickSettingsController { mClippingAnimationEndBounds.left, fraction); int animTop = (int) MathUtils.lerp(startTop, mClippingAnimationEndBounds.top, fraction); logClippingTopBound("interpolated top bound", top); int animRight = (int) MathUtils.lerp(startRight, mClippingAnimationEndBounds.right, fraction); int animBottom = (int) MathUtils.lerp(startBottom, Loading Loading @@ -1205,6 +1213,8 @@ public class QuickSettingsController { // the screen without clipping. return -mAmbientState.getStackTopMargin(); } else { logNotificationsClippingTopBound(qsTop, mNotificationStackScrollLayoutController.getTop()); return qsTop - mNotificationStackScrollLayoutController.getTop(); } } Loading @@ -1227,6 +1237,7 @@ public class QuickSettingsController { /** Calculate top padding for notifications */ public float calculateNotificationsTopPadding(boolean isShadeExpanding, int keyguardNotificationStaticPadding, float expandedFraction) { float topPadding; boolean keyguardShowing = mBarState == KEYGUARD; if (mSplitShadeEnabled) { return keyguardShowing Loading @@ -1243,19 +1254,27 @@ public class QuickSettingsController { int maxQsPadding = getMaxExpansionHeight(); int max = keyguardShowing ? Math.max( keyguardNotificationStaticPadding, maxQsPadding) : maxQsPadding; return (int) MathUtils.lerp((float) getMinExpansionHeight(), topPadding = (int) MathUtils.lerp((float) getMinExpansionHeight(), (float) max, expandedFraction); logNotificationsTopPadding("keyguard and expandImmediate", topPadding); return topPadding; } else if (isSizeChangeAnimationRunning()) { return Math.max((int) mSizeChangeAnimator.getAnimatedValue(), topPadding = Math.max((int) mSizeChangeAnimator.getAnimatedValue(), keyguardNotificationStaticPadding); logNotificationsTopPadding("size change animation running", topPadding); return topPadding; } else if (keyguardShowing) { // We can only do the smoother transition on Keyguard when we also are not collapsing // from a scrolled quick settings. return MathUtils.lerp((float) keyguardNotificationStaticPadding, topPadding = MathUtils.lerp((float) keyguardNotificationStaticPadding, (float) (getMaxExpansionHeight()), computeExpansionFraction()); logNotificationsTopPadding("keyguard", topPadding); return topPadding; } else { return mQsFrameTranslateController.getNotificationsTopPadding( topPadding = mQsFrameTranslateController.getNotificationsTopPadding( mExpansionHeight, mNotificationStackScrollLayoutController); logNotificationsTopPadding("default case", topPadding); return topPadding; } } Loading Loading @@ -1302,6 +1321,38 @@ public class QuickSettingsController { - mAmbientState.getScrollY()); } /** TODO(b/273591201): remove after bug resolved */ private void logNotificationsTopPadding(String message, float rawPadding) { int padding = ((int) rawPadding / 10) * 10; if (mBarState != KEYGUARD && padding != mLastNotificationsTopPadding && !mExpanded) { mLastNotificationsTopPadding = padding; mShadeLog.logNotificationsTopPadding(message, padding); } } /** TODO(b/273591201): remove after bug resolved */ private void logClippingTopBound(String message, int top) { top = (top / 10) * 10; if (mBarState != KEYGUARD && mShadeExpandedFraction == 1 && top != mLastClippingTopBound && !mExpanded) { mLastClippingTopBound = top; mShadeLog.logClippingTopBound(message, top); } } /** TODO(b/273591201): remove after bug resolved */ private void logNotificationsClippingTopBound(int top, int nsslTop) { top = (top / 10) * 10; nsslTop = (nsslTop / 10) * 10; if (mBarState == SHADE && mShadeExpandedFraction == 1 && (top != mLastNotificationsClippingTopBound || nsslTop != mLastNotificationsClippingTopBoundNssl) && !mExpanded) { mLastNotificationsClippingTopBound = top; mLastNotificationsClippingTopBoundNssl = nsslTop; mShadeLog.logNotificationsClippingTopBound(top, nsslTop); } } private int calculateTopClippingBound(int qsPanelBottomY) { int top; if (mSplitShadeEnabled) { Loading @@ -1311,6 +1362,7 @@ public class QuickSettingsController { // If we're transitioning, let's use the actual value. The else case // can be wrong during transitions when waiting for the keyguard to unlock top = mTransitionToFullShadePosition; logClippingTopBound("set while transitioning to full shade", top); } else { final float notificationTop = getEdgePosition(); if (mBarState == KEYGUARD) { Loading @@ -1319,8 +1371,10 @@ public class QuickSettingsController { // this should go away once we unify the stackY position and don't have // to do this min anymore below. top = qsPanelBottomY; logClippingTopBound("bypassing keyguard", top); } else { top = (int) Math.min(qsPanelBottomY, notificationTop); logClippingTopBound("keyguard default case", top); } } else { top = (int) notificationTop; Loading @@ -1328,12 +1382,14 @@ public class QuickSettingsController { } // TODO (b/265193930): remove dependency on NPVC top += mPanelViewControllerLazy.get().getOverStretchAmount(); logClippingTopBound("including overstretch", top); // Correction for instant expansion caused by HUN pull down/ float minFraction = mPanelViewControllerLazy.get().getMinFraction(); if (minFraction > 0f && minFraction < 1f) { float realFraction = (mShadeExpandedFraction - minFraction) / (1f - minFraction); top *= MathUtils.saturate(realFraction / minFraction); logClippingTopBound("after adjusted fraction", top); } } return top; Loading
packages/SystemUI/src/com/android/systemui/shade/ShadeLogger.kt +36 −0 Original line number Diff line number Diff line Loading @@ -280,4 +280,40 @@ class ShadeLogger @Inject constructor(@ShadeLog private val buffer: LogBuffer) { { "Split shade state changed: split shade ${if (bool1) "enabled" else "disabled"}" } ) } fun logNotificationsTopPadding(message: String, padding: Int) { buffer.log( TAG, LogLevel.VERBOSE, { str1 = message int1 = padding }, { "QSC NotificationsTopPadding $str1: $int1"} ) } fun logClippingTopBound(message: String, top: Int) { buffer.log( TAG, LogLevel.VERBOSE, { str1 = message int1 = top }, { "QSC ClippingTopBound $str1: $int1" } ) } fun logNotificationsClippingTopBound(top: Int, nsslTop: Int) { buffer.log( TAG, LogLevel.VERBOSE, { int1 = top int2 = nsslTop }, { "QSC NotificationsClippingTopBound set to $int1 - $int2" } ) } }