NetworkUsageRepository

Persists and observes app network usage counters.

Author

Dmitriy Moroz

Inheritors

Functions

Link copied to clipboard
abstract fun enqueueIncrement(bucket: NetworkUsageBucket, bytes: Long)

Adds a positive byte delta in repository-owned background scope.

Link copied to clipboard
abstract suspend fun get(): NetworkUsage

Returns a one-shot snapshot of the persisted traffic counters.

Link copied to clipboard
abstract suspend fun increment(bucket: NetworkUsageBucket, bytes: Long)

Adds a positive byte delta to the requested bucket and suspends until it is persisted.

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

Observes the current traffic counters and every subsequent Room update.

Link copied to clipboard
abstract suspend fun reset()

Clears all persisted counters after the user confirms reset statistics.