refine: disable game text input api (#296)

This commit is contained in:
bofeng-song 2022-09-29 13:40:28 +08:00 committed by GitHub
parent b3e1be3f00
commit 8b0cc9793d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 12 deletions

View File

@ -590,11 +590,11 @@ static jlong loadNativeCode_native(JNIEnv *env, jobject javaGameActivity,
} }
code->createActivityFunc(code, rawSavedState, rawSavedSize); code->createActivityFunc(code, rawSavedState, rawSavedSize);
code->gameTextInput = GameTextInput_init(env, 0); // code->gameTextInput = GameTextInput_init(env, 0);
GameTextInput_setEventCallback(code->gameTextInput, // GameTextInput_setEventCallback(code->gameTextInput,
reinterpret_cast<GameTextInputEventCallback>( // reinterpret_cast<GameTextInputEventCallback>(
code->callbacks.onTextInputEvent), // code->callbacks.onTextInputEvent),
code); // code);
if (rawSavedState != NULL) { if (rawSavedState != NULL) {
env->ReleaseByteArrayElements(savedState, rawSavedState, 0); env->ReleaseByteArrayElements(savedState, rawSavedState, 0);
@ -848,9 +848,9 @@ extern "C" void GameActivity_setImeEditorInfo(GameActivity *activity,
int imeOptions) { int imeOptions) {
JNIEnv *env; JNIEnv *env;
if (activity->vm->AttachCurrentThread(&env, NULL) == JNI_OK) { if (activity->vm->AttachCurrentThread(&env, NULL) == JNI_OK) {
env->CallVoidMethod(activity->javaGameActivity, // env->CallVoidMethod(activity->javaGameActivity,
gGameActivityClassInfo.setImeEditorInfoFields, // gGameActivityClassInfo.setImeEditorInfoFields,
inputType, actionId, imeOptions); // inputType, actionId, imeOptions);
} }
} }
@ -1189,14 +1189,14 @@ static const JNINativeMethod g_methods[] = {
{"onKeyDownNative", "(JLandroid/view/KeyEvent;)Z", {"onKeyDownNative", "(JLandroid/view/KeyEvent;)Z",
(void *)onKeyDown_native}, (void *)onKeyDown_native},
{"onKeyUpNative", "(JLandroid/view/KeyEvent;)Z", (void *)onKeyUp_native}, {"onKeyUpNative", "(JLandroid/view/KeyEvent;)Z", (void *)onKeyUp_native},
{"onTextInputEventNative", /* {"onTextInputEventNative",
"(JLcom/google/androidgamesdk/gametextinput/State;)V", "(JLcom/google/androidgamesdk/gametextinput/State;)V",
(void *)onTextInput_native}, (void *)onTextInput_native},
{"onWindowInsetsChangedNative", "(J)V", {"onWindowInsetsChangedNative", "(J)V",
(void *)onWindowInsetsChanged_native}, (void *)onWindowInsetsChanged_native},
{"setInputConnectionNative", {"setInputConnectionNative",
"(JLcom/google/androidgamesdk/gametextinput/InputConnection;)V", "(JLcom/google/androidgamesdk/gametextinput/InputConnection;)V",
(void *)setInputConnection_native}, (void *)setInputConnection_native},*/
}; };
static const char *const kGameActivityPathName = static const char *const kGameActivityPathName =
@ -1255,7 +1255,7 @@ extern "C" int GameActivity_register(JNIEnv *env) {
"()V"); "()V");
GET_METHOD_ID(gGameActivityClassInfo.setWindowFlags, activity_class, GET_METHOD_ID(gGameActivityClassInfo.setWindowFlags, activity_class,
"setWindowFlags", "(II)V"); "setWindowFlags", "(II)V");
GET_METHOD_ID(gGameActivityClassInfo.getWindowInsets, activity_class, /* GET_METHOD_ID(gGameActivityClassInfo.getWindowInsets, activity_class,
"getWindowInsets", "(I)Landroidx/core/graphics/Insets;"); "getWindowInsets", "(I)Landroidx/core/graphics/Insets;");
GET_METHOD_ID(gGameActivityClassInfo.getWaterfallInsets, activity_class, GET_METHOD_ID(gGameActivityClassInfo.getWaterfallInsets, activity_class,
"getWaterfallInsets", "()Landroidx/core/graphics/Insets;"); "getWaterfallInsets", "()Landroidx/core/graphics/Insets;");
@ -1288,7 +1288,7 @@ extern "C" int GameActivity_register(JNIEnv *env) {
GET_STATIC_METHOD_ID(gWindowInsetsCompatTypeClassInfo.methods[i], GET_STATIC_METHOD_ID(gWindowInsetsCompatTypeClassInfo.methods[i],
windowInsetsCompatType_class, methodNames[i], windowInsetsCompatType_class, methodNames[i],
"()I"); "()I");
} }*/
return jniRegisterNativeMethods(env, kGameActivityPathName, g_methods, return jniRegisterNativeMethods(env, kGameActivityPathName, g_methods,
NELEM(g_methods)); NELEM(g_methods));
} }