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()
Returns the
RefWatcher installed via
AndroidRefWatcherBuilder.buildAndInstall(), and RefWatcher.DISABLED is no
RefWatcher has been installed. |
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.
|
@NonNull
public static com.squareup.leakcanary.RefWatcher install(@NonNull
android.app.Application application)
RefWatcher that works out of the box, and starts watching activity
references (on ICS+).@NonNull public static com.squareup.leakcanary.RefWatcher installedRefWatcher()
RefWatcher installed via
AndroidRefWatcherBuilder.buildAndInstall(), and RefWatcher.DISABLED is no
RefWatcher has been installed.@NonNull public static AndroidRefWatcherBuilder refWatcher(@NonNull android.content.Context context)
public static void enableDisplayLeakActivity(@NonNull
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(@NonNull
LeakDirectoryProvider leakDirectoryProvider)
setLeakDirectoryProvider(LeakDirectoryProvider) instead.public static void setLeakDirectoryProvider(@NonNull
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.@NonNull
public static java.lang.String leakInfo(@NonNull
android.content.Context context,
@NonNull
com.squareup.leakcanary.HeapDump heapDump,
@NonNull
com.squareup.leakcanary.AnalysisResult result,
boolean detailed)
public static boolean isInAnalyzerProcess(@NonNull
android.content.Context context)
HeapAnalyzerService, which is
a different process than the normal app process.