1
0
mirror of https://github.com/AllanWang/Frost-for-Facebook.git synced 2024-11-10 04:52:38 +01:00

Make analytics opt in and disable bugsnag altogether

This commit is contained in:
Allan Wang 2019-07-22 23:53:13 -07:00
parent 6f0c633436
commit b6f05964d9
No known key found for this signature in database
GPG Key ID: C93E3F9C679D7A56
2 changed files with 14 additions and 2 deletions

View File

@ -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
}
}

View File

@ -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)