From ccd9e44a3e374fc48f511aa0587e35abfa2b4e56 Mon Sep 17 00:00:00 2001 From: Jonathan Almeida Date: Wed, 4 Sep 2019 16:04:48 -0400 Subject: [PATCH] No issue: Add logging for firebase/autopush --- app/src/main/java/org/mozilla/fenix/FenixApplication.kt | 2 ++ .../java/org/mozilla/fenix/components/BackgroundServices.kt | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/app/src/main/java/org/mozilla/fenix/FenixApplication.kt b/app/src/main/java/org/mozilla/fenix/FenixApplication.kt index 3056d21f9..a4ffff5f3 100644 --- a/app/src/main/java/org/mozilla/fenix/FenixApplication.kt +++ b/app/src/main/java/org/mozilla/fenix/FenixApplication.kt @@ -192,6 +192,8 @@ open class FenixApplication : Application() { // We need the push feature setup here to deliver messages in the case where the service // starts up the app first. if (components.backgroundServices.pushConfig != null) { + Logger.info("Push configuration found; initializing autopush..") + val push = components.backgroundServices.push // Install the AutoPush singleton to receive messages. diff --git a/app/src/main/java/org/mozilla/fenix/components/BackgroundServices.kt b/app/src/main/java/org/mozilla/fenix/components/BackgroundServices.kt index 7ef261575..7072e4530 100644 --- a/app/src/main/java/org/mozilla/fenix/components/BackgroundServices.kt +++ b/app/src/main/java/org/mozilla/fenix/components/BackgroundServices.kt @@ -83,11 +83,15 @@ class BackgroundServices( } val pushConfig by lazy { + val logger = Logger("PushConfig") val projectIdKey = context.getString(R.string.pref_key_push_project_id) val resId = context.resources.getIdentifier(projectIdKey, "string", context.packageName) if (resId == 0) { + logger.warn("No firebase configuration found; cannot support push service.") return@lazy null } + + logger.debug("Creating push configuration for autopush.") val projectId = context.resources.getString(resId) PushConfig(projectId) }