aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorMario Tanev <radix@google.com>2015-02-25 00:25:09 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-02-25 00:25:09 +0000
commitaf096dff14478763dd3aca5488ceee7ca793ff52 (patch)
tree127795f2b46e6d964bdd8545fe3259dcac6fc6f5 /java/src
parent85c78f712452e879d9d3971ca38d39e0d024ea62 (diff)
parenta3ac6f24cc6a22651e09a1bf7fc018d4af945333 (diff)
downloadlatinime-af096dff14478763dd3aca5488ceee7ca793ff52.tar.gz
latinime-af096dff14478763dd3aca5488ceee7ca793ff52.tar.xz
latinime-af096dff14478763dd3aca5488ceee7ca793ff52.zip
am a3ac6f24: Merge "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 elemen
* commit 'a3ac6f24cc6a22651e09a1bf7fc018d4af945333': 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.
Diffstat (limited to 'java/src')
-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) {