aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.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/LatinIME.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 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 3b995f9d9..77016cb8b 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -568,6 +568,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// TODO: Resolve mutual dependencies of {@link #loadSettings()} and
// {@link #resetDictionaryFacilitatorIfNecessary()}.
loadSettings();
+ mSubtypeSwitcher.onSubtypeChanged(mRichImm.getCurrentRawSubtype());
resetDictionaryFacilitatorIfNecessary();
// Register to receive ringer mode change and network state change.
@@ -837,8 +838,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
public void onCurrentInputMethodSubtypeChanged(final InputMethodSubtype subtype) {
// Note that the calling sequence of onCreate() and onCurrentInputMethodSubtypeChanged()
// is not guaranteed. It may even be called at the same time on a different thread.
- final RichInputMethodSubtype richSubtype = new RichInputMethodSubtype(subtype);
- mSubtypeSwitcher.onSubtypeChanged(richSubtype);
+ mSubtypeSwitcher.onSubtypeChanged(subtype);
mInputLogic.onSubtypeChanged(SubtypeLocaleUtils.getCombiningRulesExtraValue(subtype),
mSettings.getCurrent());
loadKeyboard();