Merge "Allow system jobs to be exempted from app-standby"
This commit is contained in:
@@ -255,6 +255,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
|
||||
*/
|
||||
@@ -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).
|
||||
|
||||
Reference in New Issue
Block a user