aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-03-23 06:20:58 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-03-23 06:20:58 -0700
commit380ad509e69ba2924d98d9c1e22888757638a0c5 (patch)
tree142194be594dd48d0640ba036b62e96a18fb84d4 /java/src/com/android/inputmethod/latin/LatinIME.java
parentb163f9162100559a15445c36624d86925dfe75ec (diff)
parent3ee7d97587ccbbeb8003d2142478337e8d60b2b7 (diff)
downloadlatinime-380ad509e69ba2924d98d9c1e22888757638a0c5.tar.gz
latinime-380ad509e69ba2924d98d9c1e22888757638a0c5.tar.xz
latinime-380ad509e69ba2924d98d9c1e22888757638a0c5.zip
Merge "Optimization and typo fix"
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 7903820f7..2ee5a3819 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -503,7 +503,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
private void initSuggest() {
final String localeStr = mSubtypeSwitcher.getInputLocaleStr();
- final Locale keyboardLocale = LocaleUtils.constructLocaleFromString(localeStr);
+ final Locale keyboardLocale = mSubtypeSwitcher.getInputLocale();
final Resources res = mResources;
final Locale savedLocale = LocaleUtils.setSystemLocale(res, keyboardLocale);
@@ -567,8 +567,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
}
/* package private */ void resetSuggestMainDict() {
- final String localeStr = mSubtypeSwitcher.getInputLocaleStr();
- final Locale keyboardLocale = LocaleUtils.constructLocaleFromString(localeStr);
+ final Locale keyboardLocale = mSubtypeSwitcher.getInputLocale();
int mainDicResId = DictionaryFactory.getMainDictionaryResourceId(mResources);
mSuggest.resetMainDict(this, mainDicResId, keyboardLocale);
}
@@ -1995,7 +1994,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
}
private void addToUserHistoryDictionary(final CharSequence suggestion) {
- if (suggestion == null || suggestion.length() < 1) return;
+ if (TextUtils.isEmpty(suggestion)) return;
// Only auto-add to dictionary if auto-correct is ON. Otherwise we'll be
// adding words in situations where the user or application really didn't