Merge "Fix FLAG_EXEMPT_FROM_APP_STANDBY check"

This commit is contained in:
TreeHugger Robot
2018-02-12 21:53:48 +00:00
committed by Android (Google) Code Review
2 changed files with 4 additions and 6 deletions

View File

@@ -365,9 +365,7 @@ public class JobInfo implements Parcelable {
/** @hide */
public boolean isExemptedFromAppStandby() {
return ((flags & FLAG_EXEMPT_FROM_APP_STANDBY) != 0)
&& !hasEarlyConstraint()
&& !hasLateConstraint();
return ((flags & FLAG_EXEMPT_FROM_APP_STANDBY) != 0) && !isPeriodic();
}
/**

View File

@@ -2337,9 +2337,9 @@ public final class JobSchedulerService extends com.android.server.SystemService
if (callingUid != Process.SYSTEM_UID) {
throw new SecurityException("Job has invalid flags");
}
if (job.hasLateConstraint() || job.hasEarlyConstraint()) {
Slog.wtf(TAG, "Jobs with time-constraints mustn't have"
+" FLAG_EXEMPT_FROM_APP_STANDBY. Job=" + job);
if (job.isPeriodic()) {
Slog.wtf(TAG, "Periodic jobs mustn't have"
+ " FLAG_EXEMPT_FROM_APP_STANDBY. Job=" + job);
}
}
}