ui: also enable StrictMode thread policy in debug builds

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
Harsh Shandilya 2020-08-23 00:59:20 +05:30
parent 348d430cd3
commit 898bb679d2
No known key found for this signature in database
GPG Key ID: 366D7BBAD1031E80

View File

@ -14,6 +14,7 @@ import android.os.Handler
import android.os.Looper
import android.os.StrictMode
import android.os.StrictMode.VmPolicy
import android.os.StrictMode.ThreadPolicy
import android.util.Log
import androidx.appcompat.app.AppCompatDelegate
import androidx.preference.PreferenceManager
@ -53,6 +54,7 @@ class Application : android.app.Application(), OnSharedPreferenceChangeListener
}
if (BuildConfig.DEBUG) {
StrictMode.setVmPolicy(VmPolicy.Builder().detectAll().penaltyLog().build())
StrictMode.setThreadPolicy(ThreadPolicy.Builder().detectAll().penaltyLog().build())
}
}