Adding in new metrics for Jobs.
Test: manual Change-Id: I1bc0cabb50accfad7c2fb1a32aef8a8cfa7b2193 Bug: b/257339302
This commit is contained in:
@@ -1290,7 +1290,16 @@ public class JobSchedulerService extends com.android.server.SystemService
|
||||
jobStatus.getJob().isPrefetch(),
|
||||
jobStatus.getJob().getPriority(),
|
||||
jobStatus.getEffectivePriority(),
|
||||
jobStatus.getNumPreviousAttempts());
|
||||
jobStatus.getNumPreviousAttempts(),
|
||||
jobStatus.getJob().getMaxExecutionDelayMillis(),
|
||||
/* isDeadlineConstraintSatisfied */ false,
|
||||
/* isCharging */ false,
|
||||
/* batteryNotLow */ false,
|
||||
/* storageNotLow */false,
|
||||
/* timingDelayConstraintSatisfied */ false,
|
||||
/* isDeviceIdle */ false,
|
||||
/* hasConnectivityConstraintSatisfied */ false,
|
||||
/* hasContentTriggerConstraintSatisfied */ false);
|
||||
|
||||
// If the job is immediately ready to run, then we can just immediately
|
||||
// put it in the pending list and try to schedule it. This is especially
|
||||
@@ -1489,7 +1498,16 @@ public class JobSchedulerService extends com.android.server.SystemService
|
||||
cancelled.getJob().isPrefetch(),
|
||||
cancelled.getJob().getPriority(),
|
||||
cancelled.getEffectivePriority(),
|
||||
cancelled.getNumPreviousAttempts());
|
||||
cancelled.getNumPreviousAttempts(),
|
||||
cancelled.getJob().getMaxExecutionDelayMillis(),
|
||||
cancelled.isConstraintSatisfied(JobStatus.CONSTRAINT_DEADLINE),
|
||||
cancelled.isConstraintSatisfied(JobInfo.CONSTRAINT_FLAG_CHARGING),
|
||||
cancelled.isConstraintSatisfied(JobInfo.CONSTRAINT_FLAG_BATTERY_NOT_LOW),
|
||||
cancelled.isConstraintSatisfied(JobInfo.CONSTRAINT_FLAG_STORAGE_NOT_LOW),
|
||||
cancelled.isConstraintSatisfied(JobStatus.CONSTRAINT_TIMING_DELAY),
|
||||
cancelled.isConstraintSatisfied(JobInfo.CONSTRAINT_FLAG_DEVICE_IDLE),
|
||||
cancelled.isConstraintSatisfied(JobStatus.CONSTRAINT_CONNECTIVITY),
|
||||
cancelled.isConstraintSatisfied(JobStatus.CONSTRAINT_CONTENT_TRIGGER));
|
||||
}
|
||||
// If this is a replacement, bring in the new version of the job
|
||||
if (incomingJob != null) {
|
||||
|
||||
@@ -363,7 +363,16 @@ public final class JobServiceContext implements ServiceConnection {
|
||||
job.getJob().isPrefetch(),
|
||||
job.getJob().getPriority(),
|
||||
job.getEffectivePriority(),
|
||||
job.getNumPreviousAttempts());
|
||||
job.getNumPreviousAttempts(),
|
||||
job.getJob().getMaxExecutionDelayMillis(),
|
||||
isDeadlineExpired,
|
||||
job.isConstraintSatisfied(JobInfo.CONSTRAINT_FLAG_CHARGING),
|
||||
job.isConstraintSatisfied(JobInfo.CONSTRAINT_FLAG_BATTERY_NOT_LOW),
|
||||
job.isConstraintSatisfied(JobInfo.CONSTRAINT_FLAG_STORAGE_NOT_LOW),
|
||||
job.isConstraintSatisfied(JobStatus.CONSTRAINT_TIMING_DELAY),
|
||||
job.isConstraintSatisfied(JobInfo.CONSTRAINT_FLAG_DEVICE_IDLE),
|
||||
job.isConstraintSatisfied(JobStatus.CONSTRAINT_CONNECTIVITY),
|
||||
job.isConstraintSatisfied(JobStatus.CONSTRAINT_CONTENT_TRIGGER));
|
||||
if (Trace.isTagEnabled(Trace.TRACE_TAG_SYSTEM_SERVER)) {
|
||||
// Use the context's ID to distinguish traces since there'll only be one job
|
||||
// running per context.
|
||||
@@ -1032,7 +1041,16 @@ public final class JobServiceContext implements ServiceConnection {
|
||||
completedJob.getJob().isPrefetch(),
|
||||
completedJob.getJob().getPriority(),
|
||||
completedJob.getEffectivePriority(),
|
||||
completedJob.getNumPreviousAttempts());
|
||||
completedJob.getNumPreviousAttempts(),
|
||||
completedJob.getJob().getMaxExecutionDelayMillis(),
|
||||
mParams.isOverrideDeadlineExpired(),
|
||||
completedJob.isConstraintSatisfied(JobInfo.CONSTRAINT_FLAG_CHARGING),
|
||||
completedJob.isConstraintSatisfied(JobInfo.CONSTRAINT_FLAG_BATTERY_NOT_LOW),
|
||||
completedJob.isConstraintSatisfied(JobInfo.CONSTRAINT_FLAG_STORAGE_NOT_LOW),
|
||||
completedJob.isConstraintSatisfied(JobStatus.CONSTRAINT_TIMING_DELAY),
|
||||
completedJob.isConstraintSatisfied(JobInfo.CONSTRAINT_FLAG_DEVICE_IDLE),
|
||||
completedJob.isConstraintSatisfied(JobStatus.CONSTRAINT_CONNECTIVITY),
|
||||
completedJob.isConstraintSatisfied(JobStatus.CONSTRAINT_CONTENT_TRIGGER));
|
||||
if (Trace.isTagEnabled(Trace.TRACE_TAG_SYSTEM_SERVER)) {
|
||||
Trace.asyncTraceForTrackEnd(Trace.TRACE_TAG_SYSTEM_SERVER, "JobScheduler",
|
||||
completedJob.getTag(), getId());
|
||||
|
||||
@@ -95,11 +95,11 @@ public final class JobStatus {
|
||||
static final int CONSTRAINT_IDLE = JobInfo.CONSTRAINT_FLAG_DEVICE_IDLE; // 1 << 2
|
||||
static final int CONSTRAINT_BATTERY_NOT_LOW = JobInfo.CONSTRAINT_FLAG_BATTERY_NOT_LOW; // 1 << 1
|
||||
static final int CONSTRAINT_STORAGE_NOT_LOW = JobInfo.CONSTRAINT_FLAG_STORAGE_NOT_LOW; // 1 << 3
|
||||
static final int CONSTRAINT_TIMING_DELAY = 1<<31;
|
||||
static final int CONSTRAINT_DEADLINE = 1<<30;
|
||||
static final int CONSTRAINT_CONNECTIVITY = 1 << 28;
|
||||
public static final int CONSTRAINT_TIMING_DELAY = 1 << 31;
|
||||
public static final int CONSTRAINT_DEADLINE = 1 << 30;
|
||||
public static final int CONSTRAINT_CONNECTIVITY = 1 << 28;
|
||||
static final int CONSTRAINT_TARE_WEALTH = 1 << 27; // Implicit constraint
|
||||
static final int CONSTRAINT_CONTENT_TRIGGER = 1<<26;
|
||||
public static final int CONSTRAINT_CONTENT_TRIGGER = 1 << 26;
|
||||
static final int CONSTRAINT_DEVICE_NOT_DOZING = 1 << 25; // Implicit constraint
|
||||
static final int CONSTRAINT_WITHIN_QUOTA = 1 << 24; // Implicit constraint
|
||||
static final int CONSTRAINT_PREFETCH = 1 << 23;
|
||||
@@ -1599,7 +1599,8 @@ public final class JobStatus {
|
||||
}
|
||||
}
|
||||
|
||||
boolean isConstraintSatisfied(int constraint) {
|
||||
/** @return whether or not the @param constraint is satisfied */
|
||||
public boolean isConstraintSatisfied(int constraint) {
|
||||
return (satisfiedConstraints&constraint) != 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user