diff --git a/app/metrics.yaml b/app/metrics.yaml index 5b7e4b72b7..8776af862f 100644 --- a/app/metrics.yaml +++ b/app/metrics.yaml @@ -468,6 +468,39 @@ events: notification_emails: - android-probes@mozilla.com expires: never + browser_toolbar_qr_scan_tapped: + type: event + description: | + An event that indicates that a user has tapped + QR scan button on browser toolbar. + bugs: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1862096 + data_reviews: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1862096 + data_sensitivity: + - interaction + notification_emails: + - android-probes@mozilla.com + expires: never + metadata: + tags: + - Toolbar + toolbar_tab_swipe: + type: event + description: | + A user swiped the toolbar to change the current tab. + bugs: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1862096 + data_reviews: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1862096 + data_sensitivity: + - interaction + notification_emails: + - android-probes@mozilla.com + expires: never + metadata: + tags: + - Toolbar tab_view_changed: type: event description: | diff --git a/app/src/main/java/org/mozilla/fenix/browser/ToolbarGestureHandler.kt b/app/src/main/java/org/mozilla/fenix/browser/ToolbarGestureHandler.kt index 98fd214832..f809d9f2c3 100644 --- a/app/src/main/java/org/mozilla/fenix/browser/ToolbarGestureHandler.kt +++ b/app/src/main/java/org/mozilla/fenix/browser/ToolbarGestureHandler.kt @@ -25,6 +25,8 @@ import mozilla.components.feature.tabs.TabsUseCases import mozilla.components.support.ktx.android.view.getRectWithViewLocation import mozilla.components.support.utils.ext.bottom import mozilla.components.support.utils.ext.mandatorySystemGestureInsets +import mozilla.telemetry.glean.private.NoExtras +import org.mozilla.fenix.GleanMetrics.Events import org.mozilla.fenix.R import org.mozilla.fenix.ext.getRectWithScreenLocation import org.mozilla.fenix.ext.getWindowInsets @@ -260,6 +262,7 @@ class ToolbarGestureHandler( object : AnimatorListenerAdapter() { override fun onAnimationEnd(animation: Animator) { tabPreview.isVisible = false + Events.toolbarTabSwipe.record(NoExtras()) } }, ) diff --git a/app/src/main/java/org/mozilla/fenix/home/HomeMenuView.kt b/app/src/main/java/org/mozilla/fenix/home/HomeMenuView.kt index 81c28352ec..6a2dfedf79 100644 --- a/app/src/main/java/org/mozilla/fenix/home/HomeMenuView.kt +++ b/app/src/main/java/org/mozilla/fenix/home/HomeMenuView.kt @@ -76,6 +76,18 @@ class HomeMenuView( ThemeManager.resolveAttribute(R.attr.textPrimary, context), ), ) + + menuButton.get()?.register( + object : mozilla.components.concept.menu.MenuButton.Observer { + override fun onShow() { + // MenuButton used in [HomeMenuView] doesn't emit toolbar facts. + // A wrapper is responsible for that, but we are using the button + // directly, hence recording the event directly. + // Should investigate further: https://bugzilla.mozilla.org/show_bug.cgi?id=1868207 + Events.toolbarMenuVisible.record(NoExtras()) + } + }, + ) } /** diff --git a/app/src/main/java/org/mozilla/fenix/search/SearchDialogFragment.kt b/app/src/main/java/org/mozilla/fenix/search/SearchDialogFragment.kt index 82181df204..84d527b1b5 100644 --- a/app/src/main/java/org/mozilla/fenix/search/SearchDialogFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/search/SearchDialogFragment.kt @@ -74,6 +74,7 @@ import mozilla.components.ui.autocomplete.InlineAutocompleteEditText import mozilla.components.ui.widgets.withCenterAlignedButtons import org.mozilla.fenix.BrowserDirection import org.mozilla.fenix.GleanMetrics.Awesomebar +import org.mozilla.fenix.GleanMetrics.Events import org.mozilla.fenix.GleanMetrics.VoiceSearch import org.mozilla.fenix.HomeActivity import org.mozilla.fenix.R @@ -863,6 +864,8 @@ class SearchDialogFragment : AppCompatDialogFragment(), UserInteractionHandler { return } + Events.browserToolbarQrScanTapped.record(NoExtras()) + view?.hideKeyboard() toolbarView.view.clearFocus()