Enable StrictMode in debug logging builds (#1391)
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
parent
213778122c
commit
53c3431ef0
1 changed files with 5 additions and 0 deletions
|
@ -5,6 +5,9 @@
|
|||
package dev.msfjarvis.aps
|
||||
|
||||
import android.content.SharedPreferences
|
||||
import android.os.StrictMode
|
||||
import android.os.StrictMode.ThreadPolicy
|
||||
import android.os.StrictMode.VmPolicy
|
||||
import androidx.appcompat.app.AppCompatDelegate
|
||||
import androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY
|
||||
import androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
|
||||
|
@ -31,6 +34,8 @@ class Application : android.app.Application(), SharedPreferences.OnSharedPrefere
|
|||
instance = this
|
||||
if (BuildConfig.ENABLE_DEBUG_FEATURES || prefs.getBoolean(PreferenceKeys.ENABLE_DEBUG_LOGGING, false)) {
|
||||
plant(DebugTree())
|
||||
StrictMode.setVmPolicy(VmPolicy.Builder().detectAll().penaltyLog().build())
|
||||
StrictMode.setThreadPolicy(ThreadPolicy.Builder().detectAll().penaltyLog().build())
|
||||
}
|
||||
prefs.registerOnSharedPreferenceChangeListener(this)
|
||||
setNightMode()
|
||||
|
|
Loading…
Reference in a new issue