From fdda87fd31e13d8297707511fa201e84f16a33c9 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 11 Apr 2023 19:20:26 +0200 Subject: [PATCH] tunnel: defer enabling strict mode until later Startup code can be synchronous. Signed-off-by: Jason A. Donenfeld --- ui/src/main/java/com/wireguard/android/Application.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ui/src/main/java/com/wireguard/android/Application.kt b/ui/src/main/java/com/wireguard/android/Application.kt index c66c52bd..06903af4 100644 --- a/ui/src/main/java/com/wireguard/android/Application.kt +++ b/ui/src/main/java/com/wireguard/android/Application.kt @@ -58,10 +58,6 @@ class Application : android.app.Application() { startActivity(intent) 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 { @@ -119,6 +115,11 @@ class Application : android.app.Application() { 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() {