Merge "Fix a bug where the cursor pos wouldn't be tracked correctly" into jb-mr1-dev
diff --git a/java/src/com/android/inputmethod/keyboard/PointerTracker.java b/java/src/com/android/inputmethod/keyboard/PointerTracker.java
index 89b6e7b..0778ad9 100644
--- a/java/src/com/android/inputmethod/keyboard/PointerTracker.java
+++ b/java/src/com/android/inputmethod/keyboard/PointerTracker.java
@@ -685,18 +685,13 @@
         if (!sShouldHandleGesture) {
             return;
         }
-        final int activePointerTrackerCount = getActivePointerTrackerCount();
-        if (activePointerTrackerCount == 1) {
-            mIsDetectingGesture = false;
-            // A gesture should start only from the letter key.
-            final boolean isAlphabetKeyboard = (mKeyboard != null)
-                    && mKeyboard.mId.isAlphabetKeyboard();
-            if (isAlphabetKeyboard && !mIsShowingMoreKeysPanel && key != null
-                    && Keyboard.isLetterCode(key.mCode)) {
+        // A gesture should start only from the letter key.
+        mIsDetectingGesture = (mKeyboard != null) && mKeyboard.mId.isAlphabetKeyboard()
+                && !mIsShowingMoreKeysPanel && key != null && Keyboard.isLetterCode(key.mCode);
+        if (mIsDetectingGesture) {
+            if (getActivePointerTrackerCount() == 1) {
                 sGestureFirstDownTime = eventTime;
-                onGestureDownEvent(x, y, eventTime);
             }
-        } else if (sInGesture && activePointerTrackerCount > 1) {
             onGestureDownEvent(x, y, eventTime);
         }
     }
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 00608c5..95f89c0 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -715,7 +715,9 @@
             mSpaceState = SPACE_STATE_NONE;
 
             if (mSuggestionStripView != null) {
-                mSuggestionStripView.clear();
+                // This will set the punctuation suggestions if next word suggestion is off;
+                // otherwise it will clear the suggestion strip.
+                setPunctuationSuggestions();
             }
         }