|
|
|
@ -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))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|