mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
Android: Don't let RetroAchievements override onPause
When Android sends Dolphin to the background, emulation *must* pause, otherwise emulation continues running and continues outputting audio to the user. RetroAchievements mustn't be allowed to override it.
This commit is contained in:
@@ -362,7 +362,7 @@ public final class NativeLibrary
|
||||
/**
|
||||
* Pauses emulation.
|
||||
*/
|
||||
public static native void PauseEmulation();
|
||||
public static native void PauseEmulation(boolean overrideAchievementRestrictions);
|
||||
|
||||
/**
|
||||
* Stops emulation.
|
||||
|
||||
+1
-1
@@ -455,7 +455,7 @@ class EmulationActivity : AppCompatActivity(), ThemeProvider {
|
||||
MENU_ACTION_REFRESH_WIIMOTES -> NativeLibrary.RefreshWiimotes()
|
||||
MENU_ACTION_PAUSE_EMULATION -> {
|
||||
hasUserPausedEmulation = true
|
||||
NativeLibrary.PauseEmulation()
|
||||
NativeLibrary.PauseEmulation(false)
|
||||
}
|
||||
|
||||
MENU_ACTION_UNPAUSE_EMULATION -> {
|
||||
|
||||
+1
-1
@@ -109,7 +109,7 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback {
|
||||
override fun onPause() {
|
||||
if (NativeLibrary.IsRunningAndUnpaused() && !NativeLibrary.IsShowingAlertMessage()) {
|
||||
Log.debug("[EmulationFragment] Pausing emulation.")
|
||||
NativeLibrary.PauseEmulation()
|
||||
NativeLibrary.PauseEmulation(true)
|
||||
}
|
||||
super.onPause()
|
||||
}
|
||||
|
||||
@@ -271,10 +271,12 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_UnPauseEmula
|
||||
Core::SetState(Core::System::GetInstance(), Core::State::Running);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_PauseEmulation(JNIEnv*, jclass)
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_PauseEmulation(
|
||||
JNIEnv*, jclass, bool override_achievement_restrictions)
|
||||
{
|
||||
HostThreadLock guard;
|
||||
Core::SetState(Core::System::GetInstance(), Core::State::Paused);
|
||||
Core::SetState(Core::System::GetInstance(), Core::State::Paused, true,
|
||||
override_achievement_restrictions);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_StopEmulation(JNIEnv*, jclass)
|
||||
|
||||
Reference in New Issue
Block a user