diff options
Diffstat (limited to 'backends/platform/android/android.cpp')
-rw-r--r-- | backends/platform/android/android.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/backends/platform/android/android.cpp b/backends/platform/android/android.cpp index 38f387b201..7a4ae24e6b 100644 --- a/backends/platform/android/android.cpp +++ b/backends/platform/android/android.cpp @@ -299,6 +299,7 @@ public: virtual void getTimeAndDate(TimeDate &t) const; virtual Common::TimerManager *getTimerManager(); virtual FilesystemFactory *getFilesystemFactory(); + virtual void logMessage(LogMessageType::Type type, const char *message); virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0); }; @@ -1266,6 +1267,23 @@ void OSystem_Android::addSysArchivesToSearchSet(Common::SearchSet &s, } } +void OSystem_Android::logMessage(LogMessageType::Type type, const char *message) { + switch (type) { + case LogMessageType::kDebug: + BaseBackend::logMessage(type, message); + break; + + case LogMessageType::kWarning: + __android_log_write(ANDROID_LOG_WARN, "ScummVM", message); + break; + + case LogMessageType::kError: + // FIXME: From the name it looks like this will also quit the program. + // This shouldn't do that though. + __android_log_assert("Fatal error", "ScummVM", "%s", message); + break; + } +} static jint ScummVM_scummVMMain(JNIEnv* env, jobject self, jobjectArray args) { OSystem_Android* cpp_obj = OSystem_Android::fromJavaObject(env, self); |