Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | syntax = "proto2"; |
| 18 | |
| 19 | package com.android.server.job; |
| 20 | |
| 21 | option java_multiple_files = true; |
| 22 | |
| 23 | import "frameworks/base/core/proto/android/app/jobparameters.proto"; |
| 24 | import "frameworks/base/core/proto/android/content/clipdata.proto"; |
| 25 | import "frameworks/base/core/proto/android/content/component_name.proto"; |
| 26 | import "frameworks/base/core/proto/android/content/intent.proto"; |
| 27 | import "frameworks/base/core/proto/android/net/network.proto"; |
| 28 | import "frameworks/base/core/proto/android/net/networkrequest.proto"; |
| 29 | import "frameworks/base/core/proto/android/os/bundle.proto"; |
| 30 | import "frameworks/base/core/proto/android/os/persistablebundle.proto"; |
| 31 | import "frameworks/base/core/proto/android/server/forceappstandbytracker.proto"; |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 32 | import "frameworks/base/libs/incident/proto/android/privacy.proto"; |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 33 | |
| 34 | message JobSchedulerServiceDumpProto { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 35 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 36 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 37 | optional ConstantsProto settings = 1; |
| 38 | |
| 39 | repeated int32 started_users = 2; |
| 40 | |
| 41 | message RegisteredJob { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 42 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 43 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 44 | optional JobStatusShortInfoProto info = 1; |
| 45 | optional JobStatusDumpProto dump = 2; |
| 46 | |
| 47 | // A job is ready to be executed if: |
| 48 | // is_job_ready && is_user_started && !is_job_pending && |
| 49 | // !is_job_currently_active && !is_uid_backing_up && |
| 50 | // is_component_present. |
| 51 | optional bool is_job_ready = 3; |
| 52 | optional bool is_user_started = 4; |
| 53 | optional bool is_job_pending = 5; |
| 54 | optional bool is_job_currently_active = 6; |
| 55 | optional bool is_uid_backing_up = 7; |
| 56 | optional bool is_component_present = 8; |
| 57 | } |
| 58 | repeated RegisteredJob registered_jobs = 3; |
| 59 | |
| 60 | repeated StateControllerProto controllers = 4; |
| 61 | |
| 62 | // Which uids are currently in the foreground. |
| 63 | message PriorityOverride { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 64 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 65 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 66 | optional int32 uid = 1; |
| 67 | // Use sint32 instead of an enum since priorities can technically be |
| 68 | // negative. |
| 69 | optional sint32 override_value = 2; |
| 70 | } |
| 71 | repeated PriorityOverride priority_overrides = 5; |
| 72 | |
| 73 | // UIDs that are currently performing backups, so their jobs won't be |
| 74 | // allowed to run. |
| 75 | repeated int32 backing_up_uids = 6; |
| 76 | |
| 77 | optional JobPackageHistoryProto history = 7; |
| 78 | optional JobPackageTrackerDumpProto package_tracker = 8; |
| 79 | |
| 80 | message PendingJob { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 81 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 82 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 83 | optional JobStatusShortInfoProto info = 1; |
| 84 | optional JobStatusDumpProto dump = 2; |
| 85 | optional sint32 evaluated_priority = 3; |
| 86 | // How long this job has been pending. |
| 87 | optional int64 enqueued_duration_ms = 4; |
| 88 | } |
| 89 | repeated PendingJob pending_jobs = 9; |
| 90 | |
| 91 | // From a service that has currently active or pending jobs. |
| 92 | message ActiveJob { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 93 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 94 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 95 | message InactiveJob { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 96 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 97 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 98 | optional int64 time_since_stopped_ms = 1; |
| 99 | // This is not always provided. |
| 100 | optional string stopped_reason = 2; |
| 101 | } |
| 102 | message RunningJob { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 103 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 104 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 105 | optional JobStatusShortInfoProto info = 1; |
| 106 | // How long this job has been running for. |
| 107 | optional int64 running_duration_ms = 2; |
| 108 | optional int64 time_until_timeout_ms = 3; |
| 109 | |
| 110 | optional JobStatusDumpProto dump = 4; |
| 111 | |
| 112 | optional sint32 evaluated_priority = 5; |
| 113 | |
| 114 | optional int64 time_since_made_active_ms = 6; |
| 115 | // How long this job has been pending. |
| 116 | optional int64 pending_duration_ms = 7; |
| 117 | } |
| 118 | oneof job { |
| 119 | InactiveJob inactive = 1; |
| 120 | RunningJob running = 2; |
| 121 | } |
| 122 | } |
| 123 | repeated ActiveJob active_jobs = 10; |
| 124 | |
| 125 | // True when JobScheduler is allowed to run third party apps. |
| 126 | optional bool is_ready_to_rock = 11; |
| 127 | // What was last reported to DeviceIdleController about whether the device |
| 128 | // is active. |
| 129 | optional bool reported_active = 12; |
| 130 | // The current limit on the number of concurrent JobServiceContext entries |
| 131 | // we want to keep actively running a job. |
| 132 | optional int32 max_active_jobs = 13; |
| 133 | } |
| 134 | |
| 135 | // A com.android.server.job.JobSchedulerService.Constants object. |
| 136 | message ConstantsProto { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 137 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 138 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 139 | // Minimum # of idle jobs that must be ready in order to force the JMS to |
| 140 | // schedule things early. |
| 141 | optional int32 min_idle_count = 1; |
| 142 | // Minimum # of charging jobs that must be ready in order to force the JMS |
| 143 | // to schedule things early. |
| 144 | optional int32 min_charging_count = 2; |
| 145 | // Minimum # of "battery not low" jobs that must be ready in order to force |
| 146 | // the JMS to schedule things early. |
| 147 | optional int32 min_battery_not_low_count = 3; |
| 148 | // Minimum # of "storage not low" jobs that must be ready in order to force |
| 149 | // the JMS to schedule things early. |
| 150 | optional int32 min_storage_not_low_count = 4; |
| 151 | // Minimum # of connectivity jobs that must be ready in order to force the |
| 152 | // JMS to schedule things early. 1 == Run connectivity jobs as soon as |
| 153 | // ready. |
| 154 | optional int32 min_connectivity_count = 5; |
| 155 | // Minimum # of content trigger jobs that must be ready in order to force |
| 156 | // the JMS to schedule things early. |
| 157 | optional int32 min_content_count = 6; |
| 158 | // Minimum # of jobs (with no particular constraints) for which the JMS will |
| 159 | // be happy running some work early. This (and thus the other min counts) |
| 160 | // is now set to 1, to prevent any batching at this level. Since we now do |
| 161 | // batching through doze, that is a much better mechanism. |
| 162 | optional int32 min_ready_jobs_count = 7; |
| 163 | // This is the job execution factor that is considered to be heavy use of |
| 164 | // the system. |
| 165 | optional double heavy_use_factor = 8; |
| 166 | // This is the job execution factor that is considered to be moderate use of |
| 167 | // the system. |
| 168 | optional double moderate_use_factor = 9; |
| 169 | // The number of MAX_JOB_CONTEXTS_COUNT we reserve for the foreground app. |
| 170 | optional int32 fg_job_count = 10; |
| 171 | // The maximum number of background jobs we allow when the system is in a |
| 172 | // normal memory state. |
| 173 | optional int32 bg_normal_job_count = 11; |
| 174 | // The maximum number of background jobs we allow when the system is in a |
| 175 | // moderate memory state. |
| 176 | optional int32 bg_moderate_job_count = 12; |
| 177 | // The maximum number of background jobs we allow when the system is in a |
| 178 | // low memory state. |
| 179 | optional int32 bg_low_job_count = 13; |
| 180 | // The maximum number of background jobs we allow when the system is in a |
| 181 | // critical memory state. |
| 182 | optional int32 bg_critical_job_count = 14; |
| 183 | // The maximum number of times we allow a job to have itself rescheduled |
| 184 | // before giving up on it, for standard jobs. |
| 185 | optional int32 max_standard_reschedule_count = 15; |
| 186 | // The maximum number of times we allow a job to have itself rescheduled |
| 187 | // before giving up on it, for jobs that are executing work. |
| 188 | optional int32 max_work_reschedule_count = 16; |
| 189 | // The minimum backoff time to allow for linear backoff. |
| 190 | optional int64 min_linear_backoff_time_ms = 17; |
| 191 | // The minimum backoff time to allow for exponential backoff. |
| 192 | optional int64 min_exp_backoff_time_ms = 18; |
| 193 | // How often we recalculate runnability based on apps' standby bucket |
| 194 | // assignment. This should be prime relative to common time interval lengths |
| 195 | // such as a quarter-hour or day, so that the heartbeat drifts relative to |
| 196 | // wall-clock milestones. |
| 197 | optional int64 standby_heartbeat_time_ms = 19; |
| 198 | // Mapping: standby bucket -> number of heartbeats between each sweep of |
| 199 | // that bucket's jobs. |
| 200 | // Bucket assignments as recorded in the JobStatus objects are normalized to |
| 201 | // be indices into this array, rather than the raw constants used by |
| 202 | // AppIdleHistory. |
| 203 | repeated int32 standby_beats = 20; |
Jeff Sharkey | ac2e8ef | 2018-02-22 16:06:44 -0700 | [diff] [blame^] | 204 | // The fraction of a job's running window that must pass before we |
| 205 | // consider running it when the network is congested. |
| 206 | optional double conn_congestion_delay_frac = 21; |
| 207 | // The fraction of a prefetch job's running window that must pass before |
| 208 | // we consider matching it against a metered network. |
| 209 | optional double conn_prefetch_relax_frac = 22; |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 210 | } |
| 211 | |
| 212 | message StateControllerProto { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 213 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 214 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 215 | message AppIdleController { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 216 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 217 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 218 | optional bool is_parole_on = 1; |
| 219 | |
| 220 | message TrackedJob { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 221 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 222 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 223 | optional JobStatusShortInfoProto info = 1; |
| 224 | optional int32 source_uid = 2; |
| 225 | optional string source_package_name = 3; |
| 226 | // If the constraints are satisfied, then the controller will mark |
| 227 | // the job as RUNNABLE, otherwise, it will be WAITING. |
| 228 | optional bool are_constraints_satisfied = 4; |
| 229 | } |
| 230 | repeated TrackedJob tracked_jobs = 2; |
| 231 | } |
| 232 | message BackgroundJobsController { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 233 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 234 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 235 | optional com.android.server.ForceAppStandbyTrackerProto force_app_standby_tracker = 1; |
| 236 | |
| 237 | message TrackedJob { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 238 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 239 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 240 | optional JobStatusShortInfoProto info = 1; |
| 241 | optional int32 source_uid = 2; |
| 242 | optional string source_package_name = 3; |
| 243 | optional bool is_in_foreground = 4; |
| 244 | optional bool is_whitelisted = 5; |
| 245 | optional bool can_run_any_in_background = 6; |
| 246 | // If the constraints are satisfied, then the controller will mark |
| 247 | // the job as RUNNABLE, otherwise, it will be WAITING. |
| 248 | optional bool are_constraints_satisfied = 7; |
| 249 | } |
| 250 | repeated TrackedJob tracked_jobs = 2; |
| 251 | } |
| 252 | message BatteryController { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 253 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 254 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 255 | optional bool is_on_stable_power = 1; |
| 256 | optional bool is_battery_not_low = 2; |
| 257 | |
| 258 | // Whether or not the controller is monitoring battery changes. |
| 259 | optional bool is_monitoring = 3; |
| 260 | // Only valid if is_monitoring is true. |
| 261 | optional int32 last_broadcast_sequence_number = 4; |
| 262 | |
| 263 | message TrackedJob { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 264 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 265 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 266 | optional JobStatusShortInfoProto info = 1; |
| 267 | optional int32 source_uid = 2; |
| 268 | } |
| 269 | repeated TrackedJob tracked_jobs = 5; |
| 270 | } |
| 271 | message ConnectivityController { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 272 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 273 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 274 | optional bool is_connected = 1; |
| 275 | |
| 276 | message TrackedJob { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 277 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 278 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 279 | optional JobStatusShortInfoProto info = 1; |
| 280 | optional int32 source_uid = 2; |
| 281 | optional .android.net.NetworkRequestProto required_network = 3; |
| 282 | } |
| 283 | repeated TrackedJob tracked_jobs = 2; |
| 284 | } |
| 285 | message ContentObserverController { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 286 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 287 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 288 | message TrackedJob { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 289 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 290 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 291 | optional JobStatusShortInfoProto info = 1; |
| 292 | optional int32 source_uid = 2; |
| 293 | } |
| 294 | repeated TrackedJob tracked_jobs = 1; |
| 295 | |
| 296 | message Observer { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 297 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 298 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 299 | optional int32 user_id = 1; |
| 300 | |
| 301 | message TriggerContentData { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 302 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 303 | |
| 304 | optional string uri = 1 [ |
| 305 | (.android.privacy).dest = DEST_EXPLICIT |
| 306 | ]; |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 307 | optional int32 flags = 2; |
| 308 | |
| 309 | // A |
| 310 | // com.android.server.job.controllers.ContentObserverController.JobInstance |
| 311 | // object. |
| 312 | message JobInstance { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 313 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 314 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 315 | optional JobStatusShortInfoProto info = 1; |
| 316 | optional int32 source_uid = 2; |
| 317 | |
| 318 | optional int64 trigger_content_update_delay_ms = 3; |
| 319 | optional int64 trigger_content_max_delay_ms = 4; |
| 320 | |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 321 | repeated string changed_authorities = 5 [ |
| 322 | (.android.privacy).dest = DEST_EXPLICIT |
| 323 | ]; |
| 324 | repeated string changed_uris = 6 [ |
| 325 | (.android.privacy).dest = DEST_EXPLICIT |
| 326 | ]; |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 327 | } |
| 328 | repeated JobInstance jobs = 3; |
| 329 | } |
| 330 | repeated TriggerContentData triggers = 2; |
| 331 | } |
| 332 | repeated Observer observers = 2; |
| 333 | } |
| 334 | message DeviceIdleJobsController { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 335 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 336 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 337 | // True when in device idle mode. |
| 338 | optional bool is_device_idle_mode = 1; |
| 339 | |
| 340 | message TrackedJob { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 341 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 342 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 343 | optional JobStatusShortInfoProto info = 1; |
| 344 | optional int32 source_uid = 2; |
| 345 | optional string source_package_name = 3; |
| 346 | // If the constraints are satisfied, then the controller will mark |
| 347 | // the job as RUNNABLE, otherwise, it will be WAITING. |
| 348 | optional bool are_constraints_satisfied = 4; |
| 349 | optional bool is_doze_whitelisted = 5; |
| 350 | // A job that is exempted from Doze when the app is temp whitelisted |
| 351 | // or in the foreground. |
| 352 | optional bool is_allowed_in_doze = 6; |
| 353 | } |
| 354 | repeated TrackedJob tracked_jobs = 2; |
| 355 | } |
| 356 | message IdleController { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 357 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 358 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 359 | optional bool is_idle = 1; |
| 360 | |
| 361 | message TrackedJob { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 362 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 363 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 364 | optional JobStatusShortInfoProto info = 1; |
| 365 | optional int32 source_uid = 2; |
| 366 | } |
| 367 | repeated TrackedJob tracked_jobs = 2; |
| 368 | } |
| 369 | message StorageController { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 370 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 371 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 372 | optional bool is_storage_not_low = 1; |
| 373 | optional int32 last_broadcast_sequence_number = 2; |
| 374 | |
| 375 | message TrackedJob { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 376 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 377 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 378 | optional JobStatusShortInfoProto info = 1; |
| 379 | optional int32 source_uid = 2; |
| 380 | } |
| 381 | repeated TrackedJob tracked_jobs = 3; |
| 382 | } |
| 383 | message TimeController { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 384 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 385 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 386 | optional int64 now_elapsed_realtime = 1; |
| 387 | optional int64 time_until_next_delay_alarm_ms = 2; |
| 388 | optional int64 time_until_next_deadline_alarm_ms = 3; |
| 389 | |
| 390 | message TrackedJob { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 391 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 392 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 393 | optional JobStatusShortInfoProto info = 1; |
| 394 | optional int32 source_uid = 2; |
| 395 | |
| 396 | optional bool has_timing_delay_constraint = 3; |
| 397 | // Only valid if has_timing_delay_constraint is true. Can be |
| 398 | // negative if the delay is in the past. |
| 399 | optional int64 delay_time_remaining_ms = 4; |
| 400 | |
| 401 | optional bool has_deadline_constraint = 5; |
| 402 | // Only valid if has_timing_delay_constraint is true. Can be |
| 403 | // negative in certain situations. |
| 404 | optional int64 time_remaining_until_deadline_ms = 6; |
| 405 | } |
| 406 | repeated TrackedJob tracked_jobs = 4; |
| 407 | } |
| 408 | oneof controller { |
| 409 | AppIdleController app_idle = 1; |
| 410 | BackgroundJobsController background = 2; |
| 411 | BatteryController battery = 3; |
| 412 | ConnectivityController connectivity = 4; |
| 413 | ContentObserverController content_observer = 5; |
| 414 | DeviceIdleJobsController device_idle = 6; |
| 415 | IdleController idle = 7; |
| 416 | StorageController storage = 8; |
| 417 | TimeController time = 9; |
| 418 | } |
| 419 | } |
| 420 | |
| 421 | // A com.android.server.job.JobPackageTracker.DataSet object. |
| 422 | message DataSetProto { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 423 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 424 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 425 | optional int64 start_clock_time_ms = 1; |
| 426 | // How much time has elapsed since the DataSet was instantiated. |
| 427 | optional int64 elapsed_time_ms = 2; |
| 428 | optional int64 period_ms = 3; |
| 429 | |
| 430 | // Represents a com.android.server.job.JobPackageTracker.PackageEntry |
| 431 | // object, but with some extra data. |
| 432 | message PackageEntryProto { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 433 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 434 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 435 | optional int32 uid = 1; |
| 436 | optional string package_name = 2; |
| 437 | |
| 438 | message State { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 439 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 440 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 441 | optional int64 duration_ms = 1; |
| 442 | optional int32 count = 2; |
| 443 | } |
| 444 | optional State pending_state = 3; |
| 445 | optional State active_state = 4; |
| 446 | optional State active_top_state = 5; |
| 447 | |
| 448 | // True if the PackageEntry is currently pending or has been pending in |
| 449 | // the past. |
| 450 | optional bool pending = 6; |
| 451 | // True if the PackageEntry is currently active or has been active in |
| 452 | // the past. |
| 453 | optional bool active = 7; |
| 454 | // True if the PackageEntry is currently active top or has been active |
| 455 | // top in the past. |
| 456 | optional bool active_top = 8; |
| 457 | |
| 458 | message StopReasonCount { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 459 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 460 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 461 | optional .android.app.JobParametersProto.CancelReason reason = 1; |
| 462 | optional int32 count = 2; |
| 463 | } |
| 464 | repeated StopReasonCount stop_reasons = 9; |
| 465 | } |
| 466 | repeated PackageEntryProto package_entries = 4; |
| 467 | |
| 468 | optional int32 max_concurrency = 5; |
| 469 | optional int32 max_foreground_concurrency = 6; |
| 470 | } |
| 471 | |
| 472 | // Dump from com.android.server.job.GrantedUriPermissions. |
| 473 | message GrantedUriPermissionsDumpProto { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 474 | option (.android.msg_privacy).dest = DEST_EXPLICIT; |
| 475 | |
| 476 | optional int32 flags = 1 [ (.android.privacy).dest = DEST_AUTOMATIC ]; |
| 477 | optional int32 source_user_id = 2 [ |
| 478 | (.android.privacy).dest = DEST_AUTOMATIC |
| 479 | ]; |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 480 | optional string tag = 3; |
| 481 | optional string permission_owner = 4; |
| 482 | repeated string uris = 5; |
| 483 | } |
| 484 | |
| 485 | message JobPackageTrackerDumpProto { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 486 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 487 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 488 | repeated DataSetProto historical_stats = 1; |
| 489 | optional DataSetProto current_stats = 2; |
| 490 | } |
| 491 | |
| 492 | message JobPackageHistoryProto { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 493 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 494 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 495 | enum Event { |
| 496 | UNKNOWN = 0; |
| 497 | START_JOB = 1; |
| 498 | STOP_JOB = 2; |
| 499 | START_PERIODIC_JOB = 3; |
| 500 | STOP_PERIODIC_JOB = 4; |
| 501 | } |
| 502 | message HistoryEvent { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 503 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 504 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 505 | optional Event event = 1; |
| 506 | optional int64 time_since_event_ms = 2; |
| 507 | optional int32 uid = 3; |
| 508 | // Job IDs can technically be negative. |
| 509 | optional int32 job_id = 4; |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 510 | optional string tag = 5 [ (.android.privacy).dest = DEST_EXPLICIT ]; |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 511 | // Only valid for STOP_JOB or STOP_PERIODIC_JOB Events. |
| 512 | optional .android.app.JobParametersProto.CancelReason stop_reason = 6; |
| 513 | } |
| 514 | repeated HistoryEvent history_event = 1; |
| 515 | } |
| 516 | |
| 517 | message JobStatusShortInfoProto { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 518 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 519 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 520 | optional int32 calling_uid = 1; |
| 521 | // Job IDs can technically be negative. |
| 522 | optional int32 job_id = 2; |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 523 | optional string battery_name = 3 [ |
| 524 | (.android.privacy).dest = DEST_EXPLICIT |
| 525 | ]; |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 526 | } |
| 527 | |
| 528 | // Dump from a com.android.server.job.controllers.JobStatus object. |
| 529 | message JobStatusDumpProto { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 530 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 531 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 532 | // The UID that scheduled the job. |
| 533 | optional int32 calling_uid = 1; |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 534 | optional string tag = 2 [ (.android.privacy).dest = DEST_EXPLICIT ]; |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 535 | |
| 536 | // The UID for which the job is being run. |
| 537 | optional int32 source_uid = 3; |
| 538 | optional int32 source_user_id = 4; |
| 539 | // The package for which the job is being run. |
| 540 | optional string source_package_name = 5; |
| 541 | |
| 542 | // Custom dump of android.app.job.JobInfo object. |
| 543 | message JobInfo { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 544 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 545 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 546 | optional .android.content.ComponentNameProto service = 1; |
| 547 | |
| 548 | optional bool is_periodic = 2; |
| 549 | // Only valid if is_periodic is true. |
| 550 | optional int64 period_interval_ms = 3; |
| 551 | // Only valid if is_periodic is true. |
| 552 | optional int64 period_flex_ms = 4; |
| 553 | |
| 554 | optional bool is_persisted = 5; |
| 555 | optional sint32 priority = 6; |
| 556 | optional int32 flags = 7; |
| 557 | |
| 558 | optional bool requires_charging = 8; |
| 559 | optional bool requires_battery_not_low = 9; |
| 560 | optional bool requires_device_idle = 10; |
| 561 | |
| 562 | message TriggerContentUri { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 563 | optional int32 flags = 1 [ |
| 564 | (.android.privacy).dest = DEST_AUTOMATIC |
| 565 | ]; |
| 566 | optional string uri = 2 [ (.android.privacy).dest = DEST_EXPLICIT ]; |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 567 | } |
| 568 | repeated TriggerContentUri trigger_content_uris = 11; |
| 569 | optional int64 trigger_content_update_delay_ms = 12; |
| 570 | optional int64 trigger_content_max_delay_ms = 13; |
| 571 | |
| 572 | optional .android.os.PersistableBundleProto extras = 14; |
| 573 | optional .android.os.BundleProto transient_extras = 15; |
| 574 | optional .android.content.ClipDataProto clip_data = 16; |
| 575 | |
| 576 | optional GrantedUriPermissionsDumpProto granted_uri_permissions = 17; |
| 577 | |
| 578 | optional .android.net.NetworkRequestProto required_network = 18; |
| 579 | |
| 580 | optional int64 total_network_bytes = 19; |
| 581 | |
| 582 | optional int64 min_latency_ms = 20; |
| 583 | optional int64 max_execution_delay_ms = 21; |
| 584 | |
| 585 | message Backoff { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 586 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 587 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 588 | enum Policy { |
| 589 | BACKOFF_POLICY_LINEAR = 0; |
| 590 | BACKOFF_POLICY_EXPONENTIAL = 1; |
| 591 | } |
| 592 | optional Policy policy = 1; |
| 593 | optional int64 initial_backoff_ms = 2; |
| 594 | } |
| 595 | optional Backoff backoff_policy = 22; |
| 596 | |
| 597 | optional bool has_early_constraint = 23; |
| 598 | optional bool has_late_constraint = 24; |
| 599 | } |
| 600 | optional JobInfo job_info = 6; |
| 601 | |
| 602 | enum Constraint { |
| 603 | CONSTRAINT_CHARGING = 1; |
| 604 | CONSTRAINT_BATTERY_NOT_LOW = 2; |
| 605 | CONSTRAINT_STORAGE_NOT_LOW = 3; |
| 606 | CONSTRAINT_TIMING_DELAY = 4; |
| 607 | CONSTRAINT_DEADLINE = 5; |
| 608 | CONSTRAINT_IDLE = 6; |
| 609 | CONSTRAINT_CONNECTIVITY = 7; |
| 610 | CONSTRAINT_APP_NOT_IDLE = 8; |
| 611 | CONSTRAINT_CONTENT_TRIGGER = 9; |
| 612 | CONSTRAINT_DEVICE_NOT_DOZING = 10; |
| 613 | } |
| 614 | repeated Constraint required_constraints = 7; |
| 615 | repeated Constraint satisfied_constraints = 8; |
| 616 | repeated Constraint unsatisfied_constraints = 9; |
| 617 | optional bool is_doze_whitelisted = 10; |
| 618 | |
| 619 | enum TrackingController { |
| 620 | TRACKING_BATTERY = 0; |
| 621 | TRACKING_CONNECTIVITY = 1; |
| 622 | TRACKING_CONTENT = 2; |
| 623 | TRACKING_IDLE = 3; |
| 624 | TRACKING_STORAGE = 4; |
| 625 | TRACKING_TIME = 5; |
| 626 | } |
| 627 | // Controllers that are currently tracking the job. |
| 628 | repeated TrackingController tracking_controllers = 11; |
| 629 | |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 630 | repeated string changed_authorities = 12 [ |
| 631 | (.android.privacy).dest = DEST_EXPLICIT |
| 632 | ]; |
| 633 | repeated string changed_uris = 13 [ |
| 634 | (.android.privacy).dest = DEST_EXPLICIT |
| 635 | ]; |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 636 | |
| 637 | optional .android.net.NetworkProto network = 14; |
| 638 | |
| 639 | // Only the desired data from an android.app.job.JobWorkItem object. |
| 640 | message JobWorkItem { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 641 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 642 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 643 | optional int32 work_id = 1; |
| 644 | optional int32 delivery_count = 2; |
| 645 | optional .android.content.IntentProto intent = 3; |
| 646 | optional GrantedUriPermissionsDumpProto uri_grants = 4; |
| 647 | } |
| 648 | repeated JobWorkItem pending_work = 15; |
| 649 | repeated JobWorkItem executing_work = 16; |
| 650 | |
| 651 | enum Bucket { |
| 652 | ACTIVE = 0; |
| 653 | WORKING_SET = 1; |
| 654 | FREQUENT = 2; |
| 655 | RARE = 3; |
| 656 | NEVER = 4; |
| 657 | } |
| 658 | optional Bucket standby_bucket = 17; |
| 659 | |
| 660 | optional int64 enqueue_duration_ms = 18; |
| 661 | // Can be negative if the earliest runtime deadline has passed. |
| 662 | optional sint64 time_until_earliest_runtime_ms = 19; |
| 663 | // Can be negative if the latest runtime deadline has passed. |
| 664 | optional sint64 time_until_latest_runtime_ms = 20; |
| 665 | |
| 666 | optional int32 num_failures = 21; |
| 667 | |
| 668 | optional int64 last_successful_run_time = 22; |
| 669 | optional int64 last_failed_run_time = 23; |
Makoto Onuki | 1540784 | 2018-01-19 14:23:11 -0800 | [diff] [blame] | 670 | |
| 671 | optional int64 internal_flags = 24; |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 672 | } |