Join us for ⁠#Android11: The Beta Launch Show on June 3!
Added in API level 26

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

<init>(service: Service!)

Create a new engine, ready for use.

Public methods

IBinder!

Retrieve the engine's IPC interface that should be returned by Service#onBind(Intent).

open Unit
jobFinished(params: JobParameters!, needsReschedule: Boolean)

Call in to engine to report that a job has finished executing.

abstract Boolean

Engine's report that a job has started.

abstract Boolean

Engine's report that a job has stopped.

Public constructors

<init>

Added in API level 26
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

Added in API level 26
fun getBinder(): IBinder!

Retrieve the engine's IPC interface that should be returned by Service#onBind(Intent).

jobFinished

Added in API level 26
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

Added in API level 26
abstract fun onStartJob(params: JobParameters!): Boolean

Engine's report that a job has started. See JobService#onStartJob(JobParameters) for more information.

onStopJob

Added in API level 26
abstract fun onStopJob(params: JobParameters!): Boolean

Engine's report that a job has stopped. See JobService#onStopJob(JobParameters) for more information.