Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1a6d01b6 authored by Mario Tanev's avatar Mario Tanev
Browse files

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
parent f7058c2a
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -64,12 +64,15 @@ public class DictionaryFacilitatorLruCache {
    }

    private void resetDictionariesForLocaleLocked() {
        // 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) {
        synchronized (mLock) {