Allow gesture from the delete key

And inputting unexpected word while repeating the gesture
Bug: 7303982
Change-Id: I17bb6a689397500fa0e26706d6e07e427ea0b4d7
diff --git a/java/src/com/android/inputmethod/keyboard/PointerTracker.java b/java/src/com/android/inputmethod/keyboard/PointerTracker.java
index d4d0d87..c718332 100644
--- a/java/src/com/android/inputmethod/keyboard/PointerTracker.java
+++ b/java/src/com/android/inputmethod/keyboard/PointerTracker.java
@@ -937,9 +937,10 @@
         if (!sShouldHandleGesture) {
             return;
         }
-        // A gesture should start only from a non-modifier key.
+        // A gesture should start only from a non-modifier key. Note that the gesture detection is
+        // disabled when the key is repeating.
         mIsDetectingGesture = (mKeyboard != null) && mKeyboard.mId.isAlphabetKeyboard()
-                && key != null && !key.isModifier() && !key.isRepeatable();
+                && key != null && !key.isModifier();
         if (mIsDetectingGesture) {
             if (getActivePointerTrackerCount() == 1) {
                 sGestureFirstDownTime = eventTime;
@@ -1422,6 +1423,7 @@
         if (key == null || key.getCode() != code) {
             return;
         }
+        mIsDetectingGesture = false;
         final int nextRepeatCount = repeatCount + 1;
         mTimerProxy.startKeyRepeatTimer(this, nextRepeatCount, sParams.mKeyRepeatInterval);
         callListenerOnPressAndCheckKeyboardLayoutChange(key, repeatCount);