aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/RichInputMethodManager.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-10-14 15:11:39 +0900
committerJean Chalard <jchalard@google.com>2014-10-14 15:13:35 +0900
commitd15f6e8c98f673dc38100e2fe3e359f46f7358a4 (patch)
treeeaad756686ef5e1d69e4f4b56e770271b1f0e9aa /java/src/com/android/inputmethod/latin/RichInputMethodManager.java
parent59f5988a16bfd979f748ecd356b528f0b933a42c (diff)
downloadlatinime-d15f6e8c98f673dc38100e2fe3e359f46f7358a4.tar.gz
latinime-d15f6e8c98f673dc38100e2fe3e359f46f7358a4.tar.xz
latinime-d15f6e8c98f673dc38100e2fe3e359f46f7358a4.zip
Performance fix for multiple language subtypes
The code would iterate all enabled subtypes each time getCurrentSubtype() is called, which is really quite frequent. Bug: 11230254 Change-Id: I91feb36de6eca84967e848fc585aae04b350be89
Diffstat (limited to '')
-rw-r--r--java/src/com/android/inputmethod/latin/RichInputMethodManager.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/java/src/com/android/inputmethod/latin/RichInputMethodManager.java b/java/src/com/android/inputmethod/latin/RichInputMethodManager.java
index b4ec8d674..3fcae58f1 100644
--- a/java/src/com/android/inputmethod/latin/RichInputMethodManager.java
+++ b/java/src/com/android/inputmethod/latin/RichInputMethodManager.java
@@ -299,13 +299,13 @@ public class RichInputMethodManager {
return INDEX_NOT_FOUND;
}
- public RichInputMethodSubtype getCurrentInputMethodSubtype(
- final RichInputMethodSubtype defaultSubtype) {
- final InputMethodSubtype currentSubtype = mImmWrapper.mImm.getCurrentInputMethodSubtype();
- if (currentSubtype == null) {
- return defaultSubtype;
- }
- return AdditionalFeaturesSettingUtils.getRichInputMethodSubtype(this, currentSubtype);
+ public InputMethodSubtype getCurrentRawSubtype() {
+ return mImmWrapper.mImm.getCurrentInputMethodSubtype();
+ }
+
+ public RichInputMethodSubtype createCurrentRichInputMethodSubtype(
+ final InputMethodSubtype rawSubtype) {
+ return AdditionalFeaturesSettingUtils.createRichInputMethodSubtype(this, rawSubtype);
}
public boolean hasMultipleEnabledIMEsOrSubtypes(final boolean shouldIncludeAuxiliarySubtypes) {