Skip to content

Commit

Permalink
[android] Fix Cobalt crash on official build
Browse files Browse the repository at this point in the history
1. Ensure to initialize RecursiveMutex for SbLog before ApplicationAndroid is initialized.
2. Enable qa build with official build.

b/384807408
  • Loading branch information
borongc committed Dec 27, 2024
1 parent b7b2d76 commit e4e3b16
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cobalt/build/gn.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ def get_build_args(build_args_path):
},
'qa': {
'symbol_level': 1,
'is_debug': 'false'
'is_debug': 'false',
'is_official_build': 'true'
},
'gold': {
'symbol_level': 0,
Expand Down
3 changes: 3 additions & 0 deletions starboard/android/shared/android_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@
#include "starboard/android/shared/jni_utils.h"
#include "starboard/android/shared/log_internal.h"
#include "starboard/common/file.h"
#include "starboard/common/recursive_mutex.h"
#include "starboard/common/semaphore.h"
#include "starboard/common/string.h"
#include "starboard/configuration_constants.h"
#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
Expand Down Expand Up @@ -310,6 +312,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<CommandLine>(GetArgs());
LogInit(*command_line);
auto* nativeApp = new ApplicationAndroid(std::move(command_line));
Expand Down

0 comments on commit e4e3b16

Please sign in to comment.