Merge pull request #3914 from mozilla-mobile/mergify/bp/releases_v118/pr-3502

fenix/118.2.0
Pascal Chevrel 7 months ago committed by GitHub
commit 6d6939bce9

@ -18,7 +18,9 @@ import mozilla.components.service.nimbus.NimbusApi
import mozilla.components.service.nimbus.messaging.FxNimbusMessaging import mozilla.components.service.nimbus.messaging.FxNimbusMessaging
import mozilla.components.service.nimbus.messaging.NimbusMessagingStorage import mozilla.components.service.nimbus.messaging.NimbusMessagingStorage
import mozilla.components.service.nimbus.messaging.OnDiskMessageMetadataStorage import mozilla.components.service.nimbus.messaging.OnDiskMessageMetadataStorage
import mozilla.components.support.ktx.android.content.isMainProcess
import mozilla.components.support.utils.BrowsersCache import mozilla.components.support.utils.BrowsersCache
import mozilla.components.support.utils.RunWhenReadyQueue
import org.mozilla.fenix.BuildConfig import org.mozilla.fenix.BuildConfig
import org.mozilla.fenix.Config import org.mozilla.fenix.Config
import org.mozilla.fenix.HomeActivity import org.mozilla.fenix.HomeActivity
@ -46,6 +48,7 @@ import org.mozilla.geckoview.BuildConfig.MOZ_UPDATE_CHANNEL
*/ */
class Analytics( class Analytics(
private val context: Context, private val context: Context,
private val runWhenReadyQueue: RunWhenReadyQueue,
) { ) {
val crashReporter: CrashReporter by lazyMonitored { val crashReporter: CrashReporter by lazyMonitored {
val services = mutableListOf<CrashReporterService>() val services = mutableListOf<CrashReporterService>()
@ -75,6 +78,13 @@ class Analytics(
sentryProjectUrl = getSentryProjectUrl(), sentryProjectUrl = getSentryProjectUrl(),
) )
// We only want to initialize Sentry on startup on the main process.
if (context.isMainProcess()) {
runWhenReadyQueue.runIfReadyOrQueue {
sentryService.initIfNeeded()
}
}
services.add(sentryService) services.add(sentryService)
} }

@ -158,7 +158,7 @@ class Components(private val context: Context) {
AddonManager(core.store, core.engine, addonsProvider, addonUpdater) AddonManager(core.store, core.engine, addonsProvider, addonUpdater)
} }
val analytics by lazyMonitored { Analytics(context) } val analytics by lazyMonitored { Analytics(context, performance.visualCompletenessQueue.queue) }
val publicSuffixList by lazyMonitored { PublicSuffixList(context) } val publicSuffixList by lazyMonitored { PublicSuffixList(context) }
val clipboardHandler by lazyMonitored { ClipboardHandler(context) } val clipboardHandler by lazyMonitored { ClipboardHandler(context) }
val performance by lazyMonitored { PerformanceComponent() } val performance by lazyMonitored { PerformanceComponent() }

Loading…
Cancel
Save