diff --git a/app/metrics.yaml b/app/metrics.yaml index 60dd4e79f5e6..0f3cad865924 100644 --- a/app/metrics.yaml +++ b/app/metrics.yaml @@ -728,6 +728,34 @@ preferences: notification_emails: - fenix-core@mozilla.com expires: "2020-09-01" + open_links_in_app: + type: string_list + description: > + Whether or not the user has the open links in apps feature enabled. + default: false + send_in_pings: + - metrics + bugs: + - https://github.com/mozilla-mobile/fenix/issues/11118 + data_reviews: + - https://github.com/mozilla-mobile/fenix/pull/TODO + notification_emails: + - fenix-core@mozilla.com + expires: "2020-09-01" + theme: + type: string_list + description: > + The theme the user has enabled. "light," "dark," "system," or "battery" + default: "system" for API 28+, else "light" + send_in_pings: + - metrics + bugs: + - https://github.com/mozilla-mobile/fenix/issues/11118 + data_reviews: + - https://github.com/mozilla-mobile/fenix/pull/TODO + notification_emails: + - fenix-core@mozilla.com + expires: "2020-09-01" search.default_engine: code: 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 277aebd74bc4..f2efb167ae48 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 @@ -603,6 +603,8 @@ class GleanMetricsService(private val context: Context) : MetricsService { showSearchShortcuts.set(context.settings().shouldShowSearchShortcuts.toStringList()) openLinksInAPrivateTab.set(context.settings().openLinksInAPrivateTab.toStringList()) searchSuggestionsPrivate.set(context.settings().shouldShowSearchSuggestionsInPrivate.toStringList()) + showVoiceSearch.set(context.settings().shouldShowVoiceSearch.toStringList()) + openLinksInApp.set(context.settings().openLinksInExternalApp.toStringList()) val isLoggedIn = context.components.backgroundServices.accountManager.accountProfile() != null @@ -614,6 +616,17 @@ class GleanMetricsService(private val context: Context) : MetricsService { syncItems.set(syncedItems) + val toolbarPositionSelection = + if (context.settings().shouldUseFixedTopToolbar) { + "fixed_top" + } else if (context.settings().shouldUseBottomToolbar) { + "bottom" + } else { + "top" + } + + toolbarPosition.set(listOf(toolbarPositionSelection)) + val etpSelection = if (!context.settings().shouldUseTrackingProtection) { "" @@ -638,6 +651,21 @@ class GleanMetricsService(private val context: Context) : MetricsService { } accessibilityServices.set(accessibilitySelection.toList()) + + val themeSelection = + if (context.settings().shouldUseLightTheme) { + "light" + } else if (context.settings().shouldUseDarkTheme) { + "dark" + } else if (context.settings().shouldFollowDeviceTheme) { + "system" + } else if (context.settings().shouldUseAutoBatteryTheme) { + "battery" + } else { + "" + } + + theme.set(listOf(themeSelection)) } Metrics.apply { diff --git a/docs/metrics.md b/docs/metrics.md index 73e9a252dec4..f94e0daa33ca 100644 --- a/docs/metrics.md +++ b/docs/metrics.md @@ -251,6 +251,7 @@ The following metrics are added to the ping: | perf.awesomebar.synced_tabs_suggestions |[timing_distribution](https://mozilla.github.io/glean/book/user/metrics/timing_distribution.html) |Duration of a synced tabs awesomebar suggestion query. |[1](https://github.com/mozilla-mobile/fenix/pull/10276#pullrequestreview-411101979)||2020-09-15 | | preferences.accessibility_services |[string_list](https://mozilla.github.io/glean/book/user/metrics/string_list.html) |Whether or not the user has touch exploration or switch services enabled. These are built into the Android OS, not Fenix prefs. default: "" |[1](https://github.com/mozilla-mobile/fenix/pull/11211)||2020-09-01 | | preferences.open_links_in_a_private_tab |[string_list](https://mozilla.github.io/glean/book/user/metrics/string_list.html) |Whether or not the user has enabled open links in a private tab. default: false |[1](https://github.com/mozilla-mobile/fenix/pull/11211)||2020-09-01 | +| preferences.open_links_in_app |[string_list](https://mozilla.github.io/glean/book/user/metrics/string_list.html) |Whether or not the user has the open links in apps feature enabled. default: false |[1](https://github.com/mozilla-mobile/fenix/pull/TODO)||2020-09-01 | | preferences.remote_debugging |[string_list](https://mozilla.github.io/glean/book/user/metrics/string_list.html) |Whether or not the user has remote debugging enabled default: false |[1](https://github.com/mozilla-mobile/fenix/pull/11211)||2020-09-01 | | preferences.search_bookmarks |[string_list](https://mozilla.github.io/glean/book/user/metrics/string_list.html) |Whether or not the user has enabled bookmark search suggestions default: true |[1](https://github.com/mozilla-mobile/fenix/pull/11211)||2020-09-01 | | preferences.search_browsing_history |[string_list](https://mozilla.github.io/glean/book/user/metrics/string_list.html) |Whether or not the user has enabled browsing history suggestions. default: true |[1](https://github.com/mozilla-mobile/fenix/pull/11211)||2020-09-01 | @@ -262,6 +263,7 @@ The following metrics are added to the ping: | preferences.sync |[string_list](https://mozilla.github.io/glean/book/user/metrics/string_list.html) |Whether or not the user is signed into FxA default: false |[1](https://github.com/mozilla-mobile/fenix/pull/11211)||2020-09-01 | | preferences.sync_items |[string_list](https://mozilla.github.io/glean/book/user/metrics/string_list.html) |The list of items the user has chosen to sync with FxA. default: "" if the user is signed out. Otherwise defaults to whatever is set in their FxA account. New accounts set: [bookmarks, history, passwords, tabs] |[1](https://github.com/mozilla-mobile/fenix/pull/11211)||2020-09-01 | | preferences.telemetry |[string_list](https://mozilla.github.io/glean/book/user/metrics/string_list.html) |Whether or not the user has telemetry enabled. Note we should never receive a "false" value for this since telemetry would not send in that case. default: true |[1](https://github.com/mozilla-mobile/fenix/pull/11211)||2020-09-01 | +| preferences.theme |[string_list](https://mozilla.github.io/glean/book/user/metrics/string_list.html) |The theme the user has enabled. "light," "dark," "system," or "battery" default: "system" for API 28+, else "light" |[1](https://github.com/mozilla-mobile/fenix/pull/TODO)||2020-09-01 | | preferences.toolbar_position |[string_list](https://mozilla.github.io/glean/book/user/metrics/string_list.html) |The position of the toolbar default: bottom (defaults to top if the user has accessibility services) |[1](https://github.com/mozilla-mobile/fenix/pull/11211)||2020-09-01 | | preferences.tracking_protection |[string_list](https://mozilla.github.io/glean/book/user/metrics/string_list.html) |What type of enhanced tracking protection the user has enabled. "standard," "strict," "custom," or "" (if disabled) default: "standard" |[1](https://github.com/mozilla-mobile/fenix/pull/11211)||2020-09-01 | | search.default_engine.code |[string](https://mozilla.github.io/glean/book/user/metrics/string.html) |If the search engine is pre-loaded with Fenix this value will be the search engine identifier. If it's a custom search engine (defined: https://github.com/mozilla-mobile/fenix/issues/1607) the value will be "custom" |[1](https://github.com/mozilla-mobile/fenix/pull/1606), [2](https://github.com/mozilla-mobile/fenix/pull/5216)||2020-09-01 |