From d81479a340d76afaef14ce683322e1488167919c Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Wed, 31 Aug 2011 21:20:52 +0900 Subject: Implement KeyboardLocale InputMethodSubtype extra key The locale is specified by KeyboardLocale extra key in method.xml, LatinIME will use the specified locale for keyboard layout. Bug: 5238658 Change-Id: I8e6cb66c73a7ac1bf611d9910b42fa9cff38eba0 --- .../inputmethod/compat/InputMethodServiceCompatWrapper.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'java/src/com/android/inputmethod/compat/InputMethodServiceCompatWrapper.java') 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; -- cgit v1.2.3-83-g751a