SyncWorker

class SyncWorker @AssistedInject constructor(@Assisted context: Context, @Assisted workerParameters: WorkerParameters, ioDispatcher: CoroutineDispatcher, homeRepository: HomeRepository) : CoroutineWorker

Worker to sync data.

Parameters

context

The Context.

workerParameters
ioDispatcher

The CoroutineDispatcher for I/O operations.

homeRepository

Constructors

Link copied to clipboard
@AssistedInject
constructor(@Assisted context: Context, @Assisted workerParameters: WorkerParameters, ioDispatcher: CoroutineDispatcher, homeRepository: HomeRepository)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open val coroutineContext: CoroutineDispatcher

Functions

Link copied to clipboard
open suspend override fun doWork(): ListenableWorker.Result

Performs the work to sync data.

Link copied to clipboard
open suspend override fun getForegroundInfo(): ForegroundInfo

Provides the foreground information for the worker.

Link copied to clipboard
override fun getForegroundInfoAsync(): ListenableFuture<ForegroundInfo>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@RequiresApi(value = 31)
fun getStopReason(): Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
override fun onStopped()
Link copied to clipboard
suspend fun setForeground(foregroundInfo: ForegroundInfo)
Link copied to clipboard
fun setForegroundAsync(@NonNull foregroundInfo: ForegroundInfo): ListenableFuture
Link copied to clipboard
suspend fun setProgress(data: Data)
Link copied to clipboard
open fun setProgressAsync(@NonNull data: Data): ListenableFuture
Link copied to clipboard
Link copied to clipboard
override fun startWork(): ListenableFuture<ListenableWorker.Result>
Link copied to clipboard