public final class LeakCanary
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
enableDisplayLeakActivity(android.content.Context context)
Blocking inter process call that enables the
DisplayLeakActivity. |
static com.squareup.leakcanary.RefWatcher |
install(android.app.Application application)
Creates a
RefWatcher that works out of the box, and starts watching activity
references (on ICS+). |
static com.squareup.leakcanary.RefWatcher |
installedRefWatcher() |
static boolean |
isInAnalyzerProcess(android.content.Context context)
Whether the current process is the process running the
HeapAnalyzerService, which is
a different process than the normal app process. |
static java.lang.String |
leakInfo(android.content.Context context,
com.squareup.leakcanary.HeapDump heapDump,
com.squareup.leakcanary.AnalysisResult result,
boolean detailed)
Returns a string representation of the result of a heap analysis.
|
static AndroidRefWatcherBuilder |
refWatcher(android.content.Context context) |
static void |
setDisplayLeakActivityDirectoryProvider(LeakDirectoryProvider leakDirectoryProvider)
Deprecated.
Use
setLeakDirectoryProvider(LeakDirectoryProvider) instead. |
static void |
setLeakDirectoryProvider(LeakDirectoryProvider leakDirectoryProvider)
Used to customize the location for the storage of heap dumps.
|
public static com.squareup.leakcanary.RefWatcher install(android.app.Application application)
RefWatcher that works out of the box, and starts watching activity
references (on ICS+).public static com.squareup.leakcanary.RefWatcher installedRefWatcher()
RefWatcher installed via AndroidRefWatcherBuilder.buildAndInstall().public static AndroidRefWatcherBuilder refWatcher(android.content.Context context)
public static void enableDisplayLeakActivity(android.content.Context context)
DisplayLeakActivity. When you first
install the app, DisplayLeakActivity is disabled by default and will only be enabled
once a potential leak has been found and the analysis starts. You can call this method to
enable DisplayLeakActivity before any potential leak has been detected.@Deprecated public static void setDisplayLeakActivityDirectoryProvider(LeakDirectoryProvider leakDirectoryProvider)
setLeakDirectoryProvider(LeakDirectoryProvider) instead.public static void setLeakDirectoryProvider(LeakDirectoryProvider leakDirectoryProvider)
DefaultLeakDirectoryProvider.java.lang.IllegalStateException - if a LeakDirectoryProvider has already been set, including
if the default has been automatically set when installing the ref watcher.public static java.lang.String leakInfo(android.content.Context context,
com.squareup.leakcanary.HeapDump heapDump,
com.squareup.leakcanary.AnalysisResult result,
boolean detailed)
public static boolean isInAnalyzerProcess(android.content.Context context)
HeapAnalyzerService, which is
a different process than the normal app process.