tunnel: defer enabling strict mode until later

Startup code can be synchronous.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2023-04-11 19:20:26 +02:00
parent 3907f6a4c1
commit fdda87fd31

View File

@ -58,10 +58,6 @@ class Application : android.app.Application() {
startActivity(intent) startActivity(intent)
System.exit(0) System.exit(0)
} }
if (BuildConfig.DEBUG) {
StrictMode.setVmPolicy(VmPolicy.Builder().detectAll().penaltyLog().build())
StrictMode.setThreadPolicy(ThreadPolicy.Builder().detectAll().penaltyLog().build())
}
} }
private suspend fun determineBackend(): Backend { private suspend fun determineBackend(): Backend {
@ -119,6 +115,11 @@ class Application : android.app.Application() {
Log.e(TAG, Log.getStackTraceString(e)) Log.e(TAG, Log.getStackTraceString(e))
} }
} }
if (BuildConfig.DEBUG) {
StrictMode.setVmPolicy(VmPolicy.Builder().detectAll().penaltyLog().build())
StrictMode.setThreadPolicy(ThreadPolicy.Builder().detectAll().penaltyLog().build())
}
} }
override fun onTerminate() { override fun onTerminate() {