aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/settings/SettingsValues.java
diff options
context:
space:
mode:
authorJatin Matani <jatinm@google.com>2014-11-24 13:48:16 -0800
committerJatin Matani <jatinm@google.com>2014-12-16 15:56:00 -0800
commitbc4ae6bdc0249f9282efea5d1fe7ccfefd6f93b0 (patch)
treec6b34da6729328cd1cab530c5134135a079f09a8 /java/src/com/android/inputmethod/latin/settings/SettingsValues.java
parent2c826fd28eb48bd44e8c3e465f90e99bb22649ac (diff)
downloadlatinime-bc4ae6bdc0249f9282efea5d1fe7ccfefd6f93b0.tar.gz
latinime-bc4ae6bdc0249f9282efea5d1fe7ccfefd6f93b0.tar.xz
latinime-bc4ae6bdc0249f9282efea5d1fe7ccfefd6f93b0.zip
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
Diffstat (limited to 'java/src/com/android/inputmethod/latin/settings/SettingsValues.java')
-rw-r--r--java/src/com/android/inputmethod/latin/settings/SettingsValues.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java
index 5f1a7af44..0669026d8 100644
--- a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java
+++ b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java
@@ -36,6 +36,7 @@ import java.util.Arrays;
import java.util.Locale;
import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
/**
* When you call the constructor of this class, you may want to change the current system locale by
@@ -120,6 +121,8 @@ public class SettingsValues {
public final float mKeyPreviewDismissEndXScale;
public final float mKeyPreviewDismissEndYScale;
+ @Nullable public final String mAccount;
+
public SettingsValues(final Context context, final SharedPreferences prefs, final Resources res,
@Nonnull final InputAttributes inputAttributes) {
mLocale = res.getConfiguration().locale;
@@ -176,6 +179,8 @@ public class SettingsValues {
mPlausibilityThreshold = Settings.readPlausibilityThreshold(res);
mGestureInputEnabled = Settings.readGestureInputEnabled(prefs, res);
mGestureTrailEnabled = prefs.getBoolean(Settings.PREF_GESTURE_PREVIEW_TRAIL, true);
+ mAccount = prefs.getString(LocalSettingsConstants.PREF_ACCOUNT_NAME,
+ null /* default */);
mGestureFloatingPreviewTextEnabled = !mInputAttributes.mDisableGestureFloatingPreviewText
&& prefs.getBoolean(Settings.PREF_GESTURE_FLOATING_PREVIEW_TEXT, true);
mPhraseGestureEnabled = Settings.readPhraseGestureEnabled(prefs, res);