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.
main
Mario Tanev 2015-02-25 00:25:09 +00:00 committed by Android Git Automerger
commit af096dff14
1 changed files with 8 additions and 5 deletions

View File

@ -64,11 +64,14 @@ public class DictionaryFacilitatorLruCache {
} }
private void resetDictionariesForLocaleLocked() { private void resetDictionariesForLocaleLocked() {
// Note: Given that personalized dictionaries are not used here; we can pass null account. // Nothing to do if the locale is null. This would be the case before any get() calls.
mDictionaryFacilitator.resetDictionaries(mContext, new Locale[]{mLocale}, if (mLocale != null) {
mUseContactsDictionary, false /* usePersonalizedDicts */, // Note: Given that personalized dictionaries are not used here; we can pass null account.
false /* forceReloadMainDictionary */, null /* account */, mDictionaryFacilitator.resetDictionaries(mContext, new Locale[]{mLocale},
mDictionaryNamePrefix, null /* listener */); mUseContactsDictionary, false /* usePersonalizedDicts */,
false /* forceReloadMainDictionary */, null /* account */,
mDictionaryNamePrefix, null /* listener */);
}
} }
public void setUseContactsDictionary(final boolean useContactsDictionary) { public void setUseContactsDictionary(final boolean useContactsDictionary) {