From eedb0fa3b2f9f652a705ea207e8951d90b287311 Mon Sep 17 00:00:00 2001 From: Colin Lee Date: Tue, 2 Jul 2019 14:58:28 -0500 Subject: [PATCH] For #2945: Launches to blank screen and hangs on Nexus 10 (#3854) --- CHANGELOG.md | 1 + app/src/main/java/org/mozilla/fenix/components/Search.kt | 3 ++- .../org/mozilla/fenix/components/metrics/ActivationPing.kt | 2 +- .../mozilla/fenix/components/metrics/GleanMetricsService.kt | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea0967b07..e5ad80b33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,4 +68,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - #2789 Custom tabs is not covering the full screen size. - #2893, #2673, #2916, #2314: Fix several crashes navigating from external links - #3750 - Crash when tapping "Blocked" on Google Maps after disabling location requests +- #2945 - Fixed "Launches to blank screen and hangs on Nexus 10" ### Removed diff --git a/app/src/main/java/org/mozilla/fenix/components/Search.kt b/app/src/main/java/org/mozilla/fenix/components/Search.kt index 7c6f40bb5..45b38f05d 100644 --- a/app/src/main/java/org/mozilla/fenix/components/Search.kt +++ b/app/src/main/java/org/mozilla/fenix/components/Search.kt @@ -5,6 +5,7 @@ package org.mozilla.fenix.components import android.content.Context +import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.launch import mozilla.components.browser.search.SearchEngineManager @@ -21,7 +22,7 @@ class Search(private val context: Context) { * This component provides access to a centralized registry of search engines. */ val searchEngineManager by lazy { - SearchEngineManager().apply { + SearchEngineManager(coroutineContext = IO).apply { registerForLocaleUpdates(context) GlobalScope.launch { loadAsync(context).await() diff --git a/app/src/main/java/org/mozilla/fenix/components/metrics/ActivationPing.kt b/app/src/main/java/org/mozilla/fenix/components/metrics/ActivationPing.kt index c34d581d1..f40ca5d30 100644 --- a/app/src/main/java/org/mozilla/fenix/components/metrics/ActivationPing.kt +++ b/app/src/main/java/org/mozilla/fenix/components/metrics/ActivationPing.kt @@ -157,7 +157,7 @@ class ActivationPing(private val context: Context) { // Generate the activation_id. Activation.activationId.generateAndSet() - CoroutineScope(Dispatchers.Default).launch { + CoroutineScope(Dispatchers.IO).launch { val hashedId = getHashedIdentifier() if (hashedId != null) { Logger.info("ActivationPing - generating ping with the hashed id") 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 15ab9d2c3..59e2c7d5e 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 @@ -247,7 +247,7 @@ class GleanMetricsService(private val context: Context) : MetricsService { if (initialized) return initialized = true - starter = CoroutineScope(Dispatchers.Default).launch { + starter = CoroutineScope(Dispatchers.IO).launch { Glean.registerPings(Pings) Glean.initialize(context, Configuration(channel = BuildConfig.BUILD_TYPE))