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 744f16eb3..c19d09589 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 @@ -5,9 +5,8 @@ package org.mozilla.fenix.components.metrics import android.content.Context -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job +import kotlinx.coroutines.MainScope import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking import mozilla.components.service.glean.BuildConfig @@ -397,7 +396,7 @@ class GleanMetricsService(private val context: Context) : MetricsService { if (initialized) return initialized = true - starter = CoroutineScope(Dispatchers.IO).launch { + starter = MainScope().launch { Glean.registerPings(Pings) Glean.initialize(context, Configuration(channel = BuildConfig.BUILD_TYPE))