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
This commit is contained in:
Jean Chalard
2011-07-21 18:33:20 +09:00
parent 212aa744ed
commit 410e75b15b
2 changed files with 10 additions and 2 deletions

View File

@@ -49,7 +49,10 @@ public class UserDictionaryList extends SettingsPreferenceFragment {
new String[] { UserDictionary.Words.LOCALE },
null, null, null);
final Set<String> localeList = new TreeSet<String>();
if (null != cursor && cursor.moveToFirst()) {
if (null == cursor) {
// The user dictionary service is not present or disabled. Return null.
return null;
} else if (cursor.moveToFirst()) {
final int columnIndex = cursor.getColumnIndex(UserDictionary.Words.LOCALE);
do {
String locale = cursor.getString(columnIndex);