[Scummvm-git-logs] scummvm master -> fa741de102ec562760f76bac4b33e10f84c74a20

bluegr noreply at scummvm.org
Sat May 3 09:53:07 UTC 2025


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
fa741de102 ANDROID: Trigger an abort on error


Commit: fa741de102ec562760f76bac4b33e10f84c74a20
    https://github.com/scummvm/scummvm/commit/fa741de102ec562760f76bac4b33e10f84c74a20
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2025-05-03T12:53:04+03:00

Commit Message:
ANDROID: Trigger an abort on error

This also outputs a stacktrace in the system log and reports it to
Google Play for further diagnostics.

Changed paths:
    backends/platform/android/android.cpp


diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp
index cc92bc970f4..506492ef7aa 100644
--- a/backends/platform/android/android.cpp
+++ b/backends/platform/android/android.cpp
@@ -103,6 +103,16 @@ extern "C" {
 	}
 }
 
+static bool androidErrorHandler(const char *msg) {
+	if (g_system) {
+		g_system->quit();
+	}
+	__android_log_assert(nullptr, android_log_tag,
+	                     "ERROR: %s", msg);
+	// If we end up here, we failed to handle the error
+	return false;
+}
+
 #ifdef ANDROID_DEBUG_GL
 static const char *getGlErrStr(GLenum error) {
 	switch (error) {
@@ -211,6 +221,8 @@ OSystem_Android::OSystem_Android(int audio_sample_rate, int audio_buffer_size) :
 	// though getting it via JNI is maybe the most reliable option (?)
 	// Also __system_property_get which is used by getSystemProperty() is being deprecated in recent NDKs
 
+	Common::setErrorHandler(androidErrorHandler);
+
 	int sdkVersion = JNI::getAndroidSDKVersionId();
 
 	_systemSDKdetectedStr = Common::String::format("SDK Version: %d\n", sdkVersion) ;




More information about the Scummvm-git-logs mailing list