BinderUpdateTracer

A UiStateReadRecords.BinderEventListener that tracks per-binder shouldUpdate results and bind durations for observability.

Data is accumulated in a thread-local map keyed by renderUnitId. This data is drained by the BinderUpdateDetector when it receives the corresponding RenderUnitUpdated debug event (which fires on the same thread, immediately after all binder operations complete).

When isEnabled is false (default), callbacks are no-ops with negligible overhead (one static field read per call).

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
data class BinderUpdateInfo(val binderKey: String, val binderType: BinderType, val shouldUpdate: Boolean, val bindDurationNs: Long? = null, val depChanges: List<DepChange>? = null, val isStateReadRebind: Boolean = false, val depsCollected: Boolean = true)
Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun onBindComplete(binderId: BinderId, durationNs: Long)

Called after onBind completes with the elapsed duration.

Link copied to clipboard
open override fun onDepsChanged(binderId: BinderId, changes: List<DepChange>)

Called when a binder is rebound because its deps changed. Empty means the deps compared equal and something else caused the rebind.

Link copied to clipboard
open override fun onDepsNotCollected(binderId: BinderId)

Called instead of onDepsChanged when the binder declares deps but they were not diffed, so a null change list means "nobody looked" rather than "no dep model".

Link copied to clipboard
open override fun onShouldUpdate(binderId: BinderId, result: Boolean)

Called after shouldUpdate completes with the result.

Link copied to clipboard
open override fun onStateReadRebind(binderId: BinderId)

Called when a binder is rebound because a state value it read was updated.