# androidx.work

*** ** * ** ***

WorkManager the recommended library for persistent work. Scheduled work is guaranteed to execute sometime after its `https://developer.android.com/reference/kotlin/androidx/work/Constraints` are met. WorkManager allows observation of work status and the ability to create complex chains of work.

WorkManager uses an underlying job dispatching service when available based on the following criteria:

- Uses JobScheduler for API 23+
- Uses a custom AlarmManager + BroadcastReceiver implementation for API 14-22

All work must be done in a `https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker` class. A simple implementation, `https://developer.android.com/reference/kotlin/androidx/work/Worker`, is recommended as the starting point for most developers. With the optional dependencies, you can also use `CoroutineWorker` or `RxWorker`. All background work is given a maximum of ten minutes to finish its execution. After this time has expired, the worker will be signalled to stop.

There are two types of work supported by WorkManager: `https://developer.android.com/reference/kotlin/androidx/work/OneTimeWorkRequest` and `https://developer.android.com/reference/kotlin/androidx/work/PeriodicWorkRequest`. OneTimeWorkRequests can be chained together into acyclic graphs. Work is eligible for execution when all of its prerequisites are complete. If any of its prerequisites fail or are cancelled, the work will never run.

WorkRequests can accept `https://developer.android.com/reference/kotlin/androidx/work/Constraints`, inputs (see `https://developer.android.com/reference/kotlin/androidx/work/Data`), and backoff criteria. WorkRequests can be tagged with human-readable Strings (see `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest.Builder#addTag(java.lang.String)`), and chains of work can be given a uniquely-identifiable name with conflict policies. \*

**Initializing WorkManager**

By default, WorkManager is initialized using a `ContentProvider` with a default `https://developer.android.com/reference/kotlin/androidx/work/Configuration`. ContentProviders are created and run before the `Application` object, so this allows the WorkManager singleton to be setup before your code can run in most cases. This is suitable for most developers. However, you can provide a custom `https://developer.android.com/reference/kotlin/androidx/work/Configuration` by using `https://developer.android.com/reference/kotlin/androidx/work/Configuration.Provider` or `https://developer.android.com/reference/kotlin/androidx/work/WorkManager#initialize(android.content.Context,androidx.work.Configuration)`.

**WorkManager and its Interactions with the OS**

WorkManager uses `BroadcastReceiver`s to monitor `https://developer.android.com/reference/kotlin/androidx/work/Constraints` on devices before API 23. The BroadcastReceivers are disabled on API 23 and up. In particular, WorkManager listens to the following `Intent`s:

- `android.intent.action.ACTION_POWER_CONNECTED`
- `android.intent.action.ACTION_POWER_DISCONNECTED`
- `android.intent.action.BATTERY_OKAY`
- `android.intent.action.BATTERY_LOW`
- `android.intent.action.DEVICE_STORAGE_LOW`
- `android.intent.action.DEVICE_STORAGE_OK`
- `android.net.conn.CONNECTIVITY_CHANGE`

In addition, WorkManager listens to system time changes and reboots to properly reschedule work in certain situations. For this, it listens to the following Intents:

<!-- -->

- `android.intent.action.BOOT_COMPLETED`
- `android.intent.action.TIME_SET`
- `android.intent.action.TIMEZONE_CHANGED`

WorkManager uses the following permissions:

- `android.permission.WAKE_LOCK` to make it can keep the device awake to complete work before API 23
- `android.permission.ACCESS_NETWORK_STATE` to listen to network changes before API 23 and monitor network `https://developer.android.com/reference/kotlin/androidx/work/Constraints`
- `android.permission.RECEIVE_BOOT_COMPLETED` to listen to reboots and reschedule work properly.

Note that WorkManager may enable or disable some of its BroadcastReceivers at runtime as needed. This has the side-effect of the system sending `ACTION_PACKAGE_CHANGED` broadcasts to your app. Please be aware of this use case and architect your app appropriately (especially if you are using widgets - see https://issuetracker.google.com/115575872).

## Interfaces

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/work/Clock` | The interface WorkManager uses to access to the current time. |
| `https://developer.android.com/reference/kotlin/androidx/work/Configuration.Provider` | A class that can provide the `https://developer.android.com/reference/kotlin/androidx/work/Configuration` for WorkManager and allow for on-demand initialization of WorkManager. |
| `https://developer.android.com/reference/kotlin/androidx/work/ExecutionEventListener` | Listener interface that is called for events related to a worker executing. |
| `https://developer.android.com/reference/kotlin/androidx/work/ForegroundUpdater` | Manages updating `https://developer.android.com/reference/android/app/Notification.html`s when a `https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker` transitions to running in the context of a foreground `https://developer.android.com/reference/android/app/Service.html`. |
| `https://developer.android.com/reference/kotlin/androidx/work/Operation` | An object that provides information about the execution of an asynchronous command being performed by `https://developer.android.com/reference/kotlin/androidx/work/WorkManager`. |
| `https://developer.android.com/reference/kotlin/androidx/work/ProgressUpdater` | Updates progress for a `https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker`. |
| `https://developer.android.com/reference/kotlin/androidx/work/RunnableScheduler` | Can be used to schedule `https://developer.android.com/reference/java/lang/Runnable.html`s after a delay in milliseconds. |
| `https://developer.android.com/reference/kotlin/androidx/work/ScheduleEventListener` | Listener interface that is called for events related to a worker's scheduling. |

## Classes

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/work/ArrayCreatingInputMerger` | An `https://developer.android.com/reference/kotlin/androidx/work/InputMerger` that attempts to merge the inputs, creating arrays when necessary. |
| `https://developer.android.com/reference/kotlin/androidx/work/Configuration` | The Configuration object used to customize `https://developer.android.com/reference/kotlin/androidx/work/WorkManager` upon initialization. |
| `https://developer.android.com/reference/kotlin/androidx/work/Configuration.Builder` | A Builder for `https://developer.android.com/reference/kotlin/androidx/work/Configuration`s. |
| `https://developer.android.com/reference/kotlin/androidx/work/Constraints` | A specification of the requirements that need to be met before a `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest` can run. |
| `https://developer.android.com/reference/kotlin/androidx/work/Constraints.Builder` | A Builder for a `https://developer.android.com/reference/kotlin/androidx/work/Constraints` object. |
| `https://developer.android.com/reference/kotlin/androidx/work/Constraints.ContentUriTrigger` | This class describes a content uri trigger on the `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest`: it should run when a local `content:` `https://developer.android.com/reference/android/net/Uri.html` is updated. |
| `https://developer.android.com/reference/kotlin/androidx/work/CoroutineWorker` | A `https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker` implementation that provides interop with Kotlin Coroutines. |
| `https://developer.android.com/reference/kotlin/androidx/work/Data` | A persistable set of key/value pairs which are used as inputs and outputs for `https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker`s. |
| `https://developer.android.com/reference/kotlin/androidx/work/Data.Builder` | A builder for `https://developer.android.com/reference/kotlin/androidx/work/Data` objects. |
| `https://developer.android.com/reference/kotlin/androidx/work/DelegatingWorkerFactory` | A `https://developer.android.com/reference/kotlin/androidx/work/WorkerFactory` which delegates to other factories. |
| `https://developer.android.com/reference/kotlin/androidx/work/ForegroundInfo` | The information required when a `https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker` runs in the context of a foreground service. |
| `https://developer.android.com/reference/kotlin/androidx/work/InputMerger` | An abstract class that allows the user to define how to merge a list of inputs to a `https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker`. |
| `https://developer.android.com/reference/kotlin/androidx/work/InputMergerFactory` | A factory object that creates `https://developer.android.com/reference/kotlin/androidx/work/InputMerger` instances. |
| `https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker` | A class that can perform work asynchronously in `https://developer.android.com/reference/kotlin/androidx/work/WorkManager`. |
| `https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker.Result` | The result of a `https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker`'s computation. |
| `https://developer.android.com/reference/kotlin/androidx/work/OneTimeWorkRequest` | A `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest` for non-repeating work. |
| `https://developer.android.com/reference/kotlin/androidx/work/OneTimeWorkRequest.Builder` | Builder for `https://developer.android.com/reference/kotlin/androidx/work/OneTimeWorkRequest`s. |
| `https://developer.android.com/reference/kotlin/androidx/work/Operation.State` | The lifecycle state of an `https://developer.android.com/reference/kotlin/androidx/work/Operation`. |
| `https://developer.android.com/reference/kotlin/androidx/work/Operation.State.FAILURE` | This represents an `https://developer.android.com/reference/kotlin/androidx/work/Operation` which has failed. |
| `https://developer.android.com/reference/kotlin/androidx/work/Operation.State.IN_PROGRESS` | This represents an `https://developer.android.com/reference/kotlin/androidx/work/Operation` which is in progress. |
| `https://developer.android.com/reference/kotlin/androidx/work/Operation.State.SUCCESS` | This represents an `https://developer.android.com/reference/kotlin/androidx/work/Operation` which is successful. |
| `https://developer.android.com/reference/kotlin/androidx/work/OverwritingInputMerger` | An `https://developer.android.com/reference/kotlin/androidx/work/InputMerger` that attempts to add all keys from all inputs to the output. |
| `https://developer.android.com/reference/kotlin/androidx/work/PeriodicWorkRequest` | A `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest` for repeating work. |
| `https://developer.android.com/reference/kotlin/androidx/work/PeriodicWorkRequest.Builder` | Builder for `https://developer.android.com/reference/kotlin/androidx/work/PeriodicWorkRequest`s. |
| `https://developer.android.com/reference/kotlin/androidx/work/RxWorker` | RxJava2 interoperability Worker implementation. |
| `https://developer.android.com/reference/kotlin/androidx/work/WorkContinuation` | A class that allows you to chain together `https://developer.android.com/reference/kotlin/androidx/work/OneTimeWorkRequest`s. |
| `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo` | Information about a particular `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest` containing the id of the WorkRequest, its current `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo.State`, output, tags, and run attempt count. |
| `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo.PeriodicityInfo` | A periodic work's interval and flex duration |
| `https://developer.android.com/reference/kotlin/androidx/work/WorkManager` | WorkManager is the recommended library for persistent work. |
| `https://developer.android.com/reference/kotlin/androidx/work/WorkManagerInitializer` | Initializes `https://developer.android.com/reference/kotlin/androidx/work/WorkManager` using `androidx.startup`. |
| `https://developer.android.com/reference/kotlin/androidx/work/WorkQuery` | A specification for querying `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest`s. |
| `https://developer.android.com/reference/kotlin/androidx/work/WorkQuery.Builder` | A builder for `https://developer.android.com/reference/kotlin/androidx/work/WorkQuery`. |
| `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest` | The base class for specifying parameters for work that should be enqueued in `https://developer.android.com/reference/kotlin/androidx/work/WorkManager`. |
| `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest.Builder` | A builder for `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest`s. |
| `https://developer.android.com/reference/kotlin/androidx/work/Worker` | A class that performs work synchronously on a background thread provided by `https://developer.android.com/reference/kotlin/androidx/work/WorkManager`. |
| `https://developer.android.com/reference/kotlin/androidx/work/WorkerExceptionInfo` | Represents exceptions occurred from initializing or executing a `https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker`. |
| `https://developer.android.com/reference/kotlin/androidx/work/WorkerFactory` | A factory object that creates `https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker` instances. |
| `https://developer.android.com/reference/kotlin/androidx/work/WorkerParameters` | Setup parameters for a `https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker`. |

## Annotations

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/work/ExperimentalConfigurationApi` | Annotation indicating experimental API for new WorkManager's Configuration APIs. |
| `https://developer.android.com/reference/kotlin/androidx/work/ExperimentalEventsApi` | Annotation indicating experimental API for new WorkManager's event APIs. |
| `https://developer.android.com/reference/kotlin/androidx/work/ExperimentalWorkRequestBuilderApi` | Annotation indicating experimental APIs for `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest.Builder`. |

## Enums

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/work/BackoffPolicy` | An enumeration of backoff policies when retrying work. |
| `https://developer.android.com/reference/kotlin/androidx/work/ExistingPeriodicWorkPolicy` | An enumeration of the conflict resolution policies available to unique `https://developer.android.com/reference/kotlin/androidx/work/PeriodicWorkRequest`s in case of a collision. |
| `https://developer.android.com/reference/kotlin/androidx/work/ExistingWorkPolicy` | An enumeration of the conflict resolution policies available to unique `https://developer.android.com/reference/kotlin/androidx/work/OneTimeWorkRequest`s in case of a collision. |
| `https://developer.android.com/reference/kotlin/androidx/work/NetworkType` | An enumeration of various network types that can be used as `https://developer.android.com/reference/kotlin/androidx/work/Constraints` for work. |
| `https://developer.android.com/reference/kotlin/androidx/work/OutOfQuotaPolicy` | An enumeration of policies that help determine out of quota behavior for expedited jobs. |
| `https://developer.android.com/reference/kotlin/androidx/work/WorkInfo.State` | The current lifecycle state of a `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest`. |
| `https://developer.android.com/reference/kotlin/androidx/work/WorkManager.UpdateResult` | An enumeration of results for `https://developer.android.com/reference/kotlin/androidx/work/WorkManager#updateWork(androidx.work.WorkRequest)` method. |

## Top-level functions summary

|---|---|
| `inline https://developer.android.com/reference/kotlin/androidx/work/OneTimeWorkRequest.Builder` | `<W : https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker> https://developer.android.com/reference/kotlin/androidx/work/package-summary#OneTimeWorkRequestBuilder()()` Creates a `https://developer.android.com/reference/kotlin/androidx/work/OneTimeWorkRequest` with the given `https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker`. |
| `inline https://developer.android.com/reference/kotlin/androidx/work/PeriodicWorkRequest.Builder` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi(value = 26) <W : https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker> https://developer.android.com/reference/kotlin/androidx/work/package-summary#PeriodicWorkRequestBuilder(java.time.Duration)(repeatInterval: https://developer.android.com/reference/java/time/Duration.html)` Creates a `https://developer.android.com/reference/kotlin/androidx/work/PeriodicWorkRequest.Builder` with a given `https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker`. |
| `inline https://developer.android.com/reference/kotlin/androidx/work/PeriodicWorkRequest.Builder` | `@https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi(value = 26) <W : https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker> https://developer.android.com/reference/kotlin/androidx/work/package-summary#PeriodicWorkRequestBuilder(java.time.Duration,java.time.Duration)( repeatInterval: https://developer.android.com/reference/java/time/Duration.html, flexTimeInterval: https://developer.android.com/reference/java/time/Duration.html )` Creates a `https://developer.android.com/reference/kotlin/androidx/work/PeriodicWorkRequest.Builder` with a given `https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker`. |
| `inline https://developer.android.com/reference/kotlin/androidx/work/PeriodicWorkRequest.Builder` | `<W : https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker> https://developer.android.com/reference/kotlin/androidx/work/package-summary#PeriodicWorkRequestBuilder(kotlin.Long,java.util.concurrent.TimeUnit)( repeatInterval: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, repeatIntervalTimeUnit: https://developer.android.com/reference/java/util/concurrent/TimeUnit.html )` Creates a `https://developer.android.com/reference/kotlin/androidx/work/PeriodicWorkRequest.Builder` with a given `https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker`. |
| `inline https://developer.android.com/reference/kotlin/androidx/work/PeriodicWorkRequest.Builder` | `<W : https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker> https://developer.android.com/reference/kotlin/androidx/work/package-summary#PeriodicWorkRequestBuilder(kotlin.Long,java.util.concurrent.TimeUnit,kotlin.Long,java.util.concurrent.TimeUnit)( repeatInterval: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, repeatIntervalTimeUnit: https://developer.android.com/reference/java/util/concurrent/TimeUnit.html, flexTimeInterval: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html, flexTimeIntervalUnit: https://developer.android.com/reference/java/util/concurrent/TimeUnit.html )` Creates a `https://developer.android.com/reference/kotlin/androidx/work/PeriodicWorkRequest.Builder` with a given `https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker`. |
| `inline https://developer.android.com/reference/kotlin/androidx/work/Data` | `https://developer.android.com/reference/kotlin/androidx/work/package-summary#workDataOf(kotlin.Array)(vararg pairs: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?>)` Converts a list of pairs to a `https://developer.android.com/reference/kotlin/androidx/work/Data` object. |

## Extension functions summary

|---|---|
| `suspend inline https://developer.android.com/reference/kotlin/androidx/work/Operation.State.SUCCESS` | `https://developer.android.com/reference/kotlin/androidx/work/Operation.https://developer.android.com/reference/kotlin/androidx/work/package-summary#(androidx.work.Operation).await()()` Awaits an `https://developer.android.com/reference/kotlin/androidx/work/Operation` without blocking a thread. |
| `inline https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/work/Data.https://developer.android.com/reference/kotlin/androidx/work/package-summary#(androidx.work.Data).hasKeyWithValueOfType(kotlin.String)(key: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Returns true if the instance of `https://developer.android.com/reference/kotlin/androidx/work/Data` has a value corresponding to the given `https://developer.android.com/reference/kotlin/androidx/work/package-summary#(androidx.work.Data).hasKeyWithValueOfType(kotlin.String)` with an expected type `https://developer.android.com/reference/kotlin/androidx/work/package-summary#(androidx.work.Data).hasKeyWithValueOfType(kotlin.String)`. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/work/WorkerParameters.https://developer.android.com/reference/kotlin/androidx/work/package-summary#(androidx.work.WorkerParameters).isRemoteWorkRequest()()` |
| `inline https://developer.android.com/reference/kotlin/androidx/work/OneTimeWorkRequest.Builder` | `https://developer.android.com/reference/kotlin/androidx/work/OneTimeWorkRequest.Builder.https://developer.android.com/reference/kotlin/androidx/work/package-summary#(androidx.work.OneTimeWorkRequest.Builder).setInputMerger(kotlin.reflect.KClass)( inputMerger: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.reflect/-k-class/index.html<https://developer.android.com/reference/kotlin/androidx/work/InputMerger> )` Sets an `https://developer.android.com/reference/kotlin/androidx/work/InputMerger` on the `https://developer.android.com/reference/kotlin/androidx/work/OneTimeWorkRequest.Builder`. |
| `inline https://developer.android.com/reference/kotlin/androidx/work/WorkerParameters` | `<T : https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker> https://developer.android.com/reference/kotlin/androidx/work/WorkerParameters.https://developer.android.com/reference/kotlin/androidx/work/package-summary#(androidx.work.WorkerParameters).usingRemoteService(android.content.ComponentName)( componentName: https://developer.android.com/reference/android/content/ComponentName.html )` Returns a new instance of `https://developer.android.com/reference/kotlin/androidx/work/WorkerParameters` representing a `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest` that can run in a process corresponding to the provided `https://developer.android.com/reference/android/content/ComponentName.html`. |
| `https://developer.android.com/reference/kotlin/androidx/work/WorkerParameters` | `https://developer.android.com/reference/kotlin/androidx/work/WorkerParameters.https://developer.android.com/reference/kotlin/androidx/work/package-summary#(androidx.work.WorkerParameters).usingRemoteService(kotlin.String,android.content.ComponentName)( workerClassName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, componentName: https://developer.android.com/reference/android/content/ComponentName.html )` Returns a new instance of `https://developer.android.com/reference/kotlin/androidx/work/WorkerParameters` representing a `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest` that can run in a process corresponding to the provided `https://developer.android.com/reference/android/content/ComponentName.html`. |

## Top-level functions

### OneTimeWorkRequestBuilder

Artifact: [androidx.work:work-runtime](https://developer.android.com/jetpack/androidx/releases/work) [View Source](https://cs.android.com/search?q=file:androidx/work/OneTimeWorkRequest.kt+function:OneTimeWorkRequestBuilder)

```
inline fun <W : ListenableWorker> OneTimeWorkRequestBuilder(): OneTimeWorkRequest.Builder
```

Creates a `https://developer.android.com/reference/kotlin/androidx/work/OneTimeWorkRequest` with the given `https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker`.

### PeriodicWorkRequestBuilder

Artifact: [androidx.work:work-runtime](https://developer.android.com/jetpack/androidx/releases/work) [View Source](https://cs.android.com/search?q=file:androidx/work/PeriodicWorkRequest.kt+function:PeriodicWorkRequestBuilder)

```
@RequiresApi(value = 26)
inline fun <W : ListenableWorker> PeriodicWorkRequestBuilder(repeatInterval: Duration): PeriodicWorkRequest.Builder
```

Creates a `https://developer.android.com/reference/kotlin/androidx/work/PeriodicWorkRequest.Builder` with a given `https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker`.

| Parameters |
|---|---|
| `repeatInterval: https://developer.android.com/reference/java/time/Duration.html` | @see `https://developer.android.com/reference/kotlin/androidx/work/PeriodicWorkRequest.Builder` |

### PeriodicWorkRequestBuilder

Artifact: [androidx.work:work-runtime](https://developer.android.com/jetpack/androidx/releases/work) [View Source](https://cs.android.com/search?q=file:androidx/work/PeriodicWorkRequest.kt+function:PeriodicWorkRequestBuilder)

```
@RequiresApi(value = 26)
inline fun <W : ListenableWorker> PeriodicWorkRequestBuilder(
    repeatInterval: Duration,
    flexTimeInterval: Duration
): PeriodicWorkRequest.Builder
```

Creates a `https://developer.android.com/reference/kotlin/androidx/work/PeriodicWorkRequest.Builder` with a given `https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker`.

| Parameters |
|---|---|
| `repeatInterval: https://developer.android.com/reference/java/time/Duration.html` | @see `https://developer.android.com/reference/kotlin/androidx/work/PeriodicWorkRequest.Builder` |
| `flexTimeInterval: https://developer.android.com/reference/java/time/Duration.html` | @see `https://developer.android.com/reference/kotlin/androidx/work/PeriodicWorkRequest.Builder` |

### PeriodicWorkRequestBuilder

Artifact: [androidx.work:work-runtime](https://developer.android.com/jetpack/androidx/releases/work) [View Source](https://cs.android.com/search?q=file:androidx/work/PeriodicWorkRequest.kt+function:PeriodicWorkRequestBuilder)

```
inline fun <W : ListenableWorker> PeriodicWorkRequestBuilder(
    repeatInterval: Long,
    repeatIntervalTimeUnit: TimeUnit
): PeriodicWorkRequest.Builder
```

Creates a `https://developer.android.com/reference/kotlin/androidx/work/PeriodicWorkRequest.Builder` with a given `https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker`.

| Parameters |
|---|---|
| `repeatInterval: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | @see `https://developer.android.com/reference/kotlin/androidx/work/PeriodicWorkRequest.Builder` |
| `repeatIntervalTimeUnit: https://developer.android.com/reference/java/util/concurrent/TimeUnit.html` | @see `https://developer.android.com/reference/kotlin/androidx/work/PeriodicWorkRequest.Builder` |

### PeriodicWorkRequestBuilder

Artifact: [androidx.work:work-runtime](https://developer.android.com/jetpack/androidx/releases/work) [View Source](https://cs.android.com/search?q=file:androidx/work/PeriodicWorkRequest.kt+function:PeriodicWorkRequestBuilder)

```
inline fun <W : ListenableWorker> PeriodicWorkRequestBuilder(
    repeatInterval: Long,
    repeatIntervalTimeUnit: TimeUnit,
    flexTimeInterval: Long,
    flexTimeIntervalUnit: TimeUnit
): PeriodicWorkRequest.Builder
```

Creates a `https://developer.android.com/reference/kotlin/androidx/work/PeriodicWorkRequest.Builder` with a given `https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker`.

| Parameters |
|---|---|
| `repeatInterval: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | @see `https://developer.android.com/reference/kotlin/androidx/work/PeriodicWorkRequest.Builder` |
| `repeatIntervalTimeUnit: https://developer.android.com/reference/java/util/concurrent/TimeUnit.html` | @see `https://developer.android.com/reference/kotlin/androidx/work/PeriodicWorkRequest.Builder` |
| `flexTimeInterval: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html` | @see `https://developer.android.com/reference/kotlin/androidx/work/PeriodicWorkRequest.Builder` |
| `flexTimeIntervalUnit: https://developer.android.com/reference/java/util/concurrent/TimeUnit.html` | @see `https://developer.android.com/reference/kotlin/androidx/work/PeriodicWorkRequest.Builder` |

### workDataOf

Artifact: [androidx.work:work-runtime](https://developer.android.com/jetpack/androidx/releases/work) [View Source](https://cs.android.com/search?q=file:androidx/work/Data.kt+function:workDataOf)

```
inline fun workDataOf(vararg pairs: Pair<String, Any?>): Data
```

Converts a list of pairs to a `https://developer.android.com/reference/kotlin/androidx/work/Data` object.

If multiple pairs have the same key, the resulting map will contain the value from the last of those pairs.

Entries of the map are iterated in the order they were specified.

## Extension functions

### Operation.await

Artifact: [androidx.work:work-runtime](https://developer.android.com/jetpack/androidx/releases/work) [View Source](https://cs.android.com/search?q=file:androidx/work/Operation.kt+function:await)

```
suspend inline fun Operation.await(): Operation.State.SUCCESS
```

Awaits an `https://developer.android.com/reference/kotlin/androidx/work/Operation` without blocking a thread.


This method returns the terminal state of the \[Operation\] which is \[Operation.State.SUCCESS\] or
throws a \[Throwable\] that represents why the \[Operation\] failed.

### Data.hasKeyWithValueOfType

Artifact: [androidx.work:work-runtime](https://developer.android.com/jetpack/androidx/releases/work) [View Source](https://cs.android.com/search?q=file:androidx/work/Data.kt+function:hasKeyWithValueOfType)

```
inline fun <T : Any> Data.hasKeyWithValueOfType(key: String): Boolean
```

Returns true if the instance of `https://developer.android.com/reference/kotlin/androidx/work/Data` has a value corresponding to the given `https://developer.android.com/reference/kotlin/androidx/work/package-summary#(androidx.work.Data).hasKeyWithValueOfType(kotlin.String)` with an expected type `https://developer.android.com/reference/kotlin/androidx/work/package-summary#(androidx.work.Data).hasKeyWithValueOfType(kotlin.String)`.

### WorkerParameters.isRemoteWorkRequest

Artifact: [androidx.work:work-runtime](https://developer.android.com/jetpack/androidx/releases/work) [View Source](https://cs.android.com/search?q=file:androidx/work/WorkerParameters.kt+function:isRemoteWorkRequest) Added in [2.10.0](https://developer.android.com/jetpack/androidx/releases/work#2.10.0)

```
fun WorkerParameters.isRemoteWorkRequest(): Boolean
```

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `true` if and only if the instance of `https://developer.android.com/reference/kotlin/androidx/work/WorkerParameters` corresponds to a `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest` that runs in a remote process. |

### OneTimeWorkRequest.Builder.setInputMerger

Artifact: [androidx.work:work-runtime](https://developer.android.com/jetpack/androidx/releases/work) [View Source](https://cs.android.com/search?q=file:androidx/work/OneTimeWorkRequest.kt+function:setInputMerger) Added in [2.8.0](https://developer.android.com/jetpack/androidx/releases/work#2.8.0)

```
inline fun OneTimeWorkRequest.Builder.setInputMerger(
    inputMerger: KClass<InputMerger>
): OneTimeWorkRequest.Builder
```

Sets an `https://developer.android.com/reference/kotlin/androidx/work/InputMerger` on the `https://developer.android.com/reference/kotlin/androidx/work/OneTimeWorkRequest.Builder`.

### WorkerParameters.usingRemoteService

Artifact: [androidx.work:work-runtime](https://developer.android.com/jetpack/androidx/releases/work) [View Source](https://cs.android.com/search?q=file:androidx/work/WorkerParameters.kt+function:usingRemoteService)

```
inline fun <T : ListenableWorker> WorkerParameters.usingRemoteService(
    componentName: ComponentName
): WorkerParameters
```

Returns a new instance of `https://developer.android.com/reference/kotlin/androidx/work/WorkerParameters` representing a `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest` that can run in a process corresponding to the provided `https://developer.android.com/reference/android/content/ComponentName.html`.

| Parameters |
|---|---|
| `<T : https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker>` | The `https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker` to delegate to. |
| `componentName: https://developer.android.com/reference/android/content/ComponentName.html` | The `https://developer.android.com/reference/android/content/ComponentName.html` that identifies the `RemoteService` that hosts the `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/work/WorkerParameters` | A new instance of `https://developer.android.com/reference/kotlin/androidx/work/WorkerParameters` |

### WorkerParameters.usingRemoteService

Artifact: [androidx.work:work-runtime](https://developer.android.com/jetpack/androidx/releases/work) [View Source](https://cs.android.com/search?q=file:androidx/work/WorkerParameters.kt+function:usingRemoteService) Added in [2.10.0](https://developer.android.com/jetpack/androidx/releases/work#2.10.0)

```
fun WorkerParameters.usingRemoteService(
    workerClassName: String,
    componentName: ComponentName
): WorkerParameters
```

Returns a new instance of `https://developer.android.com/reference/kotlin/androidx/work/WorkerParameters` representing a `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest` that can run in a process corresponding to the provided `https://developer.android.com/reference/android/content/ComponentName.html`.

| Parameters |
|---|---|
| `workerClassName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The fully qualified class name of the `https://developer.android.com/reference/kotlin/androidx/work/ListenableWorker` to delegate to |
| `componentName: https://developer.android.com/reference/android/content/ComponentName.html` | The `https://developer.android.com/reference/android/content/ComponentName.html` that identifies the `RemoteService` that hosts the `https://developer.android.com/reference/kotlin/androidx/work/WorkRequest`. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/work/WorkerParameters` | A new instance of `https://developer.android.com/reference/kotlin/androidx/work/WorkerParameters` |