BackoffPolicy

public enum BackoffPolicy extends Enum


An enumeration of backoff policies when retrying work. These policies are used when you have a return ListenableWorker.Result.retry from a worker to determine the correct backoff time. Backoff policies are set in WorkRequest.Builder.setBackoffCriteria or one of its variants.

Summary

Enum Values

EXPONENTIAL

Used to indicate that WorkManager should increase the backoff time exponentially

LINEAR

Used to indicate that WorkManager should increase the backoff time linearly

Public methods

final @NonNull BackoffPolicy

Returns the enum constant of this type with the specified name.

final @NonNull BackoffPolicy[]

Returns an array containing the constants of this enum type, in the order they're declared.

Enum Values

EXPONENTIAL

BackoffPolicy BackoffPolicy.EXPONENTIAL

Used to indicate that WorkManager should increase the backoff time exponentially

LINEAR

BackoffPolicy BackoffPolicy.LINEAR

Used to indicate that WorkManager should increase the backoff time linearly

Public methods

valueOf

Added in 1.0.0
public final @NonNull BackoffPolicy valueOf(@NonNull String value)

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Throws
kotlin.IllegalArgumentException

if this enum type has no constant with the specified name

values

Added in 1.0.0
public final @NonNull BackoffPolicy[] values()

Returns an array containing the constants of this enum type, in the order they're declared.

This method may be used to iterate over the constants.