diff --git a/app/src/main/java/com/fingerprintjs/android/playground/App.kt b/app/src/main/java/com/fingerprintjs/android/playground/App.kt index b876903..4dfd95e 100644 --- a/app/src/main/java/com/fingerprintjs/android/playground/App.kt +++ b/app/src/main/java/com/fingerprintjs/android/playground/App.kt @@ -1,6 +1,7 @@ package com.fingerprintjs.android.playground import android.app.Application +import android.os.StrictMode import com.fingerprintjs.android.playground.di.AppComponent import com.fingerprintjs.android.playground.di.DaggerAppComponent @@ -10,10 +11,26 @@ class App : Application() { private set override fun onCreate() { + setupStrictMode() super.onCreate() appComponent = DaggerAppComponent .builder() .app(this) .build() } -} \ No newline at end of file + + private fun setupStrictMode() { + if (BuildConfig.DEBUG) { + StrictMode.setThreadPolicy(StrictMode.ThreadPolicy.Builder() + .detectAll() + .penaltyLog() + .penaltyDeath() + .build()) + StrictMode.setVmPolicy(StrictMode.VmPolicy.Builder() + .detectAll() + .penaltyLog() + .penaltyDeath() + .build()) + } + } +}