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