Skip to content

Commit aa707e4

Browse files
committed
Merge remote-tracking branch 'firefox-android/fenix/141.0.1' into iceraven
2 parents a9aa70d + d842ffb commit aa707e4

File tree

18 files changed

+482
-116
lines changed

18 files changed

+482
-116
lines changed

app/metrics.yaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,15 @@ events:
162162
A string containing the name of the item the user tapped. These items
163163
include:
164164
add_bookmark, add_to_homescreen, add_to_top_sites, addon_details, addons_manager,
165-
back, back_long_press, bookmark, bookmarks, desktop_view_off,
166-
desktop_view_off_custom_tab, desktop_view_on, desktop_view_on_custom_tab,
167-
discover_more_extensions, dismiss_menu_banner, web_extension_browser_action_clicked,
168-
downloads, edit_bookmark, extensions_learn_more, find_in_page, find_in_page_custom_tab,
169-
forward, forward_long_press, history, install_addon, menu_banner, new_tab, open_in_app,
170-
open_in_fenix, quit, reader_mode_appearance, reload, remove_from_top_sites,
171-
save_to_collection, set_default_browser, settings, share, share_custom_tab, stop,
172-
sync_account, translate and print_content.
165+
back, back_long_press, bookmark, bookmarks, custom_back, custom_back_long_press,
166+
custom_desktop_view_off, custom_desktop_view_on, custom_find_in_page,
167+
custom_forward, custom_forward_long_press, custom_share, desktop_view_off,
168+
desktop_view_on, discover_more_extensions, dismiss_menu_banner, downloads,
169+
edit_bookmark, extensions_learn_more, find_in_page, forward, forward_long_press,
170+
history, install_addon, installed_addon_details, menu_banner, new_tab, open_in_app,
171+
open_in_fenix, print_content, quit, reader_mode_appearance, reload, remove_from_top_sites,
172+
save_to_collection, set_default_browser, settings, share, stop, sync_account,
173+
translate and web_extension_browser_action_clicked.
173174
type: string
174175
bugs:
175176
- https://github.com/mozilla-mobile/fenix/issues/1024

app/nimbus.fml.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ features:
5252
"pocket": true,
5353
"pocket-sponsored-stories": true,
5454
"synced-tabs": true,
55+
"collections": true,
5556
}
5657
defaults:
5758
- channel: nightly
@@ -63,6 +64,7 @@ features:
6364
"recent-explorations": true,
6465
"pocket": true,
6566
"synced-tabs": true,
67+
"collections": true,
6668
}
6769
}
6870
nimbus-validation:
@@ -648,6 +650,14 @@ features:
648650
value:
649651
enabled: true
650652

653+
override-user-specified-homepage-sections:
654+
description: Whether to ignore the user-specified homepage section visibility settings and hide the options in the settings.
655+
variables:
656+
enabled:
657+
description: >
658+
When true, ignore the user-specified homepage section visibility settings, and hide the toggle options in the settings.
659+
type: Boolean
660+
default: false
651661
microsurveys:
652662
description: Feature for microsurveys.
653663
variables:
@@ -931,6 +941,8 @@ types:
931941
description: Subsection of the Pocket homescreen section which shows sponsored stories.
932942
synced-tabs:
933943
description: The synced tabs section of the homepage.
944+
collections:
945+
description: The collections section of the homepage.
934946

935947
MR2022Section:
936948
description: The identifiers for the sections of the MR 2022.

app/src/androidTest/java/org/mozilla/fenix/ui/EnhancedTrackingProtectionTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import androidx.compose.ui.test.junit4.AndroidComposeTestRule
88
import androidx.core.net.toUri
99
import androidx.test.espresso.Espresso.pressBack
1010
import mozilla.components.concept.engine.utils.EngineReleaseChannel
11+
import org.junit.Ignore
1112
import org.junit.Rule
1213
import org.junit.Test
1314
import org.mozilla.fenix.customannotations.SmokeTest
@@ -127,6 +128,7 @@ class EnhancedTrackingProtectionTest : TestSetup() {
127128

128129
// TestRail link: https://mozilla.testrail.io/index.php?/cases/view/339712
129130
// Tests adding ETP exceptions to websites and keeping that preference after restart
131+
@Ignore("Failing: https://bugzilla.mozilla.org/show_bug.cgi?id=1948448")
130132
@SmokeTest
131133
@Test
132134
fun disablingETPOnAWebsiteAddsItToExceptionListTest() {
@@ -193,6 +195,7 @@ class EnhancedTrackingProtectionTest : TestSetup() {
193195

194196
// TestRail link: https://mozilla.testrail.io/index.php?/cases/view/339713
195197
// Tests removing TP exceptions individually or all at once
198+
@Ignore("Failing: https://bugzilla.mozilla.org/show_bug.cgi?id=1977952")
196199
@Test
197200
fun clearWebsitesFromTPExceptionListTest() {
198201
val firstPage = getGenericAsset(mockWebServer, 1)

app/src/androidTest/java/org/mozilla/fenix/ui/HTTPSFirstModeTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package org.mozilla.fenix.ui
66

77
import androidx.compose.ui.test.junit4.AndroidComposeTestRule
88
import androidx.core.net.toUri
9+
import org.junit.Ignore
910
import org.junit.Rule
1011
import org.junit.Test
1112
import org.mozilla.fenix.helpers.HomeActivityIntentTestRule
@@ -22,6 +23,7 @@ class HTTPSFirstModeTest {
2223
@get:Rule
2324
val memoryLeaksRule = DetectMemoryLeaksRule()
2425

26+
@Ignore("Failing: https://bugzilla.mozilla.org/show_bug.cgi?id=1950289")
2527
@Test
2628
fun httpsFirstModeImplicitSchemeTest() {
2729
navigationToolbar {
@@ -32,6 +34,7 @@ class HTTPSFirstModeTest {
3234
}
3335
}
3436

37+
@Ignore("Failing: https://bugzilla.mozilla.org/show_bug.cgi?id=1947969")
3538
@Test
3639
fun httpsFirstModeExplicitSchemeTest() {
3740
navigationToolbar {

app/src/androidTest/java/org/mozilla/fenix/ui/SettingsHTTPSOnlyModeTest.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package org.mozilla.fenix.ui
66

77
import androidx.compose.ui.test.junit4.AndroidComposeTestRule
88
import androidx.core.net.toUri
9+
import org.junit.Ignore
910
import org.junit.Rule
1011
import org.junit.Test
1112
import org.mozilla.fenix.customannotations.SkipLeaks
@@ -71,6 +72,7 @@ class SettingsHTTPSOnlyModeTest : TestSetup() {
7172
}
7273

7374
// TestRail link: https://mozilla.testrail.io/index.php?/cases/view/1724827
75+
@Ignore("Failing: https://bugzilla.mozilla.org/show_bug.cgi?id=1826317")
7476
@SmokeTest
7577
@Test
7678
fun httpsOnlyModeEnabledInNormalBrowsingTest() {
@@ -182,6 +184,7 @@ class SettingsHTTPSOnlyModeTest : TestSetup() {
182184
}
183185

184186
// TestRail link: https://mozilla.testrail.io/index.php?/cases/view/2091058
187+
@Ignore("Failing: https://bugzilla.mozilla.org/show_bug.cgi?id=1941261")
185188
@Test
186189
@SkipLeaks
187190
fun turnOffHttpsOnlyModeTest() {

app/src/main/java/org/mozilla/fenix/browser/BrowserFragment.kt

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -175,56 +175,61 @@ class BrowserFragment : BaseBrowserFragment(), UserInteractionHandler {
175175
}
176176

177177
private fun initTranslationsAction(context: Context, view: View) {
178-
// Do not add translation page action if device doesn't have large window
179-
if (!isLargeWindow()) {
180-
return
181-
}
182-
183178
if (
184179
!FxNimbus.features.translations.value().mainFlowToolbarEnabled
185180
) {
186181
return
187182
}
188183

189-
val translationsAction = Toolbar.ActionButton(
190-
AppCompatResources.getDrawable(
191-
context,
192-
R.drawable.mozac_ic_translate_24,
193-
),
194-
contentDescription = context.getString(R.string.browser_toolbar_translate),
195-
iconTintColorResource = ThemeManager.resolveAttribute(R.attr.textPrimary, context),
196-
visible = { translationsAvailable },
197-
weight = { TRANSLATIONS_WEIGHT },
198-
listener = {
199-
browserToolbarInteractor.onTranslationsButtonClicked()
200-
},
201-
)
202-
(browserToolbarView as BrowserToolbarView).toolbar.addPageAction(translationsAction)
184+
// Do not add translation page action if device doesn't have large window
185+
val translationsAction = if (isLargeWindow()) {
186+
Toolbar.ActionButton(
187+
AppCompatResources.getDrawable(
188+
context,
189+
R.drawable.mozac_ic_translate_24,
190+
),
191+
contentDescription = context.getString(R.string.browser_toolbar_translate),
192+
iconTintColorResource = ThemeManager.resolveAttribute(R.attr.textPrimary, context),
193+
visible = { translationsAvailable },
194+
weight = { TRANSLATIONS_WEIGHT },
195+
listener = {
196+
browserToolbarInteractor.onTranslationsButtonClicked()
197+
},
198+
)
199+
} else {
200+
null
201+
}
202+
203+
translationsAction?.let {
204+
(browserToolbarView as BrowserToolbarView).toolbar.addPageAction(it)
205+
}
203206

204207
translationsBinding.set(
205208
feature = TranslationsBinding(
206209
browserStore = context.components.core.store,
207210
onTranslationStatusUpdate = {
208211
translationsAvailable = it.isTranslationPossible
209212

210-
translationsAction.updateView(
211-
tintColorResource = if (it.isTranslated) {
212-
R.color.fx_mobile_icon_color_accent_violet
213-
} else {
214-
ThemeManager.resolveAttribute(R.attr.textPrimary, context)
215-
},
216-
contentDescription = if (it.isTranslated) {
217-
context.getString(
218-
R.string.browser_toolbar_translated_successfully,
219-
it.fromSelectedLanguage?.localizedDisplayName,
220-
it.toSelectedLanguage?.localizedDisplayName,
221-
)
222-
} else {
223-
context.getString(R.string.browser_toolbar_translate)
224-
},
225-
)
213+
translationsAction?.let { action ->
214+
action.updateView(
215+
tintColorResource = if (it.isTranslated) {
216+
R.color.fx_mobile_icon_color_accent_violet
217+
} else {
218+
ThemeManager.resolveAttribute(R.attr.textPrimary, context)
219+
},
220+
contentDescription = if (it.isTranslated) {
221+
context.getString(
222+
R.string.browser_toolbar_translated_successfully,
223+
it.fromSelectedLanguage?.localizedDisplayName,
224+
it.toSelectedLanguage?.localizedDisplayName,
225+
)
226+
} else {
227+
context.getString(R.string.browser_toolbar_translate)
228+
},
229+
)
226230

227-
safeInvalidateBrowserToolbarView()
231+
safeInvalidateBrowserToolbarView()
232+
}
228233

229234
if (!it.isTranslateProcessing) {
230235
requireComponents.appStore.dispatch(SnackbarAction.SnackbarDismissed)

app/src/main/java/org/mozilla/fenix/components/menu/middleware/MenuTelemetryMiddleware.kt

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,46 @@ class MenuTelemetryMiddleware(
138138
),
139139
)
140140

141+
is MenuAction.Navigate.Back -> Events.browserMenuAction.record(
142+
Events.BrowserMenuActionExtra(
143+
item = when {
144+
action.viewHistory && accessPoint == MenuAccessPoint.External ->
145+
"custom_back_long_press"
146+
action.viewHistory -> "back_long_press"
147+
accessPoint == MenuAccessPoint.External -> "custom_back"
148+
else -> "back"
149+
},
150+
),
151+
)
152+
153+
is MenuAction.Navigate.Forward -> Events.browserMenuAction.record(
154+
Events.BrowserMenuActionExtra(
155+
item = when {
156+
action.viewHistory && accessPoint == MenuAccessPoint.External ->
157+
"custom_forward_long_press"
158+
action.viewHistory -> "forward_long_press"
159+
accessPoint == MenuAccessPoint.External -> "custom_forward"
160+
else -> "forward"
161+
},
162+
),
163+
)
164+
165+
is MenuAction.Navigate.Reload -> Events.browserMenuAction.record(
166+
Events.BrowserMenuActionExtra(
167+
item = "reload",
168+
),
169+
)
170+
171+
is MenuAction.Navigate.Stop -> Events.browserMenuAction.record(
172+
Events.BrowserMenuActionExtra(
173+
item = "stop",
174+
),
175+
)
176+
141177
MenuAction.Navigate.Share -> Events.browserMenuAction.record(
142178
Events.BrowserMenuActionExtra(
143179
item = when (accessPoint) {
144-
MenuAccessPoint.External -> "share_custom_tab"
180+
MenuAccessPoint.External -> "custom_share"
145181
else -> "share"
146182
},
147183
),
@@ -166,7 +202,7 @@ class MenuTelemetryMiddleware(
166202
MenuAction.FindInPage -> Events.browserMenuAction.record(
167203
Events.BrowserMenuActionExtra(
168204
item = when (accessPoint) {
169-
MenuAccessPoint.External -> "find_in_page_custom_tab"
205+
MenuAccessPoint.External -> "custom_find_in_page"
170206
else -> "find_in_page"
171207
},
172208
),
@@ -199,7 +235,7 @@ class MenuTelemetryMiddleware(
199235
is MenuAction.RequestDesktopSite -> Events.browserMenuAction.record(
200236
Events.BrowserMenuActionExtra(
201237
item = when (accessPoint) {
202-
MenuAccessPoint.External -> "desktop_view_on_custom_tab"
238+
MenuAccessPoint.External -> "custom_desktop_view_on"
203239
else -> "desktop_view_on"
204240
},
205241
),
@@ -208,7 +244,7 @@ class MenuTelemetryMiddleware(
208244
is MenuAction.RequestMobileSite -> Events.browserMenuAction.record(
209245
Events.BrowserMenuActionExtra(
210246
item = when (accessPoint) {
211-
MenuAccessPoint.External -> "desktop_view_off_custom_tab"
247+
MenuAccessPoint.External -> "custom_desktop_view_off"
212248
else -> "desktop_view_off"
213249
},
214250
),
@@ -252,6 +288,14 @@ class MenuTelemetryMiddleware(
252288
)
253289
}
254290

291+
is MenuAction.Navigate.InstalledAddonDetails -> {
292+
Events.browserMenuAction.record(
293+
Events.BrowserMenuActionExtra(
294+
item = "installed_addon_details",
295+
),
296+
)
297+
}
298+
255299
is MenuAction.Navigate.WebCompatReporter -> {
256300
Events.browserMenuAction.record(
257301
Events.BrowserMenuActionExtra(
@@ -285,11 +329,6 @@ class MenuTelemetryMiddleware(
285329
is MenuAction.UpdateShowDisabledExtensionsOnboarding,
286330
is MenuAction.UpdateManageExtensionsMenuItemVisibility,
287331
is MenuAction.UpdateAvailableAddons,
288-
is MenuAction.Navigate.Back,
289-
is MenuAction.Navigate.Forward,
290-
is MenuAction.Navigate.Reload,
291-
is MenuAction.Navigate.Stop,
292-
is MenuAction.Navigate.InstalledAddonDetails,
293332
-> Unit
294333
}
295334
}

app/src/main/java/org/mozilla/fenix/components/settings/FeatureFlagPreference.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ private class DummyProperty : ReadWriteProperty<PreferencesHolder, Boolean> {
1717

1818
/**
1919
* Property delegate for getting and setting a boolean shared preference gated by a feature flag.
20+
*
21+
* @param key Key for the shared preference.
22+
* @param default Default value to return.
23+
* @param featureFlag If true, returns the shared preference value. If false, returns false.
2024
*/
2125
fun featureFlagPreference(key: String, default: Boolean, featureFlag: Boolean) =
2226
if (featureFlag) {
@@ -37,6 +41,10 @@ private class LazyPreference(val key: String, val default: () -> Boolean) :
3741

3842
/**
3943
* Property delegate for getting and setting lazily a boolean shared preference gated by a feature flag.
44+
*
45+
* @param key Key for the shared preference.
46+
* @param featureFlag If true, returns the shared preference value. If false, returns false.
47+
* @param default Default value to return.
4048
*/
4149
fun lazyFeatureFlagPreference(key: String, featureFlag: Boolean, default: () -> Boolean) =
4250
if (featureFlag) {

0 commit comments

Comments
 (0)