SettingsViewModel

class SettingsViewModel @Inject constructor(keyRepository: KeyRepository, settingsRepository: SettingsRepository, apiAppDao: ApiAppDao, apiAllowedKeyDao: ApiAllowedKeyDao) : ViewModel

ViewModel that combines persisted settings, keys, granted API apps and accessibility state into a single SettingsUiState and applies user changes.

Constructors

Link copied to clipboard
@Inject
constructor(keyRepository: KeyRepository, settingsRepository: SettingsRepository, apiAppDao: ApiAppDao, apiAllowedKeyDao: ApiAllowedKeyDao)

Properties

Link copied to clipboard
val uiState: StateFlow<SettingsUiState>

Functions

Link copied to clipboard
open fun addCloseable(closeable: AutoCloseable)
fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
Link copied to clipboard

Updates the cached accessibility-service enabled flag.

Link copied to clipboard

Refreshes all stored keys from the configured keyserver, reporting progress via status.

Link copied to clipboard
fun revokeApiApp(packageName: String)

Revokes all API access and allowed keys for the given caller package.

Link copied to clipboard

Allows or blocks screenshots/screen recording of sensitive screens.

Link copied to clipboard
fun setAppLanguage(language: String)

Sets the in-app language override.

Link copied to clipboard
fun setAutocrypt(enabled: Boolean)

Enables or disables Autocrypt header handling.

Link copied to clipboard

Toggles periodic backup reminders.

Link copied to clipboard

Sets the key preselected for encryption, or clears it when null.

Link copied to clipboard
fun setDefaultSignKey(keyId: Long?)

Sets the key preselected for signing, or clears it when null.

Link copied to clipboard

Enables or disables keyserver lookups.

Link copied to clipboard

Sets the keyserver base URL (trimmed).

Link copied to clipboard

Enables or disables the encrypt/decrypt overlay globally.

Link copied to clipboard

Toggles showing fingerprints in the key list.

Link copied to clipboard

Toggles visibility of the floating overlay action buttons.