Title: Theory / Unimportant / CS / Programming / Java / Android / Lib / WorkManager
Tags: h

Name: A persistent work
Definition: A work that remains scheduled through app restarts and system reboots
Page: https://developer.android.com/topic/libraries/architecture/workmanager

Name: WorkManager
Definition: Android library for persistent work
Page: https://developer.android.com/topic/libraries/architecture/workmanager

Name: An immediate persistent work
Definition: Tasks that must begin immediately and complete soon. May be expedited.
Page: https://developer.android.com/topic/libraries/architecture/workmanager
Context: Android persistent work

Name: A long running persistent work
Definition: Tasks which might run for longer, potentially longer than 10 minutes.
Page: https://developer.android.com/topic/libraries/architecture/workmanager
Context: Android persistent work

Name: A deferrable persistent work
Definition: Scheduled tasks that start at a later time and can run periodically.
Page: https://developer.android.com/topic/libraries/architecture/workmanager
Context: Android persistent work

Typ: OneTimeWorkRequest
Meaning: A worker that do a one time short job
Page: https://developer.android.com/topic/libraries/architecture/workmanager
Context: Android persistent work

Typ: WorkRequest
Meaning: A worker that do a long job, one time or periodic
Page: https://developer.android.com/topic/libraries/architecture/workmanager
Context: Android persistent work

Typ: PeriodicWorkRequest
Meaning: A worker that do periodic job
Page: https://developer.android.com/topic/libraries/architecture/workmanager
Context: Android persistent work

Name: A work constraint
Definition: Definiton of ideal condition to run a worker
Page: https://developer.android.com/topic/libraries/architecture/workmanager
Context: Android persistent work

Question: What are the benefits of WorkManager
Answer: Work constraints
Page: https://developer.android.com/topic/libraries/architecture/workmanager
Context: Android persistent work
Answer2: Robust scheduling
Answer3: Expedited work
Answer4: Flexible retry policy
Answer5: Work chaining
Answer6: Built-In threading interoperability

Name: An expedited work
Definition: Importance: Expedited work suits tasks which are important to the user or are user-initiated.
Page: https://developer.android.com/topic/libraries/architecture/workmanager
https://developer.android.com/topic/libraries/architecture/workmanager/how-to/define-work
Context: Android persistent work
Definition2: Speed: Expedited work best fits short tasks that start immediately and complete within a few minutes.
Conjdef: A work which is
Definition3: Quotas: A system-level quota that limits foreground execution time determines whether an expedited job can start.
Definition4: Power Management: Power management restrictions, such as Battery Saver and Doze, are less likely to affect expedited work.
Definition5: Latency: The system immediately executes expedited work, provided that the system's current workload enables it to do so. This means they are latency sensitive and can't be scheduled for later execution.

Name: Work chaining
Definition: Ensuring that a sequence of works are executed in correct order
Page: https://developer.android.com/topic/libraries/architecture/workmanager
Context: Android persistent work

Question: Advantage of AlarmManager over WorkManager
Answer: AlarmManager is more precise
Page: https://developer.android.com/topic/libraries/architecture/workmanager
Context: Android persistent work
Answer2: Alarm Manager can wake a device from Doze mode
Name: Work chaining

Question: Advantage of WorkManager over AlarmManager
Answer: WorkManager is more efficient in term of power and resource management
Page: https://developer.android.com/topic/libraries/architecture/workmanager
Context: Android persistent work
Name: Work chaining

Typ: Worker
Meaning: A class to overload to create worker
Function: doWork, taking no argument and returning a Result.
Page: https://developer.android.com/topic/libraries/architecture/workmanager/basics
Context: Android persistent work

Typ: androidx.work.Data
Meaning: A persistable set of key/value pairs which are used as inputs and outputs for ListenableWorkers. Keys are Strings, and values can be Strings, primitive types, or their array variants.
Page: https://developer.android.com/reference/androidx/work/Data
Context: Android persistent work

Typ: androidx.work.ListenableWorker.Result
Meaning: The result of a ListenableWorker's computation.
Page: https://developer.android.com/reference/androidx/work/Data
Context: Android persistent work

Instruction: Result.failure(outputData: Data = null)
Page: https://developer.android.com/reference/androidx/work/Data
Language: Kotlin
Context: androidx.work.ListenableWorker.Result
Returns: A Worker's result indicating a failure with information Data

Instruction: Result.success(outputData: Data = null)
Page: https://developer.android.com/reference/androidx/work/Data
Language: Kotlin
Context: androidx.work.ListenableWorker.Result
Returns: A Worker's result indicating a success with information Data

Instruction: Result.retry(outputData: Data = null)
Page: https://developer.android.com/reference/androidx/work/Data
Language: Kotlin
Context: androidx.work.ListenableWorker.Result
Returns: A Worker's result indicating that the work must be retried, with information Data

Instruction: worker.doWork()
Page: https://developer.android.com/topic/libraries/architecture/workmanager/basics
Effect: Do the work regarding of this worker and return whether it was sucesful, failed or must be retried
Language: Kotlin
Variables: worker: Worker

Typ: WorkRequest
Meaning: how and when some worker should be run
Page: https://developer.android.com/topic/libraries/architecture/workmanager/basics
Language: Kotlin

Typ: WorkManager.getInstance(context)
Meaning: A work manager for context
Page: https://developer.android.com/topic/libraries/architecture/workmanager/basics
Language: Kotlin

Typ: workManager.upload(workRequest)
Meaning: Ensure that workRequest is known by workManager and planned to be executed as required
Page: https://developer.android.com/topic/libraries/architecture/workmanager/basics
Language: Kotlin
Variables: WorkManager workManager

Instruction: OneTimeWorkRequest.from(workerClass::class.java)
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/define-work
Language: Kotlin
Returns: A default one time work request for workerClass
Variables: workManager: WorkManager
workerClass extends Worker

Instruction: OneTimeWorkRequestBuilder<WorkerClass>()
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/define-work
Language: Kotlin
Returns: A builder for a one time work request for WorkerClass
Variables: workManager: WorkManager
WorkerClass extends Worker

Name: Quota of the app
Definition: A quantity of resources allocated to the app, after which no worker can execute until it is replenished
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/define-work
Variables: workManager: WorkManager
WorkerClass extends Worker

Instruction: workRequestBuilder
  .setExpedited(outOfQuotaPolicy)
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/define-work
Effect: Ensure that this request is expedited, and if there is no Quota, run with outOfQuotaPolicy
Language: Kotlin
Variables: workRequestBuilder: WorkRequest.Builder
Name: Quota of the app

Typ: OutOfQuotaPolicy
TypMeaning: policies that help determine out of quota behavior for expedited jobs.
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/define-work
Language: Kotlin
Value: DROP_WORK_REQUEST
When the app does not have any expedited job quota, the expedited work request will be dropped and no work requests are enqueued.
Value2: RUN_AS_NON_EXPEDITED_WORK_REQUEST
When the app does not have any expedited job quota, the expedited work request will fallback to a regular work request.

Instruction: PeriodicWorkRequestBuilder<SaveImageToFileWorker>(n, timeUnit)
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/define-work
Language: Kotlin
Returns: A Builder for a periodic work request that executes every n timeUnit

Typ: Instant
Meaning: An instantaneous point on the time-line.
TODO
Page: https://developer.android.com/reference/java/time/Instant
Language: Kotlin
Variables: duration: Duration

Constant: Instant.EPOCH
Meaning: The EPOCH instant
Page: https://developer.android.com/reference/java/time/Instant
Language: Kotlin

Name: A flex period
Definition: The period during which a periodic work is expected to start
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/define-work
Section: Period work
Intuition: Using an interval instead of a fixed point allow for more flexibility when system is busy

Instruction: PeriodicWorkRequestBuilder<SaveImageToFileWorker>(
  period, periodTimeUnit,
  flex, flexTimeUnit
)
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/define-work
Language: Kotlin
Returns: A Builder for a periodic work request that executes every period periodTimeUnit, with a flexInterval of flex flexTimeUnit

Typ: androidx.work.Constraints
Meaning: A specification of the requirements that need to be met before a WorkRequest can run.
Page: https://developer.android.com/reference/kotlin/androidx/work/Constraints
Language: Kotlin

Typ: androidx.work.Constraints.Builder
Meaning: A builder for androidx.work.Constraints
Page: https://developer.android.com/reference/kotlin/androidx/work/Constraints
Language: Kotlin

Instruction: constraintBuilder.addContentUriTrigger(uri, triggerForDescendants)
Page: https://developer.android.com/reference/kotlin/androidx/work/Constraints
Effect: Sets whether the WorkRequest should run when a local content: Uri is updated.
Language: Kotlin
Variables: constraintBuilder: androidx.work.Constraints.Builder

Instruction: constraintBuilder.setRequiredNetworkType(networkType)
Page: https://developer.android.com/reference/kotlin/androidx/work/Constraints
Effect: Sets whether device should have a particular NetworkType for the WorkRequest to run.
Language: Kotlin
Variables: constraintBuilder: androidx.work.Constraints.Builder

Instruction: constraintBuilder.setRequiredBatteryNotLow(required)
Page: https://developer.android.com/reference/kotlin/androidx/work/Constraints
Effect: Set whether battery should be at an acceptable level for workRequest to run
Language: Kotlin
Variables: constraintBuilder: androidx.work.Constraints.Builder

Instruction: constraintBuilder.setRequiredCharging(required)
Page: https://developer.android.com/reference/kotlin/androidx/work/Constraints
Effect: Sets whether device should be charging for the WorkRequest to run.
Language: Kotlin
Variables: constraintBuilder: androidx.work.Constraints.Builder

Instruction: constraintBuilder.setRequiredDeviceIdle(requiresDeviceIdle)
Page: https://developer.android.com/reference/kotlin/androidx/work/Constraints
Effect: Sets whether device should be idle for the WorkRequest to run.
Language: Kotlin
Variables: constraintBuilder: androidx.work.Constraints.Builder

Instruction: constraintBuilder.setRequiresStorageNotLow(requiresDeviceIdle)
Page: https://developer.android.com/reference/kotlin/androidx/work/Constraints
Effect: Sets whether the device's available storage should be at an acceptable level for the WorkRequest to run.
Language: Kotlin
Variables: constraintBuilder: androidx.work.Constraints.Builder

Instruction: constraintBuilder.setTriggerContentMaxDealy(duration, timeUnit)
constraintBuilder.setTriggerContentMaxDealy(duration)
Page: https://developer.android.com/reference/kotlin/androidx/work/Constraints
Effect: Sets the maximum delay that is allowed from the first time a content: Uri change is detected to the time when the WorkRequest is scheduled.
Language: Kotlin
Variables: constraintBuilder: androidx.work.Constraints.Builder

Instruction: constraintBuilder.setTriggerContentUpdateDealy(duration)
constraintBuilder.setTriggerContentUpdateDealy(duration, timeUnit)
Page: https://developer.android.com/reference/kotlin/androidx/work/Constraints
Effect: Sets the delay that is allowed from the time a content: Uri change is detected to the time when the WorkRequest is scheduled.
Language: Kotlin
Variables: constraintBuilder: androidx.work.Constraints.Builder

Typ: NetworkType
TypMeaning: various network types that can be used as Constraints for work.
Page: https://developer.android.com/reference/kotlin/androidx/work/Constraints
Language: Kotlin
Value: CONNECTED
Any working network connection is required for this work.
Value2: METERED
A metered network connection is required for this work.
Value3: NOT_REQUIRED
A network is not required for this work.
Value4: NOT_ROAMING
A non-roaming network connection is required for this work.
Value5: TEMPORARILY_UNMETERED
A temporarily unmetered Network.
Value6: UNMETERED
An unmetered network connection is required for this work.

Instruction: workRequestBuilder.setConstraint(constaints)
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/define-work
Effect: Ensure that the work is run only when constraints holds
Language: Kotlin
Variables: workRequestBuilder: WorkRequestBuilder

Instruction: workRequestBuilder.setInitialDelay(
  n, timeUnit
)
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/define-work
Effect: Don't run the work before at least n timeUnit
Language: Kotlin
Variables: workRequestBuilder: WorkRequestBuilder

Name: backoff delay
Definition: the minimum amount of time to wait before retrying your work after the first attempt
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/define-work
Context: Work Request, Kotlin

Typ: BackoffPolicy
TypMeaning: how the backoff delay should increase over time for subsequent retry attempts
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/define-work
Language: Kotlin
Context: Work Request
Value: EXPONENTIAL
Used to indicate that WorkManager should increase the backoff time exponentially
Value2: LINEAR
Used to indicate that WorkManager should increase the backoff time linearly

Instruction: workRequestBuilder.addTag(tag)
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/define-work
Effect: Add tag to the workRequest being built
Language: Kotlin
Variables: workRequestBuilder: WorkRequestBuilder

Instruction: worker.getTags()
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/define-work
Language: Kotlin
Returns: The set of tags of this worker
Variables: worker: Worker

Instruction: worker.inputData
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/define-work
Language: Kotlin
Returns: A dictionnary from keys to values passed to the worker
Variables: worker: Worker

Question: What are the states of an android work
Answer: Enqueued
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/states-and-observation
Context: Android worker
Answer2: Running
Answer3: Succeeded
Answer4: Failed
Answer5: Cancelled

Question: What are the possible next states of a work in enqueued state
Answer: running
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/states-and-observation
Context: Android worker
Answer2: cancelled

Question: What are the possible next states of a work in running state
Answer: enqueued (if retry)
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/states-and-observation
Context: Android worker
Answer2: Cancelled
Answer3: Failed
Answer4: Succeeeded

Question: What are the possible states of a periodic work
Answer: Enqueued
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/states-and-observation
Context: Android worker
Answer2: Running
Answer3: Cancelled

Question: What is the difference between ID and name of a worker
Answer: name is readable
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/managing-work
Context: Android worker

Question: What is the difference between tags and name of a worker
Answer: name is unique to an instance of work
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/managing-work
Context: Android worker

Instruction: workManager.enqueueUniquePeriodicWork(
  workName,
  existingWorkPolicy,
  workRequest
)
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/managing-work
Context: Android worker
Returns: Enqueue periodic workRequest with workName. If a task with workName is already enqueued, act as indicated by workPolicy
Variables: workManager: WorkManager

Instruction: workManager.enqueueUniqueWork(
  workName,
  existingWorkPolicy,
  workRequest
)
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/managing-work
Context: Android worker
Returns: Enqueue one-time workRequest with workName. If a task with workName is already enqueued, act as indicated by workPolicy
Variables: workManager: WorkManager

Typ: ExistingWorkPolicy
TypMeaning: An enumeration of the conflict resolution policies available to unique OneTimeWorkRequests in case of a collision.
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/managing-work
Context: Android worker
Variables: workManager: WorkManager
Value: APPEND
If there is existing pending (uncompleted) work with the same unique name, append the newly-specified work as a child of all the leaves of that work sequence.
When using APPEND with failed or cancelled prerequisites, newly enqueued work will also be marked as failed or cancelled respectively.
Value2: APPEND_OR_REPLACE
If there is existing pending (uncompleted) work with the same unique name, append the newly-specified work as the child of all the leaves of that work sequence.
If there are failed or cancelled prerequisites, these prerequisites are dropped and the newly-specified work is the start of a new sequence.
Value3: KEEP
If there is existing pending (uncompleted) work with the same unique name, do nothing.
Value4: REPLACE
If there is existing pending (uncompleted) work with the same unique name, cancel and delete it.

Typ: ExistingPeriodicWorkPolicy
TypMeaning: An enumeration of the conflict resolution policies available to periodic WorkRequests in case of a name collision.
Page: https://developer.android.com/reference/androidx/work/ExistingPeriodicWorkPolicy
Context: Android worker
Variables: workManager: WorkManager
Value: KEEP
If there is existing pending (uncompleted) work with the same unique name, do nothing.
Value2: REPLACE
If there is existing pending (uncompleted) work with the same unique name, cancel and delete it.

Instruction: workManager.getWorkInfoById(id)
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/managing-work
Context: Android worker
Returns: The workInfo for work with id
Variables: workManager: WorkManager

Instruction: workManager.getWorkInfoByTag(tag)
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/managing-work
Context: Android worker
Returns: The list workInfo for work with tag
Variables: workManager: WorkManager

Instruction: workManager.getWorkInfoForUniqueWork(name)
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/managing-work
Context: Android worker
Returns: The list of workInfo for works with name
Variables: workManager: WorkManager

Instruction: workInfo.observe(???, fn)
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/managing-work
Effect: Listen to change to the worker behind workInfo and call fn to the new workInfo
Context: Android worker
Variables: workInfo: WorkInfo

Typ: WorkQuery
Meaning: A query to find a list of job of workers
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/managing-work

Instruction: workQueryBuilder.addTags(tags)
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/managing-work
Effect: restrict the query to jobs having on tag of tags
Variables: workQueryBuilder: WorkQueryBuilder

Instruction: workQueryBuilder.addStates(states)
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/managing-work
Effect: restrict the query to jobs having a state of states
Variables: workQueryBuilder: WorkQueryBuilder

Instruction: workQueryBuilder.addUniqueWorkNames(names)
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/managing-work
Effect: restrict the query to jobs whose name is in names
Variables: workQueryBuilder: WorkQueryBuilder

Instruction: workManager.getWorkInfos(workQuery)
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/managing-work
Returns: The list of WorkInfo of jobs satisfying workQuery
Variables: workQueryBuilder: WorkQueryBuilder
workManager: WorkManager

Instruction: workManager.cancelWorkById(id)
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/managing-work
Effect: cancel work with id
Variables: workManager: WorkManager

Instruction: workManager.cancelWorkByTag(tag)
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/managing-work
Effect: Cancel all job with tag
Variables: workManager: WorkManager

Instruction: workManager.cancelUniqueWork(name)
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/managing-work
Effect: Cancel the job of work name
Variables: workManager: WorkManager

Question: What occur when an enqueued job is cancelled
Answer: Jobs depending on it are cancelled
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/managing-work
Variables: workManager: WorkManager

Question: What occur when a finished job is cancelled
Answer: nothing
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/managing-work
Variables: workManager: WorkManager

Question: What occur when a running job is cancelled
Answer: It's ListenableWorker.onStopped() is called
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/managing-work
Variables: workManager: WorkManager

Question: Why can a job be stopped
Answer: You explicitly asked for it to be cancelled (by calling WorkManager.cancelWorkById(UUID), for example).
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/managing-work
Context: Android workers
Answer2: In the case of unique work, you explicitly enqueued a new WorkRequest with an ExistingWorkPolicy of REPLACE. The old WorkRequest is immediately considered cancelled.
Answer3: Your work's constraints are no longer met.
Answer4: The system instructed your app to stop your work for some reason. This can happen if you exceed the execution deadline of 10 minutes. The work is scheduled for retry at a later time.

Instruction: listenableWorker.onStopped()
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/managing-work
Effect: Called when a work is stopped. Override to react to end of the job
Language: Kotlin
Context: Android workers
Variables: listenableWorker: ListenableWorker

Instruction: listenableWorker.isStopped()
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/managing-work
Effect: Whether the worker is stopped
Language: Kotlin
Context: Android workers
Variables: listenableWorker: ListenableWorker

Instruction: coroutineWorker.setProgress(workData)
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/managing-work
Effect: set progress according to work data
Language: Kotlin
Context: Android workers
Variables: coroutineWorker: CoroutineWorker

Instruction: workDataOf(key to value)
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/managing-work
Language: Kotlin
Context: Android workers
Returns: Some data for worker, associating key to value

Typ: WorkInfo
Meaning: Information about a particular WorkRequest. TODO
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/chain-work
https://developer.android.com/reference/androidx/work/WorkInfo
Language: Kotlin
Context: Android workers

Typ: WorkContinuation
Meaning: A class that allows you to chain together OneTimeWorkRequests.
Page: https://developer.android.com/reference/androidx/work/WorkContinuation

Instruction: workContinuation.combine(continuations)
Page: https://developer.android.com/reference/androidx/work/WorkContinuation
Returns: A WorkContinuatino which is done when all continuation in continuations are done.
Variables: workContinuation: WorkContinuation

Instruction: workContinuation.enqueue()
Page: https://developer.android.com/reference/androidx/work/WorkContinuation
Effect: Enqueues the instance of WorkContinuation on the background thread.
Returns: An Operation that can be used to determine when the enqueue has completed
Variables: workContinuation: WorkContinuation

Instruction: workContinuation.getWorkInfos()
Page: https://developer.android.com/reference/androidx/work/WorkContinuation
Returns: a List of WorkInfos that provides information about the status of each OneTimeWorkRequest in this WorkContinuation, as well as their prerequisites.
Variables: workContinuation: WorkContinuation

Instruction: workContinuation.getWorkInfosLiveData()
Page: https://developer.android.com/reference/androidx/work/WorkContinuation
Returns: a LiveData list of WorkInfos that provide information about the status of each OneTimeWorkRequest in this WorkContinuation, as well as their prerequisites. If the state or outputs of any of the work changes, any attached Observers will trigger.
Variables: workContinuation: WorkContinuation

Instruction: workContinuation.then(oneTimeWorkRequest)
Page: https://developer.android.com/reference/androidx/work/WorkContinuation
Returns: A WorkContinuation, starting with workContinuation and following by doing oneTimeWorkRequest
Variables: workContinuation: WorkContinuation

Instruction: workContinuation.then(
  oneTimeWorkRequests
)
Page: https://developer.android.com/reference/androidx/work/WorkContinuation
Returns: A WorkContinuation, starting with workContinuation and following by doing all oneTimeWorkRequest of oneTimeWorkRequests
Variables: workContinuation: WorkContinuation

Typ: InputMerger
Meaning: An abstract class that allows the user to define how to merge a list of inputs to a ListenableWorker.
Page: https://developer.android.com/reference/androidx/work/InputMerger

Instruction: inputMerger.merge(
  inputs
)
Page: https://developer.android.com/reference/androidx/work/InputMerger
Language: Kotlin
Returns: a data merging all inputs
Variables: inputMerger: InputMerger

Typ: OverwritingInputMerger
Meaning: An input merger that associate to each key the last value received from an input for this key
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/chain-work
Language: Kotlin
Context: Andoid work manager
Subtype of: InputMerger

Typ: AraryCreatingInputMerger
Meaning: An input merger that associate to each key all values received from an input for this key
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/chain-work
Language: Kotlin
Context: Andoid work manager
Subtype of: InputMerger

Typ: TestWorkerBuilder<WorkerType>
Meaning: Builds instances of Worker which can be used for testing.
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/testing-worker-impl
Language: Kotlin
Context: Andoid work manager
Subtype of: TestListenableWorkerBuilder<WorkerType>

Instruction: TestWorkerBuilder<WorkerType>
  .from(
     context,
     workRequest,
     executor
  )
Page: https://developer.android.com/reference/androidx/work/testing/TestWorkerBuilder
Language: Kotlin
Context: Andoid work manager
Returns: a new instance of a TestWorkerBuilder from a WorkRequest that runs on the given Executor.

Instruction: TestWorkerBuilder<WorkerType>
  .from(
     context,
     workClass,
     executor
  )
Page: https://developer.android.com/reference/androidx/work/testing/TestWorkerBuilder
Language: Kotlin
Context: Andoid work manager
Returns: a new instance of a TestWorkerBuilder with the worker Class that runs on the given Executor.

Instruction: workDataOf(
  key_1 to value_1,
  ...,
  key_n to value_n
)
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/testing-worker-impl
https://developer.android.com/reference/kotlin/androidx/work/package-summary
Language: Kotlin
Context: Andoid work manager
Returns: Data sending key_i to data_i
Typ: Data

Instruction: WorkManagerTestInitHelper.initializeTestWorkManager(context, config)
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/integration-testing
Effect: Ensure that WorkManager can be used for tests
Language: Kotlin
Context: Andoid work manager
Returns: A test driver to simulate working condition

Typ: TestDriver
Meaning: Additional functionality exposed for WorkManager that are useful in the context of testing.
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/integration-testing
https://developer.android.com/reference/androidx/work/testing/TestDriver
Language: Kotlin
Context: Andoid work manager

Instruction: testDriver.setAllConstraintsMet(workSpecId)
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/integration-testing
https://developer.android.com/reference/androidx/work/testing/TestDriver
Effect: Tells TestDriver to pretend that all constraints on the WorkRequest with the given workSpecId are met.
Language: Kotlin
Context: Andoid work manager
Variables: testDriver: TestDriver

Instruction: testDriver.setInitialDelayMet(workSpecId)
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/integration-testing
https://developer.android.com/reference/androidx/work/testing/TestDriver
Effect: Tells TestDriver to pretend that the initial delay the OneTimeWorkRequest with the given workSpecId is met.
Language: Kotlin
Context: Andoid work manager
Variables: testDriver: TestDriver

Instruction: testDriver.setPeriodicDelayMet(workSpecId)
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/integration-testing
https://developer.android.com/reference/androidx/work/testing/TestDriver
Effect: Tells TestDriver to pretend that the period delay on the PeriodicWorkRequest with the given workSpecId is met.
Language: Kotlin
Context: Andoid work manager
Variables: testDriver: TestDriver

Question: How to debug work maanager not executing works at correct time
Answer: Add log, as explained in https://developer.android.com/topic/libraries/architecture/workmanager/how-to/debugging
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/integration-testing
Context: Andoid work manager

Name: On-demand initialization
Definition: lets you create WorkManager only when that component is needed, instead of every time the app starts up.
Page: https://developer.android.com/topic/libraries/architecture/workmanager/how-to/integration-testing
Context: Andoid work manager

Instruction: tools:node="remove"
Page: https://developer.android.com/topic/libraries/architecture/workmanager/advanced/custom-configuration
Effect: Remove default initializer of work manager
Language: xml
Context: Andoid work manager,
<provider
    android:name="androidx.startup.InitializationProvider"
    android:authorities="${applicationId}.androidx-startup">
Name: On-demand initialization

Question: How to create custom work manager
Answer: Add tools:node="remove" to xml of initializer to stop it from generating default work manager
Page: https://developer.android.com/topic/libraries/architecture/workmanager/advanced/custom-configuration
Context: Andoid work manager,
Answer2: Have your Application class implement the Configuration.Provider interface,
Answer3: provide your own implementation of Configuration.Provider.getWorkManagerConfiguration().
Name: On-demand initialization

Question: Threading in workmanager
Answer: todo
Page: https://developer.android.com/topic/libraries/architecture/workmanager/advanced/threading
Context: Andoid work manager,
Name: On-demand initialization