Add API constraints to ScheduledJobStateChanged atom
This helps us know if jobs with a particular constraint are being
starved or otherwise dysfunctional due to a bug.
Test: make statsd_testdrive &&
./out/host/linux-x86/bin/statsd_testdrive 8
Sample output:
atom {
scheduled_job_state_changed {
attribution_node {
uid: 10224
tag: ""
}
job_name: "android.jobscheduler.cts.jobtestapp/.TestJobService"
state: SCHEDULED
stop_reason: STOP_REASON_CANCELLED
standby_bucket: RESTRICTED
job_id: 691
has_charging_constraint: true
has_battery_not_low_constraint: true
has_storage_not_low_constraint: false
has_timing_delay_constraint: false
has_deadline_constraint: true
has_idle_constraint: true
has_connectivity_constraint: true
has_content_trigger_constraint: false
}
Bug: 138239687
Change-Id: I175e5a0f5cc2cb3be447ccb58142006946092e75
diff --git a/cmds/statsd/src/atoms.proto b/cmds/statsd/src/atoms.proto
index 2575542..a35be5a 100644
--- a/cmds/statsd/src/atoms.proto
+++ b/cmds/statsd/src/atoms.proto
@@ -978,6 +978,17 @@
// The job id (as assigned by the app).
optional int32 job_id = 6;
+
+ // One flag for each of the API constraints defined by Jobscheduler. Does not include implcit
+ // constraints as they are always assumed to be set.
+ optional bool has_charging_constraint = 7;
+ optional bool has_battery_not_low_constraint = 8;
+ optional bool has_storage_not_low_constraint = 9;
+ optional bool has_timing_delay_constraint = 10;
+ optional bool has_deadline_constraint = 11;
+ optional bool has_idle_constraint = 12;
+ optional bool has_connectivity_constraint = 13;
+ optional bool has_content_trigger_constraint = 14;
}
/**