Dan Ballard pushed to branch tor-browser-140.0a1-15.0-1 at The Tor Project / Applications / Tor Browser
Commits:
-
4d19dc54
by Beatriz Rizental at 2025-06-17T14:39:17-07:00
-
7d929101
by Beatriz Rizental at 2025-06-17T14:39:17-07:00
-
0235f26b
by Beatriz Rizental at 2025-06-17T14:39:17-07:00
-
d5bc2018
by Beatriz Rizental at 2025-06-17T14:39:17-07:00
19 changed files:
- mobile/android/android-components/components/browser/storage-sync/src/main/java/mozilla/components/browser/storage/sync/RemoteTabsStorage.kt
- mobile/android/android-components/components/concept/sync/src/main/java/mozilla/components/concept/sync/AccountEvent.kt
- mobile/android/android-components/components/service/firefox-accounts/src/main/java/mozilla/components/service/fxa/FxaDeviceConstellation.kt
- mobile/android/android-components/components/service/nimbus/src/main/java/mozilla/components/service/nimbus/messaging/NimbusMessagingController.kt
- mobile/android/android-components/components/service/nimbus/src/main/java/mozilla/components/service/nimbus/messaging/NimbusMessagingStorage.kt
- mobile/android/android-components/plugins/dependencies/src/main/java/ApplicationServices.kt
- mobile/android/fenix/app/nimbus.fml.yaml
- mobile/android/fenix/app/src/main/java/org/mozilla/fenix/FenixApplication.kt
- mobile/android/fenix/app/src/main/java/org/mozilla/fenix/HomeActivity.kt
- mobile/android/fenix/app/src/main/java/org/mozilla/fenix/browser/BrowserFragment.kt
- mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/BackgroundServices.kt
- mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/NimbusComponents.kt
- mobile/android/fenix/app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt
- mobile/android/fenix/app/src/main/java/org/mozilla/fenix/onboarding/FenixOnboarding.kt
- mobile/android/fenix/app/src/main/java/org/mozilla/fenix/onboarding/ReEngagementNotificationWorker.kt
- mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/SettingsFragment.kt
- mobile/android/fenix/app/src/main/java/org/mozilla/fenix/settings/advanced/DefaultLocaleSettingsController.kt
- mobile/android/fenix/app/src/main/java/org/mozilla/fenix/share/SaveToPDFMiddleware.kt
- mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
Changes:
| ... | ... | @@ -161,6 +161,7 @@ class RemoteTabsCommandQueue( |
| 161 | 161 | .groupBy {
|
| 162 | 162 | when (it.command) {
|
| 163 | 163 | is RemoteCommand.CloseTab -> PendingCommandGroup.Key.CloseTab(it.deviceId)
|
| 164 | + is RemoteCommand.__NOOP -> PendingCommandGroup.Key.Noop(it.deviceId)
|
|
| 164 | 165 | // Add `is ... ->` branches for future pending commands here...
|
| 165 | 166 | }.asAnyKey
|
| 166 | 167 | }
|
| ... | ... | @@ -184,6 +185,13 @@ class RemoteTabsCommandQueue( |
| 184 | 185 | pendingCommands = pendingCommands,
|
| 185 | 186 | )
|
| 186 | 187 | }
|
| 188 | + is PendingCommandGroup.Key.Noop -> {
|
|
| 189 | + PendingCommandGroup(
|
|
| 190 | + deviceId = key.deviceId,
|
|
| 191 | + command = DeviceCommandOutgoing.Noop(),
|
|
| 192 | + pendingCommands = pendingCommands,
|
|
| 193 | + )
|
|
| 194 | + }
|
|
| 187 | 195 | // Add `is ... ->` branches for future pending command grouping keys here...
|
| 188 | 196 | }.asAnyGroup
|
| 189 | 197 | }
|
| ... | ... | @@ -279,6 +287,7 @@ class RemoteTabsCommandQueue( |
| 279 | 287 | |
| 280 | 288 | sealed interface Key {
|
| 281 | 289 | data class CloseTab(val deviceId: String) : Key
|
| 290 | + data class Noop(val deviceId: String) : Key
|
|
| 282 | 291 | // Add data classes for future pending command grouping keys here...
|
| 283 | 292 | |
| 284 | 293 | /** Returns this grouping key as a type-erased [Key]. */
|
| ... | ... | @@ -55,6 +55,9 @@ sealed class DeviceCommandIncoming { |
| 55 | 55 | * Outgoing device commands (ie, targeted at other devices.)
|
| 56 | 56 | */
|
| 57 | 57 | sealed class DeviceCommandOutgoing {
|
| 58 | + /** A command to do nothing */
|
|
| 59 | + class Noop() : DeviceCommandOutgoing()
|
|
| 60 | + |
|
| 58 | 61 | /** A command to open a tab on another device */
|
| 59 | 62 | class SendTab(val title: String, val url: String) : DeviceCommandOutgoing()
|
| 60 | 63 |
| ... | ... | @@ -195,8 +195,10 @@ class FxaDeviceConstellation( |
| 195 | 195 | is RustCloseTabsResult.Ok -> Result.success(true)
|
| 196 | 196 | is RustCloseTabsResult.TabsNotClosed ->
|
| 197 | 197 | Result.failure(SendCommandException.TabsNotClosed(closeTabsResult.urls))
|
| 198 | + is RustCloseTabsResult.__NOOP -> Result.success(false)
|
|
| 198 | 199 | }
|
| 199 | 200 | }
|
| 201 | + is DeviceCommandOutgoing.Noop -> Result.success(false)
|
|
| 200 | 202 | }
|
| 201 | 203 | val errors: List<Throwable> = SyncTelemetry.processFxaTelemetry(account.gatherTelemetry())
|
| 202 | 204 | for (error in errors) {
|
| ... | ... | @@ -96,32 +96,32 @@ open class NimbusMessagingController( |
| 96 | 96 | * creates a URI string for the message action.
|
| 97 | 97 | */
|
| 98 | 98 | @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
|
| 99 | - open fun processMessageActionToUri(message: Message): Uri {
|
|
| 99 | + fun processMessageActionToUri(message: Message): Uri {
|
|
| 100 | 100 | val (uuid, action) = messagingStorage.generateUuidAndFormatMessage(message)
|
| 101 | 101 | sendClickedMessageTelemetry(message.id, uuid)
|
| 102 | 102 | |
| 103 | 103 | return convertActionIntoDeepLinkSchemeUri(action)
|
| 104 | 104 | }
|
| 105 | 105 | |
| 106 | - open fun sendDismissedMessageTelemetry(messageId: String) {
|
|
| 106 | + private fun sendDismissedMessageTelemetry(messageId: String) {
|
|
| 107 | 107 | GleanMessaging.messageDismissed.record(GleanMessaging.MessageDismissedExtra(messageId))
|
| 108 | 108 | }
|
| 109 | 109 | |
| 110 | - open fun sendShownMessageTelemetry(messageId: String) {
|
|
| 110 | + private fun sendShownMessageTelemetry(messageId: String) {
|
|
| 111 | 111 | GleanMessaging.messageShown.record(GleanMessaging.MessageShownExtra(messageId))
|
| 112 | 112 | }
|
| 113 | 113 | |
| 114 | - open fun sendExpiredMessageTelemetry(messageId: String) {
|
|
| 114 | + private fun sendExpiredMessageTelemetry(messageId: String) {
|
|
| 115 | 115 | GleanMessaging.messageExpired.record(GleanMessaging.MessageExpiredExtra(messageId))
|
| 116 | 116 | }
|
| 117 | 117 | |
| 118 | - open fun sendClickedMessageTelemetry(messageId: String, uuid: String?) {
|
|
| 118 | + private fun sendClickedMessageTelemetry(messageId: String, uuid: String?) {
|
|
| 119 | 119 | GleanMessaging.messageClicked.record(
|
| 120 | 120 | GleanMessaging.MessageClickedExtra(messageKey = messageId, actionUuid = uuid),
|
| 121 | 121 | )
|
| 122 | 122 | }
|
| 123 | 123 | |
| 124 | - open fun sendMicrosurveyCompletedTelemetry(messageId: String, answer: String) {
|
|
| 124 | + private fun sendMicrosurveyCompletedTelemetry(messageId: String, answer: String) {
|
|
| 125 | 125 | Microsurvey.submitButtonTapped.record(
|
| 126 | 126 | Microsurvey.SubmitButtonTappedExtra(
|
| 127 | 127 | surveyId = messageId,
|
| ... | ... | @@ -130,7 +130,7 @@ open class NimbusMessagingController( |
| 130 | 130 | )
|
| 131 | 131 | }
|
| 132 | 132 | |
| 133 | - open fun convertActionIntoDeepLinkSchemeUri(action: String): Uri =
|
|
| 133 | + private fun convertActionIntoDeepLinkSchemeUri(action: String): Uri =
|
|
| 134 | 134 | if (action.startsWith("://")) {
|
| 135 | 135 | "$deepLinkScheme$action".toUri()
|
| 136 | 136 | } else {
|
| ... | ... | @@ -33,7 +33,7 @@ const val MESSAGING_FEATURE_ID = "messaging" |
| 33 | 33 | /**
|
| 34 | 34 | * Provides messages from [messagingFeature] and combine with the metadata store on [metadataStorage].
|
| 35 | 35 | */
|
| 36 | -open class NimbusMessagingStorage(
|
|
| 36 | +class NimbusMessagingStorage(
|
|
| 37 | 37 | private val context: Context,
|
| 38 | 38 | private val metadataStorage: MessageMetadataStorage,
|
| 39 | 39 | private val onMalformedMessage: (String) -> Unit = {
|
| ... | ... | @@ -3,8 +3,8 @@ |
| 3 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
| 4 | 4 | |
| 5 | 5 | // These lines are generated by android-components/automation/application-services-nightly-bump.py
|
| 6 | -val VERSION = "140.20250523140405"
|
|
| 7 | -val CHANNEL = ApplicationServicesChannel.NIGHTLY
|
|
| 6 | +val VERSION = "140.0-TORBROWSER"
|
|
| 7 | +val CHANNEL = ApplicationServicesChannel.RELEASE
|
|
| 8 | 8 | |
| 9 | 9 | object ApplicationServicesConfig {
|
| 10 | 10 | val version = VERSION
|
| ... | ... | @@ -642,13 +642,13 @@ features: |
| 642 | 642 | defaults:
|
| 643 | 643 | - channel: developer
|
| 644 | 644 | value:
|
| 645 | - enabled: true
|
|
| 645 | + enabled: false
|
|
| 646 | 646 | - channel: nightly
|
| 647 | 647 | value:
|
| 648 | - enabled: true
|
|
| 648 | + enabled: false
|
|
| 649 | 649 | - channel: beta
|
| 650 | 650 | value:
|
| 651 | - enabled: true
|
|
| 651 | + enabled: false
|
|
| 652 | 652 | |
| 653 | 653 | trending-searches:
|
| 654 | 654 | description: Enables trending searches.
|
| ... | ... | @@ -212,7 +212,7 @@ open class FenixApplication : LocaleAwareApplication(), Provider { |
| 212 | 212 | //
|
| 213 | 213 | // We can initialize Nimbus before Glean because Glean will queue messages
|
| 214 | 214 | // before it's initialized.
|
| 215 | - // initializeNimbus()
|
|
| 215 | + initializeNimbus()
|
|
| 216 | 216 | |
| 217 | 217 | ProfilerMarkerFactProcessor.create { components.core.engine.profiler }.register()
|
| 218 | 218 |
| ... | ... | @@ -124,6 +124,7 @@ import org.mozilla.fenix.ext.getNavDirections |
| 124 | 124 | import org.mozilla.fenix.ext.hasTopDestination
|
| 125 | 125 | import org.mozilla.fenix.ext.nav
|
| 126 | 126 | import org.mozilla.fenix.ext.openSetDefaultBrowserOption
|
| 127 | +import org.mozilla.fenix.ext.recordEventInNimbus
|
|
| 127 | 128 | import org.mozilla.fenix.ext.setNavigationIcon
|
| 128 | 129 | import org.mozilla.fenix.ext.settings
|
| 129 | 130 | import org.mozilla.fenix.extension.WebExtensionPromptFeature
|
| ... | ... | @@ -458,7 +459,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity, TorAn |
| 458 | 459 | |
| 459 | 460 | if (!shouldShowOnboarding) {
|
| 460 | 461 | lifecycleScope.launch(IO) {
|
| 461 | - // showFullscreenMessageIfNeeded(applicationContext)
|
|
| 462 | + showFullscreenMessageIfNeeded(applicationContext)
|
|
| 462 | 463 | }
|
| 463 | 464 | |
| 464 | 465 | // Unless the activity is recreated, navigate to home first (without rendering it)
|
| ... | ... | @@ -498,7 +499,7 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity, TorAn |
| 498 | 499 | ),
|
| 499 | 500 | )
|
| 500 | 501 | // This will record an event in Nimbus' internal event store. Used for behavioral targeting
|
| 501 | - // recordEventInNimbus("app_opened")
|
|
| 502 | + recordEventInNimbus("app_opened")
|
|
| 502 | 503 | |
| 503 | 504 | if (safeIntent.action.equals(ACTION_OPEN_PRIVATE_TAB) && source == APP_ICON) {
|
| 504 | 505 | AppIcon.newPrivateTabTapped.record(NoExtras())
|
| ... | ... | @@ -1549,12 +1550,10 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity, TorAn |
| 1549 | 1550 | keyDismissButtonText = null,
|
| 1550 | 1551 | )
|
| 1551 | 1552 | |
| 1552 | - /*
|
|
| 1553 | 1553 | researchSurfaceDialogFragment.onAccept = {
|
| 1554 | 1554 | processIntent(messaging.getIntentForMessage(nextMessage))
|
| 1555 | 1555 | components.appStore.dispatch(AppAction.MessagingAction.MessageClicked(nextMessage))
|
| 1556 | 1556 | }
|
| 1557 | - */
|
|
| 1558 | 1557 | |
| 1559 | 1558 | researchSurfaceDialogFragment.onDismiss = {
|
| 1560 | 1559 | components.appStore.dispatch(AppAction.MessagingAction.MessageDismissed(nextMessage))
|
| ... | ... | @@ -1567,10 +1566,10 @@ open class HomeActivity : LocaleAwareAppCompatActivity(), NavHostActivity, TorAn |
| 1567 | 1566 | )
|
| 1568 | 1567 | }
|
| 1569 | 1568 | |
| 1570 | -// // Update message as displayed.
|
|
| 1571 | -// val currentBootUniqueIdentifier = BootUtils.getBootIdentifier(context)
|
|
| 1572 | -//
|
|
| 1573 | -// messaging.onMessageDisplayed(nextMessage, currentBootUniqueIdentifier)
|
|
| 1569 | + // Update message as displayed.
|
|
| 1570 | + val currentBootUniqueIdentifier = BootUtils.getBootIdentifier(context)
|
|
| 1571 | + |
|
| 1572 | + messaging.onMessageDisplayed(nextMessage, currentBootUniqueIdentifier)
|
|
| 1574 | 1573 | }
|
| 1575 | 1574 | |
| 1576 | 1575 | private fun showCrashReporter() {
|
| ... | ... | @@ -598,7 +598,7 @@ class BrowserFragment : BaseBrowserFragment(), UserInteractionHandler { |
| 598 | 598 | |
| 599 | 599 | override fun navToQuickSettingsSheet(tab: SessionState, sitePermissions: SitePermissions?) {
|
| 600 | 600 | val useCase = requireComponents.useCases.trackingProtectionUseCases
|
| 601 | - // FxNimbus.features.cookieBanners.recordExposure()
|
|
| 601 | + FxNimbus.features.cookieBanners.recordExposure()
|
|
| 602 | 602 | useCase.containsException(tab.id) { hasTrackingProtectionException ->
|
| 603 | 603 | lifecycleScope.launch {
|
| 604 | 604 | val cookieBannersStorage = requireComponents.core.cookieBannersStorage
|
| ... | ... | @@ -49,6 +49,7 @@ import org.mozilla.fenix.GleanMetrics.SyncAuth |
| 49 | 49 | import org.mozilla.fenix.R
|
| 50 | 50 | import org.mozilla.fenix.ext.components
|
| 51 | 51 | import org.mozilla.fenix.ext.maxActiveTime
|
| 52 | +import org.mozilla.fenix.ext.recordEventInNimbus
|
|
| 52 | 53 | import org.mozilla.fenix.ext.settings
|
| 53 | 54 | import org.mozilla.fenix.perf.StrictModeManager
|
| 54 | 55 | import org.mozilla.fenix.perf.lazyMonitored
|
| ... | ... | @@ -266,7 +267,7 @@ internal class TelemetryAccountObserver( |
| 266 | 267 | // User signed-in into an existing FxA account.
|
| 267 | 268 | AuthType.Signin -> {
|
| 268 | 269 | SyncAuth.signIn.record(NoExtras())
|
| 269 | - // context.recordEventInNimbus("sync_auth.sign_in")
|
|
| 270 | + context.recordEventInNimbus("sync_auth.sign_in")
|
|
| 270 | 271 | }
|
| 271 | 272 | |
| 272 | 273 | // User created a new FxA account.
|
| ... | ... | @@ -5,28 +5,17 @@ |
| 5 | 5 | package org.mozilla.fenix.components
|
| 6 | 6 | |
| 7 | 7 | import android.content.Context
|
| 8 | -import android.content.Intent
|
|
| 9 | -import android.net.Uri
|
|
| 10 | 8 | import mozilla.components.service.nimbus.NimbusApi
|
| 11 | -import mozilla.components.service.nimbus.NimbusDisabled
|
|
| 12 | 9 | import mozilla.components.service.nimbus.messaging.FxNimbusMessaging
|
| 13 | -import mozilla.components.service.nimbus.messaging.Message
|
|
| 14 | -import mozilla.components.service.nimbus.messaging.Message.Metadata
|
|
| 15 | -import mozilla.components.service.nimbus.messaging.MessageData
|
|
| 16 | -import mozilla.components.service.nimbus.messaging.MessageMetadataStorage
|
|
| 17 | -import mozilla.components.service.nimbus.messaging.MessageSurfaceId
|
|
| 18 | 10 | import mozilla.components.service.nimbus.messaging.NimbusMessagingController
|
| 19 | 11 | import mozilla.components.service.nimbus.messaging.NimbusMessagingControllerInterface
|
| 20 | 12 | import mozilla.components.service.nimbus.messaging.NimbusMessagingStorage
|
| 21 | 13 | import mozilla.components.service.nimbus.messaging.OnDiskMessageMetadataStorage
|
| 22 | -import mozilla.components.service.nimbus.messaging.StyleData
|
|
| 23 | 14 | import org.mozilla.experiments.nimbus.NimbusEventStore
|
| 24 | 15 | import org.mozilla.experiments.nimbus.NimbusMessagingHelperInterface
|
| 25 | -import org.mozilla.experiments.nimbus.NullNimbus
|
|
| 26 | 16 | import org.mozilla.fenix.BuildConfig
|
| 27 | 17 | import org.mozilla.fenix.experiments.createNimbus
|
| 28 | 18 | import org.mozilla.fenix.messaging.CustomAttributeProvider
|
| 29 | -import org.mozilla.fenix.nimbus.FxNimbus
|
|
| 30 | 19 | import org.mozilla.fenix.perf.lazyMonitored
|
| 31 | 20 | |
| 32 | 21 | /**
|
| ... | ... | @@ -39,14 +28,7 @@ class NimbusComponents(private val context: Context) { |
| 39 | 28 | * should be mediated through a FML generated class, e.g. [FxNimbus].
|
| 40 | 29 | */
|
| 41 | 30 | val sdk: NimbusApi by lazyMonitored {
|
| 42 | - if (BuildConfig.DATA_COLLECTION_DISABLED) {
|
|
| 43 | - NimbusDisabled(context)
|
|
| 44 | - } else {
|
|
| 45 | - createNimbus(context, BuildConfig.NIMBUS_ENDPOINT).also { api ->
|
|
| 46 | - FxNimbus.api = api
|
|
| 47 | - }
|
|
| 48 | - }
|
|
| 49 | - |
|
| 31 | + createNimbus(context, BuildConfig.NIMBUS_ENDPOINT)
|
|
| 50 | 32 | }
|
| 51 | 33 | |
| 52 | 34 | /**
|
| ... | ... | @@ -62,8 +44,7 @@ class NimbusComponents(private val context: Context) { |
| 62 | 44 | * the JEXL helper available from [createJexlHelper].
|
| 63 | 45 | */
|
| 64 | 46 | val events: NimbusEventStore by lazyMonitored {
|
| 65 | - NullNimbus(context)
|
|
| 66 | - //sdk.events
|
|
| 47 | + sdk.events
|
|
| 67 | 48 | }
|
| 68 | 49 | |
| 69 | 50 | /**
|
| ... | ... | @@ -97,7 +78,7 @@ class NimbusComponents(private val context: Context) { |
| 97 | 78 | * from the Nimbus Messaging component.
|
| 98 | 79 | */
|
| 99 | 80 | val messaging: NimbusMessagingControllerInterface by lazyMonitored {
|
| 100 | - NullNimbusMessagingController(
|
|
| 81 | + NimbusMessagingController(
|
|
| 101 | 82 | messagingStorage = messagingStorage,
|
| 102 | 83 | deepLinkScheme = BuildConfig.DEEP_LINK_SCHEME,
|
| 103 | 84 | )
|
| ... | ... | @@ -111,132 +92,10 @@ class NimbusComponents(private val context: Context) { |
| 111 | 92 | private val messagingStorage by lazyMonitored {
|
| 112 | 93 | NimbusMessagingStorage(
|
| 113 | 94 | context = context,
|
| 114 | - metadataStorage = NullMessageMetadataStorage(), //OnDiskMessageMetadataStorage(context),
|
|
| 95 | + metadataStorage = OnDiskMessageMetadataStorage(context),
|
|
| 115 | 96 | nimbus = sdk,
|
| 116 | 97 | messagingFeature = FxNimbusMessaging.features.messaging,
|
| 117 | 98 | attributeProvider = CustomAttributeProvider,
|
| 118 | 99 | )
|
| 119 | 100 | }
|
| 120 | 101 | } |
| 121 | -// Noop impl of MessageMetadataStorage to replace OnDiskMessageMetadataStorage
|
|
| 122 | -class NullMessageMetadataStorage(): MessageMetadataStorage {
|
|
| 123 | - override suspend fun getMetadata(): Map<String, Message.Metadata> {
|
|
| 124 | - var metadataMap: MutableMap<String, Message.Metadata> = hashMapOf()
|
|
| 125 | - return metadataMap
|
|
| 126 | - }
|
|
| 127 | - |
|
| 128 | - override suspend fun addMetadata(metadata: Message.Metadata): Message.Metadata {
|
|
| 129 | - return metadata
|
|
| 130 | - }
|
|
| 131 | - |
|
| 132 | - override suspend fun updateMetadata(metadata: Message.Metadata) {
|
|
| 133 | - // noop
|
|
| 134 | - }
|
|
| 135 | -}
|
|
| 136 | - |
|
| 137 | -class NullNimbusMessagingController(
|
|
| 138 | - messagingStorage: NimbusMessagingStorage,
|
|
| 139 | - deepLinkScheme: String,
|
|
| 140 | -) : NimbusMessagingController(messagingStorage, deepLinkScheme) {
|
|
| 141 | - |
|
| 142 | - private val nullMessage: Message = Message(
|
|
| 143 | - id = "",
|
|
| 144 | - data = MessageData(),
|
|
| 145 | - action = "",
|
|
| 146 | - style = StyleData(),
|
|
| 147 | - triggerIfAll = listOf(),
|
|
| 148 | - excludeIfAny = listOf(),
|
|
| 149 | - metadata = Metadata(""),
|
|
| 150 | - )
|
|
| 151 | - |
|
| 152 | - override suspend fun onMessageDisplayed(displayedMessage: Message, bootIdentifier: String?): Message {
|
|
| 153 | - return nullMessage
|
|
| 154 | - }
|
|
| 155 | - |
|
| 156 | - /**
|
|
| 157 | - * Called when a message has been dismissed by the user.
|
|
| 158 | - *
|
|
| 159 | - * Records a messageDismissed event, and records that the message
|
|
| 160 | - * has been dismissed.
|
|
| 161 | - */
|
|
| 162 | - override suspend fun onMessageDismissed(message: Message) {
|
|
| 163 | - return
|
|
| 164 | - }
|
|
| 165 | - |
|
| 166 | - /**
|
|
| 167 | - * Called when a microsurvey attached to a message has been completed by the user.
|
|
| 168 | - *
|
|
| 169 | - * @param message The message containing the microsurvey that was completed.
|
|
| 170 | - * @param answer The user's response to the microsurvey question.
|
|
| 171 | - */
|
|
| 172 | - override suspend fun onMicrosurveyCompleted(message: Message, answer: String) {
|
|
| 173 | - return
|
|
| 174 | - }
|
|
| 175 | - |
|
| 176 | - /**
|
|
| 177 | - * Called once the user has clicked on a message.
|
|
| 178 | - *
|
|
| 179 | - * This records that the message has been clicked on, but does not record a
|
|
| 180 | - * glean event. That should be done via [processMessageActionToUri].
|
|
| 181 | - */
|
|
| 182 | - override suspend fun onMessageClicked(message: Message) {
|
|
| 183 | - return
|
|
| 184 | - }
|
|
| 185 | - |
|
| 186 | - /**
|
|
| 187 | - * Create and return the relevant [Intent] for the given [Message].
|
|
| 188 | - *
|
|
| 189 | - * @param message the [Message] to create the [Intent] for.
|
|
| 190 | - * @return an [Intent] using the processed [Message].
|
|
| 191 | - */
|
|
| 192 | - override fun getIntentForMessage(message: Message) = Intent()
|
|
| 193 | - |
|
| 194 | - /**
|
|
| 195 | - * Will attempt to get the [Message] for the given [id].
|
|
| 196 | - *
|
|
| 197 | - * @param id the [Message.id] of the [Message] to try to match.
|
|
| 198 | - * @return the [Message] with a matching [id], or null if no [Message] has a matching [id].
|
|
| 199 | - */
|
|
| 200 | - override suspend fun getMessage(id: String): Message? {
|
|
| 201 | - return nullMessage
|
|
| 202 | - }
|
|
| 203 | - |
|
| 204 | - /**
|
|
| 205 | - * The [message] action needs to be examined for string substitutions
|
|
| 206 | - * and any `uuid` needs to be recorded in the Glean event.
|
|
| 207 | - *
|
|
| 208 | - * We call this `process` as it has a side effect of logging a Glean event while it
|
|
| 209 | - * creates a URI string for the message action.
|
|
| 210 | - */
|
|
| 211 | - override fun processMessageActionToUri(message: Message): Uri {
|
|
| 212 | - return Uri.EMPTY
|
|
| 213 | - }
|
|
| 214 | - |
|
| 215 | - override fun sendDismissedMessageTelemetry(messageId: String) {
|
|
| 216 | - return
|
|
| 217 | - }
|
|
| 218 | - |
|
| 219 | - override fun sendShownMessageTelemetry(messageId: String) {
|
|
| 220 | - return
|
|
| 221 | - }
|
|
| 222 | - |
|
| 223 | - override fun sendExpiredMessageTelemetry(messageId: String) {
|
|
| 224 | - return
|
|
| 225 | - }
|
|
| 226 | - |
|
| 227 | - override fun sendClickedMessageTelemetry(messageId: String, uuid: String?) {
|
|
| 228 | - return
|
|
| 229 | - }
|
|
| 230 | - |
|
| 231 | - override fun sendMicrosurveyCompletedTelemetry(messageId: String, answer: String) {
|
|
| 232 | - return
|
|
| 233 | - }
|
|
| 234 | - |
|
| 235 | - override fun convertActionIntoDeepLinkSchemeUri(action: String): Uri = Uri.EMPTY
|
|
| 236 | - |
|
| 237 | - override suspend fun getMessages(): List<Message> = listOf()
|
|
| 238 | - |
|
| 239 | - override suspend fun getNextMessage(surfaceId: MessageSurfaceId) = nullMessage
|
|
| 240 | - |
|
| 241 | - override fun getNextMessage(surfaceId: MessageSurfaceId, messages: List<Message>) = nullMessage
|
|
| 242 | -} |
| ... | ... | @@ -581,7 +581,7 @@ class HomeFragment : Fragment(), UserInteractionHandler { |
| 581 | 581 | |
| 582 | 582 | disableAppBarDragging()
|
| 583 | 583 | |
| 584 | - // FxNimbus.features.homescreen.recordExposure()
|
|
| 584 | + FxNimbus.features.homescreen.recordExposure()
|
|
| 585 | 585 | |
| 586 | 586 | // DO NOT MOVE ANYTHING BELOW THIS addMarker CALL!
|
| 587 | 587 | requireComponents.core.engine.profiler?.addMarker(
|
| ... | ... | @@ -33,7 +33,7 @@ class FenixOnboarding(context: Context) : PreferencesHolder { |
| 33 | 33 | // - We would like to evaluate the configuration only once (and thus it's kept in memory
|
| 34 | 34 | // and not re-evaluated)
|
| 35 | 35 | val config by lazy {
|
| 36 | - // FxNimbus.features.onboarding.recordExposure()
|
|
| 36 | + FxNimbus.features.onboarding.recordExposure()
|
|
| 37 | 37 | FxNimbus.features.onboarding.value()
|
| 38 | 38 | }
|
| 39 | 39 |
| ... | ... | @@ -45,7 +45,7 @@ class ReEngagementNotificationWorker( |
| 45 | 45 | |
| 46 | 46 | // Recording the exposure event here to capture all users who met all criteria to receive
|
| 47 | 47 | // the re-engagement notification
|
| 48 | - // FxNimbus.features.reEngagementNotification.recordExposure()
|
|
| 48 | + FxNimbus.features.reEngagementNotification.recordExposure()
|
|
| 49 | 49 | |
| 50 | 50 | if (!settings.reEngagementNotificationEnabled) {
|
| 51 | 51 | return Result.success()
|
| ... | ... | @@ -216,14 +216,11 @@ class SettingsFragment : PreferenceFragmentCompat(), UserInteractionHandler { |
| 216 | 216 | override fun onResume() {
|
| 217 | 217 | super.onResume()
|
| 218 | 218 | |
| 219 | - // IN TOR BROWSER: We don't talk about Nimbus!
|
|
| 220 | - // ~Use nimbus to set the title, and a trivial addition~
|
|
| 221 | - // val nimbusValidation = FxNimbus.features.nimbusValidation.value()
|
|
| 219 | + // Use nimbus to set the title, and a trivial addition
|
|
| 220 | + val nimbusValidation = FxNimbus.features.nimbusValidation.value()
|
|
| 222 | 221 | |
| 223 | - // val title = nimbusValidation.settingsTitle
|
|
| 224 | - // val suffix = nimbusValidation.settingsPunctuation
|
|
| 225 | - val title = getString(R.string.settings_title)
|
|
| 226 | - val suffix = ""
|
|
| 222 | + val title = nimbusValidation.settingsTitle
|
|
| 223 | + val suffix = nimbusValidation.settingsPunctuation
|
|
| 227 | 224 | |
| 228 | 225 | showToolbar("$title$suffix")
|
| 229 | 226 | |
| ... | ... | @@ -819,7 +816,7 @@ class SettingsFragment : PreferenceFragmentCompat(), UserInteractionHandler { |
| 819 | 816 | |
| 820 | 817 | @VisibleForTesting
|
| 821 | 818 | internal fun setupCookieBannerPreference() {
|
| 822 | - // FxNimbus.features.cookieBanners.recordExposure()
|
|
| 819 | + FxNimbus.features.cookieBanners.recordExposure()
|
|
| 823 | 820 | if (context?.settings()?.shouldShowCookieBannerUI == false) return
|
| 824 | 821 | with(requirePreference<SwitchPreference>(R.string.pref_key_cookie_banner_private_mode)) {
|
| 825 | 822 | isVisible = context.settings().shouldShowCookieBannerUI
|
| ... | ... | @@ -40,7 +40,7 @@ class DefaultLocaleSettingsController( |
| 40 | 40 | LocaleManager.updateBaseConfiguration(activity, locale)
|
| 41 | 41 | |
| 42 | 42 | // Invalidate cached values to use the new locale
|
| 43 | - // FxNimbus.features.nimbusValidation.withCachedValue(null)
|
|
| 43 | + FxNimbus.features.nimbusValidation.withCachedValue(null)
|
|
| 44 | 44 | activity.recreate()
|
| 45 | 45 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
| 46 | 46 | activity.overrideActivityTransition(Activity.OVERRIDE_TRANSITION_OPEN, 0, 0)
|
| ... | ... | @@ -60,7 +60,7 @@ class DefaultLocaleSettingsController( |
| 60 | 60 | LocaleManager.updateBaseConfiguration(activity, localeSettingsStore.state.localeList[0])
|
| 61 | 61 | |
| 62 | 62 | // Invalidate cached values to use the default locale
|
| 63 | - // FxNimbus.features.nimbusValidation.withCachedValue(null)
|
|
| 63 | + FxNimbus.features.nimbusValidation.withCachedValue(null)
|
|
| 64 | 64 | activity.recreate()
|
| 65 | 65 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
|
| 66 | 66 | activity.overrideActivityTransition(Activity.OVERRIDE_TRANSITION_OPEN, 0, 0)
|
| ... | ... | @@ -22,6 +22,7 @@ import org.mozilla.fenix.R |
| 22 | 22 | import org.mozilla.fenix.browser.StandardSnackbarError
|
| 23 | 23 | import org.mozilla.fenix.components.appstate.AppAction
|
| 24 | 24 | import org.mozilla.fenix.ext.components
|
| 25 | +import org.mozilla.fenix.ext.recordEventInNimbus
|
|
| 25 | 26 | import org.mozilla.geckoview.GeckoSession
|
| 26 | 27 | import org.mozilla.geckoview.GeckoSession.GeckoPrintException.ERROR_NO_ACTIVITY_CONTEXT
|
| 27 | 28 | import org.mozilla.geckoview.GeckoSession.GeckoPrintException.ERROR_NO_ACTIVITY_CONTEXT_DELEGATE
|
| ... | ... | @@ -152,7 +153,7 @@ class SaveToPDFMiddleware( |
| 152 | 153 | source = telemetrySource(isPdf),
|
| 153 | 154 | ),
|
| 154 | 155 | )
|
| 155 | - // context.recordEventInNimbus("print_tapped")
|
|
| 156 | + context.recordEventInNimbus("print_tapped")
|
|
| 156 | 157 | } else {
|
| 157 | 158 | Events.saveToPdfTapped.record(
|
| 158 | 159 | Events.SaveToPdfTappedExtra(
|
| ... | ... | @@ -320,7 +320,7 @@ class Settings(private val appContext: Context) : PreferencesHolder { |
| 320 | 320 | var showWallpaperOnboarding by lazyFeatureFlagPreference(
|
| 321 | 321 | key = appContext.getPreferenceKey(R.string.pref_key_wallpapers_onboarding),
|
| 322 | 322 | featureFlag = true,
|
| 323 | - default = { true /* mr2022Sections[Mr2022Section.WALLPAPERS_SELECTION_TOOL] == true */ },
|
|
| 323 | + default = { true },
|
|
| 324 | 324 | )
|
| 325 | 325 | |
| 326 | 326 | var openLinksInAPrivateTab by booleanPreference(
|
| ... | ... | @@ -820,25 +820,25 @@ class Settings(private val appContext: Context) : PreferencesHolder { |
| 820 | 820 | get() = false // cookieBannersSection[CookieBannersSection.FEATURE_UI] == 1
|
| 821 | 821 | |
| 822 | 822 | val shouldEnableCookieBannerDetectOnly: Boolean
|
| 823 | - get() = false // cookieBannersSection[CookieBannersSection.FEATURE_SETTING_DETECT_ONLY] == 1
|
|
| 823 | + get() = false
|
|
| 824 | 824 | |
| 825 | 825 | val shouldEnableCookieBannerGlobalRules: Boolean
|
| 826 | - get() = false // cookieBannersSection[CookieBannersSection.FEATURE_SETTING_GLOBAL_RULES] == 1
|
|
| 826 | + get() = false
|
|
| 827 | 827 | |
| 828 | 828 | val shouldEnableCookieBannerGlobalRulesSubFrame: Boolean
|
| 829 | - get() = false // cookieBannersSection[CookieBannersSection.FEATURE_SETTING_GLOBAL_RULES_SUB_FRAMES] == 1
|
|
| 829 | + get() = false
|
|
| 830 | 830 | |
| 831 | 831 | val shouldEnableQueryParameterStripping: Boolean
|
| 832 | - get() = true // queryParameterStrippingSection[QUERY_PARAMETER_STRIPPING] == "1"
|
|
| 832 | + get() = true
|
|
| 833 | 833 | |
| 834 | 834 | val shouldEnableQueryParameterStrippingPrivateBrowsing: Boolean
|
| 835 | - get() = true // queryParameterStrippingSection[QUERY_PARAMETER_STRIPPING_PMB] == "1"
|
|
| 835 | + get() = true
|
|
| 836 | 836 | |
| 837 | 837 | val queryParameterStrippingAllowList: String
|
| 838 | - get() = "" // queryParameterStrippingSection[QUERY_PARAMETER_STRIPPING_ALLOW_LIST].orEmpty()
|
|
| 838 | + get() = ""
|
|
| 839 | 839 | |
| 840 | 840 | val queryParameterStrippingStripList: String
|
| 841 | - get() = "" // queryParameterStrippingSection[QUERY_PARAMETER_STRIPPING_STRIP_LIST].orEmpty()
|
|
| 841 | + get() = ""
|
|
| 842 | 842 | |
| 843 | 843 | /**
|
| 844 | 844 | * Declared as a function for performance purposes. This could be declared as a variable using
|
| ... | ... | @@ -896,8 +896,7 @@ class Settings(private val appContext: Context) : PreferencesHolder { |
| 896 | 896 | * Indicates if the re-engagement notification feature is enabled
|
| 897 | 897 | */
|
| 898 | 898 | val reEngagementNotificationType: Int
|
| 899 | - get() = 0 // Neither Type A or B
|
|
| 900 | - // FxNimbus.features.reEngagementNotification.value().type
|
|
| 899 | + get() = 0
|
|
| 901 | 900 | |
| 902 | 901 | val shouldUseAutoBatteryTheme by booleanPreference(
|
| 903 | 902 | appContext.getPreferenceKey(R.string.pref_key_auto_battery_theme),
|
| ... | ... | @@ -1709,24 +1708,22 @@ class Settings(private val appContext: Context) : PreferencesHolder { |
| 1709 | 1708 | return currentlyEnabledLanguages.contains(userLangTag)
|
| 1710 | 1709 | }
|
| 1711 | 1710 | |
| 1712 | -// private val mr2022Sections: Map<Mr2022Section, Boolean>
|
|
| 1713 | -// get() =
|
|
| 1714 | -// FxNimbus.features.mr2022.value().sectionsEnabled
|
|
| 1711 | + private val mr2022Sections: Map<Mr2022Section, Boolean>
|
|
| 1712 | + get() =
|
|
| 1713 | + FxNimbus.features.mr2022.value().sectionsEnabled
|
|
| 1715 | 1714 | |
| 1716 | -// private val cookieBannersSection: Map<CookieBannersSection, Int>
|
|
| 1717 | -// get() =
|
|
| 1718 | -// FxNimbus.features.cookieBanners.value().sectionsEnabled
|
|
| 1715 | + private val cookieBannersSection: Map<CookieBannersSection, Int>
|
|
| 1716 | + get() =
|
|
| 1717 | + FxNimbus.features.cookieBanners.value().sectionsEnabled
|
|
| 1719 | 1718 | |
| 1720 | -// private val queryParameterStrippingSection: Map<QueryParameterStrippingSection, String>
|
|
| 1721 | -// get() =
|
|
| 1722 | -// FxNimbus.features.queryParameterStripping.value().sectionsEnabled
|
|
| 1719 | + private val queryParameterStrippingSection: Map<QueryParameterStrippingSection, String>
|
|
| 1720 | + get() =
|
|
| 1721 | + FxNimbus.features.queryParameterStripping.value().sectionsEnabled
|
|
| 1723 | 1722 | |
| 1724 | -// private val homescreenSections: Map<HomeScreenSection, Boolean>
|
|
| 1725 | -// get() =
|
|
| 1726 | -// FxNimbus.features.homescreen.value().sectionsEnabled
|
|
| 1723 | + private val homescreenSections: Map<HomeScreenSection, Boolean>
|
|
| 1724 | + get() =
|
|
| 1725 | + FxNimbus.features.homescreen.value().sectionsEnabled
|
|
| 1727 | 1726 | |
| 1728 | - // IN TOR BROWSER: we want to avoid ever calling Nimbus, so we hard-code defaults
|
|
| 1729 | - // for everything that would have accessed this property.
|
|
| 1730 | 1727 | var historyMetadataUIFeature by lazyFeatureFlagPreference(
|
| 1731 | 1728 | appContext.getPreferenceKey(R.string.pref_key_history_metadata_feature),
|
| 1732 | 1729 | default = { true },
|
| ... | ... | @@ -1739,7 +1736,7 @@ class Settings(private val appContext: Context) : PreferencesHolder { |
| 1739 | 1736 | var showSyncCFR by lazyFeatureFlagPreference(
|
| 1740 | 1737 | appContext.getPreferenceKey(R.string.pref_key_should_show_sync_cfr),
|
| 1741 | 1738 | featureFlag = true,
|
| 1742 | - default = { false /* mr2022Sections[Mr2022Section.SYNC_CFR] == true */ },
|
|
| 1739 | + default = { false },
|
|
| 1743 | 1740 | )
|
| 1744 | 1741 | |
| 1745 | 1742 | /**
|
| ... | ... | @@ -1748,7 +1745,7 @@ class Settings(private val appContext: Context) : PreferencesHolder { |
| 1748 | 1745 | var showHomeOnboardingDialog by lazyFeatureFlagPreference(
|
| 1749 | 1746 | appContext.getPreferenceKey(R.string.pref_key_should_show_home_onboarding_dialog),
|
| 1750 | 1747 | featureFlag = true,
|
| 1751 | - default = { true /* mr2022Sections[Mr2022Section.HOME_ONBOARDING_DIALOG_EXISTING_USERS] == true */ },
|
|
| 1748 | + default = { true },
|
|
| 1752 | 1749 | )
|
| 1753 | 1750 | |
| 1754 | 1751 | /**
|
| ... | ... | @@ -1917,7 +1914,6 @@ class Settings(private val appContext: Context) : PreferencesHolder { |
| 1917 | 1914 | isLauncherIntent: Boolean,
|
| 1918 | 1915 | ): Boolean {
|
| 1919 | 1916 | return if (featureEnabled && !hasUserBeenOnboarded && isLauncherIntent) {
|
| 1920 | - // FxNimbus.features.junoOnboarding.recordExposure()
|
|
| 1921 | 1917 | false
|
| 1922 | 1918 | } else {
|
| 1923 | 1919 | false
|