Add debug option to disable LeakCanary

pull/757/head
Alex Baker 6 years ago
parent c74b8c7f63
commit 02d09b0181

@ -110,7 +110,7 @@ final DAGGER_VERSION = '2.16'
final BUTTERKNIFE_VERSION = '9.0.0-rc1'
final STETHO_VERSION = '1.5.0'
final WORK_VERSION = '1.0.0-alpha10'
final LEAKCANARY_VERSION = '1.6.1'
final LEAKCANARY_VERSION = '1.6.2'
dependencies {
implementation project(":dav4android")

@ -30,7 +30,9 @@ public class BuildSetup {
if (LeakCanary.isInAnalyzerProcess(context)) {
return false;
}
LeakCanary.install(application);
if (preferences.getBoolean(R.string.p_leak_canary, false)) {
LeakCanary.install(application);
}
if (preferences.getBoolean(R.string.p_strict_mode, false)) {
StrictMode.setThreadPolicy(
new StrictMode.ThreadPolicy.Builder()

@ -276,6 +276,7 @@
<string name="debug_consume">Consume</string>
<string name="debug_strict_mode">Strict mode</string>
<string name="debug_leak_canary">LeakCanary</string>
<string name="debug_pro">Unlock pro</string>
<string name="debug_buy">Buy</string>
<string name="debug">Debug</string>
@ -284,6 +285,7 @@
<string name="p_background_sync">gtask_background_sync</string>
<string name="p_bundle_notifications">bundle_notifications</string>
<string name="p_strict_mode">strict_mode</string>
<string name="p_leak_canary">leak_canary</string>
<string name="p_debug_pro">debug_pro</string>
<string name="warned_play_services">warned_play_services</string>
<string name="p_background_sync_unmetered_only">background_sync_unmetered_only</string>

@ -4,6 +4,10 @@
<PreferenceCategory
android:title="@string/debug">
<CheckBoxPreference
android:key="@string/p_leak_canary"
android:title="@string/debug_leak_canary" />
<CheckBoxPreference
android:key="@string/p_strict_mode"
android:title="@string/debug_strict_mode"/>

Loading…
Cancel
Save