Steven Timotius | 4346f0a | 2017-09-12 11:07:21 -0700 | [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 | |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 17 | syntax = "proto2"; |
Yi Jin | 6b51414 | 2017-10-30 14:54:12 -0700 | [diff] [blame^] | 18 | |
| 19 | import "frameworks/base/core/proto/android/app/notification.proto"; |
Yi Jin | 129fc6c | 2017-09-28 15:48:38 -0700 | [diff] [blame] | 20 | import "frameworks/base/core/proto/android/content/intent.proto"; |
| 21 | import "frameworks/base/core/proto/android/server/intentresolver.proto"; |
Steven Timotius | 4346f0a | 2017-09-12 11:07:21 -0700 | [diff] [blame] | 22 | import "frameworks/base/core/proto/android/server/windowmanagerservice.proto"; |
| 23 | import "frameworks/base/core/proto/android/graphics/rect.proto"; |
Yi Jin | 129fc6c | 2017-09-28 15:48:38 -0700 | [diff] [blame] | 24 | import "frameworks/base/core/proto/android/os/looper.proto"; |
Yi Jin | 6b51414 | 2017-10-30 14:54:12 -0700 | [diff] [blame^] | 25 | import "frameworks/base/core/proto/android/util/common.proto"; |
Steven Timotius | 4346f0a | 2017-09-12 11:07:21 -0700 | [diff] [blame] | 26 | |
| 27 | package com.android.server.am.proto; |
| 28 | |
| 29 | option java_multiple_files = true; |
| 30 | |
| 31 | message ActivityManagerServiceProto { |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 32 | optional ActivityStackSupervisorProto activities = 1; |
Yi Jin | 129fc6c | 2017-09-28 15:48:38 -0700 | [diff] [blame] | 33 | |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 34 | optional BroadcastProto broadcasts = 2; |
Yi Jin | 129fc6c | 2017-09-28 15:48:38 -0700 | [diff] [blame] | 35 | |
Yi Jin | 6b51414 | 2017-10-30 14:54:12 -0700 | [diff] [blame^] | 36 | optional ActiveServicesProto services = 3; |
Yi Jin | 129fc6c | 2017-09-28 15:48:38 -0700 | [diff] [blame] | 37 | |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 38 | optional ProcessProto processes = 4; |
Steven Timotius | 4346f0a | 2017-09-12 11:07:21 -0700 | [diff] [blame] | 39 | } |
| 40 | |
Yi Jin | 6b51414 | 2017-10-30 14:54:12 -0700 | [diff] [blame^] | 41 | // "dumpsys activity --proto activities" |
Steven Timotius | 4346f0a | 2017-09-12 11:07:21 -0700 | [diff] [blame] | 42 | message ActivityStackSupervisorProto { |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 43 | optional .com.android.server.wm.proto.ConfigurationContainerProto configuration_container = 1; |
Steven Timotius | 4346f0a | 2017-09-12 11:07:21 -0700 | [diff] [blame] | 44 | repeated ActivityDisplayProto displays = 2; |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 45 | optional KeyguardControllerProto keyguard_controller = 3; |
| 46 | optional int32 focused_stack_id = 4; |
| 47 | optional .com.android.server.wm.proto.IdentifierProto resumed_activity = 5; |
Steven Timotius | 4346f0a | 2017-09-12 11:07:21 -0700 | [diff] [blame] | 48 | } |
| 49 | |
| 50 | /* represents ActivityStackSupervisor.ActivityDisplay */ |
| 51 | message ActivityDisplayProto { |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 52 | optional .com.android.server.wm.proto.ConfigurationContainerProto configuration_container = 1; |
| 53 | optional int32 id = 2; |
Steven Timotius | 4346f0a | 2017-09-12 11:07:21 -0700 | [diff] [blame] | 54 | repeated ActivityStackProto stacks = 3; |
| 55 | } |
| 56 | |
| 57 | message ActivityStackProto { |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 58 | optional .com.android.server.wm.proto.ConfigurationContainerProto configuration_container = 1; |
| 59 | optional int32 id = 2; |
Steven Timotius | 4346f0a | 2017-09-12 11:07:21 -0700 | [diff] [blame] | 60 | repeated TaskRecordProto tasks = 3; |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 61 | optional .com.android.server.wm.proto.IdentifierProto resumed_activity = 4; |
| 62 | optional int32 display_id = 5; |
| 63 | optional bool fullscreen = 6; |
| 64 | optional .android.graphics.RectProto bounds = 7; |
Steven Timotius | 4346f0a | 2017-09-12 11:07:21 -0700 | [diff] [blame] | 65 | } |
| 66 | |
| 67 | message TaskRecordProto { |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 68 | optional .com.android.server.wm.proto.ConfigurationContainerProto configuration_container = 1; |
| 69 | optional int32 id = 2; |
Steven Timotius | 4346f0a | 2017-09-12 11:07:21 -0700 | [diff] [blame] | 70 | repeated ActivityRecordProto activities = 3; |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 71 | optional int32 stack_id = 4; |
| 72 | optional .android.graphics.RectProto last_non_fullscreen_bounds = 5; |
| 73 | optional string real_activity = 6; |
| 74 | optional string orig_activity = 7; |
| 75 | optional int32 activity_type = 8; |
Wale Ogunwale | 66e1685 | 2017-10-19 13:35:52 -0700 | [diff] [blame] | 76 | optional int32 resize_mode = 9; |
| 77 | optional bool fullscreen = 10; |
| 78 | optional .android.graphics.RectProto bounds = 11; |
| 79 | optional int32 min_width = 12; |
| 80 | optional int32 min_height = 13; |
Steven Timotius | 4346f0a | 2017-09-12 11:07:21 -0700 | [diff] [blame] | 81 | } |
| 82 | |
| 83 | message ActivityRecordProto { |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 84 | optional .com.android.server.wm.proto.ConfigurationContainerProto configuration_container = 1; |
| 85 | optional .com.android.server.wm.proto.IdentifierProto identifier = 2; |
| 86 | optional string state = 3; |
| 87 | optional bool visible = 4; |
| 88 | optional bool front_of_task = 5; |
| 89 | optional int32 proc_id = 6; |
Steven Timotius | 4346f0a | 2017-09-12 11:07:21 -0700 | [diff] [blame] | 90 | } |
| 91 | |
| 92 | message KeyguardControllerProto { |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 93 | optional bool keyguard_showing = 1; |
| 94 | optional bool keyguard_occluded = 2; |
Yi Jin | 129fc6c | 2017-09-28 15:48:38 -0700 | [diff] [blame] | 95 | } |
| 96 | |
Yi Jin | 6b51414 | 2017-10-30 14:54:12 -0700 | [diff] [blame^] | 97 | // "dumpsys activity --proto broadcasts" |
Yi Jin | 129fc6c | 2017-09-28 15:48:38 -0700 | [diff] [blame] | 98 | message BroadcastProto { |
| 99 | repeated ReceiverListProto receiver_list = 1; |
| 100 | |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 101 | optional .com.android.server.IntentResolverProto receiver_resolver = 2; |
Yi Jin | 129fc6c | 2017-09-28 15:48:38 -0700 | [diff] [blame] | 102 | |
| 103 | repeated BroadcastQueueProto broadcast_queue = 3; |
| 104 | |
| 105 | repeated StickyBroadcastProto sticky_broadcasts = 4; |
| 106 | |
| 107 | message MainHandler { |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 108 | optional string handler = 1; |
| 109 | optional .android.os.LooperProto looper = 2; |
Yi Jin | 129fc6c | 2017-09-28 15:48:38 -0700 | [diff] [blame] | 110 | } |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 111 | optional MainHandler handler = 5; |
Yi Jin | 129fc6c | 2017-09-28 15:48:38 -0700 | [diff] [blame] | 112 | } |
| 113 | |
| 114 | message ReceiverListProto { |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 115 | optional ProcessRecordProto app = 1; |
| 116 | optional int32 pid = 2; |
| 117 | optional int32 uid = 3; |
| 118 | optional int32 user = 4; |
| 119 | optional BroadcastRecordProto current = 5; |
| 120 | optional bool linked_to_death = 6; |
Yi Jin | 129fc6c | 2017-09-28 15:48:38 -0700 | [diff] [blame] | 121 | repeated BroadcastFilterProto filters = 7; |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 122 | optional string hex_hash = 8; // this hash is used to find the object in IntentResolver |
Yi Jin | 129fc6c | 2017-09-28 15:48:38 -0700 | [diff] [blame] | 123 | } |
| 124 | |
| 125 | message ProcessRecordProto { |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 126 | optional int32 pid = 1; |
| 127 | optional string process_name = 2; |
| 128 | optional int32 uid = 3; |
| 129 | optional int32 user_id = 4; |
| 130 | optional int32 app_id = 5; |
| 131 | optional int32 isolated_app_id = 6; |
Yi Jin | 129fc6c | 2017-09-28 15:48:38 -0700 | [diff] [blame] | 132 | } |
| 133 | |
| 134 | message BroadcastRecordProto { |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 135 | optional int32 user_id = 1; |
| 136 | optional string intent_action = 2; |
Yi Jin | 129fc6c | 2017-09-28 15:48:38 -0700 | [diff] [blame] | 137 | } |
| 138 | |
| 139 | message BroadcastFilterProto { |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 140 | optional .android.content.IntentFilterProto intent_filter = 1; |
| 141 | optional string required_permission = 2; |
| 142 | optional string hex_hash = 3; // used to find the object in IntentResolver |
| 143 | optional int32 owning_user_id = 4; |
Yi Jin | 129fc6c | 2017-09-28 15:48:38 -0700 | [diff] [blame] | 144 | } |
| 145 | |
| 146 | message BroadcastQueueProto { |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 147 | optional string queue_name = 1; |
Yi Jin | 129fc6c | 2017-09-28 15:48:38 -0700 | [diff] [blame] | 148 | repeated BroadcastRecordProto parallel_broadcasts = 2; |
| 149 | repeated BroadcastRecordProto ordered_broadcasts = 3; |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 150 | optional BroadcastRecordProto pending_broadcast = 4; |
Yi Jin | 129fc6c | 2017-09-28 15:48:38 -0700 | [diff] [blame] | 151 | repeated BroadcastRecordProto historical_broadcasts = 5; |
| 152 | |
| 153 | message BroadcastSummary { |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 154 | optional .android.content.IntentProto intent = 1; |
| 155 | optional int64 enqueue_clock_time_ms = 2; |
| 156 | optional int64 dispatch_clock_time_ms = 3; |
| 157 | optional int64 finish_clock_time_ms = 4; |
Yi Jin | 129fc6c | 2017-09-28 15:48:38 -0700 | [diff] [blame] | 158 | } |
| 159 | repeated BroadcastSummary historical_broadcasts_summary = 6; |
| 160 | } |
| 161 | |
| 162 | message StickyBroadcastProto { |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 163 | optional int32 user = 1; |
Yi Jin | 129fc6c | 2017-09-28 15:48:38 -0700 | [diff] [blame] | 164 | |
| 165 | message StickyAction { |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 166 | optional string name = 1; |
Yi Jin | 129fc6c | 2017-09-28 15:48:38 -0700 | [diff] [blame] | 167 | repeated .android.content.IntentProto intents = 2; |
| 168 | } |
| 169 | repeated StickyAction actions = 2; |
| 170 | } |
| 171 | |
Yi Jin | 6b51414 | 2017-10-30 14:54:12 -0700 | [diff] [blame^] | 172 | // "dumpsys activity --proto service" |
| 173 | message ActiveServicesProto { |
| 174 | |
| 175 | message ServicesByUser { |
| 176 | optional int32 user_id = 1; |
| 177 | repeated ServiceRecordProto service_records = 2; |
| 178 | } |
| 179 | repeated ServicesByUser services_by_users = 1; |
Yi Jin | 129fc6c | 2017-09-28 15:48:38 -0700 | [diff] [blame] | 180 | } |
| 181 | |
Yi Jin | 6b51414 | 2017-10-30 14:54:12 -0700 | [diff] [blame^] | 182 | // corresponds to ActivityManagerService.GrantUri Java class |
| 183 | message GrantUriProto { |
| 184 | optional int32 source_user_id = 1; |
| 185 | optional string uri = 2; |
| 186 | } |
| 187 | |
| 188 | message NeededUriGrantsProto { |
| 189 | optional string target_package = 1; |
| 190 | optional int32 target_uid = 2; |
| 191 | optional int32 flags = 3; |
| 192 | |
| 193 | repeated GrantUriProto grants = 4; |
| 194 | } |
| 195 | |
| 196 | message UriPermissionOwnerProto { |
| 197 | optional string owner = 1; |
| 198 | repeated GrantUriProto read_perms = 2; |
| 199 | repeated GrantUriProto write_perms = 3; |
| 200 | } |
| 201 | |
| 202 | message ServiceRecordProto { |
| 203 | optional string short_name = 1; |
| 204 | optional string hex_hash = 2; |
| 205 | optional bool is_running = 3; // false if the application service is null |
| 206 | optional int32 pid = 4; |
| 207 | optional .android.content.IntentProto intent = 5; |
| 208 | optional string package_name = 6; |
| 209 | optional string process_name = 7; |
| 210 | optional string permission = 8; |
| 211 | |
| 212 | message AppInfo { |
| 213 | optional string base_dir = 1; |
| 214 | optional string res_dir = 2; |
| 215 | optional string data_dir = 3; |
| 216 | } |
| 217 | optional AppInfo appinfo = 9; |
| 218 | optional ProcessRecordProto app = 10; |
| 219 | optional ProcessRecordProto isolated_proc = 11; |
| 220 | optional bool whitelist_manager = 12; |
| 221 | optional bool delayed = 13; |
| 222 | |
| 223 | message Foreground { |
| 224 | optional int32 id = 1; |
| 225 | optional .android.app.NotificationProto notification = 2; |
| 226 | } |
| 227 | optional Foreground foreground = 14; |
| 228 | |
| 229 | optional .android.util.Duration create_real_time = 15; |
| 230 | optional .android.util.Duration starting_bg_timeout = 16; |
| 231 | optional .android.util.Duration last_activity_time = 17; |
| 232 | optional .android.util.Duration restart_time = 18; |
| 233 | optional bool created_from_fg = 19; |
| 234 | |
| 235 | // variables used to track states related to service start |
| 236 | message Start { |
| 237 | optional bool start_requested = 1; |
| 238 | optional bool delayed_stop = 2; |
| 239 | optional bool stop_if_killed = 3; |
| 240 | optional bool call_start = 4; |
| 241 | optional int32 last_start_id = 5; |
| 242 | } |
| 243 | optional Start start = 20; |
| 244 | |
| 245 | message ExecuteNesting { |
| 246 | optional int32 execute_nesting = 1; |
| 247 | optional bool execute_fg = 2; |
| 248 | optional .android.util.Duration executing_start = 3; |
| 249 | } |
| 250 | optional ExecuteNesting execute = 21; |
| 251 | |
| 252 | optional .android.util.Duration destory_time = 22; |
| 253 | |
| 254 | message Crash { |
| 255 | optional int32 restart_count = 1; |
| 256 | optional .android.util.Duration restart_delay = 2; |
| 257 | optional .android.util.Duration next_restart_time = 3; |
| 258 | optional int32 crash_count = 4; |
| 259 | } |
| 260 | optional Crash crash = 23; |
| 261 | |
| 262 | message StartItemProto { |
| 263 | optional int32 id = 1; |
| 264 | optional .android.util.Duration duration = 2; |
| 265 | optional int32 delivery_count = 3; |
| 266 | optional int32 done_executing_count = 4; |
| 267 | optional .android.content.IntentProto intent = 5; |
| 268 | optional NeededUriGrantsProto needed_grants = 6; |
| 269 | optional UriPermissionOwnerProto uri_permissions = 7; |
| 270 | } |
| 271 | repeated StartItemProto delivered_starts = 24; |
| 272 | repeated StartItemProto pending_starts = 25; |
| 273 | |
| 274 | repeated IntentBindRecordProto bindings = 26; |
| 275 | repeated ConnectionRecordProto connections = 27; |
| 276 | } |
| 277 | |
| 278 | message ConnectionRecordProto { |
| 279 | optional string hex_hash = 1; |
| 280 | optional int32 user_id = 2; |
| 281 | |
| 282 | enum Flag { |
| 283 | AUTO_CREATE = 0; |
| 284 | DEBUG_UNBIND = 1; |
| 285 | NOT_FG = 2; |
| 286 | IMPORTANT_BG = 3; |
| 287 | ABOVE_CLIENT = 4; |
| 288 | ALLOW_OOM_MANAGEMENT = 5; |
| 289 | WAIVE_PRIORITY = 6; |
| 290 | IMPORTANT = 7; |
| 291 | ADJUST_WITH_ACTIVITY = 8; |
| 292 | FG_SERVICE_WHILE_WAKE = 9; |
| 293 | FG_SERVICE = 10; |
| 294 | TREAT_LIKE_ACTIVITY = 11; |
| 295 | VISIBLE = 12; |
| 296 | SHOWING_UI = 13; |
| 297 | NOT_VISIBLE = 14; |
| 298 | DEAD = 15; |
| 299 | } |
| 300 | repeated Flag flags = 3; |
| 301 | optional string service_name = 4; |
| 302 | optional string conn_hex_hash = 5; |
| 303 | } |
| 304 | |
| 305 | message AppBindRecordProto { |
| 306 | optional string hex_hash = 1; |
| 307 | optional ProcessRecordProto client = 2; |
| 308 | repeated ConnectionRecordProto connections = 3; |
| 309 | } |
| 310 | |
| 311 | message IntentBindRecordProto { |
| 312 | optional string hex_hash = 1; |
| 313 | optional bool is_create = 2; |
| 314 | optional .android.content.IntentProto intent = 3; |
| 315 | optional string binder = 4; |
| 316 | optional bool requested = 5; |
| 317 | optional bool received = 6; |
| 318 | optional bool has_bound = 7; |
| 319 | optional bool do_rebind = 8; |
| 320 | |
| 321 | repeated AppBindRecordProto apps = 9; |
| 322 | } |
| 323 | |
| 324 | // TODO: "dumpsys activity --proto processes" |
Yi Jin | 129fc6c | 2017-09-28 15:48:38 -0700 | [diff] [blame] | 325 | message ProcessProto { |
Yi Jin | 129fc6c | 2017-09-28 15:48:38 -0700 | [diff] [blame] | 326 | } |