aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/DictionaryFacilitatorLruCache.java
diff options
context:
space:
mode:
authorMario Tanev <radix@google.com>2015-02-24 15:56:43 -0800
committerMario Tanev <radix@google.com>2015-02-24 15:56:43 -0800
commit1a6d01b61e2caa8340e3a52e5d941c86d59d31c8 (patch)
tree2fe0bf822bccff70480e3d0027e219d89cb71e30 /java/src/com/android/inputmethod/latin/DictionaryFacilitatorLruCache.java
parentf7058c2a89d3e081b2a279ef4853409924d42346 (diff)
downloadlatinime-1a6d01b61e2caa8340e3a52e5d941c86d59d31c8.tar.gz
latinime-1a6d01b61e2caa8340e3a52e5d941c86d59d31c8.tar.xz
latinime-1a6d01b61e2caa8340e3a52e5d941c86d59d31c8.zip
Don't call resetDictionaries if DictionaryFacilitatorLruCache.get()
hasn't been called yet. This breaks the AOSP SpellChecker. This seems to be a bug introduced recently, when the DictionaryFacilitatorLruCache was turned into a "cache" of 1 element. Change-Id: I55f6c18b274c9a33fd62cb25bcd02f64788d5ff0
Diffstat (limited to 'java/src/com/android/inputmethod/latin/DictionaryFacilitatorLruCache.java')
-rw-r--r--java/src/com/android/inputmethod/latin/DictionaryFacilitatorLruCache.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/DictionaryFacilitatorLruCache.java b/java/src/com/android/inputmethod/latin/DictionaryFacilitatorLruCache.java
index b813af4c2..1b3e9ca72 100644
--- a/java/src/com/android/inputmethod/latin/DictionaryFacilitatorLruCache.java
+++ b/java/src/com/android/inputmethod/latin/DictionaryFacilitatorLruCache.java
@@ -64,11 +64,14 @@ public class DictionaryFacilitatorLruCache {
}
private void resetDictionariesForLocaleLocked() {
- // Note: Given that personalized dictionaries are not used here; we can pass null account.
- mDictionaryFacilitator.resetDictionaries(mContext, new Locale[]{mLocale},
- mUseContactsDictionary, false /* usePersonalizedDicts */,
- false /* forceReloadMainDictionary */, null /* account */,
- mDictionaryNamePrefix, null /* listener */);
+ // Nothing to do if the locale is null. This would be the case before any get() calls.
+ if (mLocale != null) {
+ // Note: Given that personalized dictionaries are not used here; we can pass null account.
+ mDictionaryFacilitator.resetDictionaries(mContext, new Locale[]{mLocale},
+ mUseContactsDictionary, false /* usePersonalizedDicts */,
+ false /* forceReloadMainDictionary */, null /* account */,
+ mDictionaryNamePrefix, null /* listener */);
+ }
}
public void setUseContactsDictionary(final boolean useContactsDictionary) {