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 |
interface |
Configuration.Provider
A class that can provide the |
Constants | |
|---|---|
int |
MIN_SCHEDULER_LIMIT
The minimum number of system requests which can be enqueued by |
Public methods | |
|---|---|
Executor
|
getExecutor()
Gets the |
InputMergerFactory
|
getInputMergerFactory()
|
int
|
getMaxJobSchedulerId()
Gets the last valid id when scheduling work with |
int
|
getMinJobSchedulerId()
Gets the first valid id used when scheduling work with |
RunnableScheduler
|
getRunnableScheduler()
|
Executor
|
getTaskExecutor()
Gets the |
WorkerFactory
|
getWorkerFactory()
Gets the |
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 ()
Gets the Executor used by WorkManager to execute Workers.
| Returns | |
|---|---|
Executor |
The Executor used by WorkManager to execute Workers
|
getInputMergerFactory
public InputMergerFactory getInputMergerFactory ()
| Returns | |
|---|---|
InputMergerFactory |
The InputMergerFactory used by WorkManager to create instances of
InputMergers.
|
getMaxJobSchedulerId
public int getMaxJobSchedulerId ()
Gets the last valid id when scheduling work with JobScheduler.
| 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 ()
Gets the first valid id used when scheduling work with JobScheduler.
| 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()).
|
getRunnableScheduler
public RunnableScheduler getRunnableScheduler ()
| Returns | |
|---|---|
RunnableScheduler |
The RunnableScheduler to keep track of timed work in the in-process
scheduler.
|
getTaskExecutor
public Executor getTaskExecutor ()
Gets the Executor used by WorkManager for all its internal business logic.
| Returns | |
|---|---|
Executor |
The Executor used by WorkManager for all its internal business logic
|
getWorkerFactory
public WorkerFactory getWorkerFactory ()
Gets the WorkerFactory used by WorkManager to create
ListenableWorkers.
| Returns | |
|---|---|
WorkerFactory |
The WorkerFactory used by WorkManager to create
ListenableWorkers
|
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-03-04 UTC.