<lambda>null1package leakcanary 2 3 import shark.HeapAnalysis 4 5 /** 6 * Deprecated, add to LeakCanary.config.eventListeners instead. 7 * Called after [leakcanary.EventListener.Event.HeapAnalysisDone]. 8 */ 9 @Deprecated(message = "Add to LeakCanary.config.eventListeners instead") 10 fun interface OnHeapAnalyzedListener { 11 12 /** 13 * @see OnHeapAnalyzedListener 14 */ 15 fun onHeapAnalyzed(heapAnalysis: HeapAnalysis) 16 17 companion object { 18 /** 19 * Utility function to create a [OnHeapAnalyzedListener] from the passed in [block] lambda 20 * instead of using the anonymous `object : OnHeapAnalyzedListener` syntax. 21 * 22 * Usage: 23 * 24 * ```kotlin 25 * val listener = OnHeapAnalyzedListener { 26 * 27 * } 28 * ``` 29 */ 30 inline operator fun invoke(crossinline block: (HeapAnalysis) -> Unit): OnHeapAnalyzedListener = 31 OnHeapAnalyzedListener { heapAnalysis -> block(heapAnalysis) } 32 } 33 } 34