using Config strict mode flag directly within the Application as the build meta can't be injected before super application.onCreate

This commit is contained in:
Adam Brown 2022-07-11 12:02:57 +01:00
parent 3d207f93f1
commit fe1019f29f
4 changed files with 2 additions and 4 deletions

View File

@ -40,6 +40,7 @@ import com.mapbox.mapboxsdk.Mapbox
import com.vanniktech.emoji.EmojiManager
import com.vanniktech.emoji.google.GoogleEmojiProvider
import dagger.hilt.android.HiltAndroidApp
import im.vector.app.config.Config
import im.vector.app.core.di.ActiveSessionHolder
import im.vector.app.core.resources.BuildMeta
import im.vector.app.features.analytics.VectorAnalytics
@ -198,7 +199,7 @@ class VectorApplication :
}
private fun enableStrictModeIfNeeded() {
if (buildMeta.enableStrictModeLogs) {
if (Config.ENABLE_STRICT_MODE_LOGS) {
StrictMode.setThreadPolicy(
StrictMode.ThreadPolicy.Builder()
.detectAll()

View File

@ -215,7 +215,6 @@ object VectorStaticModule {
sdkInt = Build.VERSION.SDK_INT,
applicationId = BuildConfig.APPLICATION_ID,
lowPrivacyLoggingEnabled = Config.LOW_PRIVACY_LOG_ENABLE,
enableStrictModeLogs = Config.ENABLE_STRICT_MODE_LOGS,
versionName = BuildConfig.VERSION_NAME,
gitRevision = BuildConfig.GIT_REVISION,
gitRevisionDate = BuildConfig.GIT_REVISION_DATE,

View File

@ -21,7 +21,6 @@ data class BuildMeta(
val sdkInt: Int,
val applicationId: String,
val lowPrivacyLoggingEnabled: Boolean,
val enableStrictModeLogs: Boolean,
val versionName: String,
val gitRevision: String,
val gitRevisionDate: String,

View File

@ -24,7 +24,6 @@ fun aBuildMeta() = BuildMeta(
sdkInt = Build.VERSION_CODES.O,
applicationId = "im.vector",
lowPrivacyLoggingEnabled = false,
enableStrictModeLogs = false,
versionName = "app-version-name",
gitRevision = "abcdef",
gitRevisionDate = "01-01-01",