SyncService

interface SyncService

Functions

Link copied to clipboard
abstract fun getSyncRequestStateFlow(): SharedFlow<SyncRequestState>

Get the SyncRequestState as a SharedFlow.

Link copied to clipboard
abstract fun getSyncState(): SyncState

This method returns the current sync state.

Link copied to clipboard
abstract fun getSyncStateLive(): LiveData<SyncState>

This method allows to listen the sync state.

Link copied to clipboard
abstract fun hasAlreadySynced(): Boolean

This methods return true if an initial sync has been processed.

Link copied to clipboard
abstract fun isSyncThreadAlive(): Boolean

This method returns true if the sync thread is alive, i.e. started.

Link copied to clipboard
abstract fun requireBackgroundSync()

Requires a one time background sync.

Link copied to clipboard
abstract fun startAutomaticBackgroundSync(timeOutInSeconds: Long, repeatDelayInSeconds: Long)

Launches infinite self rescheduling background syncs via the WorkManager.

Link copied to clipboard
abstract fun startSync(fromForeground: Boolean)

This method start the sync thread.

Link copied to clipboard
abstract fun stopAnyBackgroundSync()
Link copied to clipboard
abstract fun stopSync()

This method stop the sync thread.

Link copied to clipboard
abstract fun syncFlow(): SharedFlow<SyncResponse>

This method returns a flow of SyncResponse. New value will be pushed through the sync thread.