summaryrefslogtreecommitdiffhomepage
path: root/ui/src/main/java/com
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2023-04-11 19:20:26 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2023-04-11 19:20:26 +0200
commitfdda87fd31e13d8297707511fa201e84f16a33c9 (patch)
tree0ec1a2de30c4861668acc249542bdff2dad7a915 /ui/src/main/java/com
parent3907f6a4c1af2ef5925cc589eb72bc16c09ecaca (diff)
tunnel: defer enabling strict mode until later
Startup code can be synchronous. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui/src/main/java/com')
-rw-r--r--ui/src/main/java/com/wireguard/android/Application.kt9
1 files 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() {