Android: Move alert message log from Kotlin to C++

For some reason, NativeLibrary.kt calling Log for the alert message text
makes Dolphin die with a JNI error. Supposedly the jstring passed to the
logging function is invalid. I don't understand why, because the dialog
that we show right afterwards is able to read the string just fine. The
error happens even if I pass the string directly to Log without
prepending any extra text.

There's no real downside to having the logging in C++ instead of Kotlin,
so let's move it to C++ to avoid the JNI error.
This commit is contained in:
JosJuice committed 2026-05-08 10:56:51 +02:00
1 parent d19952cc11
commit 4470534dc5
2 files changed
+2 -1

No files matched your search

@@ -480,7 +480,6 @@ object NativeLibrary {
fun displayAlertMsg(
caption: String, text: String, yesNo: Boolean, isWarning: Boolean, nonBlocking: Boolean
): Boolean {
Log.error("[NativeLibrary] Alert: $text")
val emulationActivity = emulationActivityRef.get()
var result = false