|
|
|
@ -3,8 +3,14 @@ package org.tasks;
|
|
|
|
|
import android.app.Application;
|
|
|
|
|
import android.content.Context;
|
|
|
|
|
import android.os.StrictMode;
|
|
|
|
|
import com.facebook.stetho.Stetho;
|
|
|
|
|
import com.facebook.stetho.timber.StethoTree;
|
|
|
|
|
import com.facebook.flipper.android.AndroidFlipperClient;
|
|
|
|
|
import com.facebook.flipper.android.utils.FlipperUtils;
|
|
|
|
|
import com.facebook.flipper.core.FlipperClient;
|
|
|
|
|
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
|
|
|
|
|
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
|
|
|
|
|
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
|
|
|
|
|
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
|
|
|
|
|
import com.facebook.soloader.SoLoader;
|
|
|
|
|
import com.squareup.leakcanary.LeakCanary;
|
|
|
|
|
import javax.inject.Inject;
|
|
|
|
|
import org.tasks.injection.ForApplication;
|
|
|
|
@ -24,9 +30,13 @@ public class BuildSetup {
|
|
|
|
|
|
|
|
|
|
public boolean setup() {
|
|
|
|
|
Timber.plant(new Timber.DebugTree());
|
|
|
|
|
if (preferences.getBoolean(R.string.p_stetho, false)) {
|
|
|
|
|
Timber.plant(new StethoTree());
|
|
|
|
|
Stetho.initializeWithDefaults(context);
|
|
|
|
|
if (preferences.getBoolean(R.string.p_flipper, false) && FlipperUtils.shouldEnableFlipper(context)) {
|
|
|
|
|
SoLoader.init(context, false);
|
|
|
|
|
FlipperClient client = AndroidFlipperClient.getInstance(context);
|
|
|
|
|
client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
|
|
|
|
|
client.addPlugin(new DatabasesFlipperPlugin(context));
|
|
|
|
|
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
|
|
|
|
|
client.start();
|
|
|
|
|
}
|
|
|
|
|
Application application = (Application) context.getApplicationContext();
|
|
|
|
|
if (LeakCanary.isInAnalyzerProcess(context)) {
|
|
|
|
|