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 Configurations.

abstract

A class that can provide the Configuration for WorkManager and allow for on-demand initialization of WorkManager.

Constants

static Int

The minimum number of system requests which can be enqueued by WorkManager when using android.app.job.JobScheduler or android.app.AlarmManager.

Public methods

Executor

Int

Int

Executor

WorkerFactory

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
Return
Executor: The Executor used by WorkManager to execute Workers

getMaxJobSchedulerId

fun getMaxJobSchedulerId(): Int
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
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()).

getTaskExecutor

@NonNull fun getTaskExecutor(): Executor
Return
Executor: The Executor used by WorkManager for all its internal book-keeping.

getWorkerFactory

@NonNull fun getWorkerFactory(): WorkerFactory
Return
WorkerFactory: The WorkerFactory used by WorkManager to create ListenableWorkers