The second Android 11 Developer Preview is now available, test it out and share your feedback.

ProgressUpdater

interface ProgressUpdater
androidx.work.ProgressUpdater

Updates progress for a androidx.work.ListenableWorker.

Summary

Public methods

abstract ListenableFuture<Void!>
updateProgress(@NonNull context: Context, @NonNull id: UUID, @NonNull data: Data)

Public methods

updateProgress

@NonNull abstract fun updateProgress(
    @NonNull context: Context,
    @NonNull id: UUID,
    @NonNull data: Data
): ListenableFuture<Void!>
Parameters
context Context: The application Context.
id UUID: The UUID identifying the ListenableWorker
data Data: The progress Data
Return
ListenableFuture<Void!> The ListenableFuture which resolves after progress is persisted.

Cancelling this ListenableFuture does not cancel the writes to the database to update progress.