2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-17 15:26:23 +00:00

[fenix] Disable marketing telemetry until privacy pop window approved in Mozillaonline builds

This commit is contained in:
rxu 2022-07-04 11:13:11 +08:00 committed by mergify[bot]
parent 2fb74d394e
commit 84ddaab605
2 changed files with 10 additions and 7 deletions

View File

@ -12,6 +12,8 @@ import android.text.method.LinkMovementMethod
import android.widget.TextView import android.widget.TextView
import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AlertDialog
import org.mozilla.fenix.R import org.mozilla.fenix.R
import org.mozilla.fenix.components.metrics.MetricServiceType
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.settings import org.mozilla.fenix.ext.settings
import kotlin.system.exitProcess import kotlin.system.exitProcess
@ -44,11 +46,12 @@ fun showPrivacyPopWindow(context: Context, activity: Activity) {
// Users can only use fenix after they agree with the privacy notice // Users can only use fenix after they agree with the privacy notice
val builder = AlertDialog.Builder(activity) val builder = AlertDialog.Builder(activity)
.setPositiveButton( .setPositiveButton(
context.getString(R.string.privacy_notice_positive_button), context.getString(R.string.privacy_notice_positive_button)
{ _, _ -> ) { _, _ ->
context.settings().shouldShowPrivacyPopWindow = false context.settings().shouldShowPrivacyPopWindow = false
} context.settings().isMarketingTelemetryEnabled = true
) context.components.analytics.metrics.start(MetricServiceType.Marketing)
}
.setNeutralButton( .setNeutralButton(
context.getString(R.string.privacy_notice_neutral_button_2), context.getString(R.string.privacy_notice_neutral_button_2),
{ _, _ -> exitProcess(0) } { _, _ -> exitProcess(0) }

View File

@ -248,9 +248,9 @@ class Settings(private val appContext: Context) : PreferencesHolder {
default = true default = true
) )
val isMarketingTelemetryEnabled by booleanPreference( var isMarketingTelemetryEnabled by booleanPreference(
appContext.getPreferenceKey(R.string.pref_key_marketing_telemetry), appContext.getPreferenceKey(R.string.pref_key_marketing_telemetry),
default = true default = !Config.channel.isMozillaOnline
) )
var isExperimentationEnabled by booleanPreference( var isExperimentationEnabled by booleanPreference(