AndroidSettingsPlatformActions

private class AndroidSettingsPlatformActions(val context: Context, val launchStoragePermission: (Array<String>) -> Unit, val launchNotificationPermission: (String) -> Unit, val storagePermissionResult: MutableState<CompletableDeferred<Boolean>?>, val notificationPermissionResult: MutableState<CompletableDeferred<Boolean>?>) : SettingsPlatformActions(source)

Android bridge used by Settings for permissions plus cache/model byte summaries.

Author

Dmitriy Moroz

Parameters

context

Android context used for permissions, app-private storage, links, and toasts.

launchStoragePermission

Launcher for Android storage/media runtime permissions.

launchNotificationPermission

Launcher for Android notification runtime permission.

storagePermissionResult

Pending storage permission continuation.

notificationPermissionResult

Pending notification permission continuation.

Constructors

Link copied to clipboard
constructor(context: Context, launchStoragePermission: (Array<String>) -> Unit, launchNotificationPermission: (String) -> Unit, storagePermissionResult: MutableState<CompletableDeferred<Boolean>?>, notificationPermissionResult: MutableState<CompletableDeferred<Boolean>?>)

Properties

Link copied to clipboard

Localization key for the warning shown under the background generation toggle.

Link copied to clipboard
private val context: Context
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
private val notificationPermissionResult: MutableState<CompletableDeferred<Boolean>?>
Link copied to clipboard

True when saving generated images through MediaStore still needs a runtime storage permission.

Link copied to clipboard
private val storagePermissionResult: MutableState<CompletableDeferred<Boolean>?>
Link copied to clipboard
open override val supportsBackgroundGeneration: Boolean = true

True when this target can continue generation work after the app leaves foreground.

Functions

Link copied to clipboard
open suspend override fun clearAppCache()

Clears app cache files after a caller has shown destructive confirmation.

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 current app cache byte size for the Settings summary row.

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.

Link copied to clipboard
open override fun openAppSettings()

Opens this app's platform settings page.

Link copied to clipboard
open override fun openUrl(url: String)

Opens an external URL through the platform.

Link copied to clipboard
open suspend override fun requestNotificationPermission(): Boolean

Requests notification permission when the platform requires it for background generation.

Link copied to clipboard
open suspend override fun requestStoragePermission(): Boolean

Requests storage/media permission when the platform requires it for gallery saves.

Link copied to clipboard
open override fun shareLogFile()

Opens the problem-report channel with diagnostic context prepared by the platform.

Link copied to clipboard
open override fun showDeveloperModeUnlocked()

Shows platform feedback after developer mode is unlocked.