diff options
author | 2012-04-04 21:39:23 +0900 | |
---|---|---|
committer | 2012-04-04 21:50:42 +0900 | |
commit | 43ebd8a035af31244a2d54fce5d8000a1fbada4c (patch) | |
tree | d18da7844dae051f12815b5e0606837a23bb2f96 /java/src/com/android/inputmethod/latin/BinaryDictionary.java | |
parent | b082c95a2bfabbf0e0cf920d709004cebfbc2915 (diff) | |
download | latinime-43ebd8a035af31244a2d54fce5d8000a1fbada4c.tar.gz latinime-43ebd8a035af31244a2d54fce5d8000a1fbada4c.tar.xz latinime-43ebd8a035af31244a2d54fce5d8000a1fbada4c.zip |
Fix the locale of flags in BinaryDictionary
Bug: 6129372
Change-Id: I4958c2aabf651d7e26648a29b75fcc6c77813451
Diffstat (limited to 'java/src/com/android/inputmethod/latin/BinaryDictionary.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/BinaryDictionary.java | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionary.java b/java/src/com/android/inputmethod/latin/BinaryDictionary.java index c43683f2d..92019c0ed 100644 --- a/java/src/com/android/inputmethod/latin/BinaryDictionary.java +++ b/java/src/com/android/inputmethod/latin/BinaryDictionary.java @@ -17,10 +17,14 @@ package com.android.inputmethod.latin; import android.content.Context; +import android.content.res.AssetFileDescriptor; +import android.content.res.Resources; import com.android.inputmethod.keyboard.ProximityInfo; +import com.android.inputmethod.latin.LocaleUtils.RunInLocale; import java.util.Arrays; +import java.util.Locale; /** * Implements a static, compacted, binary dictionary of standard words. @@ -94,14 +98,23 @@ public class BinaryDictionary extends Dictionary { * @param flagArray the flags to limit the dictionary to, or null for default. */ public BinaryDictionary(final Context context, - final String filename, final long offset, final long length, Flag[] flagArray) { + final String filename, final long offset, final long length, final Flag[] flagArray, + Locale locale) { // Note: at the moment a binary dictionary is always of the "main" type. // Initializing this here will help transitioning out of the scheme where // the Suggest class knows everything about every single dictionary. mDicTypeId = Suggest.DIC_MAIN; // TODO: Stop relying on the state of SubtypeSwitcher, get it as a parameter - mFlags = Flag.initFlags(null == flagArray ? ALL_CONFIG_FLAGS : flagArray, context, - SubtypeSwitcher.getInstance()); + final RunInLocale<Void> job = new RunInLocale<Void>() { + @Override + protected Void job(Resources res) { + // TODO: remove this when all flags are moved to the native code + mFlags = Flag.initFlags(null == flagArray ? ALL_CONFIG_FLAGS : flagArray, context, + SubtypeSwitcher.getInstance()); + return null; + } + }; + job.runInLocale(context.getResources(), locale); loadDictionary(filename, offset, length); } |