Manual install leak canary

This commit is contained in:
M66B
2022-04-23 22:46:59 +02:00
parent 0ea320d4fa
commit 11c696e3b4
5 changed files with 17 additions and 1 deletions

View File

@@ -19,6 +19,7 @@ package eu.faircode.email;
Copyright 2018-2022 by Marcel Bokhorst (M66B)
*/
import android.app.Application;
import android.content.Intent;
import androidx.annotation.NonNull;
@@ -37,6 +38,10 @@ import shark.ObjectInspector;
import shark.ObjectReporter;
public class CoalMine {
static void install(@NonNull Application app) {
AppWatcher.INSTANCE.manualInstall(app, 10000);
}
static void setup(boolean enabled) {
List<ObjectInspector> inspectors = new ArrayList<>(LeakCanary.getConfig().getObjectInspectors());
@@ -89,6 +94,7 @@ public class CoalMine {
.objectInspectors(inspectors)
.build();
LeakCanary.setConfig(config);
LeakCanary.INSTANCE.showLeakDisplayActivityLauncherIcon(true);
}