diff options
author | 2011-05-17 22:32:19 +0900 | |
---|---|---|
committer | 2011-05-17 22:55:58 +0900 | |
commit | bf65f31c5fcd61d8c3aed0e7c6efc38dd7342c1f (patch) | |
tree | e3cc877e94b04edb3aaf4ca09a8975d64c13a1c7 /java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java | |
parent | d2d21ce0beeadfbcc477fcae32694846cb89dfe1 (diff) | |
download | latinime-bf65f31c5fcd61d8c3aed0e7c6efc38dd7342c1f.tar.gz latinime-bf65f31c5fcd61d8c3aed0e7c6efc38dd7342c1f.tar.xz latinime-bf65f31c5fcd61d8c3aed0e7c6efc38dd7342c1f.zip |
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
Diffstat (limited to 'java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java b/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java index 562580d41..7ce92920d 100644 --- a/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java +++ b/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java @@ -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)); } } } |