aboutsummaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
Diffstat (limited to 'app/src')
-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
-rw-r--r--app/src/nonFree/AndroidManifest.xml2
3 files changed, 19 insertions, 1 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()
+ }
}
diff --git a/app/src/nonFree/AndroidManifest.xml b/app/src/nonFree/AndroidManifest.xml
index 2f8d2746..83103b18 100644
--- a/app/src/nonFree/AndroidManifest.xml
+++ b/app/src/nonFree/AndroidManifest.xml
@@ -6,6 +6,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application>
<meta-data android:name="io.sentry.dsn" android:value="${sentryDsn}" />
- <meta-data android:name="io.sentry.traces.sample-rate" android:value="0.0" />
+ <meta-data android:name="io.sentry.traces.sample-rate" android:value="1.0" />
</application>
</manifest>