blob: 0a10cece0caba6447c39412a61031337212d393d [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 BackgroundJobsController {
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 com.android.server.ForceAppStandbyTrackerProto force_app_standby_tracker = 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 optional bool is_in_foreground = 4;
234 optional bool is_whitelisted = 5;
235 optional bool can_run_any_in_background = 6;
236 // If the constraints are satisfied, then the controller will mark
237 // the job as RUNNABLE, otherwise, it will be WAITING.
238 optional bool are_constraints_satisfied = 7;
239 }
240 repeated TrackedJob tracked_jobs = 2;
241 }
242 message BatteryController {
Kweku Adams0f168de2018-01-24 10:51:30 -0800243 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
244
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800245 optional bool is_on_stable_power = 1;
246 optional bool is_battery_not_low = 2;
247
248 // Whether or not the controller is monitoring battery changes.
249 optional bool is_monitoring = 3;
250 // Only valid if is_monitoring is true.
251 optional int32 last_broadcast_sequence_number = 4;
252
253 message TrackedJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800254 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
255
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800256 optional JobStatusShortInfoProto info = 1;
257 optional int32 source_uid = 2;
258 }
259 repeated TrackedJob tracked_jobs = 5;
260 }
261 message ConnectivityController {
Kweku Adams0f168de2018-01-24 10:51:30 -0800262 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
263
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800264 optional bool is_connected = 1;
265
266 message TrackedJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800267 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
268
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800269 optional JobStatusShortInfoProto info = 1;
270 optional int32 source_uid = 2;
271 optional .android.net.NetworkRequestProto required_network = 3;
272 }
273 repeated TrackedJob tracked_jobs = 2;
274 }
275 message ContentObserverController {
Kweku Adams0f168de2018-01-24 10:51:30 -0800276 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
277
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800278 message TrackedJob {
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 JobStatusShortInfoProto info = 1;
282 optional int32 source_uid = 2;
283 }
284 repeated TrackedJob tracked_jobs = 1;
285
286 message Observer {
Kweku Adams0f168de2018-01-24 10:51:30 -0800287 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
288
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800289 optional int32 user_id = 1;
290
291 message TriggerContentData {
Kweku Adams0f168de2018-01-24 10:51:30 -0800292 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
293
294 optional string uri = 1 [
295 (.android.privacy).dest = DEST_EXPLICIT
296 ];
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800297 optional int32 flags = 2;
298
299 // A
300 // com.android.server.job.controllers.ContentObserverController.JobInstance
301 // object.
302 message JobInstance {
Kweku Adams0f168de2018-01-24 10:51:30 -0800303 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
304
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800305 optional JobStatusShortInfoProto info = 1;
306 optional int32 source_uid = 2;
307
308 optional int64 trigger_content_update_delay_ms = 3;
309 optional int64 trigger_content_max_delay_ms = 4;
310
Kweku Adams0f168de2018-01-24 10:51:30 -0800311 repeated string changed_authorities = 5 [
312 (.android.privacy).dest = DEST_EXPLICIT
313 ];
314 repeated string changed_uris = 6 [
315 (.android.privacy).dest = DEST_EXPLICIT
316 ];
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800317 }
318 repeated JobInstance jobs = 3;
319 }
320 repeated TriggerContentData triggers = 2;
321 }
322 repeated Observer observers = 2;
323 }
324 message DeviceIdleJobsController {
Kweku Adams0f168de2018-01-24 10:51:30 -0800325 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
326
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800327 // True when in device idle mode.
328 optional bool is_device_idle_mode = 1;
329
330 message TrackedJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800331 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
332
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800333 optional JobStatusShortInfoProto info = 1;
334 optional int32 source_uid = 2;
335 optional string source_package_name = 3;
336 // If the constraints are satisfied, then the controller will mark
337 // the job as RUNNABLE, otherwise, it will be WAITING.
338 optional bool are_constraints_satisfied = 4;
339 optional bool is_doze_whitelisted = 5;
340 // A job that is exempted from Doze when the app is temp whitelisted
341 // or in the foreground.
342 optional bool is_allowed_in_doze = 6;
343 }
344 repeated TrackedJob tracked_jobs = 2;
345 }
346 message IdleController {
Kweku Adams0f168de2018-01-24 10:51:30 -0800347 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
348
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800349 optional bool is_idle = 1;
350
351 message TrackedJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800352 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
353
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800354 optional JobStatusShortInfoProto info = 1;
355 optional int32 source_uid = 2;
356 }
357 repeated TrackedJob tracked_jobs = 2;
358 }
359 message StorageController {
Kweku Adams0f168de2018-01-24 10:51:30 -0800360 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
361
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800362 optional bool is_storage_not_low = 1;
363 optional int32 last_broadcast_sequence_number = 2;
364
365 message TrackedJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800366 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
367
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800368 optional JobStatusShortInfoProto info = 1;
369 optional int32 source_uid = 2;
370 }
371 repeated TrackedJob tracked_jobs = 3;
372 }
373 message TimeController {
Kweku Adams0f168de2018-01-24 10:51:30 -0800374 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
375
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800376 optional int64 now_elapsed_realtime = 1;
377 optional int64 time_until_next_delay_alarm_ms = 2;
378 optional int64 time_until_next_deadline_alarm_ms = 3;
379
380 message TrackedJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800381 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
382
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800383 optional JobStatusShortInfoProto info = 1;
384 optional int32 source_uid = 2;
385
386 optional bool has_timing_delay_constraint = 3;
387 // Only valid if has_timing_delay_constraint is true. Can be
388 // negative if the delay is in the past.
389 optional int64 delay_time_remaining_ms = 4;
390
391 optional bool has_deadline_constraint = 5;
392 // Only valid if has_timing_delay_constraint is true. Can be
393 // negative in certain situations.
394 optional int64 time_remaining_until_deadline_ms = 6;
395 }
396 repeated TrackedJob tracked_jobs = 4;
397 }
398 oneof controller {
Kweku Adams21b8d262018-03-30 12:19:58 -0700399 BackgroundJobsController background = 1;
400 BatteryController battery = 2;
401 ConnectivityController connectivity = 3;
402 ContentObserverController content_observer = 4;
403 DeviceIdleJobsController device_idle = 5;
404 IdleController idle = 6;
405 StorageController storage = 7;
406 TimeController time = 8;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800407 }
408}
409
410// A com.android.server.job.JobPackageTracker.DataSet object.
411message DataSetProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800412 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
413
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800414 optional int64 start_clock_time_ms = 1;
415 // How much time has elapsed since the DataSet was instantiated.
416 optional int64 elapsed_time_ms = 2;
417 optional int64 period_ms = 3;
418
419 // Represents a com.android.server.job.JobPackageTracker.PackageEntry
420 // object, but with some extra data.
421 message PackageEntryProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800422 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
423
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800424 optional int32 uid = 1;
425 optional string package_name = 2;
426
427 message State {
Kweku Adams0f168de2018-01-24 10:51:30 -0800428 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
429
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800430 optional int64 duration_ms = 1;
431 optional int32 count = 2;
432 }
433 optional State pending_state = 3;
434 optional State active_state = 4;
435 optional State active_top_state = 5;
436
437 // True if the PackageEntry is currently pending or has been pending in
438 // the past.
439 optional bool pending = 6;
440 // True if the PackageEntry is currently active or has been active in
441 // the past.
442 optional bool active = 7;
443 // True if the PackageEntry is currently active top or has been active
444 // top in the past.
445 optional bool active_top = 8;
446
447 message StopReasonCount {
Kweku Adams0f168de2018-01-24 10:51:30 -0800448 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
449
Tej Singh33a412b2018-03-16 18:43:59 -0700450 optional .android.app.job.StopReasonEnum reason = 1;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800451 optional int32 count = 2;
452 }
453 repeated StopReasonCount stop_reasons = 9;
454 }
455 repeated PackageEntryProto package_entries = 4;
456
457 optional int32 max_concurrency = 5;
458 optional int32 max_foreground_concurrency = 6;
459}
460
461// Dump from com.android.server.job.GrantedUriPermissions.
462message GrantedUriPermissionsDumpProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800463 option (.android.msg_privacy).dest = DEST_EXPLICIT;
464
465 optional int32 flags = 1 [ (.android.privacy).dest = DEST_AUTOMATIC ];
466 optional int32 source_user_id = 2 [
467 (.android.privacy).dest = DEST_AUTOMATIC
468 ];
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800469 optional string tag = 3;
470 optional string permission_owner = 4;
471 repeated string uris = 5;
472}
473
474message JobPackageTrackerDumpProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800475 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
476
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800477 repeated DataSetProto historical_stats = 1;
478 optional DataSetProto current_stats = 2;
479}
480
481message JobPackageHistoryProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800482 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
483
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800484 enum Event {
485 UNKNOWN = 0;
486 START_JOB = 1;
487 STOP_JOB = 2;
488 START_PERIODIC_JOB = 3;
489 STOP_PERIODIC_JOB = 4;
490 }
491 message HistoryEvent {
Kweku Adams0f168de2018-01-24 10:51:30 -0800492 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
493
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800494 optional Event event = 1;
495 optional int64 time_since_event_ms = 2;
496 optional int32 uid = 3;
497 // Job IDs can technically be negative.
498 optional int32 job_id = 4;
Yi Jin2921dd02018-03-23 14:10:31 -0700499 optional string tag = 5;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800500 // Only valid for STOP_JOB or STOP_PERIODIC_JOB Events.
Tej Singh33a412b2018-03-16 18:43:59 -0700501 optional .android.app.job.StopReasonEnum stop_reason = 6;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800502 }
503 repeated HistoryEvent history_event = 1;
504}
505
506message JobStatusShortInfoProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800507 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
508
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800509 optional int32 calling_uid = 1;
510 // Job IDs can technically be negative.
511 optional int32 job_id = 2;
Yi Jine5e2a752018-03-28 18:31:07 -0700512 optional string battery_name = 3;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800513}
514
515// Dump from a com.android.server.job.controllers.JobStatus object.
516message JobStatusDumpProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800517 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
518
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800519 // The UID that scheduled the job.
520 optional int32 calling_uid = 1;
Yi Jin2921dd02018-03-23 14:10:31 -0700521 optional string tag = 2;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800522
523 // The UID for which the job is being run.
524 optional int32 source_uid = 3;
525 optional int32 source_user_id = 4;
526 // The package for which the job is being run.
527 optional string source_package_name = 5;
528
529 // Custom dump of android.app.job.JobInfo object.
530 message JobInfo {
Kweku Adams0f168de2018-01-24 10:51:30 -0800531 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
532
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800533 optional .android.content.ComponentNameProto service = 1;
534
535 optional bool is_periodic = 2;
536 // Only valid if is_periodic is true.
537 optional int64 period_interval_ms = 3;
538 // Only valid if is_periodic is true.
539 optional int64 period_flex_ms = 4;
540
541 optional bool is_persisted = 5;
542 optional sint32 priority = 6;
543 optional int32 flags = 7;
544
545 optional bool requires_charging = 8;
546 optional bool requires_battery_not_low = 9;
547 optional bool requires_device_idle = 10;
548
549 message TriggerContentUri {
Kweku Adams0f168de2018-01-24 10:51:30 -0800550 optional int32 flags = 1 [
551 (.android.privacy).dest = DEST_AUTOMATIC
552 ];
553 optional string uri = 2 [ (.android.privacy).dest = DEST_EXPLICIT ];
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800554 }
555 repeated TriggerContentUri trigger_content_uris = 11;
556 optional int64 trigger_content_update_delay_ms = 12;
557 optional int64 trigger_content_max_delay_ms = 13;
558
559 optional .android.os.PersistableBundleProto extras = 14;
560 optional .android.os.BundleProto transient_extras = 15;
Kweku Adamscb89f622018-03-22 13:55:46 -0700561 // ClipData of information that is returned to the application at
562 // execution time, but not persisted by the system. This is provided by
563 // the app and the main purpose of providing a ClipData is to allow
564 // granting of URI permissions for data associated with the clip. The
565 // exact kind of permission grant to perform is specified in the flags
566 // field.
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800567 optional .android.content.ClipDataProto clip_data = 16;
568
569 optional GrantedUriPermissionsDumpProto granted_uri_permissions = 17;
570
571 optional .android.net.NetworkRequestProto required_network = 18;
572
573 optional int64 total_network_bytes = 19;
574
575 optional int64 min_latency_ms = 20;
576 optional int64 max_execution_delay_ms = 21;
577
578 message Backoff {
Kweku Adams0f168de2018-01-24 10:51:30 -0800579 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
580
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800581 enum Policy {
582 BACKOFF_POLICY_LINEAR = 0;
583 BACKOFF_POLICY_EXPONENTIAL = 1;
584 }
585 optional Policy policy = 1;
586 optional int64 initial_backoff_ms = 2;
587 }
588 optional Backoff backoff_policy = 22;
589
590 optional bool has_early_constraint = 23;
591 optional bool has_late_constraint = 24;
592 }
593 optional JobInfo job_info = 6;
594
595 enum Constraint {
596 CONSTRAINT_CHARGING = 1;
597 CONSTRAINT_BATTERY_NOT_LOW = 2;
598 CONSTRAINT_STORAGE_NOT_LOW = 3;
599 CONSTRAINT_TIMING_DELAY = 4;
600 CONSTRAINT_DEADLINE = 5;
601 CONSTRAINT_IDLE = 6;
602 CONSTRAINT_CONNECTIVITY = 7;
Kweku Adams21b8d262018-03-30 12:19:58 -0700603 CONSTRAINT_CONTENT_TRIGGER = 8;
604 CONSTRAINT_DEVICE_NOT_DOZING = 9;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800605 }
606 repeated Constraint required_constraints = 7;
607 repeated Constraint satisfied_constraints = 8;
608 repeated Constraint unsatisfied_constraints = 9;
609 optional bool is_doze_whitelisted = 10;
610
611 enum TrackingController {
612 TRACKING_BATTERY = 0;
613 TRACKING_CONNECTIVITY = 1;
614 TRACKING_CONTENT = 2;
615 TRACKING_IDLE = 3;
616 TRACKING_STORAGE = 4;
617 TRACKING_TIME = 5;
618 }
619 // Controllers that are currently tracking the job.
620 repeated TrackingController tracking_controllers = 11;
621
Kweku Adams0f168de2018-01-24 10:51:30 -0800622 repeated string changed_authorities = 12 [
623 (.android.privacy).dest = DEST_EXPLICIT
624 ];
625 repeated string changed_uris = 13 [
626 (.android.privacy).dest = DEST_EXPLICIT
627 ];
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800628
629 optional .android.net.NetworkProto network = 14;
630
631 // Only the desired data from an android.app.job.JobWorkItem object.
632 message JobWorkItem {
Kweku Adams0f168de2018-01-24 10:51:30 -0800633 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
634
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800635 optional int32 work_id = 1;
636 optional int32 delivery_count = 2;
637 optional .android.content.IntentProto intent = 3;
638 optional GrantedUriPermissionsDumpProto uri_grants = 4;
639 }
640 repeated JobWorkItem pending_work = 15;
641 repeated JobWorkItem executing_work = 16;
642
643 enum Bucket {
644 ACTIVE = 0;
645 WORKING_SET = 1;
646 FREQUENT = 2;
647 RARE = 3;
648 NEVER = 4;
649 }
650 optional Bucket standby_bucket = 17;
651
652 optional int64 enqueue_duration_ms = 18;
653 // Can be negative if the earliest runtime deadline has passed.
654 optional sint64 time_until_earliest_runtime_ms = 19;
655 // Can be negative if the latest runtime deadline has passed.
656 optional sint64 time_until_latest_runtime_ms = 20;
657
658 optional int32 num_failures = 21;
659
660 optional int64 last_successful_run_time = 22;
661 optional int64 last_failed_run_time = 23;
Makoto Onuki15407842018-01-19 14:23:11 -0800662
663 optional int64 internal_flags = 24;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800664}