From b6f05964d9955ab54cde619bc28b7b55a0525773 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Mon, 22 Jul 2019 23:53:13 -0700 Subject: Make analytics opt in and disable bugsnag altogether --- .../main/kotlin/com/pitchedapps/frost/settings/Behaviour.kt | 13 ++++++++++++- app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt | 3 ++- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'app/src/main') 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) -- cgit v1.2.3