Remove tip telemetry

This commit is contained in:
Elise Richards 2021-08-30 14:35:36 -07:00 committed by mergify[bot]
parent fa811cb244
commit d137becd48
6 changed files with 1 additions and 105 deletions

View File

@ -2363,62 +2363,6 @@ history:
- android-probes@mozilla.com
expires: "2022-08-01"
tip:
displayed:
type: event
description: |
The tip was displayed
extra_keys:
identifier:
description: "The identifier of the tip displayed"
bugs:
- https://github.com/mozilla-mobile/fenix/issues/9328
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/9836
- https://github.com/mozilla-mobile/fenix/pull/15713#issuecomment-703972068
- https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789
data_sensitivity:
- interaction
notification_emails:
- android-probes@mozilla.com
expires: "2021-08-01"
pressed:
type: event
description: |
The tip's button was pressed
extra_keys:
identifier:
description: "The identifier of the tip the action was taken on"
bugs:
- https://github.com/mozilla-mobile/fenix/issues/9328
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/9836
- https://github.com/mozilla-mobile/fenix/pull/15713#issuecomment-703972068
- https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789
data_sensitivity:
- interaction
notification_emails:
- android-probes@mozilla.com
expires: "2021-08-01"
closed:
type: event
description: |
The tip was closed
extra_keys:
identifier:
description: "The identifier of the tip closed"
bugs:
- https://github.com/mozilla-mobile/fenix/issues/9328
data_reviews:
- https://github.com/mozilla-mobile/fenix/pull/9836
- https://github.com/mozilla-mobile/fenix/pull/15713#issuecomment-703972068
- https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789
data_sensitivity:
- interaction
notification_emails:
- android-probes@mozilla.com
expires: "2021-08-01"
reader_mode:
available:
type: event

View File

@ -22,7 +22,6 @@ import org.mozilla.fenix.GleanMetrics.Onboarding
import org.mozilla.fenix.GleanMetrics.ProgressiveWebApp
import org.mozilla.fenix.GleanMetrics.SearchShortcuts
import org.mozilla.fenix.GleanMetrics.TabsTray
import org.mozilla.fenix.GleanMetrics.Tip
import org.mozilla.fenix.GleanMetrics.ToolbarSettings
import org.mozilla.fenix.GleanMetrics.TopSites
import org.mozilla.fenix.GleanMetrics.TrackingProtection
@ -351,21 +350,6 @@ sealed class Event {
get() = hashMapOf(Addons.openAddonSettingKeys.addonId to addonId)
}
data class TipDisplayed(val identifier: String) : Event() {
override val extras: Map<Tip.displayedKeys, String>?
get() = hashMapOf(Tip.displayedKeys.identifier to identifier)
}
data class TipPressed(val identifier: String) : Event() {
override val extras: Map<Tip.pressedKeys, String>?
get() = hashMapOf(Tip.pressedKeys.identifier to identifier)
}
data class TipClosed(val identifier: String) : Event() {
override val extras: Map<Tip.closedKeys, String>?
get() = hashMapOf(Tip.closedKeys.identifier to identifier)
}
data class ToolbarPositionChanged(val position: Position) : Event() {
enum class Position { TOP, BOTTOM }

View File

@ -54,7 +54,6 @@ import org.mozilla.fenix.GleanMetrics.SyncedTabs
import org.mozilla.fenix.GleanMetrics.Tab
import org.mozilla.fenix.GleanMetrics.Tabs
import org.mozilla.fenix.GleanMetrics.TabsTray
import org.mozilla.fenix.GleanMetrics.Tip
import org.mozilla.fenix.GleanMetrics.ToolbarSettings
import org.mozilla.fenix.GleanMetrics.TopSites
import org.mozilla.fenix.GleanMetrics.TrackingProtection
@ -541,18 +540,6 @@ private val Event.wrapper: EventWrapper<*>?
{ Addons.openAddonSetting.record(it) },
{ Addons.openAddonSettingKeys.valueOf(it) }
)
is Event.TipDisplayed -> EventWrapper(
{ Tip.displayed.record(it) },
{ Tip.displayedKeys.valueOf(it) }
)
is Event.TipPressed -> EventWrapper(
{ Tip.pressed.record(it) },
{ Tip.pressedKeys.valueOf(it) }
)
is Event.TipClosed -> EventWrapper(
{ Tip.closed.record(it) },
{ Tip.closedKeys.valueOf(it) }
)
is Event.VoiceSearchTapped -> EventWrapper<NoExtraKeys>(
{ VoiceSearch.tapped.record(it) }
)

View File

@ -27,12 +27,10 @@ import mozilla.components.service.sync.logins.toLogin
import mozilla.components.support.migration.FennecLoginsMPImporter
import mozilla.components.support.migration.FennecProfile
import org.mozilla.fenix.R
import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.components.tips.Tip
import org.mozilla.fenix.components.tips.TipProvider
import org.mozilla.fenix.components.tips.TipType
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.ext.metrics
import org.mozilla.fenix.ext.settings
/**
@ -214,8 +212,6 @@ class MasterPasswordTipProvider(
private fun dismissMPTip() {
tip?.let {
context.metrics.track(Event.TipClosed(it.identifier))
context.components.settings.preferences
.edit()
.putBoolean(it.identifier, false)

View File

@ -9,8 +9,6 @@ import androidx.core.view.isVisible
import org.mozilla.fenix.BrowserDirection
import org.mozilla.fenix.HomeActivity
import org.mozilla.fenix.R
import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.components.metrics.MetricController
import org.mozilla.fenix.components.tips.Tip
import org.mozilla.fenix.components.tips.TipType
import org.mozilla.fenix.databinding.ButtonTipItemBinding
@ -23,7 +21,6 @@ import org.mozilla.fenix.utils.view.ViewHolder
class ButtonTipViewHolder(
private val view: View,
private val interactor: SessionControlInteractor,
private val metrics: MetricController = view.context.components.analytics.metrics,
private val settings: Settings = view.context.components.settings
) : ViewHolder(view) {
@ -35,8 +32,6 @@ class ButtonTipViewHolder(
this.tip = tip
metrics.track(Event.TipDisplayed(tip.identifier))
with(binding) {
tipHeaderText.text = tip.title
tip.titleDrawable?.let {
@ -60,12 +55,9 @@ class ButtonTipViewHolder(
tipButton.setOnClickListener {
tip.type.action.invoke()
metrics.track(Event.TipPressed(tip.identifier))
}
tipClose.setOnClickListener {
metrics.track(Event.TipClosed(tip.identifier))
settings.preferences
.edit()
.putBoolean(tip.identifier, false)

View File

@ -24,8 +24,6 @@ import org.junit.Test
import org.junit.runner.RunWith
import org.mozilla.fenix.BrowserDirection
import org.mozilla.fenix.HomeActivity
import org.mozilla.fenix.components.metrics.Event
import org.mozilla.fenix.components.metrics.MetricController
import org.mozilla.fenix.components.tips.Tip
import org.mozilla.fenix.components.tips.TipType
import org.mozilla.fenix.databinding.ButtonTipItemBinding
@ -38,7 +36,6 @@ class ButtonTipViewHolderTest {
@MockK private lateinit var activity: HomeActivity
@MockK private lateinit var interactor: SessionControlInteractor
@MockK(relaxed = true) private lateinit var metrics: MetricController
@MockK private lateinit var settings: Settings
@MockK private lateinit var sharedPrefs: SharedPreferences
@MockK private lateinit var sharedPrefsEditor: SharedPreferences.Editor
@ -53,7 +50,7 @@ class ButtonTipViewHolderTest {
.inflate(ButtonTipViewHolder.LAYOUT_ID, null)
)
viewHolder = ButtonTipViewHolder(view, interactor, metrics, settings)
viewHolder = ButtonTipViewHolder(view, interactor, settings)
binding = ButtonTipItemBinding.bind(view)
every { view.context } returns activity
every { activity.openToBrowserAndLoad(any(), any(), any()) } just Runs
@ -71,8 +68,6 @@ class ButtonTipViewHolderTest {
assertEquals("Tip Title", binding.tipHeaderText.text)
assertEquals("Tip description", binding.tipDescriptionText.text)
assertEquals("button", binding.tipButton.text)
verify { metrics.track(Event.TipDisplayed("tipIdentifier")) }
}
@Test
@ -105,7 +100,6 @@ class ButtonTipViewHolderTest {
binding.tipButton.performClick()
verify { action() }
verify { metrics.track(Event.TipPressed("tipIdentifier")) }
}
@Test
@ -115,7 +109,6 @@ class ButtonTipViewHolderTest {
binding.tipClose.performClick()
verify { interactor.onCloseTip(tip) }
verify { metrics.track(Event.TipClosed("tipIdentifier")) }
verify { sharedPrefsEditor.putBoolean("tipIdentifier", false) }
}