summaryrefslogtreecommitdiff
path: root/core/proto/android/os/incident.proto
blob: 57026d95ceb81a6028758f9782a616bda2174729 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
/*
 * Copyright (C) 2016 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

syntax = "proto2";
option java_multiple_files = true;

import "frameworks/base/core/proto/android/nfc/nfc_service.proto";
import "frameworks/base/core/proto/android/os/backtrace.proto";
import "frameworks/base/core/proto/android/os/batterytype.proto";
import "frameworks/base/core/proto/android/os/cpufreq.proto";
import "frameworks/base/core/proto/android/os/cpuinfo.proto";
import "frameworks/base/core/proto/android/os/cpu_usage.proto";
import "frameworks/base/core/proto/android/os/data.proto";
import "frameworks/base/core/proto/android/os/header.proto";
import "frameworks/base/core/proto/android/os/kernelwake.proto";
import "frameworks/base/core/proto/android/os/metadata.proto";
import "frameworks/base/core/proto/android/os/pagetypeinfo.proto";
import "frameworks/base/core/proto/android/os/procrank.proto";
import "frameworks/base/core/proto/android/os/ps.proto";
import "frameworks/base/core/proto/android/os/statsdata.proto";
import "frameworks/base/core/proto/android/os/system_properties.proto";
import "frameworks/base/core/proto/android/providers/settings.proto";
import "frameworks/base/core/proto/android/server/activitymanagerservice.proto";
import "frameworks/base/core/proto/android/server/alarm/alarmmanagerservice.proto";
import "frameworks/base/core/proto/android/server/bluetooth_manager_service.proto";
import "frameworks/base/core/proto/android/server/fingerprint.proto";
import "frameworks/base/core/proto/android/server/jobscheduler.proto";
import "frameworks/base/core/proto/android/server/location/context_hub.proto";
import "frameworks/base/core/proto/android/server/powermanagerservice.proto";
import "frameworks/base/core/proto/android/server/powerstatsservice.proto";
import "frameworks/base/core/proto/android/server/windowmanagerservice.proto";
import "frameworks/base/core/proto/android/service/appwidget.proto";
import "frameworks/base/core/proto/android/service/battery.proto";
import "frameworks/base/core/proto/android/service/batterystats.proto";
import "frameworks/base/core/proto/android/service/diskstats.proto";
import "frameworks/base/core/proto/android/service/dropbox.proto";
import "frameworks/base/core/proto/android/service/graphicsstats.proto";
import "frameworks/base/core/proto/android/service/notification.proto";
import "frameworks/base/core/proto/android/service/package.proto";
import "frameworks/base/core/proto/android/service/print.proto";
import "frameworks/base/core/proto/android/service/procstats.proto";
import "frameworks/base/core/proto/android/service/restricted_image.proto";
import "frameworks/base/core/proto/android/service/sensor_service.proto";
import "frameworks/base/core/proto/android/service/usb.proto";
import "frameworks/base/core/proto/android/util/event_log_tags.proto";
import "frameworks/base/core/proto/android/util/log.proto";
import "frameworks/base/core/proto/android/util/textdump.proto";
import "frameworks/base/core/proto/android/privacy.proto";
import "frameworks/base/core/proto/android/section.proto";
import "frameworks/base/proto/src/ipconnectivity.proto";
import "packages/modules/Connectivity/framework/proto/netstats.proto";
import "packages/modules/Permission/service/proto/role_service.proto";

package android.os;

// Privacy tag can be marked to override UNSET messages so generic
// message type can be handled case by case, e.g. GZippedFileProto.
message IncidentProto {
    reserved 1001;

    // Incident header from callers
    repeated IncidentHeaderProto header = 1;
    // Internal metadata of incidentd
    optional IncidentMetadata metadata = 2;

    // Device information
    optional SystemPropertiesProto system_properties = 1000 [
        (section).type = SECTION_COMMAND,
        (section).args = "getprop"
    ];

    optional string kernel_version = 1002 [
        (section).type = SECTION_FILE,
        (section).args = "/proc/version",
        (privacy).dest = DEST_AUTOMATIC
    ];

    // Device Logs
    optional android.util.EventLogTagMapProto event_log_tag_map = 1100 [
        (section).type = SECTION_FILE,
        (section).args = "/system/etc/event-log-tags"
    ];

    optional android.util.LogProto main_logs = 1101 [
        (section).type = SECTION_LOG,
        (section).args = "main"
    ];

    optional android.util.LogProto radio_logs = 1102 [
        (section).type = SECTION_LOG,
        (section).args = "radio"
    ];

    optional android.util.LogProto events_logs = 1103 [
        (section).type = SECTION_LOG,
        (section).args = "events"
    ];

    optional android.util.LogProto system_logs = 1104 [
        (section).type = SECTION_LOG,
        (section).args = "system"
    ];

    optional android.util.LogProto crash_logs = 1105 [
        (section).type = SECTION_LOG,
        (section).args = "crash"
    ];

    optional android.util.LogProto stats_logs = 1106 [
        (section).type = SECTION_LOG,
        (section).args = "stats"
    ];

    optional android.util.LogProto security_logs = 1107 [
        (section).type = SECTION_LOG,
        (section).args = "security"
    ];

    optional android.util.LogProto kernel_logs = 1108 [
        (section).type = SECTION_LOG,
        (section).args = "kernel"
    ];

    // Last logcat sections.
    // Note that kernel logs is not persisted since it's contained in last kmsg.
    optional android.util.LogProto last_main_logs = 1109 [
        (section).type = SECTION_LOG,
        (section).args = "main -L"
    ];

    optional android.util.LogProto last_radio_logs = 1110 [
        (section).type = SECTION_LOG,
        (section).args = "radio -L"
    ];

    optional android.util.LogProto last_events_logs = 1111 [
        (section).type = SECTION_LOG,
        (section).args = "events -L"
    ];

    optional android.util.LogProto last_system_logs = 1112 [
        (section).type = SECTION_LOG,
        (section).args = "system -L"
    ];

    optional android.util.LogProto last_crash_logs = 1113 [
        (section).type = SECTION_LOG,
        (section).args = "crash -L"
    ];

    optional android.util.LogProto last_stats_logs = 1114 [
        (section).type = SECTION_LOG,
        (section).args = "stats -L"
    ];

    // security logs is only available with "Device Owner" mode
    optional android.util.LogProto last_security_logs = 1115 [
        (section).type = SECTION_LOG,
        (section).args = "security -L"
    ];

    optional android.util.PersistedLogProto persisted_logs = 1116 [
        (section).type = SECTION_COMMAND,
        (section).args = "/system/bin/sh /system/bin/incident-helper-cmd -l run persisted_logs --limit 10MB"
    ];

    // Stack dumps
    optional android.os.BackTraceProto native_traces = 1200 [
        (section).type = SECTION_TOMBSTONE,
        (section).args = "native"
    ];

    optional android.os.BackTraceProto hal_traces = 1201 [
        (section).type = SECTION_TOMBSTONE,
        (section).args = "hal"
    ];

    optional android.os.BackTraceProto java_traces = 1202 [
        (section).type = SECTION_TOMBSTONE,
        (section).args = "java"
    ];

    // Linux services
    optional ProcrankProto procrank = 2000 [
        // Disable procrank for reasons below:
        // 1. incidentd can't execute `procrank` because it don't have DAC perms
        //    since it is running as its own uid, no root access.
        // 2. the same information is able to be accessed by meminfo dumpsys.
        // 3. leave this one here to show case of how to disable a section
        //    (no removal allowed if you are familiar with PROTOBUF).
        (section).type = SECTION_NONE,
        (section).args = "procrank"
    ];

    optional PageTypeInfoProto page_type_info = 2001 [
        (section).type = SECTION_FILE,
        (section).args = "/proc/pagetypeinfo"
    ];

    optional KernelWakeSourcesProto kernel_wake_sources = 2002 [
        (section).type = SECTION_FILE,
        (section).args = "/d/wakeup_sources"
    ];

    optional CpuInfoProto cpu_info = 2003 [
        (section).type = SECTION_COMMAND,
        (section).args = "top -b -n 1 -H -s 6 -o pid,tid,user,pr,ni,%cpu,s,virt,res,pcy,cmd,name"
    ];

    optional CpuFreqProto cpu_freq = 2004 [
        (section).type = SECTION_FILE,
        (section).args = "/sys/devices/system/cpu/cpufreq/all_time_in_state"
    ];

    optional PsProto processes_and_threads = 2005 [
        (section).type = SECTION_COMMAND,
        (section).args = "ps -A -T -Z -O pri,nice,rtprio,sched,pcy,time"
    ];

    optional BatteryTypeProto battery_type = 2006 [
        (section).type = SECTION_FILE,
        (section).args = "/sys/class/power_supply/bms/battery_type"
    ];

    optional GZippedFileProto last_kmsg = 2007 [
        (section).type = SECTION_GZIP,
        (section).args = "/sys/fs/pstore/console-ramoops /sys/fs/pstore/console-ramoops-0 /proc/last_kmsg",
        (privacy).dest = DEST_EXPLICIT
    ];

    // System Services
    optional com.android.server.biometrics.fingerprint.FingerprintServiceDumpProto fingerprint = 3000 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "fingerprint --proto --incident"
    ];

    optional android.service.NetworkStatsServiceDumpProto netstats = 3001 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "netstats --proto",
        (section).userdebug_and_eng_only = true
    ];

    optional android.providers.settings.SettingsServiceDumpProto settings = 3002 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "settings --proto"
    ];

    optional android.service.appwidget.AppWidgetServiceDumpProto appwidget = 3003;
    optional android.service.notification.NotificationServiceDumpProto notification = 3004 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "notification --proto"
    ];

    optional android.service.batterystats.BatteryStatsServiceDumpProto batterystats = 3005 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "batterystats --proto"
    ];

    optional android.service.battery.BatteryServiceDumpProto battery = 3006 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "battery --proto"
    ];

    optional android.service.diskstats.DiskStatsServiceDumpProto diskstats = 3007 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "diskstats --proto"
    ];

    optional android.service.pm.PackageServiceDumpProto package = 3008 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "package --proto"
    ];

    optional com.android.server.power.PowerManagerServiceDumpProto power = 3009 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "power --proto"
    ];

    optional android.service.print.PrintServiceDumpProto print = 3010 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "print --proto"
    ];

    optional android.service.procstats.ProcessStatsServiceDumpProto procstats = 3011 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "procstats --proto"
    ];

    optional com.android.server.am.ActivityManagerServiceDumpActivitiesProto activities = 3012 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "activity --proto activities"
    ];

    optional com.android.server.am.ActivityManagerServiceDumpBroadcastsProto broadcasts = 3013 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "activity --proto broadcasts"
    ];

    optional com.android.server.am.ActivityManagerServiceDumpServicesProto amservices = 3014 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "activity --proto service"
    ];

    optional com.android.server.am.ActivityManagerServiceDumpProcessesProto amprocesses = 3015 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "activity --proto processes"
    ];

    optional com.android.server.alarm.AlarmManagerServiceDumpProto alarm = 3016 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "alarm --proto"
    ];

    optional com.android.server.wm.WindowManagerServiceDumpProto window = 3017 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "window --proto"
    ];

    optional com.android.server.am.MemInfoDumpProto meminfo = 3018 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "meminfo -a --proto"
    ];

    optional android.service.GraphicsStatsServiceDumpProto graphicsstats = 3019 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "graphicsstats --proto"
    ];

    optional com.android.server.job.JobSchedulerServiceDumpProto jobscheduler = 3020 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "jobscheduler --proto"
    ];

    optional android.service.usb.UsbServiceDumpProto usb = 3021 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "usb --proto"
    ];

    // The history can be large and may cause issues in consumers, so put the
    // history in a separate section to compensate.
    optional android.service.batterystats.BatteryStatsServiceDumpHistoryProto battery_history = 3022 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "batterystats --proto --history",
        (section).userdebug_and_eng_only = true
    ];

    optional android.os.StatsDataDumpProto stats_data = 3023 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "stats --proto",
        (section).userdebug_and_eng_only = true
    ];

    optional com.android.role.RoleServiceDumpProto role = 3024 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "role --proto"
    ];

    optional android.service.restricted_image.RestrictedImagesDumpProto restricted_images = 3025 [
        (section).type = SECTION_DUMPSYS,
        (section).userdebug_and_eng_only = true,
        (section).args = "incidentcompanion --restricted_image"
    ];

    // System trace as a serialized protobuf.
    optional bytes system_trace = 3026 [
        (section).type = SECTION_FILE,
        (section).args = "/data/misc/perfetto-traces/incident-trace",
        (privacy).dest = DEST_AUTOMATIC
    ];

    // Dropbox entries split by tags.
    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_data_app_crash = 3027 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "dropbox --proto data_app_crash"
    ];

    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_data_app_anr = 3028 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "dropbox --proto data_app_anr"
    ];

    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_data_app_native_crash = 3029 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "dropbox --proto data_app_native_crash"
    ];

    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_data_app_strictmode = 3030 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "dropbox --proto data_app_strictmode"
    ];

    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_data_app_wtf = 3031 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "dropbox --proto data_app_wtf"
    ];

    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_app_crash = 3032 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "dropbox --proto system_app_crash"
    ];

    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_app_anr = 3033 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "dropbox --proto system_app_anr"
    ];

    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_app_native_crash = 3034 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "dropbox --proto system_app_native_crash"
    ];

    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_app_strictmode = 3035 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "dropbox --proto system_app_strictmode"
    ];

    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_app_wtf = 3036 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "dropbox --proto system_app_wtf"
    ];

    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_server_crash = 3037 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "dropbox --proto system_server_crash"
    ];

    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_server_anr = 3038 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "dropbox --proto system_server_anr"
    ];

    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_server_native_crash = 3039 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "dropbox --proto system_server_native_crash"
    ];

    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_server_lowmem= 3040 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "dropbox --proto system_server_lowmem"
    ];

    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_server_strictmode = 3041 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "dropbox --proto system_server_strictmode"
    ];

    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_server_watchdog = 3042 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "dropbox --proto system_server_watchdog"
    ];

    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_server_wtf = 3043 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "dropbox --proto system_server_wtf"
    ];

    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_recovery_log = 3044 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "dropbox --proto SYSTEM_RECOVERY_LOG"
    ];

    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_system_tombstone = 3045 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "dropbox --proto SYSTEM_TOMBSTONE"
    ];

    optional android.service.dropbox.DropBoxManagerServiceDumpProto dropbox_subsystem_restart = 3046 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "dropbox --proto SubsystemRestart"
    ];

    optional CpuUsageProto process_cpu_usage = 3047 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "cpuinfo --proto"
    ];

    optional .clearcut.connectivity.IpConnectivityLog ip_connectivity_metrics = 3049 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "connmetrics --proto"
    ];

    optional com.android.server.BluetoothManagerServiceDumpProto bluetooth_manager = 3050 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "bluetooth_manager --proto"
    ];

    optional com.android.server.location.ContextHubServiceProto context_hub = 3051 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "contexthub --proto"
    ];

    optional com.android.nfc.NfcServiceDumpProto nfc_service  = 3052 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "nfc --proto"
    ];

    optional android.service.SensorServiceProto sensor_service = 3053 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "sensorservice --proto"
    ];

    optional com.android.server.powerstats.PowerStatsServiceMeterProto powerstats_meter = 3054 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "powerstats --proto meter"
    ];

    optional com.android.server.powerstats.PowerStatsServiceModelProto powerstats_model = 3055 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "powerstats --proto model"
    ];

    optional com.android.server.powerstats.PowerStatsServiceResidencyProto powerstats_residency = 3056 [
        (section).type = SECTION_DUMPSYS,
        (section).args = "powerstats --proto residency"
    ];

    // Dumps in text format (on userdebug and eng builds only): 4000 ~ 4999
    optional android.util.TextDumpProto textdump_wifi = 4000 [
        (section).type = SECTION_TEXT_DUMPSYS,
        (section).args = "wifi"
    ];

    optional android.util.TextDumpProto textdump_bluetooth = 4001 [
        (section).type = SECTION_TEXT_DUMPSYS,
        (section).args = "bluetooth_manager"
    ];

    // Reserved for OEMs.
    extensions 50000 to 100000;
}