diff --git a/platforms/android/app/src/main/AndroidManifest.xml b/platforms/android/app/src/main/AndroidManifest.xml index 17ec8724cb..8111c2ee7c 100644 --- a/platforms/android/app/src/main/AndroidManifest.xml +++ b/platforms/android/app/src/main/AndroidManifest.xml @@ -16,7 +16,7 @@ android:hardwareAccelerated="true" android:icon="@android:drawable/sym_def_app_icon" android:label="@string/app_name" - android:theme="@android:style/Theme.NoTitleBar.Fullscreen" + android:theme="@android:style/Theme.NoTitleBar" android:enableOnBackInvokedCallback="false"> = Build.VERSION_CODES.R) { + getWindow().getDecorView().getWindowInsetsController().hide(WindowInsets.Type.systemBars()); + }else { + View decorView = getWindow().getDecorView(); + // Hide the status bar. + int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN; + decorView.setSystemUiVisibility(uiOptions); + // Remember that you should never show the action bar if the + // status bar is hidden, so hide that too if necessary. + ActionBar actionBar = getActionBar(); + actionBar.hide(); + } + } + @Override protected String[] getLibraries() { // SDL3 is statically linked into libmain.so in this build. diff --git a/src/dusk/logging.cpp b/src/dusk/logging.cpp index b079d507c6..ec9b1e9fac 100644 --- a/src/dusk/logging.cpp +++ b/src/dusk/logging.cpp @@ -6,6 +6,8 @@ #if ANDROID #include "android/log.h" +#include +#include #endif bool StubLogEnabled = true; @@ -64,18 +66,10 @@ void aurora_log_callback(AuroraLogLevel level, const char* module, const char* m break; } - const char* start = message; - const char* end = message + len; - while (start < end) { - const char* newline = static_cast(memchr(start, '\n', end - start)); - if (!newline) { - __android_log_print(android_log_level, module, "%.*s", static_cast(end - start), start); - break; - } - if (newline > start) { - __android_log_print(android_log_level, module, "%.*s", static_cast(newline - start), start); - } - start = newline + 1; + std::stringstream msgStream(message); + std::string segment; + while(std::getline(msgStream, segment)) { + __android_log_print(android_log_level, module, "%s\n", segment.c_str()); } if (level == LOG_FATAL) {