summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Michael Wright <michaelwr@google.com> 2013-07-02 17:35:00 -0700
committer Michael Wright <michaelwr@google.com> 2013-07-02 17:35:00 -0700
commit398d309c616ee5e1661282d7fce38db4cfb24ee6 (patch)
treee719108ed6d6c9c9e1fa22cafefb01d69e77464f
parent7f48bea96b2f374a3c810255a73a5abbbd708da4 (diff)
Properly set the tap down time when entering non-tap modes
This prevents us from erroneously generating tap gestures on things like quick button presses. Change-Id: I708e7df9341df589927fd2c0e15c202ccb30ba9b
-rw-r--r--services/input/InputReader.cpp16
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
}
}