2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-11 13:11:01 +00:00

Bug 1851676 - Makes initIfNeeded public inside SentryService.

(cherry picked from commit 16a37cf474e00f46281adeb06f81e1e0f5f6cd4e)
This commit is contained in:
Jeff Boek 2023-09-05 13:02:12 -07:00
parent 17e5d208b3
commit 215c6bad39
2 changed files with 11 additions and 1 deletions

View File

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

View File

@ -158,7 +158,7 @@ class Components(private val context: Context) {
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 clipboardHandler by lazyMonitored { ClipboardHandler(context) }
val performance by lazyMonitored { PerformanceComponent() }