OSDN Git Service

Only play up effect if its been over 100 ms
authorJason Monk <jmonk@google.com>
Thu, 6 Jul 2017 19:38:19 +0000 (15:38 -0400)
committerJason Monk <jmonk@google.com>
Thu, 6 Jul 2017 19:38:19 +0000 (15:38 -0400)
Test: manual
Bug: 62655913
Change-Id: If256ab9fc6f74688f47b0ea53543d3b2fd514a35

packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java

index 2d3e0b6..d652bde 100644 (file)
@@ -228,7 +228,9 @@ public class KeyButtonView extends ImageView implements ButtonInterface {
                 setPressed(false);
                 // Always send a release ourselves because it doesn't seem to be sent elsewhere
                 // and it feels weird to sometimes get a release haptic and other times not.
-                performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY_RELEASE);
+                if ((SystemClock.uptimeMillis() - mDownTime) > 100) {
+                    performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY_RELEASE);
+                }
                 if (mCode != 0) {
                     if (doIt) {
                         sendEvent(KeyEvent.ACTION_UP, 0);