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
This commit is contained in:
Jean Chalard 2011-05-17 22:32:19 +09:00
parent d2d21ce0be
commit bf65f31c5f

View file

@ -78,16 +78,20 @@ class BinaryDictionaryGetter {
} else { } else {
try { try {
// If that was no-go, try to find a publicly exported dictionary. // 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) { } catch (FileNotFoundException e) {
Log.e(TAG, "Unable to create dictionary file from provider for locale " Log.e(TAG, "Unable to create dictionary file from provider for locale "
+ locale.toString() + ": falling back to internal dictionary"); + locale.toString() + ": falling back to internal dictionary");
return Arrays.asList(loadFallbackResource(context, fallbackResId));
} catch (IOException e) { } catch (IOException e) {
Log.e(TAG, "Unable to read source data for locale " Log.e(TAG, "Unable to read source data for locale "
+ locale.toString() + ": falling back to internal dictionary"); + locale.toString() + ": falling back to internal dictionary");
return Arrays.asList(loadFallbackResource(context, fallbackResId));
} }
return Arrays.asList(loadFallbackResource(context, fallbackResId));
} }
} }
} }