StorageUsagePlatformActions

Platform bridge for filesystem storage usage operations.

Common code owns the screen behavior, while platform implementations know how to read app cache directories and downloaded model files safely on their filesystem.

Author

Dmitriy Moroz

Inheritors

Functions

Link copied to clipboard
abstract suspend fun clearAllDownloadedModels()

Deletes every downloaded model directory visible to the platform.

Link copied to clipboard
abstract suspend fun clearAppCache()

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

Link copied to clipboard
abstract suspend fun getAllDownloadedModelsBytes(): Long

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

Link copied to clipboard
abstract suspend fun getAppCacheBytes(): Long

Returns the current app cache directory size in bytes.

Link copied to clipboard
abstract suspend 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.