ForegroundUpdater


public interface ForegroundUpdater


Manages updating android.app.Notifications when a ListenableWorker transitions to running in the context of a foreground android.app.Service.

Summary

Public methods

abstract @NonNull ListenableFuture<Void>
setForegroundAsync(
    @NonNull Context context,
    @NonNull UUID id,
    @NonNull ForegroundInfo foregroundInfo
)

Public methods

setForegroundAsync

Added in 2.3.0
abstract @NonNull ListenableFuture<VoidsetForegroundAsync(
    @NonNull Context context,
    @NonNull UUID id,
    @NonNull ForegroundInfo foregroundInfo
)
Parameters
@NonNull Context context

The application Context.

@NonNull UUID id

The UUID identifying the ListenableWorker

@NonNull ForegroundInfo foregroundInfo

The ForegroundInfo

Returns
@NonNull ListenableFuture<Void>

@return The ListenableFuture which resolves after the ListenableWorker transitions to running in the context of a foreground android.app.Service.