Class WorkManagerScheduler
- java.lang.Object
-
- com.google.android.exoplayer2.ext.workmanager.WorkManagerScheduler
-
- All Implemented Interfaces:
Scheduler
@Deprecated public final class WorkManagerScheduler extends Object implements Scheduler
Deprecated.com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.AScheduler
that usesWorkManager
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WorkManagerScheduler.SchedulerWorker
Deprecated.AWorker
that starts the target service if the requirements are met.
-
Constructor Summary
Constructors Constructor Description WorkManagerScheduler(Context context, String workName)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
cancel()
Deprecated.Cancels anything that was previously scheduled, or else does nothing.Requirements
getSupportedRequirements(Requirements requirements)
Deprecated.Checks whether thisScheduler
supports the providedRequirements
.boolean
schedule(Requirements requirements, String servicePackage, String serviceAction)
Deprecated.Schedules a service to be started in the foreground when someRequirements
are met.
-
-
-
Constructor Detail
-
WorkManagerScheduler
public WorkManagerScheduler(Context context, String workName)
Deprecated.- Parameters:
context
- A context.workName
- A name for work scheduled by this instance. If the same name was used by a previous instance, anything scheduled by the previous instance will be canceled by this instance ifschedule(Requirements, String, String)
orcancel()
are called.
-
-
Method Detail
-
schedule
public boolean schedule(Requirements requirements, String servicePackage, String serviceAction)
Deprecated.Description copied from interface:Scheduler
Schedules a service to be started in the foreground when someRequirements
are met. Anything that was previously scheduled will be canceled.The service to be started must be declared in the manifest of
servicePackage
with an intent filter containingserviceAction
. Note that when started withserviceAction
, the service must callService.startForeground(int, Notification)
to make itself a foreground service, as documented byContextWrapper.startForegroundService(Intent)
.
-
cancel
public boolean cancel()
Deprecated.Description copied from interface:Scheduler
Cancels anything that was previously scheduled, or else does nothing.
-
getSupportedRequirements
public Requirements getSupportedRequirements(Requirements requirements)
Deprecated.Description copied from interface:Scheduler
Checks whether thisScheduler
supports the providedRequirements
. If all of the requirements are supported then the sameRequirements
instance is returned. If not then a new instance is returned containing the subset of the requirements that are supported.- Specified by:
getSupportedRequirements
in interfaceScheduler
- Parameters:
requirements
- The requirements to check.- Returns:
- The supported requirements.
-
-