Make emoji separators

Bug: 11163495
Change-Id: I3247b8d1bbd3406b29a30a25aebd932c63431943
diff --git a/java/src/com/android/inputmethod/latin/LastComposedWord.java b/java/src/com/android/inputmethod/latin/LastComposedWord.java
index 642b3a4..2e9280c 100644
--- a/java/src/com/android/inputmethod/latin/LastComposedWord.java
+++ b/java/src/com/android/inputmethod/latin/LastComposedWord.java
@@ -16,8 +16,6 @@
 
 package com.android.inputmethod.latin;
 
-import com.android.inputmethod.latin.utils.StringUtils;
-
 import android.text.TextUtils;
 
 /**
@@ -85,8 +83,4 @@
     private boolean didCommitTypedWord() {
         return TextUtils.equals(mTypedWord, mCommittedWord);
     }
-
-    public static int getSeparatorLength(final String separatorString) {
-        return StringUtils.codePointCount(separatorString);
-    }
 }
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index ccdbd0d..4ad7cb5 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1712,7 +1712,8 @@
         mSpaceState = SPACE_STATE_NONE;
         final boolean didAutoCorrect;
         final SettingsValues settingsValues = mSettings.getCurrent();
-        if (settingsValues.isWordSeparator(primaryCode)) {
+        if (settingsValues.isWordSeparator(primaryCode)
+                || Character.getType(primaryCode) == Character.OTHER_SYMBOL) {
             didAutoCorrect = handleSeparator(primaryCode, x, y, spaceState);
         } else {
             didAutoCorrect = false;
@@ -2979,8 +2980,8 @@
         final String originallyTypedWord = mLastComposedWord.mTypedWord;
         final String committedWord = mLastComposedWord.mCommittedWord;
         final int cancelLength = committedWord.length();
-        final int separatorLength = LastComposedWord.getSeparatorLength(
-                mLastComposedWord.mSeparatorString);
+        // We want java chars, not codepoints for the following.
+        final int separatorLength = mLastComposedWord.mSeparatorString.length();
         // TODO: should we check our saved separator against the actual contents of the text view?
         final int deleteLength = cancelLength + separatorLength;
         if (DEBUG) {