[fenix] For https://github.com/mozilla-mobile/fenix/issues/21239 improve telemetry values for Allow users to customize their home screen

pull/600/head
Arturo Mejia 3 years ago committed by mergify[bot]
parent 15a3e30bf0
commit e87af643cb

@ -342,23 +342,23 @@ sealed class Event {
val enabled: Boolean,
val context: Context
) : Event() {
private val booleanPreferenceTelemetryAllowList = listOf(
context.getString(R.string.pref_key_enable_top_frecent_sites),
context.getString(R.string.pref_key_recent_tabs),
context.getString(R.string.pref_key_recent_bookmarks),
context.getString(R.string.pref_key_pocket_homescreen_recommendations),
context.getString(R.string.pref_key_history_metadata_feature)
private val telemetryAllowMap = mapOf(
context.getString(R.string.pref_key_enable_top_frecent_sites) to "most_visited_sites",
context.getString(R.string.pref_key_recent_tabs) to "jump_back_in",
context.getString(R.string.pref_key_recent_bookmarks) to "recently_saved",
context.getString(R.string.pref_key_history_metadata_feature) to "recently_visited",
context.getString(R.string.pref_key_pocket_homescreen_recommendations) to "pocket",
)
override val extras: Map<Events.preferenceToggledKeys, String>?
override val extras: Map<Events.preferenceToggledKeys, String>
get() = mapOf(
Events.preferenceToggledKeys.preferenceKey to preferenceKey,
Events.preferenceToggledKeys.preferenceKey to (telemetryAllowMap[preferenceKey] ?: ""),
Events.preferenceToggledKeys.enabled to enabled.toString()
)
init {
// If the event is not in the allow list, we don't want to track it
require(booleanPreferenceTelemetryAllowList.contains(preferenceKey))
require(telemetryAllowMap.contains(preferenceKey))
}
}

Loading…
Cancel
Save