From da1188c6ee877ffe9c8c5fe9ebea7f53f5c462d8 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sat, 15 Feb 2020 18:52:06 +0530 Subject: [PATCH] Record StrictMode failures to logcat Signed-off-by: Harsh Shandilya --- app/src/main/java/com/wireguard/android/Application.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/com/wireguard/android/Application.java b/app/src/main/java/com/wireguard/android/Application.java index 22572d54..bd848e66 100644 --- a/app/src/main/java/com/wireguard/android/Application.java +++ b/app/src/main/java/com/wireguard/android/Application.java @@ -12,6 +12,7 @@ import android.os.AsyncTask; import android.os.Build; import android.os.Handler; import android.os.Looper; +import android.os.StrictMode; import android.util.Log; import androidx.preference.PreferenceManager; @@ -131,6 +132,10 @@ public class Application extends android.app.Application { startActivity(intent); System.exit(0); } + + if (BuildConfig.DEBUG) { + StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectAll().penaltyLog().build()); + } } @Override