From 4744662f5cbd1d40b91503ab4242ff5b9f423d9d Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 28 Jul 2019 11:08:47 -0700 Subject: Init bugsnag after pref setup --- .../main/kotlin/com/pitchedapps/frost/FrostApp.kt | 26 +++++++++++++--------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt b/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt index a465eb7b..65c6d463 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt @@ -84,22 +84,13 @@ class FrostApp : Application() { .withDatabase(NotificationDb.NAME, NotificationDb::class) .build() ) - Showcase.initialize(this, "${BuildConfig.APPLICATION_ID}.showcase") - Prefs.initialize(this, "${BuildConfig.APPLICATION_ID}.prefs") // if (LeakCanary.isInAnalyzerProcess(this)) return // refWatcher = LeakCanary.install(this) + initPrefs() initBugsnag() - KL.shouldLog = { BuildConfig.DEBUG } - Prefs.verboseLogging = false + L.i { "Begin Frost for Facebook" } FrostPglAdBlock.init(this) - if (Prefs.installDate == -1L) { - Prefs.installDate = System.currentTimeMillis() - } - if (Prefs.identifier == -1) { - Prefs.identifier = Random().nextInt(Int.MAX_VALUE) - } - Prefs.lastLaunch = System.currentTimeMillis() super.onCreate() @@ -150,6 +141,19 @@ class FrostApp : Application() { } } + private fun initPrefs() { + Prefs.initialize(this, "${BuildConfig.APPLICATION_ID}.prefs") + KL.shouldLog = { BuildConfig.DEBUG } + Prefs.verboseLogging = false + if (Prefs.installDate == -1L) { + Prefs.installDate = System.currentTimeMillis() + } + if (Prefs.identifier == -1) { + Prefs.identifier = Random().nextInt(Int.MAX_VALUE) + } + Prefs.lastLaunch = System.currentTimeMillis() + } + private fun initBugsnag() { if (BuildConfig.DEBUG) { return -- cgit v1.2.3