Add option to enable personalization dictionaries.

Bug: 11757851

Change-Id: I4872c10793d4fd55c0bd9e5bc4650925de6d2c1d
main
Keisuke Kuroyanagi 2013-12-16 19:17:31 +09:00
parent b6a19229ba
commit d4bb7df412
4 changed files with 15 additions and 2 deletions

View File

@ -87,6 +87,11 @@
<!-- Description for option enabling or disabling the use of names of people in Contacts for suggestion and correction [CHAR LIMIT=65] --> <!-- Description for option enabling or disabling the use of names of people in Contacts for suggestion and correction [CHAR LIMIT=65] -->
<string name="use_contacts_dict_summary">Use names from Contacts for suggestions and corrections</string> <string name="use_contacts_dict_summary">Use names from Contacts for suggestions and corrections</string>
<!-- Option name for enabling the use by the keyboards of sent/received messages, e-mail and typing history to improve suggestion accuracy [CHAR LIMIT=25] -->
<string name="use_personalized_dicts">Personalized suggestions</string>
<!-- Description for option enabling the use by the keyboards of sent/received messages, e-mail and typing history to improve suggestion accuracy [CHAR LIMIT=65] -->
<string name="use_personalized_dicts_summary">Learn from your communications and typed data to improve suggestions</string>
<!-- Option name for enabling or disabling the double-space period feature that lets double tap on spacebar insert a period followed by a space [CHAR LIMIT=30] --> <!-- Option name for enabling or disabling the double-space period feature that lets double tap on spacebar insert a period followed by a space [CHAR LIMIT=30] -->
<string name="use_double_space_period">Double-space period</string> <string name="use_double_space_period">Double-space period</string>
<!-- Description for option enabling or disabling the double-space period feature that lets double tap on spacebar insert a period followed by a space [CHAR LIMIT=65] --> <!-- Description for option enabling or disabling the double-space period feature that lets double tap on spacebar insert a period followed by a space [CHAR LIMIT=65] -->

View File

@ -133,6 +133,12 @@
android:summary="@string/use_contacts_dict_summary" android:summary="@string/use_contacts_dict_summary"
android:persistent="true" android:persistent="true"
android:defaultValue="true" /> android:defaultValue="true" />
<CheckBoxPreference
android:key="pref_key_use_personalized_dicts"
android:title="@string/use_personalized_dicts"
android:summary="@string/use_personalized_dicts_summary"
android:persistent="true"
android:defaultValue="true" />
<CheckBoxPreference <CheckBoxPreference
android:key="pref_key_use_double_space_period" android:key="pref_key_use_double_space_period"
android:title="@string/use_double_space_period" android:title="@string/use_double_space_period"

View File

@ -53,6 +53,7 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang
public static final String PREF_MISC_SETTINGS = "misc_settings"; public static final String PREF_MISC_SETTINGS = "misc_settings";
public static final String PREF_ADVANCED_SETTINGS = "pref_advanced_settings"; public static final String PREF_ADVANCED_SETTINGS = "pref_advanced_settings";
public static final String PREF_KEY_USE_CONTACTS_DICT = "pref_key_use_contacts_dict"; public static final String PREF_KEY_USE_CONTACTS_DICT = "pref_key_use_contacts_dict";
public static final String PREF_KEY_USE_PERSONALIZED_DICTS = "pref_key_use_personalized_dicts";
public static final String PREF_KEY_USE_DOUBLE_SPACE_PERIOD = public static final String PREF_KEY_USE_DOUBLE_SPACE_PERIOD =
"pref_key_use_double_space_period"; "pref_key_use_double_space_period";
public static final String PREF_BLOCK_POTENTIALLY_OFFENSIVE = public static final String PREF_BLOCK_POTENTIALLY_OFFENSIVE =

View File

@ -29,11 +29,9 @@ import com.android.inputmethod.latin.Dictionary;
import com.android.inputmethod.latin.InputAttributes; import com.android.inputmethod.latin.InputAttributes;
import com.android.inputmethod.latin.R; import com.android.inputmethod.latin.R;
import com.android.inputmethod.latin.RichInputMethodManager; import com.android.inputmethod.latin.RichInputMethodManager;
import com.android.inputmethod.latin.SubtypeSwitcher;
import com.android.inputmethod.latin.SuggestedWords; import com.android.inputmethod.latin.SuggestedWords;
import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo;
import com.android.inputmethod.latin.utils.CollectionUtils; import com.android.inputmethod.latin.utils.CollectionUtils;
import com.android.inputmethod.latin.utils.InputTypeUtils;
import com.android.inputmethod.latin.utils.StringUtils; import com.android.inputmethod.latin.utils.StringUtils;
import java.util.ArrayList; import java.util.ArrayList;
@ -71,6 +69,7 @@ public final class SettingsValues {
public final boolean mIncludesOtherImesInLanguageSwitchList; public final boolean mIncludesOtherImesInLanguageSwitchList;
public final boolean mShowsLanguageSwitchKey; public final boolean mShowsLanguageSwitchKey;
public final boolean mUseContactsDict; public final boolean mUseContactsDict;
public final boolean mUsePersonalizedDicts;
public final boolean mUseDoubleSpacePeriod; public final boolean mUseDoubleSpacePeriod;
public final boolean mBlockPotentiallyOffensive; public final boolean mBlockPotentiallyOffensive;
// Use bigrams to predict the next word when there is no input for it yet // Use bigrams to predict the next word when there is no input for it yet
@ -148,6 +147,7 @@ public final class SettingsValues {
Settings.PREF_INCLUDE_OTHER_IMES_IN_LANGUAGE_SWITCH_LIST, false); Settings.PREF_INCLUDE_OTHER_IMES_IN_LANGUAGE_SWITCH_LIST, false);
mShowsLanguageSwitchKey = Settings.readShowsLanguageSwitchKey(prefs); mShowsLanguageSwitchKey = Settings.readShowsLanguageSwitchKey(prefs);
mUseContactsDict = prefs.getBoolean(Settings.PREF_KEY_USE_CONTACTS_DICT, true); mUseContactsDict = prefs.getBoolean(Settings.PREF_KEY_USE_CONTACTS_DICT, true);
mUsePersonalizedDicts = prefs.getBoolean(Settings.PREF_KEY_USE_PERSONALIZED_DICTS, true);
mUseDoubleSpacePeriod = prefs.getBoolean(Settings.PREF_KEY_USE_DOUBLE_SPACE_PERIOD, true); mUseDoubleSpacePeriod = prefs.getBoolean(Settings.PREF_KEY_USE_DOUBLE_SPACE_PERIOD, true);
mBlockPotentiallyOffensive = Settings.readBlockPotentiallyOffensive(prefs, res); mBlockPotentiallyOffensive = Settings.readBlockPotentiallyOffensive(prefs, res);
mAutoCorrectEnabled = Settings.readAutoCorrectEnabled(autoCorrectionThresholdRawValue, res); mAutoCorrectEnabled = Settings.readAutoCorrectEnabled(autoCorrectionThresholdRawValue, res);
@ -206,6 +206,7 @@ public final class SettingsValues {
mIncludesOtherImesInLanguageSwitchList = false; mIncludesOtherImesInLanguageSwitchList = false;
mShowsLanguageSwitchKey = true; mShowsLanguageSwitchKey = true;
mUseContactsDict = true; mUseContactsDict = true;
mUsePersonalizedDicts = true;
mUseDoubleSpacePeriod = true; mUseDoubleSpacePeriod = true;
mBlockPotentiallyOffensive = true; mBlockPotentiallyOffensive = true;
mAutoCorrectEnabled = true; mAutoCorrectEnabled = true;