blob: 889842ccc99e9989186f7ee5e3a322f319101892 [file] [log] [blame]
Steven Timotius4346f0a2017-09-12 11:07:21 -07001/*
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 Jinc7f93072017-09-29 15:29:38 -070017syntax = "proto2";
Yi Jin6b514142017-10-30 14:54:12 -070018
19import "frameworks/base/core/proto/android/app/notification.proto";
Yi Jin129fc6c2017-09-28 15:48:38 -070020import "frameworks/base/core/proto/android/content/intent.proto";
21import "frameworks/base/core/proto/android/server/intentresolver.proto";
Steven Timotius4346f0a2017-09-12 11:07:21 -070022import "frameworks/base/core/proto/android/server/windowmanagerservice.proto";
23import "frameworks/base/core/proto/android/graphics/rect.proto";
Yi Jin129fc6c2017-09-28 15:48:38 -070024import "frameworks/base/core/proto/android/os/looper.proto";
Yi Jin6b514142017-10-30 14:54:12 -070025import "frameworks/base/core/proto/android/util/common.proto";
Steven Timotius4346f0a2017-09-12 11:07:21 -070026
27package com.android.server.am.proto;
28
29option java_multiple_files = true;
30
31message ActivityManagerServiceProto {
Yi Jinc7f93072017-09-29 15:29:38 -070032 optional ActivityStackSupervisorProto activities = 1;
Yi Jin129fc6c2017-09-28 15:48:38 -070033
Yi Jinc7f93072017-09-29 15:29:38 -070034 optional BroadcastProto broadcasts = 2;
Yi Jin129fc6c2017-09-28 15:48:38 -070035
Yi Jin6b514142017-10-30 14:54:12 -070036 optional ActiveServicesProto services = 3;
Yi Jin129fc6c2017-09-28 15:48:38 -070037
Yi Jinc7f93072017-09-29 15:29:38 -070038 optional ProcessProto processes = 4;
Steven Timotius4346f0a2017-09-12 11:07:21 -070039}
40
Yi Jin6b514142017-10-30 14:54:12 -070041// "dumpsys activity --proto activities"
Steven Timotius4346f0a2017-09-12 11:07:21 -070042message ActivityStackSupervisorProto {
Yi Jinc7f93072017-09-29 15:29:38 -070043 optional .com.android.server.wm.proto.ConfigurationContainerProto configuration_container = 1;
Steven Timotius4346f0a2017-09-12 11:07:21 -070044 repeated ActivityDisplayProto displays = 2;
Yi Jinc7f93072017-09-29 15:29:38 -070045 optional KeyguardControllerProto keyguard_controller = 3;
46 optional int32 focused_stack_id = 4;
47 optional .com.android.server.wm.proto.IdentifierProto resumed_activity = 5;
Steven Timotius4346f0a2017-09-12 11:07:21 -070048}
49
50/* represents ActivityStackSupervisor.ActivityDisplay */
51message ActivityDisplayProto {
Yi Jinc7f93072017-09-29 15:29:38 -070052 optional .com.android.server.wm.proto.ConfigurationContainerProto configuration_container = 1;
53 optional int32 id = 2;
Steven Timotius4346f0a2017-09-12 11:07:21 -070054 repeated ActivityStackProto stacks = 3;
55}
56
57message ActivityStackProto {
Yi Jinc7f93072017-09-29 15:29:38 -070058 optional .com.android.server.wm.proto.ConfigurationContainerProto configuration_container = 1;
59 optional int32 id = 2;
Steven Timotius4346f0a2017-09-12 11:07:21 -070060 repeated TaskRecordProto tasks = 3;
Yi Jinc7f93072017-09-29 15:29:38 -070061 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 Timotius4346f0a2017-09-12 11:07:21 -070065}
66
67message TaskRecordProto {
Yi Jinc7f93072017-09-29 15:29:38 -070068 optional .com.android.server.wm.proto.ConfigurationContainerProto configuration_container = 1;
69 optional int32 id = 2;
Steven Timotius4346f0a2017-09-12 11:07:21 -070070 repeated ActivityRecordProto activities = 3;
Yi Jinc7f93072017-09-29 15:29:38 -070071 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 Ogunwale66e16852017-10-19 13:35:52 -070076 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 Timotius4346f0a2017-09-12 11:07:21 -070081}
82
83message ActivityRecordProto {
Yi Jinc7f93072017-09-29 15:29:38 -070084 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 Timotius4346f0a2017-09-12 11:07:21 -070090}
91
92message KeyguardControllerProto {
Yi Jinc7f93072017-09-29 15:29:38 -070093 optional bool keyguard_showing = 1;
94 optional bool keyguard_occluded = 2;
Yi Jin129fc6c2017-09-28 15:48:38 -070095}
96
Yi Jin6b514142017-10-30 14:54:12 -070097// "dumpsys activity --proto broadcasts"
Yi Jin129fc6c2017-09-28 15:48:38 -070098message BroadcastProto {
99 repeated ReceiverListProto receiver_list = 1;
100
Yi Jinc7f93072017-09-29 15:29:38 -0700101 optional .com.android.server.IntentResolverProto receiver_resolver = 2;
Yi Jin129fc6c2017-09-28 15:48:38 -0700102
103 repeated BroadcastQueueProto broadcast_queue = 3;
104
105 repeated StickyBroadcastProto sticky_broadcasts = 4;
106
107 message MainHandler {
Yi Jinc7f93072017-09-29 15:29:38 -0700108 optional string handler = 1;
109 optional .android.os.LooperProto looper = 2;
Yi Jin129fc6c2017-09-28 15:48:38 -0700110 }
Yi Jinc7f93072017-09-29 15:29:38 -0700111 optional MainHandler handler = 5;
Yi Jin129fc6c2017-09-28 15:48:38 -0700112}
113
114message ReceiverListProto {
Yi Jinc7f93072017-09-29 15:29:38 -0700115 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 Jin129fc6c2017-09-28 15:48:38 -0700121 repeated BroadcastFilterProto filters = 7;
Yi Jinc7f93072017-09-29 15:29:38 -0700122 optional string hex_hash = 8; // this hash is used to find the object in IntentResolver
Yi Jin129fc6c2017-09-28 15:48:38 -0700123}
124
125message ProcessRecordProto {
Yi Jinc7f93072017-09-29 15:29:38 -0700126 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 Jin129fc6c2017-09-28 15:48:38 -0700132}
133
134message BroadcastRecordProto {
Yi Jinc7f93072017-09-29 15:29:38 -0700135 optional int32 user_id = 1;
136 optional string intent_action = 2;
Yi Jin129fc6c2017-09-28 15:48:38 -0700137}
138
139message BroadcastFilterProto {
Yi Jinc7f93072017-09-29 15:29:38 -0700140 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 Jin129fc6c2017-09-28 15:48:38 -0700144}
145
146message BroadcastQueueProto {
Yi Jinc7f93072017-09-29 15:29:38 -0700147 optional string queue_name = 1;
Yi Jin129fc6c2017-09-28 15:48:38 -0700148 repeated BroadcastRecordProto parallel_broadcasts = 2;
149 repeated BroadcastRecordProto ordered_broadcasts = 3;
Yi Jinc7f93072017-09-29 15:29:38 -0700150 optional BroadcastRecordProto pending_broadcast = 4;
Yi Jin129fc6c2017-09-28 15:48:38 -0700151 repeated BroadcastRecordProto historical_broadcasts = 5;
152
153 message BroadcastSummary {
Yi Jinc7f93072017-09-29 15:29:38 -0700154 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 Jin129fc6c2017-09-28 15:48:38 -0700158 }
159 repeated BroadcastSummary historical_broadcasts_summary = 6;
160}
161
162message StickyBroadcastProto {
Yi Jinc7f93072017-09-29 15:29:38 -0700163 optional int32 user = 1;
Yi Jin129fc6c2017-09-28 15:48:38 -0700164
165 message StickyAction {
Yi Jinc7f93072017-09-29 15:29:38 -0700166 optional string name = 1;
Yi Jin129fc6c2017-09-28 15:48:38 -0700167 repeated .android.content.IntentProto intents = 2;
168 }
169 repeated StickyAction actions = 2;
170}
171
Yi Jin6b514142017-10-30 14:54:12 -0700172// "dumpsys activity --proto service"
173message 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 Jin129fc6c2017-09-28 15:48:38 -0700180}
181
Yi Jin6b514142017-10-30 14:54:12 -0700182// corresponds to ActivityManagerService.GrantUri Java class
183message GrantUriProto {
184 optional int32 source_user_id = 1;
185 optional string uri = 2;
186}
187
188message 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
196message UriPermissionOwnerProto {
197 optional string owner = 1;
198 repeated GrantUriProto read_perms = 2;
199 repeated GrantUriProto write_perms = 3;
200}
201
202message 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
278message 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
305message AppBindRecordProto {
306 optional string hex_hash = 1;
307 optional ProcessRecordProto client = 2;
308 repeated ConnectionRecordProto connections = 3;
309}
310
311message 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 Jin129fc6c2017-09-28 15:48:38 -0700325message ProcessProto {
Yi Jin129fc6c2017-09-28 15:48:38 -0700326}