mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-01-22 07:17:53 +01:00
Strict mode: add a build entry to enable whenever we want to check
This commit is contained in:
parent
979c0832cf
commit
c2880a5832
@ -190,6 +190,8 @@ android {
|
||||
|
||||
resValue "bool", "debug_mode", "true"
|
||||
buildConfigField "boolean", "LOW_PRIVACY_LOG_ENABLE", "false"
|
||||
// Set to true if you want to enable strict mode in debug
|
||||
buildConfigField "boolean", "ENABLE_STRICT_MODE_LOGS", "false"
|
||||
|
||||
signingConfig signingConfigs.debug
|
||||
}
|
||||
@ -199,6 +201,7 @@ android {
|
||||
|
||||
resValue "bool", "debug_mode", "false"
|
||||
buildConfigField "boolean", "LOW_PRIVACY_LOG_ENABLE", "false"
|
||||
buildConfigField "boolean", "ENABLE_STRICT_MODE_LOGS", "false"
|
||||
|
||||
postprocessing {
|
||||
removeUnusedCode true
|
||||
|
@ -93,13 +93,7 @@ class VectorApplication :
|
||||
private var fontThreadHandler: Handler? = null
|
||||
|
||||
override fun onCreate() {
|
||||
if (BuildConfig.DEBUG) {
|
||||
StrictMode.setThreadPolicy(StrictMode.ThreadPolicy.Builder()
|
||||
.detectAll()
|
||||
.penaltyFlashScreen()
|
||||
.penaltyLog()
|
||||
.build())
|
||||
}
|
||||
enableStrictModeIfNeeded()
|
||||
super.onCreate()
|
||||
appContext = this
|
||||
vectorComponent = DaggerVectorComponent.factory().create(this)
|
||||
@ -171,6 +165,15 @@ class VectorApplication :
|
||||
// initKnownEmojiHashSet(appContext)
|
||||
}
|
||||
|
||||
private fun enableStrictModeIfNeeded() {
|
||||
if (BuildConfig.ENABLE_STRICT_MODE_LOGS) {
|
||||
StrictMode.setThreadPolicy(StrictMode.ThreadPolicy.Builder()
|
||||
.detectAll()
|
||||
.penaltyLog()
|
||||
.build())
|
||||
}
|
||||
}
|
||||
|
||||
override fun providesMatrixConfiguration() = MatrixConfiguration(BuildConfig.FLAVOR_DESCRIPTION)
|
||||
|
||||
override fun getWorkManagerConfiguration(): WorkConfiguration {
|
||||
|
Loading…
Reference in New Issue
Block a user