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
17syntax = "proto2";
18
19package com.android.server.am;
20
21import "frameworks/base/core/proto/android/app/activitymanager.proto";
22import "frameworks/base/core/proto/android/app/enums.proto";
23import "frameworks/base/core/proto/android/app/notification.proto";
24import "frameworks/base/core/proto/android/app/profilerinfo.proto";
25import "frameworks/base/core/proto/android/content/component_name.proto";
26import "frameworks/base/core/proto/android/content/configuration.proto";
27import "frameworks/base/core/proto/android/content/intent.proto";
28import "frameworks/base/core/proto/android/content/package_item_info.proto";
29import "frameworks/base/core/proto/android/graphics/rect.proto";
30import "frameworks/base/core/proto/android/internal/processstats.proto";
31import "frameworks/base/core/proto/android/os/bundle.proto";
32import "frameworks/base/core/proto/android/os/looper.proto";
33import "frameworks/base/core/proto/android/os/powermanager.proto";
34import "frameworks/base/core/proto/android/server/intentresolver.proto";
35import "frameworks/base/core/proto/android/server/windowmanagerservice.proto";
36import "frameworks/base/core/proto/android/util/common.proto";
37import "frameworks/base/core/proto/android/privacy.proto";
38
39option java_multiple_files = true;
40
41message ActivityManagerServiceProto {
42    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
43
44    optional ActivityManagerServiceDumpActivitiesProto activities = 1;
45
46    optional ActivityManagerServiceDumpBroadcastsProto broadcasts = 2;
47
48    optional ActivityManagerServiceDumpServicesProto services = 3;
49
50    optional ActivityManagerServiceDumpProcessesProto processes = 4;
51}
52
53// "dumpsys activity --proto activities"
54message ActivityManagerServiceDumpActivitiesProto {
55    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
56
57    optional ActivityStackSupervisorProto activity_stack_supervisor = 1;
58}
59
60message ActivityStackSupervisorProto {
61    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
62
63    optional .com.android.server.wm.ConfigurationContainerProto configuration_container = 1;
64    repeated ActivityDisplayProto displays = 2;
65    optional KeyguardControllerProto keyguard_controller = 3;
66    // TODO(b/111541062): Focused stack and resumed activity are now per-display. Topmost instances
67    // can be obtained from top display and these fields can be removed.
68    optional int32 focused_stack_id = 4;
69    optional .com.android.server.wm.IdentifierProto resumed_activity = 5;
70    // Whether or not the home activity is the recents activity. This is needed for the CTS tests to
71    // know what activity types to check for when invoking splitscreen multi-window.
72    optional bool is_home_recents_component = 6;
73    repeated .com.android.server.wm.IdentifierProto pending_activities = 7;
74}
75
76/* represents ActivityStackSupervisor.ActivityDisplay */
77message ActivityDisplayProto {
78    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
79
80    optional .com.android.server.wm.ConfigurationContainerProto configuration_container = 1;
81    optional int32 id = 2;
82    repeated ActivityStackProto stacks = 3;
83    optional int32 focused_stack_id = 4;
84    optional .com.android.server.wm.IdentifierProto resumed_activity = 5;
85    optional bool single_task_instance = 6;
86}
87
88message ActivityStackProto {
89    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
90
91    optional .com.android.server.wm.ConfigurationContainerProto configuration_container = 1;
92    optional int32 id = 2;
93    repeated TaskRecordProto tasks = 3;
94    optional .com.android.server.wm.IdentifierProto resumed_activity = 4;
95    optional int32 display_id = 5;
96    optional bool fullscreen = 6;
97    optional .android.graphics.RectProto bounds = 7;
98}
99
100message TaskRecordProto {
101    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
102
103    optional .com.android.server.wm.ConfigurationContainerProto configuration_container = 1;
104    optional int32 id = 2;
105    repeated ActivityRecordProto activities = 3;
106    optional int32 stack_id = 4;
107    optional .android.graphics.RectProto last_non_fullscreen_bounds = 5;
108    optional string real_activity = 6;
109    optional string orig_activity = 7;
110    optional int32 activity_type = 8;
111    optional int32 resize_mode = 9;
112    optional bool fullscreen = 10;
113    optional .android.graphics.RectProto bounds = 11;
114    optional int32 min_width = 12;
115    optional int32 min_height = 13;
116}
117
118message ActivityRecordProto {
119    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
120
121    optional .com.android.server.wm.ConfigurationContainerProto configuration_container = 1;
122    optional .com.android.server.wm.IdentifierProto identifier = 2;
123    optional string state = 3;
124    optional bool visible = 4;
125    optional bool front_of_task = 5;
126    optional int32 proc_id = 6;
127    optional bool translucent = 7;
128}
129
130message KeyguardControllerProto {
131    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
132
133    optional bool keyguard_showing = 1;
134    repeated KeyguardOccludedProto keyguard_occluded_states= 2;
135    optional bool aod_showing = 3;
136}
137
138message KeyguardOccludedProto {
139    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
140
141    optional int32 display_id = 1;
142    optional bool keyguard_occluded = 2;
143}
144
145// "dumpsys activity --proto broadcasts"
146message ActivityManagerServiceDumpBroadcastsProto {
147    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
148
149    repeated ReceiverListProto receiver_list = 1;
150
151    optional .com.android.server.IntentResolverProto receiver_resolver = 2;
152
153    repeated BroadcastQueueProto broadcast_queue = 3;
154
155    repeated StickyBroadcastProto sticky_broadcasts = 4;
156
157    message MainHandler {
158        option (.android.msg_privacy).dest = DEST_AUTOMATIC;
159
160        optional string handler = 1;
161        optional .android.os.LooperProto looper = 2;
162    }
163    optional MainHandler handler = 5;
164}
165
166message ReceiverListProto {
167    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
168
169    optional ProcessRecordProto app = 1;
170    optional int32 pid = 2;
171    optional int32 uid = 3;
172    optional int32 user = 4;
173    optional BroadcastRecordProto current = 5;
174    optional bool linked_to_death = 6;
175    repeated BroadcastFilterProto filters = 7;
176    // Used to find this ReceiverList object in IntentResolver
177    optional string hex_hash = 8;
178}
179
180message ProcessRecordProto {
181    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
182
183    optional int32 pid = 1;
184    optional string process_name = 2;
185    optional int32 uid = 3;
186    optional int32 user_id = 4;
187    optional int32 app_id = 5;
188    optional int32 isolated_app_id = 6;
189    optional bool persistent = 7;
190    optional int32 lru_index = 8;
191}
192
193message BroadcastRecordProto {
194    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
195
196    optional int32 user_id = 1;
197    optional string intent_action = 2;
198}
199
200message BroadcastFilterProto {
201    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
202
203    optional .android.content.IntentFilterProto intent_filter = 1;
204    optional string required_permission = 2;
205    // Used to find the BroadcastFilter object in IntentResolver
206    optional string hex_hash = 3;
207    optional int32 owning_user_id = 4;
208}
209
210message BroadcastQueueProto {
211    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
212
213    optional string queue_name = 1;
214    repeated BroadcastRecordProto parallel_broadcasts = 2;
215    repeated BroadcastRecordProto ordered_broadcasts = 3;
216    optional BroadcastRecordProto pending_broadcast = 4;
217    repeated BroadcastRecordProto historical_broadcasts = 5;
218
219    message BroadcastSummary {
220        option (.android.msg_privacy).dest = DEST_AUTOMATIC;
221
222        optional .android.content.IntentProto intent = 1;
223        optional int64 enqueue_clock_time_ms = 2;
224        optional int64 dispatch_clock_time_ms = 3;
225        optional int64 finish_clock_time_ms = 4;
226    }
227    repeated BroadcastSummary historical_broadcasts_summary = 6;
228}
229
230message MemInfoDumpProto {
231    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
232
233    optional int64 uptime_duration_ms = 1;
234    optional int64 elapsed_realtime_ms = 2;
235
236    message ProcessMemory {
237        option (.android.msg_privacy).dest = DEST_AUTOMATIC;
238
239        optional int32 pid = 1;
240        optional string process_name = 2;
241
242        message MemoryInfo {
243            option (.android.msg_privacy).dest = DEST_AUTOMATIC;
244
245            optional string name = 1;
246            // The proportional set size for the heap.
247            optional int32 total_pss_kb = 2;
248            // The proportional set size that is swappable for the heap.
249            optional int32 clean_pss_kb = 3;
250            // The private dirty pages used by the heap.
251            optional int32 shared_dirty_kb = 4;
252            // The shared dirty pages used by the heap.
253            optional int32 private_dirty_kb = 5;
254            // The shared clean pages used by the heap.
255            optional int32 shared_clean_kb = 6;
256            // The private clean pages used by the heap.
257            optional int32 private_clean_kb = 7;
258            oneof dirty_swap {
259                // The dirty the pages that have been swapped out.
260                int32 dirty_swap_kb = 8;
261                // The dirty the pages that have been swapped out, proportional.
262                int32 dirty_swap_pss_kb = 9;
263            }
264        }
265        message HeapInfo {
266            option (.android.msg_privacy).dest = DEST_AUTOMATIC;
267
268            optional MemoryInfo mem_info = 1;
269            optional int32 heap_size_kb = 2;
270            optional int32 heap_alloc_kb = 3;
271            optional int32 heap_free_kb = 4;
272        }
273        optional HeapInfo native_heap = 3;
274        optional HeapInfo dalvik_heap = 4;
275        repeated MemoryInfo other_heaps = 5;
276        optional MemoryInfo unknown_heap = 6;
277        // Summation of native_heap, dalvik_heap, and other_heaps.
278        optional HeapInfo total_heap = 7;
279
280        repeated MemoryInfo dalvik_details = 8;
281
282        message AppSummary {
283            option (.android.msg_privacy).dest = DEST_AUTOMATIC;
284
285            optional int32 java_heap_pss_kb = 1;
286            optional int32 native_heap_pss_kb = 2;
287            optional int32 code_pss_kb = 3;
288            optional int32 stack_pss_kb = 4;
289            optional int32 graphics_pss_kb = 5;
290            optional int32 private_other_pss_kb = 6;
291            optional int32 system_pss_kb = 7;
292
293            oneof total_swap {
294                int32 total_swap_pss = 8;
295                int32 total_swap_kb = 9;
296            }
297        }
298        optional AppSummary app_summary = 9;
299    }
300    repeated ProcessMemory native_processes = 3;
301
302    message AppData {
303        option (.android.msg_privacy).dest = DEST_AUTOMATIC;
304
305        optional ProcessMemory process_memory = 1;
306
307        message ObjectStats {
308            option (.android.msg_privacy).dest = DEST_AUTOMATIC;
309
310            optional int32 view_instance_count = 1;
311            optional int32 view_root_instance_count = 2;
312            optional int32 app_context_instance_count = 3;
313            optional int32 activity_instance_count = 4;
314            optional int32 global_asset_count = 5;
315            optional int32 global_asset_manager_count = 6;
316            optional int32 local_binder_object_count = 7;
317            optional int32 proxy_binder_object_count = 8;
318            optional int64 parcel_memory_kb = 9;
319            optional int32 parcel_count = 10;
320            optional int32 binder_object_death_count = 11;
321            optional int32 open_ssl_socket_count = 12;
322            optional int32 webview_instance_count = 13;
323        }
324        optional ObjectStats objects = 2;
325
326        message SqlStats {
327            option (.android.msg_privacy).dest = DEST_AUTOMATIC;
328
329            optional int32 memory_used_kb = 1;
330            optional int32 pagecache_overflow_kb = 2;
331            optional int32 malloc_size_kb = 3;
332
333            message Database {
334                option (.android.msg_privacy).dest = DEST_AUTOMATIC;
335
336                optional string name = 1;
337                optional int32 page_size = 2;
338                optional int32 db_size = 3;
339                // Number of lookaside slots:
340                // http://www.sqlite.org/c3ref/c_dbstatus_lookaside_used.html
341                optional int32 lookaside_b = 4;
342                // Statement cache stats: hits/misses/cachesize
343                optional string cache = 5;
344            }
345            repeated Database databases = 4;
346        }
347        optional SqlStats sql = 3;
348
349        optional string asset_allocations = 4;
350        optional string unreachable_memory = 5;
351    }
352    repeated AppData app_processes = 4;
353
354    message MemItem {
355        option (.android.msg_privacy).dest = DEST_AUTOMATIC;
356
357        optional string tag = 1;
358        optional string label = 2;
359        optional int32 id = 3;
360        optional bool is_proc = 4;
361        optional bool has_activities = 5;
362        optional int64 pss_kb = 6;
363        optional int64 swap_pss_kb = 7;
364        repeated MemItem sub_items = 8;
365    }
366    repeated MemItem total_pss_by_process = 5;
367    repeated MemItem total_pss_by_oom_adjustment = 6;
368    repeated MemItem total_pss_by_category = 7;
369
370    optional int64 total_ram_kb = 8;
371    optional .com.android.internal.app.procstats.ProcessStatsProto.MemoryFactor status = 9;
372    // Total free RAM = cached_pss_kb + cached_kernel_kb + free_kb.
373    optional int64 cached_pss_kb = 10;
374    optional int64 cached_kernel_kb = 11;
375    optional int64 free_kb = 12;
376    // Total used RAM = used_pss_kb + used_kernel_kb.
377    optional int64 used_pss_kb = 13;
378    optional int64 used_kernel_kb = 14;
379
380    optional int64 lost_ram_kb = 15;
381
382    optional int64 total_zram_kb = 16;
383    optional int64 zram_physical_used_in_swap_kb = 17;
384    optional int64 total_zram_swap_kb = 18;
385
386    optional int64 ksm_sharing_kb = 19;
387    optional int64 ksm_shared_kb = 20;
388    optional int64 ksm_unshared_kb = 21;
389    optional int64 ksm_volatile_kb = 22;
390
391    // The approximate per-application memory class of the current device. This
392    // gives developers an idea of how hard a memory limit you should impose on
393    // their application to let the overall system work best. The value is in
394    // megabytes; the baseline Android memory class is 16 (which happens to be the
395    // Java heap limit of those devices); some devices with more memory may have
396    // 24 or even higher numbers.
397    optional int32 tuning_mb = 23;
398    // The approximate per-application memory class of the current device when an
399    // application is running with a large heap. This is the space available for
400    // memory-intensive applications; most applications should not need this
401    // amount of memory, and should instead stay with the tuning_mb limit. The
402    // value is in megabytes. This may be the same size as tuning_mb on memory
403    // constrained devices, or it may be significantly larger on devices with a
404    // large amount of available RAM.
405    // This is the size of the application's Dalvik heap if it has specified
406    // 'android:largeHeap="true"' in its manifest.
407    optional int32 tuning_large_mb = 24;
408
409    optional int64 oom_kb = 25;
410
411    // The maximum pss size in kb that we consider a process acceptable to restore
412    // from its cached state for running in the background when RAM is low.
413    optional int64 restore_limit_kb = 26;
414
415    optional bool is_low_ram_device = 27;
416    optional bool is_high_end_gfx = 28;
417}
418
419message StickyBroadcastProto {
420    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
421
422    optional int32 user = 1;
423
424    message StickyAction {
425        option (.android.msg_privacy).dest = DEST_AUTOMATIC;
426
427        // The action of the sticky Intent.
428        optional string name = 1;
429        repeated .android.content.IntentProto intents = 2;
430    }
431    repeated StickyAction actions = 2;
432}
433
434// "dumpsys activity --proto service"
435message ActivityManagerServiceDumpServicesProto {
436    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
437
438    optional ActiveServicesProto active_services = 1;
439}
440
441message ActiveServicesProto {
442    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
443
444    message ServicesByUser {
445        option (.android.msg_privacy).dest = DEST_AUTOMATIC;
446
447        optional int32 user_id = 1;
448        repeated ServiceRecordProto service_records = 2;
449    }
450    repeated ServicesByUser services_by_users = 1;
451}
452
453// corresponds to ActivityManagerService.GrantUri Java class
454message GrantUriProto {
455    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
456
457    optional int32 source_user_id = 1;
458    optional string uri = 2 [ (.android.privacy).dest = DEST_EXPLICIT ];
459}
460
461message NeededUriGrantsProto {
462    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
463
464    optional string target_package = 1;
465    optional int32 target_uid = 2;
466    optional int32 flags = 3;
467
468    repeated GrantUriProto grants = 4;
469}
470
471message UriPermissionOwnerProto {
472    option (.android.msg_privacy).dest = DEST_EXPLICIT;
473
474    optional string owner = 1;
475    repeated GrantUriProto read_perms = 2;
476    repeated GrantUriProto write_perms = 3;
477}
478
479message ServiceRecordProto {
480    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
481
482    optional string short_name = 1;
483    optional bool is_running = 2; // false if the application service is null
484    optional int32 pid = 3;
485    optional .android.content.IntentProto intent = 4;
486    optional string package_name = 5;
487    optional string process_name = 6;
488    optional string permission = 7;
489
490    message AppInfo {
491        option (.android.msg_privacy).dest = DEST_EXPLICIT;
492
493        optional string base_dir = 1;
494        optional string res_dir = 2;
495        optional string data_dir = 3;
496    }
497    optional AppInfo appinfo = 8;
498    optional ProcessRecordProto app = 9;
499    optional ProcessRecordProto isolated_proc = 10;
500    optional bool whitelist_manager = 11;
501    optional bool delayed = 12;
502
503    message Foreground {
504        option (.android.msg_privacy).dest = DEST_AUTOMATIC;
505
506        optional int32 id = 1;
507        optional .android.app.NotificationProto notification = 2;
508    }
509    optional Foreground foreground = 13;
510
511    optional .android.util.Duration create_real_time = 14;
512    optional .android.util.Duration starting_bg_timeout = 15;
513    optional .android.util.Duration last_activity_time = 16;
514    optional .android.util.Duration restart_time = 17;
515    optional bool created_from_fg = 18;
516
517    // variables used to track states related to service start
518    message Start {
519        option (.android.msg_privacy).dest = DEST_AUTOMATIC;
520
521        optional bool start_requested = 1;
522        optional bool delayed_stop = 2;
523        optional bool stop_if_killed = 3;
524        optional bool call_start = 4;
525        optional int32 last_start_id = 5;
526    }
527    optional Start start = 19;
528
529    message ExecuteNesting {
530        option (.android.msg_privacy).dest = DEST_AUTOMATIC;
531
532        optional int32 execute_nesting = 1;
533        optional bool execute_fg = 2;
534        optional .android.util.Duration executing_start = 3;
535    }
536    optional ExecuteNesting execute = 20;
537
538    optional .android.util.Duration destory_time = 21;
539
540    message Crash {
541        option (.android.msg_privacy).dest = DEST_AUTOMATIC;
542
543        optional int32 restart_count = 1;
544        optional .android.util.Duration restart_delay = 2;
545        optional .android.util.Duration next_restart_time = 3;
546        optional int32 crash_count = 4;
547    }
548    optional Crash crash = 22;
549
550    message StartItem {
551        option (.android.msg_privacy).dest = DEST_AUTOMATIC;
552
553        optional int32 id = 1;
554        optional .android.util.Duration duration = 2;
555        optional int32 delivery_count = 3;
556        optional int32 done_executing_count = 4;
557        optional .android.content.IntentProto intent = 5;
558        optional NeededUriGrantsProto needed_grants = 6;
559        optional UriPermissionOwnerProto uri_permissions = 7;
560    }
561    repeated StartItem delivered_starts = 23;
562    repeated StartItem pending_starts = 24;
563
564    repeated IntentBindRecordProto bindings = 25;
565    repeated ConnectionRecordProto connections = 26;
566
567    // Next Tag: 27
568}
569
570message ConnectionRecordProto {
571    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
572
573    // Used to find same record, e.g. AppBindRecord has the hex_hash
574    optional string hex_hash = 1; // cross reference the object and avoid double logging.
575    optional int32 user_id = 2;
576
577    enum Flag {
578        AUTO_CREATE = 0;
579        DEBUG_UNBIND = 1;
580        NOT_FG = 2;
581        IMPORTANT_BG = 3;
582        ABOVE_CLIENT = 4;
583        ALLOW_OOM_MANAGEMENT = 5;
584        WAIVE_PRIORITY = 6;
585        IMPORTANT = 7;
586        ADJUST_WITH_ACTIVITY = 8;
587        FG_SERVICE_WHILE_AWAKE = 9;
588        FG_SERVICE = 10;
589        TREAT_LIKE_ACTIVITY = 11;
590        VISIBLE = 12;
591        SHOWING_UI = 13;
592        NOT_VISIBLE = 14;
593        DEAD = 15;
594        NOT_PERCEPTIBLE = 16;
595        INCLUDE_CAPABILITIES = 17;
596    }
597    repeated Flag flags = 3;
598    optional string service_name = 4;
599}
600
601message AppBindRecordProto {
602    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
603
604    optional string service_name = 1;
605    optional string client_proc_name = 2;
606    repeated string connections = 3; // hex_hash of ConnectionRecordProto
607}
608
609message IntentBindRecordProto {
610    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
611
612    optional .android.content.IntentProto intent = 1;
613    optional string binder = 2;
614    optional bool auto_create = 3; // value of BIND_AUTO_CREATE flag.
615    optional bool requested = 4;
616    optional bool received = 5;
617    optional bool has_bound = 6;
618    optional bool do_rebind = 7;
619
620    repeated AppBindRecordProto apps = 8;
621}
622
623// TODO: "dumpsys activity --proto processes"
624message ActivityManagerServiceDumpProcessesProto {
625    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
626
627    repeated ProcessRecordProto procs = 1;
628    repeated ProcessRecordProto isolated_procs = 2;
629    repeated ActiveInstrumentationProto active_instrumentations = 3;
630    repeated UidRecordProto active_uids = 4;
631    repeated UidRecordProto validate_uids = 5;
632
633    // Process LRU list (sorted by oom_adj)
634    message LruProcesses {
635        option (.android.msg_privacy).dest = DEST_AUTOMATIC;
636
637        optional int32 size = 1;
638        optional int32 non_act_at = 2;
639        optional int32 non_svc_at = 3;
640        repeated ProcessOomProto list = 4;
641    }
642    optional LruProcesses lru_procs = 6;
643    repeated ProcessRecordProto pids_self_locked = 7;
644    // Foreground Processes
645    repeated ImportanceTokenProto important_procs = 8;
646    // Persisent processes that are starting
647    repeated ProcessRecordProto persistent_starting_procs = 9;
648    // Processes that are being removed
649    repeated ProcessRecordProto removed_procs = 10;
650    // Processes that are on old until the system is ready
651    repeated ProcessRecordProto on_hold_procs = 11;
652    // Processes that are waiting to GC
653    repeated ProcessToGcProto gc_procs = 12;
654    optional AppErrorsProto app_errors = 13;
655    optional UserControllerProto user_controller = 14;
656    optional ProcessRecordProto home_proc = 15;
657    optional ProcessRecordProto previous_proc = 16;
658    optional int64 previous_proc_visible_time_ms = 17;
659    optional ProcessRecordProto heavy_weight_proc = 18;
660    optional .android.content.ConfigurationProto global_configuration = 19;
661    // ActivityStackSupervisorProto dumps these values as well, still here?
662    // repeated ActivityDisplayProto displays = 20;
663
664    optional bool config_will_change = 21;
665
666    message ScreenCompatPackage {
667        option (.android.msg_privacy).dest = DEST_AUTOMATIC;
668
669        optional string package = 1;
670        optional int32 mode = 2;
671    }
672    repeated ScreenCompatPackage screen_compat_packages = 22;
673
674    message UidObserverRegistrationProto {
675        option (.android.msg_privacy).dest = DEST_AUTOMATIC;
676
677        optional int32 uid = 1;
678        optional string package = 2;
679        repeated .android.app.UidObserverFlag flags = 3;
680        optional int32 cut_point = 4; // only available when UID_OBSERVER_PROCSTATE is on
681
682        message ProcState {
683            option (.android.msg_privacy).dest = DEST_AUTOMATIC;
684
685            optional int32 uid = 1;
686            optional int32 state = 2;
687        }
688        repeated ProcState last_proc_states = 5;
689    }
690    repeated UidObserverRegistrationProto uid_observers = 23;
691    repeated int32 device_idle_whitelist = 24;
692    repeated int32 device_idle_temp_whitelist = 25;
693
694    message PendingTempWhitelist {
695        option (.android.msg_privacy).dest = DEST_AUTOMATIC;
696
697        optional int32 target_uid = 1;
698        optional int64 duration_ms = 2;
699        optional string tag = 3;
700    }
701    repeated PendingTempWhitelist pending_temp_whitelist = 26;
702
703    message SleepStatus {
704        option (.android.msg_privacy).dest = DEST_AUTOMATIC;
705
706        optional .android.os.PowerManagerInternalProto.Wakefulness wakefulness = 1;
707        repeated string sleep_tokens = 2 [ (.android.privacy).dest = DEST_EXPLICIT ];
708        optional bool sleeping = 3;
709        optional bool shutting_down = 4;
710        optional bool test_pss_mode = 5;
711    }
712    optional SleepStatus sleep_status = 27;
713
714    message Voice {
715        option (.android.msg_privacy).dest = DEST_AUTOMATIC;
716
717        optional string session = 1;
718        optional .android.os.PowerManagerProto.WakeLock wakelock = 2;
719    }
720    optional Voice running_voice = 28;
721
722    optional VrControllerProto vr_controller = 29;
723
724    message DebugApp {
725        option (.android.msg_privacy).dest = DEST_AUTOMATIC;
726
727        optional string debug_app = 1;
728        optional string orig_debug_app = 2;
729        optional bool debug_transient = 3;
730        optional bool orig_wait_for_debugger = 4;
731    }
732    optional DebugApp debug = 30;
733    optional AppTimeTrackerProto current_tracker = 31;
734
735    message MemWatchProcess {
736        option (.android.msg_privacy).dest = DEST_AUTOMATIC;
737
738        message Process {
739            option (.android.msg_privacy).dest = DEST_AUTOMATIC;
740
741            optional string name = 1;
742
743            message MemStats {
744                option (.android.msg_privacy).dest = DEST_AUTOMATIC;
745
746                optional int32 uid = 1;
747                optional string size = 2;
748                optional string report_to = 3;
749            }
750            repeated MemStats mem_stats = 2;
751        }
752        repeated Process procs = 1;
753
754        message Dump {
755            option (.android.msg_privacy).dest = DEST_AUTOMATIC;
756
757            optional string proc_name = 1;
758            optional string file = 2 [ (.android.privacy).dest = DEST_EXPLICIT ];
759            optional int32 pid = 3;
760            optional int32 uid = 4;
761            optional bool is_user_initiated = 5;
762        }
763        optional Dump dump = 2;
764    }
765    optional MemWatchProcess mem_watch_processes = 32;
766    optional string track_allocation_app = 33;
767
768    message Profile {
769        option (.android.msg_privacy).dest = DEST_AUTOMATIC;
770
771        optional string app_name = 1;
772        optional ProcessRecordProto proc = 2;
773        optional .android.app.ProfilerInfoProto info = 3;
774        optional int32 type = 4;
775    }
776    optional Profile profile = 34;
777    optional string native_debugging_app = 35;
778    optional bool always_finish_activities = 36;
779
780    message Controller {
781        option (.android.msg_privacy).dest = DEST_AUTOMATIC;
782
783        optional string controller = 1;
784        optional bool is_a_monkey = 2;
785    }
786    optional Controller controller = 37;
787
788    optional int32 total_persistent_procs = 38;
789    optional bool processes_ready = 39;
790    optional bool system_ready = 40;
791    optional bool booted = 41;
792    optional int32 factory_test = 42;
793    optional bool booting = 43;
794    optional bool call_finish_booting = 44;
795    optional bool boot_animation_complete = 45;
796    optional int64 last_power_check_uptime_ms = 46;
797    optional .android.os.PowerManagerProto.WakeLock going_to_sleep = 47;
798    optional .android.os.PowerManagerProto.WakeLock launching_activity = 48;
799    optional int32 adj_seq = 49;
800    optional int32 lru_seq = 50;
801    optional int32 num_non_cached_procs = 51;
802    optional int32 num_cached_hidden_procs = 52;
803    optional int32 num_service_procs = 53;
804    optional int32 new_num_service_procs = 54;
805    optional bool allow_lower_mem_level = 55;
806    optional int32 last_memory_level = 56;
807    optional int32 last_num_processes = 57;
808    optional .android.util.Duration last_idle_time = 58;
809    optional int64 low_ram_since_last_idle_ms = 59;
810}
811
812message ActiveInstrumentationProto {
813    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
814
815    optional .android.content.ComponentNameProto class = 1;
816    optional bool finished = 2;
817    repeated ProcessRecordProto running_processes = 3;
818    repeated string target_processes = 4;
819    optional .android.content.pm.ApplicationInfoProto target_info = 5;
820    optional string profile_file = 6;
821    optional string watcher = 7;
822    optional string ui_automation_connection = 8;
823    // Arguments as given to the ActiveInstrumentation object in Bundle
824    // toString format.
825    reserved 9; // arguments (in String format).
826    // Arguments as given to the ActiveInstrumentation object.
827    optional .android.os.BundleProto arguments = 10;
828}
829
830// Proto definition of com.android.server.am.UidRecord.java
831message UidRecordProto {
832    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
833
834    optional int32 uid = 1;
835    optional .android.app.ProcessStateEnum current = 2;
836    optional bool ephemeral = 3;
837    optional bool fg_services = 4;
838    optional bool whilelist = 5;
839    optional .android.util.Duration last_background_time = 6;
840    optional bool idle = 7;
841
842    enum Change {
843        CHANGE_GONE = 0;
844        CHANGE_IDLE = 1;
845        CHANGE_ACTIVE = 2;
846        CHANGE_CACHED = 3;
847        CHANGE_UNCACHED = 4;
848    }
849    repeated Change last_reported_changes = 8;
850    optional int32 num_procs = 9;
851
852    message ProcStateSequence {
853        option (.android.msg_privacy).dest = DEST_AUTOMATIC;
854
855        optional int64 cururent = 1;
856        optional int64 last_network_updated = 2;
857        optional int64 last_dispatched = 3;
858    }
859    optional ProcStateSequence network_state_update = 10;
860
861    // Next Tag: 11
862}
863
864// proto of class ImportanceToken in ActivityManagerService
865message ImportanceTokenProto {
866    option (.android.msg_privacy).dest = DEST_EXPLICIT;
867
868    optional int32 pid = 1;
869    optional string token = 2;
870    optional string reason = 3;
871}
872
873// proto of class VrController.java
874message VrControllerProto {
875    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
876
877    enum VrMode {
878        FLAG_NON_VR_MODE = 0;
879        FLAG_VR_MODE = 1;
880        FLAG_PERSISTENT_VR_MODE = 2;
881    }
882    repeated VrMode vr_mode = 1;
883    optional int32 render_thread_id = 2;
884}
885
886message ProcessOomProto {
887    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
888
889    optional bool persistent = 1;
890    optional int32 num = 2;
891    optional string oom_adj = 3;
892
893    // Activity manager's version of Process enum, see ProcessList.java
894    enum SchedGroup {
895        SCHED_GROUP_UNKNOWN = -1;
896        SCHED_GROUP_BACKGROUND = 0;
897        SCHED_GROUP_DEFAULT = 1;
898        SCHED_GROUP_TOP_APP = 2;
899        SCHED_GROUP_TOP_APP_BOUND = 3;
900    }
901    optional SchedGroup sched_group = 4 [ default = SCHED_GROUP_UNKNOWN];
902
903    oneof Foreground {
904        bool activities = 5;
905        bool services = 6;
906    }
907
908    optional .android.app.ProcessStateEnum state = 7;
909    optional int32 trim_memory_level = 8;
910    optional ProcessRecordProto proc = 9;
911    optional string adj_type = 10;
912
913    oneof AdjTarget {
914        .android.content.ComponentNameProto adj_target_component_name = 11;
915        string adj_target_object = 12;
916    }
917
918    oneof AdjSource {
919        ProcessRecordProto adj_source_proc = 13;
920        string adj_source_object = 14;
921    }
922
923    message Detail {
924        option (.android.msg_privacy).dest = DEST_AUTOMATIC;
925
926        optional int32 max_adj = 1;
927        optional int32 cur_raw_adj = 2;
928        optional int32 set_raw_adj = 3;
929        optional int32 cur_adj = 4;
930        optional int32 set_adj = 5;
931        optional .android.app.ProcessStateEnum current_state = 7;
932        optional .android.app.ProcessStateEnum set_state = 8;
933        optional string last_pss = 9;
934        optional string last_swap_pss = 10;
935        optional string last_cached_pss = 11;
936        optional bool cached = 12;
937        optional bool empty = 13;
938        optional bool has_above_client = 14;
939
940        // only make sense if process is a service
941        message CpuRunTime {
942            option (.android.msg_privacy).dest = DEST_AUTOMATIC;
943
944            optional int64 over_ms = 1;
945            optional int64 used_ms = 2;
946            optional float ultilization = 3; // ratio of cpu time usage
947        }
948        optional CpuRunTime service_run_time = 15;
949    }
950    optional Detail detail = 15;
951}
952
953message ProcessToGcProto {
954    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
955
956    optional ProcessRecordProto proc = 1;
957    optional bool report_low_memory = 2;
958    optional int64 now_uptime_ms = 3;
959    optional int64 last_gced_ms = 4;
960    optional int64 last_low_memory_ms = 5;
961}
962
963// sync with com.android.server.am.AppErrors.java
964message AppErrorsProto {
965    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
966
967    optional int64 now_uptime_ms = 1;
968
969    message ProcessCrashTime {
970        option (.android.msg_privacy).dest = DEST_AUTOMATIC;
971
972        optional string process_name = 1;
973
974        message Entry {
975            option (.android.msg_privacy).dest = DEST_AUTOMATIC;
976
977            optional int32 uid = 1;
978            optional int64 last_crashed_at_ms = 2;
979        }
980        repeated Entry entries = 2;
981    }
982    repeated ProcessCrashTime process_crash_times = 2;
983
984    message BadProcess {
985        option (.android.msg_privacy).dest = DEST_AUTOMATIC;
986
987        optional string process_name = 1;
988
989        message Entry {
990            option (.android.msg_privacy).dest = DEST_AUTOMATIC;
991
992            optional int32 uid = 1;
993            optional int64 crashed_at_ms = 2;
994            optional string short_msg = 3;
995            optional string long_msg = 4 [ (.android.privacy).dest = DEST_EXPLICIT ];
996            optional string stack = 5 [ (.android.privacy).dest = DEST_EXPLICIT ];
997        }
998        repeated Entry entries = 2;
999    }
1000    repeated BadProcess bad_processes = 3;
1001}
1002
1003// sync with com.android.server.am.UserState.java
1004message UserStateProto {
1005    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
1006
1007    enum State {
1008        STATE_BOOTING = 0;
1009        STATE_RUNNING_LOCKED = 1;
1010        STATE_RUNNING_UNLOCKING = 2;
1011        STATE_RUNNING_UNLOCKED = 3;
1012        STATE_STOPPING = 4;
1013        STATE_SHUTDOWN = 5;
1014    }
1015    optional State state = 1;
1016    optional bool switching = 2;
1017}
1018
1019// sync with com.android.server.am.UserController.java
1020message UserControllerProto {
1021    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
1022
1023    message User {
1024        option (.android.msg_privacy).dest = DEST_AUTOMATIC;
1025
1026        optional int32 id = 1;
1027        optional UserStateProto state = 2;
1028    }
1029    repeated User started_users = 1;
1030    repeated int32 started_user_array = 2;
1031    repeated int32 user_lru = 3;
1032
1033    message UserProfile {
1034        option (.android.msg_privacy).dest = DEST_AUTOMATIC;
1035
1036        optional int32 user = 1;
1037        optional int32 profile = 2;
1038    }
1039    repeated UserProfile user_profile_group_ids = 4;
1040}
1041
1042// sync with com.android.server.am.AppTimeTracker.java
1043message AppTimeTrackerProto {
1044    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
1045
1046    optional string receiver = 1;
1047    optional int64 total_duration_ms = 2;
1048
1049    message PackageTime {
1050        option (.android.msg_privacy).dest = DEST_AUTOMATIC;
1051
1052        optional string package = 1;
1053        optional int64 duration_ms = 2;
1054    }
1055    repeated PackageTime package_times = 3;
1056
1057    optional .android.util.Duration started_time = 4;
1058    optional string started_package = 5;
1059}
1060