From 6f2de0e2bdad3745735a05f74056523263f09320 Mon Sep 17 00:00:00 2001 From: mcarare Date: Wed, 30 Mar 2022 14:57:48 +0300 Subject: [PATCH] For #24210: Remove wrapper from displaying toolbar menu event. --- .../java/org/mozilla/fenix/components/metrics/Event.kt | 1 - .../fenix/components/metrics/GleanMetricsService.kt | 3 --- .../mozilla/fenix/components/metrics/MetricController.kt | 8 +++++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/components/metrics/Event.kt b/app/src/main/java/org/mozilla/fenix/components/metrics/Event.kt index 52ff0ef7ae9d..9b674948a971 100644 --- a/app/src/main/java/org/mozilla/fenix/components/metrics/Event.kt +++ b/app/src/main/java/org/mozilla/fenix/components/metrics/Event.kt @@ -150,7 +150,6 @@ sealed class Event { object OpenedTabSuggestionClicked : Event() // Set default browser experiment metrics - object ToolbarMenuShown : Event() object SetDefaultBrowserToolbarMenuClicked : Event() // Home menu interaction diff --git a/app/src/main/java/org/mozilla/fenix/components/metrics/GleanMetricsService.kt b/app/src/main/java/org/mozilla/fenix/components/metrics/GleanMetricsService.kt index ecdafad7d6f7..aa9a902de32b 100644 --- a/app/src/main/java/org/mozilla/fenix/components/metrics/GleanMetricsService.kt +++ b/app/src/main/java/org/mozilla/fenix/components/metrics/GleanMetricsService.kt @@ -119,9 +119,6 @@ private val Event.wrapper: EventWrapper<*>? is Event.SetDefaultBrowserToolbarMenuClicked -> EventWrapper( { ExperimentsDefaultBrowser.toolbarMenuClicked.record(it) } ) - is Event.ToolbarMenuShown -> EventWrapper( - { Events.toolbarMenuVisible.record(it) } - ) is Event.CustomTabsMenuOpened -> EventWrapper( { CustomTab.menu.record(it) } diff --git a/app/src/main/java/org/mozilla/fenix/components/metrics/MetricController.kt b/app/src/main/java/org/mozilla/fenix/components/metrics/MetricController.kt index 4ea4a98a2888..8ccf701f5ee5 100644 --- a/app/src/main/java/org/mozilla/fenix/components/metrics/MetricController.kt +++ b/app/src/main/java/org/mozilla/fenix/components/metrics/MetricController.kt @@ -35,6 +35,7 @@ import mozilla.components.support.base.facts.Facts import mozilla.components.support.base.log.logger.Logger import mozilla.components.support.webextensions.facts.WebExtensionFacts import org.mozilla.fenix.BuildConfig +import org.mozilla.fenix.GleanMetrics.Events import org.mozilla.fenix.GleanMetrics.LoginDialog import org.mozilla.fenix.GleanMetrics.PerfAwesomebar import org.mozilla.fenix.search.awesomebar.ShortcutsSuggestionProvider @@ -114,6 +115,10 @@ internal class ReleaseMetricController( Component.FEATURE_PROMPTS to LoginDialogFacts.Items.SAVE -> { LoginDialog.saved.record(NoExtras()) } + + Component.BROWSER_TOOLBAR to ToolbarFacts.Items.MENU -> { + Events.toolbarMenuVisible.record(NoExtras()) + } else -> { this.toEvent()?.also { track(it) @@ -204,9 +209,6 @@ internal class ReleaseMetricController( } } - Component.BROWSER_TOOLBAR == component && ToolbarFacts.Items.MENU == item -> { - metadata?.get("customTab")?.let { Event.CustomTabsMenuOpened } ?: Event.ToolbarMenuShown - } Component.BROWSER_MENU == component && BrowserMenuFacts.Items.WEB_EXTENSION_MENU_ITEM == item -> { metadata?.get("id")?.let { Event.AddonsOpenInToolbarMenu(it.toString()) } }