diff options
Diffstat (limited to 'java/src/com/android/inputmethod/compat/CompatUtils.java')
-rw-r--r-- | java/src/com/android/inputmethod/compat/CompatUtils.java | 38 |
1 files changed, 9 insertions, 29 deletions
diff --git a/java/src/com/android/inputmethod/compat/CompatUtils.java b/java/src/com/android/inputmethod/compat/CompatUtils.java index ba82a06ac..ce427e9c9 100644 --- a/java/src/com/android/inputmethod/compat/CompatUtils.java +++ b/java/src/com/android/inputmethod/compat/CompatUtils.java @@ -23,8 +23,6 @@ import android.util.Log; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.List; public class CompatUtils { private static final String TAG = CompatUtils.class.getSimpleName(); @@ -35,23 +33,16 @@ public class CompatUtils { public static Intent getInputLanguageSelectionIntent(String inputMethodId, int flagsForSubtypeSettings) { - final String action; - Intent intent; - if (InputMethodServiceCompatWrapper.CAN_HANDLE_ON_CURRENT_INPUT_METHOD_SUBTYPE_CHANGED - /* android.os.Build.VERSION_CODES.HONEYCOMB */ - && android.os.Build.VERSION.SDK_INT >= 11) { - // Refer to android.provider.Settings.ACTION_INPUT_METHOD_SUBTYPE_SETTINGS - action = INPUT_METHOD_SUBTYPE_SETTINGS; - intent = new Intent(action); - if (!TextUtils.isEmpty(inputMethodId)) { - intent.putExtra(EXTRA_INPUT_METHOD_ID, inputMethodId); - } - if (flagsForSubtypeSettings > 0) { - intent.setFlags(flagsForSubtypeSettings); - } - return intent; + // Refer to android.provider.Settings.ACTION_INPUT_METHOD_SUBTYPE_SETTINGS + final String action = INPUT_METHOD_SUBTYPE_SETTINGS; + final Intent intent = new Intent(action); + if (!TextUtils.isEmpty(inputMethodId)) { + intent.putExtra(EXTRA_INPUT_METHOD_ID, inputMethodId); } - throw new RuntimeException("Language selection doesn't supported on this platform"); + if (flagsForSubtypeSettings > 0) { + intent.setFlags(flagsForSubtypeSettings); + } + return intent; } public static Class<?> getClass(String className) { @@ -138,15 +129,4 @@ public class CompatUtils { Log.e(TAG, "Exception in setFieldValue: " + e.getClass().getSimpleName()); } } - - public static List<InputMethodSubtypeCompatWrapper> copyInputMethodSubtypeListToWrapper( - Object listObject) { - if (!(listObject instanceof List<?>)) return null; - final List<InputMethodSubtypeCompatWrapper> subtypes = - new ArrayList<InputMethodSubtypeCompatWrapper>(); - for (Object o: (List<?>)listObject) { - subtypes.add(new InputMethodSubtypeCompatWrapper(o)); - } - return subtypes; - } } |