10 changes: 8 additions & 2 deletions Source/Android/jni/MainAndroid.cpp
Expand Up @@ -151,14 +151,14 @@ void Host_TitleChanged()
{
}

static bool MsgAlert(const char* caption, const char* text, bool yes_no, Common::MsgType /*style*/)
static bool MsgAlert(const char* caption, const char* text, bool yes_no, Common::MsgType style)
{
JNIEnv* env = IDCache::GetEnvForThread();

// Execute the Java method.
jboolean result = env->CallStaticBooleanMethod(
IDCache::GetNativeLibraryClass(), IDCache::GetDisplayAlertMsg(), ToJString(env, caption),
ToJString(env, text), yes_no ? JNI_TRUE : JNI_FALSE);
ToJString(env, text), yes_no ? JNI_TRUE : JNI_FALSE, style == Common::MsgType::Warning);

return result != JNI_FALSE;
}
Expand Down Expand Up @@ -300,6 +300,12 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_StopEmulatio
s_emulation_end_event.Wait();
}

JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_IsBooting(JNIEnv* env,
jobject obj)
{
return static_cast<jboolean>(Core::IsBooting());
}

JNIEXPORT void JNICALL
Java_org_dolphinemu_dolphinemu_NativeLibrary_WaitUntilDoneBooting(JNIEnv* env, jobject obj)
{
Expand Down
7 changes: 6 additions & 1 deletion Source/Core/Core/Core.cpp
Expand Up @@ -170,6 +170,11 @@ void DisplayMessage(std::string message, int time_in_ms)
OSD::AddMessage(std::move(message), time_in_ms);
}

bool IsBooting()
{
return s_is_booting.IsSet() || !s_hardware_initialized;
}

bool IsRunning()
{
return (GetState() != State::Uninitialized || s_hardware_initialized) && !s_is_stopping;
Expand Down Expand Up @@ -674,7 +679,7 @@ State GetState()

void WaitUntilDoneBooting()
{
if (s_is_booting.IsSet() || !s_hardware_initialized)
if (IsBooting())
s_done_booting.Wait();
}

Expand Down
1 change: 1 addition & 0 deletions Source/Core/Core/Core.h
Expand Up @@ -99,6 +99,7 @@ void UndeclareAsCPUThread();

std::string StopMessage(bool main_thread, std::string_view message);

bool IsBooting();
bool IsRunning();
bool IsRunningAndStarted(); // is running and the CPU loop has been entered
bool IsRunningInCurrentThread(); // this tells us whether we are running in the CPU thread.
Expand Down