aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2018-04-12 18:50:58 -0400
committerGitHub <noreply@github.com>2018-04-12 18:50:58 -0400
commitd9e2562267e549ee407e683262406581f2c4888e (patch)
tree0dc063913b00a9dc4f10d0d5c7085218c2cc17c3 /app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt
parent42e57597bcc3216778e9f14389f751eb62da1bd5 (diff)
downloadfrost-d9e2562267e549ee407e683262406581f2c4888e.tar.gz
frost-d9e2562267e549ee407e683262406581f2c4888e.tar.bz2
frost-d9e2562267e549ee407e683262406581f2c4888e.zip
Misc (#865)
* Clean up git code * Update download link * Update theme * Reorder settings, resolvees #856 * Do not log undeliverable exception * Handle potential lack of webview * Set notification epoch default to now, resolves #857 * Fix notification epoch time init * Update changelog * Update theme * Add slack url, resolves #880 * Prepare for image update
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt20
1 files changed, 13 insertions, 7 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt b/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt
index dec22e88..ae4360a5 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt
@@ -18,12 +18,14 @@ import com.pitchedapps.frost.dbflow.FbTabsDb
import com.pitchedapps.frost.dbflow.NotificationDb
import com.pitchedapps.frost.facebook.FbCookie
import com.pitchedapps.frost.glide.GlideApp
-import com.pitchedapps.frost.services.*
+import com.pitchedapps.frost.services.scheduleNotifications
+import com.pitchedapps.frost.services.setupNotificationChannels
import com.pitchedapps.frost.utils.*
import com.raizlabs.android.dbflow.config.DatabaseConfig
import com.raizlabs.android.dbflow.config.FlowConfig
import com.raizlabs.android.dbflow.config.FlowManager
import com.raizlabs.android.dbflow.runtime.ContentResolverNotifier
+import io.reactivex.exceptions.UndeliverableException
import io.reactivex.plugins.RxJavaPlugins
import java.net.SocketTimeoutException
import java.util.*
@@ -60,7 +62,6 @@ class FrostApp : Application() {
.build())
Showcase.initialize(this, "${BuildConfig.APPLICATION_ID}.showcase")
Prefs.initialize(this, "${BuildConfig.APPLICATION_ID}.prefs")
- ReleasePrefs.initialize(this, "${BuildConfig.APPLICATION_ID}.manager")
// if (LeakCanary.isInAnalyzerProcess(this)) return
// refWatcher = LeakCanary.install(this)
if (!BuildConfig.DEBUG) {
@@ -84,7 +85,11 @@ class FrostApp : Application() {
KL.shouldLog = { BuildConfig.DEBUG }
Prefs.verboseLogging = false
L.i { "Begin Frost for Facebook" }
- FbCookie()
+ try {
+ FbCookie()
+ } catch (e: Exception) {
+ // no webview found; error will be handled in start activity
+ }
FrostPglAdBlock.init(this)
if (Prefs.installDate == -1L) Prefs.installDate = System.currentTimeMillis()
if (Prefs.identifier == -1) Prefs.identifier = Random().nextInt(Int.MAX_VALUE)
@@ -95,7 +100,6 @@ class FrostApp : Application() {
setupNotificationChannels(applicationContext)
applicationContext.scheduleNotifications(Prefs.notificationFreq)
- applicationContext.scheduleUpdater(ReleasePrefs.enableUpdater)
/**
* Drawer profile loading logic
@@ -132,12 +136,14 @@ class FrostApp : Application() {
RxJavaPlugins.setErrorHandler {
when (it) {
- is SocketTimeoutException -> Unit
- else -> L.e(it) { "RxJava error" }
+ is SocketTimeoutException, is UndeliverableException ->
+ L.e { "RxJava common error ${it.message}" }
+ else ->
+ L.e(it) { "RxJava error" }
}
}
}
-} \ No newline at end of file
+}