JobServiceEngine
abstract class JobServiceEngine
| kotlin.Any | |
| ↳ | android.app.job.JobServiceEngine |
Helper for implementing a android.app.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 android.app.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 |
|
|---|---|
|
Create a new engine, ready for use. |
|
Public methods |
|
|---|---|
| IBinder! |
Retrieve the engine's IPC interface that should be returned by |
| open Unit |
jobFinished(params: JobParameters!, needsReschedule: Boolean)Call in to engine to report that a job has finished executing. |
| abstract Boolean |
onStartJob(params: JobParameters!)Engine's report that a job has started. |
| abstract Boolean |
onStopJob(params: JobParameters!)Engine's report that a job has stopped. |
Public constructors
<init>
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
getBinder
fun getBinder(): IBinder!
Retrieve the engine's IPC interface that should be returned by Service#onBind(Intent).
jobFinished
open fun jobFinished(
params: JobParameters!,
needsReschedule: Boolean
): Unit
Call in to engine to report that a job has finished executing. See JobService#jobFinished(JobParameters, boolean) JobService.jobFinished} for more information.
onStartJob
abstract fun onStartJob(params: JobParameters!): Boolean
Engine's report that a job has started. See JobService#onStartJob(JobParameters) for more information.
onStopJob
abstract fun onStopJob(params: JobParameters!): Boolean
Engine's report that a job has stopped. See JobService#onStopJob(JobParameters) for more information.