StopReason Enum
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.
public enum StopReason
type StopReason =
- Inheritance
-
StopReason
Fields
| Name | Value | Description |
|---|---|---|
| Undefined | 0 | There is no reason the job is stopped. This is the value returned from the JobParameters object passed to JobService.onStartJob(JobParameters). Android reference for 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. |
| CancelledByApp | 1 | The job was cancelled directly by the app, either by calling JobScheduler.cancel(int), JobScheduler.cancelAll(), or by scheduling a new job with the same job ID. Android reference for 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. |
| Preempt | 2 | The job was stopped to run a higher priority job of the app. Android reference for 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. |
| Timeout | 3 | The job used up its maximum execution time and timed out. Each individual job has a maximum execution time limit, regardless of how much total quota the app has. See the note on JobScheduler and JobInfo for the execution time limits. Android reference for 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. |
| DeviceState | 4 | The device state (e.g., Doze, battery saver, memory usage, etc.) requires JobScheduler to stop this job. Android reference for 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. |
| ConstraintBatteryNotLow | 5 | The requested battery-not-low constraint is no longer satisfied. Android reference for 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. |
| ConstraintCharging | 6 | The requested charging constraint is no longer satisfied. Android reference for 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. |
| ConstraintConnectivity | 7 | The requested connectivity constraint is no longer satisfied. Android reference for 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. |
| ConstraintDeviceIdle | 8 | The requested idle constraint is no longer satisfied. Android reference for 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. |
| ConstraintStorageNotLow | 9 | The requested storage-not-low constraint is no longer satisfied. Android reference for 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. |
| Quota | 10 | The app has consumed all of its current quota. Each app is assigned a quota of how much it can run jobs within a certain time frame. The quota is informed, in part, by app standby buckets. Once an app has used up all of its quota, it won't be able to start jobs until quota is replenished, is changed, or is temporarily not applied. Android reference for 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. |
| BackgroundRestriction | 11 | The app is restricted from running in the background. Android reference for 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. |
| AppStandby | 12 | The current standby bucket requires that the job stop now. Android reference for 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. |
| User | 13 | The user stopped the job. This can happen either through force-stop, adb shell commands, uninstalling, or some other UI. Android reference for 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. |
| SystemProcessing | 14 | The system is doing some processing that requires stopping this job. Android reference for 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. |
| EstimatedAppLaunchTimeChanged | 15 | The system's estimate of when the app will be launched changed significantly enough to decide this job shouldn't be running right now. This will mostly apply to prefetch jobs. Android reference for 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. |
| TimeoutAbandoned | 16 | The job used up its maximum execution time and timed out. The system also detected that the app can no longer call JobService.jobFinished(JobParameters,boolean) for this job, likely because the strong reference to the job handle (JobParameters) passed to it via JobService.onStartJob(JobParameters) was lost. This can occur even if the app called JobScheduler.cancel(int), JobScheduler.cancelAll(), or JobScheduler.cancelInAllNamespaces() to stop an active job while losing strong references to the job handle. In this case, the job is not necessarily abandoned. However, the system cannot distinguish such cases from truly abandoned jobs. It is recommended that you use JobService.jobFinished(JobParameters,boolean) or return false from JobService.onStartJob(JobParameters) to stop an active job. This will prevent the occurrence of this stop reason and the need to handle it. The primary use case for this stop reason is to report a probable case of a job being abandoned. Android reference for 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. |