diff options
author | 2014-04-28 07:39:00 +0900 | |
---|---|---|
committer | 2014-04-28 15:11:19 +0900 | |
commit | 8ba4f33709e6c40ade96922f88feace6e4b75b56 (patch) | |
tree | d06f0e886318cd9987a54a1fba1adae295cd8f47 /java/src/com/android/inputmethod/latin/RichInputMethodManager.java | |
parent | 2cc7c3321d9e1dea462cbcd78a6ee1a99985b73b (diff) | |
download | latinime-8ba4f33709e6c40ade96922f88feace6e4b75b56.tar.gz latinime-8ba4f33709e6c40ade96922f88feace6e4b75b56.tar.xz latinime-8ba4f33709e6c40ade96922f88feace6e4b75b56.zip |
Use shouldOfferSwitchingToNextInputMethod when available
With this CL, LatinIME starts using
InputMethodManager#shouldOfferSwitchingToNextInputMethod when
available and API level is higher than 19 (KitKat).
Note that relevant settings of LatinIME will be ignored if
InputMethodManager#shouldOfferSwitchingToNextInputMethod is
considered to be available at the moment. We will revisit
here to reorganize the user visible settings before the
new global IME switching mechanism becomes publicly
available.
BUG: 12965588
Change-Id: I0188fa56cba8e983c61cef3ae3400a0e3821f718
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); + } } |