StorageUsageObserver

Shared invalidation source for storage usage snapshots.

Storage size comes from several non-Room sources, including cache directories and downloaded model files. Those sources do not expose flows, so writers notify this observer after mutations and both Settings and the standalone storage screen reload a fresh snapshot from the same stream.

Author

Dmitriy Moroz

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
private val revision: MutableStateFlow<Long>

Functions

Link copied to clipboard

Invalidates the current snapshot after cache, gallery, or model files change.

Link copied to clipboard
fun observe(): Flow<Long>

Emits a monotonically increasing revision whenever storage usage should be reloaded.