From bc67fc97c39628c76a4dbca411b0e8a9bfaf726a Mon Sep 17 00:00:00 2001 From: JosJuice Date: Wed, 26 Jun 2024 20:34:16 +0200 Subject: Revert "Audit uses of IsRunning and GetState" This reverts commit 72cf2bdb87f09deff22e1085de3290126aa4ad05. SYSCONF settings are getting cleared when they shouldn't be. Let's revert the change until I get proper time to figure out why it's broken. --- Source/Android/jni/MainAndroid.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'Source/Android/jni/MainAndroid.cpp') diff --git a/Source/Android/jni/MainAndroid.cpp b/Source/Android/jni/MainAndroid.cpp index 83902892e9..23fc782aeb 100644 --- a/Source/Android/jni/MainAndroid.cpp +++ b/Source/Android/jni/MainAndroid.cpp @@ -118,7 +118,8 @@ void Host_Message(HostMessageID id) } else if (id == HostMessageID::WMUserStop) { - Core::QueueHostJob(&Core::Stop); + if (Core::IsRunning(Core::System::GetInstance())) + Core::QueueHostJob(&Core::Stop); } } @@ -275,6 +276,13 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SetIsBooting } JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_IsRunning(JNIEnv*, jclass) +{ + return s_is_booting.IsSet() || + static_cast(Core::IsRunning(Core::System::GetInstance())); +} + +JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_IsRunningAndStarted(JNIEnv*, + jclass) { return static_cast(Core::IsRunning(Core::System::GetInstance())); } @@ -285,13 +293,6 @@ Java_org_dolphinemu_dolphinemu_NativeLibrary_IsRunningAndUnpaused(JNIEnv*, jclas return static_cast(Core::GetState(Core::System::GetInstance()) == Core::State::Running); } -JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_IsUninitialized(JNIEnv*, - jclass) -{ - return static_cast(Core::IsUninitialized(Core::System::GetInstance()) && - !s_is_booting.IsSet()); -} - JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetVersionString(JNIEnv* env, jclass) { -- cgit v1.2.3