snapshot

abstract suspend fun snapshot(): ByteArray?

Produce the app-data blob to include in the next backup. Return null when there's nothing to back up — the SDK then passes appMetadata = null to AppStateBackup.backup, keeping the blob lean (just the length prefix + AES-GCM overhead).

Called from the backup pipeline, inside a coroutine on Dispatchers.IO by convention but not enforced. Implementations should not assume any particular dispatcher.