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 f79e30f commit 81bf3f8
Show file tree
Hide file tree
Showing 2 changed files with 4 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
2 changes: 2 additions & 0 deletions starboard/android/shared/android_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<CommandLine>(GetArgs());
LogInit(*command_line);
auto* nativeApp = new ApplicationAndroid(std::move(command_line));
Expand Down

0 comments on commit 81bf3f8

Please sign in to comment.