diff options
author | 2014-03-05 19:42:53 +0900 | |
---|---|---|
committer | 2014-03-05 19:42:53 +0900 | |
commit | de36b47d29b7d6bdfb448a97bef2dcc3f5649205 (patch) | |
tree | 53466873e0dc5ef3802d3fd67a9fcf78a22cbc12 /java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java | |
parent | e784148ae6872942434eaa55ca32b4c6442cc8e8 (diff) | |
download | latinime-de36b47d29b7d6bdfb448a97bef2dcc3f5649205.tar.gz latinime-de36b47d29b7d6bdfb448a97bef2dcc3f5649205.tar.xz latinime-de36b47d29b7d6bdfb448a97bef2dcc3f5649205.zip |
Use BinaryDictionaryUtils to read dictionary header.
Bug: 8187060
Bug:13035567
Change-Id: I90a5e0665c367f5a1bd786f4babf0d03e79e68fa
Diffstat (limited to 'java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java b/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java index acbd919cd..4c49cb31c 100644 --- a/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java +++ b/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java @@ -21,10 +21,9 @@ import android.content.SharedPreferences; import android.content.res.AssetFileDescriptor; import android.util.Log; -import com.android.inputmethod.latin.makedict.DictDecoder; import com.android.inputmethod.latin.makedict.DictionaryHeader; -import com.android.inputmethod.latin.makedict.FormatSpec; import com.android.inputmethod.latin.makedict.UnsupportedFormatException; +import com.android.inputmethod.latin.utils.BinaryDictionaryUtils; import com.android.inputmethod.latin.utils.CollectionUtils; import com.android.inputmethod.latin.utils.DictionaryInfoUtils; import com.android.inputmethod.latin.utils.LocaleUtils; @@ -226,12 +225,10 @@ final public class BinaryDictionaryGetter { // ## HACK ## we prevent usage of a dictionary before version 18. The reason for this is, since // those do not include whitelist entries, the new code with an old version of the dictionary // would lose whitelist functionality. - private static boolean hackCanUseDictionaryFile(final Locale locale, final File f) { + private static boolean hackCanUseDictionaryFile(final Locale locale, final File file) { try { // Read the version of the file - final DictDecoder dictDecoder = FormatSpec.getDictDecoder(f, 0, f.length()); - final DictionaryHeader header = dictDecoder.readHeader(); - + final DictionaryHeader header = BinaryDictionaryUtils.getHeader(file); final String version = header.mDictionaryOptions.mAttributes.get(VERSION_KEY); if (null == version) { // No version in the options : the format is unexpected |