diff options
author | 2014-04-28 06:58:01 +0000 | |
---|---|---|
committer | 2014-04-28 06:58:02 +0000 | |
commit | 91db602b83f5964896f9e1bc31e21ed16f775e4e (patch) | |
tree | 2e3f512e9df5fee539f7c8365d71e6ef5374e510 /java/src/com/android/inputmethod/latin/RichInputMethodManager.java | |
parent | 0b42851eed535929dedaa807cadd971a4efcd47f (diff) | |
parent | 8ba4f33709e6c40ade96922f88feace6e4b75b56 (diff) | |
download | latinime-91db602b83f5964896f9e1bc31e21ed16f775e4e.tar.gz latinime-91db602b83f5964896f9e1bc31e21ed16f775e4e.tar.xz latinime-91db602b83f5964896f9e1bc31e21ed16f775e4e.zip |
Merge "Use shouldOfferSwitchingToNextInputMethod when available"
Diffstat (limited to 'java/src/com/android/inputmethod/latin/RichInputMethodManager.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/RichInputMethodManager.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/RichInputMethodManager.java b/java/src/com/android/inputmethod/latin/RichInputMethodManager.java index 630a03670..2b0be545e 100644 --- a/java/src/com/android/inputmethod/latin/RichInputMethodManager.java +++ b/java/src/com/android/inputmethod/latin/RichInputMethodManager.java @@ -20,6 +20,7 @@ import static com.android.inputmethod.latin.Constants.Subtype.KEYBOARD_MODE; import android.content.Context; import android.content.SharedPreferences; +import android.os.Build; import android.os.IBinder; import android.preference.PreferenceManager; import android.util.Log; @@ -406,4 +407,15 @@ public final class RichInputMethodManager { mSubtypeListCacheWithoutImplicitlySelectedSubtypes.clear(); mInputMethodInfoCache.clear(); } + + 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) { + return defaultValue; + } + return mImmWrapper.shouldOfferSwitchingToNextInputMethod(binder); + } } |