blob: 4eb4aaeb34992a00dd1a40507238b6350d999cae [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;
Makoto Onuki0525b982018-05-02 14:46:59 -070043 optional bool in_parole = 18;
Wei Wang8c0c3c12018-11-14 14:56:52 -080044 optional bool in_thermal = 19;
Makoto Onukib5d5e972018-02-20 14:44:20 -080045
Kweku Adams85f2fbc2017-12-18 12:04:12 -080046 repeated int32 started_users = 2;
47
48 message RegisteredJob {
Kweku Adams0f168de2018-01-24 10:51:30 -080049 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
50
Kweku Adams85f2fbc2017-12-18 12:04:12 -080051 optional JobStatusShortInfoProto info = 1;
52 optional JobStatusDumpProto dump = 2;
53
54 // A job is ready to be executed if:
55 // is_job_ready && is_user_started && !is_job_pending &&
56 // !is_job_currently_active && !is_uid_backing_up &&
57 // is_component_present.
58 optional bool is_job_ready = 3;
59 optional bool is_user_started = 4;
60 optional bool is_job_pending = 5;
61 optional bool is_job_currently_active = 6;
62 optional bool is_uid_backing_up = 7;
63 optional bool is_component_present = 8;
Makoto Onukib5d5e972018-02-20 14:44:20 -080064
65 optional int64 last_run_heartbeat = 9;
Kweku Adams85f2fbc2017-12-18 12:04:12 -080066 }
67 repeated RegisteredJob registered_jobs = 3;
68
69 repeated StateControllerProto controllers = 4;
70
71 // Which uids are currently in the foreground.
72 message PriorityOverride {
Kweku Adams0f168de2018-01-24 10:51:30 -080073 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
74
Kweku Adams85f2fbc2017-12-18 12:04:12 -080075 optional int32 uid = 1;
76 // Use sint32 instead of an enum since priorities can technically be
77 // negative.
78 optional sint32 override_value = 2;
79 }
80 repeated PriorityOverride priority_overrides = 5;
81
82 // UIDs that are currently performing backups, so their jobs won't be
83 // allowed to run.
84 repeated int32 backing_up_uids = 6;
85
86 optional JobPackageHistoryProto history = 7;
87 optional JobPackageTrackerDumpProto package_tracker = 8;
88
89 message PendingJob {
Kweku Adams0f168de2018-01-24 10:51:30 -080090 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
91
Kweku Adams85f2fbc2017-12-18 12:04:12 -080092 optional JobStatusShortInfoProto info = 1;
93 optional JobStatusDumpProto dump = 2;
94 optional sint32 evaluated_priority = 3;
95 // How long this job has been pending.
96 optional int64 enqueued_duration_ms = 4;
97 }
98 repeated PendingJob pending_jobs = 9;
99
100 // From a service that has currently active or pending jobs.
101 message ActiveJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800102 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
103
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800104 message InactiveJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800105 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
106
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800107 optional int64 time_since_stopped_ms = 1;
108 // This is not always provided.
109 optional string stopped_reason = 2;
110 }
111 message RunningJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800112 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
113
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800114 optional JobStatusShortInfoProto info = 1;
115 // How long this job has been running for.
116 optional int64 running_duration_ms = 2;
117 optional int64 time_until_timeout_ms = 3;
118
119 optional JobStatusDumpProto dump = 4;
120
121 optional sint32 evaluated_priority = 5;
122
123 optional int64 time_since_made_active_ms = 6;
124 // How long this job has been pending.
125 optional int64 pending_duration_ms = 7;
126 }
127 oneof job {
128 InactiveJob inactive = 1;
129 RunningJob running = 2;
130 }
131 }
132 repeated ActiveJob active_jobs = 10;
133
134 // True when JobScheduler is allowed to run third party apps.
135 optional bool is_ready_to_rock = 11;
136 // What was last reported to DeviceIdleController about whether the device
137 // is active.
138 optional bool reported_active = 12;
139 // The current limit on the number of concurrent JobServiceContext entries
140 // we want to keep actively running a job.
141 optional int32 max_active_jobs = 13;
142}
143
144// A com.android.server.job.JobSchedulerService.Constants object.
145message ConstantsProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800146 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
147
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800148 // Minimum # of idle jobs that must be ready in order to force the JMS to
149 // schedule things early.
150 optional int32 min_idle_count = 1;
151 // Minimum # of charging jobs that must be ready in order to force the JMS
152 // to schedule things early.
153 optional int32 min_charging_count = 2;
154 // Minimum # of "battery not low" jobs that must be ready in order to force
155 // the JMS to schedule things early.
156 optional int32 min_battery_not_low_count = 3;
157 // Minimum # of "storage not low" jobs that must be ready in order to force
158 // the JMS to schedule things early.
159 optional int32 min_storage_not_low_count = 4;
160 // Minimum # of connectivity jobs that must be ready in order to force the
161 // JMS to schedule things early. 1 == Run connectivity jobs as soon as
162 // ready.
163 optional int32 min_connectivity_count = 5;
164 // Minimum # of content trigger jobs that must be ready in order to force
165 // the JMS to schedule things early.
166 optional int32 min_content_count = 6;
167 // Minimum # of jobs (with no particular constraints) for which the JMS will
168 // be happy running some work early. This (and thus the other min counts)
169 // is now set to 1, to prevent any batching at this level. Since we now do
170 // batching through doze, that is a much better mechanism.
171 optional int32 min_ready_jobs_count = 7;
172 // This is the job execution factor that is considered to be heavy use of
173 // the system.
174 optional double heavy_use_factor = 8;
175 // This is the job execution factor that is considered to be moderate use of
176 // the system.
177 optional double moderate_use_factor = 9;
178 // The number of MAX_JOB_CONTEXTS_COUNT we reserve for the foreground app.
179 optional int32 fg_job_count = 10;
180 // The maximum number of background jobs we allow when the system is in a
181 // normal memory state.
182 optional int32 bg_normal_job_count = 11;
183 // The maximum number of background jobs we allow when the system is in a
184 // moderate memory state.
185 optional int32 bg_moderate_job_count = 12;
186 // The maximum number of background jobs we allow when the system is in a
187 // low memory state.
188 optional int32 bg_low_job_count = 13;
189 // The maximum number of background jobs we allow when the system is in a
190 // critical memory state.
191 optional int32 bg_critical_job_count = 14;
192 // The maximum number of times we allow a job to have itself rescheduled
193 // before giving up on it, for standard jobs.
194 optional int32 max_standard_reschedule_count = 15;
195 // The maximum number of times we allow a job to have itself rescheduled
196 // before giving up on it, for jobs that are executing work.
197 optional int32 max_work_reschedule_count = 16;
198 // The minimum backoff time to allow for linear backoff.
199 optional int64 min_linear_backoff_time_ms = 17;
200 // The minimum backoff time to allow for exponential backoff.
201 optional int64 min_exp_backoff_time_ms = 18;
202 // How often we recalculate runnability based on apps' standby bucket
203 // assignment. This should be prime relative to common time interval lengths
204 // such as a quarter-hour or day, so that the heartbeat drifts relative to
205 // wall-clock milestones.
206 optional int64 standby_heartbeat_time_ms = 19;
207 // Mapping: standby bucket -> number of heartbeats between each sweep of
208 // that bucket's jobs.
209 // Bucket assignments as recorded in the JobStatus objects are normalized to
210 // be indices into this array, rather than the raw constants used by
211 // AppIdleHistory.
212 repeated int32 standby_beats = 20;
Jeff Sharkeyac2e8ef2018-02-22 16:06:44 -0700213 // The fraction of a job's running window that must pass before we
214 // consider running it when the network is congested.
215 optional double conn_congestion_delay_frac = 21;
216 // The fraction of a prefetch job's running window that must pass before
217 // we consider matching it against a metered network.
218 optional double conn_prefetch_relax_frac = 22;
Kweku Adams4836f9d2018-11-12 17:04:17 -0800219 // Whether to use heartbeats or rolling window for quota management. True
220 // will use heartbeats, false will use a rolling window.
221 optional bool use_heartbeats = 23;
222
223 message QuotaController {
224 // How much time each app will have to run jobs within their standby bucket window.
225 optional int64 allowed_time_per_period_ms = 1;
226 // How much time the package should have before transitioning from out-of-quota to in-quota.
227 // This should not affect processing if the package is already in-quota.
228 optional int64 in_quota_buffer_ms = 2;
229 // The quota window size of the particular standby bucket. Apps in this standby bucket are
230 // expected to run only {@link QUOTA_CONTROLLER_ALLOWED_TIME_PER_PERIOD_MS} within the past
231 // WINDOW_SIZE_MS.
232 optional int64 active_window_size_ms = 3;
233 // The quota window size of the particular standby bucket. Apps in this standby bucket are
234 // expected to run only {@link QUOTA_CONTROLLER_ALLOWED_TIME_PER_PERIOD_MS} within the past
235 // WINDOW_SIZE_MS.
236 optional int64 working_window_size_ms = 4;
237 // The quota window size of the particular standby bucket. Apps in this standby bucket are
238 // expected to run only {@link QUOTA_CONTROLLER_ALLOWED_TIME_PER_PERIOD_MS} within the past
239 // WINDOW_SIZE_MS.
240 optional int64 frequent_window_size_ms = 5;
241 // The quota window size of the particular standby bucket. Apps in this standby bucket are
242 // expected to run only {@link QUOTA_CONTROLLER_ALLOWED_TIME_PER_PERIOD_MS} within the past
243 // WINDOW_SIZE_MS.
244 optional int64 rare_window_size_ms = 6;
Kweku Adams045fb5722018-12-11 14:29:10 -0800245 // The maximum amount of time an app can have its jobs running within a 24 hour window.
246 optional int64 max_execution_time_ms = 7;
Kweku Adams4836f9d2018-11-12 17:04:17 -0800247 }
248 optional QuotaController quota_controller = 24;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800249}
250
251message StateControllerProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800252 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
253
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800254 message BackgroundJobsController {
Kweku Adams0f168de2018-01-24 10:51:30 -0800255 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
256
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800257 optional com.android.server.ForceAppStandbyTrackerProto force_app_standby_tracker = 1;
258
259 message TrackedJob {
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 JobStatusShortInfoProto info = 1;
263 optional int32 source_uid = 2;
264 optional string source_package_name = 3;
265 optional bool is_in_foreground = 4;
266 optional bool is_whitelisted = 5;
267 optional bool can_run_any_in_background = 6;
268 // If the constraints are satisfied, then the controller will mark
269 // the job as RUNNABLE, otherwise, it will be WAITING.
270 optional bool are_constraints_satisfied = 7;
271 }
272 repeated TrackedJob tracked_jobs = 2;
273 }
274 message BatteryController {
Kweku Adams0f168de2018-01-24 10:51:30 -0800275 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
276
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800277 optional bool is_on_stable_power = 1;
278 optional bool is_battery_not_low = 2;
279
280 // Whether or not the controller is monitoring battery changes.
281 optional bool is_monitoring = 3;
282 // Only valid if is_monitoring is true.
283 optional int32 last_broadcast_sequence_number = 4;
284
285 message TrackedJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800286 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
287
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800288 optional JobStatusShortInfoProto info = 1;
289 optional int32 source_uid = 2;
290 }
291 repeated TrackedJob tracked_jobs = 5;
292 }
293 message ConnectivityController {
Kweku Adams0f168de2018-01-24 10:51:30 -0800294 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
295
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800296 optional bool is_connected = 1;
297
298 message TrackedJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800299 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
300
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800301 optional JobStatusShortInfoProto info = 1;
302 optional int32 source_uid = 2;
303 optional .android.net.NetworkRequestProto required_network = 3;
304 }
305 repeated TrackedJob tracked_jobs = 2;
306 }
307 message ContentObserverController {
Kweku Adams0f168de2018-01-24 10:51:30 -0800308 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
309
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800310 message TrackedJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800311 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
312
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800313 optional JobStatusShortInfoProto info = 1;
314 optional int32 source_uid = 2;
315 }
316 repeated TrackedJob tracked_jobs = 1;
317
318 message Observer {
Kweku Adams0f168de2018-01-24 10:51:30 -0800319 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
320
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800321 optional int32 user_id = 1;
322
323 message TriggerContentData {
Kweku Adams0f168de2018-01-24 10:51:30 -0800324 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
325
326 optional string uri = 1 [
327 (.android.privacy).dest = DEST_EXPLICIT
328 ];
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800329 optional int32 flags = 2;
330
331 // A
332 // com.android.server.job.controllers.ContentObserverController.JobInstance
333 // object.
334 message JobInstance {
Kweku Adams0f168de2018-01-24 10:51:30 -0800335 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
336
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800337 optional JobStatusShortInfoProto info = 1;
338 optional int32 source_uid = 2;
339
340 optional int64 trigger_content_update_delay_ms = 3;
341 optional int64 trigger_content_max_delay_ms = 4;
342
Kweku Adams0f168de2018-01-24 10:51:30 -0800343 repeated string changed_authorities = 5 [
344 (.android.privacy).dest = DEST_EXPLICIT
345 ];
346 repeated string changed_uris = 6 [
347 (.android.privacy).dest = DEST_EXPLICIT
348 ];
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800349 }
350 repeated JobInstance jobs = 3;
351 }
352 repeated TriggerContentData triggers = 2;
353 }
354 repeated Observer observers = 2;
355 }
356 message DeviceIdleJobsController {
Kweku Adams0f168de2018-01-24 10:51:30 -0800357 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
358
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800359 // True when in device idle mode.
360 optional bool is_device_idle_mode = 1;
361
362 message TrackedJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800363 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
364
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800365 optional JobStatusShortInfoProto info = 1;
366 optional int32 source_uid = 2;
367 optional string source_package_name = 3;
368 // If the constraints are satisfied, then the controller will mark
369 // the job as RUNNABLE, otherwise, it will be WAITING.
370 optional bool are_constraints_satisfied = 4;
371 optional bool is_doze_whitelisted = 5;
372 // A job that is exempted from Doze when the app is temp whitelisted
373 // or in the foreground.
374 optional bool is_allowed_in_doze = 6;
375 }
376 repeated TrackedJob tracked_jobs = 2;
377 }
378 message IdleController {
Kweku Adams0f168de2018-01-24 10:51:30 -0800379 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
380
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800381 optional bool is_idle = 1;
382
383 message TrackedJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800384 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
385
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800386 optional JobStatusShortInfoProto info = 1;
387 optional int32 source_uid = 2;
388 }
389 repeated TrackedJob tracked_jobs = 2;
390 }
Kweku Adams4836f9d2018-11-12 17:04:17 -0800391 message QuotaController {
392 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
393
394 optional bool is_charging = 1;
395 optional bool is_in_parole = 2;
396
397 message TrackedJob {
398 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
399
400 optional JobStatusShortInfoProto info = 1;
401 optional int32 source_uid = 2;
402 optional JobStatusDumpProto.Bucket effective_standby_bucket = 3;
403 optional bool has_quota = 4;
404 // The amount of time that this job has remaining in its quota. This
405 // can be negative if the job is out of quota.
406 optional int64 remaining_quota_ms = 5;
407 }
408 repeated TrackedJob tracked_jobs = 3;
409
410 message Package {
411 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
412
413 optional int32 user_id = 1;
414 optional string name = 2;
415 }
416
417 message TimingSession {
418 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
419
420 optional int64 start_time_elapsed = 1;
421 optional int64 end_time_elapsed = 2;
Kweku Adamscc5afbc2018-12-11 15:24:25 -0800422 // The number of background jobs that ran during this session.
423 optional int32 bg_job_count = 3;
Kweku Adams4836f9d2018-11-12 17:04:17 -0800424 }
425
426 message Timer {
427 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
428
429 optional Package pkg = 1;
430 // True if the Timer is actively tracking jobs.
431 optional bool is_active = 2;
432 // The time this timer last became active. Only valid if is_active is true.
433 optional int64 start_time_elapsed = 3;
Kweku Adamscc5afbc2018-12-11 15:24:25 -0800434 // How many background jobs are currently running. Valid only if the device is_active
435 // is true.
436 optional int32 bg_job_count = 4;
Kweku Adams4836f9d2018-11-12 17:04:17 -0800437 // All of the jobs that the Timer is currently tracking.
438 repeated JobStatusShortInfoProto running_jobs = 5;
439 }
440
441 message PackageStats {
442 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
443
444 optional Package pkg = 1;
445
446 optional Timer timer = 2;
447
448 repeated TimingSession saved_sessions = 3;
449 }
450 repeated PackageStats package_stats = 4;
451 }
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800452 message StorageController {
Kweku Adams0f168de2018-01-24 10:51:30 -0800453 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
454
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800455 optional bool is_storage_not_low = 1;
456 optional int32 last_broadcast_sequence_number = 2;
457
458 message TrackedJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800459 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
460
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800461 optional JobStatusShortInfoProto info = 1;
462 optional int32 source_uid = 2;
463 }
464 repeated TrackedJob tracked_jobs = 3;
465 }
466 message TimeController {
Kweku Adams0f168de2018-01-24 10:51:30 -0800467 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
468
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800469 optional int64 now_elapsed_realtime = 1;
470 optional int64 time_until_next_delay_alarm_ms = 2;
471 optional int64 time_until_next_deadline_alarm_ms = 3;
472
473 message TrackedJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800474 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
475
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800476 optional JobStatusShortInfoProto info = 1;
477 optional int32 source_uid = 2;
478
479 optional bool has_timing_delay_constraint = 3;
480 // Only valid if has_timing_delay_constraint is true. Can be
481 // negative if the delay is in the past.
482 optional int64 delay_time_remaining_ms = 4;
483
484 optional bool has_deadline_constraint = 5;
485 // Only valid if has_timing_delay_constraint is true. Can be
486 // negative in certain situations.
487 optional int64 time_remaining_until_deadline_ms = 6;
488 }
489 repeated TrackedJob tracked_jobs = 4;
490 }
491 oneof controller {
Kweku Adams21b8d262018-03-30 12:19:58 -0700492 BackgroundJobsController background = 1;
493 BatteryController battery = 2;
494 ConnectivityController connectivity = 3;
495 ContentObserverController content_observer = 4;
496 DeviceIdleJobsController device_idle = 5;
497 IdleController idle = 6;
Kweku Adams4836f9d2018-11-12 17:04:17 -0800498 QuotaController quota = 9;
Kweku Adams21b8d262018-03-30 12:19:58 -0700499 StorageController storage = 7;
500 TimeController time = 8;
Kweku Adams4836f9d2018-11-12 17:04:17 -0800501 // Next tag: 10
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800502 }
503}
504
505// A com.android.server.job.JobPackageTracker.DataSet object.
506message DataSetProto {
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 int64 start_clock_time_ms = 1;
510 // How much time has elapsed since the DataSet was instantiated.
511 optional int64 elapsed_time_ms = 2;
512 optional int64 period_ms = 3;
513
514 // Represents a com.android.server.job.JobPackageTracker.PackageEntry
515 // object, but with some extra data.
516 message PackageEntryProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800517 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
518
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800519 optional int32 uid = 1;
520 optional string package_name = 2;
521
522 message State {
Kweku Adams0f168de2018-01-24 10:51:30 -0800523 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
524
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800525 optional int64 duration_ms = 1;
526 optional int32 count = 2;
527 }
528 optional State pending_state = 3;
529 optional State active_state = 4;
530 optional State active_top_state = 5;
531
532 // True if the PackageEntry is currently pending or has been pending in
533 // the past.
534 optional bool pending = 6;
535 // True if the PackageEntry is currently active or has been active in
536 // the past.
537 optional bool active = 7;
538 // True if the PackageEntry is currently active top or has been active
539 // top in the past.
540 optional bool active_top = 8;
541
542 message StopReasonCount {
Kweku Adams0f168de2018-01-24 10:51:30 -0800543 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
544
Tej Singh33a412b2018-03-16 18:43:59 -0700545 optional .android.app.job.StopReasonEnum reason = 1;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800546 optional int32 count = 2;
547 }
548 repeated StopReasonCount stop_reasons = 9;
549 }
550 repeated PackageEntryProto package_entries = 4;
551
552 optional int32 max_concurrency = 5;
553 optional int32 max_foreground_concurrency = 6;
554}
555
556// Dump from com.android.server.job.GrantedUriPermissions.
557message GrantedUriPermissionsDumpProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800558 option (.android.msg_privacy).dest = DEST_EXPLICIT;
559
560 optional int32 flags = 1 [ (.android.privacy).dest = DEST_AUTOMATIC ];
561 optional int32 source_user_id = 2 [
562 (.android.privacy).dest = DEST_AUTOMATIC
563 ];
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800564 optional string tag = 3;
565 optional string permission_owner = 4;
566 repeated string uris = 5;
567}
568
569message JobPackageTrackerDumpProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800570 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
571
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800572 repeated DataSetProto historical_stats = 1;
573 optional DataSetProto current_stats = 2;
574}
575
576message JobPackageHistoryProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800577 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
578
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800579 enum Event {
580 UNKNOWN = 0;
581 START_JOB = 1;
582 STOP_JOB = 2;
583 START_PERIODIC_JOB = 3;
584 STOP_PERIODIC_JOB = 4;
585 }
586 message HistoryEvent {
Kweku Adams0f168de2018-01-24 10:51:30 -0800587 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
588
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800589 optional Event event = 1;
590 optional int64 time_since_event_ms = 2;
591 optional int32 uid = 3;
592 // Job IDs can technically be negative.
593 optional int32 job_id = 4;
Yi Jin2921dd02018-03-23 14:10:31 -0700594 optional string tag = 5;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800595 // Only valid for STOP_JOB or STOP_PERIODIC_JOB Events.
Tej Singh33a412b2018-03-16 18:43:59 -0700596 optional .android.app.job.StopReasonEnum stop_reason = 6;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800597 }
598 repeated HistoryEvent history_event = 1;
599}
600
601message JobStatusShortInfoProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800602 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
603
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800604 optional int32 calling_uid = 1;
605 // Job IDs can technically be negative.
606 optional int32 job_id = 2;
Yi Jine5e2a752018-03-28 18:31:07 -0700607 optional string battery_name = 3;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800608}
609
610// Dump from a com.android.server.job.controllers.JobStatus object.
611message JobStatusDumpProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800612 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
613
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800614 // The UID that scheduled the job.
615 optional int32 calling_uid = 1;
Yi Jin2921dd02018-03-23 14:10:31 -0700616 optional string tag = 2;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800617
618 // The UID for which the job is being run.
619 optional int32 source_uid = 3;
620 optional int32 source_user_id = 4;
621 // The package for which the job is being run.
622 optional string source_package_name = 5;
623
624 // Custom dump of android.app.job.JobInfo object.
625 message JobInfo {
Kweku Adams0f168de2018-01-24 10:51:30 -0800626 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
627
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800628 optional .android.content.ComponentNameProto service = 1;
629
630 optional bool is_periodic = 2;
631 // Only valid if is_periodic is true.
632 optional int64 period_interval_ms = 3;
633 // Only valid if is_periodic is true.
634 optional int64 period_flex_ms = 4;
635
636 optional bool is_persisted = 5;
637 optional sint32 priority = 6;
638 optional int32 flags = 7;
639
640 optional bool requires_charging = 8;
641 optional bool requires_battery_not_low = 9;
642 optional bool requires_device_idle = 10;
643
644 message TriggerContentUri {
Kweku Adams0f168de2018-01-24 10:51:30 -0800645 optional int32 flags = 1 [
646 (.android.privacy).dest = DEST_AUTOMATIC
647 ];
648 optional string uri = 2 [ (.android.privacy).dest = DEST_EXPLICIT ];
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800649 }
650 repeated TriggerContentUri trigger_content_uris = 11;
651 optional int64 trigger_content_update_delay_ms = 12;
652 optional int64 trigger_content_max_delay_ms = 13;
653
654 optional .android.os.PersistableBundleProto extras = 14;
655 optional .android.os.BundleProto transient_extras = 15;
Kweku Adamscb89f622018-03-22 13:55:46 -0700656 // ClipData of information that is returned to the application at
657 // execution time, but not persisted by the system. This is provided by
658 // the app and the main purpose of providing a ClipData is to allow
659 // granting of URI permissions for data associated with the clip. The
660 // exact kind of permission grant to perform is specified in the flags
661 // field.
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800662 optional .android.content.ClipDataProto clip_data = 16;
663
664 optional GrantedUriPermissionsDumpProto granted_uri_permissions = 17;
665
666 optional .android.net.NetworkRequestProto required_network = 18;
667
668 optional int64 total_network_bytes = 19;
669
670 optional int64 min_latency_ms = 20;
671 optional int64 max_execution_delay_ms = 21;
672
673 message Backoff {
Kweku Adams0f168de2018-01-24 10:51:30 -0800674 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
675
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800676 enum Policy {
677 BACKOFF_POLICY_LINEAR = 0;
678 BACKOFF_POLICY_EXPONENTIAL = 1;
679 }
680 optional Policy policy = 1;
681 optional int64 initial_backoff_ms = 2;
682 }
683 optional Backoff backoff_policy = 22;
684
685 optional bool has_early_constraint = 23;
686 optional bool has_late_constraint = 24;
687 }
688 optional JobInfo job_info = 6;
689
690 enum Constraint {
691 CONSTRAINT_CHARGING = 1;
692 CONSTRAINT_BATTERY_NOT_LOW = 2;
693 CONSTRAINT_STORAGE_NOT_LOW = 3;
694 CONSTRAINT_TIMING_DELAY = 4;
695 CONSTRAINT_DEADLINE = 5;
696 CONSTRAINT_IDLE = 6;
697 CONSTRAINT_CONNECTIVITY = 7;
Kweku Adams21b8d262018-03-30 12:19:58 -0700698 CONSTRAINT_CONTENT_TRIGGER = 8;
699 CONSTRAINT_DEVICE_NOT_DOZING = 9;
Kweku Adams4836f9d2018-11-12 17:04:17 -0800700 CONSTRAINT_WITHIN_QUOTA = 10;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800701 }
702 repeated Constraint required_constraints = 7;
703 repeated Constraint satisfied_constraints = 8;
704 repeated Constraint unsatisfied_constraints = 9;
705 optional bool is_doze_whitelisted = 10;
Kweku Adams4836f9d2018-11-12 17:04:17 -0800706 optional bool is_uid_active = 26;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800707
Kweku Adams32f44762018-11-02 16:58:32 -0700708 message ImplicitConstraints {
709 // The device isn't Dozing or this job will be in the foreground. This
710 // implicit constraint must be satisfied for the job to run.
711 optional bool is_not_dozing = 1;
712 // The job is not restricted from running in the background (due to
713 // Battery Saver). This implicit constraint must be satisfied for the
714 // job to run.
715 optional bool is_not_restricted_in_bg = 2;
716 }
717 optional ImplicitConstraints implicit_constraints = 25;
718
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800719 enum TrackingController {
720 TRACKING_BATTERY = 0;
721 TRACKING_CONNECTIVITY = 1;
722 TRACKING_CONTENT = 2;
723 TRACKING_IDLE = 3;
724 TRACKING_STORAGE = 4;
725 TRACKING_TIME = 5;
Kweku Adams4836f9d2018-11-12 17:04:17 -0800726 TRACKING_QUOTA = 6;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800727 }
728 // Controllers that are currently tracking the job.
729 repeated TrackingController tracking_controllers = 11;
730
Kweku Adams0f168de2018-01-24 10:51:30 -0800731 repeated string changed_authorities = 12 [
732 (.android.privacy).dest = DEST_EXPLICIT
733 ];
734 repeated string changed_uris = 13 [
735 (.android.privacy).dest = DEST_EXPLICIT
736 ];
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800737
738 optional .android.net.NetworkProto network = 14;
739
740 // Only the desired data from an android.app.job.JobWorkItem object.
741 message JobWorkItem {
Kweku Adams0f168de2018-01-24 10:51:30 -0800742 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
743
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800744 optional int32 work_id = 1;
745 optional int32 delivery_count = 2;
746 optional .android.content.IntentProto intent = 3;
747 optional GrantedUriPermissionsDumpProto uri_grants = 4;
748 }
749 repeated JobWorkItem pending_work = 15;
750 repeated JobWorkItem executing_work = 16;
751
752 enum Bucket {
753 ACTIVE = 0;
754 WORKING_SET = 1;
755 FREQUENT = 2;
756 RARE = 3;
757 NEVER = 4;
758 }
759 optional Bucket standby_bucket = 17;
Kweku Adams4836f9d2018-11-12 17:04:17 -0800760 optional bool is_exempted_from_app_standby = 27;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800761
762 optional int64 enqueue_duration_ms = 18;
763 // Can be negative if the earliest runtime deadline has passed.
764 optional sint64 time_until_earliest_runtime_ms = 19;
765 // Can be negative if the latest runtime deadline has passed.
766 optional sint64 time_until_latest_runtime_ms = 20;
767
768 optional int32 num_failures = 21;
769
770 optional int64 last_successful_run_time = 22;
771 optional int64 last_failed_run_time = 23;
Makoto Onuki15407842018-01-19 14:23:11 -0800772
773 optional int64 internal_flags = 24;
Kweku Adams32f44762018-11-02 16:58:32 -0700774
Kweku Adams4836f9d2018-11-12 17:04:17 -0800775 // Next tag: 28
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800776}