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
This commit is contained in:
Jason Mylen
2023-01-18 20:10:53 +00:00
parent ec1d4f483d
commit a152ee8158

View File

@@ -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;