Configuration

public final class Configuration
extends Object

java.lang.Object
   ↳ 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

class Configuration.Builder

A Builder for Configurations. 

Constants

int MIN_SCHEDULER_LIMIT

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

Public methods

Executor getExecutor()
int getMaxJobSchedulerId()
int getMinJobSchedulerId()
WorkerFactory getWorkerFactory()

Inherited methods

Constants

MIN_SCHEDULER_LIMIT

public static final int MIN_SCHEDULER_LIMIT

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

Constant Value: 20 (0x00000014)

Public methods

getExecutor

public Executor getExecutor ()

Returns
Executor The Executor used by WorkManager to execute Workers

getMaxJobSchedulerId

public int getMaxJobSchedulerId ()

Returns
int The last valid id (inclusive) used by WorkManager when creating new instances of JobInfos. If the current jobId goes beyond the bounds of the defined range of (getMinJobSchedulerId(), getMaxJobSchedulerId()), it is reset to (getMinJobSchedulerId()).

getMinJobSchedulerId

public int getMinJobSchedulerId ()

Returns
int The first valid id (inclusive) used by WorkManager when creating new instances of JobInfos. If the current jobId goes beyond the bounds of the defined range of (getMinJobSchedulerId(), getMaxJobSchedulerId()), it is reset to (getMinJobSchedulerId()).

getWorkerFactory

public WorkerFactory getWorkerFactory ()

Returns
WorkerFactory The WorkerFactory used by WorkManager to create ListenableWorkers