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