diff options
author | 2014-04-30 08:53:28 +0000 | |
---|---|---|
committer | 2014-04-30 08:53:28 +0000 | |
commit | 23d11dc08f82f9a98d145fa22e8d8445f847601f (patch) | |
tree | 00e93710d4e9eebc28d612dab933c86ae474619f /java/src/com/android/inputmethod | |
parent | bd34caedaafca68655277ee0c4906c8fcc1233bd (diff) | |
parent | 1690992d1b5e37f21edb3040d5b939bd0f713efc (diff) | |
download | latinime-23d11dc08f82f9a98d145fa22e8d8445f847601f.tar.gz latinime-23d11dc08f82f9a98d145fa22e8d8445f847601f.tar.xz latinime-23d11dc08f82f9a98d145fa22e8d8445f847601f.zip |
am 1690992d: Check OS codename for shouldOfferSwitchingToNextInputMethod
* commit '1690992d1b5e37f21edb3040d5b939bd0f713efc':
Check OS codename for shouldOfferSwitchingToNextInputMethod
Diffstat (limited to 'java/src/com/android/inputmethod')
-rw-r--r-- | java/src/com/android/inputmethod/latin/RichInputMethodManager.java | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/latin/RichInputMethodManager.java b/java/src/com/android/inputmethod/latin/RichInputMethodManager.java index 2b0be545e..64cc562c8 100644 --- a/java/src/com/android/inputmethod/latin/RichInputMethodManager.java +++ b/java/src/com/android/inputmethod/latin/RichInputMethodManager.java @@ -410,12 +410,21 @@ public final class RichInputMethodManager { public boolean shouldOfferSwitchingToNextInputMethod(final IBinder binder, boolean defaultValue) { - // Use the default value instead on Jelly Bean MR2 and previous where - // {@link InputMethodManager#shouldOfferSwitchingToNextInputMethod} isn't yet available - // and on KitKat where the API is still just a stub to return true always. - if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) { + // Use the default value instead on Jelly Bean MR2 and previous, where + // {@link InputMethodManager#shouldOfferSwitchingToNextInputMethod} isn't yet available. + if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN_MR2) { return defaultValue; } + // Use the default value instead on KitKat as well, where + // {@link InputMethodManager#shouldOfferSwitchingToNextInputMethod} is still just a stub to + // return true always. + if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT) { + // Make sure this is actually KitKat. + // TODO: Consider to remove this check once the *next* version becomes available. + if (Build.VERSION.CODENAME.equals("REL")) { + return defaultValue; + } + } return mImmWrapper.shouldOfferSwitchingToNextInputMethod(binder); } } |