tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 02c08f7939b74e5bea98f2fe425f26127819504e
parent 67be11daa4d7fb2387ec13ff514bf61346742e68
Author: rmalicdem <rmalicdem@mozilla.com>
Date:   Tue,  9 Dec 2025 17:01:00 +0000

Bug 2002636 - Part 2: Add telemetry for toolbar shortcut during startup r=android-reviewers,Roger

Differential Revision: https://phabricator.services.mozilla.com/D274608

Diffstat:
Mmobile/android/fenix/app/metrics.yaml | 40++++++++++++++++++++++++++++++++++++++++
Mmobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt | 5+++++
Mmobile/android/fenix/app/src/test/java/org/mozilla/fenix/FenixApplicationTest.kt | 6++++++
3 files changed, 51 insertions(+), 0 deletions(-)

diff --git a/mobile/android/fenix/app/metrics.yaml b/mobile/android/fenix/app/metrics.yaml @@ -4193,6 +4193,46 @@ preferences: tags: - Toolbar - Settings + toolbar_simple_shortcut: + type: string + description: | + The toolbar shortcut used in simple toolbar. + Possible values are: new_tab, share, bookmark, translate, homepage or back. + send_in_pings: + - metrics + bugs: + - https://bugzilla.mozilla.org/show_bug.cgi?id=2002636 + data_reviews: + - https://phabricator.services.mozilla.com/D274608 + data_sensitivity: + - interaction + notification_emails: + - android-probes@mozilla.com + expires: never + metadata: + tags: + - Toolbar + - Settings + toolbar_expanded_shortcut: + type: string + description: | + The toolbar shortcut used in expanded toolbar. + Possible values are: bookmark, translate, homepage or back. + send_in_pings: + - metrics + bugs: + - https://bugzilla.mozilla.org/show_bug.cgi?id=2002636 + data_reviews: + - https://phabricator.services.mozilla.com/D274608 + data_sensitivity: + - interaction + notification_emails: + - android-probes@mozilla.com + expires: never + metadata: + tags: + - Toolbar + - Settings accessibility_services: type: string_list diff --git a/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt b/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt @@ -947,6 +947,11 @@ open class FenixApplication : LocaleAwareApplication(), Provider { }, ) + if (settings.shouldShowToolbarCustomization) { + toolbarSimpleShortcut.set(settings.toolbarSimpleShortcut) + toolbarExpandedShortcut.set(settings.toolbarExpandedShortcut) + } + enhancedTrackingProtection.set( when { !settings.shouldUseTrackingProtection -> "" diff --git a/mobile/android/fenix/app/src/test/java/org/mozilla/fenix/FenixApplicationTest.kt b/mobile/android/fenix/app/src/test/java/org/mozilla/fenix/FenixApplicationTest.kt @@ -44,6 +44,7 @@ import org.mozilla.fenix.distributions.DistributionProviderChecker import org.mozilla.fenix.distributions.DistributionSettings import org.mozilla.fenix.ext.components import org.mozilla.fenix.helpers.FenixGleanTestRule +import org.mozilla.fenix.settings.ShortcutType import org.mozilla.fenix.settings.doh.DohSettingsProvider import org.mozilla.fenix.settings.doh.ProtectionLevel import org.mozilla.fenix.utils.Settings @@ -146,6 +147,9 @@ class FenixApplicationTest { every { settings.mobileBookmarksSize } returns 5 every { settings.toolbarPosition } returns ToolbarPosition.BOTTOM every { settings.shouldUseExpandedToolbar } returns true + every { settings.shouldShowToolbarCustomization } returns true + every { settings.toolbarSimpleShortcut } returns ShortcutType.SHARE.value + every { settings.toolbarExpandedShortcut } returns ShortcutType.HOMEPAGE.value every { settings.getTabViewPingString() } returns "test" every { settings.getTabTimeoutPingString() } returns "test" every { settings.shouldShowSearchSuggestions } returns true @@ -230,6 +234,8 @@ class FenixApplicationTest { assertEquals(emptyList<String>(), Preferences.syncItems.testGetValue()) assertEquals("fixed_top", Preferences.toolbarPositionSetting.testGetValue()) assertEquals("expanded", Preferences.toolbarModeSetting.testGetValue()) + assertEquals(ShortcutType.SHARE.value, Preferences.toolbarSimpleShortcut.testGetValue()) + assertEquals(ShortcutType.HOMEPAGE.value, Preferences.toolbarExpandedShortcut.testGetValue()) assertEquals("standard", Preferences.enhancedTrackingProtection.testGetValue()) assertEquals(listOf("switch", "touch exploration"), Preferences.accessibilityServices.testGetValue()) assertEquals(true, Preferences.inactiveTabsEnabled.testGetValue())