From b4dd50bf5c5db4d606918532983572913411500d Mon Sep 17 00:00:00 2001 From: Michal Brzezinski Date: Tue, 27 Sep 2022 16:12:02 +0100 Subject: [PATCH] Fixing reading shade expansion progress when user pulls from the top of lockscreen This is special case not covered by shade to lockscreen transition (LockscreenShadeTransitionController) as here shade goes directly to expanded QS and we should use QS expansion fraction to properly track the progress. Bug: 244574445 Test: Go to large screen portrait lockscreen, pull down from the top, QS status bar should slowly fade in Change-Id: Ic74fb42e48b2aa3da956c47c41205058175e5273 --- .../NotificationPanelViewController.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java index d7e86b6e29195..a6db5f2c9855d 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java @@ -2479,17 +2479,23 @@ public final class NotificationPanelViewController extends PanelViewController { mDepthController.setQsPanelExpansion(qsExpansionFraction); mStatusBarKeyguardViewManager.setQsExpansion(qsExpansionFraction); - // updateQsExpansion will get called whenever mTransitionToFullShadeProgress or - // mLockscreenShadeTransitionController.getDragProgress change. - // When in lockscreen, getDragProgress indicates the true expanded fraction of QS - float shadeExpandedFraction = mTransitioningToFullShadeProgress > 0 - ? mLockscreenShadeTransitionController.getQSDragProgress() + float shadeExpandedFraction = isOnKeyguard() + ? getLockscreenShadeDragProgress() : getExpandedFraction(); mLargeScreenShadeHeaderController.setShadeExpandedFraction(shadeExpandedFraction); mLargeScreenShadeHeaderController.setQsExpandedFraction(qsExpansionFraction); mLargeScreenShadeHeaderController.setQsVisible(mQsVisible); } + private float getLockscreenShadeDragProgress() { + // mTransitioningToFullShadeProgress > 0 means we're doing regular lockscreen to shade + // transition. If that's not the case we should follow QS expansion fraction for when + // user is pulling from the same top to go directly to expanded QS + return mTransitioningToFullShadeProgress > 0 + ? mLockscreenShadeTransitionController.getQSDragProgress() + : computeQsExpansionFraction(); + } + private void onStackYChanged(boolean shouldAnimate) { if (mQs != null) { if (shouldAnimate) { @@ -4749,9 +4755,7 @@ public final class NotificationPanelViewController extends PanelViewController { @Override public float getLockscreenShadeDragProgress() { - return mTransitioningToFullShadeProgress > 0 - ? mLockscreenShadeTransitionController.getQSDragProgress() - : computeQsExpansionFraction(); + return NotificationPanelViewController.this.getLockscreenShadeDragProgress(); } };