blob: e68f9dbbc9b73d39af73a8b28c38fcf79b5efe92 [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
Kweku Adamsbffea5a2018-12-13 22:13:28 -0800223 message TimeController {
Kweku Adams288e73b2019-01-17 13:53:24 -0800224 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
225
Kweku Adamsbffea5a2018-12-13 22:13:28 -0800226 // Whether or not TimeController should skip setting wakeup alarms for jobs that aren't
227 // ready now.
228 optional bool skip_not_ready_jobs = 1;
229 }
230 optional TimeController time_controller = 25;
231
Kweku Adams4836f9d2018-11-12 17:04:17 -0800232 message QuotaController {
Kweku Adams288e73b2019-01-17 13:53:24 -0800233 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
234
Kweku Adams4836f9d2018-11-12 17:04:17 -0800235 // How much time each app will have to run jobs within their standby bucket window.
236 optional int64 allowed_time_per_period_ms = 1;
237 // How much time the package should have before transitioning from out-of-quota to in-quota.
238 // This should not affect processing if the package is already in-quota.
239 optional int64 in_quota_buffer_ms = 2;
240 // The quota window size of the particular standby bucket. Apps in this standby bucket are
241 // expected to run only {@link QUOTA_CONTROLLER_ALLOWED_TIME_PER_PERIOD_MS} within the past
242 // WINDOW_SIZE_MS.
243 optional int64 active_window_size_ms = 3;
244 // The quota window size of the particular standby bucket. Apps in this standby bucket are
245 // expected to run only {@link QUOTA_CONTROLLER_ALLOWED_TIME_PER_PERIOD_MS} within the past
246 // WINDOW_SIZE_MS.
247 optional int64 working_window_size_ms = 4;
248 // The quota window size of the particular standby bucket. Apps in this standby bucket are
249 // expected to run only {@link QUOTA_CONTROLLER_ALLOWED_TIME_PER_PERIOD_MS} within the past
250 // WINDOW_SIZE_MS.
251 optional int64 frequent_window_size_ms = 5;
252 // The quota window size of the particular standby bucket. Apps in this standby bucket are
253 // expected to run only {@link QUOTA_CONTROLLER_ALLOWED_TIME_PER_PERIOD_MS} within the past
254 // WINDOW_SIZE_MS.
255 optional int64 rare_window_size_ms = 6;
Kweku Adams045fb5722018-12-11 14:29:10 -0800256 // The maximum amount of time an app can have its jobs running within a 24 hour window.
257 optional int64 max_execution_time_ms = 7;
Kweku Adams288e73b2019-01-17 13:53:24 -0800258 // The maximum number of jobs an app can run within this particular standby bucket's
259 // window size.
260 optional int32 max_job_count_active = 8;
261 // The maximum number of jobs an app can run within this particular standby bucket's
262 // window size.
263 optional int32 max_job_count_working = 9;
264 // The maximum number of jobs an app can run within this particular standby bucket's
265 // window size.
266 optional int32 max_job_count_frequent = 10;
267 // The maximum number of jobs an app can run within this particular standby bucket's
268 // window size.
269 optional int32 max_job_count_rare = 11;
270 // The maximum number of jobs that should be allowed to run in the past
271 // {@link QUOTA_CONTROLLER_ALLOWED_TIME_PER_PERIOD_MS}.
272 optional int32 max_job_count_per_allowed_time = 12;
Kweku Adams4836f9d2018-11-12 17:04:17 -0800273 }
274 optional QuotaController quota_controller = 24;
Kweku Adamsbffea5a2018-12-13 22:13:28 -0800275
276 // Next tag: 26
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800277}
278
279message StateControllerProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800280 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
281
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800282 message BackgroundJobsController {
Kweku Adams0f168de2018-01-24 10:51:30 -0800283 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
284
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800285 optional com.android.server.ForceAppStandbyTrackerProto force_app_standby_tracker = 1;
286
287 message TrackedJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800288 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
289
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800290 optional JobStatusShortInfoProto info = 1;
291 optional int32 source_uid = 2;
292 optional string source_package_name = 3;
293 optional bool is_in_foreground = 4;
294 optional bool is_whitelisted = 5;
295 optional bool can_run_any_in_background = 6;
296 // If the constraints are satisfied, then the controller will mark
297 // the job as RUNNABLE, otherwise, it will be WAITING.
298 optional bool are_constraints_satisfied = 7;
299 }
300 repeated TrackedJob tracked_jobs = 2;
301 }
302 message BatteryController {
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 bool is_on_stable_power = 1;
306 optional bool is_battery_not_low = 2;
307
308 // Whether or not the controller is monitoring battery changes.
309 optional bool is_monitoring = 3;
310 // Only valid if is_monitoring is true.
311 optional int32 last_broadcast_sequence_number = 4;
312
313 message TrackedJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800314 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
315
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800316 optional JobStatusShortInfoProto info = 1;
317 optional int32 source_uid = 2;
318 }
319 repeated TrackedJob tracked_jobs = 5;
320 }
321 message ConnectivityController {
Kweku Adams0f168de2018-01-24 10:51:30 -0800322 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
323
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800324 optional bool is_connected = 1;
325
326 message TrackedJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800327 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
328
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800329 optional JobStatusShortInfoProto info = 1;
330 optional int32 source_uid = 2;
331 optional .android.net.NetworkRequestProto required_network = 3;
332 }
333 repeated TrackedJob tracked_jobs = 2;
334 }
335 message ContentObserverController {
Kweku Adams0f168de2018-01-24 10:51:30 -0800336 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
337
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800338 message TrackedJob {
Kweku Adams0f168de2018-01-24 10:51:30 -0800339 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
340
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800341 optional JobStatusShortInfoProto info = 1;
342 optional int32 source_uid = 2;
343 }
344 repeated TrackedJob tracked_jobs = 1;
345
346 message Observer {
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 int32 user_id = 1;
350
351 message TriggerContentData {
Kweku Adams0f168de2018-01-24 10:51:30 -0800352 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
353
354 optional string uri = 1 [
355 (.android.privacy).dest = DEST_EXPLICIT
356 ];
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800357 optional int32 flags = 2;
358
359 // A
360 // com.android.server.job.controllers.ContentObserverController.JobInstance
361 // object.
362 message JobInstance {
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
368 optional int64 trigger_content_update_delay_ms = 3;
369 optional int64 trigger_content_max_delay_ms = 4;
370
Kweku Adams0f168de2018-01-24 10:51:30 -0800371 repeated string changed_authorities = 5 [
372 (.android.privacy).dest = DEST_EXPLICIT
373 ];
374 repeated string changed_uris = 6 [
375 (.android.privacy).dest = DEST_EXPLICIT
376 ];
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800377 }
378 repeated JobInstance jobs = 3;
379 }
380 repeated TriggerContentData triggers = 2;
381 }
382 repeated Observer observers = 2;
383 }
384 message DeviceIdleJobsController {
Kweku Adams0f168de2018-01-24 10:51:30 -0800385 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
386
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800387 // True when in device idle mode.
388 optional bool is_device_idle_mode = 1;
389
390 message TrackedJob {
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 JobStatusShortInfoProto info = 1;
394 optional int32 source_uid = 2;
395 optional string source_package_name = 3;
396 // If the constraints are satisfied, then the controller will mark
397 // the job as RUNNABLE, otherwise, it will be WAITING.
398 optional bool are_constraints_satisfied = 4;
399 optional bool is_doze_whitelisted = 5;
400 // A job that is exempted from Doze when the app is temp whitelisted
401 // or in the foreground.
402 optional bool is_allowed_in_doze = 6;
403 }
404 repeated TrackedJob tracked_jobs = 2;
405 }
406 message IdleController {
Kweku Adams0f168de2018-01-24 10:51:30 -0800407 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
408
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800409 optional bool is_idle = 1;
410
411 message TrackedJob {
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 JobStatusShortInfoProto info = 1;
415 optional int32 source_uid = 2;
416 }
417 repeated TrackedJob tracked_jobs = 2;
418 }
Kweku Adams4836f9d2018-11-12 17:04:17 -0800419 message QuotaController {
420 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
421
422 optional bool is_charging = 1;
423 optional bool is_in_parole = 2;
424
Kweku Adamsd6625ff2019-01-10 12:06:21 -0800425 // List of UIDs currently in the foreground.
426 repeated int32 foreground_uids = 3;
427
Kweku Adams4836f9d2018-11-12 17:04:17 -0800428 message TrackedJob {
429 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
430
431 optional JobStatusShortInfoProto info = 1;
432 optional int32 source_uid = 2;
433 optional JobStatusDumpProto.Bucket effective_standby_bucket = 3;
Kweku Adamsd6625ff2019-01-10 12:06:21 -0800434 // If the job started while the app was in the TOP state.
435 optional bool is_top_started_job = 4;
436 optional bool has_quota = 5;
Kweku Adams4836f9d2018-11-12 17:04:17 -0800437 // The amount of time that this job has remaining in its quota. This
438 // can be negative if the job is out of quota.
Kweku Adamsd6625ff2019-01-10 12:06:21 -0800439 optional int64 remaining_quota_ms = 6;
Kweku Adams4836f9d2018-11-12 17:04:17 -0800440 }
Kweku Adamsd6625ff2019-01-10 12:06:21 -0800441 repeated TrackedJob tracked_jobs = 4;
Kweku Adams4836f9d2018-11-12 17:04:17 -0800442
443 message Package {
444 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
445
446 optional int32 user_id = 1;
447 optional string name = 2;
448 }
449
450 message TimingSession {
451 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
452
453 optional int64 start_time_elapsed = 1;
454 optional int64 end_time_elapsed = 2;
Kweku Adamscc5afbc2018-12-11 15:24:25 -0800455 // The number of background jobs that ran during this session.
456 optional int32 bg_job_count = 3;
Kweku Adams4836f9d2018-11-12 17:04:17 -0800457 }
458
459 message Timer {
460 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
461
462 optional Package pkg = 1;
463 // True if the Timer is actively tracking jobs.
464 optional bool is_active = 2;
465 // The time this timer last became active. Only valid if is_active is true.
466 optional int64 start_time_elapsed = 3;
Kweku Adamscc5afbc2018-12-11 15:24:25 -0800467 // How many background jobs are currently running. Valid only if the device is_active
468 // is true.
469 optional int32 bg_job_count = 4;
Kweku Adams4836f9d2018-11-12 17:04:17 -0800470 // All of the jobs that the Timer is currently tracking.
471 repeated JobStatusShortInfoProto running_jobs = 5;
472 }
473
474 message PackageStats {
475 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
476
477 optional Package pkg = 1;
478
479 optional Timer timer = 2;
480
481 repeated TimingSession saved_sessions = 3;
482 }
Kweku Adamsd6625ff2019-01-10 12:06:21 -0800483 repeated PackageStats package_stats = 5;
Kweku Adams4836f9d2018-11-12 17:04:17 -0800484 }
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800485 message StorageController {
Kweku Adams0f168de2018-01-24 10:51:30 -0800486 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
487
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800488 optional bool is_storage_not_low = 1;
489 optional int32 last_broadcast_sequence_number = 2;
490
491 message TrackedJob {
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 JobStatusShortInfoProto info = 1;
495 optional int32 source_uid = 2;
496 }
497 repeated TrackedJob tracked_jobs = 3;
498 }
499 message TimeController {
Kweku Adams0f168de2018-01-24 10:51:30 -0800500 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
501
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800502 optional int64 now_elapsed_realtime = 1;
503 optional int64 time_until_next_delay_alarm_ms = 2;
504 optional int64 time_until_next_deadline_alarm_ms = 3;
505
506 message TrackedJob {
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 JobStatusShortInfoProto info = 1;
510 optional int32 source_uid = 2;
511
512 optional bool has_timing_delay_constraint = 3;
513 // Only valid if has_timing_delay_constraint is true. Can be
514 // negative if the delay is in the past.
515 optional int64 delay_time_remaining_ms = 4;
516
517 optional bool has_deadline_constraint = 5;
518 // Only valid if has_timing_delay_constraint is true. Can be
519 // negative in certain situations.
520 optional int64 time_remaining_until_deadline_ms = 6;
521 }
522 repeated TrackedJob tracked_jobs = 4;
523 }
524 oneof controller {
Kweku Adams21b8d262018-03-30 12:19:58 -0700525 BackgroundJobsController background = 1;
526 BatteryController battery = 2;
527 ConnectivityController connectivity = 3;
528 ContentObserverController content_observer = 4;
529 DeviceIdleJobsController device_idle = 5;
530 IdleController idle = 6;
Kweku Adams4836f9d2018-11-12 17:04:17 -0800531 QuotaController quota = 9;
Kweku Adams21b8d262018-03-30 12:19:58 -0700532 StorageController storage = 7;
533 TimeController time = 8;
Kweku Adams4836f9d2018-11-12 17:04:17 -0800534 // Next tag: 10
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800535 }
536}
537
538// A com.android.server.job.JobPackageTracker.DataSet object.
539message DataSetProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800540 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
541
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800542 optional int64 start_clock_time_ms = 1;
543 // How much time has elapsed since the DataSet was instantiated.
544 optional int64 elapsed_time_ms = 2;
545 optional int64 period_ms = 3;
546
547 // Represents a com.android.server.job.JobPackageTracker.PackageEntry
548 // object, but with some extra data.
549 message PackageEntryProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800550 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
551
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800552 optional int32 uid = 1;
553 optional string package_name = 2;
554
555 message State {
Kweku Adams0f168de2018-01-24 10:51:30 -0800556 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
557
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800558 optional int64 duration_ms = 1;
559 optional int32 count = 2;
560 }
561 optional State pending_state = 3;
562 optional State active_state = 4;
563 optional State active_top_state = 5;
564
565 // True if the PackageEntry is currently pending or has been pending in
566 // the past.
567 optional bool pending = 6;
568 // True if the PackageEntry is currently active or has been active in
569 // the past.
570 optional bool active = 7;
571 // True if the PackageEntry is currently active top or has been active
572 // top in the past.
573 optional bool active_top = 8;
574
575 message StopReasonCount {
Kweku Adams0f168de2018-01-24 10:51:30 -0800576 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
577
Tej Singh33a412b2018-03-16 18:43:59 -0700578 optional .android.app.job.StopReasonEnum reason = 1;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800579 optional int32 count = 2;
580 }
581 repeated StopReasonCount stop_reasons = 9;
582 }
583 repeated PackageEntryProto package_entries = 4;
584
585 optional int32 max_concurrency = 5;
586 optional int32 max_foreground_concurrency = 6;
587}
588
589// Dump from com.android.server.job.GrantedUriPermissions.
590message GrantedUriPermissionsDumpProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800591 option (.android.msg_privacy).dest = DEST_EXPLICIT;
592
593 optional int32 flags = 1 [ (.android.privacy).dest = DEST_AUTOMATIC ];
594 optional int32 source_user_id = 2 [
595 (.android.privacy).dest = DEST_AUTOMATIC
596 ];
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800597 optional string tag = 3;
598 optional string permission_owner = 4;
599 repeated string uris = 5;
600}
601
602message JobPackageTrackerDumpProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800603 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
604
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800605 repeated DataSetProto historical_stats = 1;
606 optional DataSetProto current_stats = 2;
607}
608
609message JobPackageHistoryProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800610 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
611
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800612 enum Event {
613 UNKNOWN = 0;
614 START_JOB = 1;
615 STOP_JOB = 2;
616 START_PERIODIC_JOB = 3;
617 STOP_PERIODIC_JOB = 4;
618 }
619 message HistoryEvent {
Kweku Adams0f168de2018-01-24 10:51:30 -0800620 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
621
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800622 optional Event event = 1;
623 optional int64 time_since_event_ms = 2;
624 optional int32 uid = 3;
625 // Job IDs can technically be negative.
626 optional int32 job_id = 4;
Yi Jin2921dd02018-03-23 14:10:31 -0700627 optional string tag = 5;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800628 // Only valid for STOP_JOB or STOP_PERIODIC_JOB Events.
Tej Singh33a412b2018-03-16 18:43:59 -0700629 optional .android.app.job.StopReasonEnum stop_reason = 6;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800630 }
631 repeated HistoryEvent history_event = 1;
632}
633
634message JobStatusShortInfoProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800635 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
636
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800637 optional int32 calling_uid = 1;
638 // Job IDs can technically be negative.
639 optional int32 job_id = 2;
Yi Jine5e2a752018-03-28 18:31:07 -0700640 optional string battery_name = 3;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800641}
642
643// Dump from a com.android.server.job.controllers.JobStatus object.
644message JobStatusDumpProto {
Kweku Adams0f168de2018-01-24 10:51:30 -0800645 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
646
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800647 // The UID that scheduled the job.
648 optional int32 calling_uid = 1;
Yi Jin2921dd02018-03-23 14:10:31 -0700649 optional string tag = 2;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800650
651 // The UID for which the job is being run.
652 optional int32 source_uid = 3;
653 optional int32 source_user_id = 4;
654 // The package for which the job is being run.
655 optional string source_package_name = 5;
656
657 // Custom dump of android.app.job.JobInfo object.
658 message JobInfo {
Kweku Adams0f168de2018-01-24 10:51:30 -0800659 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
660
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800661 optional .android.content.ComponentNameProto service = 1;
662
663 optional bool is_periodic = 2;
664 // Only valid if is_periodic is true.
665 optional int64 period_interval_ms = 3;
666 // Only valid if is_periodic is true.
667 optional int64 period_flex_ms = 4;
668
669 optional bool is_persisted = 5;
670 optional sint32 priority = 6;
671 optional int32 flags = 7;
672
673 optional bool requires_charging = 8;
674 optional bool requires_battery_not_low = 9;
675 optional bool requires_device_idle = 10;
676
677 message TriggerContentUri {
Kweku Adams0f168de2018-01-24 10:51:30 -0800678 optional int32 flags = 1 [
679 (.android.privacy).dest = DEST_AUTOMATIC
680 ];
681 optional string uri = 2 [ (.android.privacy).dest = DEST_EXPLICIT ];
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800682 }
683 repeated TriggerContentUri trigger_content_uris = 11;
684 optional int64 trigger_content_update_delay_ms = 12;
685 optional int64 trigger_content_max_delay_ms = 13;
686
687 optional .android.os.PersistableBundleProto extras = 14;
688 optional .android.os.BundleProto transient_extras = 15;
Kweku Adamscb89f622018-03-22 13:55:46 -0700689 // ClipData of information that is returned to the application at
690 // execution time, but not persisted by the system. This is provided by
691 // the app and the main purpose of providing a ClipData is to allow
692 // granting of URI permissions for data associated with the clip. The
693 // exact kind of permission grant to perform is specified in the flags
694 // field.
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800695 optional .android.content.ClipDataProto clip_data = 16;
696
697 optional GrantedUriPermissionsDumpProto granted_uri_permissions = 17;
698
699 optional .android.net.NetworkRequestProto required_network = 18;
700
701 optional int64 total_network_bytes = 19;
702
703 optional int64 min_latency_ms = 20;
704 optional int64 max_execution_delay_ms = 21;
705
706 message Backoff {
Kweku Adams0f168de2018-01-24 10:51:30 -0800707 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
708
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800709 enum Policy {
710 BACKOFF_POLICY_LINEAR = 0;
711 BACKOFF_POLICY_EXPONENTIAL = 1;
712 }
713 optional Policy policy = 1;
714 optional int64 initial_backoff_ms = 2;
715 }
716 optional Backoff backoff_policy = 22;
717
718 optional bool has_early_constraint = 23;
719 optional bool has_late_constraint = 24;
720 }
721 optional JobInfo job_info = 6;
722
723 enum Constraint {
724 CONSTRAINT_CHARGING = 1;
725 CONSTRAINT_BATTERY_NOT_LOW = 2;
726 CONSTRAINT_STORAGE_NOT_LOW = 3;
727 CONSTRAINT_TIMING_DELAY = 4;
728 CONSTRAINT_DEADLINE = 5;
729 CONSTRAINT_IDLE = 6;
730 CONSTRAINT_CONNECTIVITY = 7;
Kweku Adams21b8d262018-03-30 12:19:58 -0700731 CONSTRAINT_CONTENT_TRIGGER = 8;
732 CONSTRAINT_DEVICE_NOT_DOZING = 9;
Kweku Adams4836f9d2018-11-12 17:04:17 -0800733 CONSTRAINT_WITHIN_QUOTA = 10;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800734 }
735 repeated Constraint required_constraints = 7;
736 repeated Constraint satisfied_constraints = 8;
737 repeated Constraint unsatisfied_constraints = 9;
738 optional bool is_doze_whitelisted = 10;
Kweku Adams4836f9d2018-11-12 17:04:17 -0800739 optional bool is_uid_active = 26;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800740
Kweku Adams32f44762018-11-02 16:58:32 -0700741 message ImplicitConstraints {
742 // The device isn't Dozing or this job will be in the foreground. This
743 // implicit constraint must be satisfied for the job to run.
744 optional bool is_not_dozing = 1;
745 // The job is not restricted from running in the background (due to
746 // Battery Saver). This implicit constraint must be satisfied for the
747 // job to run.
748 optional bool is_not_restricted_in_bg = 2;
749 }
750 optional ImplicitConstraints implicit_constraints = 25;
751
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800752 enum TrackingController {
753 TRACKING_BATTERY = 0;
754 TRACKING_CONNECTIVITY = 1;
755 TRACKING_CONTENT = 2;
756 TRACKING_IDLE = 3;
757 TRACKING_STORAGE = 4;
758 TRACKING_TIME = 5;
Kweku Adams4836f9d2018-11-12 17:04:17 -0800759 TRACKING_QUOTA = 6;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800760 }
761 // Controllers that are currently tracking the job.
762 repeated TrackingController tracking_controllers = 11;
763
Kweku Adams0f168de2018-01-24 10:51:30 -0800764 repeated string changed_authorities = 12 [
765 (.android.privacy).dest = DEST_EXPLICIT
766 ];
767 repeated string changed_uris = 13 [
768 (.android.privacy).dest = DEST_EXPLICIT
769 ];
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800770
771 optional .android.net.NetworkProto network = 14;
772
773 // Only the desired data from an android.app.job.JobWorkItem object.
774 message JobWorkItem {
Kweku Adams0f168de2018-01-24 10:51:30 -0800775 option (.android.msg_privacy).dest = DEST_AUTOMATIC;
776
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800777 optional int32 work_id = 1;
778 optional int32 delivery_count = 2;
779 optional .android.content.IntentProto intent = 3;
780 optional GrantedUriPermissionsDumpProto uri_grants = 4;
781 }
782 repeated JobWorkItem pending_work = 15;
783 repeated JobWorkItem executing_work = 16;
784
785 enum Bucket {
786 ACTIVE = 0;
787 WORKING_SET = 1;
788 FREQUENT = 2;
789 RARE = 3;
790 NEVER = 4;
791 }
792 optional Bucket standby_bucket = 17;
Kweku Adams4836f9d2018-11-12 17:04:17 -0800793 optional bool is_exempted_from_app_standby = 27;
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800794
795 optional int64 enqueue_duration_ms = 18;
796 // Can be negative if the earliest runtime deadline has passed.
797 optional sint64 time_until_earliest_runtime_ms = 19;
798 // Can be negative if the latest runtime deadline has passed.
799 optional sint64 time_until_latest_runtime_ms = 20;
800
801 optional int32 num_failures = 21;
802
803 optional int64 last_successful_run_time = 22;
804 optional int64 last_failed_run_time = 23;
Makoto Onuki15407842018-01-19 14:23:11 -0800805
806 optional int64 internal_flags = 24;
Kweku Adams32f44762018-11-02 16:58:32 -0700807
Kweku Adams4836f9d2018-11-12 17:04:17 -0800808 // Next tag: 28
Kweku Adams85f2fbc2017-12-18 12:04:12 -0800809}