Package 

Class AndroidDetectLeaksAssert

  • All Implemented Interfaces:
    leakcanary.DetectLeaksAssert

    
    public final class AndroidDetectLeaksAssert
     implements DetectLeaksAssert
                        

    Default DetectLeaksAssert implementation. Uses public helpers so you should be able to create our own implementation if needed.

    Leak detection can be skipped by annotating tests with SkipLeakDetection which requires the TestDescriptionHolder test rule be applied and evaluating when assertNoLeaks is called.

    For improved leak detection, you should consider updating LeakCanary.Config.leakingObjectFinder to FilteringLeakingObjectFinder(AndroidObjectInspectors.appLeakingObjectFilters) when running in instrumentation tests. This changes leak detection from being incremental (based on AppWatcher to also scanning for all objects of known types in the heap).