OfflineManager

Manages the offline packs and ambient cache that belong to one map runtime.

Properties

Link copied to clipboard
abstract val packs: Set<OfflinePack>

All offline packs registered with this manager. Backed by Compose snapshot state.

Functions

Link copied to clipboard
abstract suspend fun clearAmbientCache()

Deletes ambient-cache resources that no offline pack needs.

Link copied to clipboard
abstract suspend fun create(definition: OfflinePackDefinition, metadata: ByteArray = ByteArray(0)): OfflinePack

Creates a paused offline pack for definition. Call resume to start its download.

Link copied to clipboard
abstract suspend fun delete(pack: OfflinePack)

Unregisters pack and permits the cache to remove resources that no remaining pack needs.

Link copied to clipboard
abstract suspend fun invalidate(pack: OfflinePack)

Checks the resources in pack against the server and downloads changed resources.

Link copied to clipboard
abstract suspend fun invalidateAmbientCache()

Checks ambient-cache resources against the server and downloads changed resources.

Link copied to clipboard
abstract suspend fun mergeDatabase(databaseFile: Path): Set<OfflinePack>

Merges the offline packs and their resources from databaseFile into this manager's database.

Link copied to clipboard
abstract fun pause(pack: OfflinePack)

Pauses the download of pack.

Link copied to clipboard
abstract fun resume(pack: OfflinePack)

Resumes the download of pack.

Link copied to clipboard
abstract suspend fun setMaximumAmbientCacheSize(size: Long)

Sets the maximum ambient-cache size in bytes. A size of zero disables ambient caching.