aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/app/passwordstore/Application.kt10
1 files changed, 7 insertions, 3 deletions
diff --git a/app/src/main/java/app/passwordstore/Application.kt b/app/src/main/java/app/passwordstore/Application.kt
index 35e1ae22..984adde4 100644
--- a/app/src/main/java/app/passwordstore/Application.kt
+++ b/app/src/main/java/app/passwordstore/Application.kt
@@ -46,15 +46,19 @@ class Application : android.app.Application(), SharedPreferences.OnSharedPrefere
override fun onCreate() {
super.onCreate()
instance = this
- LeakCanary.config =
- LeakCanary.config.copy(eventListeners = LeakCanary.config.eventListeners + SentryLeakUploader)
+ val eventListeners = LeakCanary.config.eventListeners + SentryLeakUploader
if (
BuildConfig.ENABLE_DEBUG_FEATURES ||
prefs.getBoolean(PreferenceKeys.ENABLE_DEBUG_LOGGING, false)
) {
LogcatLogger.install(AndroidLogcatLogger(DEBUG))
- AppWatcher.manualInstall(this)
setVmPolicy()
+ LeakCanary.config.copy(dumpHeap = true, eventListeners = eventListeners)
+ LeakCanary.showLeakDisplayActivityLauncherIcon(true)
+ AppWatcher.manualInstall(this)
+ } else {
+ LeakCanary.config.copy(dumpHeap = false, eventListeners = eventListeners)
+ LeakCanary.showLeakDisplayActivityLauncherIcon(false)
}
prefs.registerOnSharedPreferenceChangeListener(this)
setNightMode()