For #21239 improve telemetry values for Allow users to customize their home screen
This commit is contained in:
parent
83e3e0b19d
commit
c05fbfb6c3
|
@ -342,23 +342,23 @@ sealed class Event {
|
||||||
val enabled: Boolean,
|
val enabled: Boolean,
|
||||||
val context: Context
|
val context: Context
|
||||||
) : Event() {
|
) : Event() {
|
||||||
private val booleanPreferenceTelemetryAllowList = listOf(
|
private val telemetryAllowMap = mapOf(
|
||||||
context.getString(R.string.pref_key_enable_top_frecent_sites),
|
context.getString(R.string.pref_key_enable_top_frecent_sites) to "most_visited_sites",
|
||||||
context.getString(R.string.pref_key_recent_tabs),
|
context.getString(R.string.pref_key_recent_tabs) to "jump_back_in",
|
||||||
context.getString(R.string.pref_key_recent_bookmarks),
|
context.getString(R.string.pref_key_recent_bookmarks) to "recently_saved",
|
||||||
context.getString(R.string.pref_key_pocket_homescreen_recommendations),
|
context.getString(R.string.pref_key_history_metadata_feature) to "recently_visited",
|
||||||
context.getString(R.string.pref_key_history_metadata_feature)
|
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(
|
get() = mapOf(
|
||||||
Events.preferenceToggledKeys.preferenceKey to preferenceKey,
|
Events.preferenceToggledKeys.preferenceKey to (telemetryAllowMap[preferenceKey] ?: ""),
|
||||||
Events.preferenceToggledKeys.enabled to enabled.toString()
|
Events.preferenceToggledKeys.enabled to enabled.toString()
|
||||||
)
|
)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
// If the event is not in the allow list, we don't want to track it
|
// 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…
Reference in New Issue
Block a user