aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 5b242b1e0..940f6b835 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -155,7 +155,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
private UserDictionary mUserDictionary;
private UserBigramDictionary mUserBigramDictionary;
- private ContactsDictionary mContactsDictionary;
private AutoDictionary mAutoDictionary;
// TODO: Create an inner class to group options and pseudo-options to improve readability.
@@ -407,6 +406,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
if (null == mPrefs) mPrefs = PreferenceManager.getDefaultSharedPreferences(this);
if (null == mSubtypeSwitcher) mSubtypeSwitcher = SubtypeSwitcher.getInstance();
mSettingsValues = new Settings.Values(mPrefs, this, mSubtypeSwitcher.getInputLocaleStr());
+ resetContactsDictionary();
}
private void initSuggest() {
@@ -429,8 +429,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
mUserDictionary = new UserDictionary(this, localeStr);
mSuggest.setUserDictionary(mUserDictionary);
- mContactsDictionary = new ContactsDictionary(this, Suggest.DIC_CONTACTS);
- mSuggest.setContactsDictionary(mContactsDictionary);
+ resetContactsDictionary();
mAutoDictionary = new AutoDictionary(this, this, localeStr, Suggest.DIC_AUTO);
mSuggest.setAutoDictionary(mAutoDictionary);
@@ -443,6 +442,13 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
Utils.setSystemLocale(res, savedLocale);
}
+ private void resetContactsDictionary() {
+ if (null == mSuggest) return;
+ ContactsDictionary contactsDictionary = mSettingsValues.mUseContactsDict
+ ? new ContactsDictionary(this, Suggest.DIC_CONTACTS) : null;
+ mSuggest.setContactsDictionary(contactsDictionary);
+ }
+
/* package private */ void resetSuggestMainDict() {
final String localeStr = mSubtypeSwitcher.getInputLocaleStr();
final Locale keyboardLocale = Utils.constructLocaleFromString(localeStr);