fix: adjust LeakCanary init flow

This commit is contained in:
Harsh Shandilya
2023-03-24 10:19:02 +05:30
parent 7e4ebc0348
commit bebb804e01

View File

@@ -53,12 +53,11 @@ class Application : android.app.Application(), SharedPreferences.OnSharedPrefere
) { ) {
LogcatLogger.install(AndroidLogcatLogger(DEBUG)) LogcatLogger.install(AndroidLogcatLogger(DEBUG))
setVmPolicy() setVmPolicy()
AppWatcher.manualInstall(this)
LeakCanary.config.copy(dumpHeap = true, eventListeners = eventListeners) LeakCanary.config.copy(dumpHeap = true, eventListeners = eventListeners)
LeakCanary.showLeakDisplayActivityLauncherIcon(true) LeakCanary.showLeakDisplayActivityLauncherIcon(true)
AppWatcher.manualInstall(this)
} else { } else {
LeakCanary.config.copy(dumpHeap = false, eventListeners = eventListeners) LeakCanary.config.copy(dumpHeap = false, eventListeners = eventListeners)
LeakCanary.showLeakDisplayActivityLauncherIcon(false)
} }
prefs.registerOnSharedPreferenceChangeListener(this) prefs.registerOnSharedPreferenceChangeListener(this)
setNightMode() setNightMode()