Loading apex/jobscheduler/service/java/com/android/server/job/JobSchedulerService.java +3 −6 Original line number Diff line number Diff line Loading @@ -1633,12 +1633,9 @@ public class JobSchedulerService extends com.android.server.SystemService for (int i=0; i<mActiveServices.size(); i++) { final JobServiceContext jsc = mActiveServices.get(i); final JobStatus job = jsc.getRunningJobLocked(); if (job != null && !job.canRunInDoze() && !job.dozeWhitelisted && !job.uidActive) { // We will report active if we have a job running and it is not an exception // due to being in the foreground or whitelisted. if (job != null && !job.canRunInDoze()) { // We will report active if we have a job running and it does not have an // exception that allows it to run in Doze. active = true; break; } Loading apex/jobscheduler/service/java/com/android/server/job/controllers/DeviceIdleJobsController.java +2 −2 Original line number Diff line number Diff line Loading @@ -246,7 +246,7 @@ public final class DeviceIdleJobsController extends StateController { pw.print((jobStatus.satisfiedConstraints & JobStatus.CONSTRAINT_DEVICE_NOT_DOZING) != 0 ? " RUNNABLE" : " WAITING"); if (jobStatus.dozeWhitelisted) { if (jobStatus.appHasDozeExemption) { pw.print(" WHITELISTED"); } if (mAllowInIdleJobs.contains(jobStatus)) { Loading @@ -273,7 +273,7 @@ public final class DeviceIdleJobsController extends StateController { proto.write(TrackedJob.SOURCE_PACKAGE_NAME, jobStatus.getSourcePackageName()); proto.write(TrackedJob.ARE_CONSTRAINTS_SATISFIED, (jobStatus.satisfiedConstraints & JobStatus.CONSTRAINT_DEVICE_NOT_DOZING) != 0); proto.write(TrackedJob.IS_DOZE_WHITELISTED, jobStatus.dozeWhitelisted); proto.write(TrackedJob.IS_DOZE_WHITELISTED, jobStatus.appHasDozeExemption); proto.write(TrackedJob.IS_ALLOWED_IN_DOZE, mAllowInIdleJobs.contains(jobStatus)); proto.end(jsToken); Loading apex/jobscheduler/service/java/com/android/server/job/controllers/JobStatus.java +6 −5 Original line number Diff line number Diff line Loading @@ -267,7 +267,7 @@ public final class JobStatus { private final boolean mHasMediaBackupExemption; // Set to true if doze constraint was satisfied due to app being whitelisted. public boolean dozeWhitelisted; boolean appHasDozeExemption; // Set to true when the app is "active" per AppStateTracker public boolean uidActive; Loading Loading @@ -1179,7 +1179,8 @@ public final class JobStatus { * in Doze. */ public boolean canRunInDoze() { return (getFlags() & JobInfo.FLAG_WILL_BE_FOREGROUND) != 0 return appHasDozeExemption || (getFlags() & JobInfo.FLAG_WILL_BE_FOREGROUND) != 0 || ((shouldTreatAsExpeditedJob() || startedAsExpeditedJob) && (mDynamicConstraints & CONSTRAINT_DEVICE_NOT_DOZING) == 0); } Loading Loading @@ -1243,7 +1244,7 @@ public final class JobStatus { /** @return true if the constraint was changed, false otherwise. */ boolean setDeviceNotDozingConstraintSatisfied(final long nowElapsed, boolean state, boolean whitelisted) { dozeWhitelisted = whitelisted; appHasDozeExemption = whitelisted; if (setConstraintSatisfied(CONSTRAINT_DEVICE_NOT_DOZING, nowElapsed, state)) { // The constraint was changed. Update the ready flag. mReadyNotDozing = state || canRunInDoze(); Loading Loading @@ -2110,7 +2111,7 @@ public final class JobStatus { } pw.decreaseIndent(); if (dozeWhitelisted) { if (appHasDozeExemption) { pw.println("Doze whitelisted: true"); } if (uidActive) { Loading Loading @@ -2323,7 +2324,7 @@ public final class JobStatus { dumpConstraints(proto, JobStatusDumpProto.SATISFIED_CONSTRAINTS, satisfiedConstraints); dumpConstraints(proto, JobStatusDumpProto.UNSATISFIED_CONSTRAINTS, ((requiredConstraints | CONSTRAINT_WITHIN_QUOTA) & ~satisfiedConstraints)); proto.write(JobStatusDumpProto.IS_DOZE_WHITELISTED, dozeWhitelisted); proto.write(JobStatusDumpProto.IS_DOZE_WHITELISTED, appHasDozeExemption); proto.write(JobStatusDumpProto.IS_UID_ACTIVE, uidActive); proto.write(JobStatusDumpProto.IS_EXEMPTED_FROM_APP_STANDBY, job.isExemptedFromAppStandby()); Loading Loading
apex/jobscheduler/service/java/com/android/server/job/JobSchedulerService.java +3 −6 Original line number Diff line number Diff line Loading @@ -1633,12 +1633,9 @@ public class JobSchedulerService extends com.android.server.SystemService for (int i=0; i<mActiveServices.size(); i++) { final JobServiceContext jsc = mActiveServices.get(i); final JobStatus job = jsc.getRunningJobLocked(); if (job != null && !job.canRunInDoze() && !job.dozeWhitelisted && !job.uidActive) { // We will report active if we have a job running and it is not an exception // due to being in the foreground or whitelisted. if (job != null && !job.canRunInDoze()) { // We will report active if we have a job running and it does not have an // exception that allows it to run in Doze. active = true; break; } Loading
apex/jobscheduler/service/java/com/android/server/job/controllers/DeviceIdleJobsController.java +2 −2 Original line number Diff line number Diff line Loading @@ -246,7 +246,7 @@ public final class DeviceIdleJobsController extends StateController { pw.print((jobStatus.satisfiedConstraints & JobStatus.CONSTRAINT_DEVICE_NOT_DOZING) != 0 ? " RUNNABLE" : " WAITING"); if (jobStatus.dozeWhitelisted) { if (jobStatus.appHasDozeExemption) { pw.print(" WHITELISTED"); } if (mAllowInIdleJobs.contains(jobStatus)) { Loading @@ -273,7 +273,7 @@ public final class DeviceIdleJobsController extends StateController { proto.write(TrackedJob.SOURCE_PACKAGE_NAME, jobStatus.getSourcePackageName()); proto.write(TrackedJob.ARE_CONSTRAINTS_SATISFIED, (jobStatus.satisfiedConstraints & JobStatus.CONSTRAINT_DEVICE_NOT_DOZING) != 0); proto.write(TrackedJob.IS_DOZE_WHITELISTED, jobStatus.dozeWhitelisted); proto.write(TrackedJob.IS_DOZE_WHITELISTED, jobStatus.appHasDozeExemption); proto.write(TrackedJob.IS_ALLOWED_IN_DOZE, mAllowInIdleJobs.contains(jobStatus)); proto.end(jsToken); Loading
apex/jobscheduler/service/java/com/android/server/job/controllers/JobStatus.java +6 −5 Original line number Diff line number Diff line Loading @@ -267,7 +267,7 @@ public final class JobStatus { private final boolean mHasMediaBackupExemption; // Set to true if doze constraint was satisfied due to app being whitelisted. public boolean dozeWhitelisted; boolean appHasDozeExemption; // Set to true when the app is "active" per AppStateTracker public boolean uidActive; Loading Loading @@ -1179,7 +1179,8 @@ public final class JobStatus { * in Doze. */ public boolean canRunInDoze() { return (getFlags() & JobInfo.FLAG_WILL_BE_FOREGROUND) != 0 return appHasDozeExemption || (getFlags() & JobInfo.FLAG_WILL_BE_FOREGROUND) != 0 || ((shouldTreatAsExpeditedJob() || startedAsExpeditedJob) && (mDynamicConstraints & CONSTRAINT_DEVICE_NOT_DOZING) == 0); } Loading Loading @@ -1243,7 +1244,7 @@ public final class JobStatus { /** @return true if the constraint was changed, false otherwise. */ boolean setDeviceNotDozingConstraintSatisfied(final long nowElapsed, boolean state, boolean whitelisted) { dozeWhitelisted = whitelisted; appHasDozeExemption = whitelisted; if (setConstraintSatisfied(CONSTRAINT_DEVICE_NOT_DOZING, nowElapsed, state)) { // The constraint was changed. Update the ready flag. mReadyNotDozing = state || canRunInDoze(); Loading Loading @@ -2110,7 +2111,7 @@ public final class JobStatus { } pw.decreaseIndent(); if (dozeWhitelisted) { if (appHasDozeExemption) { pw.println("Doze whitelisted: true"); } if (uidActive) { Loading Loading @@ -2323,7 +2324,7 @@ public final class JobStatus { dumpConstraints(proto, JobStatusDumpProto.SATISFIED_CONSTRAINTS, satisfiedConstraints); dumpConstraints(proto, JobStatusDumpProto.UNSATISFIED_CONSTRAINTS, ((requiredConstraints | CONSTRAINT_WITHIN_QUOTA) & ~satisfiedConstraints)); proto.write(JobStatusDumpProto.IS_DOZE_WHITELISTED, dozeWhitelisted); proto.write(JobStatusDumpProto.IS_DOZE_WHITELISTED, appHasDozeExemption); proto.write(JobStatusDumpProto.IS_UID_ACTIVE, uidActive); proto.write(JobStatusDumpProto.IS_EXEMPTED_FROM_APP_STANDBY, job.isExemptedFromAppStandby()); Loading