AndroidStorageUsagePlatformActions

Android implementation that measures and deletes app-private storage used by the usage screen.

Author

Dmitriy Moroz

Parameters

context

Android context whose app-private cache and files directories are inspected.

Constructors

Link copied to clipboard
constructor(context: Context)

Properties

Link copied to clipboard
private val context: Context

Functions

Link copied to clipboard
open suspend override fun clearAllDownloadedModels()

Deletes every downloaded model directory visible to the platform.

Link copied to clipboard
open suspend override fun clearAppCache()

Deletes app cache files. Callers are responsible for showing confirmation first.

Link copied to clipboard
open suspend override fun getAllDownloadedModelsBytes(): Long

Returns total bytes occupied by every downloaded model directory visible to the platform.

Link copied to clipboard
open suspend override fun getAppCacheBytes(): Long

Returns the current app cache directory size in bytes.

Link copied to clipboard
open suspend override fun getDownloadedModelsBytes(modelIds: List<String>): Long

Returns total bytes occupied by downloaded model directories for modelIds.

Link copied to clipboard
open fun mapStorageBytesForUi(bytes: Long): Long

Converts a raw storage counter into a user-visible amount.