Skip to content

Commit

Permalink
Bug 1862096 – add toolbar related telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
mike a authored and mergify[bot] committed Dec 5, 2023
1 parent 4e2cf7d commit 75ffacb
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 4 deletions.
4 changes: 2 additions & 2 deletions android-components/components/lib/crash/docs/metrics.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- AUTOGENERATED BY glean_parser v8.1.1. DO NOT EDIT. -->
<!-- AUTOGENERATED BY glean_parser v10.0.3. DO NOT EDIT. -->

# Metrics

Expand Down Expand Up @@ -62,5 +62,5 @@ In addition to those built-in metrics, the following metrics are added to the pi

Data categories are [defined here](https://wiki.mozilla.org/Firefox/Data_Collection).

<!-- AUTOGENERATED BY glean_parser v8.1.1. DO NOT EDIT. -->
<!-- AUTOGENERATED BY glean_parser v10.0.3. DO NOT EDIT. -->

4 changes: 2 additions & 2 deletions android-components/components/service/nimbus/docs/metrics.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- AUTOGENERATED BY glean_parser v8.1.1. DO NOT EDIT. -->
<!-- AUTOGENERATED BY glean_parser v10.0.3. DO NOT EDIT. -->

# Metrics

Expand Down Expand Up @@ -30,5 +30,5 @@ In addition to those built-in metrics, the following metrics are added to the pi

Data categories are [defined here](https://wiki.mozilla.org/Firefox/Data_Collection).

<!-- AUTOGENERATED BY glean_parser v8.1.1. DO NOT EDIT. -->
<!-- AUTOGENERATED BY glean_parser v10.0.3. DO NOT EDIT. -->

33 changes: 33 additions & 0 deletions fenix/app/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,39 @@ events:
notification_emails:
- [email protected]
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:
- [email protected]
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:
- [email protected]
expires: never
metadata:
tags:
- Toolbar
tab_view_changed:
type: event
description: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -260,6 +262,7 @@ class ToolbarGestureHandler(
object : AnimatorListenerAdapter() {
override fun onAnimationEnd(animation: Animator) {
tabPreview.isVisible = false
Events.toolbarTabSwipe.record(NoExtras())
}
},
)
Expand Down
12 changes: 12 additions & 0 deletions fenix/app/src/main/java/org/mozilla/fenix/home/HomeMenuView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
},
)
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -863,6 +864,8 @@ class SearchDialogFragment : AppCompatDialogFragment(), UserInteractionHandler {
return
}

Events.browserToolbarQrScanTapped.record(NoExtras())

view?.hideKeyboard()
toolbarView.view.clearFocus()

Expand Down

0 comments on commit 75ffacb

Please sign in to comment.