Loading app/build.gradle +7 −4 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ android { manifestPlaceholders = [ "deepLinkScheme": deepLinkSchemeValue ] buildConfigField "boolean", "DATA_COLLECTION_DISABLED", "true" } def releaseTemplate = { Loading Loading @@ -192,6 +193,8 @@ android.applicationVariants.all { variant -> // ------------------------------------------------------------------------------------------------- def isDebug = variant.buildType.resValues['IS_DEBUG']?.value ?: false def isDataCollectionDisabled = variant.buildType.buildConfigFields['DATA_COLLECTION_DISABLED']?.value ?: true def isDebugOrDCD = isDebug || isDataCollectionDisabled def useReleaseVersioning = variant.buildType.buildConfigFields['USE_RELEASE_VERSIONING']?.value ?: false def versionName = Config.releaseVersionName(project) Loading @@ -200,7 +203,7 @@ android.applicationVariants.all { variant -> println("Application ID: " + [variant.mergedFlavor.applicationId, variant.buildType.applicationIdSuffix].findAll().join()) println("Build type: " + variant.buildType.name) println("Flavor: " + variant.flavorName) println("Telemetry enabled: " + !isDebug) println("Telemetry enabled: " + !isDebugOrDCD) if (useReleaseVersioning) { // The Google Play Store does not allow multiple APKs for the same app that all have the Loading @@ -225,7 +228,7 @@ android.applicationVariants.all { variant -> // ------------------------------------------------------------------------------------------------- buildConfigField 'String', 'SENTRY_TOKEN', 'null' if (!isDebug) { if (!isDebugOrDCD) { buildConfigField 'boolean', 'CRASH_REPORTING', 'true' // Reading sentry token from local file (if it exists). In a release task on taskcluster it will be available. try { Loading @@ -236,7 +239,7 @@ android.applicationVariants.all { variant -> buildConfigField 'boolean', 'CRASH_REPORTING', 'false' } if (!isDebug) { if (!isDebugOrDCD) { buildConfigField 'boolean', 'TELEMETRY', 'true' } else { buildConfigField 'boolean', 'TELEMETRY', 'false' Loading @@ -257,7 +260,7 @@ android.applicationVariants.all { variant -> print("Adjust token: ") if (!isDebug) { if (!isDebugOrDCD) { try { def token = new File("${rootDir}/.adjust_token").text.trim() buildConfigField 'String', 'ADJUST_TOKEN', '"' + token + '"' Loading app/src/main/java/org/mozilla/fenix/utils/Settings.kt +3 −3 Original line number Diff line number Diff line Loading @@ -286,17 +286,17 @@ class Settings(private val appContext: Context) : PreferencesHolder { val isTelemetryEnabled by booleanPreference( appContext.getPreferenceKey(R.string.pref_key_telemetry), default = true default = BuildConfig.DATA_COLLECTION_DISABLED == false ) val isMarketingTelemetryEnabled by booleanPreference( appContext.getPreferenceKey(R.string.pref_key_marketing_telemetry), default = true default = BuildConfig.DATA_COLLECTION_DISABLED == false ) val isExperimentationEnabled by booleanPreference( appContext.getPreferenceKey(R.string.pref_key_experimentation), default = true default = BuildConfig.DATA_COLLECTION_DISABLED == false ) private var trackingProtectionOnboardingShownThisSession = false Loading app/src/test/java/org/mozilla/fenix/utils/SettingsTest.kt +6 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ import org.junit.Assert.assertTrue import org.junit.Before import org.junit.Test import org.junit.runner.RunWith import org.mozilla.fenix.BuildConfig import org.mozilla.fenix.helpers.FenixRobolectricTestRunner import org.mozilla.fenix.settings.PhoneFeature import org.mozilla.fenix.settings.deletebrowsingdata.DeleteBrowsingDataOnQuitType Loading Loading @@ -149,8 +150,12 @@ class SettingsTest { fun isTelemetryEnabled() { // When just created // Then if (BuildConfig.DATA_COLLECTION_DISABLED) { assertFalse(settings.isTelemetryEnabled) } else { assertTrue(settings.isTelemetryEnabled) } } @Test fun showLoginsDialogWarningSync() { Loading Loading
app/build.gradle +7 −4 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ android { manifestPlaceholders = [ "deepLinkScheme": deepLinkSchemeValue ] buildConfigField "boolean", "DATA_COLLECTION_DISABLED", "true" } def releaseTemplate = { Loading Loading @@ -192,6 +193,8 @@ android.applicationVariants.all { variant -> // ------------------------------------------------------------------------------------------------- def isDebug = variant.buildType.resValues['IS_DEBUG']?.value ?: false def isDataCollectionDisabled = variant.buildType.buildConfigFields['DATA_COLLECTION_DISABLED']?.value ?: true def isDebugOrDCD = isDebug || isDataCollectionDisabled def useReleaseVersioning = variant.buildType.buildConfigFields['USE_RELEASE_VERSIONING']?.value ?: false def versionName = Config.releaseVersionName(project) Loading @@ -200,7 +203,7 @@ android.applicationVariants.all { variant -> println("Application ID: " + [variant.mergedFlavor.applicationId, variant.buildType.applicationIdSuffix].findAll().join()) println("Build type: " + variant.buildType.name) println("Flavor: " + variant.flavorName) println("Telemetry enabled: " + !isDebug) println("Telemetry enabled: " + !isDebugOrDCD) if (useReleaseVersioning) { // The Google Play Store does not allow multiple APKs for the same app that all have the Loading @@ -225,7 +228,7 @@ android.applicationVariants.all { variant -> // ------------------------------------------------------------------------------------------------- buildConfigField 'String', 'SENTRY_TOKEN', 'null' if (!isDebug) { if (!isDebugOrDCD) { buildConfigField 'boolean', 'CRASH_REPORTING', 'true' // Reading sentry token from local file (if it exists). In a release task on taskcluster it will be available. try { Loading @@ -236,7 +239,7 @@ android.applicationVariants.all { variant -> buildConfigField 'boolean', 'CRASH_REPORTING', 'false' } if (!isDebug) { if (!isDebugOrDCD) { buildConfigField 'boolean', 'TELEMETRY', 'true' } else { buildConfigField 'boolean', 'TELEMETRY', 'false' Loading @@ -257,7 +260,7 @@ android.applicationVariants.all { variant -> print("Adjust token: ") if (!isDebug) { if (!isDebugOrDCD) { try { def token = new File("${rootDir}/.adjust_token").text.trim() buildConfigField 'String', 'ADJUST_TOKEN', '"' + token + '"' Loading
app/src/main/java/org/mozilla/fenix/utils/Settings.kt +3 −3 Original line number Diff line number Diff line Loading @@ -286,17 +286,17 @@ class Settings(private val appContext: Context) : PreferencesHolder { val isTelemetryEnabled by booleanPreference( appContext.getPreferenceKey(R.string.pref_key_telemetry), default = true default = BuildConfig.DATA_COLLECTION_DISABLED == false ) val isMarketingTelemetryEnabled by booleanPreference( appContext.getPreferenceKey(R.string.pref_key_marketing_telemetry), default = true default = BuildConfig.DATA_COLLECTION_DISABLED == false ) val isExperimentationEnabled by booleanPreference( appContext.getPreferenceKey(R.string.pref_key_experimentation), default = true default = BuildConfig.DATA_COLLECTION_DISABLED == false ) private var trackingProtectionOnboardingShownThisSession = false Loading
app/src/test/java/org/mozilla/fenix/utils/SettingsTest.kt +6 −1 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ import org.junit.Assert.assertTrue import org.junit.Before import org.junit.Test import org.junit.runner.RunWith import org.mozilla.fenix.BuildConfig import org.mozilla.fenix.helpers.FenixRobolectricTestRunner import org.mozilla.fenix.settings.PhoneFeature import org.mozilla.fenix.settings.deletebrowsingdata.DeleteBrowsingDataOnQuitType Loading Loading @@ -149,8 +150,12 @@ class SettingsTest { fun isTelemetryEnabled() { // When just created // Then if (BuildConfig.DATA_COLLECTION_DISABLED) { assertFalse(settings.isTelemetryEnabled) } else { assertTrue(settings.isTelemetryEnabled) } } @Test fun showLoginsDialogWarningSync() { Loading