diff options
author | 2012-04-11 21:02:26 +0900 | |
---|---|---|
committer | 2012-04-11 21:03:21 +0900 | |
commit | e6269759d642eac0a03ae6942acb5cd556e7ff46 (patch) | |
tree | 60d5df7d38d250a1282a036d205ef4520ade8681 /java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java | |
parent | 9d95a99626f2aeda2248be45748490f7be6349cc (diff) | |
download | latinime-e6269759d642eac0a03ae6942acb5cd556e7ff46.tar.gz latinime-e6269759d642eac0a03ae6942acb5cd556e7ff46.tar.xz latinime-e6269759d642eac0a03ae6942acb5cd556e7ff46.zip |
Read the dictionary resource in a more sensical place.
We don't need to pass this down all the way from LatinIME any more.
It fetched be done exactly where it needs to be.
Change-Id: I9f277f9c4f9de70ae755a1334d86c67bbb24c988
Diffstat (limited to 'java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java b/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java index 3fbe70f1b..b0c2adc79 100644 --- a/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java +++ b/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java @@ -255,13 +255,13 @@ class BinaryDictionaryGetter { * - Uses a content provider to get a public dictionary set, as per the protocol described * in BinaryDictionaryFileDumper. * If that fails: - * - Gets a file name from the fallback resource passed as an argument. + * - Gets a file name from the built-in dictionary for this locale, if any. * If that fails: * - Returns null. * @return The list of addresses of valid dictionary files, or null. */ public static ArrayList<AssetFileAddress> getDictionaryFiles(final Locale locale, - final Context context, final int fallbackResId) { + final Context context) { // cacheWordListsFromContentProvider returns the list of files it copied to local // storage, but we don't really care about what was copied NOW: what we want is the @@ -290,6 +290,8 @@ class BinaryDictionaryGetter { } if (!foundMainDict && dictPackSettings.isWordListActive(mainDictId)) { + final int fallbackResId = + DictionaryFactory.getMainDictionaryResourceId(context.getResources(), locale); final AssetFileAddress fallbackAsset = loadFallbackResource(context, fallbackResId); if (null != fallbackAsset) { fileList.add(fallbackAsset); |