From 8b8fb4f00d48363e42faf497fad20dd852eeb8f5 Mon Sep 17 00:00:00 2001 From: Mickey Moz <33347735+MickeyMoz@users.noreply.github.com> Date: Thu, 4 Nov 2021 03:05:43 +0100 Subject: [PATCH 01/35] Update Android Components version to 96.0.20211103143130. (#22297) Co-authored-by: Ryan VanderMeulen --- buildSrc/src/main/java/AndroidComponents.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/java/AndroidComponents.kt b/buildSrc/src/main/java/AndroidComponents.kt index 905da6889e..e554eaec1d 100644 --- a/buildSrc/src/main/java/AndroidComponents.kt +++ b/buildSrc/src/main/java/AndroidComponents.kt @@ -3,5 +3,5 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ object AndroidComponents { - const val VERSION = "96.0.20211102173221" + const val VERSION = "96.0.20211103143130" } From 76bb0c3b3795097e138e78bd84caf3f74fcff35f Mon Sep 17 00:00:00 2001 From: Christian Sadilek Date: Wed, 3 Nov 2021 15:58:42 -0400 Subject: [PATCH 02/35] Closes #21659: Add SERPs to history search groups --- .../HistoryMetadataMiddleware.kt | 60 ++++++++++-------- .../HistoryMetadataMiddlewareTest.kt | 61 +++++++++++++++++-- 2 files changed, 91 insertions(+), 30 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/historymetadata/HistoryMetadataMiddleware.kt b/app/src/main/java/org/mozilla/fenix/historymetadata/HistoryMetadataMiddleware.kt index f24d576e06..ee5e791f10 100644 --- a/app/src/main/java/org/mozilla/fenix/historymetadata/HistoryMetadataMiddleware.kt +++ b/app/src/main/java/org/mozilla/fenix/historymetadata/HistoryMetadataMiddleware.kt @@ -14,6 +14,7 @@ import mozilla.components.browser.state.selector.findNormalTab import mozilla.components.browser.state.selector.findTab import mozilla.components.browser.state.selector.selectedNormalTab import mozilla.components.browser.state.state.BrowserState +import mozilla.components.browser.state.state.SearchState import mozilla.components.browser.state.state.TabSessionState import mozilla.components.feature.search.ext.parseSearchTerms import mozilla.components.lib.state.Middleware @@ -141,40 +142,48 @@ class HistoryMetadataMiddleware( } } - private fun createHistoryMetadata(context: MiddlewareContext, tab: TabSessionState) { + @Suppress("ComplexMethod") + private fun createHistoryMetadata( + context: MiddlewareContext, + tab: TabSessionState + ) { val tabParent = tab.getParent(context.store) val previousUrlIndex = tab.content.history.currentIndex - 1 val tabMetadataHasSearchTerms = !tab.historyMetadata?.searchTerm.isNullOrBlank() // Obtain search terms and referrer url either from tab parent, from the history stack, or // from the tab itself. - // At a high level, there are two main cases here - 1) either the tab was opened as a 'new tab' - // via the search results page, or 2) a page was opened in the same tab as the search results page. - // Details about the New Tab case: - // - we obtain search terms via tab's parent (the search results page) - // - however, it's possible that parent changed (e.g. user navigated away from the search - // results page). - // - our approach below is to capture search terms from the parent within the tab.historyMetadata - // state on the first load of the tab, and then rely on this data for subsequent page loads on that tab. - // - this way, once a tab becomes part of the search group, it won't leave this search group - // unless a direct navigation event happens. + // + // At a high level, there are two main cases here: + // 1) The tab was opened as a 'new tab' via the search engine results page (SERP). In this + // case we obtain search terms via the tab's parent (the search results page). However, it's + // possible that the parent changed (e.g. user navigated away from the search results page). + // Our approach below is to capture search terms from the parent within the + // tab.historyMetadata state on the first load of the tab, and then rely on this data for + // subsequent page loads on that tab. This way, once a tab becomes part of the search group, + // it won't leave this group unless a direct navigation event happens. + // + // 2) A page was opened in the same tab as the search results page (navigated to via content). val (searchTerm, referrerUrl) = when { - // Loading page opened in a New Tab for the first time. + // Page was opened in a new tab. Look for search terms in the parent tab. tabParent != null && !tabMetadataHasSearchTerms -> { - val searchTerms = tabParent.content.searchTerms.takeUnless { it.isEmpty() } - ?: context.state.search.parseSearchTerms(tabParent.content.url) + val searchTerms = findSearchTerms(tabParent, context.state.search) searchTerms to tabParent.content.url } - // We only want to inspect the previous url in history if the user navigated via - // web content i.e., they followed a link, not if the user navigated directly via - // toolbar. + // Page was navigated to via content i.e., the user followed a link. Look for search terms in tab history. !directLoadTriggered && previousUrlIndex >= 0 -> { // Once a tab is within the search group, only a direct load event (via the toolbar) can change that. + val previousUrl = tab.content.history.items[previousUrlIndex].uri val (searchTerms, referrerUrl) = if (tabMetadataHasSearchTerms) { - tab.historyMetadata?.searchTerm to tab.historyMetadata?.referrerUrl + tab.historyMetadata?.searchTerm to previousUrl } else { - val previousUrl = tab.content.history.items[previousUrlIndex].uri - context.state.search.parseSearchTerms(previousUrl) to previousUrl + // Find search terms by checking if page is a SERP or a result opened from a SERP + val searchTerms = findSearchTerms(tab, context.state.search) + if (searchTerms != null) { + searchTerms to null + } else { + context.state.search.parseSearchTerms(previousUrl) to previousUrl + } } if (searchTerms != null) { @@ -190,11 +199,8 @@ class HistoryMetadataMiddleware( tabMetadataHasSearchTerms && !(directLoadTriggered && previousUrlIndex >= 0) -> { tab.historyMetadata?.searchTerm to tab.historyMetadata?.referrerUrl } - // We had no search terms, no history stack, and no parent. - // This would be the case for any page loaded directly via the toolbar including - // a search results page itself. For now, the original search results page is not - // part of the search group: https://github.com/mozilla-mobile/fenix/issues/21659. - else -> null to null + // In all other cases (e.g. direct load) find search terms by checking if page is a SERP + else -> findSearchTerms(tab, context.state.search) to null } // Sanity check to make sure we don't record a metadata record referring to itself. @@ -218,4 +224,8 @@ class HistoryMetadataMiddleware( store.state.findTab(it) } } + + private fun findSearchTerms(tab: TabSessionState, searchState: SearchState): String? { + return tab.content.searchTerms.takeUnless { it.isEmpty() } ?: searchState.parseSearchTerms(tab.content.url) + } } diff --git a/app/src/test/java/org/mozilla/fenix/historymetadata/HistoryMetadataMiddlewareTest.kt b/app/src/test/java/org/mozilla/fenix/historymetadata/HistoryMetadataMiddlewareTest.kt index 08ee477982..99123b5450 100644 --- a/app/src/test/java/org/mozilla/fenix/historymetadata/HistoryMetadataMiddlewareTest.kt +++ b/app/src/test/java/org/mozilla/fenix/historymetadata/HistoryMetadataMiddlewareTest.kt @@ -114,6 +114,55 @@ class HistoryMetadataMiddlewareTest { } } + @Test + fun `GIVEN normal tab is a search engine result page WHEN history metadata is recorded THEN search terms are provided`() { + service = TestingMetadataService() + middleware = HistoryMetadataMiddleware(service) + val tab = createTab("about:blank") + store = BrowserStore( + middleware = listOf(middleware) + EngineMiddleware.create(engine = mockk()), + initialState = BrowserState( + tabs = listOf(tab) + ) + ) + setupGoogleSearchEngine() + + val serpUrl = "https://google.com?q=mozilla+website" + store.dispatch(EngineAction.LoadUrlAction(tab.id, serpUrl)).joinBlocking() + store.dispatch(ContentAction.UpdateUrlAction(tab.id, serpUrl)).joinBlocking() + store.dispatch(ContentAction.UpdateHistoryStateAction(tab.id, listOf(HistoryItem("Google Search", serpUrl)), currentIndex = 0)).joinBlocking() + with((service as TestingMetadataService).createdMetadata) { + assertEquals(1, this.count()) + assertEquals("https://google.com?q=mozilla+website", this[0].url) + assertEquals("mozilla website", this[0].searchTerm) + assertNull(this[0].referrerUrl) + } + } + + @Test + fun `GIVEN normal tab navigates to search engine result page WHEN history metadata is recorded THEN search terms are provided`() { + service = TestingMetadataService() + middleware = HistoryMetadataMiddleware(service) + val tab = createTab("https://google.com") + store = BrowserStore( + middleware = listOf(middleware) + EngineMiddleware.create(engine = mockk()), + initialState = BrowserState( + tabs = listOf(tab) + ) + ) + setupGoogleSearchEngine() + + val serpUrl = "https://google.com?q=mozilla+website" + store.dispatch(ContentAction.UpdateUrlAction(tab.id, serpUrl)).joinBlocking() + store.dispatch(ContentAction.UpdateHistoryStateAction(tab.id, listOf(HistoryItem("Google Search", "https://google.com"), HistoryItem("Google Search", serpUrl)), currentIndex = 1)).joinBlocking() + with((service as TestingMetadataService).createdMetadata) { + assertEquals(1, this.count()) + assertEquals("https://google.com?q=mozilla+website", this[0].url) + assertEquals("mozilla website", this[0].searchTerm) + assertNull(this[0].referrerUrl) + } + } + @Test fun `GIVEN tab opened as new tab from a search page WHEN search page navigates away THEN redirecting or navigating in tab retains original search terms`() { service = TestingMetadataService() @@ -132,7 +181,7 @@ class HistoryMetadataMiddlewareTest { with((service as TestingMetadataService).createdMetadata) { assertEquals(2, this.count()) assertEquals("https://google.com?q=mozilla+website", this[0].url) - assertNull(this[0].searchTerm) + assertEquals("mozilla website", this[0].searchTerm) assertNull(this[0].referrerUrl) assertEquals("https://google.com?url=https://mozilla.org", this[1].url) @@ -180,7 +229,7 @@ class HistoryMetadataMiddlewareTest { assertEquals(5, this.count()) assertEquals("https://mozilla.org/manifesto", this[4].url) assertEquals("mozilla website", this[4].searchTerm) - assertEquals("https://google.com?q=mozilla+website", this[4].referrerUrl) + assertEquals("https://mozilla.org", this[4].referrerUrl) } } @@ -202,7 +251,7 @@ class HistoryMetadataMiddlewareTest { with((service as TestingMetadataService).createdMetadata) { assertEquals(2, this.count()) assertEquals("https://google.com?q=mozilla+website", this[0].url) - assertNull(this[0].searchTerm) + assertEquals("mozilla website", this[0].searchTerm) assertNull(this[0].referrerUrl) assertEquals("https://google.com?url=https://mozilla.org", this[1].url) @@ -230,6 +279,7 @@ class HistoryMetadataMiddlewareTest { // Direct load occurs on parent tab. Search terms should be cleared. store.dispatch(EngineAction.LoadUrlAction(parentTab.id, "https://firefox.com")).joinBlocking() + store.dispatch(ContentAction.UpdateSearchTermsAction(parentTab.id, "")).joinBlocking() store.dispatch(ContentAction.UpdateUrlAction(parentTab.id, "https://firefox.com")).joinBlocking() store.dispatch(ContentAction.UpdateHistoryStateAction(parentTab.id, listOf(HistoryItem("Google - mozilla website", "https://google.com?q=mozilla+website"), HistoryItem("Firefox", "https://firefox.com")), 1)).joinBlocking() with((service as TestingMetadataService).createdMetadata) { @@ -258,7 +308,7 @@ class HistoryMetadataMiddlewareTest { with((service as TestingMetadataService).createdMetadata) { assertEquals(2, this.count()) assertEquals("https://google.com?q=mozilla+website", this[0].url) - assertNull(this[0].searchTerm) + assertEquals("mozilla website", this[0].searchTerm) assertNull(this[0].referrerUrl) assertEquals("https://google.com?url=https://mozilla.org", this[1].url) @@ -286,6 +336,7 @@ class HistoryMetadataMiddlewareTest { // Direct load occurs on parent tab. Search terms should be cleared. store.dispatch(EngineAction.OptimizedLoadUrlTriggeredAction(parentTab.id, "https://firefox.com")).joinBlocking() + store.dispatch(ContentAction.UpdateSearchTermsAction(parentTab.id, "")).joinBlocking() store.dispatch(ContentAction.UpdateUrlAction(parentTab.id, "https://firefox.com")).joinBlocking() store.dispatch(ContentAction.UpdateHistoryStateAction(parentTab.id, listOf(HistoryItem("Google - mozilla website", "https://google.com?q=mozilla+website"), HistoryItem("Firefox", "https://firefox.com")), 1)).joinBlocking() with((service as TestingMetadataService).createdMetadata) { @@ -298,7 +349,7 @@ class HistoryMetadataMiddlewareTest { @Test fun `GIVEN normal tab has parent WHEN url is the same THEN nothing happens`() { - val parentTab = createTab("https://mozilla.org", searchTerms = "mozilla website") + val parentTab = createTab("https://mozilla.org") val tab = createTab("https://mozilla.org", parent = parentTab) store.dispatch(TabListAction.AddTabAction(parentTab)).joinBlocking() store.dispatch(TabListAction.AddTabAction(tab)).joinBlocking() From 4f55f16bd772a9516a4f4a3c9975c3e4ab82ee53 Mon Sep 17 00:00:00 2001 From: Elise Richards Date: Wed, 3 Nov 2021 20:54:18 -0700 Subject: [PATCH 03/35] For #21313: Remove expiring/unused metrics for December (#21789) * Remove crash reporter metrics * Remove tab counter menu item probe Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- app/metrics.yaml | 65 ------------------- .../mozilla/fenix/components/metrics/Event.kt | 16 ----- .../components/metrics/GleanMetricsService.kt | 12 ---- .../toolbar/BrowserToolbarController.kt | 11 ---- .../fenix/crashes/CrashReporterController.kt | 8 +-- .../crashes/CrashReporterControllerTest.kt | 19 ++---- 6 files changed, 8 insertions(+), 123 deletions(-) diff --git a/app/metrics.yaml b/app/metrics.yaml index 39c7d8dfbe..4abe2407db 100644 --- a/app/metrics.yaml +++ b/app/metrics.yaml @@ -300,30 +300,6 @@ events: - android-probes@mozilla.com - erichards@mozilla.com expires: never - tab_counter_menu_action: - type: event - description: - A tab counter menu item was tapped - extra_keys: - item: - description: | - A string containing the name of the item the user tapped. These items - are: - - New tab, New private tab, Close tab - bugs: - - https://github.com/mozilla-mobile/fenix/issues/11442 - - https://github.com/mozilla-mobile/fenix/issues/19923 - data_reviews: - - https://github.com/mozilla-mobile/fenix/pull/11533 - - https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877 - - https://github.com/mozilla-mobile/fenix/pull/18143 - - https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789 - data_sensitivity: - - interaction - notification_emails: - - android-probes@mozilla.com - expires: "2021-12-01" synced_tab_opened: type: event description: | @@ -620,47 +596,6 @@ toolbar_settings: - android-probes@mozilla.com expires: "2022-02-01" -crash_reporter: - opened: - type: event - description: | - The crash reporter was displayed - bugs: - - https://github.com/mozilla-mobile/fenix/issues/1040 - - https://github.com/mozilla-mobile/fenix/issues/19923 - data_reviews: - - https://github.com/mozilla-mobile/fenix/pull/1214#issue-264756708 - - https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877 - - https://github.com/mozilla-mobile/fenix/pull/18143 - - https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789 - data_sensitivity: - - interaction - notification_emails: - - android-probes@mozilla.com - expires: "2021-12-01" - closed: - type: event - description: | - The crash reporter was closed - extra_keys: - crash_submitted: - description: | - A boolean that tells us whether or not the user submitted a crash - report - bugs: - - https://github.com/mozilla-mobile/fenix/issues/1040 - - https://github.com/mozilla-mobile/fenix/issues/19923 - data_reviews: - - https://github.com/mozilla-mobile/fenix/pull/1214#issue-264756708 - - https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877 - - https://github.com/mozilla-mobile/fenix/pull/18143 - - https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789 - data_sensitivity: - - interaction - notification_emails: - - android-probes@mozilla.com - expires: "2021-12-01" - context_menu: item_tapped: type: event 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 67240683d0..4505eb3276 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 @@ -14,7 +14,6 @@ import org.mozilla.fenix.GleanMetrics.AppTheme import org.mozilla.fenix.GleanMetrics.Autoplay import org.mozilla.fenix.GleanMetrics.Collections import org.mozilla.fenix.GleanMetrics.ContextMenu -import org.mozilla.fenix.GleanMetrics.CrashReporter import org.mozilla.fenix.GleanMetrics.ErrorPage import org.mozilla.fenix.GleanMetrics.Events import org.mozilla.fenix.GleanMetrics.History @@ -619,14 +618,8 @@ sealed class Event { } } - object CrashReporterOpened : Event() data class AddonInstalled(val addonId: String) : Event() - data class CrashReporterClosed(val crashSubmitted: Boolean) : Event() { - override val extras: Map? - get() = mapOf(CrashReporter.closedKeys.crashSubmitted to crashSubmitted.toString()) - } - data class BrowserMenuItemTapped(val item: Item) : Event() { enum class Item { SETTINGS, HELP, DESKTOP_VIEW_ON, DESKTOP_VIEW_OFF, FIND_IN_PAGE, NEW_TAB, @@ -640,15 +633,6 @@ sealed class Event { get() = mapOf(Events.browserMenuActionKeys.item to item.toString().lowercase(Locale.ROOT)) } - data class TabCounterMenuItemTapped(val item: Item) : Event() { - enum class Item { - NEW_TAB, NEW_PRIVATE_TAB, CLOSE_TAB - } - - override val extras: Map? - get() = mapOf(Events.tabCounterMenuActionKeys.item to item.toString().lowercase(Locale.ROOT)) - } - object AutoPlaySettingVisited : Event() data class AutoPlaySettingChanged(val setting: AutoplaySetting) : Event() { 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 cfd4baa77e..552dc20999 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 @@ -19,7 +19,6 @@ import org.mozilla.fenix.GleanMetrics.BrowserSearch import org.mozilla.fenix.GleanMetrics.Collections import org.mozilla.fenix.GleanMetrics.ContextMenu import org.mozilla.fenix.GleanMetrics.ContextualMenu -import org.mozilla.fenix.GleanMetrics.CrashReporter import org.mozilla.fenix.GleanMetrics.CreditCards import org.mozilla.fenix.GleanMetrics.CustomTab import org.mozilla.fenix.GleanMetrics.CustomizeHome @@ -158,13 +157,6 @@ private val Event.wrapper: EventWrapper<*>? { ContextMenu.itemTapped.record(it) }, { ContextMenu.itemTappedKeys.valueOf(it) } ) - is Event.CrashReporterOpened -> EventWrapper( - { CrashReporter.opened.record(it) } - ) - is Event.CrashReporterClosed -> EventWrapper( - { CrashReporter.closed.record(it) }, - { CrashReporter.closedKeys.valueOf(it) } - ) is Event.BrowserMenuItemTapped -> EventWrapper( { Events.browserMenuAction.record(it) }, { Events.browserMenuActionKeys.valueOf(it) } @@ -544,10 +536,6 @@ private val Event.wrapper: EventWrapper<*>? is Event.VoiceSearchTapped -> EventWrapper( { VoiceSearch.tapped.record(it) } ) - is Event.TabCounterMenuItemTapped -> EventWrapper( - { Events.tabCounterMenuAction.record(it) }, - { Events.tabCounterMenuActionKeys.valueOf(it) } - ) is Event.OnboardingPrivacyNotice -> EventWrapper( { Onboarding.privacyNotice.record(it) } ) diff --git a/app/src/main/java/org/mozilla/fenix/components/toolbar/BrowserToolbarController.kt b/app/src/main/java/org/mozilla/fenix/components/toolbar/BrowserToolbarController.kt index 9e1b84b769..02daa63705 100644 --- a/app/src/main/java/org/mozilla/fenix/components/toolbar/BrowserToolbarController.kt +++ b/app/src/main/java/org/mozilla/fenix/components/toolbar/BrowserToolbarController.kt @@ -126,9 +126,6 @@ class DefaultBrowserToolbarController( override fun handleTabCounterItemInteraction(item: TabCounterMenu.Item) { when (item) { is TabCounterMenu.Item.CloseTab -> { - metrics.track( - Event.TabCounterMenuItemTapped(Event.TabCounterMenuItemTapped.Item.CLOSE_TAB) - ) store.state.selectedTab?.let { // When closing the last tab we must show the undo snackbar in the home fragment if (store.state.getNormalOrPrivateTabs(it.content.private).count() == 1) { @@ -143,20 +140,12 @@ class DefaultBrowserToolbarController( } } is TabCounterMenu.Item.NewTab -> { - metrics.track( - Event.TabCounterMenuItemTapped(Event.TabCounterMenuItemTapped.Item.NEW_TAB) - ) activity.browsingModeManager.mode = BrowsingMode.Normal navController.navigate( BrowserFragmentDirections.actionGlobalHome(focusOnAddressBar = true) ) } is TabCounterMenu.Item.NewPrivateTab -> { - metrics.track( - Event.TabCounterMenuItemTapped( - Event.TabCounterMenuItemTapped.Item.NEW_PRIVATE_TAB - ) - ) activity.browsingModeManager.mode = BrowsingMode.Private navController.navigate( BrowserFragmentDirections.actionGlobalHome(focusOnAddressBar = true) diff --git a/app/src/main/java/org/mozilla/fenix/crashes/CrashReporterController.kt b/app/src/main/java/org/mozilla/fenix/crashes/CrashReporterController.kt index d4cf9b68a3..40dd9baeee 100644 --- a/app/src/main/java/org/mozilla/fenix/crashes/CrashReporterController.kt +++ b/app/src/main/java/org/mozilla/fenix/crashes/CrashReporterController.kt @@ -4,6 +4,7 @@ package org.mozilla.fenix.crashes +import android.util.Log import androidx.navigation.NavController import kotlinx.coroutines.DelicateCoroutinesApi import kotlinx.coroutines.Dispatchers @@ -13,7 +14,6 @@ import kotlinx.coroutines.launch import mozilla.components.lib.crash.Crash import org.mozilla.fenix.R import org.mozilla.fenix.components.Components -import org.mozilla.fenix.components.metrics.Event import org.mozilla.fenix.ext.nav import org.mozilla.fenix.utils.Settings @@ -25,10 +25,6 @@ class CrashReporterController( private val settings: Settings ) { - init { - components.analytics.metrics.track(Event.CrashReporterOpened) - } - /** * Closes the crash reporter fragment and tries to recover the session. * @@ -82,7 +78,7 @@ class CrashReporterController( false } - components.analytics.metrics.track(Event.CrashReporterClosed(didSubmitReport)) + Log.i("Crash Reporter", "Report submitted: $didSubmitReport") return job } } diff --git a/app/src/test/java/org/mozilla/fenix/crashes/CrashReporterControllerTest.kt b/app/src/test/java/org/mozilla/fenix/crashes/CrashReporterControllerTest.kt index 0db2945f95..b75fbf9059 100644 --- a/app/src/test/java/org/mozilla/fenix/crashes/CrashReporterControllerTest.kt +++ b/app/src/test/java/org/mozilla/fenix/crashes/CrashReporterControllerTest.kt @@ -15,7 +15,6 @@ import org.junit.Before import org.junit.Test import org.mozilla.fenix.R import org.mozilla.fenix.components.Components -import org.mozilla.fenix.components.metrics.Event import org.mozilla.fenix.utils.Settings @@ -40,19 +39,11 @@ class CrashReporterControllerTest { every { currentDest.id } returns R.id.crashReporterFragment } - @Test - fun `reports crash reporter opened`() { - CrashReporterController(crash, sessionId, navContoller, components, settings) - - verify { components.analytics.metrics.track(Event.CrashReporterOpened) } - } - @Test fun `handle close and restore tab`() { val controller = CrashReporterController(crash, sessionId, navContoller, components, settings) controller.handleCloseAndRestore(sendCrash = false)?.joinBlocking() - verify { components.analytics.metrics.track(Event.CrashReporterClosed(false)) } verify { components.useCases.sessionUseCases.crashRecovery.invoke() } verify { navContoller.popBackStack() } } @@ -62,7 +53,6 @@ class CrashReporterControllerTest { val controller = CrashReporterController(crash, sessionId, navContoller, components, settings) controller.handleCloseAndRemove(sendCrash = false)?.joinBlocking() - verify { components.analytics.metrics.track(Event.CrashReporterClosed(false)) } verify { components.useCases.tabsUseCases.removeTab(sessionId) } verify { components.useCases.sessionUseCases.crashRecovery.invoke() } verify { @@ -77,7 +67,9 @@ class CrashReporterControllerTest { val controller = CrashReporterController(crash, sessionId, navContoller, components, settings) controller.handleCloseAndRestore(sendCrash = true)?.joinBlocking() - verify { components.analytics.metrics.track(Event.CrashReporterClosed(false)) } + verify(exactly = 0) { + components.analytics.crashReporter.submitReport(crash) + } } @Test @@ -87,7 +79,8 @@ class CrashReporterControllerTest { val controller = CrashReporterController(crash, sessionId, navContoller, components, settings) controller.handleCloseAndRestore(sendCrash = true)?.joinBlocking() - verify { components.analytics.crashReporter.submitReport(crash) } - verify { components.analytics.metrics.track(Event.CrashReporterClosed(true)) } + verify { + components.analytics.crashReporter.submitReport(crash) + } } } From 6296ed939f2e9feed18f7e9284b37aa0985200c6 Mon Sep 17 00:00:00 2001 From: Elise Richards Date: Wed, 3 Nov 2021 21:28:52 -0700 Subject: [PATCH 04/35] For #21313: Renew product telemetry expiring in December (#21316) * For #21313: Product telemetry renewals for December * For #21313: Data review for december product telemetry renewals Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- app/metrics.yaml | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/app/metrics.yaml b/app/metrics.yaml index 4abe2407db..afbec7ed07 100644 --- a/app/metrics.yaml +++ b/app/metrics.yaml @@ -140,11 +140,12 @@ events: - https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877 - https://github.com/mozilla-mobile/fenix/pull/18143 - https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789 + - https://github.com/mozilla-mobile/fenix/pull/21316#issuecomment-944615938 data_sensitivity: - interaction notification_emails: - android-probes@mozilla.com - expires: "2021-12-01" + expires: "2022-12-01" default_browser_changed: type: event description: | @@ -270,11 +271,12 @@ events: - https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877 - https://github.com/mozilla-mobile/fenix/pull/18143 - https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789 + - https://github.com/mozilla-mobile/fenix/pull/21316#issuecomment-944615938 data_sensitivity: - interaction notification_emails: - android-probes@mozilla.com - expires: "2021-12-01" + expires: "2022-12-01" opened_link: type: event description: | @@ -363,11 +365,12 @@ events: data_reviews: - https://github.com/mozilla-mobile/fenix/pull/19936 - https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789 + - https://github.com/mozilla-mobile/fenix/pull/21316#issuecomment-944615938 data_sensitivity: - interaction notification_emails: - android-probes@mozilla.com - expires: "2021-12-10" + expires: "2022-12-10" tab_view_changed: type: event description: | @@ -2095,11 +2098,12 @@ custom_tab: - https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877 - https://github.com/mozilla-mobile/fenix/pull/18143 - https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789 + - https://github.com/mozilla-mobile/fenix/pull/21316#issuecomment-944615938 data_sensitivity: - interaction notification_emails: - android-probes@mozilla.com - expires: "2021-12-01" + expires: "2022-06-01" action_button: type: event description: | @@ -2112,11 +2116,12 @@ custom_tab: - https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877 - https://github.com/mozilla-mobile/fenix/pull/18143 - https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789 + - https://github.com/mozilla-mobile/fenix/pull/21316#issuecomment-944615938 data_sensitivity: - interaction notification_emails: - android-probes@mozilla.com - expires: "2021-12-01" + expires: "2022-06-01" menu: type: event description: | @@ -2129,11 +2134,12 @@ custom_tab: - https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877 - https://github.com/mozilla-mobile/fenix/pull/18143 - https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789 + - https://github.com/mozilla-mobile/fenix/pull/21316#issuecomment-944615938 data_sensitivity: - interaction notification_emails: - android-probes@mozilla.com - expires: "2021-12-01" + expires: "2022-06-01" activation: identifier: @@ -2202,11 +2208,12 @@ error_page: - https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877 - https://github.com/mozilla-mobile/fenix/pull/18143 - https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789 + - https://github.com/mozilla-mobile/fenix/pull/21316#issuecomment-944615938 data_sensitivity: - interaction notification_emails: - android-probes@mozilla.com - expires: "2021-12-01" + expires: "2022-12-01" sync_auth: opened: @@ -4041,11 +4048,12 @@ app_theme: - https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877 - https://github.com/mozilla-mobile/fenix/pull/18143 - https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789 + - https://github.com/mozilla-mobile/fenix/pull/21316#issuecomment-944615938 data_sensitivity: - interaction notification_emails: - android-probes@mozilla.com - expires: "2021-12-01" + expires: "2022-12-01" pocket: pocket_top_site_clicked: @@ -4356,11 +4364,12 @@ addons: - https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877 - https://github.com/mozilla-mobile/fenix/pull/18143 - https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789 + - https://github.com/mozilla-mobile/fenix/pull/21316#issuecomment-944615938 data_sensitivity: - interaction notification_emails: - android-probes@mozilla.com - expires: "2021-12-01" + expires: "2022-08-01" open_addon_in_toolbar_menu: type: event description: | @@ -4377,11 +4386,12 @@ addons: - https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877 - https://github.com/mozilla-mobile/fenix/pull/18143 - https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789 + - https://github.com/mozilla-mobile/fenix/pull/21316#issuecomment-944615938 data_sensitivity: - interaction notification_emails: - android-probes@mozilla.com - expires: "2021-12-01" + expires: "2022-08-01" open_addon_setting: type: event description: | @@ -4477,11 +4487,12 @@ addons: - https://github.com/mozilla-mobile/fenix/pull/13958#issuecomment-676857877 - https://github.com/mozilla-mobile/fenix/pull/18143 - https://github.com/mozilla-mobile/fenix/pull/19924#issuecomment-861423789 + - https://github.com/mozilla-mobile/fenix/pull/21316#issuecomment-944615938 data_sensitivity: - interaction notification_emails: - android-probes@mozilla.com - expires: "2021-12-01" + expires: "2022-08-01" perf.startup: cold_main_app_to_first_frame: From f02ebe165084d7e39aea918a14ca0e4c7e58fe5e Mon Sep 17 00:00:00 2001 From: Michael Comella <759372+mcomella@users.noreply.github.com> Date: Thu, 28 Oct 2021 15:34:32 -0700 Subject: [PATCH 05/35] No issue: change label in perf issue template to `performance` I recently changed the label from `eng:performance` to `performance` so this template also has to be updated. --- .github/ISSUE_TEMPLATE/---performance-issue.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/---performance-issue.md b/.github/ISSUE_TEMPLATE/---performance-issue.md index 5412b99983..11f342660f 100644 --- a/.github/ISSUE_TEMPLATE/---performance-issue.md +++ b/.github/ISSUE_TEMPLATE/---performance-issue.md @@ -2,7 +2,7 @@ name: "⌛ Performance issue" about: Create a performance issue if the app is slow or it uses too much memory, disk space, battery, or network data title: "" -labels: "eng:performance" +labels: "performance" assignees: '' --- From ed8f2c0bc3d1de6dae19c612fc5f852904cdaaf7 Mon Sep 17 00:00:00 2001 From: Michael Comella Date: Tue, 26 Oct 2021 15:00:39 -0700 Subject: [PATCH 06/35] For #22177: rename RootLinearLayout -> HomeActivityRoot... This is so we can be more specific with the detail text in our markers. --- .../{RootLinearLayout.kt => HomeActivityRootLinearLayout.kt} | 5 +++-- app/src/main/res/layout/activity_home.xml | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) rename app/src/main/java/org/mozilla/fenix/perf/{RootLinearLayout.kt => HomeActivityRootLinearLayout.kt} (83%) diff --git a/app/src/main/java/org/mozilla/fenix/perf/RootLinearLayout.kt b/app/src/main/java/org/mozilla/fenix/perf/HomeActivityRootLinearLayout.kt similarity index 83% rename from app/src/main/java/org/mozilla/fenix/perf/RootLinearLayout.kt rename to app/src/main/java/org/mozilla/fenix/perf/HomeActivityRootLinearLayout.kt index 4fd31c66e2..c015a17989 100644 --- a/app/src/main/java/org/mozilla/fenix/perf/RootLinearLayout.kt +++ b/app/src/main/java/org/mozilla/fenix/perf/HomeActivityRootLinearLayout.kt @@ -8,14 +8,15 @@ import android.content.Context import android.util.AttributeSet import android.widget.LinearLayout import mozilla.components.concept.base.profiler.Profiler +import org.mozilla.fenix.HomeActivity private const val DETAIL_TEXT = "RootLinearLayout" /** * A [LinearLayout] that adds profiler markers for various methods. This is intended to be used on - * the root view of the view hierarchy to understand global measure/layout events. + * the root view of [HomeActivity]'s view hierarchy to understand global measure/layout events. */ -class RootLinearLayout(context: Context, attrs: AttributeSet) : LinearLayout(context, attrs) { +class HomeActivityRootLinearLayout(context: Context, attrs: AttributeSet) : LinearLayout(context, attrs) { var profilerProvider: () -> Profiler? = { null } diff --git a/app/src/main/res/layout/activity_home.xml b/app/src/main/res/layout/activity_home.xml index c881efbb49..b91ab497c9 100644 --- a/app/src/main/res/layout/activity_home.xml +++ b/app/src/main/res/layout/activity_home.xml @@ -1,7 +1,7 @@ - - + From bc6d8be9c10b07696921f560c474daed15e891a8 Mon Sep 17 00:00:00 2001 From: Michael Comella Date: Tue, 26 Oct 2021 15:09:12 -0700 Subject: [PATCH 07/35] For #22177: change onMeasure/onLayout markers into a single track + draw. When you want to look at one of these markers, you usually want to look at all three so I found that having them on a single track was easier to follow. Since they run in sequence, they should never overlap and that should minimize confusion. --- .../java/org/mozilla/fenix/HomeActivity.kt | 1 - .../perf/HomeActivityRootLinearLayout.kt | 22 ++++++++++++++----- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/HomeActivity.kt b/app/src/main/java/org/mozilla/fenix/HomeActivity.kt index 058e989d06..c05f9a07ce 100644 --- a/app/src/main/java/org/mozilla/fenix/HomeActivity.kt +++ b/app/src/main/java/org/mozilla/fenix/HomeActivity.kt @@ -213,7 +213,6 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity { binding = ActivityHomeBinding.inflate(layoutInflater) setContentView(binding.root) - binding.root.profilerProvider = { components.core.engine.profiler } ProfilerMarkers.addListenerForOnGlobalLayout(components.core.engine, this, binding.root) // Must be after we set the content view diff --git a/app/src/main/java/org/mozilla/fenix/perf/HomeActivityRootLinearLayout.kt b/app/src/main/java/org/mozilla/fenix/perf/HomeActivityRootLinearLayout.kt index c015a17989..c62617b8f1 100644 --- a/app/src/main/java/org/mozilla/fenix/perf/HomeActivityRootLinearLayout.kt +++ b/app/src/main/java/org/mozilla/fenix/perf/HomeActivityRootLinearLayout.kt @@ -5,12 +5,14 @@ package org.mozilla.fenix.perf import android.content.Context +import android.graphics.Canvas import android.util.AttributeSet import android.widget.LinearLayout import mozilla.components.concept.base.profiler.Profiler import org.mozilla.fenix.HomeActivity +import org.mozilla.fenix.ext.components -private const val DETAIL_TEXT = "RootLinearLayout" +private const val MARKER_NAME = "Measure, Layout, Draw" /** * A [LinearLayout] that adds profiler markers for various methods. This is intended to be used on @@ -18,17 +20,25 @@ private const val DETAIL_TEXT = "RootLinearLayout" */ class HomeActivityRootLinearLayout(context: Context, attrs: AttributeSet) : LinearLayout(context, attrs) { - var profilerProvider: () -> Profiler? = { null } + private val profiler: Profiler? = context.components.core.engine.profiler override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { - val profilerStartTime = profilerProvider.invoke()?.getProfilerTime() + val profilerStartTime = profiler?.getProfilerTime() super.onMeasure(widthMeasureSpec, heightMeasureSpec) - profilerProvider.invoke()?.addMarker("onMeasure", profilerStartTime, DETAIL_TEXT) + profiler?.addMarker(MARKER_NAME, profilerStartTime, "onMeasure (HomeActivity root)") } override fun onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int) { - val profilerStartTime = profilerProvider.invoke()?.getProfilerTime() + val profilerStartTime = profiler?.getProfilerTime() super.onLayout(changed, l, t, r, b) - profilerProvider.invoke()?.addMarker("onLayout", profilerStartTime, DETAIL_TEXT) + profiler?.addMarker(MARKER_NAME, profilerStartTime, "onLayout (HomeActivity root)") + } + + override fun dispatchDraw(canvas: Canvas?) { + // We instrument dispatchDraw, for drawing children, because LinearLayout never draws itself, + // i.e. it never calls onDraw or draw. + val profilerStartTime = profiler?.getProfilerTime() + super.dispatchDraw(canvas) + profiler?.addMarker(MARKER_NAME, profilerStartTime, "dispatchDraw (HomeActivity root)") } } From 7d67b84a92c35c39366bd4f43d2d1f0296b9d7b7 Mon Sep 17 00:00:00 2001 From: Michael Comella Date: Tue, 26 Oct 2021 15:16:06 -0700 Subject: [PATCH 08/35] For #22177: add SearchDialogFragmentConstraintLayout; has markers. Here's a profile with these changes: https://share.firefox.dev/3vTpZha --- .../perf/HomeActivityRootLinearLayout.kt | 9 ++-- .../org/mozilla/fenix/perf/ProfilerMarkers.kt | 2 + .../SearchDialogFragmentConstraintLayout.kt | 43 +++++++++++++++++++ .../res/layout/fragment_search_dialog.xml | 4 +- 4 files changed, 51 insertions(+), 7 deletions(-) create mode 100644 app/src/main/java/org/mozilla/fenix/perf/SearchDialogFragmentConstraintLayout.kt diff --git a/app/src/main/java/org/mozilla/fenix/perf/HomeActivityRootLinearLayout.kt b/app/src/main/java/org/mozilla/fenix/perf/HomeActivityRootLinearLayout.kt index c62617b8f1..f3a6ad49bf 100644 --- a/app/src/main/java/org/mozilla/fenix/perf/HomeActivityRootLinearLayout.kt +++ b/app/src/main/java/org/mozilla/fenix/perf/HomeActivityRootLinearLayout.kt @@ -11,8 +11,7 @@ import android.widget.LinearLayout import mozilla.components.concept.base.profiler.Profiler import org.mozilla.fenix.HomeActivity import org.mozilla.fenix.ext.components - -private const val MARKER_NAME = "Measure, Layout, Draw" +import org.mozilla.fenix.perf.ProfilerMarkers.MEASURE_LAYOUT_DRAW_MARKER_NAME /** * A [LinearLayout] that adds profiler markers for various methods. This is intended to be used on @@ -25,13 +24,13 @@ class HomeActivityRootLinearLayout(context: Context, attrs: AttributeSet) : Line override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { val profilerStartTime = profiler?.getProfilerTime() super.onMeasure(widthMeasureSpec, heightMeasureSpec) - profiler?.addMarker(MARKER_NAME, profilerStartTime, "onMeasure (HomeActivity root)") + profiler?.addMarker(MEASURE_LAYOUT_DRAW_MARKER_NAME, profilerStartTime, "onMeasure (HomeActivity root)") } override fun onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int) { val profilerStartTime = profiler?.getProfilerTime() super.onLayout(changed, l, t, r, b) - profiler?.addMarker(MARKER_NAME, profilerStartTime, "onLayout (HomeActivity root)") + profiler?.addMarker(MEASURE_LAYOUT_DRAW_MARKER_NAME, profilerStartTime, "onLayout (HomeActivity root)") } override fun dispatchDraw(canvas: Canvas?) { @@ -39,6 +38,6 @@ class HomeActivityRootLinearLayout(context: Context, attrs: AttributeSet) : Line // i.e. it never calls onDraw or draw. val profilerStartTime = profiler?.getProfilerTime() super.dispatchDraw(canvas) - profiler?.addMarker(MARKER_NAME, profilerStartTime, "dispatchDraw (HomeActivity root)") + profiler?.addMarker(MEASURE_LAYOUT_DRAW_MARKER_NAME, profilerStartTime, "dispatchDraw (HomeActivity root)") } } diff --git a/app/src/main/java/org/mozilla/fenix/perf/ProfilerMarkers.kt b/app/src/main/java/org/mozilla/fenix/perf/ProfilerMarkers.kt index 6b2f4ec1e3..013e9362d5 100644 --- a/app/src/main/java/org/mozilla/fenix/perf/ProfilerMarkers.kt +++ b/app/src/main/java/org/mozilla/fenix/perf/ProfilerMarkers.kt @@ -18,6 +18,8 @@ import mozilla.components.concept.engine.Engine */ object ProfilerMarkers { + const val MEASURE_LAYOUT_DRAW_MARKER_NAME = "Measure, Layout, Draw" + fun addListenerForOnGlobalLayout(engine: Engine, activity: Activity, rootView: View) { // We define the listener in a non-anonymous class to avoid memory leaks with the activity. val listener = MarkerGlobalLayoutListener(engine, activity::class.simpleName ?: "null") diff --git a/app/src/main/java/org/mozilla/fenix/perf/SearchDialogFragmentConstraintLayout.kt b/app/src/main/java/org/mozilla/fenix/perf/SearchDialogFragmentConstraintLayout.kt new file mode 100644 index 0000000000..3ef89b40f5 --- /dev/null +++ b/app/src/main/java/org/mozilla/fenix/perf/SearchDialogFragmentConstraintLayout.kt @@ -0,0 +1,43 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +package org.mozilla.fenix.perf + +import android.content.Context +import android.graphics.Canvas +import android.util.AttributeSet +import androidx.constraintlayout.widget.ConstraintLayout +import mozilla.components.concept.base.profiler.Profiler +import org.mozilla.fenix.ext.components +import org.mozilla.fenix.perf.ProfilerMarkers.MEASURE_LAYOUT_DRAW_MARKER_NAME +import org.mozilla.fenix.search.SearchDialogFragment + +/** + * Adds markers for measure/layout/draw to the root layout of [SearchDialogFragment]. + */ +class SearchDialogFragmentConstraintLayout(context: Context, attrs: AttributeSet) : ConstraintLayout(context, attrs) { + + private val profiler: Profiler? = context.components.core.engine.profiler + + override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { + val profilerStartTime = profiler?.getProfilerTime() + super.onMeasure(widthMeasureSpec, heightMeasureSpec) + profiler?.addMarker(MEASURE_LAYOUT_DRAW_MARKER_NAME, profilerStartTime, "onMeasure (SearchDialogFragment root)") + } + + override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) { + val profilerStartTime = profiler?.getProfilerTime() + super.onLayout(changed, left, top, right, bottom) + profiler?.addMarker(MEASURE_LAYOUT_DRAW_MARKER_NAME, profilerStartTime, "onLayout (SearchDialogFragment root)") + } + + override fun draw(canvas: Canvas?) { + // We instrument draw, rather than onDraw or dispatchDraw, because ConstraintLayout's draw includes + // both of the other methods. If we want to track how long it takes to draw the children, + // we'd get more information by instrumenting them individually. + val profilerStartTime = profiler?.getProfilerTime() + super.draw(canvas) + profiler?.addMarker(MEASURE_LAYOUT_DRAW_MARKER_NAME, profilerStartTime, "draw (SearchDialogFragment root)") + } +} diff --git a/app/src/main/res/layout/fragment_search_dialog.xml b/app/src/main/res/layout/fragment_search_dialog.xml index aa8c8a2d40..d4747c157d 100644 --- a/app/src/main/res/layout/fragment_search_dialog.xml +++ b/app/src/main/res/layout/fragment_search_dialog.xml @@ -2,7 +2,7 @@ - - + From ed0389abe35218462911d0bb1f18f38cf65209ad Mon Sep 17 00:00:00 2001 From: Mozilla L10n Automation Bot Date: Thu, 4 Nov 2021 00:04:44 +0000 Subject: [PATCH 09/35] Import l10n. --- app/src/main/res/values-cy/strings.xml | 4 +-- app/src/main/res/values-iw/strings.xml | 2 +- app/src/main/res/values-pa-rIN/strings.xml | 29 ++++++++++++++-------- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/app/src/main/res/values-cy/strings.xml b/app/src/main/res/values-cy/strings.xml index 55bd9dcc42..e814d1ae77 100644 --- a/app/src/main/res/values-cy/strings.xml +++ b/app/src/main/res/values-cy/strings.xml @@ -1102,7 +1102,7 @@ Dewislen casgliadau - Casglwch y pethau sydd o bwys i chi.\nCrynhowch ynghyd chwiliadau, gwefannau a thabiau tebyg i gael mynediad cyflym yn hwyrach. + Casglwch y pethau sydd o bwys i chi.\nCasglwch ynghyd chwiliadau, gwefannau a thabiau tebyg i gael mynediad cyflym yn nes ymlaen. Dewis Tabiau @@ -1431,7 +1431,7 @@ Fodd bynnag, gall fod yn llai sefydlog. Llwythwch ein porwr Beta i gael profiad - Dewis eich thema + Dewiswch eich thema Arbedwch ychydig o fatri a’ch golwg trwy alluogi’r modd tywyll. diff --git a/app/src/main/res/values-iw/strings.xml b/app/src/main/res/values-iw/strings.xml index 417ea82a79..edb80866de 100644 --- a/app/src/main/res/values-iw/strings.xml +++ b/app/src/main/res/values-iw/strings.xml @@ -192,7 +192,7 @@ ספרייה - אתר למחשבים שולחניים + אתר למחשבים הוספה למסך הבית diff --git a/app/src/main/res/values-pa-rIN/strings.xml b/app/src/main/res/values-pa-rIN/strings.xml index 8e3b02e04f..c0fe69b6e3 100644 --- a/app/src/main/res/values-pa-rIN/strings.xml +++ b/app/src/main/res/values-pa-rIN/strings.xml @@ -2021,11 +2021,11 @@ ਸਾਰੀਆਂ ਨਾ-ਸਰਗਰਮ ਟੈਬਾਂ ਬੰਦ ਕਰੋ - ਟੈਬਾਂ %s ਦਿਨਾਂ ਲਈ ਇੱਥੇ ਮੌਜੂਦ ਹੁੰਦੀਆਂ ਹਨ। ਉਸ ਸਮੇਂ ਬਾਅਦ, ਟੈਬਾਂ ਨੂੰ ਆਪਣੇ-ਆਪ ਬੰਦ ਕੀਤਾ ਜਾਵੇਗਾ। + ਟੈਬਾਂ %s ਦਿਨਾਂ ਲਈ ਇੱਥੇ ਮੌਜੂਦ ਹੁੰਦੀਆਂ ਹਨ। ਉਸ ਸਮੇਂ ਬਾਅਦ, ਟੈਬਾਂ ਨੂੰ ਆਪਣੇ-ਆਪ ਬੰਦ ਕੀਤਾ ਜਾਵੇਗਾ। - 30 ਦਿਨ + 30 ਦਿਨ - 1 ਹਫ਼ਤਾ + 1 ਹਫ਼ਤਾ @@ -2040,19 +2040,28 @@ - ਸੁਧਾਰ ਕਰਨ ਲਈ ਸਾਡੀ ਮਦਦ ਕਰੋ + ਸੁਧਾਰ ਕਰਨ ਲਈ ਸਾਡੀ ਮਦਦ ਕਰੋ + + Firefox ਸੁਧਾਰਨ ਲਈ ਮਦਦ + - ਤੁਸੀਂ ਨਾ-ਸਰਗਰਮ ਟੈਬਾਂ ਨੂੰ ਅਸਮਰੱਥ ਕਿਉਂ ਕੀਤਾ ਸੀ? + ਤੁਸੀਂ ਨਾ-ਸਰਗਰਮ ਟੈਬਾਂ ਨੂੰ ਅਸਮਰੱਥ ਕਿਉਂ ਕੀਤਾ ਸੀ? + + ਮੈਨੂੰ ਸਮਝ ਨਹੀਂ ਆਈ ਕਿ ਇਹ ਕਿਵੇਂ ਕਰਦਾ ਹੈ + + ਮੈਂ ਆਪਣੀਆਂ ਪੁਰਾਣੀਆਂ ਟੈਬਾਂ ਖੁਦ ਸਾਫ਼ ਕਰਨੀਆਂ ਹਨ + + ਨਾ-ਸਰਗਰਮੀ ਲਈ ਸਮਾਂ ਬਹੁਤ ਜ਼ਿਆਦਾ ਹੈ - ਫ਼ੀਚਰ ਵਿੱਚ ਦਿਲਚਸਪੀ ਨਹੀਂ ਹੈ + ਦੋ ਹਫ਼ਤੇ ਦਾ ਸਮਾਂ ਬਹੁਤ ਜ਼ਿਆਦਾ ਹੈ - ਨਾ-ਸਰਗਰਮੀ ਲਈ ਸਮਾਂ ਬਹੁਤ ਜ਼ਿਆਦਾ ਹੈ + ਨਾ-ਸਰਗਰਮੀ ਲਈ ਸਮਾਂ ਬਹੁਤ ਘੱਟ ਹੈ - ਨਾ-ਸਰਗਰਮੀ ਲਈ ਸਮਾਂ ਬਹੁਤ ਘੱਟ ਹੈ + ਦੋ ਹਫ਼ਤੇ ਦਾ ਸਮਾਂ ਬਹੁਤ ਘੱਟ ਹੈ - ਭੇਜੋ + ਭੇਜੋ - ਬੰਦ ਕਰੋ + ਬੰਦ ਕਰੋ ਵੈੱਬਸਾਈਟਾਂ, ਈਮੇਲਾਂ ਅਤੇ ਸੁਨੇਹਿਆਂ ਨੂੰ Firefox ਵਿੱਚ ਆਪਣੇ ਖੋਲ੍ਹਣ ਲਈ ਲਿੰਕ ਸੈੱਟ ਕਰੋ। From 4d88c521ac321efc3894e412e8ec2639b747bb76 Mon Sep 17 00:00:00 2001 From: Oana Horvath Date: Thu, 4 Nov 2021 16:11:03 +0200 Subject: [PATCH 10/35] For #22304 & #22256: Disabled failing visitedUrlHistoryTest & editCustomSearchEngineTest tests --- app/src/androidTest/java/org/mozilla/fenix/ui/HistoryTest.kt | 2 ++ app/src/androidTest/java/org/mozilla/fenix/ui/SmokeTest.kt | 1 + 2 files changed, 3 insertions(+) diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/HistoryTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/HistoryTest.kt index 094080b47b..704fb8a2ec 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/HistoryTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/HistoryTest.kt @@ -13,6 +13,7 @@ import mozilla.components.browser.storage.sync.PlacesHistoryStorage import okhttp3.mockwebserver.MockWebServer import org.junit.After import org.junit.Before +import org.junit.Ignore import org.junit.Rule import org.junit.Test import org.mozilla.fenix.R @@ -78,6 +79,7 @@ class HistoryTest { } } + @Ignore("Failing, see https://github.com/mozilla-mobile/fenix/issues/22304") @Test // Test running on beta/release builds in CI: // caution when making changes to it, so they don't block the builds diff --git a/app/src/androidTest/java/org/mozilla/fenix/ui/SmokeTest.kt b/app/src/androidTest/java/org/mozilla/fenix/ui/SmokeTest.kt index f4ac2968dc..d024f75c04 100644 --- a/app/src/androidTest/java/org/mozilla/fenix/ui/SmokeTest.kt +++ b/app/src/androidTest/java/org/mozilla/fenix/ui/SmokeTest.kt @@ -548,6 +548,7 @@ class SmokeTest { } } + @Ignore("Failing intermittently https://github.com/mozilla-mobile/fenix/issues/22256") @Test // Verifies setting as default a customized search engine name and URL fun editCustomSearchEngineTest() { From 294997e5595f3ac0c2afc1a2c01f13d11ab49092 Mon Sep 17 00:00:00 2001 From: Grisha Kruglov Date: Thu, 4 Nov 2021 00:06:55 -0700 Subject: [PATCH 11/35] No issue: history view search group missing Our boundary conditions for matching search groups to visits was wrong. This change switches the boundary buffer to only be applied to history items, not the metadata items. In other words, when checking if any of the metadata items match the current "page" of history, we'll be looking to see if the item falls within this time window: buffer - oldest history item <= metadata item <= newest history item + buffer There's a separate problem with buffer though: it's reset to 0 when requested offset is >0, but that requires a larger refactor of this code, for a separate PR. --- .../history/PagedHistoryProvider.kt | 4 +- .../history/PagedHistoryProviderTest.kt | 146 ++++++++++++++++++ 2 files changed, 148 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/components/history/PagedHistoryProvider.kt b/app/src/main/java/org/mozilla/fenix/components/history/PagedHistoryProvider.kt index 7069fecc1c..eb78ff0915 100644 --- a/app/src/main/java/org/mozilla/fenix/components/history/PagedHistoryProvider.kt +++ b/app/src/main/java/org/mozilla/fenix/components/history/PagedHistoryProvider.kt @@ -156,8 +156,8 @@ class DefaultPagedHistoryProvider( val historyGroupsInOffset = if (history.isNotEmpty()) { historyGroups?.filter { it.items.any { item -> - history.last().visitedAt <= item.visitedAt - visitedAtBuffer && - item.visitedAt - visitedAtBuffer <= (history.first().visitedAt + visitedAtBuffer) + (history.last().visitedAt - visitedAtBuffer) <= item.visitedAt && + item.visitedAt <= (history.first().visitedAt + visitedAtBuffer) } } ?: emptyList() } else { diff --git a/app/src/test/java/org/mozilla/fenix/components/history/PagedHistoryProviderTest.kt b/app/src/test/java/org/mozilla/fenix/components/history/PagedHistoryProviderTest.kt index 32a041c154..5b04b16b39 100644 --- a/app/src/test/java/org/mozilla/fenix/components/history/PagedHistoryProviderTest.kt +++ b/app/src/test/java/org/mozilla/fenix/components/history/PagedHistoryProviderTest.kt @@ -146,4 +146,150 @@ class PagedHistoryProviderTest { ) assertEquals(results, actualResults) } + + @Test + fun `history metadata matching lower bound`() { + val provider = DefaultPagedHistoryProvider( + historyStorage = storage, + showHistorySearchGroups = true + ) + // Oldest history visit on the page is 15 seconds (buffer time) newer than matching + // metadata record. + val visitInfo1 = VisitInfo( + url = "http://www.mozilla.com", + title = "mozilla", + visitTime = 25000, + visitType = VisitType.LINK, + previewImageUrl = null + ) + + val historyMetadataKey1 = HistoryMetadataKey("http://www.mozilla.com", "mozilla", null) + val historyEntry1 = HistoryMetadata( + key = historyMetadataKey1, + title = "mozilla", + createdAt = 10000, + updatedAt = 10, + totalViewTime = 10, + documentType = DocumentType.Regular, + previewImageUrl = null + ) + + coEvery { storage.getVisitsPaginated(any(), any(), any()) } returns listOf(visitInfo1) + coEvery { storage.getHistoryMetadataSince(any()) } returns listOf(historyEntry1) + + var actualResults: List? = null + provider.getHistory(0L, 5) { + actualResults = it + } + + coVerify { + storage.getVisitsPaginated( + offset = 0L, + count = 5, + excludeTypes = listOf( + VisitType.NOT_A_VISIT, + VisitType.DOWNLOAD, + VisitType.REDIRECT_TEMPORARY, + VisitType.RELOAD, + VisitType.EMBED, + VisitType.FRAMED_LINK, + VisitType.REDIRECT_PERMANENT + ) + ) + } + + val results = listOf( + History.Group( + id = historyEntry1.createdAt.toInt(), + title = historyEntry1.key.searchTerm!!, + visitedAt = historyEntry1.createdAt, + // Results are de-duped by URL and sorted descending by createdAt/visitedAt + items = listOf( + History.Metadata( + id = historyEntry1.createdAt.toInt(), + title = historyEntry1.title!!, + url = historyEntry1.key.url, + visitedAt = historyEntry1.createdAt, + totalViewTime = historyEntry1.totalViewTime, + historyMetadataKey = historyMetadataKey1 + ) + ) + ) + ) + + assertEquals(results, actualResults) + } + + @Test + fun `history metadata matching upper bound`() { + val provider = DefaultPagedHistoryProvider( + historyStorage = storage, + showHistorySearchGroups = true + ) + // Newest history visit on the page is 15 seconds (buffer time) older than matching + // metadata record. + val visitInfo1 = VisitInfo( + url = "http://www.mozilla.com", + title = "mozilla", + visitTime = 10000, + visitType = VisitType.LINK, + previewImageUrl = null + ) + + val historyMetadataKey1 = HistoryMetadataKey("http://www.mozilla.com", "mozilla", null) + val historyEntry1 = HistoryMetadata( + key = historyMetadataKey1, + title = "mozilla", + createdAt = 25000, + updatedAt = 10, + totalViewTime = 10, + documentType = DocumentType.Regular, + previewImageUrl = null + ) + + coEvery { storage.getVisitsPaginated(any(), any(), any()) } returns listOf(visitInfo1) + coEvery { storage.getHistoryMetadataSince(any()) } returns listOf(historyEntry1) + + var actualResults: List? = null + provider.getHistory(0L, 5) { + actualResults = it + } + + coVerify { + storage.getVisitsPaginated( + offset = 0L, + count = 5, + excludeTypes = listOf( + VisitType.NOT_A_VISIT, + VisitType.DOWNLOAD, + VisitType.REDIRECT_TEMPORARY, + VisitType.RELOAD, + VisitType.EMBED, + VisitType.FRAMED_LINK, + VisitType.REDIRECT_PERMANENT + ) + ) + } + + val results = listOf( + History.Group( + id = historyEntry1.createdAt.toInt(), + title = historyEntry1.key.searchTerm!!, + visitedAt = historyEntry1.createdAt, + // Results are de-duped by URL and sorted descending by createdAt/visitedAt + items = listOf( + History.Metadata( + id = historyEntry1.createdAt.toInt(), + title = historyEntry1.title!!, + url = historyEntry1.key.url, + visitedAt = historyEntry1.createdAt, + totalViewTime = historyEntry1.totalViewTime, + historyMetadataKey = historyMetadataKey1 + ) + ) + ) + ) + + assertEquals(results, actualResults) + } } From f8adaae5cae6c88b4513d4823cb5aed9017087a1 Mon Sep 17 00:00:00 2001 From: MickeyMoz Date: Thu, 4 Nov 2021 16:46:43 +0000 Subject: [PATCH 12/35] Update Android Components version to 96.0.20211104143116. --- buildSrc/src/main/java/AndroidComponents.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/java/AndroidComponents.kt b/buildSrc/src/main/java/AndroidComponents.kt index e554eaec1d..ffc6fd3825 100644 --- a/buildSrc/src/main/java/AndroidComponents.kt +++ b/buildSrc/src/main/java/AndroidComponents.kt @@ -3,5 +3,5 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ object AndroidComponents { - const val VERSION = "96.0.20211103143130" + const val VERSION = "96.0.20211104143116" } From 04618983aa744c3f9c0ccb4c400926323b1fdb00 Mon Sep 17 00:00:00 2001 From: Roger Yang Date: Wed, 3 Nov 2021 17:11:11 -0400 Subject: [PATCH 13/35] Close #22299: Add history search term group telemetry --- app/metrics.yaml | 14 +++++++++++++- .../org/mozilla/fenix/components/metrics/Event.kt | 1 + .../components/metrics/GleanMetricsService.kt | 3 +++ .../fenix/library/history/HistoryController.kt | 1 + .../components/metrics/GleanMetricsServiceTest.kt | 4 ++++ .../components/metrics/MetricControllerTest.kt | 12 ++++++++++++ 6 files changed, 34 insertions(+), 1 deletion(-) diff --git a/app/metrics.yaml b/app/metrics.yaml index afbec7ed07..f5b0d141b7 100644 --- a/app/metrics.yaml +++ b/app/metrics.yaml @@ -2639,7 +2639,19 @@ history: notification_emails: - android-probes@mozilla.com expires: "2022-11-01" - + search_term_group_tapped: + type: event + description: | + A user tapped on a search term group in history + bugs: + - https://github.com/mozilla-mobile/fenix/issues/22299 + data_reviews: + - https://github.com/mozilla-mobile/fenix/pull/22300 + data_sensitivity: + - interaction + notification_emails: + - android-probes@mozilla.com + expires: "2022-11-01" reader_mode: available: 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 4505eb3276..b4c23e9baf 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 @@ -85,6 +85,7 @@ sealed class Event { data class HistoryRecentSearchesTapped(val source: String) : Event() { override val extras = mapOf(History.recentSearchesTappedKeys.pageNumber to source) } + object HistorySearchTermGroupTapped : Event() object ReaderModeAvailable : Event() object ReaderModeOpened : Event() object ReaderModeClosed : Event() 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 552dc20999..b9f3e322f4 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 @@ -312,6 +312,9 @@ private val Event.wrapper: EventWrapper<*>? { History.recentSearchesTapped.record(it) }, { History.recentSearchesTappedKeys.valueOf(it) } ) + is Event.HistorySearchTermGroupTapped -> EventWrapper( + { History.searchTermGroupTapped.record(it) } + ) is Event.CollectionRenamed -> EventWrapper( { Collections.renamed.record(it) } ) diff --git a/app/src/main/java/org/mozilla/fenix/library/history/HistoryController.kt b/app/src/main/java/org/mozilla/fenix/library/history/HistoryController.kt index 5586a75042..ce01fa96fc 100644 --- a/app/src/main/java/org/mozilla/fenix/library/history/HistoryController.kt +++ b/app/src/main/java/org/mozilla/fenix/library/history/HistoryController.kt @@ -42,6 +42,7 @@ class DefaultHistoryController( when (item) { is History.Regular -> openToBrowser(item) is History.Group -> { + metrics.track(Event.HistorySearchTermGroupTapped) navController.navigate( HistoryFragmentDirections.actionGlobalHistoryMetadataGroup( title = item.title, diff --git a/app/src/test/java/org/mozilla/fenix/components/metrics/GleanMetricsServiceTest.kt b/app/src/test/java/org/mozilla/fenix/components/metrics/GleanMetricsServiceTest.kt index cec73b5feb..fd65d15759 100644 --- a/app/src/test/java/org/mozilla/fenix/components/metrics/GleanMetricsServiceTest.kt +++ b/app/src/test/java/org/mozilla/fenix/components/metrics/GleanMetricsServiceTest.kt @@ -176,6 +176,10 @@ class GleanMetricsServiceTest { val events = History.recentSearchesTapped.testGetValue() assertEquals(1, events[0].extra!!.size) assertEquals("5", events[0].extra!!["page_number"]) + + assertFalse(History.searchTermGroupTapped.testHasValue()) + gleanService.track(Event.HistorySearchTermGroupTapped) + assertTrue(History.searchTermGroupTapped.testHasValue()) } @Test diff --git a/app/src/test/java/org/mozilla/fenix/components/metrics/MetricControllerTest.kt b/app/src/test/java/org/mozilla/fenix/components/metrics/MetricControllerTest.kt index a03f7a014e..0144cf81ca 100644 --- a/app/src/test/java/org/mozilla/fenix/components/metrics/MetricControllerTest.kt +++ b/app/src/test/java/org/mozilla/fenix/components/metrics/MetricControllerTest.kt @@ -333,6 +333,10 @@ class MetricControllerTest { every { marketingService1.shouldTrack(Event.HistoryOpenedInNewTabs) } returns true every { marketingService1.shouldTrack(Event.HistoryOpenedInPrivateTab) } returns true every { marketingService1.shouldTrack(Event.HistoryOpenedInPrivateTabs) } returns true + every { marketingService1.shouldTrack(Event.HistoryItemRemoved) } returns true + every { marketingService1.shouldTrack(Event.HistoryAllItemsRemoved) } returns true + every { marketingService1.shouldTrack(Event.HistoryRecentSearchesTapped("2")) } returns true + every { marketingService1.shouldTrack(Event.HistorySearchTermGroupTapped) } returns true controller.start(MetricServiceType.Marketing) @@ -340,11 +344,19 @@ class MetricControllerTest { controller.track(Event.HistoryOpenedInNewTabs) controller.track(Event.HistoryOpenedInPrivateTab) controller.track(Event.HistoryOpenedInPrivateTabs) + controller.track(Event.HistoryItemRemoved) + controller.track(Event.HistoryAllItemsRemoved) + controller.track(Event.HistoryRecentSearchesTapped("2")) + controller.track(Event.HistorySearchTermGroupTapped) verify { marketingService1.track(Event.HistoryOpenedInNewTab) } verify { marketingService1.track(Event.HistoryOpenedInNewTabs) } verify { marketingService1.track(Event.HistoryOpenedInPrivateTab) } verify { marketingService1.track(Event.HistoryOpenedInPrivateTabs) } + verify { marketingService1.track(Event.HistoryItemRemoved) } + verify { marketingService1.track(Event.HistoryAllItemsRemoved) } + verify { marketingService1.track(Event.HistoryRecentSearchesTapped("2")) } + verify { marketingService1.track(Event.HistorySearchTermGroupTapped) } } @Test From 7e66c023637821c0813f956983e3675942f576d6 Mon Sep 17 00:00:00 2001 From: Mozilla L10n Automation Bot Date: Fri, 5 Nov 2021 00:05:56 +0000 Subject: [PATCH 14/35] Import l10n. --- app/src/main/res/values-es/strings.xml | 27 +++++++ app/src/main/res/values-hy-rAM/strings.xml | 93 +++++++++++++++------- 2 files changed, 90 insertions(+), 30 deletions(-) diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 47a11c6886..fb93b67816 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -114,6 +114,12 @@ Descartar + + Desactivar en ajustes + + ¿Cerrar automáticamente después de un mes? + + Firefox puede cerrar pestañas que no has visto durante el último mes. Cerrar @@ -163,6 +169,9 @@ in the Recently visited section --> Eliminar + + Mostrar el botón de todas las exploraciones anteriores + Pestañas abiertas @@ -240,6 +249,8 @@ Personalizar inicio + + Personalizar la página de inicio Pantalla de inicio @@ -287,11 +298,16 @@ Busca directamente desde la barra de direcciones + + + Novedades en Firefox Ahora es más fácil retomar desde donde quedaste. Página de inicio de Firefox personalizada + + Accede a tus pestañas abiertas, marcadores e historial de navegación. Pestañas limpias y organizadas @@ -2018,6 +2034,12 @@ Cierre automático activado + + + Ayúdanos a mejorar + + Ayuda a mejorar Firefox + ¿Por qué desactivaste pestañas inactivas? @@ -2044,6 +2066,11 @@ Cerrar + + + Historias que te hacen reflexionar + + Historias que te hacen reflexionar Historias por tema diff --git a/app/src/main/res/values-hy-rAM/strings.xml b/app/src/main/res/values-hy-rAM/strings.xml index 454bd07961..39cf6941ad 100644 --- a/app/src/main/res/values-hy-rAM/strings.xml +++ b/app/src/main/res/values-hy-rAM/strings.xml @@ -24,7 +24,7 @@ 1 բաց ներդիր: Հպեք՝ փոխարկելու համար: - %1$s բաց ներդիրներ: Հպեք՝ փոխարկելու համար: + %1$s բաց ներդիրներ: Հպեք՝ փոխարկելու համար: Ընտրված է %1$d @@ -108,9 +108,22 @@ Բաց թողնել - Երկու շաբաթ չնայած էջանիշերը տեղափոխվում են այստեղ: + Երկու շաբաթ չնայած էջանիշերը տեղափոխվում են այստեղ: - Անջատել կարգավորումներում + Անջատել կարգավորումներում + + + Ինքնափակե՞լ մեկ ամսից: + + Firefox-ը կարող է փակել ներդիրները, որոնք չեք դիտել վերջին ամսում: + + Փակել + + Միացնել ինքնափակումը + + + Միացնել ինքնափակումը + @@ -120,7 +133,7 @@ Նոր գաղտնի ներդիր - Լավագույն կայքեր + Լավագույն կայքեր @@ -167,7 +180,7 @@ Կանգնեցնել - Էջանիշ + Էջանիշ Խմբագրել Էջանիշը @@ -378,7 +391,9 @@ Ոճ - Տուն + Տուն + + Տնային էջ Ժեստեր @@ -572,7 +587,7 @@ Միացնել համաժամեցումը - Firefox-ում աշխատասեղանի զուգավորման կոդ սկանավորեք + Firefox-ում աշխատասեղանի զուգավորման կոդ սկանավորեք Մուտք գործել @@ -696,15 +711,23 @@ Ինքնափակել բաց ներդիրները - + - Սկսել տնից + Սկսել տնից + + Ողջյունի պատուհան - Չորս ժամ անց + Չորս ժամ անց + + Տնային էջ - Միշտ + Միշտ + + Վերջին ներդիրը - Երբեք + Երբեք + + Տնային էջը չորս ժամ անգործությունից հետո Ձեռքով փակեք @@ -761,13 +784,13 @@ Պահպանել հավաքածուում - Ընտրել + Ընտրել Համօգտագործել ներդիրները Վերջերս փակված ներդիրներ - Վերջին փակվածը + Վերջին փակվածը Հաշվի կարգավորումներ @@ -888,10 +911,6 @@ Այստեղ պատմություն չկա - - Ջնջել ներբեռնումները - - Համոզվա՞ծ եք, որ ցանկանում եք մաքրել ներբեռնումերը: Ներբեռնումները հեռացված են @@ -932,7 +951,7 @@ Էջանիշերի ցանկ - Խմբագրել Էջանիշը + Խմբագրել Էջանիշը Ընտրել պանակ @@ -1963,8 +1982,10 @@ Հասկանալի է + + Ամենաշատ այցելված լավագույն կայքերը - Ցուցադրել ամենաշատ այցելված կայքերը + Ցուցադրել ամենաշատ այցելված կայքերը Ցուցադրել ամենաշատ այցելվող կայքերը @@ -1983,11 +2004,11 @@ Փակել բոլոր անգործուն ներդիրները - Ներդիրներն այստեղ հասանելի են %s: Այդ ժամանակից հետո ներդիրներն ինքնաբար կփակվեն: + Ներդիրներն այստեղ հասանելի են %s: Այդ ժամանակից հետո ներդիրներն ինքնաբար կփակվեն: - 30 օր + 30 օր - 1 շաբաթ + 1 շաբաթ @@ -1997,21 +2018,33 @@ ՄԻԱՑՆԵԼ ԻՆՔՆԱՓԱԿՈՒՄԸ + + Ինքնափակումը միացված է + - Օգնեք մեզ բարելավել + Օգնեք մեզ բարելավել + + Օգնեք բարելավել Firefox-ը + - Ինչու՞ եք անջատել անգործուն ներդիրները: + Ինչու՞ եք անջատել անգործուն ներդիրները: + + Ես չեմ հասկանում, թե ինչպես է դա աշխատում + + Ես ինքս սիրում եմ մաքրել հին ներդիրները + + Անգործունության ժամանակը երկար է - Հետաքրքրված չեմ + Երկշաբաթյա ժամկետը չափազանց երկար է - Անգործունության ժամանակը երկար է + Անգործունության ժամանակը կարճ է - Անգործունության ժամանակը կարճ է + Երկշաբաթյա ժամկետը չափազանց կարճ է - Ուղարկել + Ուղարկել - Փակել + Փակել Կայեք հղումներ կայքերից, էլ. նամակներից և հաղորդագրություններից, որոնք ինքնաբար կերպով կբացվեն Firefox-ում: From 9ae2fb636fb4cc91701cdd96cbf819530f1e2d81 Mon Sep 17 00:00:00 2001 From: MickeyMoz Date: Fri, 5 Nov 2021 15:37:17 +0000 Subject: [PATCH 15/35] Update Android Components version to 96.0.20211105143418. --- buildSrc/src/main/java/AndroidComponents.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/java/AndroidComponents.kt b/buildSrc/src/main/java/AndroidComponents.kt index ffc6fd3825..643504a394 100644 --- a/buildSrc/src/main/java/AndroidComponents.kt +++ b/buildSrc/src/main/java/AndroidComponents.kt @@ -3,5 +3,5 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ object AndroidComponents { - const val VERSION = "96.0.20211104143116" + const val VERSION = "96.0.20211105143418" } From 8c9f0c835a3f36597ed06bce0266f8859b0ffc9c Mon Sep 17 00:00:00 2001 From: Sebastian Kaspari Date: Fri, 5 Nov 2021 13:14:59 +0100 Subject: [PATCH 16/35] Closes #21695: ThreadPenaltyDeathWithIgnoresListener: Ignore stack traces containing InstrumentationHooks class --- .../ThreadPenaltyDeathWithIgnoresListener.kt | 13 +++++++++++- ...readPenaltyDeathWithIgnoresListenerTest.kt | 11 ++++++++++ .../resources/InstrumentationHooksLogcat.txt | 20 +++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 app/src/test/resources/InstrumentationHooksLogcat.txt diff --git a/app/src/main/java/org/mozilla/fenix/perf/ThreadPenaltyDeathWithIgnoresListener.kt b/app/src/main/java/org/mozilla/fenix/perf/ThreadPenaltyDeathWithIgnoresListener.kt index fcc7774b32..87f8da48ec 100644 --- a/app/src/main/java/org/mozilla/fenix/perf/ThreadPenaltyDeathWithIgnoresListener.kt +++ b/app/src/main/java/org/mozilla/fenix/perf/ThreadPenaltyDeathWithIgnoresListener.kt @@ -12,6 +12,7 @@ import mozilla.components.support.base.log.logger.Logger import org.mozilla.fenix.utils.ManufacturerCodes private const val FCQN_EDM_STORAGE_PROVIDER_BASE = "com.android.server.enterprise.storage.EdmStorageProviderBase" +private const val INSTRUMENTED_HOOKS_CLASS = "com.android.tools.deploy.instrument.InstrumentationHooks" /** * A [StrictMode.OnThreadViolationListener] that recreates @@ -45,7 +46,8 @@ class ThreadPenaltyDeathWithIgnoresListener( } private fun shouldViolationBeIgnored(violation: Violation): Boolean = - isSamsungLgEdmStorageProviderStartupViolation(violation) + isSamsungLgEdmStorageProviderStartupViolation(violation) || + containsInstrumentedHooksClass(violation) private fun isSamsungLgEdmStorageProviderStartupViolation(violation: Violation): Boolean { // Root issue: https://github.com/mozilla-mobile/fenix/issues/17920 @@ -70,4 +72,13 @@ class ThreadPenaltyDeathWithIgnoresListener( // issue, we'd catch it on other manufacturers. return violation.stackTrace.any { it.className == FCQN_EDM_STORAGE_PROVIDER_BASE } } + + private fun containsInstrumentedHooksClass(violation: Violation): Boolean { + // See https://github.com/mozilla-mobile/fenix/issues/21695 + // When deploying debug builds from Android Studio then we may hit a DiskReadViolation + // occasionally. There's an upstream fix for this, but the stable version of Android Studio + // still seems to be affected. + // https://cs.android.com/android-studio/platform/tools/base/+/abbbe67087626460e0127d3f5377f9cf896e9941 + return violation.stackTrace.any { it.className == INSTRUMENTED_HOOKS_CLASS } + } } diff --git a/app/src/test/java/org/mozilla/fenix/perf/ThreadPenaltyDeathWithIgnoresListenerTest.kt b/app/src/test/java/org/mozilla/fenix/perf/ThreadPenaltyDeathWithIgnoresListenerTest.kt index f046e406c3..25e54e4181 100644 --- a/app/src/test/java/org/mozilla/fenix/perf/ThreadPenaltyDeathWithIgnoresListenerTest.kt +++ b/app/src/test/java/org/mozilla/fenix/perf/ThreadPenaltyDeathWithIgnoresListenerTest.kt @@ -68,6 +68,14 @@ class ThreadPenaltyDeathWithIgnoresListenerTest { listener.onThreadViolation(violation) } + @Test + fun `WHEN provided the InstrumentationHooks violation THEN it will be ignored and logged`() { + every { violation.stackTrace } returns getInstrumentationHooksStackTrace() + listener.onThreadViolation(violation) + + verify { logger.debug("Ignoring StrictMode ThreadPolicy violation", violation) } + } + @Test fun `WHEN violation is null THEN we don't throw an exception`() { listener.onThreadViolation(null) @@ -75,4 +83,7 @@ class ThreadPenaltyDeathWithIgnoresListenerTest { private fun getEdmStorageProviderStackTrace() = StackTraces.getStackTraceFromLogcat("EdmStorageProviderBaseLogcat.txt") + + private fun getInstrumentationHooksStackTrace() = + StackTraces.getStackTraceFromLogcat("InstrumentationHooksLogcat.txt") } diff --git a/app/src/test/resources/InstrumentationHooksLogcat.txt b/app/src/test/resources/InstrumentationHooksLogcat.txt new file mode 100644 index 0000000000..94d1803654 --- /dev/null +++ b/app/src/test/resources/InstrumentationHooksLogcat.txt @@ -0,0 +1,20 @@ +02-08 10:56:02.185 21990 21990 E AndroidRuntime: at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1659) +02-08 10:56:02.185 21990 21990 E AndroidRuntime: at libcore.io.BlockGuardOs.access(BlockGuardOs.java:74) +02-08 10:56:02.185 21990 21990 E AndroidRuntime: at libcore.io.ForwardingOs.access(ForwardingOs.java:131) +02-08 10:56:02.185 21990 21990 E AndroidRuntime: at android.app.ActivityThread$AndroidOs.access(ActivityThread.java:7719) +02-08 10:56:02.185 21990 21990 E AndroidRuntime: at java.io.UnixFileSystem.checkAccess(UnixFileSystem.java:281) +02-08 10:56:02.185 21990 21990 E AndroidRuntime: at java.io.File.exists(File.java:813) +02-08 10:56:02.185 21990 21990 E AndroidRuntime: at com.android.tools.deploy.instrument.ResourceOverlays.updateLoader(ResourceOverlays.java:73) +02-08 10:56:02.185 21990 21990 E AndroidRuntime: at com.android.tools.deploy.instrument.ResourceOverlays.addResourceOverlays(ResourceOverlays.java:36) +02-08 10:56:02.185 21990 21990 E AndroidRuntime: at com.android.tools.deploy.instrument.InstrumentationHooks.addResourceOverlays(InstrumentationHooks.java:102) +02-08 10:56:02.185 21990 21990 E AndroidRuntime: at android.app.LoadedApk.getResources(LoadedApk.java:1312) +02-08 10:56:02.185 21990 21990 E AndroidRuntime: at android.app.ContextImpl.createAppContext(ContextImpl.java:3011) +02-08 10:56:02.185 21990 21990 E AndroidRuntime: at android.app.ContextImpl.createAppContext(ContextImpl.java:3003) +02-08 10:56:02.185 21990 21990 E AndroidRuntime: at android.app.Service.createServiceBaseContext(Service.java:904) +02-08 10:56:02.185 21990 21990 E AndroidRuntime: at android.app.ActivityThread.handleCreateService(ActivityThread.java:4475) +02-08 10:56:02.185 21990 21990 E AndroidRuntime: at android.app.ActivityThread.access$1700(ActivityThread.java:247) +02-08 10:56:02.185 21990 21990 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2076) +02-08 10:56:02.185 21990 21990 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106) +02-08 10:56:02.185 21990 21990 E AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:201) +02-08 10:56:02.185 21990 21990 E AndroidRuntime: at android.os.Looper.loop(Looper.java:288) +02-08 10:56:02.185 21990 21990 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7842) From 5b889fdb96ff7d441335f50cb15ac855a274c9f1 Mon Sep 17 00:00:00 2001 From: Grisha Kruglov Date: Fri, 5 Nov 2021 14:26:32 -0700 Subject: [PATCH 17/35] For #22342: Make layout constraint for 'recent bookmarks' the same as other sections --- app/src/main/res/layout/recent_bookmarks_header.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/layout/recent_bookmarks_header.xml b/app/src/main/res/layout/recent_bookmarks_header.xml index 92657a243f..0c97c2285f 100644 --- a/app/src/main/res/layout/recent_bookmarks_header.xml +++ b/app/src/main/res/layout/recent_bookmarks_header.xml @@ -23,7 +23,7 @@ android:paddingTop="1dp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toStartOf="@id/showAllBookmarksButton" - app:layout_constraintBottom_toBottomOf="parent" /> + app:layout_constraintTop_toTopOf="parent" /> Date: Wed, 3 Nov 2021 21:45:16 -0700 Subject: [PATCH 18/35] For #21816: Filename in "Open" PDF dialog overflows screen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changing the download file name length to the max allowed by AS (251 char, won’t compile if more; max would be 260 for latest windows versions, but generally it is 255), and changing the UI test to check if the long file name is fully visible. Changing the downloaded dialog layout to properly display really long file names. --- app/src/androidTest/assets/pages/download.html | 2 +- ...OSdpZIwCWGIVM3AZmjFSaiAyZKxJp8G1oZ2md4DBQYy6F1.svg} | 0 .../java/org/mozilla/fenix/helpers/TestAssetHelper.kt | 7 ++++++- .../java/org/mozilla/fenix/ui/DownloadTest.kt | 4 ++-- .../androidTest/java/org/mozilla/fenix/ui/SmokeTest.kt | 2 +- .../java/org/mozilla/fenix/ui/robots/DownloadRobot.kt | 3 +++ app/src/main/res/layout/download_dialog_layout.xml | 10 +++++----- 7 files changed, 18 insertions(+), 10 deletions(-) rename app/src/androidTest/assets/resources/{Globe.svg => tAJwqaWjJsXS8AhzSninBMCfIZbHBGgcc001lx5DIdDwIcfEgQ6vE5Gb5VgAled17DFZ2A7ZDOHA0NpQPHXXFHPSD4wzCkRWiaOorNI574zLtv4Hjiz6O6T7onmUTGgUQ2YQoiQFyrCrPv8ZB9KvmtoRFRVIZh8Pg2a1THrm9gpMoLwP44nDNN5o70USUyVXFxPeTerG9OSdpZIwCWGIVM3AZmjFSaiAyZKxJp8G1oZ2md4DBQYy6F1.svg} (100%) diff --git a/app/src/androidTest/assets/pages/download.html b/app/src/androidTest/assets/pages/download.html index 440a3b0c07..c05677828a 100644 --- a/app/src/androidTest/assets/pages/download.html +++ b/app/src/androidTest/assets/pages/download.html @@ -1,6 +1,6 @@ - Page content: Globe.svg + Page content: tAJwqaWjJsXS8AhzSninBMCfIZbHBGgcc001lx5DIdDwIcfEgQ6vE5Gb5VgAled17DFZ2A7ZDOHA0NpQPHXXFHPSD4wzCkRWiaOorNI574zLtv4Hjiz6O6T7onmUTGgUQ2YQoiQFyrCrPv8ZB9KvmtoRFRVIZh8Pg2a1THrm9gpMoLwP44nDNN5o70USUyVXFxPeTerG9OSdpZIwCWGIVM3AZmjFSaiAyZKxJp8G1oZ2md4DBQYy6F1.svg