From a152ee8158c88a3ad9da6580ee1016c98d02e338 Mon Sep 17 00:00:00 2001 From: Jason Mylen Date: Wed, 18 Jan 2023 20:10:53 +0000 Subject: [PATCH] Handle edge cases for haptic feedback on shade opening. When a user is using the "Swipe" lock screen it is possible the state could trigger the openning haptic before this change. When the fling gesture is used, sometimes the vibration state is not set correctly. Test: manual Bug: 260676854 Change-Id: Id1873499b71655c1d9b379be476351ea4bdca03a --- .../systemui/shade/NotificationPanelViewController.java | 4 +++- 1 file changed, 3 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 ce6fb14fbcf85..12ebcfc794996 100644 --- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java @@ -2147,6 +2147,7 @@ public final class NotificationPanelViewController implements Dumpable { } ValueAnimator animator = createHeightAnimator(target, overshootAmount); if (expand) { + maybeVibrateOnOpening(true /* openingWithTouch */); if (expandBecauseOfFalsing && vel < 0) { vel = 0; } @@ -2157,6 +2158,7 @@ public final class NotificationPanelViewController implements Dumpable { animator.setDuration(SHADE_OPEN_SPRING_OUT_DURATION); } } else { + mHasVibratedOnOpen = false; if (shouldUseDismissingAnimation()) { if (vel == 0) { animator.setInterpolator(Interpolators.PANEL_CLOSE_ACCELERATED); @@ -6367,7 +6369,7 @@ public final class NotificationPanelViewController implements Dumpable { mShadeLog.logHasVibrated(mHasVibratedOnOpen, mExpandedFraction); } addMovement(event); - if (!isFullyCollapsed()) { + if (!isFullyCollapsed() && !isOnKeyguard()) { maybeVibrateOnOpening(true /* openingWithTouch */); } float h = y - mInitialExpandY;