mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-10 07:48:31 +07:00
Fix android pause (#10318)
* Fix MusicController Pause handling for Android's pause event * Revert inadvertent instrumentation change
This commit is contained in:
@ -446,9 +446,11 @@ open class UncivGame(val isConsoleMode: Boolean = false) : Game(), PlatformSpeci
|
||||
}
|
||||
|
||||
override fun pause() {
|
||||
// Needs to go ASAP - on Android, there's a tiny race condition: The OS will stop our playback forcibly, it likely
|
||||
// already has, but if we do _our_ pause before the MusicController timer notices, it will at least remember the current track.
|
||||
if (::musicController.isInitialized) musicController.pause()
|
||||
val curGameInfo = gameInfo
|
||||
if (curGameInfo != null) files.requestAutoSave(curGameInfo)
|
||||
if (::musicController.isInitialized) musicController.pause()
|
||||
super.pause()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user