aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-07-22 23:53:13 -0700
committerAllan Wang <me@allanwang.ca>2019-07-22 23:53:13 -0700
commitb6f05964d9955ab54cde619bc28b7b55a0525773 (patch)
treec63dea4fea083a317f050a1c0ef0dd4c92c05556 /app
parent6f0c6334366d037696e9249bbbd2f165448716e6 (diff)
downloadfrost-b6f05964d9955ab54cde619bc28b7b55a0525773.tar.gz
frost-b6f05964d9955ab54cde619bc28b7b55a0525773.tar.bz2
frost-b6f05964d9955ab54cde619bc28b7b55a0525773.zip
Make analytics opt in and disable bugsnag altogether
Diffstat (limited to 'app')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/settings/Behaviour.kt13
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt3
2 files changed, 14 insertions, 2 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/settings/Behaviour.kt b/app/src/main/kotlin/com/pitchedapps/frost/settings/Behaviour.kt
index c774892e..06687c05 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Behaviour.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Behaviour.kt
@@ -17,6 +17,8 @@
package com.pitchedapps.frost.settings
import ca.allanwang.kau.kpref.activity.KPrefAdapterBuilder
+import com.bugsnag.android.Bugsnag
+import com.pitchedapps.frost.BuildConfig
import com.pitchedapps.frost.R
import com.pitchedapps.frost.activities.SettingsActivity
import com.pitchedapps.frost.facebook.FB_URL_BASE
@@ -84,7 +86,16 @@ fun SettingsActivity.getBehaviourPrefs(): KPrefAdapterBuilder.() -> Unit = {
descRes = R.string.exit_confirmation_desc
}
- checkbox(R.string.analytics, Prefs::analytics, { Prefs.analytics = it }) {
+ checkbox(R.string.analytics, Prefs::analytics, {
+ if (!BuildConfig.DEBUG) {
+ if (it) {
+ Bugsnag.enableExceptionHandler()
+ } else {
+ Bugsnag.disableExceptionHandler()
+ }
+ }
+ Prefs.analytics = it
+ }) {
descRes = R.string.analytics_desc
}
}
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt
index c10a95ce..b73f7fca 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt
@@ -22,6 +22,7 @@ import ca.allanwang.kau.kpref.KPref
import ca.allanwang.kau.utils.colorToForeground
import ca.allanwang.kau.utils.isColorVisibleOn
import ca.allanwang.kau.utils.withAlpha
+import com.pitchedapps.frost.BuildConfig
import com.pitchedapps.frost.enums.FACEBOOK_BLUE
import com.pitchedapps.frost.enums.FeedSort
import com.pitchedapps.frost.enums.MainActivityLayout
@@ -153,7 +154,7 @@ object Prefs : KPref() {
var verboseLogging: Boolean by kpref("verbose_logging", false)
- var analytics: Boolean by kpref("analytics", true)
+ var analytics: Boolean by kpref("analytics", false)
var biometricsEnabled: Boolean by kpref("biometrics_enabled", false)