diff options
author | 2021-03-15 11:17:42 -0700 | |
---|---|---|
committer | 2021-03-25 18:15:44 -0700 | |
commit | 4826eeba879f9820c7ce265c09aef9eff5451ab1 (patch) | |
tree | fe62d14fd2c801340f018af1ebd9550863a5d047 | |
parent | 5010c912769d001f4939b18210e50f5fd893d1db (diff) |
Log EJ status to statsd.
Test output:
data {
elapsed_timestamp_nanos: 4320796331314
atom {
scheduled_job_state_changed {
attribution_node {
uid: 10483
tag: ""
}
job_name: "android.jobscheduler.cts.jobtestapp/.TestJobService"
state: SCHEDULED
stop_reason: STOP_REASON_UNKNOWN
standby_bucket: ACTIVE
job_id: 4320
has_charging_constraint: false
has_battery_not_low_constraint: false
has_storage_not_low_constraint: false
has_timing_delay_constraint: false
has_deadline_constraint: false
has_idle_constraint: false
has_connectivity_constraint: false
has_content_trigger_constraint: false
is_requested_expedited_job: true
is_running_as_expedited_job: false
}
}
}
data {
elapsed_timestamp_nanos: 4320802878606
atom {
scheduled_job_state_changed {
attribution_node {
uid: 10483
tag: ""
}
job_name: "android.jobscheduler.cts.jobtestapp/.TestJobService"
state: STARTED
stop_reason: STOP_REASON_UNKNOWN
standby_bucket: ACTIVE
job_id: 4320
has_charging_constraint: false
has_battery_not_low_constraint: false
has_storage_not_low_constraint: false
has_timing_delay_constraint: false
has_deadline_constraint: false
has_idle_constraint: false
has_connectivity_constraint: false
has_content_trigger_constraint: false
is_requested_expedited_job: true
is_running_as_expedited_job: true
}
}
}
Bug: 138239687
Bug: 171305774
Test: make statsd_testdrive && ./out/host/linux-x86/bin/statsd_testdrive 8
Change-Id: Ib395ab67a0cc1d4fadd5ff8772d94d6ba0f14503
3 files changed, 13 insertions, 6 deletions
diff --git a/apex/jobscheduler/service/java/com/android/server/job/JobSchedulerService.java b/apex/jobscheduler/service/java/com/android/server/job/JobSchedulerService.java index 8ac237e63877..a452fbcbe42d 100644 --- a/apex/jobscheduler/service/java/com/android/server/job/JobSchedulerService.java +++ b/apex/jobscheduler/service/java/com/android/server/job/JobSchedulerService.java @@ -1046,7 +1046,7 @@ public class JobSchedulerService extends com.android.server.SystemService FrameworkStatsLog.write_non_chained(FrameworkStatsLog.SCHEDULED_JOB_STATE_CHANGED, uId, null, jobStatus.getBatteryName(), FrameworkStatsLog.SCHEDULED_JOB_STATE_CHANGED__STATE__SCHEDULED, - JobProtoEnums.STOP_REASON_CANCELLED, jobStatus.getStandbyBucket(), + JobProtoEnums.STOP_REASON_UNKNOWN, jobStatus.getStandbyBucket(), jobStatus.getJobId(), jobStatus.hasChargingConstraint(), jobStatus.hasBatteryNotLowConstraint(), @@ -1055,7 +1055,9 @@ public class JobSchedulerService extends com.android.server.SystemService jobStatus.hasDeadlineConstraint(), jobStatus.hasIdleConstraint(), jobStatus.hasConnectivityConstraint(), - jobStatus.hasContentTriggerConstraint()); + jobStatus.hasContentTriggerConstraint(), + jobStatus.isRequestedExpeditedJob(), + /* isRunningAsExpeditedJob */ 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 diff --git a/apex/jobscheduler/service/java/com/android/server/job/JobServiceContext.java b/apex/jobscheduler/service/java/com/android/server/job/JobServiceContext.java index 790fae0860de..f0fedda7db70 100644 --- a/apex/jobscheduler/service/java/com/android/server/job/JobServiceContext.java +++ b/apex/jobscheduler/service/java/com/android/server/job/JobServiceContext.java @@ -322,7 +322,9 @@ public final class JobServiceContext implements ServiceConnection { job.hasDeadlineConstraint(), job.hasIdleConstraint(), job.hasConnectivityConstraint(), - job.hasContentTriggerConstraint()); + job.hasContentTriggerConstraint(), + job.isRequestedExpeditedJob(), + job.shouldTreatAsExpeditedJob()); try { mBatteryStats.noteJobStart(job.getBatteryName(), job.getSourceUid()); } catch (RemoteException e) { @@ -904,7 +906,9 @@ public final class JobServiceContext implements ServiceConnection { completedJob.hasDeadlineConstraint(), completedJob.hasIdleConstraint(), completedJob.hasConnectivityConstraint(), - completedJob.hasContentTriggerConstraint()); + completedJob.hasContentTriggerConstraint(), + completedJob.isRequestedExpeditedJob(), + completedJob.startedAsExpeditedJob); try { mBatteryStats.noteJobFinish(mRunningJob.getBatteryName(), mRunningJob.getSourceUid(), legacyStopReason); diff --git a/apex/jobscheduler/service/java/com/android/server/job/controllers/JobStatus.java b/apex/jobscheduler/service/java/com/android/server/job/controllers/JobStatus.java index 8d999e1e7e36..80e68e9a883b 100644 --- a/apex/jobscheduler/service/java/com/android/server/job/controllers/JobStatus.java +++ b/apex/jobscheduler/service/java/com/android/server/job/controllers/JobStatus.java @@ -142,13 +142,14 @@ public final class JobStatus { * (Atom #21) * * CONSTRAINT_BACKGROUND_NOT_RESTRICTED can be inferred with BatterySaverModeStateChanged * (Atom #20) + * * CONSTRAINT_STORAGE_NOT_LOW can be inferred with LowStorageStateChanged (Atom #130) */ private static final int STATSD_CONSTRAINTS_TO_LOG = CONSTRAINT_CONTENT_TRIGGER | CONSTRAINT_DEADLINE | CONSTRAINT_IDLE - | CONSTRAINT_STORAGE_NOT_LOW | CONSTRAINT_TIMING_DELAY - | CONSTRAINT_WITHIN_QUOTA; + | CONSTRAINT_WITHIN_QUOTA + | CONSTRAINT_WITHIN_EXPEDITED_QUOTA; // TODO(b/129954980) private static final boolean STATS_LOG_ENABLED = false; |