diff options
| author | JosJuice <josjuice@gmail.com> | 2024-07-02 17:27:04 +0200 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2024-10-04 18:35:41 +0200 |
| commit | 6ca2da53e86766f54df1ae79e65bb220b41ed7ef (patch) | |
| tree | 4b2fdcf42129d439d532b0cf31b94dfe748969c5 /Source/Android/jni/MainAndroid.cpp | |
| parent | 2da3e49b1e876a28c93ad990c71e5d4bb2441f5b (diff) | |
Partially revert "Revert "Audit uses of IsRunning and GetState""
This reverts the revert commit bc67fc97c39628c76a4dbca411b0e8a9bfaf726a,
except for the changes in BaseConfigLoader.cpp, which caused the bug
that made us revert 72cf2bdb87f09deff22e1085de3290126aa4ad05. PR 12917
contains an improved change to BaseConfigLoader.cpp, which can be merged
(or rejected) independently.
A few changes have also been made based on review comments.
Diffstat (limited to 'Source/Android/jni/MainAndroid.cpp')
| -rw-r--r-- | Source/Android/jni/MainAndroid.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/Source/Android/jni/MainAndroid.cpp b/Source/Android/jni/MainAndroid.cpp index 811b28c32b..270dad9ed3 100644 --- a/Source/Android/jni/MainAndroid.cpp +++ b/Source/Android/jni/MainAndroid.cpp @@ -118,8 +118,7 @@ void Host_Message(HostMessageID id) } else if (id == HostMessageID::WMUserStop) { - if (Core::IsRunning(Core::System::GetInstance())) - Core::QueueHostJob(&Core::Stop); + Core::QueueHostJob(&Core::Stop); } } @@ -277,13 +276,6 @@ 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<jboolean>(Core::IsRunning(Core::System::GetInstance())); -} - -JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_IsRunningAndStarted(JNIEnv*, - jclass) -{ return static_cast<jboolean>(Core::IsRunning(Core::System::GetInstance())); } @@ -293,6 +285,13 @@ Java_org_dolphinemu_dolphinemu_NativeLibrary_IsRunningAndUnpaused(JNIEnv*, jclas return static_cast<jboolean>(Core::GetState(Core::System::GetInstance()) == Core::State::Running); } +JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_IsUninitialized(JNIEnv*, + jclass) +{ + return static_cast<jboolean>(Core::IsUninitialized(Core::System::GetInstance()) && + !s_is_booting.IsSet()); +} + JNIEXPORT jstring JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_GetVersionString(JNIEnv* env, jclass) { |
