diff options
author | 2013-07-19 22:44:57 +0000 | |
---|---|---|
committer | 2013-07-19 22:44:57 +0000 | |
commit | c5236deeb0b0025a3dba54d688590d9146b5dbf3 (patch) | |
tree | 341a0248bbb312a565d9adce8510a27053b32efd | |
parent | 5712ca7f2e6ac0c7914875a580380fb363e86566 (diff) | |
parent | 398d309c616ee5e1661282d7fce38db4cfb24ee6 (diff) |
Merge "Properly set the tap down time when entering non-tap modes"
-rw-r--r-- | services/input/InputReader.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/services/input/InputReader.cpp b/services/input/InputReader.cpp index 5b64d8afab3f..992001fc62d5 100644 --- a/services/input/InputReader.cpp +++ b/services/input/InputReader.cpp @@ -4650,6 +4650,14 @@ bool TouchInputMapper::preparePointerGestures(nsecs_t when, mCurrentFingerIdBits, positions); } + // If the gesture ever enters a mode other than TAP, HOVER or TAP_DRAG, without first returning + // to NEUTRAL, then we should not generate tap event. + if (mPointerGesture.lastGestureMode != PointerGesture::HOVER + && mPointerGesture.lastGestureMode != PointerGesture::TAP + && mPointerGesture.lastGestureMode != PointerGesture::TAP_DRAG) { + mPointerGesture.resetTap(); + } + // Pick a new active touch id if needed. // Choose an arbitrary pointer that just went down, if there is one. // Otherwise choose an arbitrary remaining pointer. @@ -4858,8 +4866,12 @@ bool TouchInputMapper::preparePointerGestures(nsecs_t when, } } else { #if DEBUG_GESTURES - ALOGD("Gestures: Not a TAP, %0.3fms since down", - (when - mPointerGesture.tapDownTime) * 0.000001f); + if (mPointerGesture.tapDownTime != LLONG_MIN) { + ALOGD("Gestures: Not a TAP, %0.3fms since down", + (when - mPointerGesture.tapDownTime) * 0.000001f); + } else { + ALOGD("Gestures: Not a TAP, incompatible mode transitions"); + } #endif } } |