diff options
author | 2015-02-23 21:53:10 +0000 | |
---|---|---|
committer | 2015-02-23 21:53:10 +0000 | |
commit | 95b179e69912d833b72c80a96d1951b3afa182ba (patch) | |
tree | 7a8499deb40d629e3123b6977d45cbed66e34e2f /java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java | |
parent | fd35422dfa3b738efa08c48970feb82c7d79d010 (diff) | |
parent | bae3c4bac563d2379b462334b55ee78cc24ba0a0 (diff) | |
download | latinime-95b179e69912d833b72c80a96d1951b3afa182ba.tar.gz latinime-95b179e69912d833b72c80a96d1951b3afa182ba.tar.xz latinime-95b179e69912d833b72c80a96d1951b3afa182ba.zip |
am bae3c4ba: Merge "Make checksum and header checks decoder dependent."
* commit 'bae3c4bac563d2379b462334b55ee78cc24ba0a0':
Make checksum and header checks decoder dependent.
Diffstat (limited to 'java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java b/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java index 9c70cad0a..e00532aa6 100644 --- a/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java +++ b/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java @@ -22,6 +22,7 @@ import android.content.res.AssetFileDescriptor; import android.util.Log; import com.android.inputmethod.latin.common.LocaleUtils; +import com.android.inputmethod.latin.define.DecoderSpecificConstants; import com.android.inputmethod.latin.makedict.DictionaryHeader; import com.android.inputmethod.latin.makedict.UnsupportedFormatException; import com.android.inputmethod.latin.utils.BinaryDictionaryUtils; @@ -54,6 +55,9 @@ final public class BinaryDictionaryGetter { */ private static final String COMMON_PREFERENCES_NAME = "LatinImeDictPrefs"; + private static final boolean SHOULD_USE_DICT_VERSION = + DecoderSpecificConstants.SHOULD_USE_DICT_VERSION; + // Name of the category for the main dictionary public static final String MAIN_DICTIONARY_CATEGORY = "main"; public static final String ID_CATEGORY_SEPARATOR = ":"; @@ -224,6 +228,10 @@ final public class BinaryDictionaryGetter { // 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 File file) { + if (!SHOULD_USE_DICT_VERSION) { + return true; + } + try { // Read the version of the file final DictionaryHeader header = BinaryDictionaryUtils.getHeader(file); |