aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2018-10-08 22:46:26 -0400
committerGitHub <noreply@github.com>2018-10-08 22:46:26 -0400
commit5ceb6a856fa18e772f62dd9cc4f6e2ceaf18064a (patch)
tree39a49a86b4bcf83d1c6823310dd706ee2dd81614 /app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt
parent7698d12a5a9898d0f7037b821b22c7892df21daa (diff)
downloadfrost-5ceb6a856fa18e772f62dd9cc4f6e2ceaf18064a.tar.gz
frost-5ceb6a856fa18e772f62dd9cc4f6e2ceaf18064a.tar.bz2
frost-5ceb6a856fa18e772f62dd9cc4f6e2ceaf18064a.zip
Fix/misc (#1130)
* Update bugsnag exception filter * Rewrite imageactivity to remove file nullability * Init bugsnag before logging * Add bugsnag tags * Update theme for transitioning to post creation
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt14
1 files changed, 12 insertions, 2 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt b/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt
index a12745bf..c566aa05 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt
@@ -11,6 +11,7 @@ import ca.allanwang.kau.utils.buildIsLollipopAndUp
import com.bugsnag.android.Bugsnag
import com.bumptech.glide.request.RequestOptions
import com.bumptech.glide.signature.ApplicationVersionSignature
+import com.google.android.exoplayer2.ExoPlaybackException
import com.mikepenz.materialdrawer.util.AbstractDrawerImageLoader
import com.mikepenz.materialdrawer.util.DrawerImageLoader
import com.pitchedapps.frost.dbflow.CookiesDb
@@ -28,6 +29,7 @@ import com.raizlabs.android.dbflow.runtime.ContentResolverNotifier
import io.reactivex.exceptions.UndeliverableException
import io.reactivex.plugins.RxJavaPlugins
import java.net.SocketTimeoutException
+import java.net.UnknownHostException
import java.util.*
import kotlin.reflect.KClass
@@ -64,8 +66,8 @@ class FrostApp : Application() {
Prefs.initialize(this, "${BuildConfig.APPLICATION_ID}.prefs")
// if (LeakCanary.isInAnalyzerProcess(this)) return
// refWatcher = LeakCanary.install(this)
- KL.shouldLog = { BuildConfig.DEBUG }
initBugsnag()
+ KL.shouldLog = { BuildConfig.DEBUG }
Prefs.verboseLogging = false
L.i { "Begin Frost for Facebook" }
try {
@@ -130,18 +132,26 @@ class FrostApp : Application() {
private fun initBugsnag() {
if (BuildConfig.DEBUG) return
+ Bugsnag.init(this)
+ Bugsnag.disableExceptionHandler()
if (!BuildConfig.APPLICATION_ID.startsWith("com.pitchedapps.frost")) return
val version = BuildUtils.match(BuildConfig.VERSION_NAME)
?: return L.d { "Bugsnag disabled for ${BuildConfig.VERSION_NAME}" }
- Bugsnag.init(this)
+ Bugsnag.enableExceptionHandler()
Bugsnag.setNotifyReleaseStages(*BuildUtils.getAllStages())
Bugsnag.setAppVersion(version.versionName)
Bugsnag.setReleaseStage(BuildUtils.getStage(BuildConfig.BUILD_TYPE))
Bugsnag.setAutoCaptureSessions(true)
Bugsnag.setUserId(Prefs.frostId)
+ Bugsnag.addToTab("Build", "Application", BuildConfig.APPLICATION_ID)
+ Bugsnag.addToTab("Build", "Version", BuildConfig.VERSION_NAME)
+
Bugsnag.beforeNotify { error ->
when {
error.exception is UndeliverableException -> false
+ error.exception is ExoPlaybackException -> false
+ error.exception is SocketTimeoutException -> false
+ error.exception is UnknownHostException -> false
error.exception.stackTrace.any { it.className.contains("XposedBridge") } -> false
else -> true
}