Merge "Suppress calling onPressKey and onReleaseKey while detecting gesture"
diff --git a/java/src/com/android/inputmethod/keyboard/PointerTracker.java b/java/src/com/android/inputmethod/keyboard/PointerTracker.java
index dcfae73..2ec6e20 100644
--- a/java/src/com/android/inputmethod/keyboard/PointerTracker.java
+++ b/java/src/com/android/inputmethod/keyboard/PointerTracker.java
@@ -441,7 +441,7 @@
 
     // Returns true if keyboard has been changed by this callback.
     private boolean callListenerOnPressAndCheckKeyboardLayoutChange(final Key key) {
-        if (sInGesture) {
+        if (sInGesture || mIsDetectingGesture) {
             return false;
         }
         final boolean ignoreModifierKey = mIsInSlidingKeyInputFromModifier && key.isModifier();
@@ -500,7 +500,7 @@
     // primaryCode is different from {@link Key#mCode}.
     private void callListenerOnRelease(final Key key, final int primaryCode,
             final boolean withSliding) {
-        if (sInGesture) {
+        if (sInGesture || mIsDetectingGesture) {
             return;
         }
         final boolean ignoreModifierKey = mIsInSlidingKeyInputFromModifier && key.isModifier();