aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/dev/msfjarvis/aps/Application.kt13
-rw-r--r--app/src/main/java/dev/msfjarvis/aps/util/features/Feature.kt5
2 files changed, 18 insertions, 0 deletions
diff --git a/app/src/main/java/dev/msfjarvis/aps/Application.kt b/app/src/main/java/dev/msfjarvis/aps/Application.kt
index 1a72655b..0c7def1c 100644
--- a/app/src/main/java/dev/msfjarvis/aps/Application.kt
+++ b/app/src/main/java/dev/msfjarvis/aps/Application.kt
@@ -15,11 +15,15 @@ import dagger.hilt.android.HiltAndroidApp
import dev.msfjarvis.aps.injection.context.FilesDirPath
import dev.msfjarvis.aps.injection.prefs.SettingsPreferences
import dev.msfjarvis.aps.util.extensions.getString
+import dev.msfjarvis.aps.util.features.Feature
+import dev.msfjarvis.aps.util.features.Features
import dev.msfjarvis.aps.util.git.sshj.setUpBouncyCastleForSshj
import dev.msfjarvis.aps.util.proxy.ProxyUtils
import dev.msfjarvis.aps.util.settings.GitSettings
import dev.msfjarvis.aps.util.settings.PreferenceKeys
import dev.msfjarvis.aps.util.settings.runMigrations
+import io.sentry.Sentry
+import io.sentry.protocol.User
import javax.inject.Inject
import logcat.AndroidLogcatLogger
import logcat.LogPriority.DEBUG
@@ -33,6 +37,7 @@ class Application : android.app.Application(), SharedPreferences.OnSharedPrefere
@Inject @FilesDirPath lateinit var filesDirPath: String
@Inject lateinit var proxyUtils: ProxyUtils
@Inject lateinit var gitSettings: GitSettings
+ @Inject lateinit var features: Features
override fun onCreate() {
super.onCreate()
@@ -48,6 +53,14 @@ class Application : android.app.Application(), SharedPreferences.OnSharedPrefere
runMigrations(filesDirPath, prefs, gitSettings)
proxyUtils.setDefaultProxy()
DynamicColors.applyToActivitiesIfAvailable(this)
+ Sentry.configureScope { scope ->
+ val user = User()
+ user.others =
+ Feature.VALUES.associate { feature ->
+ "features.${feature.configKey}" to features.isEnabled(feature).toString()
+ }
+ scope.user = user
+ }
}
override fun onTerminate() {
diff --git a/app/src/main/java/dev/msfjarvis/aps/util/features/Feature.kt b/app/src/main/java/dev/msfjarvis/aps/util/features/Feature.kt
index 7ae2e642..4eef003d 100644
--- a/app/src/main/java/dev/msfjarvis/aps/util/features/Feature.kt
+++ b/app/src/main/java/dev/msfjarvis/aps/util/features/Feature.kt
@@ -15,4 +15,9 @@ enum class Feature(
/** Opt into the new PGP backend powered by the PGPainless library. */
EnablePGPainlessBackend(false, "enable_pgp_v2_backend"),
+ ;
+
+ companion object {
+ @JvmField val VALUES = values()
+ }
}