aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/InputLanguageSelection.java
diff options
context:
space:
mode:
authorKen Wakasa <kwakasa@google.com>2011-01-05 00:39:41 +0900
committerKen Wakasa <kwakasa@google.com>2011-01-05 11:31:58 +0900
commit458249e703bded3a1cbd25a2ab2249f9366a8188 (patch)
tree9a2f02ed25db681adb72e6ddf54049b3dc22291c /java/src/com/android/inputmethod/latin/InputLanguageSelection.java
parenta96574fdd5e38a237a35b21a2b7c20a29138c648 (diff)
downloadlatinime-458249e703bded3a1cbd25a2ab2249f9366a8188.tar.gz
latinime-458249e703bded3a1cbd25a2ab2249f9366a8188.tar.xz
latinime-458249e703bded3a1cbd25a2ab2249f9366a8188.zip
Consolidate main dictionary files.
This change is a preparation for upcoming optimizations on dictionary file loading. * We can consolidate dictionary files because we are no longer relying on Asset Manager. * Stopping compressing dictionary files as planning to use mmap() on the region in the apk file. * Probably we won't rely on Asset Manager. Instead we'll probably use offset and size obtained from AssetFileDescriptor. Change-Id: Id57dce512fd3d2397a58628f8264bd824194da76
Diffstat (limited to 'java/src/com/android/inputmethod/latin/InputLanguageSelection.java')
-rw-r--r--java/src/com/android/inputmethod/latin/InputLanguageSelection.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/InputLanguageSelection.java b/java/src/com/android/inputmethod/latin/InputLanguageSelection.java
index 27e0fbe4a..faee38eda 100644
--- a/java/src/com/android/inputmethod/latin/InputLanguageSelection.java
+++ b/java/src/com/android/inputmethod/latin/InputLanguageSelection.java
@@ -99,15 +99,15 @@ public class InputLanguageSelection extends PreferenceActivity {
}
private boolean hasDictionary(Locale locale) {
- Resources res = getResources();
- Configuration conf = res.getConfiguration();
- Locale saveLocale = conf.locale;
+ final Resources res = getResources();
+ final Configuration conf = res.getConfiguration();
+ final Locale saveLocale = conf.locale;
boolean haveDictionary = false;
conf.locale = locale;
res.updateConfiguration(conf, res.getDisplayMetrics());
- int[] dictionaries = LatinIME.getDictionary(res);
- BinaryDictionary bd = new BinaryDictionary(this, dictionaries, Suggest.DIC_MAIN);
+ int mainDicResId = LatinIME.getMainDictionaryResourceId(res);
+ BinaryDictionary bd = new BinaryDictionary(this, mainDicResId, Suggest.DIC_MAIN);
// Is the dictionary larger than a placeholder? Arbitrarily chose a lower limit of
// 4000-5000 words, whereas the LARGE_DICTIONARY is about 20000+ words.