Bug 859212 - Part 2: Add Android stock keyboard and TouchPal to list of gesture keyboards. r=jchen
authorChris Peterson <cpeterson@mozilla.com>
Sat, 06 Apr 2013 00:23:45 -0700
changeset 128036 0c4b651f1a448efede1659d81e3393fc6d278d50
parent 128035 d678fbf4ca2e4ecbaae7cfed34401ba6b86718d6
child 128037 f1a739e3b5fa4c9312f108abf9038241e76e1633
push id26107
push usercpeterson@mozilla.com
push dateMon, 08 Apr 2013 20:22:12 +0000
treeherdermozilla-inbound@f971d287ba11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjchen
bugs859212
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 859212 - Part 2: Add Android stock keyboard and TouchPal to list of gesture keyboards. r=jchen
mobile/android/base/InputMethods.java
--- a/mobile/android/base/InputMethods.java
+++ b/mobile/android/base/InputMethods.java
@@ -11,27 +11,28 @@ import android.provider.Settings.Secure;
 import android.view.inputmethod.InputMethodInfo;
 import android.view.inputmethod.InputMethodManager;
 
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Locale;
 
 final class InputMethods {
-
+    public static final String METHOD_ANDROID_LATINIME = "com.android.inputmethod.latin/.LatinIME";
     public static final String METHOD_ATOK = "com.justsystems.atokmobile.service/.AtokInputMethodService";
     public static final String METHOD_GOOGLE_JAPANESE_INPUT = "com.google.android.inputmethod.japanese/.MozcService";
+    public static final String METHOD_GOOGLE_LATINIME = "com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME";
     public static final String METHOD_IWNN = "jp.co.omronsoft.iwnnime.ml/.standardcommon.IWnnLanguageSwitcher";
     public static final String METHOD_OPENWNN_PLUS = "com.owplus.ime.openwnnplus/.OpenWnnJAJP";
     public static final String METHOD_SAMSUNG = "com.sec.android.inputmethod/.SamsungKeypad";
     public static final String METHOD_SIMEJI = "com.adamrocker.android.input.simeji/.OpenWnnSimeji";
-    public static final String METHOD_STOCK_LATINIME = "com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME";
     public static final String METHOD_SWIFTKEY = "com.touchtype.swiftkey/com.touchtype.KeyboardService";
     public static final String METHOD_SWYPE = "com.swype.android.inputmethod/.SwypeInputMethod";
     public static final String METHOD_SWYPE_BETA = "com.nuance.swype.input/.IME";
+    public static final String METHOD_TOUCHPAL_KEYBOARD = "com.cootek.smartinputv5/com.cootek.smartinput5.TouchPalIME";
 
     /* These input method names are currently unused, but kept here for future reference:
     public static final String METHOD_EYES_FREE_KEYBOARD = "com.googlecode.eyesfree.inputmethod.latin/.LatinIME";
     public static final String METHOD_GO_KEYBOARD = "com.jb.gokeyboard/.GoKeyboard";
     public static final String METHOD_GOOGLE_PINYIN = "com.google.android.inputmethod.pinyin/.PinyinIME";
     public static final String METHOD_GOOGLE_TALKBACK = "com.google.android.marvin.talkback/com.googlecode.eyesfree.inputmethod.latin.LatinIME";
     public static final String METHOD_HACKERS_KEYBOARD = "org.pocketworkstation.pckeyboard/.LatinIME";
     public static final String METHOD_SAMSUNG_GALAXY_NOTE = "com.samsung.sec.android.inputmethod.axt9/.AxT9IME";
@@ -85,24 +86,29 @@ final class InputMethods {
                                              "EeePad".equals(Build.BOARD);
         }
         // The locale may change while Firefox is running, but the device and OS should not. :)
         return sIsPreJellyBeanAsusTransformer && !Locale.getDefault().equals(Locale.US);
     }
 
     public static boolean needsSoftResetWorkaround(String inputMethod) {
         // Stock latin IME on Android 4.2 and above
-        return Build.VERSION.SDK_INT >= 17 &&
-               METHOD_STOCK_LATINIME.equals(inputMethod);
+        return Build.VERSION.SDK_INT >= 17 && (METHOD_ANDROID_LATINIME.equals(inputMethod) ||
+                                               METHOD_GOOGLE_LATINIME.equals(inputMethod));
     }
 
     public static boolean shouldDelayAwesomebarUpdate(Context context) {
         String inputMethod = getCurrentInputMethod(context);
         return METHOD_SAMSUNG.equals(inputMethod) ||
                METHOD_SWIFTKEY.equals(inputMethod);
     }
 
     public static boolean isGestureKeyboard(Context context) {
+        // SwiftKey is a gesture keyboard, but it doesn't seem to need any special-casing
+        // to do AwesomeBar auto-spacing.
         String inputMethod = getCurrentInputMethod(context);
-        return METHOD_SWYPE.equals(inputMethod) ||
-               METHOD_SWYPE_BETA.equals(inputMethod);
+        return (Build.VERSION.SDK_INT >= 17 && (METHOD_ANDROID_LATINIME.equals(inputMethod) ||
+                                                METHOD_GOOGLE_LATINIME.equals(inputMethod))) ||
+               METHOD_SWYPE.equals(inputMethod) ||
+               METHOD_SWYPE_BETA.equals(inputMethod) ||
+               METHOD_TOUCHPAL_KEYBOARD.equals(inputMethod);
     }
 }