Enable StrictMode for userdebug builds

This commit is contained in:
Torsten Grote 2020-10-05 11:05:09 -03:00 committed by Chirayu Desai
parent 948cd597d8
commit 4387353227

View file

@ -6,6 +6,7 @@ import android.app.backup.IBackupManager
import android.content.Context.BACKUP_SERVICE
import android.os.Build
import android.os.ServiceManager.getService
import android.os.StrictMode
import com.stevesoltys.seedvault.crypto.cryptoModule
import com.stevesoltys.seedvault.header.headerModule
import com.stevesoltys.seedvault.metadata.MetadataManager
@ -63,6 +64,21 @@ class App : Application() {
)
)
}
if (isDebugBuild()) {
StrictMode.setThreadPolicy(
StrictMode.ThreadPolicy.Builder()
.detectAll()
.penaltyLog()
.penaltyFlashScreen()
.build()
)
StrictMode.setVmPolicy(
StrictMode.VmPolicy.Builder()
.detectAll()
.penaltyLog()
.build()
)
}
migrateTokenFromMetadataToSettingsManager()
}