Fix a bug in one of the methods to get a dictionary.

One of the two methods for getting a dictionary from the dictionary
pack had a bug and would not tolerate not getting an actual dictionary.
This change fixes that.

Change-Id: Id58bb27258494fb3aa60ec07a4eb27cfb5cc7279
main
Jean Chalard 2011-05-17 22:32:19 +09:00
parent d2d21ce0be
commit bf65f31c5f
1 changed files with 7 additions and 3 deletions

View File

@ -78,16 +78,20 @@ class BinaryDictionaryGetter {
} else {
try {
// If that was no-go, try to find a publicly exported dictionary.
return BinaryDictionaryFileDumper.getDictSetFromContentProvider(locale, context);
List<AssetFileAddress> listFromContentProvider =
BinaryDictionaryFileDumper.getDictSetFromContentProvider(locale, context);
if (null != listFromContentProvider) {
return listFromContentProvider;
}
// If the list is null, fall through and return the fallback
} catch (FileNotFoundException e) {
Log.e(TAG, "Unable to create dictionary file from provider for locale "
+ locale.toString() + ": falling back to internal dictionary");
return Arrays.asList(loadFallbackResource(context, fallbackResId));
} catch (IOException e) {
Log.e(TAG, "Unable to read source data for locale "
+ locale.toString() + ": falling back to internal dictionary");
return Arrays.asList(loadFallbackResource(context, fallbackResId));
}
return Arrays.asList(loadFallbackResource(context, fallbackResId));
}
}
}