public ServiceHeapDumpListener(Context context, Class<? extends AbstractAnalysisResultService> listenerServiceClass) { LeakCanaryInternals.setEnabled(context, listenerServiceClass, true); LeakCanaryInternals.setEnabled(context, HeapAnalyzerService.class, true); this.listenerServiceClass = (Class) Preconditions.checkNotNull(listenerServiceClass, "listenerServiceClass"); this.context = ((Context) Preconditions.checkNotNull(context, "context")) .getApplicationContext(); }
public ServiceHeapDumpListener(Context context, Class<? extends AbstractAnalysisResultService> listenerServiceClass) { setEnabled(context, listenerServiceClass, true); setEnabled(context, HeapAnalyzerService.class, true); this.listenerServiceClass = checkNotNull(listenerServiceClass, "listenerServiceClass"); this.context = checkNotNull(context, "context").getApplicationContext(); }
public void analyze(HeapDump heapDump) { Preconditions.checkNotNull(heapDump, "heapDump"); HeapAnalyzerService.runAnalysis(this.context, heapDump, this.listenerServiceClass); }
public static boolean isInAnalyzerProcess(Context context) { return LeakCanaryInternals.isInServiceProcess(context, HeapAnalyzerService.class); }
@Override public void analyze(HeapDump heapDump) { checkNotNull(heapDump, "heapDump"); HeapAnalyzerService.runAnalysis(context, heapDump, listenerServiceClass); }
/** * Whether the current process is the process running the {@link HeapAnalyzerService}, which is * a different process than the normal app process. */ public static boolean isInAnalyzerProcess(Context context) { return isInServiceProcess(context, HeapAnalyzerService.class); }