Merge "Add jni interface to use on memory dictionary."

This commit is contained in:
Keisuke Kuroyanagi 2014-04-22 17:07:15 +00:00 committed by Android (Google) Code Review
commit 68b4f2ada9
2 changed files with 14 additions and 0 deletions

View file

@ -151,6 +151,8 @@ public final class BinaryDictionary extends Dictionary {
private static native long openNative(String sourceDir, long dictOffset, long dictSize,
boolean isUpdatable);
private static native long createOnMemoryNative(long formatVersion,
String locale, String[] attributeKeyStringArray, String[] attributeValueStringArray);
private static native void getHeaderInfoNative(long dict, int[] outHeaderSize,
int[] outFormatVersion, ArrayList<int[]> outAttributeKeys,
ArrayList<int[]> outAttributeValues);

View file

@ -65,6 +65,13 @@ static jlong latinime_BinaryDictionary_open(JNIEnv *env, jclass clazz, jstring s
return reinterpret_cast<jlong>(dictionary);
}
static jlong latinime_BinaryDictionary_createOnMemory(JNIEnv *env, jclass clazz,
jlong formatVersion, jstring locale, jobjectArray attributeKeyStringArray,
jobjectArray attributeValueStringArray) {
// TODO: Implement.
return 0;
}
static void latinime_BinaryDictionary_flush(JNIEnv *env, jclass clazz, jlong dict,
jstring filePath) {
Dictionary *dictionary = reinterpret_cast<Dictionary *>(dict);
@ -467,6 +474,11 @@ static const JNINativeMethod sMethods[] = {
const_cast<char *>("(Ljava/lang/String;JJZ)J"),
reinterpret_cast<void *>(latinime_BinaryDictionary_open)
},
{
const_cast<char *>("createOnMemoryNative"),
const_cast<char *>("(JLjava/lang/String;[Ljava/lang/String;[Ljava/lang/String;)J"),
reinterpret_cast<void *>(latinime_BinaryDictionary_createOnMemory)
},
{
const_cast<char *>("closeNative"),
const_cast<char *>("(J)V"),