From 10ee9baae5bf58ab6442d04f1aa9d0dde7088e58 Mon Sep 17 00:00:00 2001 From: Shawn Lee Date: Thu, 16 Mar 2023 13:57:53 -0700 Subject: [PATCH] Prevent flings after motion gestures on fully expanded keyguard take 2 Narrower version of original reverted change. Any up-down gesture on keyguard would trigger a fling that visibly jumped the keyguard up due to the different height calculation for shade vs keyguard. If the gesture was quick enough, we were stuck with this incorrect expansion fraction until the next touch. This change simply blocks flings on keyguard off guestures that end at full expansion, since touch has already been intercepted by NotificationShadeWindowViewController when we're about to fling from that state. Test: manual Bug: 259023628 Change-Id: I0c8d585c964ec8046395b260b5a7a60849beab2b --- .../systemui/shade/NotificationPanelViewController.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java index 36be44256fcc8..1be8ca06dd5bd 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java @@ -3555,7 +3555,13 @@ public final class NotificationPanelViewController implements Dumpable { : (mKeyguardStateController.canDismissLockScreen() ? UNLOCK : BOUNCER_UNLOCK); - fling(vel, expand, isFalseTouch(x, y, interactionType)); + // don't fling while in keyguard to avoid jump in shade expand animation; + // touch has been intercepted already so flinging here is redundant + if (mBarState == KEYGUARD && mExpandedFraction >= 1.0) { + mShadeLog.d("NPVC endMotionEvent - skipping fling on keyguard"); + } else { + fling(vel, expand, isFalseTouch(x, y, interactionType)); + } onTrackingStopped(expand); mUpdateFlingOnLayout = expand && mPanelClosedOnDown && !mHasLayoutedSinceDown; if (mUpdateFlingOnLayout) {