diff options
author | Jorim Jaggi <jjaggi@google.com> | 2015-10-01 14:13:04 -0700 |
---|---|---|
committer | Jorim Jaggi <jjaggi@google.com> | 2015-10-01 14:13:04 -0700 |
commit | d3f84d4a9a0ab22fcf85592dfbc5f7be9ecf5f9b (patch) | |
tree | 124a7cabdfa52278df181d547aeebd3140203b04 /services | |
parent | 6ffe9f05de81fab8e3cb4031a784e26c2c0acce1 (diff) | |
download | frameworks_base-d3f84d4a9a0ab22fcf85592dfbc5f7be9ecf5f9b.zip frameworks_base-d3f84d4a9a0ab22fcf85592dfbc5f7be9ecf5f9b.tar.gz frameworks_base-d3f84d4a9a0ab22fcf85592dfbc5f7be9ecf5f9b.tar.bz2 |
Add minimum time for double tap gesture
Bug: 24304031
Change-Id: I15629d6b05175aea9b0d02571f6245966094f162
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/GestureLauncherService.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/GestureLauncherService.java b/services/core/java/com/android/server/GestureLauncherService.java index f245985..2aa0390 100644 --- a/services/core/java/com/android/server/GestureLauncherService.java +++ b/services/core/java/com/android/server/GestureLauncherService.java @@ -55,7 +55,8 @@ public class GestureLauncherService extends SystemService { * Time in milliseconds in which the power button must be pressed twice so it will be considered * as a camera launch. */ - private static final long CAMERA_POWER_DOUBLE_TAP_TIME_MS = 300; + private static final long CAMERA_POWER_DOUBLE_TAP_MAX_TIME_MS = 300; + private static final long CAMERA_POWER_DOUBLE_TAP_MIN_TIME_MS = 120; /** The listener that receives the gesture event. */ private final GestureEventListener mGestureListener = new GestureEventListener(); @@ -256,14 +257,16 @@ public class GestureLauncherService extends SystemService { synchronized (this) { doubleTapInterval = event.getEventTime() - mLastPowerDown; if (mCameraDoubleTapPowerEnabled - && doubleTapInterval < CAMERA_POWER_DOUBLE_TAP_TIME_MS) { + && doubleTapInterval < CAMERA_POWER_DOUBLE_TAP_MAX_TIME_MS + && doubleTapInterval > CAMERA_POWER_DOUBLE_TAP_MIN_TIME_MS) { launched = true; intercept = interactive; } mLastPowerDown = event.getEventTime(); } if (launched) { - Slog.i(TAG, "Power button double tap gesture detected, launching camera."); + Slog.i(TAG, "Power button double tap gesture detected, launching camera. Interval=" + + doubleTapInterval + "ms"); launched = handleCameraLaunchGesture(false /* useWakelock */, StatusBarManager.CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP); if (launched) { |