blob: 8d4b56ca36191bb7db6d005e8a56a284f76e0dce [file] [log] [blame]
Kweku Adams85f2fbc2017-12-18 12:04:12 -08001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
18
19package com.android.server.job;
20
21option java_multiple_files = true;
22
Tej Singh33a412b2018-03-16 18:43:59 -070023import "frameworks/base/core/proto/android/app/job/enums.proto";
Kweku Adams85f2fbc2017-12-18 12:04:12 -080024import "frameworks/base/core/proto/android/content/clipdata.proto";
25import "frameworks/base/core/proto/android/content/component_name.proto";
26import "frameworks/base/core/proto/android/content/intent.proto";
27import "frameworks/base/core/proto/android/net/network.proto";
28import "frameworks/base/core/proto/android/net/networkrequest.proto";
29import "frameworks/base/core/proto/android/os/bundle.proto";
30import "frameworks/base/core/proto/android/os/persistablebundle.proto";
31import "frameworks/base/core/proto/android/server/forceappstandbytracker.proto";
Kweku Adams0f168de2018-01-24 10:51:30 -080032import "frameworks/base/libs/incident/proto/android/privacy.proto";
Kweku Adams85f2fbc2017-12-18 12:04:12 -080033
34message JobSchedulerServiceDumpProto {
Kweku Adams0f168de2018-01-24 10:51:30 -080035 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
36
Kweku Adams85f2fbc2017-12-18 12:04:12 -080037 optional ConstantsProto settings = 1;
38
Makoto Onukib5d5e972018-02-20 14:44:20 -080039 optional int32 current_heartbeat = 14;
40 repeated int32 next_heartbeat = 15;
41 optional int64 last_heartbeat_time_millis = 16;
42 optional int64 next_heartbeat_time_millis = 17;
43
Kweku Adams85f2fbc2017-12-18 12:04:12 -080044 repeated int32 started_users = 2;
45
46 message RegisteredJob {
Kweku Adams0f168de2018-01-24 10:51:30 -080047 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
48
Kweku Adams85f2fbc2017-12-18 12:04:12 -080049 optional JobStatusShortInfoProto info = 1;
50 optional JobStatusDumpProto dump = 2;
51
52 // A job is ready to be executed if:
53 // is_job_ready && is_user_started && !is_job_pending &&
54 // !is_job_currently_active && !is_uid_backing_up &&
55 // is_component_present.
56 optional bool is_job_ready = 3;
57 optional bool is_user_started = 4;
58 optional bool is_job_pending = 5;
59 optional bool is_job_currently_active = 6;
60 optional bool is_uid_backing_up = 7;
61 optional bool is_component_present = 8;
Makoto Onukib5d5e972018-02-20 14:44:20 -080062
63 optional int64 last_run_heartbeat = 9;
Kweku Adams85f2fbc2017-12-18 12:04:12 -080064 }
65 repeated RegisteredJob registered_jobs = 3;
66
67 repeated StateControllerProto controllers = 4;
68
69 // Which uids are currently in the foreground.
70 message PriorityOverride {
Kweku Adams0f168de2018-01-24 10:51:30 -080071 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
72
Kweku Adams85f2fbc2017-12-18 12:04:12 -080073 optional int32 uid = 1;
74 // Use sint32 instead of an enum since priorities can technically be
75 // negative.
76 optional sint32 override_value = 2;
77 }
78 repeated PriorityOverride priority_overrides = 5;
79
80 // UIDs that are currently performing backups, so their jobs won't be
81 // allowed to run.
82 repeated int32 backing_up_uids = 6;
83
84 optional JobPackageHistoryProto history = 7;
85 optional JobPackageTrackerDumpProto package_tracker = 8;
86
87 message PendingJob {
Kweku Adams0f168de2018-01-24 10:51:30 -080088 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
89
Kweku Adams85f2fbc2017-12-18 12:04:12 -080090 optional JobStatusShortInfoProto info = 1;
91 optional JobStatusDumpProto dump = 2;
92 optional sint32 evaluated_priority = 3;
93 // How long this job has been pending.
94 optional int64 enqueued_duration_ms = 4;
95 }
96 repeated PendingJob pending_jobs = 9;
97
98 // From a service that has currently active or pending jobs.
99 message ActiveJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800100 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
101
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800102 message InactiveJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800103 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
104
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800105 optional int64 time_since_stopped_ms = 1;
106 // This is not always provided.
107 optional string stopped_reason = 2;
108 }
109 message RunningJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800110 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
111
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800112 optional JobStatusShortInfoProto info = 1;
113 // How long this job has been running for.
114 optional int64 running_duration_ms = 2;
115 optional int64 time_until_timeout_ms = 3;
116
117 optional JobStatusDumpProto dump = 4;
118
119 optional sint32 evaluated_priority = 5;
120
121 optional int64 time_since_made_active_ms = 6;
122 // How long this job has been pending.
123 optional int64 pending_duration_ms = 7;
124 }
125 oneof job {
126 InactiveJob inactive = 1;
127 RunningJob running = 2;
128 }
129 }
130 repeated ActiveJob active_jobs = 10;
131
132 // True when JobScheduler is allowed to run third party apps.
133 optional bool is_ready_to_rock = 11;
134 // What was last reported to DeviceIdleController about whether the device
135 // is active.
136 optional bool reported_active = 12;
137 // The current limit on the number of concurrent JobServiceContext entries
138 // we want to keep actively running a job.
139 optional int32 max_active_jobs = 13;
140}
141
142// A com.android.server.job.JobSchedulerService.Constants object.
143message ConstantsProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800144 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
145
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800146 // Minimum # of idle jobs that must be ready in order to force the JMS to
147 // schedule things early.
148 optional int32 min_idle_count = 1;
149 // Minimum # of charging jobs that must be ready in order to force the JMS
150 // to schedule things early.
151 optional int32 min_charging_count = 2;
152 // Minimum # of "battery not low" jobs that must be ready in order to force
153 // the JMS to schedule things early.
154 optional int32 min_battery_not_low_count = 3;
155 // Minimum # of "storage not low" jobs that must be ready in order to force
156 // the JMS to schedule things early.
157 optional int32 min_storage_not_low_count = 4;
158 // Minimum # of connectivity jobs that must be ready in order to force the
159 // JMS to schedule things early. 1 == Run connectivity jobs as soon as
160 // ready.
161 optional int32 min_connectivity_count = 5;
162 // Minimum # of content trigger jobs that must be ready in order to force
163 // the JMS to schedule things early.
164 optional int32 min_content_count = 6;
165 // Minimum # of jobs (with no particular constraints) for which the JMS will
166 // be happy running some work early. This (and thus the other min counts)
167 // is now set to 1, to prevent any batching at this level. Since we now do
168 // batching through doze, that is a much better mechanism.
169 optional int32 min_ready_jobs_count = 7;
170 // This is the job execution factor that is considered to be heavy use of
171 // the system.
172 optional double heavy_use_factor = 8;
173 // This is the job execution factor that is considered to be moderate use of
174 // the system.
175 optional double moderate_use_factor = 9;
176 // The number of MAX_JOB_CONTEXTS_COUNT we reserve for the foreground app.
177 optional int32 fg_job_count = 10;
178 // The maximum number of background jobs we allow when the system is in a
179 // normal memory state.
180 optional int32 bg_normal_job_count = 11;
181 // The maximum number of background jobs we allow when the system is in a
182 // moderate memory state.
183 optional int32 bg_moderate_job_count = 12;
184 // The maximum number of background jobs we allow when the system is in a
185 // low memory state.
186 optional int32 bg_low_job_count = 13;
187 // The maximum number of background jobs we allow when the system is in a
188 // critical memory state.
189 optional int32 bg_critical_job_count = 14;
190 // The maximum number of times we allow a job to have itself rescheduled
191 // before giving up on it, for standard jobs.
192 optional int32 max_standard_reschedule_count = 15;
193 // The maximum number of times we allow a job to have itself rescheduled
194 // before giving up on it, for jobs that are executing work.
195 optional int32 max_work_reschedule_count = 16;
196 // The minimum backoff time to allow for linear backoff.
197 optional int64 min_linear_backoff_time_ms = 17;
198 // The minimum backoff time to allow for exponential backoff.
199 optional int64 min_exp_backoff_time_ms = 18;
200 // How often we recalculate runnability based on apps' standby bucket
201 // assignment. This should be prime relative to common time interval lengths
202 // such as a quarter-hour or day, so that the heartbeat drifts relative to
203 // wall-clock milestones.
204 optional int64 standby_heartbeat_time_ms = 19;
205 // Mapping: standby bucket -> number of heartbeats between each sweep of
206 // that bucket's jobs.
207 // Bucket assignments as recorded in the JobStatus objects are normalized to
208 // be indices into this array, rather than the raw constants used by
209 // AppIdleHistory.
210 repeated int32 standby_beats = 20;
Jeff Sharkeyac2e8ef2018-02-22 16:06:44 -0700211 // The fraction of a job's running window that must pass before we
212 // consider running it when the network is congested.
213 optional double conn_congestion_delay_frac = 21;
214 // The fraction of a prefetch job's running window that must pass before
215 // we consider matching it against a metered network.
216 optional double conn_prefetch_relax_frac = 22;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800217}
218
219message StateControllerProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800220 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
221
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800222 message AppIdleController {
Kweku Adams0f168de2018-01-24 10:51:30 -0800223 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
224
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800225 optional bool is_parole_on = 1;
226
227 message TrackedJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800228 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
229
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800230 optional JobStatusShortInfoProto info = 1;
231 optional int32 source_uid = 2;
232 optional string source_package_name = 3;
233 // If the constraints are satisfied, then the controller will mark
234 // the job as RUNNABLE, otherwise, it will be WAITING.
235 optional bool are_constraints_satisfied = 4;
236 }
237 repeated TrackedJob tracked_jobs = 2;
238 }
239 message BackgroundJobsController {
Kweku Adams0f168de2018-01-24 10:51:30 -0800240 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
241
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800242 optional com.android.server.ForceAppStandbyTrackerProto force_app_standby_tracker = 1;
243
244 message TrackedJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800245 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
246
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800247 optional JobStatusShortInfoProto info = 1;
248 optional int32 source_uid = 2;
249 optional string source_package_name = 3;
250 optional bool is_in_foreground = 4;
251 optional bool is_whitelisted = 5;
252 optional bool can_run_any_in_background = 6;
253 // If the constraints are satisfied, then the controller will mark
254 // the job as RUNNABLE, otherwise, it will be WAITING.
255 optional bool are_constraints_satisfied = 7;
256 }
257 repeated TrackedJob tracked_jobs = 2;
258 }
259 message BatteryController {
Kweku Adams0f168de2018-01-24 10:51:30 -0800260 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
261
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800262 optional bool is_on_stable_power = 1;
263 optional bool is_battery_not_low = 2;
264
265 // Whether or not the controller is monitoring battery changes.
266 optional bool is_monitoring = 3;
267 // Only valid if is_monitoring is true.
268 optional int32 last_broadcast_sequence_number = 4;
269
270 message TrackedJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800271 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
272
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800273 optional JobStatusShortInfoProto info = 1;
274 optional int32 source_uid = 2;
275 }
276 repeated TrackedJob tracked_jobs = 5;
277 }
278 message ConnectivityController {
Kweku Adams0f168de2018-01-24 10:51:30 -0800279 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
280
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800281 optional bool is_connected = 1;
282
283 message TrackedJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800284 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
285
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800286 optional JobStatusShortInfoProto info = 1;
287 optional int32 source_uid = 2;
288 optional .android.net.NetworkRequestProto required_network = 3;
289 }
290 repeated TrackedJob tracked_jobs = 2;
291 }
292 message ContentObserverController {
Kweku Adams0f168de2018-01-24 10:51:30 -0800293 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
294
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800295 message TrackedJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800296 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
297
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800298 optional JobStatusShortInfoProto info = 1;
299 optional int32 source_uid = 2;
300 }
301 repeated TrackedJob tracked_jobs = 1;
302
303 message Observer {
Kweku Adams0f168de2018-01-24 10:51:30 -0800304 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
305
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800306 optional int32 user_id = 1;
307
308 message TriggerContentData {
Kweku Adams0f168de2018-01-24 10:51:30 -0800309 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
310
311 optional string uri = 1 [
312 (.android.privacy).dest = DEST_EXPLICIT
313 ];
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800314 optional int32 flags = 2;
315
316 // A
317 // com.android.server.job.controllers.ContentObserverController.JobInstance
318 // object.
319 message JobInstance {
Kweku Adams0f168de2018-01-24 10:51:30 -0800320 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
321
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800322 optional JobStatusShortInfoProto info = 1;
323 optional int32 source_uid = 2;
324
325 optional int64 trigger_content_update_delay_ms = 3;
326 optional int64 trigger_content_max_delay_ms = 4;
327
Kweku Adams0f168de2018-01-24 10:51:30 -0800328 repeated string changed_authorities = 5 [
329 (.android.privacy).dest = DEST_EXPLICIT
330 ];
331 repeated string changed_uris = 6 [
332 (.android.privacy).dest = DEST_EXPLICIT
333 ];
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800334 }
335 repeated JobInstance jobs = 3;
336 }
337 repeated TriggerContentData triggers = 2;
338 }
339 repeated Observer observers = 2;
340 }
341 message DeviceIdleJobsController {
Kweku Adams0f168de2018-01-24 10:51:30 -0800342 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
343
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800344 // True when in device idle mode.
345 optional bool is_device_idle_mode = 1;
346
347 message TrackedJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800348 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
349
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800350 optional JobStatusShortInfoProto info = 1;
351 optional int32 source_uid = 2;
352 optional string source_package_name = 3;
353 // If the constraints are satisfied, then the controller will mark
354 // the job as RUNNABLE, otherwise, it will be WAITING.
355 optional bool are_constraints_satisfied = 4;
356 optional bool is_doze_whitelisted = 5;
357 // A job that is exempted from Doze when the app is temp whitelisted
358 // or in the foreground.
359 optional bool is_allowed_in_doze = 6;
360 }
361 repeated TrackedJob tracked_jobs = 2;
362 }
363 message IdleController {
Kweku Adams0f168de2018-01-24 10:51:30 -0800364 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
365
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800366 optional bool is_idle = 1;
367
368 message TrackedJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800369 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
370
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800371 optional JobStatusShortInfoProto info = 1;
372 optional int32 source_uid = 2;
373 }
374 repeated TrackedJob tracked_jobs = 2;
375 }
376 message StorageController {
Kweku Adams0f168de2018-01-24 10:51:30 -0800377 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
378
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800379 optional bool is_storage_not_low = 1;
380 optional int32 last_broadcast_sequence_number = 2;
381
382 message TrackedJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800383 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
384
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800385 optional JobStatusShortInfoProto info = 1;
386 optional int32 source_uid = 2;
387 }
388 repeated TrackedJob tracked_jobs = 3;
389 }
390 message TimeController {
Kweku Adams0f168de2018-01-24 10:51:30 -0800391 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
392
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800393 optional int64 now_elapsed_realtime = 1;
394 optional int64 time_until_next_delay_alarm_ms = 2;
395 optional int64 time_until_next_deadline_alarm_ms = 3;
396
397 message TrackedJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800398 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
399
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800400 optional JobStatusShortInfoProto info = 1;
401 optional int32 source_uid = 2;
402
403 optional bool has_timing_delay_constraint = 3;
404 // Only valid if has_timing_delay_constraint is true. Can be
405 // negative if the delay is in the past.
406 optional int64 delay_time_remaining_ms = 4;
407
408 optional bool has_deadline_constraint = 5;
409 // Only valid if has_timing_delay_constraint is true. Can be
410 // negative in certain situations.
411 optional int64 time_remaining_until_deadline_ms = 6;
412 }
413 repeated TrackedJob tracked_jobs = 4;
414 }
415 oneof controller {
416 AppIdleController app_idle = 1;
417 BackgroundJobsController background = 2;
418 BatteryController battery = 3;
419 ConnectivityController connectivity = 4;
420 ContentObserverController content_observer = 5;
421 DeviceIdleJobsController device_idle = 6;
422 IdleController idle = 7;
423 StorageController storage = 8;
424 TimeController time = 9;
425 }
426}
427
428// A com.android.server.job.JobPackageTracker.DataSet object.
429message DataSetProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800430 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
431
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800432 optional int64 start_clock_time_ms = 1;
433 // How much time has elapsed since the DataSet was instantiated.
434 optional int64 elapsed_time_ms = 2;
435 optional int64 period_ms = 3;
436
437 // Represents a com.android.server.job.JobPackageTracker.PackageEntry
438 // object, but with some extra data.
439 message PackageEntryProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800440 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
441
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800442 optional int32 uid = 1;
443 optional string package_name = 2;
444
445 message State {
Kweku Adams0f168de2018-01-24 10:51:30 -0800446 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
447
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800448 optional int64 duration_ms = 1;
449 optional int32 count = 2;
450 }
451 optional State pending_state = 3;
452 optional State active_state = 4;
453 optional State active_top_state = 5;
454
455 // True if the PackageEntry is currently pending or has been pending in
456 // the past.
457 optional bool pending = 6;
458 // True if the PackageEntry is currently active or has been active in
459 // the past.
460 optional bool active = 7;
461 // True if the PackageEntry is currently active top or has been active
462 // top in the past.
463 optional bool active_top = 8;
464
465 message StopReasonCount {
Kweku Adams0f168de2018-01-24 10:51:30 -0800466 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
467
Tej Singh33a412b2018-03-16 18:43:59 -0700468 optional .android.app.job.StopReasonEnum reason = 1;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800469 optional int32 count = 2;
470 }
471 repeated StopReasonCount stop_reasons = 9;
472 }
473 repeated PackageEntryProto package_entries = 4;
474
475 optional int32 max_concurrency = 5;
476 optional int32 max_foreground_concurrency = 6;
477}
478
479// Dump from com.android.server.job.GrantedUriPermissions.
480message GrantedUriPermissionsDumpProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800481 option (.android.msg_privacy).dest = DEST_EXPLICIT;
482
483 optional int32 flags = 1 [ (.android.privacy).dest = DEST_AUTOMATIC ];
484 optional int32 source_user_id = 2 [
485 (.android.privacy).dest = DEST_AUTOMATIC
486 ];
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800487 optional string tag = 3;
488 optional string permission_owner = 4;
489 repeated string uris = 5;
490}
491
492message JobPackageTrackerDumpProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800493 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
494
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800495 repeated DataSetProto historical_stats = 1;
496 optional DataSetProto current_stats = 2;
497}
498
499message JobPackageHistoryProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800500 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
501
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800502 enum Event {
503 UNKNOWN = 0;
504 START_JOB = 1;
505 STOP_JOB = 2;
506 START_PERIODIC_JOB = 3;
507 STOP_PERIODIC_JOB = 4;
508 }
509 message HistoryEvent {
Kweku Adams0f168de2018-01-24 10:51:30 -0800510 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
511
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800512 optional Event event = 1;
513 optional int64 time_since_event_ms = 2;
514 optional int32 uid = 3;
515 // Job IDs can technically be negative.
516 optional int32 job_id = 4;
Yi Jin2921dd02018-03-23 14:10:31 -0700517 optional string tag = 5;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800518 // Only valid for STOP_JOB or STOP_PERIODIC_JOB Events.
Tej Singh33a412b2018-03-16 18:43:59 -0700519 optional .android.app.job.StopReasonEnum stop_reason = 6;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800520 }
521 repeated HistoryEvent history_event = 1;
522}
523
524message JobStatusShortInfoProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800525 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
526
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800527 optional int32 calling_uid = 1;
528 // Job IDs can technically be negative.
529 optional int32 job_id = 2;
Kweku Adams0f168de2018-01-24 10:51:30 -0800530 optional string battery_name = 3 [
531 (.android.privacy).dest = DEST_EXPLICIT
532 ];
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800533}
534
535// Dump from a com.android.server.job.controllers.JobStatus object.
536message JobStatusDumpProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800537 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
538
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800539 // The UID that scheduled the job.
540 optional int32 calling_uid = 1;
Yi Jin2921dd02018-03-23 14:10:31 -0700541 optional string tag = 2;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800542
543 // The UID for which the job is being run.
544 optional int32 source_uid = 3;
545 optional int32 source_user_id = 4;
546 // The package for which the job is being run.
547 optional string source_package_name = 5;
548
549 // Custom dump of android.app.job.JobInfo object.
550 message JobInfo {
Kweku Adams0f168de2018-01-24 10:51:30 -0800551 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
552
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800553 optional .android.content.ComponentNameProto service = 1;
554
555 optional bool is_periodic = 2;
556 // Only valid if is_periodic is true.
557 optional int64 period_interval_ms = 3;
558 // Only valid if is_periodic is true.
559 optional int64 period_flex_ms = 4;
560
561 optional bool is_persisted = 5;
562 optional sint32 priority = 6;
563 optional int32 flags = 7;
564
565 optional bool requires_charging = 8;
566 optional bool requires_battery_not_low = 9;
567 optional bool requires_device_idle = 10;
568
569 message TriggerContentUri {
Kweku Adams0f168de2018-01-24 10:51:30 -0800570 optional int32 flags = 1 [
571 (.android.privacy).dest = DEST_AUTOMATIC
572 ];
573 optional string uri = 2 [ (.android.privacy).dest = DEST_EXPLICIT ];
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800574 }
575 repeated TriggerContentUri trigger_content_uris = 11;
576 optional int64 trigger_content_update_delay_ms = 12;
577 optional int64 trigger_content_max_delay_ms = 13;
578
579 optional .android.os.PersistableBundleProto extras = 14;
580 optional .android.os.BundleProto transient_extras = 15;
581 optional .android.content.ClipDataProto clip_data = 16;
582
583 optional GrantedUriPermissionsDumpProto granted_uri_permissions = 17;
584
585 optional .android.net.NetworkRequestProto required_network = 18;
586
587 optional int64 total_network_bytes = 19;
588
589 optional int64 min_latency_ms = 20;
590 optional int64 max_execution_delay_ms = 21;
591
592 message Backoff {
Kweku Adams0f168de2018-01-24 10:51:30 -0800593 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
594
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800595 enum Policy {
596 BACKOFF_POLICY_LINEAR = 0;
597 BACKOFF_POLICY_EXPONENTIAL = 1;
598 }
599 optional Policy policy = 1;
600 optional int64 initial_backoff_ms = 2;
601 }
602 optional Backoff backoff_policy = 22;
603
604 optional bool has_early_constraint = 23;
605 optional bool has_late_constraint = 24;
606 }
607 optional JobInfo job_info = 6;
608
609 enum Constraint {
610 CONSTRAINT_CHARGING = 1;
611 CONSTRAINT_BATTERY_NOT_LOW = 2;
612 CONSTRAINT_STORAGE_NOT_LOW = 3;
613 CONSTRAINT_TIMING_DELAY = 4;
614 CONSTRAINT_DEADLINE = 5;
615 CONSTRAINT_IDLE = 6;
616 CONSTRAINT_CONNECTIVITY = 7;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800617 CONSTRAINT_CONTENT_TRIGGER = 9;
618 CONSTRAINT_DEVICE_NOT_DOZING = 10;
619 }
620 repeated Constraint required_constraints = 7;
621 repeated Constraint satisfied_constraints = 8;
622 repeated Constraint unsatisfied_constraints = 9;
623 optional bool is_doze_whitelisted = 10;
624
625 enum TrackingController {
626 TRACKING_BATTERY = 0;
627 TRACKING_CONNECTIVITY = 1;
628 TRACKING_CONTENT = 2;
629 TRACKING_IDLE = 3;
630 TRACKING_STORAGE = 4;
631 TRACKING_TIME = 5;
632 }
633 // Controllers that are currently tracking the job.
634 repeated TrackingController tracking_controllers = 11;
635
Kweku Adams0f168de2018-01-24 10:51:30 -0800636 repeated string changed_authorities = 12 [
637 (.android.privacy).dest = DEST_EXPLICIT
638 ];
639 repeated string changed_uris = 13 [
640 (.android.privacy).dest = DEST_EXPLICIT
641 ];
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800642
643 optional .android.net.NetworkProto network = 14;
644
645 // Only the desired data from an android.app.job.JobWorkItem object.
646 message JobWorkItem {
Kweku Adams0f168de2018-01-24 10:51:30 -0800647 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
648
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800649 optional int32 work_id = 1;
650 optional int32 delivery_count = 2;
651 optional .android.content.IntentProto intent = 3;
652 optional GrantedUriPermissionsDumpProto uri_grants = 4;
653 }
654 repeated JobWorkItem pending_work = 15;
655 repeated JobWorkItem executing_work = 16;
656
657 enum Bucket {
658 ACTIVE = 0;
659 WORKING_SET = 1;
660 FREQUENT = 2;
661 RARE = 3;
662 NEVER = 4;
663 }
664 optional Bucket standby_bucket = 17;
665
666 optional int64 enqueue_duration_ms = 18;
667 // Can be negative if the earliest runtime deadline has passed.
668 optional sint64 time_until_earliest_runtime_ms = 19;
669 // Can be negative if the latest runtime deadline has passed.
670 optional sint64 time_until_latest_runtime_ms = 20;
671
672 optional int32 num_failures = 21;
673
674 optional int64 last_successful_run_time = 22;
675 optional int64 last_failed_run_time = 23;
Makoto Onuki15407842018-01-19 14:23:11 -0800676
677 optional int64 internal_flags = 24;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800678}