summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/inputmethod/UserDictionarySettingsUtils.java
diff options
context:
space:
mode:
authorSatoshi Kataoka <satok@google.com>2013-07-30 11:54:15 +0900
committerSatoshi Kataoka <satok@google.com>2013-07-30 12:42:43 +0900
commit4b6603cb7981d99a6609a7de610d1f2c35f47074 (patch)
treea8dee44f3f86c725992d9c6da9e5a7d570901ed9 /src/com/android/settings/inputmethod/UserDictionarySettingsUtils.java
parent84bbb548a6823649103ef91b73462848e8bf74d4 (diff)
downloadpackages_apps_Settings-4b6603cb7981d99a6609a7de610d1f2c35f47074.zip
packages_apps_Settings-4b6603cb7981d99a6609a7de610d1f2c35f47074.tar.gz
packages_apps_Settings-4b6603cb7981d99a6609a7de610d1f2c35f47074.tar.bz2
Fix the displayed name of the personal dictionary
Bug: 8976598 Change-Id: I3a8b50790b6da1658f32ff89df222127cb310da6
Diffstat (limited to 'src/com/android/settings/inputmethod/UserDictionarySettingsUtils.java')
-rw-r--r--src/com/android/settings/inputmethod/UserDictionarySettingsUtils.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/com/android/settings/inputmethod/UserDictionarySettingsUtils.java b/src/com/android/settings/inputmethod/UserDictionarySettingsUtils.java
index 2238b4b..e77f9c5 100644
--- a/src/com/android/settings/inputmethod/UserDictionarySettingsUtils.java
+++ b/src/com/android/settings/inputmethod/UserDictionarySettingsUtils.java
@@ -16,9 +16,11 @@
package com.android.settings.inputmethod;
+import com.android.settings.R;
import com.android.settings.Utils;
import android.content.Context;
+import android.text.TextUtils;
import java.util.Locale;
@@ -27,6 +29,11 @@ import java.util.Locale;
*/
public class UserDictionarySettingsUtils {
public static String getLocaleDisplayName(Context context, String localeStr) {
+ if (TextUtils.isEmpty(localeStr)) {
+ // CAVEAT: localeStr should not be null because a null locale stands for the system
+ // locale in UserDictionary.Words.addWord.
+ return context.getResources().getString(R.string.user_dict_settings_all_languages);
+ }
final Locale locale = Utils.createLocaleFromString(localeStr);
final Locale systemLocale = context.getResources().getConfiguration().locale;
return locale.getDisplayName(systemLocale);