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 | |
Tej Singh | 33a412b | 2018-03-16 18:43:59 -0700 | [diff] [blame] | 23 | import "frameworks/base/core/proto/android/app/job/enums.proto"; |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 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 | 8845d01 | 2018-12-11 20:06:45 -0800 | [diff] [blame] | 32 | import "frameworks/base/core/proto/android/server/job/enums.proto"; |
Joe Onorato | 99598ee | 2019-02-11 15:55:13 +0000 | [diff] [blame] | 33 | import "frameworks/base/core/proto/android/privacy.proto"; |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 34 | |
Makoto Onuki | f731c42 | 2019-01-22 13:23:31 -0800 | [diff] [blame] | 35 | // Next tag: 21 |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 36 | message JobSchedulerServiceDumpProto { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 37 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 38 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 39 | optional ConstantsProto settings = 1; |
| 40 | |
Makoto Onuki | b5d5e97 | 2018-02-20 14:44:20 -0800 | [diff] [blame] | 41 | optional int32 current_heartbeat = 14; |
| 42 | repeated int32 next_heartbeat = 15; |
| 43 | optional int64 last_heartbeat_time_millis = 16; |
| 44 | optional int64 next_heartbeat_time_millis = 17; |
Makoto Onuki | 0525b98 | 2018-05-02 14:46:59 -0700 | [diff] [blame] | 45 | optional bool in_parole = 18; |
Wei Wang | 8c0c3c1 | 2018-11-14 14:56:52 -0800 | [diff] [blame] | 46 | optional bool in_thermal = 19; |
Makoto Onuki | b5d5e97 | 2018-02-20 14:44:20 -0800 | [diff] [blame] | 47 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 48 | repeated int32 started_users = 2; |
| 49 | |
| 50 | message RegisteredJob { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 51 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 52 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 53 | optional JobStatusShortInfoProto info = 1; |
| 54 | optional JobStatusDumpProto dump = 2; |
| 55 | |
| 56 | // A job is ready to be executed if: |
| 57 | // is_job_ready && is_user_started && !is_job_pending && |
| 58 | // !is_job_currently_active && !is_uid_backing_up && |
| 59 | // is_component_present. |
| 60 | optional bool is_job_ready = 3; |
| 61 | optional bool is_user_started = 4; |
| 62 | optional bool is_job_pending = 5; |
| 63 | optional bool is_job_currently_active = 6; |
| 64 | optional bool is_uid_backing_up = 7; |
| 65 | optional bool is_component_present = 8; |
Makoto Onuki | b5d5e97 | 2018-02-20 14:44:20 -0800 | [diff] [blame] | 66 | |
| 67 | optional int64 last_run_heartbeat = 9; |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 68 | } |
| 69 | repeated RegisteredJob registered_jobs = 3; |
| 70 | |
| 71 | repeated StateControllerProto controllers = 4; |
| 72 | |
| 73 | // Which uids are currently in the foreground. |
| 74 | message PriorityOverride { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 75 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 76 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 77 | optional int32 uid = 1; |
| 78 | // Use sint32 instead of an enum since priorities can technically be |
| 79 | // negative. |
| 80 | optional sint32 override_value = 2; |
| 81 | } |
| 82 | repeated PriorityOverride priority_overrides = 5; |
| 83 | |
| 84 | // UIDs that are currently performing backups, so their jobs won't be |
| 85 | // allowed to run. |
| 86 | repeated int32 backing_up_uids = 6; |
| 87 | |
| 88 | optional JobPackageHistoryProto history = 7; |
| 89 | optional JobPackageTrackerDumpProto package_tracker = 8; |
| 90 | |
| 91 | message PendingJob { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 92 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 93 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 94 | optional JobStatusShortInfoProto info = 1; |
| 95 | optional JobStatusDumpProto dump = 2; |
| 96 | optional sint32 evaluated_priority = 3; |
| 97 | // How long this job has been pending. |
| 98 | optional int64 enqueued_duration_ms = 4; |
| 99 | } |
| 100 | repeated PendingJob pending_jobs = 9; |
| 101 | |
| 102 | // From a service that has currently active or pending jobs. |
| 103 | message ActiveJob { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 104 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 105 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 106 | message InactiveJob { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 107 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 108 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 109 | optional int64 time_since_stopped_ms = 1; |
| 110 | // This is not always provided. |
| 111 | optional string stopped_reason = 2; |
| 112 | } |
| 113 | message RunningJob { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 114 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 115 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 116 | optional JobStatusShortInfoProto info = 1; |
| 117 | // How long this job has been running for. |
| 118 | optional int64 running_duration_ms = 2; |
| 119 | optional int64 time_until_timeout_ms = 3; |
| 120 | |
| 121 | optional JobStatusDumpProto dump = 4; |
| 122 | |
| 123 | optional sint32 evaluated_priority = 5; |
| 124 | |
| 125 | optional int64 time_since_made_active_ms = 6; |
| 126 | // How long this job has been pending. |
| 127 | optional int64 pending_duration_ms = 7; |
| 128 | } |
| 129 | oneof job { |
| 130 | InactiveJob inactive = 1; |
| 131 | RunningJob running = 2; |
| 132 | } |
| 133 | } |
| 134 | repeated ActiveJob active_jobs = 10; |
| 135 | |
| 136 | // True when JobScheduler is allowed to run third party apps. |
| 137 | optional bool is_ready_to_rock = 11; |
| 138 | // What was last reported to DeviceIdleController about whether the device |
| 139 | // is active. |
| 140 | optional bool reported_active = 12; |
| 141 | // The current limit on the number of concurrent JobServiceContext entries |
| 142 | // we want to keep actively running a job. |
| 143 | optional int32 max_active_jobs = 13; |
Makoto Onuki | f731c42 | 2019-01-22 13:23:31 -0800 | [diff] [blame] | 144 | |
| 145 | // Dump from JobConcurrencyManager. |
| 146 | optional JobConcurrencyManagerProto concurrency_manager = 20; |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 147 | } |
| 148 | |
| 149 | // A com.android.server.job.JobSchedulerService.Constants object. |
Makoto Onuki | f731c42 | 2019-01-22 13:23:31 -0800 | [diff] [blame] | 150 | // Next tag: 29 |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 151 | message ConstantsProto { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 152 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 153 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 154 | // Minimum # of idle jobs that must be ready in order to force the JMS to |
| 155 | // schedule things early. |
| 156 | optional int32 min_idle_count = 1; |
| 157 | // Minimum # of charging jobs that must be ready in order to force the JMS |
| 158 | // to schedule things early. |
| 159 | optional int32 min_charging_count = 2; |
| 160 | // Minimum # of "battery not low" jobs that must be ready in order to force |
| 161 | // the JMS to schedule things early. |
| 162 | optional int32 min_battery_not_low_count = 3; |
| 163 | // Minimum # of "storage not low" jobs that must be ready in order to force |
| 164 | // the JMS to schedule things early. |
| 165 | optional int32 min_storage_not_low_count = 4; |
| 166 | // Minimum # of connectivity jobs that must be ready in order to force the |
| 167 | // JMS to schedule things early. 1 == Run connectivity jobs as soon as |
| 168 | // ready. |
| 169 | optional int32 min_connectivity_count = 5; |
| 170 | // Minimum # of content trigger jobs that must be ready in order to force |
| 171 | // the JMS to schedule things early. |
| 172 | optional int32 min_content_count = 6; |
| 173 | // Minimum # of jobs (with no particular constraints) for which the JMS will |
| 174 | // be happy running some work early. This (and thus the other min counts) |
| 175 | // is now set to 1, to prevent any batching at this level. Since we now do |
| 176 | // batching through doze, that is a much better mechanism. |
| 177 | optional int32 min_ready_jobs_count = 7; |
| 178 | // This is the job execution factor that is considered to be heavy use of |
| 179 | // the system. |
| 180 | optional double heavy_use_factor = 8; |
| 181 | // This is the job execution factor that is considered to be moderate use of |
| 182 | // the system. |
| 183 | optional double moderate_use_factor = 9; |
| 184 | // The number of MAX_JOB_CONTEXTS_COUNT we reserve for the foreground app. |
| 185 | optional int32 fg_job_count = 10; |
| 186 | // The maximum number of background jobs we allow when the system is in a |
| 187 | // normal memory state. |
| 188 | optional int32 bg_normal_job_count = 11; |
| 189 | // The maximum number of background jobs we allow when the system is in a |
| 190 | // moderate memory state. |
| 191 | optional int32 bg_moderate_job_count = 12; |
| 192 | // The maximum number of background jobs we allow when the system is in a |
| 193 | // low memory state. |
| 194 | optional int32 bg_low_job_count = 13; |
| 195 | // The maximum number of background jobs we allow when the system is in a |
| 196 | // critical memory state. |
| 197 | optional int32 bg_critical_job_count = 14; |
| 198 | // The maximum number of times we allow a job to have itself rescheduled |
| 199 | // before giving up on it, for standard jobs. |
| 200 | optional int32 max_standard_reschedule_count = 15; |
| 201 | // The maximum number of times we allow a job to have itself rescheduled |
| 202 | // before giving up on it, for jobs that are executing work. |
| 203 | optional int32 max_work_reschedule_count = 16; |
| 204 | // The minimum backoff time to allow for linear backoff. |
| 205 | optional int64 min_linear_backoff_time_ms = 17; |
| 206 | // The minimum backoff time to allow for exponential backoff. |
| 207 | optional int64 min_exp_backoff_time_ms = 18; |
| 208 | // How often we recalculate runnability based on apps' standby bucket |
| 209 | // assignment. This should be prime relative to common time interval lengths |
| 210 | // such as a quarter-hour or day, so that the heartbeat drifts relative to |
| 211 | // wall-clock milestones. |
| 212 | optional int64 standby_heartbeat_time_ms = 19; |
| 213 | // Mapping: standby bucket -> number of heartbeats between each sweep of |
| 214 | // that bucket's jobs. |
| 215 | // Bucket assignments as recorded in the JobStatus objects are normalized to |
| 216 | // be indices into this array, rather than the raw constants used by |
| 217 | // AppIdleHistory. |
| 218 | repeated int32 standby_beats = 20; |
Jeff Sharkey | ac2e8ef | 2018-02-22 16:06:44 -0700 | [diff] [blame] | 219 | // The fraction of a job's running window that must pass before we |
| 220 | // consider running it when the network is congested. |
| 221 | optional double conn_congestion_delay_frac = 21; |
| 222 | // The fraction of a prefetch job's running window that must pass before |
| 223 | // we consider matching it against a metered network. |
| 224 | optional double conn_prefetch_relax_frac = 22; |
Kweku Adams | 4836f9d | 2018-11-12 17:04:17 -0800 | [diff] [blame] | 225 | // Whether to use heartbeats or rolling window for quota management. True |
| 226 | // will use heartbeats, false will use a rolling window. |
| 227 | optional bool use_heartbeats = 23; |
| 228 | |
Kweku Adams | bffea5a | 2018-12-13 22:13:28 -0800 | [diff] [blame] | 229 | message TimeController { |
Kweku Adams | 288e73b | 2019-01-17 13:53:24 -0800 | [diff] [blame] | 230 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 231 | |
Kweku Adams | bffea5a | 2018-12-13 22:13:28 -0800 | [diff] [blame] | 232 | // Whether or not TimeController should skip setting wakeup alarms for jobs that aren't |
| 233 | // ready now. |
| 234 | optional bool skip_not_ready_jobs = 1; |
| 235 | } |
| 236 | optional TimeController time_controller = 25; |
| 237 | |
Kweku Adams | 4836f9d | 2018-11-12 17:04:17 -0800 | [diff] [blame] | 238 | message QuotaController { |
Kweku Adams | 288e73b | 2019-01-17 13:53:24 -0800 | [diff] [blame] | 239 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 240 | |
Kweku Adams | 4836f9d | 2018-11-12 17:04:17 -0800 | [diff] [blame] | 241 | // How much time each app will have to run jobs within their standby bucket window. |
| 242 | optional int64 allowed_time_per_period_ms = 1; |
| 243 | // How much time the package should have before transitioning from out-of-quota to in-quota. |
| 244 | // This should not affect processing if the package is already in-quota. |
| 245 | optional int64 in_quota_buffer_ms = 2; |
| 246 | // The quota window size of the particular standby bucket. Apps in this standby bucket are |
| 247 | // expected to run only {@link QUOTA_CONTROLLER_ALLOWED_TIME_PER_PERIOD_MS} within the past |
| 248 | // WINDOW_SIZE_MS. |
| 249 | optional int64 active_window_size_ms = 3; |
| 250 | // The quota window size of the particular standby bucket. Apps in this standby bucket are |
| 251 | // expected to run only {@link QUOTA_CONTROLLER_ALLOWED_TIME_PER_PERIOD_MS} within the past |
| 252 | // WINDOW_SIZE_MS. |
| 253 | optional int64 working_window_size_ms = 4; |
| 254 | // The quota window size of the particular standby bucket. Apps in this standby bucket are |
| 255 | // expected to run only {@link QUOTA_CONTROLLER_ALLOWED_TIME_PER_PERIOD_MS} within the past |
| 256 | // WINDOW_SIZE_MS. |
| 257 | optional int64 frequent_window_size_ms = 5; |
| 258 | // The quota window size of the particular standby bucket. Apps in this standby bucket are |
| 259 | // expected to run only {@link QUOTA_CONTROLLER_ALLOWED_TIME_PER_PERIOD_MS} within the past |
| 260 | // WINDOW_SIZE_MS. |
| 261 | optional int64 rare_window_size_ms = 6; |
Kweku Adams | 045fb572 | 2018-12-11 14:29:10 -0800 | [diff] [blame] | 262 | // The maximum amount of time an app can have its jobs running within a 24 hour window. |
| 263 | optional int64 max_execution_time_ms = 7; |
Kweku Adams | 288e73b | 2019-01-17 13:53:24 -0800 | [diff] [blame] | 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_active = 8; |
| 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_working = 9; |
| 270 | // The maximum number of jobs an app can run within this particular standby bucket's |
| 271 | // window size. |
| 272 | optional int32 max_job_count_frequent = 10; |
| 273 | // The maximum number of jobs an app can run within this particular standby bucket's |
| 274 | // window size. |
| 275 | optional int32 max_job_count_rare = 11; |
| 276 | // The maximum number of jobs that should be allowed to run in the past |
| 277 | // {@link QUOTA_CONTROLLER_ALLOWED_TIME_PER_PERIOD_MS}. |
| 278 | optional int32 max_job_count_per_allowed_time = 12; |
Kweku Adams | d48eef0 | 2019-05-14 13:44:32 -0700 | [diff] [blame^] | 279 | // The maximum number of timing sessions an app can run within this particular standby |
| 280 | // bucket's window size. |
| 281 | optional int32 max_session_count_active = 13; |
| 282 | // The maximum number of timing sessions an app can run within this particular standby |
| 283 | // bucket's window size. |
| 284 | optional int32 max_session_count_working = 14; |
| 285 | // The maximum number of timing sessions an app can run within this particular standby |
| 286 | // bucket's window size. |
| 287 | optional int32 max_session_count_frequent = 15; |
| 288 | // The maximum number of timing sessions an app can run within this particular standby |
| 289 | // bucket's window size. |
| 290 | optional int32 max_session_count_rare = 16; |
| 291 | // The maximum number of timing sessions that should be allowed to run in the past |
| 292 | // {@link QUOTA_CONTROLLER_ALLOWED_TIME_PER_PERIOD_MS}. |
| 293 | optional int32 max_session_count_per_allowed_time = 17; |
| 294 | // Treat two distinct {@link TimingSession}s as the same if they start and end within this |
| 295 | // amount of time of each other. |
| 296 | optional int64 timing_session_coalescing_duration_ms = 18; |
Kweku Adams | 4836f9d | 2018-11-12 17:04:17 -0800 | [diff] [blame] | 297 | } |
| 298 | optional QuotaController quota_controller = 24; |
Kweku Adams | bffea5a | 2018-12-13 22:13:28 -0800 | [diff] [blame] | 299 | |
Makoto Onuki | f731c42 | 2019-01-22 13:23:31 -0800 | [diff] [blame] | 300 | // Max number of jobs, when screen is ON. |
| 301 | optional MaxJobCountsPerMemoryTrimLevelProto max_job_counts_screen_on = 26; |
| 302 | |
| 303 | // Max number of jobs, when screen is OFF. |
| 304 | optional MaxJobCountsPerMemoryTrimLevelProto max_job_counts_screen_off = 27; |
| 305 | |
| 306 | // In this time after screen turns on, we increase job concurrency. |
| 307 | optional int32 screen_off_job_concurrency_increase_delay_ms = 28; |
| 308 | } |
| 309 | |
| 310 | // Next tag: 4 |
| 311 | message MaxJobCountsProto { |
| 312 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 313 | |
| 314 | // Total number of jobs to run simultaneously. |
| 315 | optional int32 total_jobs = 1; |
| 316 | |
| 317 | // Max number of BG (== owned by non-TOP apps) jobs to run simultaneously. |
| 318 | optional int32 max_bg = 2; |
| 319 | |
| 320 | // We try to run at least this many BG (== owned by non-TOP apps) jobs, when there are any |
| 321 | // pending, rather than always running the TOTAL number of FG jobs. |
| 322 | optional int32 min_bg = 3; |
| 323 | } |
| 324 | |
| 325 | // Next tag: 5 |
| 326 | message MaxJobCountsPerMemoryTrimLevelProto { |
| 327 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 328 | |
| 329 | optional MaxJobCountsProto normal = 1; |
| 330 | optional MaxJobCountsProto moderate = 2; |
| 331 | optional MaxJobCountsProto low = 3; |
| 332 | optional MaxJobCountsProto critical = 4; |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 333 | } |
| 334 | |
| 335 | message StateControllerProto { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 336 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 337 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 338 | message BackgroundJobsController { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 339 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 340 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 341 | optional com.android.server.ForceAppStandbyTrackerProto force_app_standby_tracker = 1; |
| 342 | |
| 343 | message TrackedJob { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 344 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 345 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 346 | optional JobStatusShortInfoProto info = 1; |
| 347 | optional int32 source_uid = 2; |
| 348 | optional string source_package_name = 3; |
| 349 | optional bool is_in_foreground = 4; |
| 350 | optional bool is_whitelisted = 5; |
| 351 | optional bool can_run_any_in_background = 6; |
| 352 | // If the constraints are satisfied, then the controller will mark |
| 353 | // the job as RUNNABLE, otherwise, it will be WAITING. |
| 354 | optional bool are_constraints_satisfied = 7; |
| 355 | } |
| 356 | repeated TrackedJob tracked_jobs = 2; |
| 357 | } |
| 358 | message BatteryController { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 359 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 360 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 361 | optional bool is_on_stable_power = 1; |
| 362 | optional bool is_battery_not_low = 2; |
| 363 | |
| 364 | // Whether or not the controller is monitoring battery changes. |
| 365 | optional bool is_monitoring = 3; |
| 366 | // Only valid if is_monitoring is true. |
| 367 | optional int32 last_broadcast_sequence_number = 4; |
| 368 | |
| 369 | message TrackedJob { |
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 JobStatusShortInfoProto info = 1; |
| 373 | optional int32 source_uid = 2; |
| 374 | } |
| 375 | repeated TrackedJob tracked_jobs = 5; |
| 376 | } |
| 377 | message ConnectivityController { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 378 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 379 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 380 | optional bool is_connected = 1; |
| 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 | optional .android.net.NetworkRequestProto required_network = 3; |
| 388 | } |
| 389 | repeated TrackedJob tracked_jobs = 2; |
| 390 | } |
| 391 | message ContentObserverController { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 392 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 393 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 394 | message TrackedJob { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 395 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 396 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 397 | optional JobStatusShortInfoProto info = 1; |
| 398 | optional int32 source_uid = 2; |
| 399 | } |
| 400 | repeated TrackedJob tracked_jobs = 1; |
| 401 | |
| 402 | message Observer { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 403 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 404 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 405 | optional int32 user_id = 1; |
| 406 | |
| 407 | message TriggerContentData { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 408 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 409 | |
| 410 | optional string uri = 1 [ |
| 411 | (.android.privacy).dest = DEST_EXPLICIT |
| 412 | ]; |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 413 | optional int32 flags = 2; |
| 414 | |
| 415 | // A |
| 416 | // com.android.server.job.controllers.ContentObserverController.JobInstance |
| 417 | // object. |
| 418 | message JobInstance { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 419 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 420 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 421 | optional JobStatusShortInfoProto info = 1; |
| 422 | optional int32 source_uid = 2; |
| 423 | |
| 424 | optional int64 trigger_content_update_delay_ms = 3; |
| 425 | optional int64 trigger_content_max_delay_ms = 4; |
| 426 | |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 427 | repeated string changed_authorities = 5 [ |
| 428 | (.android.privacy).dest = DEST_EXPLICIT |
| 429 | ]; |
| 430 | repeated string changed_uris = 6 [ |
| 431 | (.android.privacy).dest = DEST_EXPLICIT |
| 432 | ]; |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 433 | } |
| 434 | repeated JobInstance jobs = 3; |
| 435 | } |
| 436 | repeated TriggerContentData triggers = 2; |
| 437 | } |
| 438 | repeated Observer observers = 2; |
| 439 | } |
| 440 | message DeviceIdleJobsController { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 441 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 442 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 443 | // True when in device idle mode. |
| 444 | optional bool is_device_idle_mode = 1; |
| 445 | |
| 446 | message TrackedJob { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 447 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 448 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 449 | optional JobStatusShortInfoProto info = 1; |
| 450 | optional int32 source_uid = 2; |
| 451 | optional string source_package_name = 3; |
| 452 | // If the constraints are satisfied, then the controller will mark |
| 453 | // the job as RUNNABLE, otherwise, it will be WAITING. |
| 454 | optional bool are_constraints_satisfied = 4; |
| 455 | optional bool is_doze_whitelisted = 5; |
| 456 | // A job that is exempted from Doze when the app is temp whitelisted |
| 457 | // or in the foreground. |
| 458 | optional bool is_allowed_in_doze = 6; |
| 459 | } |
| 460 | repeated TrackedJob tracked_jobs = 2; |
| 461 | } |
| 462 | message IdleController { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 463 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 464 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 465 | optional bool is_idle = 1; |
| 466 | |
| 467 | message TrackedJob { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 468 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 469 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 470 | optional JobStatusShortInfoProto info = 1; |
| 471 | optional int32 source_uid = 2; |
| 472 | } |
| 473 | repeated TrackedJob tracked_jobs = 2; |
| 474 | } |
Kweku Adams | 4836f9d | 2018-11-12 17:04:17 -0800 | [diff] [blame] | 475 | message QuotaController { |
| 476 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 477 | |
| 478 | optional bool is_charging = 1; |
| 479 | optional bool is_in_parole = 2; |
Kweku Adams | 9a4fc55 | 2019-04-25 11:43:23 -0700 | [diff] [blame] | 480 | optional int64 elapsed_realtime = 6; |
Kweku Adams | 4836f9d | 2018-11-12 17:04:17 -0800 | [diff] [blame] | 481 | |
Kweku Adams | d6625ff | 2019-01-10 12:06:21 -0800 | [diff] [blame] | 482 | // List of UIDs currently in the foreground. |
| 483 | repeated int32 foreground_uids = 3; |
| 484 | |
Kweku Adams | 4836f9d | 2018-11-12 17:04:17 -0800 | [diff] [blame] | 485 | message TrackedJob { |
| 486 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 487 | |
| 488 | optional JobStatusShortInfoProto info = 1; |
| 489 | optional int32 source_uid = 2; |
| 490 | optional JobStatusDumpProto.Bucket effective_standby_bucket = 3; |
Kweku Adams | d6625ff | 2019-01-10 12:06:21 -0800 | [diff] [blame] | 491 | // If the job started while the app was in the TOP state. |
| 492 | optional bool is_top_started_job = 4; |
| 493 | optional bool has_quota = 5; |
Kweku Adams | 4836f9d | 2018-11-12 17:04:17 -0800 | [diff] [blame] | 494 | // The amount of time that this job has remaining in its quota. This |
| 495 | // can be negative if the job is out of quota. |
Kweku Adams | d6625ff | 2019-01-10 12:06:21 -0800 | [diff] [blame] | 496 | optional int64 remaining_quota_ms = 6; |
Kweku Adams | 4836f9d | 2018-11-12 17:04:17 -0800 | [diff] [blame] | 497 | } |
Kweku Adams | d6625ff | 2019-01-10 12:06:21 -0800 | [diff] [blame] | 498 | repeated TrackedJob tracked_jobs = 4; |
Kweku Adams | 4836f9d | 2018-11-12 17:04:17 -0800 | [diff] [blame] | 499 | |
Kweku Adams | 9a4fc55 | 2019-04-25 11:43:23 -0700 | [diff] [blame] | 500 | message AlarmListener { |
| 501 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 502 | |
| 503 | // Whether the listener is waiting for an alarm or not. |
| 504 | optional bool is_waiting = 1; |
| 505 | // The time at which the alarm should go off, in the elapsed realtime timebase. Only |
| 506 | // valid if is_waiting is true. |
| 507 | optional int64 trigger_time_elapsed = 2; |
| 508 | } |
| 509 | |
Kweku Adams | 7d6a31c | 2019-04-16 17:05:30 -0700 | [diff] [blame] | 510 | message ExecutionStats { |
| 511 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 512 | |
| 513 | optional JobStatusDumpProto.Bucket standby_bucket = 1; |
| 514 | |
| 515 | // The time after which this record should be considered invalid (out of date), in the |
| 516 | // elapsed realtime timebase. |
| 517 | optional int64 expiration_time_elapsed = 2; |
| 518 | optional int64 window_size_ms = 3; |
| 519 | |
| 520 | /** The total amount of time the app ran in its respective bucket window size. */ |
| 521 | optional int64 execution_time_in_window_ms = 4; |
| 522 | optional int32 bg_job_count_in_window = 5; |
| 523 | |
| 524 | /** |
| 525 | * The total amount of time the app ran in the last |
| 526 | * {@link QuotaController#MAX_PERIOD_MS}. |
| 527 | */ |
| 528 | optional int64 execution_time_in_max_period_ms = 6; |
| 529 | optional int32 bg_job_count_in_max_period = 7; |
| 530 | |
| 531 | /** |
Kweku Adams | d48eef0 | 2019-05-14 13:44:32 -0700 | [diff] [blame^] | 532 | * The number of {@link TimingSession}s within the bucket window size. This will include |
| 533 | * sessions that started before the window as long as they end within the window. |
| 534 | */ |
| 535 | optional int32 session_count_in_window = 11; |
| 536 | |
| 537 | /** |
Kweku Adams | 7d6a31c | 2019-04-16 17:05:30 -0700 | [diff] [blame] | 538 | * The time after which the sum of all the app's sessions plus |
| 539 | * ConstantsProto.QuotaController.in_quota_buffer_ms equals the quota. This is only |
| 540 | * valid if |
| 541 | * execution_time_in_window_ms >= |
| 542 | * ConstantsProto.QuotaController.allowed_time_per_period_ms |
| 543 | * or |
| 544 | * execution_time_in_max_period_ms >= |
| 545 | * ConstantsProto.QuotaController.max_execution_time_ms. |
| 546 | */ |
| 547 | optional int64 quota_cutoff_time_elapsed = 8; |
| 548 | |
| 549 | /** |
| 550 | * The time after which job_count_in_allowed_time should be considered invalid, in the |
| 551 | * elapsed realtime timebase. |
| 552 | */ |
| 553 | optional int64 job_count_expiration_time_elapsed = 9; |
| 554 | |
| 555 | /** |
| 556 | * The number of jobs that ran in at least the last |
| 557 | * ConstantsProto.QuotaController.allowed_time_per_period_ms. |
| 558 | * It may contain a few stale entries since cleanup won't happen exactly every |
| 559 | * ConstantsProto.QuotaController.allowed_time_per_period_ms. |
| 560 | */ |
| 561 | optional int32 job_count_in_allowed_time = 10; |
Kweku Adams | d48eef0 | 2019-05-14 13:44:32 -0700 | [diff] [blame^] | 562 | |
| 563 | /** |
| 564 | * The time after which {@link #timingSessionCountInAllowedTime} should be considered |
| 565 | * invalid, in the elapsed realtime timebase. |
| 566 | */ |
| 567 | optional int64 session_count_expiration_time_elapsed = 12; |
| 568 | |
| 569 | /** |
| 570 | * The number of {@link TimingSession}s that ran in at least the last |
| 571 | * {@link #mAllowedTimePerPeriodMs}. It may contain a few stale entries since cleanup won't |
| 572 | * happen exactly every {@link #mAllowedTimePerPeriodMs}. This should only be considered |
| 573 | * valid before elapsed realtime has reached |
| 574 | * {@link #timingSessionCountExpirationTimeElapsed}. |
| 575 | */ |
| 576 | optional int32 session_count_in_allowed_time = 13; |
Kweku Adams | 7d6a31c | 2019-04-16 17:05:30 -0700 | [diff] [blame] | 577 | } |
| 578 | |
Kweku Adams | 4836f9d | 2018-11-12 17:04:17 -0800 | [diff] [blame] | 579 | message Package { |
| 580 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 581 | |
| 582 | optional int32 user_id = 1; |
| 583 | optional string name = 2; |
| 584 | } |
| 585 | |
| 586 | message TimingSession { |
| 587 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 588 | |
| 589 | optional int64 start_time_elapsed = 1; |
| 590 | optional int64 end_time_elapsed = 2; |
Kweku Adams | cc5afbc | 2018-12-11 15:24:25 -0800 | [diff] [blame] | 591 | // The number of background jobs that ran during this session. |
| 592 | optional int32 bg_job_count = 3; |
Kweku Adams | 4836f9d | 2018-11-12 17:04:17 -0800 | [diff] [blame] | 593 | } |
| 594 | |
| 595 | message Timer { |
| 596 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 597 | |
| 598 | optional Package pkg = 1; |
| 599 | // True if the Timer is actively tracking jobs. |
| 600 | optional bool is_active = 2; |
| 601 | // The time this timer last became active. Only valid if is_active is true. |
| 602 | optional int64 start_time_elapsed = 3; |
Kweku Adams | cc5afbc | 2018-12-11 15:24:25 -0800 | [diff] [blame] | 603 | // How many background jobs are currently running. Valid only if the device is_active |
| 604 | // is true. |
| 605 | optional int32 bg_job_count = 4; |
Kweku Adams | 4836f9d | 2018-11-12 17:04:17 -0800 | [diff] [blame] | 606 | // All of the jobs that the Timer is currently tracking. |
| 607 | repeated JobStatusShortInfoProto running_jobs = 5; |
| 608 | } |
| 609 | |
| 610 | message PackageStats { |
| 611 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 612 | |
| 613 | optional Package pkg = 1; |
| 614 | |
| 615 | optional Timer timer = 2; |
| 616 | |
| 617 | repeated TimingSession saved_sessions = 3; |
Kweku Adams | 7d6a31c | 2019-04-16 17:05:30 -0700 | [diff] [blame] | 618 | |
| 619 | repeated ExecutionStats execution_stats = 4; |
Kweku Adams | 9a4fc55 | 2019-04-25 11:43:23 -0700 | [diff] [blame] | 620 | |
| 621 | optional AlarmListener in_quota_alarm_listener = 5; |
Kweku Adams | 4836f9d | 2018-11-12 17:04:17 -0800 | [diff] [blame] | 622 | } |
Kweku Adams | d6625ff | 2019-01-10 12:06:21 -0800 | [diff] [blame] | 623 | repeated PackageStats package_stats = 5; |
Kweku Adams | 4836f9d | 2018-11-12 17:04:17 -0800 | [diff] [blame] | 624 | } |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 625 | message StorageController { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 626 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 627 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 628 | optional bool is_storage_not_low = 1; |
| 629 | optional int32 last_broadcast_sequence_number = 2; |
| 630 | |
| 631 | message TrackedJob { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 632 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 633 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 634 | optional JobStatusShortInfoProto info = 1; |
| 635 | optional int32 source_uid = 2; |
| 636 | } |
| 637 | repeated TrackedJob tracked_jobs = 3; |
| 638 | } |
| 639 | message TimeController { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 640 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 641 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 642 | optional int64 now_elapsed_realtime = 1; |
| 643 | optional int64 time_until_next_delay_alarm_ms = 2; |
| 644 | optional int64 time_until_next_deadline_alarm_ms = 3; |
| 645 | |
| 646 | message TrackedJob { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 647 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 648 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 649 | optional JobStatusShortInfoProto info = 1; |
| 650 | optional int32 source_uid = 2; |
| 651 | |
| 652 | optional bool has_timing_delay_constraint = 3; |
| 653 | // Only valid if has_timing_delay_constraint is true. Can be |
| 654 | // negative if the delay is in the past. |
| 655 | optional int64 delay_time_remaining_ms = 4; |
| 656 | |
| 657 | optional bool has_deadline_constraint = 5; |
| 658 | // Only valid if has_timing_delay_constraint is true. Can be |
| 659 | // negative in certain situations. |
| 660 | optional int64 time_remaining_until_deadline_ms = 6; |
| 661 | } |
| 662 | repeated TrackedJob tracked_jobs = 4; |
| 663 | } |
| 664 | oneof controller { |
Kweku Adams | 21b8d26 | 2018-03-30 12:19:58 -0700 | [diff] [blame] | 665 | BackgroundJobsController background = 1; |
| 666 | BatteryController battery = 2; |
| 667 | ConnectivityController connectivity = 3; |
| 668 | ContentObserverController content_observer = 4; |
| 669 | DeviceIdleJobsController device_idle = 5; |
| 670 | IdleController idle = 6; |
Kweku Adams | 4836f9d | 2018-11-12 17:04:17 -0800 | [diff] [blame] | 671 | QuotaController quota = 9; |
Kweku Adams | 21b8d26 | 2018-03-30 12:19:58 -0700 | [diff] [blame] | 672 | StorageController storage = 7; |
| 673 | TimeController time = 8; |
Kweku Adams | 4836f9d | 2018-11-12 17:04:17 -0800 | [diff] [blame] | 674 | // Next tag: 10 |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 675 | } |
| 676 | } |
| 677 | |
| 678 | // A com.android.server.job.JobPackageTracker.DataSet object. |
| 679 | message DataSetProto { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 680 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 681 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 682 | optional int64 start_clock_time_ms = 1; |
| 683 | // How much time has elapsed since the DataSet was instantiated. |
| 684 | optional int64 elapsed_time_ms = 2; |
| 685 | optional int64 period_ms = 3; |
| 686 | |
| 687 | // Represents a com.android.server.job.JobPackageTracker.PackageEntry |
| 688 | // object, but with some extra data. |
| 689 | message PackageEntryProto { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 690 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 691 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 692 | optional int32 uid = 1; |
| 693 | optional string package_name = 2; |
| 694 | |
| 695 | message State { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 696 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 697 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 698 | optional int64 duration_ms = 1; |
| 699 | optional int32 count = 2; |
| 700 | } |
| 701 | optional State pending_state = 3; |
| 702 | optional State active_state = 4; |
| 703 | optional State active_top_state = 5; |
| 704 | |
| 705 | // True if the PackageEntry is currently pending or has been pending in |
| 706 | // the past. |
| 707 | optional bool pending = 6; |
| 708 | // True if the PackageEntry is currently active or has been active in |
| 709 | // the past. |
| 710 | optional bool active = 7; |
| 711 | // True if the PackageEntry is currently active top or has been active |
| 712 | // top in the past. |
| 713 | optional bool active_top = 8; |
| 714 | |
| 715 | message StopReasonCount { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 716 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 717 | |
Tej Singh | 33a412b | 2018-03-16 18:43:59 -0700 | [diff] [blame] | 718 | optional .android.app.job.StopReasonEnum reason = 1; |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 719 | optional int32 count = 2; |
| 720 | } |
| 721 | repeated StopReasonCount stop_reasons = 9; |
| 722 | } |
| 723 | repeated PackageEntryProto package_entries = 4; |
| 724 | |
| 725 | optional int32 max_concurrency = 5; |
| 726 | optional int32 max_foreground_concurrency = 6; |
| 727 | } |
| 728 | |
| 729 | // Dump from com.android.server.job.GrantedUriPermissions. |
| 730 | message GrantedUriPermissionsDumpProto { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 731 | option (.android.msg_privacy).dest = DEST_EXPLICIT; |
| 732 | |
| 733 | optional int32 flags = 1 [ (.android.privacy).dest = DEST_AUTOMATIC ]; |
| 734 | optional int32 source_user_id = 2 [ |
| 735 | (.android.privacy).dest = DEST_AUTOMATIC |
| 736 | ]; |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 737 | optional string tag = 3; |
| 738 | optional string permission_owner = 4; |
| 739 | repeated string uris = 5; |
| 740 | } |
| 741 | |
| 742 | message JobPackageTrackerDumpProto { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 743 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 744 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 745 | repeated DataSetProto historical_stats = 1; |
| 746 | optional DataSetProto current_stats = 2; |
| 747 | } |
| 748 | |
| 749 | message JobPackageHistoryProto { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 750 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 751 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 752 | enum Event { |
| 753 | UNKNOWN = 0; |
| 754 | START_JOB = 1; |
| 755 | STOP_JOB = 2; |
| 756 | START_PERIODIC_JOB = 3; |
| 757 | STOP_PERIODIC_JOB = 4; |
| 758 | } |
| 759 | message HistoryEvent { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 760 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 761 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 762 | optional Event event = 1; |
| 763 | optional int64 time_since_event_ms = 2; |
| 764 | optional int32 uid = 3; |
| 765 | // Job IDs can technically be negative. |
| 766 | optional int32 job_id = 4; |
Yi Jin | 2921dd0 | 2018-03-23 14:10:31 -0700 | [diff] [blame] | 767 | optional string tag = 5; |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 768 | // Only valid for STOP_JOB or STOP_PERIODIC_JOB Events. |
Tej Singh | 33a412b | 2018-03-16 18:43:59 -0700 | [diff] [blame] | 769 | optional .android.app.job.StopReasonEnum stop_reason = 6; |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 770 | } |
| 771 | repeated HistoryEvent history_event = 1; |
| 772 | } |
| 773 | |
| 774 | message JobStatusShortInfoProto { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 775 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 776 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 777 | optional int32 calling_uid = 1; |
| 778 | // Job IDs can technically be negative. |
| 779 | optional int32 job_id = 2; |
Yi Jin | e5e2a75 | 2018-03-28 18:31:07 -0700 | [diff] [blame] | 780 | optional string battery_name = 3; |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 781 | } |
| 782 | |
| 783 | // Dump from a com.android.server.job.controllers.JobStatus object. |
| 784 | message JobStatusDumpProto { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 785 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 786 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 787 | // The UID that scheduled the job. |
| 788 | optional int32 calling_uid = 1; |
Yi Jin | 2921dd0 | 2018-03-23 14:10:31 -0700 | [diff] [blame] | 789 | optional string tag = 2; |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 790 | |
| 791 | // The UID for which the job is being run. |
| 792 | optional int32 source_uid = 3; |
| 793 | optional int32 source_user_id = 4; |
| 794 | // The package for which the job is being run. |
| 795 | optional string source_package_name = 5; |
| 796 | |
| 797 | // Custom dump of android.app.job.JobInfo object. |
| 798 | message JobInfo { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 799 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 800 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 801 | optional .android.content.ComponentNameProto service = 1; |
| 802 | |
| 803 | optional bool is_periodic = 2; |
| 804 | // Only valid if is_periodic is true. |
| 805 | optional int64 period_interval_ms = 3; |
| 806 | // Only valid if is_periodic is true. |
| 807 | optional int64 period_flex_ms = 4; |
| 808 | |
| 809 | optional bool is_persisted = 5; |
| 810 | optional sint32 priority = 6; |
| 811 | optional int32 flags = 7; |
| 812 | |
| 813 | optional bool requires_charging = 8; |
| 814 | optional bool requires_battery_not_low = 9; |
| 815 | optional bool requires_device_idle = 10; |
| 816 | |
| 817 | message TriggerContentUri { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 818 | optional int32 flags = 1 [ |
| 819 | (.android.privacy).dest = DEST_AUTOMATIC |
| 820 | ]; |
| 821 | optional string uri = 2 [ (.android.privacy).dest = DEST_EXPLICIT ]; |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 822 | } |
| 823 | repeated TriggerContentUri trigger_content_uris = 11; |
| 824 | optional int64 trigger_content_update_delay_ms = 12; |
| 825 | optional int64 trigger_content_max_delay_ms = 13; |
| 826 | |
| 827 | optional .android.os.PersistableBundleProto extras = 14; |
| 828 | optional .android.os.BundleProto transient_extras = 15; |
Kweku Adams | cb89f62 | 2018-03-22 13:55:46 -0700 | [diff] [blame] | 829 | // ClipData of information that is returned to the application at |
| 830 | // execution time, but not persisted by the system. This is provided by |
| 831 | // the app and the main purpose of providing a ClipData is to allow |
| 832 | // granting of URI permissions for data associated with the clip. The |
| 833 | // exact kind of permission grant to perform is specified in the flags |
| 834 | // field. |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 835 | optional .android.content.ClipDataProto clip_data = 16; |
| 836 | |
| 837 | optional GrantedUriPermissionsDumpProto granted_uri_permissions = 17; |
| 838 | |
| 839 | optional .android.net.NetworkRequestProto required_network = 18; |
| 840 | |
| 841 | optional int64 total_network_bytes = 19; |
| 842 | |
| 843 | optional int64 min_latency_ms = 20; |
| 844 | optional int64 max_execution_delay_ms = 21; |
| 845 | |
| 846 | message Backoff { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 847 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 848 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 849 | enum Policy { |
| 850 | BACKOFF_POLICY_LINEAR = 0; |
| 851 | BACKOFF_POLICY_EXPONENTIAL = 1; |
| 852 | } |
| 853 | optional Policy policy = 1; |
| 854 | optional int64 initial_backoff_ms = 2; |
| 855 | } |
| 856 | optional Backoff backoff_policy = 22; |
| 857 | |
| 858 | optional bool has_early_constraint = 23; |
| 859 | optional bool has_late_constraint = 24; |
| 860 | } |
| 861 | optional JobInfo job_info = 6; |
| 862 | |
Kweku Adams | 8845d01 | 2018-12-11 20:06:45 -0800 | [diff] [blame] | 863 | repeated ConstraintEnum required_constraints = 7; |
| 864 | repeated ConstraintEnum satisfied_constraints = 8; |
| 865 | repeated ConstraintEnum unsatisfied_constraints = 9; |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 866 | optional bool is_doze_whitelisted = 10; |
Kweku Adams | 4836f9d | 2018-11-12 17:04:17 -0800 | [diff] [blame] | 867 | optional bool is_uid_active = 26; |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 868 | |
Kweku Adams | 32f4476 | 2018-11-02 16:58:32 -0700 | [diff] [blame] | 869 | message ImplicitConstraints { |
| 870 | // The device isn't Dozing or this job will be in the foreground. This |
| 871 | // implicit constraint must be satisfied for the job to run. |
| 872 | optional bool is_not_dozing = 1; |
| 873 | // The job is not restricted from running in the background (due to |
| 874 | // Battery Saver). This implicit constraint must be satisfied for the |
| 875 | // job to run. |
| 876 | optional bool is_not_restricted_in_bg = 2; |
| 877 | } |
| 878 | optional ImplicitConstraints implicit_constraints = 25; |
| 879 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 880 | enum TrackingController { |
| 881 | TRACKING_BATTERY = 0; |
| 882 | TRACKING_CONNECTIVITY = 1; |
| 883 | TRACKING_CONTENT = 2; |
| 884 | TRACKING_IDLE = 3; |
| 885 | TRACKING_STORAGE = 4; |
| 886 | TRACKING_TIME = 5; |
Kweku Adams | 4836f9d | 2018-11-12 17:04:17 -0800 | [diff] [blame] | 887 | TRACKING_QUOTA = 6; |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 888 | } |
| 889 | // Controllers that are currently tracking the job. |
| 890 | repeated TrackingController tracking_controllers = 11; |
| 891 | |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 892 | repeated string changed_authorities = 12 [ |
| 893 | (.android.privacy).dest = DEST_EXPLICIT |
| 894 | ]; |
| 895 | repeated string changed_uris = 13 [ |
| 896 | (.android.privacy).dest = DEST_EXPLICIT |
| 897 | ]; |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 898 | |
| 899 | optional .android.net.NetworkProto network = 14; |
| 900 | |
| 901 | // Only the desired data from an android.app.job.JobWorkItem object. |
| 902 | message JobWorkItem { |
Kweku Adams | 0f168de | 2018-01-24 10:51:30 -0800 | [diff] [blame] | 903 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 904 | |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 905 | optional int32 work_id = 1; |
| 906 | optional int32 delivery_count = 2; |
| 907 | optional .android.content.IntentProto intent = 3; |
| 908 | optional GrantedUriPermissionsDumpProto uri_grants = 4; |
| 909 | } |
| 910 | repeated JobWorkItem pending_work = 15; |
| 911 | repeated JobWorkItem executing_work = 16; |
| 912 | |
| 913 | enum Bucket { |
| 914 | ACTIVE = 0; |
| 915 | WORKING_SET = 1; |
| 916 | FREQUENT = 2; |
| 917 | RARE = 3; |
| 918 | NEVER = 4; |
| 919 | } |
| 920 | optional Bucket standby_bucket = 17; |
Kweku Adams | 4836f9d | 2018-11-12 17:04:17 -0800 | [diff] [blame] | 921 | optional bool is_exempted_from_app_standby = 27; |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 922 | |
| 923 | optional int64 enqueue_duration_ms = 18; |
| 924 | // Can be negative if the earliest runtime deadline has passed. |
| 925 | optional sint64 time_until_earliest_runtime_ms = 19; |
| 926 | // Can be negative if the latest runtime deadline has passed. |
| 927 | optional sint64 time_until_latest_runtime_ms = 20; |
| 928 | |
| 929 | optional int32 num_failures = 21; |
| 930 | |
| 931 | optional int64 last_successful_run_time = 22; |
| 932 | optional int64 last_failed_run_time = 23; |
Makoto Onuki | 1540784 | 2018-01-19 14:23:11 -0800 | [diff] [blame] | 933 | |
| 934 | optional int64 internal_flags = 24; |
Kweku Adams | 32f4476 | 2018-11-02 16:58:32 -0700 | [diff] [blame] | 935 | |
Kweku Adams | 4836f9d | 2018-11-12 17:04:17 -0800 | [diff] [blame] | 936 | // Next tag: 28 |
Kweku Adams | 85f2fbc | 2017-12-18 12:04:12 -0800 | [diff] [blame] | 937 | } |
Makoto Onuki | f731c42 | 2019-01-22 13:23:31 -0800 | [diff] [blame] | 938 | |
| 939 | // Dump from com.android.server.job.JobConcurrencyManager. |
| 940 | // Next tag: 7 |
| 941 | message JobConcurrencyManagerProto { |
| 942 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 943 | |
| 944 | // Whether the device is interactive (== screen on) now or not. |
| 945 | optional bool current_interactive = 1; |
| 946 | // Similar to current_interactive, screen on or not, but it takes into account the off timeout. |
| 947 | optional bool effective_interactive = 2; |
| 948 | // How many milliseconds have passed since the last screen on. (i.e. 1000 == 1 sec ago) |
| 949 | optional int64 time_since_last_screen_on_ms = 3; |
| 950 | // How many milliseconds have passed since the last screen off. (i.e. 1000 == 1 sec ago) |
| 951 | optional int64 time_since_last_screen_off_ms = 4; |
| 952 | // Current max number of jobs. |
| 953 | optional JobCountTrackerProto job_count_tracker = 5; |
| 954 | // Current memory trim level. |
| 955 | optional int32 memory_trim_level = 6; |
| 956 | } |
| 957 | |
| 958 | // Dump from com.android.server.job.JobConcurrencyManager.JobCountTracker. |
| 959 | // Next tag: 8 |
| 960 | message JobCountTrackerProto { |
| 961 | option (.android.msg_privacy).dest = DEST_AUTOMATIC; |
| 962 | |
| 963 | // Number of total jos that can run simultaneously. |
| 964 | optional int32 config_num_max_total_jobs = 1; |
| 965 | // Number of background jos that can run simultaneously. |
| 966 | optional int32 config_num_max_bg_jobs = 2; |
| 967 | // Out of total jobs, this many background jobs should be guaranteed to be executed, even if |
| 968 | // there are the config_num_max_total_jobs count of foreground jobs pending. |
| 969 | optional int32 config_num_min_bg_jobs = 3; |
| 970 | |
| 971 | // Number of running foreground jobs. |
| 972 | optional int32 num_running_fg_jobs = 4; |
| 973 | // Number of running background jobs. |
| 974 | optional int32 num_running_bg_jobs = 5; |
| 975 | |
| 976 | // Number of pending foreground jobs. |
| 977 | optional int32 num_pending_fg_jobs = 6; |
| 978 | // Number of pending background jobs. |
| 979 | optional int32 num_pending_bg_jobs = 7; |
| 980 | } |