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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user