From bc4ae6bdc0249f9282efea5d1fe7ccfefd6f93b0 Mon Sep 17 00:00:00 2001 From: Jatin Matani Date: Mon, 24 Nov 2014 13:48:16 -0800 Subject: Passing account info to dictionaryFacilitator Attempt to use dictionary facilitor without invoking preference manager. Instead use account from settings only when things are being reset/changed. Discussion forked from ag/591663 Overall, the idea here is to maintain an account information inside dictionary groups. Reset the dictionary groups if account changes (the way we do for locale). Since only user history dictionary is currently affected, the check to reset user history dictionary also includes the check to verify the account. For other things remain the same. SettingsValues holds the current account (and is updated if prefs change due to change in account settings). The updated settings are then propagated to dictionary facilitator via LatinIME#loadSettings. Bug:18104749,18469539 Change-Id: I553e776e7ea125d0fb7a1fe70a4c7eb0b2277fb8 --- .../inputmethod/latin/personalization/PersonalizationDictionary.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'java/src/com/android/inputmethod/latin/personalization/PersonalizationDictionary.java') diff --git a/java/src/com/android/inputmethod/latin/personalization/PersonalizationDictionary.java b/java/src/com/android/inputmethod/latin/personalization/PersonalizationDictionary.java index 33d1273f7..76451cc6b 100644 --- a/java/src/com/android/inputmethod/latin/personalization/PersonalizationDictionary.java +++ b/java/src/com/android/inputmethod/latin/personalization/PersonalizationDictionary.java @@ -24,6 +24,8 @@ import com.android.inputmethod.latin.Dictionary; import java.io.File; import java.util.Locale; +import javax.annotation.Nullable; + public class PersonalizationDictionary extends DecayingExpandableBinaryDictionaryBase { /* package */ static final String NAME = PersonalizationDictionary.class.getSimpleName(); @@ -37,7 +39,8 @@ public class PersonalizationDictionary extends DecayingExpandableBinaryDictionar @SuppressWarnings("unused") @ExternallyReferenced public static PersonalizationDictionary getDictionary(final Context context, - final Locale locale, final File dictFile, final String dictNamePrefix) { + final Locale locale, final File dictFile, final String dictNamePrefix, + @Nullable final String account) { return PersonalizationHelper.getPersonalizationDictionary(context, locale); } } -- cgit v1.2.3-83-g751a