Configuration
class Configuration
| kotlin.Any | |
| ↳ | androidx.work.Configuration |
The Configuration object used to customize WorkManager upon initialization. Configuration contains various parameters used to setup WorkManager. For example, it is possible to customize the Executor used by Workers here.
To set a custom Configuration for WorkManager, see WorkManager#initialize(Context, Configuration).
Summary
| Nested classes | |
|---|---|
|
A Builder for |
|
| abstract |
A class that can provide the |
| Constants | |
|---|---|
| static Int |
The minimum number of system requests which can be enqueued by |
| Public methods | |
|---|---|
| Executor |
Gets the |
| InputMergerFactory | |
| Int |
Gets the last valid id when scheduling work with |
| Int |
Gets the first valid id used when scheduling work with |
| RunnableScheduler | |
| Executor |
Gets the |
| WorkerFactory |
Gets the |
Constants
MIN_SCHEDULER_LIMIT
static val MIN_SCHEDULER_LIMIT: Int
The minimum number of system requests which can be enqueued by WorkManager when using android.app.job.JobScheduler or android.app.AlarmManager.
Value: 20
Public methods
getExecutor
@NonNull fun getExecutor(): Executor
Gets the Executor used by WorkManager to execute Workers.
| Return | |
|---|---|
Executor |
The Executor used by WorkManager to execute Workers |
getInputMergerFactory
@NonNull fun getInputMergerFactory(): InputMergerFactory
| Return | |
|---|---|
InputMergerFactory |
The InputMergerFactory used by WorkManager to create instances of InputMergers. |
getMaxJobSchedulerId
fun getMaxJobSchedulerId(): Int
Gets the last valid id when scheduling work with android.app.job.JobScheduler.
| Return | |
|---|---|
Int |
The last valid id (inclusive) used by WorkManager when creating new instances of android.app.job.JobInfos. If the current jobId goes beyond the bounds of the defined range of (Configuration.Builder#getMinJobSchedulerId(), Configuration.Builder#getMaxJobSchedulerId()), it is reset to (Configuration.Builder#getMinJobSchedulerId()). |
getMinJobSchedulerId
fun getMinJobSchedulerId(): Int
Gets the first valid id used when scheduling work with android.app.job.JobScheduler.
| Return | |
|---|---|
Int |
The first valid id (inclusive) used by WorkManager when creating new instances of android.app.job.JobInfos. If the current jobId goes beyond the bounds of the defined range of (Configuration.Builder#getMinJobSchedulerId(), Configuration.Builder#getMaxJobSchedulerId()), it is reset to (Configuration.Builder#getMinJobSchedulerId()). |
getRunnableScheduler
@NonNull fun getRunnableScheduler(): RunnableScheduler
| Return | |
|---|---|
RunnableScheduler |
The RunnableScheduler to keep track of timed work in the in-process scheduler. |
getTaskExecutor
@NonNull fun getTaskExecutor(): Executor
Gets the Executor used by WorkManager for all its internal business logic.
| Return | |
|---|---|
Executor |
The Executor used by WorkManager for all its internal business logic |
getWorkerFactory
@NonNull fun getWorkerFactory(): WorkerFactory
Gets the WorkerFactory used by WorkManager to create ListenableWorkers.
| Return | |
|---|---|
WorkerFactory |
The WorkerFactory used by WorkManager to create ListenableWorkers |

