BackoffPolicy


enum BackoffPolicy : 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 functions

BackoffPolicy
valueOf(value: String)

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

Array<BackoffPolicy>

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

Public properties

EnumEntries<BackoffPolicy>

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Enum Values

EXPONENTIAL

val BackoffPolicy.EXPONENTIALBackoffPolicy

Used to indicate that WorkManager should increase the backoff time exponentially

LINEAR

val BackoffPolicy.LINEARBackoffPolicy

Used to indicate that WorkManager should increase the backoff time linearly

Public functions

valueOf

Added in 1.0.0
fun valueOf(value: String): BackoffPolicy

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
fun values(): Array<BackoffPolicy>

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.

Public properties

entries

val entriesEnumEntries<BackoffPolicy>

Returns a representation of an immutable list of all enum entries, in the order they're declared.

This method may be used to iterate over the enum entries.