am 4ded1af2: Improve the language list in the personal dictionary

* commit '4ded1af21097652dcd0750d9b3f2f24df2904e25':
  Improve the language list in the personal dictionary
This commit is contained in:
Satoshi Kataoka 2013-06-27 04:36:03 -07:00 committed by Android Git Automerger
commit 120a8da91c

View file

@ -58,7 +58,6 @@ public class UserDictionaryList extends PreferenceFragment {
new String[] { UserDictionary.Words.LOCALE }, new String[] { UserDictionary.Words.LOCALE },
null, null, null); null, null, null);
final TreeSet<String> localeSet = new TreeSet<String>(); final TreeSet<String> localeSet = new TreeSet<String>();
boolean addedAllLocale = false;
if (null == cursor) { if (null == cursor) {
// The user dictionary service is not present or disabled. Return null. // The user dictionary service is not present or disabled. Return null.
return null; return null;
@ -66,14 +65,10 @@ public class UserDictionaryList extends PreferenceFragment {
final int columnIndex = cursor.getColumnIndex(UserDictionary.Words.LOCALE); final int columnIndex = cursor.getColumnIndex(UserDictionary.Words.LOCALE);
do { do {
final String locale = cursor.getString(columnIndex); final String locale = cursor.getString(columnIndex);
final boolean allLocale = TextUtils.isEmpty(locale); localeSet.add(null != locale ? locale : "");
localeSet.add(allLocale ? "" : locale);
if (allLocale) {
addedAllLocale = true;
}
} while (cursor.moveToNext()); } while (cursor.moveToNext());
} }
if (!UserDictionarySettings.IS_SHORTCUT_API_SUPPORTED && !addedAllLocale) { if (!UserDictionarySettings.IS_SHORTCUT_API_SUPPORTED) {
// For ICS, we need to show "For all languages" in case that the keyboard locale // For ICS, we need to show "For all languages" in case that the keyboard locale
// is different from the system locale // is different from the system locale
localeSet.add(""); localeSet.add("");