Skip to content
Snippets Groups Projects
Commit 1690992d authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Check OS codename for shouldOfferSwitchingToNextInputMethod

Make sure if Build.VERSION.CODENAME is "REL" or not when
Build.VERSION.SDK_INT is 19 (KitKat). This is a tentative
workaround until Build.VERSION.SDK_INT is bumped to 20 or
greater.

BUG: 12965588
Change-Id: I0f6a8ef92af221240d247997ce65bd5e351b2d5e
parent 879629af
No related branches found
No related tags found
No related merge requests found
...@@ -410,12 +410,21 @@ public final class RichInputMethodManager { ...@@ -410,12 +410,21 @@ public final class RichInputMethodManager {
public boolean shouldOfferSwitchingToNextInputMethod(final IBinder binder, public boolean shouldOfferSwitchingToNextInputMethod(final IBinder binder,
boolean defaultValue) { boolean defaultValue) {
// Use the default value instead on Jelly Bean MR2 and previous where // Use the default value instead on Jelly Bean MR2 and previous, where
// {@link InputMethodManager#shouldOfferSwitchingToNextInputMethod} isn't yet available // {@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.JELLY_BEAN_MR2) {
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
return defaultValue; 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); return mImmWrapper.shouldOfferSwitchingToNextInputMethod(binder);
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment