android-components / mozilla.components.service.fxa.sync / WorkManagerSyncDispatcher

WorkManagerSyncDispatcher

class WorkManagerSyncDispatcher : SyncDispatcher, Observable<SyncStatusObserver>, Closeable (source)

Constructors

Name Summary
<init> WorkManagerSyncDispatcher(context: <ERROR CLASS>, supportedEngines: Set<SyncEngine>)

Functions

Name Summary
close fun close(): Unit
isSyncActive fun isSyncActive(): Boolean
startPeriodicSync fun startPeriodicSync(unit: TimeUnit, period: Long): Unit
Periodic background syncing is mainly intended to reduce workload when we sync during application startup.
stopPeriodicSync fun stopPeriodicSync(): Unit
Disables periodic syncing in the background. Currently running syncs may continue until completion. Safe to call this even if periodic syncing isn’t currently enabled.
syncNow fun syncNow(reason: SyncReason, debounce: Boolean): Unit
workersStateChanged fun workersStateChanged(isRunning: Boolean): Unit

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.