From 85ddfe1317a4475269e53f62c2338c335e02e839 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Mon, 25 Aug 2014 04:42:15 +0000 Subject: Revert "Revert "[ML1] Introduce RichInputMethodSubtype"" This reverts commit a63d0a8ee6cb05bcddb69bf9a6018853d89d886a. This patch seems to be fine after all, but was submitted without its companion [ML1.1] patch causing a build breakage. Reverting the revert and submitting both at the same time seems like the right thing to do. Change-Id: Ib8fefa40b74dcee0edb025a52dac9b35c82d49df --- .../com/android/inputmethod/latin/RichInputMethodManager.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'java/src/com/android/inputmethod/latin/RichInputMethodManager.java') diff --git a/java/src/com/android/inputmethod/latin/RichInputMethodManager.java b/java/src/com/android/inputmethod/latin/RichInputMethodManager.java index 7cf4eff92..fc7a53a02 100644 --- a/java/src/com/android/inputmethod/latin/RichInputMethodManager.java +++ b/java/src/com/android/inputmethod/latin/RichInputMethodManager.java @@ -297,10 +297,14 @@ public final class RichInputMethodManager { return INDEX_NOT_FOUND; } - public InputMethodSubtype getCurrentInputMethodSubtype( - final InputMethodSubtype defaultSubtype) { + public RichInputMethodSubtype getCurrentInputMethodSubtype( + final RichInputMethodSubtype defaultSubtype) { final InputMethodSubtype currentSubtype = mImmWrapper.mImm.getCurrentInputMethodSubtype(); - return (currentSubtype != null) ? currentSubtype : defaultSubtype; + if (currentSubtype == null) { + return defaultSubtype; + } + // TODO: Determine locales to use for multi-lingual use. + return new RichInputMethodSubtype(currentSubtype); } public boolean hasMultipleEnabledIMEsOrSubtypes(final boolean shouldIncludeAuxiliarySubtypes) { -- cgit v1.2.3-83-g751a