diff options
author | 2013-10-03 12:17:31 -0700 | |
---|---|---|
committer | 2013-10-03 12:17:31 -0700 | |
commit | 72e6932d90473378e6851500d91dd645fef3c4dd (patch) | |
tree | ca1f7feef4674c70b76bdc1c94243bb47476f26b /java/src/com/android/inputmethod/latin/personalization/PersonalizationHelper.java | |
parent | 33587f919ef19d89296491a3d0e746b610838828 (diff) | |
parent | f2800fc6f44521f0594a4c29441bdf04d14341d8 (diff) | |
download | latinime-72e6932d90473378e6851500d91dd645fef3c4dd.tar.gz latinime-72e6932d90473378e6851500d91dd645fef3c4dd.tar.xz latinime-72e6932d90473378e6851500d91dd645fef3c4dd.zip |
am f2800fc6: am 1cf4789b: Merge "Set header attributes for ExpandableBinaryDictionary."
* commit 'f2800fc6f44521f0594a4c29441bdf04d14341d8':
Set header attributes for ExpandableBinaryDictionary.
Diffstat (limited to 'java/src/com/android/inputmethod/latin/personalization/PersonalizationHelper.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/personalization/PersonalizationHelper.java | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/java/src/com/android/inputmethod/latin/personalization/PersonalizationHelper.java b/java/src/com/android/inputmethod/latin/personalization/PersonalizationHelper.java index 5f702ee3f..8c9484b12 100644 --- a/java/src/com/android/inputmethod/latin/personalization/PersonalizationHelper.java +++ b/java/src/com/android/inputmethod/latin/personalization/PersonalizationHelper.java @@ -30,7 +30,7 @@ public class PersonalizationHelper { private static final String TAG = PersonalizationHelper.class.getSimpleName(); private static final boolean DEBUG = false; - private static final ConcurrentHashMap<String, SoftReference<UserHistoryPredictionDictionary>> + private static final ConcurrentHashMap<String, SoftReference<UserHistoryDictionary>> sLangUserHistoryDictCache = CollectionUtils.newConcurrentHashMap(); private static final ConcurrentHashMap<String, SoftReference<PersonalizationDictionary>> @@ -41,25 +41,23 @@ public class PersonalizationHelper { sLangPersonalizationPredictionDictCache = CollectionUtils.newConcurrentHashMap(); - public static UserHistoryPredictionDictionary getUserHistoryPredictionDictionary( + public static UserHistoryDictionary getUserHistoryDictionary( final Context context, final String locale, final SharedPreferences sp) { synchronized (sLangUserHistoryDictCache) { if (sLangUserHistoryDictCache.containsKey(locale)) { - final SoftReference<UserHistoryPredictionDictionary> ref = + final SoftReference<UserHistoryDictionary> ref = sLangUserHistoryDictCache.get(locale); - final UserHistoryPredictionDictionary dict = ref == null ? null : ref.get(); + final UserHistoryDictionary dict = ref == null ? null : ref.get(); if (dict != null) { if (DEBUG) { - Log.w(TAG, "Use cached UserHistoryPredictionDictionary for " + locale); + Log.w(TAG, "Use cached UserHistoryDictionary for " + locale); } dict.reloadDictionaryIfRequired(); return dict; } } - final UserHistoryPredictionDictionary dict = - new UserHistoryPredictionDictionary(context, locale, sp); - sLangUserHistoryDictCache.put( - locale, new SoftReference<UserHistoryPredictionDictionary>(dict)); + final UserHistoryDictionary dict = new UserHistoryDictionary(context, locale, sp); + sLangUserHistoryDictCache.put(locale, new SoftReference<UserHistoryDictionary>(dict)); return dict; } } |