diff options
| author | Makoto Onuki <omakoto@google.com> | 2018-01-27 00:31:42 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2018-01-27 00:31:42 +0000 |
| commit | 1f805b44eaa86285cbdbce2cbac8510cf79f0605 (patch) | |
| tree | 8159dc6f5ecbffd281d2102dd2ab3466f078525d /core/java | |
| parent | 73a4d9444b24617444179a3c8a88f8c6820e39bc (diff) | |
| parent | 959acb52739f4883400a4a0aac7d8837e35f014b (diff) | |
Merge "Allow system jobs to be exempted from app-standby"
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/app/job/JobInfo.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/core/java/android/app/job/JobInfo.java b/core/java/android/app/job/JobInfo.java index cba9dcc3c4cc..a1ad825c3a29 100644 --- a/core/java/android/app/job/JobInfo.java +++ b/core/java/android/app/job/JobInfo.java @@ -256,6 +256,14 @@ public class JobInfo implements Parcelable { public static final int FLAG_IS_PREFETCH = 1 << 2; /** + * This job needs to be exempted from the app standby throttling. Only the system (UID 1000) + * can set it. Jobs with a time constrant must not have it. + * + * @hide + */ + public static final int FLAG_EXEMPT_FROM_APP_STANDBY = 1 << 3; + + /** * @hide */ public static final int CONSTRAINT_FLAG_CHARGING = 1 << 0; @@ -355,6 +363,13 @@ public class JobInfo implements Parcelable { return flags; } + /** @hide */ + public boolean isExemptedFromAppStandby() { + return ((flags & FLAG_EXEMPT_FROM_APP_STANDBY) != 0) + && !hasEarlyConstraint() + && !hasLateConstraint(); + } + /** * Whether this job requires that the device be charging (or be a non-battery-powered * device connected to permanent power, such as Android TV devices). |
