App-Support > healthstack.app.sync > SyncWorker

SyncWorker

[androidJvm]
class SyncWorker(context: Context, params: WorkerParameters) : CoroutineWorker

A CoroutineWorker that performs synchronization of health data with the backend.

Constructors

SyncWorker

[androidJvm]
fun SyncWorker(context: Context, params: WorkerParameters)

Functions

Name Summary
doWork

[androidJvm]
open suspend override fun doWork(): ListenableWorker.Result
The main entry point of the worker that performs the synchronization.

getApplicationContext

[androidJvm]
@NonNull
fun getApplicationContext(): Context

getBackgroundExecutor

[androidJvm]
@RestrictTo(value = [RestrictTo.Scope.LIBRARY_GROUP])
@NonNull
open fun getBackgroundExecutor(): Executor

getForegroundInfo

[androidJvm]
open suspend fun getForegroundInfo(): ForegroundInfo

getForegroundInfoAsync

[androidJvm]
override fun getForegroundInfoAsync(): ListenableFuture<ForegroundInfo>

getId

[androidJvm]
@NonNull
fun getId(): UUID

getInputData

[androidJvm]
@NonNull
fun getInputData(): Data

getNetwork

[androidJvm]
@RequiresApi(value = 28)
@Nullable
fun getNetwork(): Network?

getRunAttemptCount

[androidJvm]
@IntRange(from = 0)
fun getRunAttemptCount(): Int

getTags

[androidJvm]
@NonNull
fun getTags(): MutableSet<String>

getTaskExecutor

[androidJvm]
@RestrictTo(value = [RestrictTo.Scope.LIBRARY_GROUP])
@NonNull
open fun getTaskExecutor(): TaskExecutor

getTriggeredContentAuthorities

[androidJvm]
@RequiresApi(value = 24)
@NonNull
fun getTriggeredContentAuthorities(): MutableList<String>

getTriggeredContentUris

[androidJvm]
@RequiresApi(value = 24)
@NonNull
fun getTriggeredContentUris(): MutableList<Uri>

getWorkerFactory

[androidJvm]
@RestrictTo(value = [RestrictTo.Scope.LIBRARY_GROUP])
@NonNull
open fun getWorkerFactory(): WorkerFactory

isRunInForeground

[androidJvm]
@RestrictTo(value = [RestrictTo.Scope.LIBRARY_GROUP])
open fun isRunInForeground(): Boolean

isStopped

[androidJvm]
fun isStopped(): Boolean

isUsed

[androidJvm]
@RestrictTo(value = [RestrictTo.Scope.LIBRARY_GROUP])
fun isUsed(): Boolean

onStopped

[androidJvm]
override fun onStopped()

setForeground

[androidJvm]
suspend fun setForeground(foregroundInfo: ForegroundInfo)

setForegroundAsync

[androidJvm]
@NonNull
fun setForegroundAsync(@NonNullforegroundInfo: ForegroundInfo): ListenableFuture<Void>

setProgress

[androidJvm]
suspend fun setProgress(data: Data)

setProgressAsync

[androidJvm]
@NonNull
open fun setProgressAsync(@NonNulldata: Data): ListenableFuture<Void>

setRunInForeground

[androidJvm]
@RestrictTo(value = [RestrictTo.Scope.LIBRARY_GROUP])
open fun setRunInForeground(runInForeground: Boolean)

setUsed

[androidJvm]
@RestrictTo(value = [RestrictTo.Scope.LIBRARY_GROUP])
fun setUsed()

startWork

[androidJvm]
override fun startWork(): ListenableFuture<ListenableWorker.Result>

stop

[androidJvm]
@RestrictTo(value = [RestrictTo.Scope.LIBRARY_GROUP])
fun stop()

Properties

Name Summary
coroutineContext

[androidJvm]
open val coroutineContext: CoroutineDispatcher