From cd0e03ac401692d1fa6fc6005739ce0e2c19d574 Mon Sep 17 00:00:00 2001 From: Bo-Rong Chen Date: Thu, 19 Dec 2024 15:10:53 -0800 Subject: [PATCH] [android] Fix Cobalt crash on official build 1. Ensure to initialize RecursiveMutex for SbLog before ApplicationAndroid is initialized. 2. Enable qa build with official build. b/384807408 --- cobalt/build/gn.py | 2 +- starboard/android/shared/android_main.cc | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cobalt/build/gn.py b/cobalt/build/gn.py index 06d86bc2a02..8e34d4e2b7c 100755 --- a/cobalt/build/gn.py +++ b/cobalt/build/gn.py @@ -56,7 +56,7 @@ def get_build_args(build_args_path): }, 'qa': { 'symbol_level': 1, - 'is_debug': 'false' + 'is_official_build': 'true' }, 'gold': { 'symbol_level': 0, diff --git a/starboard/android/shared/android_main.cc b/starboard/android/shared/android_main.cc index b16001e7a70..92b6632332e 100644 --- a/starboard/android/shared/android_main.cc +++ b/starboard/android/shared/android_main.cc @@ -30,6 +30,7 @@ #include "starboard/event.h" #include "starboard/log.h" #include "starboard/shared/starboard/command_line.h" +#include "starboard/shared/starboard/log_mutex.h" #include "starboard/thread.h" #if SB_IS(EVERGREEN_COMPATIBLE) #include "starboard/crashpad_wrapper/wrapper.h" // nogncheck @@ -310,6 +311,7 @@ Java_dev_cobalt_coat_StarboardBridge_startNativeStarboard(JniEnvExt* env) { #if SB_IS(EVERGREEN_COMPATIBLE) StarboardThreadLaunch(); #else + starboard::shared::starboard::GetLoggingMutex(); auto command_line = std::make_unique(GetArgs()); LogInit(*command_line); auto* nativeApp = new ApplicationAndroid(std::move(command_line));