From fdef96e2331700247a4caff0db576aa669c30188 Mon Sep 17 00:00:00 2001
From: Sylvain <[EMAIL REDACTED]>
Date: Tue, 4 Oct 2022 12:08:09 +0200
Subject: [PATCH] Android: remove "nativeSetComposingText" since it's not used
anymore (and it may fail registering at init if code is cleaned with
proguard)
---
.../main/java/org/libsdl/app/SDLActivity.java | 5 +----
src/core/android/SDL_android.c | 18 +-----------------
2 files changed, 2 insertions(+), 21 deletions(-)
diff --git a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
index 6cf7611cc47..af9265b84d2 100644
--- a/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
+++ b/android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
@@ -2000,10 +2000,7 @@ protected void updateText() {
public static native void nativeCommitText(String text, int newCursorPosition);
- public native void nativeGenerateScancodeForUnichar(char c);
-
- public native void nativeSetComposingText(String text, int newCursorPosition);
-
+ public static native void nativeGenerateScancodeForUnichar(char c);
}
class SDLClipboardHandler implements
diff --git a/src/core/android/SDL_android.c b/src/core/android/SDL_android.c
index 83e63119976..ebdd1041bf8 100644
--- a/src/core/android/SDL_android.c
+++ b/src/core/android/SDL_android.c
@@ -212,14 +212,9 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE_INPUT_CONNECTION(nativeGenerateScancod
JNIEnv *env, jclass cls,
jchar chUnicode);
-JNIEXPORT void JNICALL SDL_JAVA_INTERFACE_INPUT_CONNECTION(nativeSetComposingText)(
- JNIEnv *env, jclass cls,
- jstring text, jint newCursorPosition);
-
static JNINativeMethod SDLInputConnection_tab[] = {
{ "nativeCommitText", "(Ljava/lang/String;I)V", SDL_JAVA_INTERFACE_INPUT_CONNECTION(nativeCommitText) },
- { "nativeGenerateScancodeForUnichar", "(C)V", SDL_JAVA_INTERFACE_INPUT_CONNECTION(nativeGenerateScancodeForUnichar) },
- { "nativeSetComposingText", "(Ljava/lang/String;I)V", SDL_JAVA_INTERFACE_INPUT_CONNECTION(nativeSetComposingText) }
+ { "nativeGenerateScancodeForUnichar", "(C)V", SDL_JAVA_INTERFACE_INPUT_CONNECTION(nativeGenerateScancodeForUnichar) }
};
/* Java class SDLAudioManager */
@@ -1286,17 +1281,6 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE_INPUT_CONNECTION(nativeGenerateScancod
SDL_SendKeyboardUnicodeKey(chUnicode);
}
-JNIEXPORT void JNICALL SDL_JAVA_INTERFACE_INPUT_CONNECTION(nativeSetComposingText)(
- JNIEnv *env, jclass cls,
- jstring text, jint newCursorPosition)
-{
- const char *utftext = (*env)->GetStringUTFChars(env, text, NULL);
-
- SDL_SendEditingText(utftext, 0, 0);
-
- (*env)->ReleaseStringUTFChars(env, text, utftext);
-}
-
JNIEXPORT jstring JNICALL SDL_JAVA_INTERFACE(nativeGetHint)(
JNIEnv *env, jclass cls,
jstring name)