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