Bug 859212 - Part 4: Remove unused HKB whitelist. r=jchen
authorChris Peterson <cpeterson@mozilla.com>
Sun, 07 Apr 2013 23:05:15 -0700
changeset 128038 79c23403daee79ac89901009b3e5ed4212fccb55
parent 128037 f1a739e3b5fa4c9312f108abf9038241e76e1633
child 128039 f971d287ba11d60ddc72c7aae79869d426221aea
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 4: Remove unused HKB whitelist. r=jchen
mobile/android/base/InputMethods.java
--- a/mobile/android/base/InputMethods.java
+++ b/mobile/android/base/InputMethods.java
@@ -6,17 +6,16 @@
 package org.mozilla.gecko;
 
 import android.content.Context;
 import android.os.Build;
 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";
@@ -24,26 +23,16 @@ final class InputMethods {
     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_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";
 
-    // this is white list of IME support for hardware physical keyboard
-    private static final Collection<String> sHKBWhiteList = Arrays.asList(new String[] {
-                                                            METHOD_ATOK,
-                                                            METHOD_GOOGLE_JAPANESE_INPUT,
-                                                            METHOD_IWNN,
-                                                            METHOD_OPENWNN_PLUS,
-                                                            METHOD_SIMEJI,
-                                                            });
-    private static Boolean sIsPreJellyBeanAsusTransformer;
-
     private InputMethods() {}
 
     public static String getCurrentInputMethod(Context context) {
         String inputMethod = Secure.getString(context.getContentResolver(), Secure.DEFAULT_INPUT_METHOD);
         return (inputMethod != null ? inputMethod : "");
     }
 
     public static InputMethodInfo getInputMethodInfo(Context context, String inputMethod) {
@@ -56,32 +45,16 @@ final class InputMethods {
         }
         return null;
     }
 
     public static InputMethodManager getInputMethodManager(Context context) {
         return (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
     }
 
-    public static boolean canUseInputMethodOnHKB(String inputMethod) {
-        if (sHKBWhiteList.contains(inputMethod)) {
-            return true;
-        }
-
-        // Asus Transformers generate en-US keycodes for HKB keys, regardless of system locale or
-        // keyboard layout. This bug is reportedly fixed in JB. See bug 669361 and bug 712018.
-        if (sIsPreJellyBeanAsusTransformer == null) {
-            sIsPreJellyBeanAsusTransformer = Build.VERSION.SDK_INT < 16 &&
-                                             "asus".equals(Build.BRAND) &&
-                                             "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_ANDROID_LATINIME.equals(inputMethod) ||
                                                METHOD_GOOGLE_LATINIME.equals(inputMethod));
     }
 
     public static boolean shouldDelayAwesomebarUpdate(Context context) {
         String inputMethod = getCurrentInputMethod(context);