JobInfo.Builder.SetOverrideDeadline(Int64) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Set a deadline after which all other functional requested constraints will be ignored.
[Android.Runtime.Register("setOverrideDeadline", "(J)Landroid/app/job/JobInfo$Builder;", "")]
public Android.App.Job.JobInfo.Builder? SetOverrideDeadline(long maxExecutionDelayMillis);
[<Android.Runtime.Register("setOverrideDeadline", "(J)Landroid/app/job/JobInfo$Builder;", "")>]
member this.SetOverrideDeadline : int64 -> Android.App.Job.JobInfo.Builder
Parameters
- maxExecutionDelayMillis
- Int64
The delay in milliseconds from scheduling until the override deadline. This is not a guaranteed start time.
Returns
This builder instance.
- Attributes
Remarks
After the deadline has passed, the job can run even if other functional requirements, including a delay set through SetMinimumLatency(Int64), are not met. IsOverrideDeadlineExpired indicates whether the deadline has passed. Other factors, such as Doze mode and system health, can delay execution beyond the deadline.
A periodic job with a nonzero override deadline causes Build() to throw an exception.
On Android 15 and later, for apps targeting Android 15 or later, a negative deadline causes Build() to throw an exception.
A deadline of zero, or one equal to the minimum latency, can make other functional constraints ineffective. The time window is the time between the minimum latency and the deadline; the minimum latency is zero if it is not set. On Android 15 and later, for apps targeting Android 15 or later, a short window with functional constraints can cause Build() to throw an exception when the platform enforces a minimum window. For work that must happen immediately, consider SetExpedited(Boolean) or SetUserInitiated(Boolean).
This API aimed to guarantee execution of the job by the deadline only on Android version Build.VERSION_CODES.LOLLIPOP. That aim and guarantee has not existed since Build.VERSION_CODES.M.
Android reference for android.app.job.JobInfo.Builder.setOverrideDeadline.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.