From 23154791ab1f44ed6cd72772d5ffc6e0bd57e0ba Mon Sep 17 00:00:00 2001 From: Ryan Kelly Date: Thu, 17 Dec 2020 14:28:30 +1100 Subject: [PATCH] [fenix] Reset experiment telemetry identifiers on data prefs change. When the user opts out of telemetry, we need to reset the user identifiers used by the experiment system, so that there's no risk of tracking the user across the reset event if they later decide to re-enable telemetry. --- .../java/org/mozilla/fenix/settings/DataChoicesFragment.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/org/mozilla/fenix/settings/DataChoicesFragment.kt b/app/src/main/java/org/mozilla/fenix/settings/DataChoicesFragment.kt index 03f7d5debc..ca0229a2a3 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/DataChoicesFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/DataChoicesFragment.kt @@ -31,6 +31,10 @@ class DataChoicesFragment : PreferenceFragmentCompat() { } else { context.components.analytics.metrics.stop(MetricServiceType.Data) } + // Reset experiment identifiers on both opt-in and opt-out; it's likely + // that in future we will need to pass in the new telemetry client_id + // to this method when the user opts back in. + context.components.analytics.experiments.resetTelemetryIdentifiers() } else if (key == getPreferenceKey(R.string.pref_key_marketing_telemetry)) { if (context.settings().isMarketingTelemetryEnabled) { context.components.analytics.metrics.start(MetricServiceType.Marketing)