aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2011-06-10 18:16:21 +0900
committerJean Chalard <jchalard@google.com>2011-06-13 17:33:04 +0900
commit699094f9b6e0a4621e8b3cfab70b59c0c7c086bb (patch)
tree8523178580f755e9ebb3fd1a9860f69203823343 /java/src/com/android/inputmethod/latin/LatinIME.java
parent601b72cb1ecaff78f75f5938cdb90a019dff6f65 (diff)
downloadlatinime-699094f9b6e0a4621e8b3cfab70b59c0c7c086bb.tar.gz
latinime-699094f9b6e0a4621e8b3cfab70b59c0c7c086bb.tar.xz
latinime-699094f9b6e0a4621e8b3cfab70b59c0c7c086bb.zip
Add an option to use or not the contacts dictionary.
Bug: 4586840 Change-Id: If62cd57e5ab661e6a51a5442d09bf0af8f08f263
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);