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

SyncableLoginsStorage

class SyncableLoginsStorage : LoginsStorage, SyncableStore, AutoCloseable (source)

An implementation of LoginsStorage backed by application-services’ logins library. Synchronization support is provided both directly (via sync) when only syncing this storage layer, or via getHandle when syncing multiple stores. Use the latter in conjunction with FxaAccountManager.

Constructors

Name Summary
<init> SyncableLoginsStorage(context: <ERROR CLASS>, key: String)
An implementation of LoginsStorage backed by application-services’ logins library. Synchronization support is provided both directly (via sync) when only syncing this storage layer, or via getHandle when syncing multiple stores. Use the latter in conjunction with FxaAccountManager.

Functions

Name Summary
add suspend fun add(login: Login): String
close fun close(): Unit
delete suspend fun delete(id: String): Boolean
ensureValid suspend fun ensureValid(login: Login): <ERROR CLASS>
get suspend fun get(guid: String): Login?
getByBaseDomain suspend fun getByBaseDomain(origin: String): List<Login>
getHandle fun getHandle(): Long
This should be removed. See: https://github.com/mozilla/application-services/issues/1877
getPotentialDupesIgnoringUsername suspend fun getPotentialDupesIgnoringUsername(login: Login): List<Login>
importLoginsAsync suspend fun importLoginsAsync(logins: List<Login>): <ERROR CLASS>
list suspend fun list(): List<Login>
sync suspend fun sync(syncInfo: SyncUnlockInfo): SyncTelemetryPing
Synchronizes the logins storage layer with a remote layer. If synchronizing multiple stores, avoid using this - prefer setting up sync via FxaAccountManager instead.
touch suspend fun touch(guid: String): <ERROR CLASS>
update suspend fun update(login: Login): <ERROR CLASS>
warmUp suspend fun warmUp(): <ERROR CLASS>
“Warms up” this storage layer by establishing the database connection.
wipe suspend fun wipe(): <ERROR CLASS>
wipeLocal suspend fun wipeLocal(): <ERROR CLASS>

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.