am f6c22008: Workaround to stop init dict traverse session

* commit 'f6c2200890012708709964fb1a8933ed1c3e7dd8':
  Workaround to stop init dict traverse session
main
Satoshi Kataoka 2012-08-10 05:07:52 -07:00 committed by Android Git Automerger
commit f85ec4082f
2 changed files with 8 additions and 5 deletions

View File

@ -23,8 +23,8 @@ public class DicTraverseSession {
JniUtils.loadNativeLibrary(); JniUtils.loadNativeLibrary();
} }
private native long setDicTraverseSessionNative(String locale); private native long setDicTraverseSessionNative(String locale);
private native void initDicTraverseSessionNative(long nativeDicTraverseSession, //private native void initDicTraverseSessionNative(long nativeDicTraverseSession,
long dictionary, int[] previousWord, int previwousWordLength); //long dictionary, int[] previousWord, int previousWordLength);
private native void releaseDicTraverseSessionNative(long nativeDicTraverseSession); private native void releaseDicTraverseSessionNative(long nativeDicTraverseSession);
private long mNativeDicTraverseSession; private long mNativeDicTraverseSession;
@ -43,8 +43,8 @@ public class DicTraverseSession {
} }
public void initSession(long dictionary, int[] previousWord, int previousWordLength) { public void initSession(long dictionary, int[] previousWord, int previousWordLength) {
initDicTraverseSessionNative( //initDicTraverseSessionNative(
mNativeDicTraverseSession, dictionary, previousWord, previousWordLength); //mNativeDicTraverseSession, dictionary, previousWord, previousWordLength);
} }
private final long createNativeDicTraverseSession(String locale) { private final long createNativeDicTraverseSession(String locale) {

View File

@ -22,11 +22,13 @@
#include "jni_common.h" #include "jni_common.h"
namespace latinime { namespace latinime {
class Dictionary;
static jlong latinime_setDicTraverseSession(JNIEnv *env, jobject object, jstring localeJStr) { static jlong latinime_setDicTraverseSession(JNIEnv *env, jobject object, jstring localeJStr) {
void *traverseSession = DicTraverseWrapper::getDicTraverseSession(env, localeJStr); void *traverseSession = DicTraverseWrapper::getDicTraverseSession(env, localeJStr);
return reinterpret_cast<jlong>(traverseSession); return reinterpret_cast<jlong>(traverseSession);
} }
#if 0
static void latinime_initDicTraverseSession(JNIEnv *env, jobject object, jlong traverseSession, static void latinime_initDicTraverseSession(JNIEnv *env, jobject object, jlong traverseSession,
jlong dictionary, jintArray previousWord, jint previousWordLength) { jlong dictionary, jintArray previousWord, jint previousWordLength) {
void *ts = reinterpret_cast<void*>(traverseSession); void *ts = reinterpret_cast<void*>(traverseSession);
@ -35,6 +37,7 @@ static void latinime_initDicTraverseSession(JNIEnv *env, jobject object, jlong t
env->GetIntArrayRegion(previousWord, 0, previousWordLength, prevWord); env->GetIntArrayRegion(previousWord, 0, previousWordLength, prevWord);
DicTraverseWrapper::initDicTraverseSession(ts, dict, prevWord, previousWordLength); DicTraverseWrapper::initDicTraverseSession(ts, dict, prevWord, previousWordLength);
} }
#endif
static void latinime_DicTraverseSession_release( static void latinime_DicTraverseSession_release(
JNIEnv *env, jobject object, jlong traverseSession) { JNIEnv *env, jobject object, jlong traverseSession) {
@ -44,7 +47,7 @@ static void latinime_DicTraverseSession_release(
static JNINativeMethod sMethods[] = { static JNINativeMethod sMethods[] = {
{"setDicTraverseSessionNative", "(Ljava/lang/String;)J", (void*)latinime_setDicTraverseSession}, {"setDicTraverseSessionNative", "(Ljava/lang/String;)J", (void*)latinime_setDicTraverseSession},
{"initDicTraverseSessionNative", "(JJ[II)V", (void*)latinime_initDicTraverseSession}, //{"initDicTraverseSessionNative", "(JJ[II)V", (void*)latinime_initDicTraverseSession},
{"releaseDicTraverseSessionNative", "(J)V", (void*)latinime_DicTraverseSession_release} {"releaseDicTraverseSessionNative", "(J)V", (void*)latinime_DicTraverseSession_release}
}; };