diff options
Diffstat (limited to 'java/src/com/android/inputmethod/compat/InputMethodServiceCompatWrapper.java')
-rw-r--r-- | java/src/com/android/inputmethod/compat/InputMethodServiceCompatWrapper.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/compat/InputMethodServiceCompatWrapper.java b/java/src/com/android/inputmethod/compat/InputMethodServiceCompatWrapper.java index 7aab66d05..8e2ee0f7a 100644 --- a/java/src/com/android/inputmethod/compat/InputMethodServiceCompatWrapper.java +++ b/java/src/com/android/inputmethod/compat/InputMethodServiceCompatWrapper.java @@ -73,16 +73,17 @@ public class InputMethodServiceCompatWrapper extends InputMethodService { // This call is required to let LatinIME itself know a subtype changed // event when the API level is 10 or previous. @SuppressWarnings("unused") - public void notifyOnCurrentInputMethodSubtypeChanged(InputMethodSubtypeCompatWrapper subtype) { + public void notifyOnCurrentInputMethodSubtypeChanged( + InputMethodSubtypeCompatWrapper newSubtype) { // Do nothing when the API level is 11 or later // and FORCE_ENABLE_VOICE_EVEN_WITH_NO_VOICE_SUBTYPES is not true if (CAN_HANDLE_ON_CURRENT_INPUT_METHOD_SUBTYPE_CHANGED && !InputMethodManagerCompatWrapper. FORCE_ENABLE_VOICE_EVEN_WITH_NO_VOICE_SUBTYPES) { return; } - if (subtype == null) { - subtype = mImm.getCurrentInputMethodSubtype(); - } + final InputMethodSubtypeCompatWrapper subtype = (newSubtype == null) + ? mImm.getCurrentInputMethodSubtype() + : newSubtype; if (subtype != null) { if (!InputMethodManagerCompatWrapper.FORCE_ENABLE_VOICE_EVEN_WITH_NO_VOICE_SUBTYPES && !subtype.isDummy()) return; |