[ Web Proxy ]
URL:
Viewing: https://developer.android.com/reference/android/app/job/JobServiceEngine [Back]  [Original]

JobServiceEngine  |  API reference  |  Android Developers Skip to main content
Essentials Design & Plan Develop Google Play Blog
Search:
Android Studio
Android Developers [Android Developers]
Stay organized with collections Save and categorize content based on your preferences.

JobServiceEngine


public abstract class JobServiceEngine
extends Object

java.lang.Object
   ↳ android.app.job.JobServiceEngine


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 Service.onBind(Intent).

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

Public constructors

JobServiceEngine

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

getBinder

Added in API level 26
public final IBinder getBinder ()

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

Returns
IBinder

jobFinished

Added in API level 26
public void jobFinished (JobParameters params, 
                boolean needsReschedule)

Call in to engine to report that a job has finished executing. See JobService.jobFinished(JobParameters,boolean) for more information.

Parameters
params JobParameters

needsReschedule boolean

onNetworkChanged

Added in API level 34
public void onNetworkChanged (JobParameters params)

Engine's report that the network for the job has changed.

Parameters
params JobParameters: This value cannot be null.

See also:

onStartJob

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

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

setNotification

Added in API level 34
public void setNotification (JobParameters params, 
                int notificationId, 
                Notification notification, 
                int jobEndNotificationPolicy)

Give JobScheduler a notification to tie to this job's lifecycle.

Parameters
params JobParameters: This value cannot be null.

notificationId int

notification Notification: This value cannot be null.

jobEndNotificationPolicy int: Value is one of the following:

See also:

updateEstimatedNetworkBytes

Added in API level 34
public void updateEstimatedNetworkBytes (JobParameters params, 
                JobWorkItem item, 
                long downloadBytes, 
                long uploadBytes)

Call in to engine to report data transfer progress.

Parameters
params JobParameters: This value cannot be null.

item JobWorkItem: This value may be null.

downloadBytes long: Value is a non-negative number of bytes.

uploadBytes long: Value is a non-negative number of bytes.

See also:

updateTransferredNetworkBytes

Added in API level 34
public void updateTransferredNetworkBytes (JobParameters params, 
                JobWorkItem item, 
                long downloadBytes, 
                long uploadBytes)

Call in to engine to report data transfer progress.

Parameters
params JobParameters: This value cannot be null.

item JobWorkItem: This value may be null.

downloadBytes long: Value is a non-negative number of bytes.

uploadBytes long: Value is a non-negative number of bytes.

See also:

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2026-08-03 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-08-03 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page