diff --git a/app/metrics.yaml b/app/metrics.yaml index 7330a88ccb80..92708fbe49d8 100644 --- a/app/metrics.yaml +++ b/app/metrics.yaml @@ -429,6 +429,7 @@ events: description: | A string containing the name of the tab view the user tapped. These items include: list or grid. + type: string bugs: - https://github.com/mozilla-mobile/fenix/issues/19956 data_reviews: diff --git a/app/src/main/java/org/mozilla/fenix/components/metrics/Event.kt b/app/src/main/java/org/mozilla/fenix/components/metrics/Event.kt index ff3028e50ca0..a79428938555 100644 --- a/app/src/main/java/org/mozilla/fenix/components/metrics/Event.kt +++ b/app/src/main/java/org/mozilla/fenix/components/metrics/Event.kt @@ -399,13 +399,6 @@ sealed class Event { get() = mapOf(Autoplay.settingChangedKeys.autoplaySetting to setting.toString().lowercase(Locale.ROOT)) } - data class TabViewSettingChanged(val type: Type) : Event() { - enum class Type { LIST, GRID } - - override val extras: Map? - get() = mapOf(Events.tabViewChangedKeys.type to type.toString().lowercase(Locale.ROOT)) - } - data class SearchTermGroupCount(val count: Int) : Event() { override val extras: Map get() = hashMapOf(SearchTerms.numberOfSearchTermGroupKeys.count to count.toString()) diff --git a/app/src/main/java/org/mozilla/fenix/settings/TabsSettingsFragment.kt b/app/src/main/java/org/mozilla/fenix/settings/TabsSettingsFragment.kt index cb9fe517d39c..da9f7d3d0a5e 100644 --- a/app/src/main/java/org/mozilla/fenix/settings/TabsSettingsFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/settings/TabsSettingsFragment.kt @@ -10,10 +10,9 @@ import androidx.preference.PreferenceCategory import androidx.preference.PreferenceFragmentCompat import androidx.preference.SwitchPreference import org.mozilla.fenix.FeatureFlags +import org.mozilla.fenix.GleanMetrics.Events import org.mozilla.fenix.R import org.mozilla.fenix.components.metrics.Event -import org.mozilla.fenix.components.metrics.Event.TabViewSettingChanged -import org.mozilla.fenix.components.metrics.Event.TabViewSettingChanged.Type import org.mozilla.fenix.ext.components import org.mozilla.fenix.ext.settings import org.mozilla.fenix.ext.showToolbar @@ -104,12 +103,10 @@ class TabsSettingsFragment : PreferenceFragmentCompat() { } private fun sendTabViewTelemetry() { - val metrics = requireContext().components.analytics.metrics - if (listRadioButton.isChecked && !gridRadioButton.isChecked) { - metrics.track(TabViewSettingChanged(Type.LIST)) + Events.tabViewChanged.record(Events.TabViewChangedExtra("list")) } else { - metrics.track(TabViewSettingChanged(Type.GRID)) + Events.tabViewChanged.record(Events.TabViewChangedExtra("grid")) } }