JobServiceEngine | API reference | Android Developers
Summary: Ctors | Methods | Inherited Methods
public
abstract
class
JobServiceEngine
extends Object
Helper for implementing a Service that interacts with
JobScheduler. This is not intended for use by regular applications, but
allows frameworks built on top of the platform to create their own
Service that interact with JobScheduler as well as
add in additional functionality. If you just want to execute jobs normally, you
should instead be looking at JobService.
Summary
Public constructors | |
|---|---|
JobServiceEngine(Service service)
Create a new engine, ready for use. |
|
Public methods | |
|---|---|
final
IBinder
|
getBinder()
Retrieve the engine's IPC interface that should be returned by
|
void
|
jobFinished(JobParameters params, boolean needsReschedule)
Call in to engine to report that a job has finished executing. |
void
|
onNetworkChanged(JobParameters params)
Engine's report that the network for the job has changed. |
abstract
boolean
|
onStartJob(JobParameters params)
Engine's report that a job has started. |
abstract
boolean
|
onStopJob(JobParameters params)
Engine's report that a job has stopped. |
void
|
setNotification(JobParameters params, int notificationId, Notification notification, int jobEndNotificationPolicy)
Give JobScheduler a notification to tie to this job's lifecycle. |
void
|
updateEstimatedNetworkBytes(JobParameters params, JobWorkItem item, long downloadBytes, long uploadBytes)
Call in to engine to report data transfer progress. |
void
|
updateTransferredNetworkBytes(JobParameters params, JobWorkItem item, long downloadBytes, long uploadBytes)
Call in to engine to report data transfer progress. |
Inherited methods | |||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
From class
| |||||||||||||||||||||||
Public constructors
JobServiceEngine
public JobServiceEngine (Service service)
Create a new engine, ready for use.
| Parameters | |
|---|---|
service |
Service: The Service that is creating this engine and in which it will run. |
Public methods
onNetworkChanged
public void onNetworkChanged (JobParameters params)
Engine's report that the network for the job has changed.
| Parameters | |
|---|---|
params |
JobParameters: This value cannot be null. |
onStartJob
public abstract boolean onStartJob (JobParameters params)
Engine's report that a job has started. See
JobService.onStartJob for more information.
| Parameters | |
|---|---|
params |
JobParameters |
| Returns | |
|---|---|
boolean |
|
onStopJob
public abstract boolean onStopJob (JobParameters params)
Engine's report that a job has stopped. See
JobService.onStopJob for more information.
| Parameters | |
|---|---|
params |
JobParameters |
| Returns | |
|---|---|
boolean |
|