summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2011-07-21 18:33:20 +0900
committerJean Chalard <jchalard@google.com>2011-07-21 20:30:17 +0900
commit410e75b15bd7ecfcb8985c4368fec5e355e2c099 (patch)
tree4b95caf44924cd116bdc897fe748de2fbd1edbf3 /src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java
parent212aa744edf10ba0acc1427d8e64b0bf55de6980 (diff)
downloadpackages_apps_Settings-410e75b15bd7ecfcb8985c4368fec5e355e2c099.tar.gz
packages_apps_Settings-410e75b15bd7ecfcb8985c4368fec5e355e2c099.tar.bz2
packages_apps_Settings-410e75b15bd7ecfcb8985c4368fec5e355e2c099.zip
Remove the "user dictionary" settings entry if none
When the user dictionary service is not present or disabled, the settings application should not be showing an entry to use it. Bug: 5024166 Change-Id: Ic57d67eb03cf54e2c411fb0909c2a5d23d3e1fd7
Diffstat (limited to 'src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java')
-rw-r--r--src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java b/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java
index 4ccebf070..e966ec7c9 100644
--- a/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java
+++ b/src/com/android/settings/inputmethod/InputMethodAndLanguageSettings.java
@@ -126,7 +126,12 @@ public class InputMethodAndLanguageSettings extends SettingsPreferenceFragment
private void updateUserDictionaryPreference(Preference userDictionaryPreference) {
final Activity activity = getActivity();
final Set<String> localeList = UserDictionaryList.getUserDictionaryLocalesList(activity);
- if (localeList.size() <= 1) {
+ if (null == localeList) {
+ // The locale list is null if and only if the user dictionary service is
+ // not present or disabled. In this case we need to remove the preference.
+ ((PreferenceGroup)findPreference("language_settings_category")).removePreference(
+ userDictionaryPreference);
+ } else if (localeList.size() <= 1) {
userDictionaryPreference.setTitle(R.string.user_dict_single_settings_title);
userDictionaryPreference.setFragment(UserDictionarySettings.class.getName());
// If the size of localeList is 0, we don't set the locale parameter in the