mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-23 14:19:15 +07:00
Refactor: Consistent & correct usage of coroutines (#7077)
* Refactor: Consistent usage of coroutines * Add usage comments to the different threads * Refactor: Properly separate crash handling into its platform-specific parts * Fix autoSave never finishing * Correctly handle coroutines when the GL thread is not accepting runnables anymore Co-authored-by: Yair Morgenstern <yairm210@hotmail.com>
This commit is contained in:
@ -7,7 +7,6 @@ import android.provider.DocumentsContract
|
||||
import android.provider.OpenableColumns
|
||||
import androidx.annotation.GuardedBy
|
||||
import com.unciv.logic.CustomFileLocationHelper
|
||||
import com.unciv.ui.crashhandling.postCrashHandlingRunnable
|
||||
import java.io.InputStream
|
||||
import java.io.OutputStream
|
||||
|
||||
|
@ -3,6 +3,7 @@ package com.unciv.app
|
||||
import android.app.Activity
|
||||
import android.content.pm.ActivityInfo
|
||||
import com.unciv.ui.utils.GeneralPlatformSpecificHelpers
|
||||
import kotlin.concurrent.thread
|
||||
|
||||
/** See also interface [GeneralPlatformSpecificHelpers].
|
||||
*
|
||||
@ -35,4 +36,9 @@ Sources for Info about current orientation in case need:
|
||||
* External is probably on an SD-card or similar which is always accessible by the user.
|
||||
*/
|
||||
override fun shouldPreferExternalStorage(): Boolean = true
|
||||
|
||||
override fun handleUncaughtThrowable(ex: Throwable): Boolean {
|
||||
thread { throw ex } // this will kill the app but report the exception to the Google Play Console if the user allows it
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user