LeakCanary 2.2

pull/898/head
Alex Baker 4 years ago
parent 53c1e81249
commit fdbc2feb95

@ -13,6 +13,7 @@ import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
import com.facebook.soloader.SoLoader;
import javax.inject.Inject;
import leakcanary.AppWatcher;
import org.tasks.injection.ForApplication;
import org.tasks.preferences.Preferences;
import timber.log.Timber;
@ -33,6 +34,9 @@ public class BuildSetup {
Application application = (Application) context.getApplicationContext();
SoLoader.init(application, false);
if (!preferences.getBoolean(R.string.p_leakcanary, false)) {
AppWatcher.setConfig(AppWatcher.getConfig().newBuilder().enabled(false).build());
}
if (preferences.getBoolean(R.string.p_flipper, false) && FlipperUtils.shouldEnableFlipper(context)) {
FlipperClient client = AndroidFlipperClient.getInstance(application);
client.addPlugin(new InspectorFlipperPlugin(application, DescriptorMapping.withDefaults()));

@ -29,6 +29,7 @@ public class DebugPreferences extends InjectingPreferenceActivity {
for (int pref :
asList(
R.string.p_leakcanary,
R.string.p_flipper,
R.string.p_strict_mode_vm,
R.string.p_strict_mode_thread)) {

@ -4,6 +4,7 @@
<string name="backup_api_key">AEdPqrEAAAAImTf5DbfspggWrU9h06685ONycpUVwJj1JwawQQ</string>
<string name="debug_strict_mode_thread">Strict mode - Thread</string>
<string name="debug_strict_mode_vm">Strict mode - VM</string>
<string name="debug_leakcanary">LeakCanary</string>
<string name="debug_flipper">Flipper</string>
<string name="debug_pro">Unlock pro</string>
<string name="debug_purchase">Purchase %s</string>

@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<CheckBoxPreference
android:key="@string/p_leakcanary"
android:title="@string/debug_leakcanary" />
<CheckBoxPreference
android:key="@string/p_flipper"
android:title="@string/debug_flipper"/>

@ -290,6 +290,7 @@
<string name="p_bundle_notifications">bundle_notifications</string>
<string name="p_strict_mode_vm">strict_mode_vm</string>
<string name="p_strict_mode_thread">strict_mode_thread</string>
<string name="p_leakcanary">p_leakcanary</string>
<string name="p_flipper">p_flipper</string>
<string name="p_debug_pro">debug_pro</string>
<string name="warned_play_services">warned_play_services</string>

@ -5,7 +5,7 @@ object Versions {
const val dagger = "2.26"
const val butterknife = "10.2.0"
const val work = "2.3.0"
const val leakcanary = "2.1"
const val leakcanary = "2.2"
const val room = "2.2.3"
const val crashlytics = "2.10.1"
const val firebase = "17.2.1"

Loading…
Cancel
Save