diff options
author | 2013-12-04 12:47:05 +0900 | |
---|---|---|
committer | 2013-12-04 16:19:55 +0900 | |
commit | 5e80e699c4369d3f4604728952ac3d4bc0bae23a (patch) | |
tree | 8a65896229e2dadf709b4ba8d03024d263c7de39 /native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp | |
parent | 294fe541c8689a1cb0783e16b83159a035464a5c (diff) | |
download | latinime-5e80e699c4369d3f4604728952ac3d4bc0bae23a.tar.gz latinime-5e80e699c4369d3f4604728952ac3d4bc0bae23a.tar.xz latinime-5e80e699c4369d3f4604728952ac3d4bc0bae23a.zip |
[RF1] Remove files that don't match the expected format, step 1
This implements the skeleton implementation, and enables a
fallback implementation in the case the file is coming from the
dictionary provider.
- A better scheme should be used for provider-supplied dicts.
- This does not implement the solution for device-generated
dicts yet. This will come in a future change.
- This does not implement the checking process on the native
side yet. This will come in a future change.
Bug: 11281748
Change-Id: Ifa6e237d19dfbffe503e3674915480ea867b0ddf
Diffstat (limited to 'native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp')
-rw-r--r-- | native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp b/native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp index c6a5900e7..87d482be1 100644 --- a/native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp +++ b/native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp @@ -135,6 +135,14 @@ static void latinime_BinaryDictionary_close(JNIEnv *env, jclass clazz, jlong dic delete dictionary; } +static bool latinime_BinaryDictionary_hasValidContents(JNIEnv *env, jclass clazz, + jlong dict) { + Dictionary *dictionary = reinterpret_cast<Dictionary *>(dict); + if (!dictionary) return false; + // TODO: check format version + return true; +} + static int latinime_BinaryDictionary_getFormatVersion(JNIEnv *env, jclass clazz, jlong dict) { Dictionary *dictionary = reinterpret_cast<Dictionary *>(dict); if (!dictionary) return 0; @@ -438,6 +446,11 @@ static const JNINativeMethod sMethods[] = { reinterpret_cast<void *>(latinime_BinaryDictionary_close) }, { + const_cast<char *>("hasValidContentsNative"), + const_cast<char *>("(J)Z"), + reinterpret_cast<void *>(latinime_BinaryDictionary_hasValidContents) + }, + { const_cast<char *>("getFormatVersionNative"), const_cast<char *>("(J)I"), reinterpret_cast<void *>(latinime_BinaryDictionary_getFormatVersion) |