android-components / mozilla.components.service.sync.logins / SyncableLoginsStore


data class SyncableLoginsStore : LockableStore (source)

Wraps AsyncLoginsStorage instance along with a lazy encryption key.

This helper class lives here and not alongside AsyncLoginsStorage because we don’t want to force a service-sync-logins dependency (which has a heavy native library dependency) on consumers of FirefoxSyncFeature.


Name Summary
<init> SyncableLoginsStore(store: AsyncLoginsStorage, key: () -> Deferred<String>)
Wraps AsyncLoginsStorage instance along with a lazy encryption key.


Name Summary
key val key: () -> Deferred<String>
store val store: AsyncLoginsStorage


Name Summary
getHandle fun getHandle(): Long
This should be removed. See:
sync suspend fun sync(authInfo: SyncAuthInfo): SyncStatus
Performs a sync.
unlocked suspend fun <T> unlocked(encryptionKey: String, block: suspend (store: LockableStore) -> T): T
Executes a block while keeping the store in an unlocked state. Store is locked once block is finished.
withUnlocked suspend fun <T> withUnlocked(block: suspend (AsyncLoginsStorage) -> T): T
Run some block which operates over an unlocked instance of AsyncLoginsStorage. Database is locked once block is done.

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.