For #20328 - Adds telemetry for recentlyClosed button

...from tabsTray, inactiveTabs section.
upstream-sync
codrut.topliceanu 3 years ago committed by mergify[bot]
parent 84767f84ea
commit 5e13ead750

@ -2798,6 +2798,19 @@ tabs_tray:
notification_emails: notification_emails:
- android-probes@mozilla.com - android-probes@mozilla.com
expires: "2022-02-01" expires: "2022-02-01"
inactive_tabs_recently_closed:
type: event
description: |
A user tapped the "Recently closed" option of the inactive tabs menu.
bugs:
- https://github.com/mozilla-mobile/fenix/issues/20328
data_reviews:
- https://github.com/mozilla-mobile/fenix/issues/20328
data_sensitivity:
- interaction
notification_emails:
- android-probes@mozilla.com
expires: "2022-08-01"
collections: collections:
renamed: renamed:

@ -186,6 +186,7 @@ sealed class Event {
object TabsTraySaveToCollectionPressed : Event() object TabsTraySaveToCollectionPressed : Event()
object TabsTrayShareAllTabsPressed : Event() object TabsTrayShareAllTabsPressed : Event()
object TabsTrayCloseAllTabsPressed : Event() object TabsTrayCloseAllTabsPressed : Event()
object TabsTrayRecentlyClosedPressed : Event()
object ProgressiveWebAppOpenFromHomescreenTap : Event() object ProgressiveWebAppOpenFromHomescreenTap : Event()
object ProgressiveWebAppInstallAsShortcut : Event() object ProgressiveWebAppInstallAsShortcut : Event()

@ -683,6 +683,9 @@ private val Event.wrapper: EventWrapper<*>?
is Event.TabsTrayCloseAllTabsPressed -> EventWrapper<NoExtraKeys>( is Event.TabsTrayCloseAllTabsPressed -> EventWrapper<NoExtraKeys>(
{ TabsTray.closeAllTabs.record(it) } { TabsTray.closeAllTabs.record(it) }
) )
is Event.TabsTrayRecentlyClosedPressed -> EventWrapper<NoExtraKeys>(
{ TabsTray.inactiveTabsRecentlyClosed.record(it) }
)
is Event.AutoPlaySettingVisited -> EventWrapper<NoExtraKeys>( is Event.AutoPlaySettingVisited -> EventWrapper<NoExtraKeys>(
{ Autoplay.visitedSetting.record(it) } { Autoplay.visitedSetting.record(it) }
) )

@ -174,6 +174,8 @@ class DefaultTabsTrayController(
dismissTray() dismissTray()
navController.navigate(R.id.recentlyClosedFragment) navController.navigate(R.id.recentlyClosedFragment)
metrics.track(Event.TabsTrayRecentlyClosedPressed)
} }
/** /**

@ -249,6 +249,10 @@ class GleanMetricsServiceTest {
assertFalse(TabsTray.closeAllTabs.testHasValue()) assertFalse(TabsTray.closeAllTabs.testHasValue())
gleanService.track(Event.TabsTrayCloseAllTabsPressed) gleanService.track(Event.TabsTrayCloseAllTabsPressed)
assertTrue(TabsTray.closeAllTabs.testHasValue()) assertTrue(TabsTray.closeAllTabs.testHasValue())
assertFalse(TabsTray.inactiveTabsRecentlyClosed.testHasValue())
gleanService.track(Event.TabsTrayRecentlyClosedPressed)
assertTrue(TabsTray.inactiveTabsRecentlyClosed.testHasValue())
} }
@Test @Test

Loading…
Cancel
Save