public final class

WorkManagerScheduler.SchedulerWorker

extends Worker

 java.lang.Object

androidx.work.ListenableWorker

androidx.work.Worker

↳androidx.media3.exoplayer.workmanager.WorkManagerScheduler.SchedulerWorker

Overview

A Worker that starts the target service if the requirements are met.

Summary

Constructors
publicSchedulerWorker(Context context, WorkerParameters workerParams)

Methods
public abstract ListenableWorker.ResultdoWork()

Override this method to do your actual background processing.

from WorkergetForegroundInfo, getForegroundInfoAsync, startWork
from ListenableWorkergetApplicationContext, getBackgroundExecutor, getId, getInputData, getNetwork, getRunAttemptCount, getTags, getTaskExecutor, getTriggeredContentAuthorities, getTriggeredContentUris, getWorkerFactory, isStopped, isUsed, onStopped, setForegroundAsync, setProgressAsync, setUsed, stop
from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public SchedulerWorker(Context context, WorkerParameters workerParams)

Methods

public abstract ListenableWorker.Result doWork()

Override this method to do your actual background processing. This method is called on a background thread - you are required to synchronously do your work and return the ListenableWorker.Result from this method. Once you return from this method, the Worker is considered to have finished what its doing and will be destroyed. If you need to do your work asynchronously on a thread of your own choice, see ListenableWorker.

A Worker has a well defined execution window to finish its execution and return a ListenableWorker.Result. After this time has expired, the Worker will be signalled to stop.

Returns:

The ListenableWorker.Result of the computation; note that dependent work will not execute if you use ListenableWorker.Result.failure() or ListenableWorker.Result.failure(Data)