blob: 30536099456abd8a57932a341efddc940c453c73 [file] [log] [blame]
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070018
19package android.os.statsd;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070020option java_package = "com.android.os";
Stefan Lafonae2df012017-11-14 09:17:21 -080021option java_outer_classname = "AtomsProto";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070022
Yao Chen9c1debe2018-02-19 14:39:19 -080023import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
Bookatzdb026a22018-01-10 19:01:56 -080024import "frameworks/base/core/proto/android/app/enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070025import "frameworks/base/core/proto/android/app/job/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080026import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack He52260142018-12-18 15:43:27 -080027import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack He22e4a1d2019-01-09 01:19:13 -080028import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Chiachang Wang67f24472019-01-15 15:14:00 +080029import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080030import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wang67f24472019-01-15 15:14:00 +080031import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080032import "frameworks/base/core/proto/android/server/enums.proto";
Yao Chen046b5122018-10-24 14:09:20 -070033import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080034import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080035import "frameworks/base/core/proto/android/telephony/enums.proto";
36import "frameworks/base/core/proto/android/view/enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080037
Yao Chend54f9dd2017-10-17 17:37:48 +000038/**
Stefan Lafonae2df012017-11-14 09:17:21 -080039 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000040 * raw stats log events from the Android system, also known as "atoms."
41 *
42 * This field contains a single oneof with all of the available messages.
43 * The stats-log-api-gen tool runs as part of the Android build and
44 * generates the android.util.StatsLog class, which contains the constants
45 * and methods that Android uses to log.
46 *
Stefan Lafonae2df012017-11-14 09:17:21 -080047 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000048 * Instead, statsd on Android constructs these messages synthetically,
49 * in the format defined here and in stats_log.proto.
50 */
Stefan Lafonae2df012017-11-14 09:17:21 -080051message Atom {
52 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070053 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070054 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
55 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080056 // 3 is available for use
Bookatzc1a050a2017-10-10 15:49:28 -070057 BleScanResultReceived ble_scan_result_received = 4;
58 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080059 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070060 SyncStateChanged sync_state_changed = 7;
61 ScheduledJobStateChanged scheduled_job_state_changed = 8;
62 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070063 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080064 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
65 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
66 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Hyunyoung Songcc651c12018-10-17 13:35:32 -070067 // 14 - 18 are available
68 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080069 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
70 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
71 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070072 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080073 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070074 CameraStateChanged camera_state_changed = 25;
75 FlashlightStateChanged flashlight_state_changed = 26;
76 UidProcessStateChanged uid_process_state_changed = 27;
77 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
78 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070079 BatteryLevelChanged battery_level_changed = 30;
80 ChargingStateChanged charging_state_changed = 31;
81 PluggedStateChanged plugged_state_changed = 32;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080082 // 33 - 34 are available
Bookatz8c6571b2017-10-24 15:04:41 -070083 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
84 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -070085 WifiLockStateChanged wifi_lock_state_changed = 37;
86 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
87 WifiScanStateChanged wifi_scan_state_changed = 39;
88 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -070089 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -070090 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -070091 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +090092 PacketWakeupOccurred packet_wakeup_occurred = 44;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080093 // 45 is available
Bookatz8fcd09a2017-12-18 13:01:10 -080094 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -080095 AppBreadcrumbReported app_breadcrumb_reported = 47;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080096 AppStartOccurred app_start_occurred = 48;
97 AppStartCanceled app_start_canceled = 49;
98 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -080099 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800100 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800101 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800102 LmkStateChanged lmk_state_changed = 54;
103 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800104 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800105 BootSequenceReported boot_sequence_reported = 57;
Tej Singhbb8554a2018-01-26 11:59:14 -0800106 DaveyOccurred davey_occurred = 58;
Chenjie Yue8904192017-12-08 19:12:57 -0800107 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800108 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800109 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800110 KeyguardStateChanged keyguard_state_changed = 62;
111 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
112 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800113 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800114 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800115 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
116 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Tej Singh02200f92018-04-02 19:37:59 -0700117 // 69 is blank but need not be.
Andrew Chantb56388b2018-03-22 21:07:33 -0700118 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800119 SpeakerImpedanceReported speaker_impedance_reported = 71;
120 HardwareFailed hardware_failed = 72;
121 PhysicalDropDetected physical_drop_detected = 73;
122 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800123 MobileConnectionStateChanged mobile_connection_state_changed = 75;
124 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700125 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800126 AppCrashOccurred app_crash_occurred = 78;
127 ANROccurred anr_occurred = 79;
128 WTFOccurred wtf_occurred = 80;
Yangster4ccebea2018-10-09 17:09:02 -0700129 PhoneServiceStateChanged phone_service_state_changed = 94;
130 PhoneStateChanged phone_state_changed = 95;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800131 LowMemReported low_mem_reported = 81;
lifr35a7cf02018-12-12 16:38:04 +0800132 NetworkDnsEventReported network_dns_event_reported = 116;
Chiachang Wang67f24472019-01-15 15:14:00 +0800133 DataStallEvent data_stall_event = 121;
Jack He52260142018-12-18 15:43:27 -0800134 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack He22e4a1d2019-01-09 01:19:13 -0800135 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
136 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Jack Yu6d421bc2019-01-23 17:42:54 +0800137 NfcErrorOccurred nfc_error_occurred = 134;
138 NfcStateChanged nfc_state_changed = 135;
139 NfcBeamOccurred nfc_beam_occurred = 136;
140 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
141 NfcTagOccurred nfc_tag_occurred = 138;
142 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
143 SeStateChanged se_state_changed = 140;
144 SeOmapiReported se_omapi_reported = 141;
Yao Chend54f9dd2017-10-17 17:37:48 +0000145 }
David Chenc8a43242017-10-17 16:23:28 -0700146
David Chen6e3e6cb2018-01-03 16:14:06 -0800147 // Pulled events will start at field 10000.
Tej Singh40298312018-02-16 00:15:09 -0800148 // Next: 10022
David Chenc8a43242017-10-17 16:23:28 -0700149 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800150 WifiBytesTransfer wifi_bytes_transfer = 10000;
151 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
152 MobileBytesTransfer mobile_bytes_transfer = 10002;
153 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800154 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800155 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800156 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800157 CpuTimePerFreq cpu_time_per_freq = 10008;
158 CpuTimePerUid cpu_time_per_uid = 10009;
159 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800160 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800161 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800162 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800163 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800164 SystemElapsedRealtime system_elapsed_realtime = 10014;
165 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800166 CpuActiveTime cpu_active_time = 10016;
167 CpuClusterTime cpu_cluster_time = 10017;
Chenjie Yu937d7422018-01-10 16:37:53 -0800168 DiskSpace disk_space = 10018;
Tej Singhbf972d92018-01-10 20:51:13 -0800169 RemainingBatteryCapacity remaining_battery_capacity = 10019;
170 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800171 Temperature temperature = 10021;
David Chenc8a43242017-10-17 16:23:28 -0700172 }
yroa1fe77c2018-02-26 14:22:54 -0800173
Bookatz76aafcf2018-09-17 16:17:10 -0700174 // DO NOT USE field numbers above 100,000 in AOSP.
175 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
176 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700177}
178
Yao Chend54f9dd2017-10-17 17:37:48 +0000179/**
Yangster-mac20877162017-12-22 17:19:39 -0800180 * This proto represents a node of an attribution chain.
181 * Note: All attribution chains are represented as a repeated field of type
182 * AttributionNode. It is understood that in such arrays, the order is that
183 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000184 */
Yangster-mac20877162017-12-22 17:19:39 -0800185message AttributionNode {
186 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800187 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800188
Yangster-mac20877162017-12-22 17:19:39 -0800189 // The (optional) string tag for an element in the attribution chain. If the
190 // element has no tag, it is encoded as an empty string.
191 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700192}
193
Yao Chend54f9dd2017-10-17 17:37:48 +0000194/*
195 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800196 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000197 *
198 * RULES:
199 * - The field ids for each atom must start at 1, and count upwards by 1.
200 * Skipping field ids is not allowed.
201 * - These form an API, so renaming, renumbering or removing fields is
202 * not allowed between android releases. (This is not currently enforced,
203 * but there will be a tool to enforce this restriction).
204 * - The types must be built-in protocol buffer types, namely, no sub-messages
205 * are allowed (yet). The bytes type is also not allowed.
206 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800207 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000208 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800209 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000210 * - A field that is a uid should be a string field, tagged with the [xxx]
211 * annotation. The generated code on android will be represented by UIDs,
212 * and those UIDs will be translated in xxx to those strings.
213 *
214 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700215 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000216 * - If there is a UID, it goes first. Think in an object-oriented fashion.
217 * *****************************************************************************
218 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700219
Yao Chend54f9dd2017-10-17 17:37:48 +0000220/**
221 * Logs when the screen state changes.
222 *
223 * Logged from:
224 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
225 */
226message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800227 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800228 optional android.view.DisplayStateEnum state = 1 [(stateFieldOption).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700229}
Yao Chend54f9dd2017-10-17 17:37:48 +0000230
231/**
Bookatzc1a050a2017-10-10 15:49:28 -0700232 * Logs that the state of a process state, as per the activity manager, has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000233 *
234 * Logged from:
235 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
236 */
Bookatzc1a050a2017-10-10 15:49:28 -0700237message UidProcessStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700238 optional int32 uid = 1 [(stateFieldOption).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000239
Bookatzdb026a22018-01-10 19:01:56 -0800240 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800241 optional android.app.ProcessStateEnum state = 2 [(stateFieldOption).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000242}
243
244/**
Bookatzc1a050a2017-10-10 15:49:28 -0700245 * Logs that a process started, finished, crashed, or ANRed.
246 *
247 * Logged from:
248 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
249 */
250message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700251 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700252
David Chen0b5c90c2018-01-25 16:51:49 -0800253 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800254 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700255
Bookatzddccf0a2017-11-28 16:48:14 -0800256 // What lifecycle state the process changed to.
257 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800258 enum State {
259 FINISHED = 0;
260 STARTED = 1;
261 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800262 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800263 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700264}
265
Bookatzc1a050a2017-10-10 15:49:28 -0700266/**
267 * Logs when the ble scan state changes.
268 *
269 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700270 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700271 */
272message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800273 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700274
275 enum State {
276 OFF = 0;
277 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700278 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
279 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700280 }
281 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700282
Bookatze5ec0b42018-03-26 13:34:56 -0700283 // Does the scan have a filter.
284 optional bool is_filtered = 3;
285 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
286 optional bool is_first_match = 4;
287 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
288 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700289}
290
291/**
292 * Logs reporting of a ble scan finding results.
293 *
294 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700295 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700296 */
Bookatzae6738e2018-09-13 11:38:56 -0700297// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700298message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800299 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700300
301 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800302 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700303}
304
305/**
306 * Logs when a sensor state changes.
307 *
308 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700309 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700310 */
311message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800312 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700313
Bookatzc1a050a2017-10-10 15:49:28 -0700314 // The id (int) of the sensor.
315 optional int32 sensor_id = 2;
316
317 enum State {
318 OFF = 0;
319 ON = 1;
320 }
321 optional State state = 3;
322}
323
324
325/**
326 * Logs when GPS state changes.
327 *
328 * Logged from:
329 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
330 */
331message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800332 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700333
334 enum State {
335 OFF = 0;
336 ON = 1;
337 }
338 optional State state = 2;
339}
340
341
342/**
343 * Logs when a sync manager sync state changes.
344 *
345 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700346 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700347 */
348message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800349 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700350
David Chen0b5c90c2018-01-25 16:51:49 -0800351 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800352 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700353
354 enum State {
355 OFF = 0;
356 ON = 1;
357 }
358 optional State state = 3;
359}
360
361/**
362 * Logs when a job scheduler job state changes.
363 *
364 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700365 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700366 */
367message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800368 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700369
370 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800371 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700372
373 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800374 FINISHED = 0;
375 STARTED = 1;
376 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700377 }
378 optional State state = 3;
379
Tej Singh33a412b2018-03-16 18:43:59 -0700380 // The reason a job has stopped.
381 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700382 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700383 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700384}
385
386/**
387 * Logs when the audio state changes.
388 *
389 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700390 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700391 */
392message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800393 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700394
395 enum State {
396 OFF = 0;
397 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700398 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
399 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700400 }
401 optional State state = 2;
402}
403
404/**
405 * Logs when the video codec state changes.
406 *
407 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700408 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700409 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800410message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800411 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700412
413 enum State {
414 OFF = 0;
415 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700416 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
417 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700418 }
419 optional State state = 2;
420}
421
422/**
423 * Logs when the flashlight state changes.
424 *
425 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700426 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700427 */
428message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800429 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700430
431 enum State {
432 OFF = 0;
433 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700434 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
435 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700436 }
437 optional State state = 2;
438}
439
440/**
441 * Logs when the camera state changes.
442 *
443 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700444 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700445 */
446message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800447 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700448
449 enum State {
450 OFF = 0;
451 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700452 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
453 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700454 }
455 optional State state = 2;
456}
457
458/**
459 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000460 *
461 * Logged from:
462 * TODO
463 */
Bookatzd6746242017-10-24 18:39:35 -0700464message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800465 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000466
Bookatz1a1b0462018-01-12 11:47:03 -0800467 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
468 // From frameworks/base/core/proto/android/os/enums.proto.
469 optional android.os.WakeLockLevelEnum level = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700470
471 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
472 optional string tag = 3;
473
474 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800475 RELEASE = 0;
476 ACQUIRE = 1;
477 CHANGE_RELEASE = 2;
478 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700479 }
480 optional State state = 4;
481}
482
483/**
Bookatzc1a050a2017-10-10 15:49:28 -0700484 * Logs when a partial wakelock is considered 'long' (over 1 min).
485 *
486 * Logged from:
487 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
488 */
489message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800490 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700491
Yao Chend54f9dd2017-10-17 17:37:48 +0000492 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
493 optional string tag = 2;
494
Bookatzc1a050a2017-10-10 15:49:28 -0700495 // TODO: I have no idea what this is.
496 optional string history_tag = 3;
497
498 enum State {
499 OFF = 0;
500 ON = 1;
501 }
502 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000503}
504
Bookatzc1a050a2017-10-10 15:49:28 -0700505/**
506 * Logs Battery Saver state change.
507 *
508 * Logged from:
509 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
510 */
511message BatterySaverModeStateChanged {
512 enum State {
513 OFF = 0;
514 ON = 1;
515 }
516 optional State state = 1;
517}
518
519/**
520 * Logs Doze mode state change.
521 *
522 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800523 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700524 */
525message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800526 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800527}
528
529
530/**
531 * Logs state change of Doze mode including maintenance windows.
532 *
533 * Logged from:
534 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
535 */
536message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800537 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700538}
539
540/**
541 * Logs screen brightness level.
542 *
543 * Logged from:
544 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
545 */
546message ScreenBrightnessChanged {
547 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
548 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700549}
550
551/**
552 * Logs battery level (percent full, from 0 to 100).
553 *
554 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700555 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700556 */
557message BatteryLevelChanged {
558 // Battery level. Should be in [0, 100].
559 optional int32 battery_level = 1;
560}
561
562/**
563 * Logs change in charging status of the device.
564 *
565 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700566 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700567 */
568message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800569 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
570 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700571}
572
573/**
574 * Logs whether the device is plugged in, and what power source it is using.
575 *
576 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700577 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700578 */
579message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800580 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
581 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700582}
583
Bookatz8c6571b2017-10-24 15:04:41 -0700584/**
585 * Logs when an app's wakeup alarm fires.
586 *
587 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700588 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700589 */
590message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800591 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800592
593 // Name of the wakeup alarm.
594 optional string tag = 2;
595}
596
597/**
598 * Logs when an an app causes the mobile radio to change state.
599 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
600 *
601 * Logged from:
602 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
603 */
604message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800605 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800606
Bookatz1a1b0462018-01-12 11:47:03 -0800607 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
608 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800609}
610
611/**
612 * Logs when an an app causes the wifi radio to change state.
613 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
614 *
615 * Logged from:
616 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
617 */
618message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800619 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800620
Bookatz1a1b0462018-01-12 11:47:03 -0800621 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
622 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700623}
624
625/**
626 * Logs kernel wakeup reasons and aborts.
627 *
628 * Logged from:
629 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
630 */
631message KernelWakeupReported {
632 // Name of the kernel wakeup reason (or abort).
633 optional string wakeup_reason_name = 1;
634
635 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800636 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700637}
638
639/**
640 * Logs wifi locks held by an app.
641 *
642 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700643 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700644 */
645message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800646 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700647
648 enum State {
649 OFF = 0;
650 ON = 1;
651 }
652 optional State state = 2;
653}
654
655/**
656 * Logs wifi signal strength changes.
657 *
658 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700659 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700660 */
661message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800662 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
663 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700664}
665
666/**
667 * Logs wifi scans performed by an app.
668 *
669 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700670 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700671 */
672message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800673 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700674
675 enum State {
676 OFF = 0;
677 ON = 1;
678 }
679 optional State state = 2;
680}
681
682/**
Tej Singh4503e102018-01-04 14:35:01 -0800683 * Logs wifi multicast locks held by an app
684 *
685 * Logged from:
686 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
687 */
688message WifiMulticastLockStateChanged {
689 repeated AttributionNode attribution_node = 1;
690
691 enum State {
692 OFF = 0;
693 ON = 1;
694 }
695 optional State state = 2;
696}
697
698/**
Tej Singh1ea42892018-01-19 09:27:00 -0800699 * Logs shutdown reason and duration on next boot.
700 *
701 * Logged from:
702 * frameworks/base/core/java/com/android/server/BootReceiver.java
703 */
704message ShutdownSequenceReported {
705 // True if shutdown is for a reboot. Default: false if we do not know.
706 optional bool reboot = 1;
707
708 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
709 optional string reason = 2;
710
711 // Beginning of shutdown time in ms using wall clock time since unix epoch.
712 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -0800713 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -0800714
715 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -0800716 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -0800717}
718
Tej Singh6483ea42018-01-25 17:45:49 -0800719
720/**
721 * Logs boot reason and duration.
722 *
723 * Logged from:
724 * system/core/bootstat/bootstat.cpp
725 */
726message BootSequenceReported {
727 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
728 // Default: "<EMPTY>" if not available.
729 optional string bootloader_reason = 1;
730
731 // Reason for system boot. Eg. bootloader, reboot,userrequested
732 // Default: "<EMPTY>" if not available.
733 optional string system_reason = 2;
734
735 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -0800736 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -0800737
738 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800739 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -0800740
741 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800742 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -0800743
744 // Time since last boot in ms. Default: 0 if not available.
745 optional int64 time_since_last_boot = 6;
746}
747
Tej Singhc477d9c2018-02-05 18:31:39 -0800748
749/**
750 * Logs call state and disconnect cause (if applicable).
751 *
752 * Logged from:
753 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
754 */
755message CallStateChanged {
756 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
757 // From frameworks/base/core/proto/android/telecomm/enums.proto.
758 optional android.telecom.CallStateEnum call_state = 1;
759
760 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
761 // This value is only applicable when the call_state is DISCONNECTED, and
762 // should always be UNKNOWN if the call_state is not DISCONNECTED.
763 // From frameworks/base/core/proto/android/telecomm/enums.proto.
764 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
765
766 // True if the call is self-managed, which are apps that use the
767 // telecom infrastructure to make their own calls.
768 optional bool self_managed = 3;
769
770 // True if call is external. External calls are calls on connected Wear
771 // devices but show up in Telecom so the user can pull them onto the device.
772 optional bool external_call = 4;
773}
774
Tej Singh1ea42892018-01-19 09:27:00 -0800775/**
Tej Singhdd7bd352018-02-09 19:33:15 -0800776 * Logs keyguard state. The keyguard is the lock screen.
777 *
778 * Logged from:
779 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
780 */
781message KeyguardStateChanged {
782 enum State {
783 UNKNOWN = 0;
784 // The keyguard is hidden when the phone is unlocked.
785 HIDDEN = 1;
786 // The keyguard is shown when the phone is locked (screen turns off).
787 SHOWN= 2;
788 // The keyguard is occluded when something is overlaying the keyguard.
789 // Eg. Opening the camera while on the lock screen.
790 OCCLUDED = 3;
791 }
792 optional State state = 1;
793}
794
795/**
796 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
797 * prompts the user to enter a password (pattern, pin, etc).
798 *
799 * Logged from:
800 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
801 */
802
803message KeyguardBouncerStateChanged {
804 enum State {
805 UNKNOWN = 0;
806 // Bouncer is hidden, either as a result of successfully entering the
807 // password, screen timing out, or user going back to lock screen.
808 HIDDEN = 1;
809 // This is when the user is being prompted to enter the password.
810 SHOWN = 2;
811 }
812 optional State state = 1;
813}
814
815/**
816 * Logs the result of entering a password into the keyguard bouncer.
817 *
818 * Logged from:
819 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
820 */
821message KeyguardBouncerPasswordEntered {
822 enum BouncerResult {
823 UNKNOWN = 0;
824 // The password entered was incorrect.
825 FAILURE = 1;
826 // The password entered was correct.
827 SUCCESS = 2;
828 }
829 optional BouncerResult result = 1;
830}
831
Tej Singha883b372018-02-15 11:30:01 -0800832/*
833 * Logs changes to the configuration of the device. The configuration is defined
834 * in frameworks/base/core/java/android/content/res/Configuration.java
835 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
836 * Please go there to interpret the possible values each field can be.
837 *
838 * Logged from:
839 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
840 */
841message ResourceConfigurationChanged {
842 // Bit mask of color capabilities of the screen.
843 // Contains information about the color gamut and hdr mode of the screen.
844 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
845 optional int32 colorMode = 1;
846
847 // The target screen density being rendered to.
848 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
849 optional int32 densityDpi = 2;
850
851 // Current user preference for the scaling factor for fonts,
852 // relative to the base density scaling.
853 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
854 optional float fontScale = 3;
855
856 // Flag indicating whether the hard keyboard is hidden.
857 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
858 optional int32 hardKeyboardHidden = 4;
859
860 // The type of keyboard attached to the device.
861 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
862 optional int32 keyboard = 5;
863
864 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
865 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
866 optional int32 keyboardHideen = 6;
867
868 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
869 // 0 if undefined.
870 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
871 optional int32 mcc = 7;
872
873 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
874 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
875 // MNC_ZERO symbol defined in Configuration.java.
876 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
877 optional int32 mnc = 8;
878
879 // The kind of navigation available on the device.
880 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
881 optional int32 navigation = 9;
882
883 // Flag indicating whether the navigation is available.
884 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
885 optional int32 navigationHidden = 10;
886
887 // Overall orientation of the screen.
888 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
889 optional int32 orientation = 11;
890
891 // The current height of the available screen space, in dp units.
892 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
893 optional int32 screenHeightDp = 12;
894
895 // Bit mask of overall layout of the screen.
896 // Contains information about screen size, whether the screen is wider/taller
897 // than normal, whether the screen layout is right-tl-left or left-to-right,
898 // and whether the screen has a rounded shape.
899 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
900 optional int32 screenLayout = 13;
901
902 // Current width of the available screen space, in dp units.
903 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
904 optional int32 screenWidthDp = 14;
905
906 // The smallest screen size an application will see in normal operation.
907 // This is the smallest value of both screenWidthDp and screenHeightDp
908 // in portrait and landscape.
909 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
910 optional int32 smallestScreenWidthDp = 15;
911
912 // The type of touch screen attached to the device.
913 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
914 optional int32 touchscreen = 16;
915
916 // Bit mask of the ui mode.
917 // Contains information about the overall ui mode of the device.
918 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
919 // Also contains information about whether the device is in night mode.
920 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
921 optional int32 uiMode = 17;
922}
923
Tej Singheee317b2018-03-07 19:28:05 -0800924
925/**
926 * Logs changes in the connection state of the mobile radio.
927 *
928 * Logged from:
929 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
930 */
931message MobileConnectionStateChanged {
932 // States are from the state machine DataConnection.java.
933 enum State {
934 UNKNOWN = 0;
935 // The connection is inactive, or disconnected.
936 INACTIVE = 1;
937 // The connection is being activated, or connecting.
938 ACTIVATING = 2;
939 // The connection is active, or connected.
940 ACTIVE = 3;
941 // The connection is disconnecting.
942 DISCONNECTING = 4;
943 // The connection is disconnecting after creating a connection.
944 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
945 }
946 optional State state = 1;
947 // For multi-sim phones, this distinguishes between the sim cards.
948 optional int32 sim_slot_index = 2;
949 // Used to identify the connection. Starts at 0 and increments by 1 for
950 // every new network created. Resets whenever the device reboots.
951 optional int32 data_connection_id = 3;
952 // A bitmask for the capabilities of this connection.
953 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
954 // Default value (if we have no information): 0
955 optional int64 capabilities = 4;
956 // If this connection has internet.
957 // This just checks if the DEFAULT bit of capabilities is set.
958 optional bool has_internet = 5;
959}
960
961/**
962 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
963 *
964 * Logged from:
965 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
966 */
967message MobileRadioTechnologyChanged {
968 optional android.telephony.NetworkTypeEnum state = 1;
969 // For multi-sim phones, this distinguishes between the sim cards.
970 optional int32 sim_slot_index = 2;
971}
972
Andrew Chantb56388b2018-03-22 21:07:33 -0700973/**
974 * Logs the VID and PID of any connected USB devices.
975 *
976 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
977 *
978 * Logged by Vendor.
979 */
980message UsbDeviceAttached {
981 optional int32 vid = 1;
982 optional int32 pid = 2;
983 optional bool has_audio = 3;
984 optional bool has_hid = 4;
985 optional bool has_storage = 5;
986}
987
Tej Singheee317b2018-03-07 19:28:05 -0800988
Tej Singhdd7bd352018-02-09 19:33:15 -0800989/**
Tej Singh5d991e12018-03-09 19:48:11 -0800990 * Logs when Bluetooth is enabled and disabled.
991 *
992 * Logged from:
993 * services/core/java/com/android/server/BluetoothManagerService.java
994 */
995message BluetoothEnabledStateChanged {
996 repeated AttributionNode attribution_node = 1;
997 // Whether or not bluetooth is enabled on the device.
998 enum State {
999 UNKNOWN = 0;
1000 ENABLED = 1;
1001 DISABLED = 2;
1002 }
1003 optional State state = 2;
1004 // The reason for being enabled/disabled.
1005 // Eg. Airplane mode, crash, application request.
1006 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1007 // If the reason is an application request, this will be the package name.
1008 optional string pkgName = 4;
1009}
1010
1011/**
Jack He22e4a1d2019-01-09 01:19:13 -08001012 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001013 *
1014 * Logged from:
Jack He22e4a1d2019-01-09 01:19:13 -08001015 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1016 *
1017 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001018 */
1019message BluetoothConnectionStateChanged {
1020 // The state of the connection.
1021 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1022 optional android.bluetooth.ConnectionStateEnum state = 1;
1023 // An identifier that can be used to match connect and disconnect events.
1024 // Currently is last two bytes of a hash of a device level ID and
1025 // the mac address of the bluetooth device that is connected.
Jack He22e4a1d2019-01-09 01:19:13 -08001026 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1027 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001028 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1029 // From android.bluetooth.BluetoothAdapter.java
Jack He22e4a1d2019-01-09 01:19:13 -08001030 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001031 optional int32 bt_profile = 3;
Jack He22e4a1d2019-01-09 01:19:13 -08001032 // An identifier that can be used to match events for this device.
1033 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1034 // Salt: Randomly generated 256 bit value
1035 // Hash algorithm: HMAC-SHA256
1036 // Size: 32 byte
1037 // Default: null or empty if the device identifier is not known
1038 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1039}
1040
1041/**
1042 * Logs when a Bluetooth device connects and disconnects over ACL
1043 *
1044 * Logged from:
1045 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1046 *
1047 * Next Tag: 3
1048 */
1049message BluetoothAclConnectionStateChanged {
1050 // An identifier that can be used to match events for this device.
1051 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1052 // Salt: Randomly generated 256 bit value
1053 // Hash algorithm: HMAC-SHA256
1054 // Size: 32 byte
1055 // Default: null or empty if the device identifier is not known
1056 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1057 // The state of the connection.
1058 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1059 optional android.bluetooth.ConnectionStateEnum state = 2;
1060}
1061
1062/**
1063 * Logs when a Bluetooth device connects and disconnects over SCO
1064 *
1065 * Logged from:
1066 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1067 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1068 *
1069 * Next Tag: 4
1070 */
1071message BluetoothScoConnectionStateChanged {
1072 // An identifier that can be used to match events for this device.
1073 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1074 // Salt: Randomly generated 256 bit value
1075 // Hash algorithm: HMAC-SHA256
1076 // Size: 32 byte
1077 // Default: null or empty if the device identifier is not known
1078 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1079 // The state of the connection.
1080 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1081 optional android.bluetooth.ConnectionStateEnum state = 2;
1082 // Codec used for this SCO connection
1083 // Default: UNKNOWN
1084 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001085}
1086
Jack He52260142018-12-18 15:43:27 -08001087// Logs when there is an event affecting Bluetooth device's link layer connection.
1088// - This event is triggered when there is a related HCI command or event
1089// - Users of this metrics can deduce Bluetooth device's connection state from these events
1090// - HCI commands are logged before the command is sent, after receiving command status, and after
1091// receiving command complete
1092// - HCI events are logged when they arrive
1093//
1094// Low level log from system/bt
1095//
1096// Bluetooth classic commands:
1097// - CMD_CREATE_CONNECTION
1098// - CMD_DISCONNECT
1099// - CMD_CREATE_CONNECTION_CANCEL
1100// - CMD_ACCEPT_CONNECTION_REQUEST
1101// - CMD_REJECT_CONNECTION_REQUEST
1102// - CMD_SETUP_ESCO_CONNECTION
1103// - CMD_ACCEPT_ESCO_CONNECTION
1104// - CMD_REJECT_ESCO_CONNECTION
1105// - CMD_ENH_SETUP_ESCO_CONNECTION
1106// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1107//
1108// Bluetooth low energy commands:
1109// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1110// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1111// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1112// - CMD_BLE_CLEAR_WHITE_LIST
1113// - CMD_BLE_ADD_WHITE_LIST
1114// - CMD_BLE_REMOVE_WHITE_LIST
1115//
1116// Bluetooth classic events:
1117// - EVT_CONNECTION_COMP
1118// - EVT_CONNECTION_REQUEST
1119// - EVT_DISCONNECTION_COMP
1120// - EVT_ESCO_CONNECTION_COMP
1121// - EVT_ESCO_CONNECTION_CHANGED
1122//
1123// Bluetooth low energy meta events:
1124// - BLE_EVT_CONN_COMPLETE_EVT
1125// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1126//
1127// Next tag: 10
1128message BluetoothLinkLayerConnectionEvent {
1129 // An identifier that can be used to match events for this device.
1130 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1131 // Salt: Randomly generated 256 bit value
1132 // Hash algorithm: HMAC-SHA256
1133 // Size: 32 byte
1134 // Default: null or empty if the device identifier is not known
1135 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1136 // Connection handle of this connection if available
1137 // Range: 0x0000 - 0x0EFF (12 bits)
1138 // Default: 0xFFFF if the handle is unknown
1139 optional int32 connection_handle = 2;
1140 // Direction of the link
1141 // Default: DIRECTION_UNKNOWN
1142 optional android.bluetooth.DirectionEnum direction = 3;
1143 // Type of this link
1144 // Default: LINK_TYPE_UNKNOWN
1145 optional android.bluetooth.LinkTypeEnum type = 4;
1146
1147 // Reason metadata for this link layer connection event, rules for interpretation:
1148 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1149 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1150 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1151 // set and valid, ignore hci_ble_event
1152
1153 // HCI command associated with this event
1154 // Default: CMD_UNKNOWN
1155 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1156 // HCI event associated with this event
1157 // Default: EVT_UNKNOWN
1158 optional android.bluetooth.hci.EventEnum hci_event = 6;
1159 // HCI BLE meta event associated with this event
1160 // Default: BLE_EVT_UNKNOWN
1161 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1162 // HCI command status code if this is triggerred by hci_cmd
1163 // Default: STATUS_UNKNOWN
1164 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1165 // HCI reason code associated with this event
1166 // Default: STATUS_UNKNOWN
1167 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1168}
1169
1170
Tej Singh5d991e12018-03-09 19:48:11 -08001171/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001172 * Logs when something is plugged into or removed from the USB-C connector.
1173 *
1174 * Logged from:
1175 * Vendor USB HAL.
1176 */
1177message UsbConnectorStateChanged {
1178 enum State {
1179 DISCONNECTED = 0;
1180 CONNECTED = 1;
1181 }
1182 optional State state = 1;
1183}
1184
1185/**
1186 * Logs the reported speaker impedance.
1187 *
1188 * Logged from:
1189 * Vendor audio implementation.
1190 */
1191message SpeakerImpedanceReported {
1192 optional int32 speaker_location = 1;
1193 optional int32 impedance = 2;
1194}
1195
1196/**
1197 * Logs the report of a failed hardware.
1198 *
1199 * Logged from:
1200 * Vendor HALs.
1201 *
1202 */
1203message HardwareFailed {
1204 enum HardwareType {
1205 HARDWARE_FAILED_UNKNOWN = 0;
1206 HARDWARE_FAILED_MICROPHONE = 1;
1207 HARDWARE_FAILED_CODEC = 2;
1208 HARDWARE_FAILED_SPEAKER = 3;
1209 HARDWARE_FAILED_FINGERPRINT = 4;
1210 }
1211 optional HardwareType hardware_type = 1;
1212
1213 /* hardware_location allows vendors to differentiate between multiple instances of
1214 * the same hardware_type. The specific locations are vendor defined integers,
1215 * referring to board-specific numbering schemes.
1216 */
1217 optional int32 hardware_location = 2;
1218
1219 /* failure_code is specific to the HardwareType of the failed hardware.
1220 * It should use the enum values defined below.
1221 */
1222 enum MicrophoneFailureCode {
1223 MICROPHONE_FAILURE_COMPLETE = 0;
1224 }
1225 enum CodecFailureCode {
1226 CODEC_FAILURE_COMPLETE = 0;
1227 }
1228 enum SpeakerFailureCode {
1229 SPEAKER_FAILURE_COMPLETE = 0;
1230 SPEAKER_FAILURE_HIGH_Z = 1;
1231 SPEAKER_FAILURE_SHORT = 2;
1232 }
1233 enum FingerprintFailureCode {
1234 FINGERPRINT_FAILURE_COMPLETE = 0;
1235 FINGERPRINT_SENSOR_BROKEN = 1;
1236 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1237 }
1238 optional int32 failure_code = 3;
1239}
1240
1241/**
1242 * Log an event when the device has been physically dropped.
1243 * Reported from the /vendor partition.
1244 */
1245message PhysicalDropDetected {
1246 // Confidence that the event was actually a drop, 0 -> 100
1247 optional int32 confidence_pctg = 1;
1248 // Peak acceleration of the drop, in 1/1000s of a g.
1249 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001250 // Duration of freefall in ms
1251 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001252}
1253
1254/**
1255 * Log bucketed battery charge cycles.
1256 *
1257 * Each bucket represents cycles of the battery past
1258 * a given charge point. For example, bucket 1 is the
1259 * lowest 1/8th of the battery, and bucket 8 is 100%.
1260 *
1261 * Logged from:
1262 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1263 */
1264message ChargeCyclesReported {
1265 optional int32 cycle_bucket_1 = 1;
1266 optional int32 cycle_bucket_2 = 2;
1267 optional int32 cycle_bucket_3 = 3;
1268 optional int32 cycle_bucket_4 = 4;
1269 optional int32 cycle_bucket_5 = 5;
1270 optional int32 cycle_bucket_6 = 6;
1271 optional int32 cycle_bucket_7 = 7;
1272 optional int32 cycle_bucket_8 = 8;
1273}
1274
1275/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001276 * Logs the duration of a davey (jank of >=700ms) when it occurs
1277 *
1278 * Logged from:
1279 * frameworks/base/libs/hwui/JankTracker.cpp
1280 */
1281message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001282 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001283 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001284
Tej Singhbb8554a2018-01-26 11:59:14 -08001285 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001286 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001287}
1288
1289/**
Bookatze5885242017-10-24 20:10:31 -07001290 * Logs phone signal strength changes.
1291 *
1292 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001293 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001294 */
1295message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001296 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1297 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001298}
1299
Yangster4ccebea2018-10-09 17:09:02 -07001300
1301/**
1302 * Logs when the phone state, sim state or signal strength changes
1303 *
1304 * Logged from:
1305 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1306 */
1307message PhoneServiceStateChanged {
1308 optional android.telephony.ServiceStateEnum state = 1;
1309 optional android.telephony.SimStateEnum sim_state = 2;
1310 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1311}
1312
1313/**
1314 * Logs when the phone becomes on or off.
1315 *
1316 * Logged from:
1317 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1318 */
1319message PhoneStateChanged {
1320 enum State {
1321 OFF = 0;
1322 ON = 1;
1323 }
1324 optional State state = 1;
1325}
1326
Hyunyoung Songcc651c12018-10-17 13:35:32 -07001327message LauncherUIChanged {
Yao Chen046b5122018-10-24 14:09:20 -07001328 optional android.stats.launcher.LauncherAction action = 1;
1329 optional android.stats.launcher.LauncherState src_state = 2;
1330 optional android.stats.launcher.LauncherState dst_state = 3;
1331 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songcc651c12018-10-17 13:35:32 -07001332 optional bool is_swipe_up_enabled = 5;
1333}
1334
David Chenc28b2bb2017-10-24 12:52:52 -07001335/**
1336 * Logs that a setting was updated.
1337 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001338 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001339 * The tag and is_default allow resetting of settings to default values based on the specified
1340 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1341 */
1342message SettingChanged {
1343 // The name of the setting.
1344 optional string setting = 1;
1345
1346 // The change being imposed on this setting. May represent a number, eg "3".
1347 optional string value = 2;
1348
1349 // The new value of this setting. For most settings, this is same as value. For some settings,
1350 // value is +X or -X where X represents an element in a set. For example, if the previous value
1351 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1352 // The +/- feature is currently only used for location_providers_allowed.
1353 optional string new_value = 3;
1354
1355 // The previous value of this setting.
1356 optional string prev_value = 4;
1357
1358 // The tag used with the is_default for resetting sets of settings. This is generally null.
1359 optional string tag = 5;
1360
Bookatz90867622018-01-31 15:05:57 -08001361 // True if this setting with tag should be resettable.
1362 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001363
David Chenbd789912018-03-16 17:19:55 -07001364 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001365 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001366
1367 enum ChangeReason {
1368 UPDATED = 1; // Updated can be an insertion or an update.
1369 DELETED = 2;
1370 }
1371 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001372}
Chenjie Yub3dda412017-10-24 13:41:59 -07001373
Chenjie Yu05013b32017-11-21 10:21:41 -08001374/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001375 * Logs activity going to foreground or background
1376 *
1377 * Logged from:
1378 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1379 */
1380message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001381 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001382 optional string pkg_name = 2;
1383 optional string class_name = 3;
1384
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001385 enum State {
1386 BACKGROUND = 0;
1387 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001388 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001389 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001390}
David Chenc8a43242017-10-17 16:23:28 -07001391
1392/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001393 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001394 * Logged from:
1395 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1396 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001397message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001398 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001399
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001400 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001401
1402 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001403 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001404 optional string process_name = 3;
1405
1406 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001407 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07001408
1409 optional string package_name = 5;
1410
1411 enum InstantApp {
1412 UNAVAILABLE = 0;
1413 FALSE = 1;
1414 TRUE = 2;
1415 }
1416 optional InstantApp is_instant_app = 6;
1417
1418 enum ForegroundState {
1419 UNKNOWN = 0;
1420 BACKGROUND = 1;
1421 FOREGROUND = 2;
1422 }
1423 optional ForegroundState foreground_state = 7;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001424}
David Chen9e3808c2017-11-20 17:25:34 -08001425
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001426/**
1427 * Logs when a WTF (What a Terrible Failure) happened.
1428 * Logged from:
1429 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1430 */
1431message WTFOccurred {
1432 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001433
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001434 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001435
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001436 // The name of the process.
1437 // system_server if it is not by an app
1438 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001439
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001440 // The pid if available. -1 means not available.
1441 optional sint32 pid = 4;
1442}
1443
1444/**
1445 * Logs when system server reports low memory.
1446 * Logged from:
1447 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1448 */
1449message LowMemReported {
1450}
1451
1452/**
1453 * Logs when an app ANR (App Not Responding) occurs.
1454 * Logged from:
1455 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1456 */
1457message ANROccurred {
1458 optional int32 uid = 1 [(is_uid) = true];
1459
1460 optional string process_name = 2;
1461
1462 optional string short_component_name = 3;
1463
1464 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07001465
1466 enum InstantApp {
1467 UNAVAILABLE = 0;
1468 FALSE = 1;
1469 TRUE = 2;
1470 }
1471 optional InstantApp is_instant_app = 5;
1472
1473 enum ForegroundState {
1474 UNKNOWN = 0;
1475 BACKGROUND = 1;
1476 FOREGROUND = 2;
1477 }
1478 optional ForegroundState foreground_state = 6;
David Chen9e3808c2017-11-20 17:25:34 -08001479}
1480
David Chen0a368b22017-12-06 16:28:16 -08001481/*
1482 * Allows other apps to push events into statsd.
1483 * Logged from:
1484 * frameworks/base/core/java/android/util/StatsLog.java
1485 */
David Chen0b5c90c2018-01-25 16:51:49 -08001486message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08001487 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001488 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08001489
1490 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
1491 optional int32 label = 2;
1492
1493 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
1494 // predicates for the metrics).
1495 enum State {
1496 UNKNOWN = 0;
1497 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
1498 STOP = 2;
1499 START = 3;
1500 }
1501 optional State state = 3;
1502}
1503
David Chen9e3808c2017-11-20 17:25:34 -08001504/**
Bookatz8fcd09a2017-12-18 13:01:10 -08001505 * Logs when statsd detects an anomaly.
1506 *
1507 * Logged from:
1508 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
1509 */
1510message AnomalyDetected {
1511 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07001512 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08001513
Yangster-mac94e197c2018-01-02 16:03:03 -08001514 // Id of the config whose anomaly detection alert fired.
1515 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08001516
Yangster-mac94e197c2018-01-02 16:03:03 -08001517 // Id of the alert (i.e. name of the anomaly that was detected).
1518 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08001519}
1520
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001521message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001522 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001523 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001524
1525 // The app package name.
1526 optional string pkg_name = 2;
1527
1528 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001529 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001530 WARM = 1;
1531 HOT = 2;
1532 COLD = 3;
1533 }
1534 // The transition type.
1535 optional TransitionType type = 3;
1536
1537 // The activity name.
1538 optional string activity_name = 4;
1539
1540 // The name of the calling app. Empty if not set.
1541 optional string calling_pkg_name = 5;
1542
1543 // Whether the app is an instant app.
1544 optional bool is_instant_app = 6;
1545
1546 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08001547 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001548
Bookatz80d11a02018-01-16 10:46:35 -08001549 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001550
David Chen0b5c90c2018-01-25 16:51:49 -08001551 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001552 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001553 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001554 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001555 optional int32 bind_application_delay_millis = 11;
1556 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001557
1558 // Empty if not set.
1559 optional string launch_token = 13;
1560
Calin Juravle759fbda2018-02-20 19:52:30 +00001561 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001562 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00001563
1564 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001565 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001566}
1567
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001568message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001569 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001570 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001571
1572 // The app package name.
1573 optional string pkg_name = 2;
1574
1575 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001576 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001577 WARM = 1;
1578 HOT = 2;
1579 COLD = 3;
1580 }
1581 // The transition type.
1582 optional TransitionType type = 3;
1583
1584 // The activity name.
1585 optional string activity_name = 4;
1586}
1587
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001588message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001589 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001590 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001591
1592 // The app package name.
1593 optional string pkg_name = 2;
1594
1595 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001596 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001597 WITH_BUNDLE = 1;
1598 WITHOUT_BUNDLE = 2;
1599 }
1600 // The transition type.
1601 optional TransitionType type = 3;
1602
1603 // The activity name.
1604 optional string activity_name = 4;
1605
1606 optional bool transition_process_running = 5;
1607
1608 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08001609 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001610}
1611
Bookatz8fcd09a2017-12-18 13:01:10 -08001612/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08001613 * Logs a picture-in-picture action
1614 * Logged from:
1615 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1616 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
1617 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
1618 */
1619message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001620 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07001621 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08001622
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001623 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001624
Chenjie Yu52cacc62017-12-08 18:11:45 -08001625 enum State {
1626 ENTERED = 1;
1627 EXPANDED_TO_FULL_SCREEN = 2;
1628 MINIMIZED = 3;
1629 DISMISSED = 4;
1630 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001631 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001632}
1633
1634/**
Chenjie Yue8904192017-12-08 19:12:57 -08001635 * Logs overlay action
1636 * Logged from:
1637 * services/core/java/com/android/server/wm/Session.java
1638 */
1639message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001640 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08001641
1642 optional string package_name = 2;
1643
1644 optional bool using_alert_window = 3;
1645
1646 enum State {
1647 ENTERED = 1;
1648 EXITED = 2;
1649 }
1650 optional State state = 4;
1651}
1652
Chenjie Yuccfe6452018-01-30 11:33:21 -08001653/*
1654 * Logs foreground service starts and stops.
1655 * Note that this is not when a service starts or stops, but when it is
1656 * considered foreground.
1657 * Logged from
1658 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
1659 */
1660message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001661 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08001662 // package_name + "/" + class_name
1663 optional string short_name = 2;
1664
1665 enum State {
1666 ENTER = 1;
1667 EXIT = 2;
1668 }
1669 optional State state = 3;
1670}
1671
Chenjie Yue8904192017-12-08 19:12:57 -08001672/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08001673 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
1674 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
1675 * attributed back to the parent (host) uid. One example is Chrome.
1676 *
1677 * Logged from:
1678 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1679 */
1680message IsolatedUidChanged {
1681 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001682 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Chenjie Yubbcbc602018-02-05 16:51:52 -08001683 optional int32 parent_uid = 1;
1684
1685 optional int32 isolated_uid = 2;
1686
1687 // We expect an isolated uid to be removed before if it's used for another parent uid.
1688 enum Event {
1689 REMOVED = 0;
1690 CREATED = 1;
1691 }
1692 optional Event event = 3;
1693}
1694
1695/*
1696 * Logs the reception of an incoming network packet causing the main system to wake up for
1697 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
1698 * and processed by WakeupController.cpp.
1699 */
1700message PacketWakeupOccurred {
1701 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
1702 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07001703 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001704 // The interface name on which the packet was received.
1705 optional string iface = 2;
1706 // The ethertype value of the packet.
1707 optional int32 ethertype = 3;
1708 // String representation of the destination MAC address of the packet.
1709 optional string destination_hardware_address = 4;
1710 // String representation of the source address of the packet if this was an IP packet.
1711 optional string source_ip = 5;
1712 // String representation of the destination address of the packet if this was an IP packet.
1713 optional string destination_ip = 6;
1714 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
1715 // field if this was an IPv6 packet. The range of possible values is the same for both IP
1716 // families.
1717 optional int32 ip_next_header = 7;
1718 // The source port if this was a TCP or UDP packet.
1719 optional int32 source_port = 8;
1720 // The destination port if this was a TCP or UDP packet.
1721 optional int32 destination_port = 9;
1722}
1723
1724/*
1725 * Logs the memory stats for an app on startup.
1726 * Logged from:
1727 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1728 */
1729message AppStartMemoryStateCaptured {
1730 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001731 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001732
1733 // The process name.
1734 optional string process_name = 2;
1735
1736 // The activity name.
1737 optional string activity_name = 3;
1738
1739 // # of page-faults
1740 optional int64 pgfault = 4;
1741
1742 // # of major page-faults
1743 optional int64 pgmajfault = 5;
1744
1745 // RSS
1746 optional int64 rss_in_bytes = 6;
1747
1748 // CACHE
1749 optional int64 cache_in_bytes = 7;
1750
1751 // SWAP
1752 optional int64 swap_in_bytes = 8;
1753}
1754
1755/*
1756 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
1757 * for LMK event.
1758 * Logged from:
1759 * system/core/lmkd/lmkd.c
1760 */
1761message LmkStateChanged {
1762 enum State {
1763 UNKNOWN = 0;
1764 START = 1;
1765 STOP = 2;
1766 }
1767 optional State state = 1;
1768}
1769
1770/*
1771 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
1772 * Logged from:
1773 * system/core/lmkd/lmkd.c
1774 */
1775message LmkKillOccurred {
1776 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001777 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001778
1779 // The process name.
1780 optional string process_name = 2;
1781
1782 // oom adj score.
1783 optional int32 oom_score = 3;
1784
1785 // # of page-faults
1786 optional int64 pgfault = 4;
1787
1788 // # of major page-faults
1789 optional int64 pgmajfault = 5;
1790
1791 // RSS
1792 optional int64 rss_in_bytes = 6;
1793
1794 // CACHE
1795 optional int64 cache_in_bytes = 7;
1796
1797 // SWAP
1798 optional int64 swap_in_bytes = 8;
Jim Blackler972a5c52018-11-21 15:24:48 +00001799
1800 // The elapsed real time of start of the process.
1801 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08001802}
1803
Rajeev Kumar51b54602018-03-01 12:18:26 -08001804/*
1805 * Logs when the ActivityManagerService detects that an app died.
1806 *
1807 * Logged from:
1808 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1809 */
1810message AppDied {
1811 // timestamp(elapsedRealtime) of record creation
Yao Chenc40a19d2018-03-15 16:48:25 -07001812 optional uint64 timestamp_millis = 1 [(stateFieldOption).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08001813}
1814
Chenjie Yubbcbc602018-02-05 16:51:52 -08001815//////////////////////////////////////////////////////////////////////
1816// Pulled atoms below this line //
1817//////////////////////////////////////////////////////////////////////
1818
1819/**
David Chenc8a43242017-10-17 16:23:28 -07001820 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
1821 *
1822 * Pulled from:
1823 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
1824 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001825message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07001826 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07001827
1828 optional int64 rx_bytes = 2;
1829
1830 optional int64 rx_packets = 3;
1831
1832 optional int64 tx_bytes = 4;
1833
1834 optional int64 tx_packets = 5;
1835}
1836
1837/**
1838 * Pulls bytes transferred via wifi (separated by foreground and background usage).
1839 *
1840 * Pulled from:
1841 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
1842 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001843message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07001844 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07001845
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001846 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
1847 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07001848
1849 optional int64 rx_bytes = 3;
1850
1851 optional int64 rx_packets = 4;
1852
1853 optional int64 tx_bytes = 5;
1854
1855 optional int64 tx_packets = 6;
1856}
1857
1858/**
1859 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
1860 *
1861 * Pulled from:
1862 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
1863 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001864message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07001865 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07001866
1867 optional int64 rx_bytes = 2;
1868
1869 optional int64 rx_packets = 3;
1870
1871 optional int64 tx_bytes = 4;
1872
1873 optional int64 tx_packets = 5;
1874}
1875
1876/**
1877 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
1878 *
1879 * Pulled from:
1880 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
1881 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001882message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07001883 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07001884
Yao Chenc40a19d2018-03-15 16:48:25 -07001885 // 1 denotes foreground and 0 denotes background. This is called Set in
1886 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001887 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07001888
1889 optional int64 rx_bytes = 3;
1890
1891 optional int64 rx_packets = 4;
1892
1893 optional int64 tx_bytes = 5;
1894
1895 optional int64 tx_packets = 6;
1896}
1897
1898/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001899 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
1900 *
1901 * Pulled from:
1902 * StatsCompanionService
1903 */
1904message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07001905 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08001906
1907 optional int64 rx_bytes = 2;
1908
1909 optional int64 tx_bytes = 3;
1910}
1911
1912/**
David Chenc8a43242017-10-17 16:23:28 -07001913 * Pulls the kernel wakelock durations. This atom is adapted from
1914 * android/internal/os/KernelWakelockStats.java
1915 *
1916 * Pulled from:
1917 * StatsCompanionService using KernelWakelockReader.
1918 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001919message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07001920 optional string name = 1;
1921
1922 optional int32 count = 2;
1923
1924 optional int32 version = 3;
1925
1926 optional int64 time = 4;
1927}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07001928
Chenjie Yu05013b32017-11-21 10:21:41 -08001929/**
Chenjie Yuc8b7f222018-01-11 23:25:57 -08001930 * Pulls low power state information. This includes platform and subsystem sleep state information,
1931 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in
Chenjie Yu5305e1d2017-10-31 13:49:36 -07001932 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07001933 * hardware/interfaces/power/1.1/types.hal
1934 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001935message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08001936 // Subsystem name
1937 optional string subsystem_name = 1;
1938 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
1939 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
1940 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08001941 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08001942 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08001943 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08001944 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07001945}
Chenjie Yu7f8def92017-11-03 09:33:15 -07001946
Chenjie Yu05013b32017-11-21 10:21:41 -08001947/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07001948 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08001949 * Pulls the time the cpu spend on the frequency index. Frequency index
1950 * starts from highest to lowest. The value should be monotonically
1951 * increasing since boot. However, if there is a cpu
1952 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07001953 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001954message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07001955 optional uint32 cluster = 1;
1956 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08001957 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07001958}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001959
Chenjie Yu05013b32017-11-21 10:21:41 -08001960/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001961 * Pulls Cpu Time Per Uid.
1962 * Note that isolated process uid time should be attributed to host uids.
1963 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001964message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07001965 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00001966 optional uint64 user_time_micros = 2;
1967 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001968}
1969
1970/**
1971 * Pulls Cpu Time Per Uid per frequency.
1972 * Note that isolated process uid time should be attributed to host uids.
1973 * For each uid, we order the time by descending frequencies.
1974 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08001975message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07001976 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08001977 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08001978 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08001979}
Hugo Benichi884970e2017-11-14 22:42:46 +09001980
Chenjie Yu05013b32017-11-21 10:21:41 -08001981/**
1982 * Pulls Wifi Controller Activity Energy Info
1983 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001984message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08001985 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08001986 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08001987 // stack reported state
1988 // TODO: replace this with proto enum
1989 optional int32 stack_state = 2;
1990 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001991 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08001992 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001993 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08001994 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08001995 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08001996 // product of current(mA), voltage(V) and time(ms)
1997 optional uint64 controller_energy_used = 6;
1998}
1999
2000/**
2001 * Pulls Modem Activity Energy Info
2002 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002003message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002004 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002005 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002006 // sleep time in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08002007 optional uint64 sleep_time_millis = 2;
Chenjie Yu05013b32017-11-21 10:21:41 -08002008 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002009 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002010 /**
2011 * Tx power index
2012 * index 0 = tx_power < 0dBm
2013 * index 1 = 0dBm < tx_power < 5dBm
2014 * index 2 = 5dBm < tx_power < 15dBm
2015 * index 3 = 15dBm < tx_power < 20dBm
2016 * index 4 = tx_power > 20dBm
2017 */
2018 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002019 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002020 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002021 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002022 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002023 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002024 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002025 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002026 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002027 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002028 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002029 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002030 // product of current(mA), voltage(V) and time(ms)
2031 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002032}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002033
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002034/**
2035 * Pulls Bluetooth Activity Energy Info
2036 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2037 */
2038message BluetoothActivityInfo {
2039 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002040 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002041 // bluetooth stack state
2042 optional int32 bluetooth_stack_state = 2;
2043 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002044 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002045 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002046 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002047 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002048 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002049 // product of current(mA), voltage(V) and time(ms)
2050 optional uint64 energy_used = 6;
2051}
2052
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002053/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002054 * Logs the memory stats for a process.
2055 */
2056message ProcessMemoryState {
2057 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002058 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002059
2060 // The process name.
2061 optional string process_name = 2;
2062
2063 // oom adj score.
2064 optional int32 oom_score = 3;
2065
2066 // # of page-faults
2067 optional int64 pgfault = 4;
2068
2069 // # of major page-faults
2070 optional int64 pgmajfault = 5;
2071
Rajeev Kumar90235992018-01-29 11:06:48 -08002072 // RSS
2073 optional int64 rss_in_bytes = 6;
2074
2075 // CACHE
2076 optional int64 cache_in_bytes = 7;
2077
2078 // SWAP
2079 optional int64 swap_in_bytes = 8;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002080}
2081
2082/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002083 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002084 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002085message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002086 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002087}
2088
2089/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002090 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002091 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002092message SystemUptime {
2093 // Milliseconds since the system was booted.
2094 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
2095 // for external input).
2096 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08002097 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002098}
2099
2100/*
2101 * Reads from /proc/uid_concurrent_active_time which has the format:
2102 * active: X (X is # cores)
2103 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
2104 * [uid1]: [time-0] [time-1] [time-2] ... ...
2105 * ...
2106 * Time-N means the CPU time a UID spent running concurrently with N other processes.
2107 * The file contains a monotonically increasing count of time for a single boot.
2108 */
2109message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002110 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002111 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002112}
2113
2114/**
2115 * Reads from /proc/uid_concurrent_policy_time which has the format:
2116 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
2117 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2118 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2119 * ...
2120 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
2121 * The file contains a monotonically increasing count of time for a single boot.
2122 */
2123message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002124 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002125 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002126 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08002127}
2128
2129/*
2130 * Pulls free disk space, for data, system partition and temporary directory.
2131 */
2132message DiskSpace {
2133 // available bytes in data partition
2134 optional uint64 data_available_bytes = 1;
2135 // available bytes in system partition
2136 optional uint64 system_available_bytes = 2;
2137 // available bytes in download cache or temp directories
2138 optional uint64 temp_available_bytes = 3;
2139}
Tej Singhbf972d92018-01-10 20:51:13 -08002140
2141/**
2142 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002143 * Pulled from:
2144 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002145 */
2146message RemainingBatteryCapacity {
2147 optional int32 charge_uAh = 1;
2148}
2149
2150/**
2151 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002152 * Pulled from:
2153 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002154 */
2155message FullBatteryCapacity {
2156 optional int32 capacity_uAh = 1;
Tej Singh40298312018-02-16 00:15:09 -08002157}
2158
2159/**
Tej Singhd89137e2018-03-26 14:51:40 -07002160 * Pulls the temperature of various parts of the device.
2161 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08002162 *
2163 * Pulled from:
2164 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
2165 */
2166message Temperature {
2167 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY.
2168 optional android.os.TemperatureTypeEnum sensor_location = 1;
2169
2170 // The name of the temperature source. Eg. CPU0
2171 optional string sensor_name = 2;
2172
Tej Singhd89137e2018-03-26 14:51:40 -07002173 // Temperature in tenths of a degree C.
2174 optional int32 temperature_dC = 3;
yroa1fe77c2018-02-26 14:22:54 -08002175}
lifr35a7cf02018-12-12 16:38:04 +08002176
2177/**
2178 * Logs the latency period(in microseconds) and the return code of
2179 * the DNS(Domain Name System) lookups.
2180 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
2181 * to get info(address or hostname) from DNS server(or DNS cache).
2182 * Logged from:
2183 * /system/netd/server/DnsProxyListener.cpp
2184 */
2185message NetworkDnsEventReported {
2186 // The types of the DNS lookups, as defined in
2187 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
2188 enum EventType {
2189 EVENT_UNKNOWN = 0;
2190 EVENT_GETADDRINFO = 1;
2191 EVENT_GETHOSTBYNAME = 2;
2192 EVENT_GETHOSTBYADDR = 3;
2193 EVENT_RES_NSEND = 4;
2194 }
2195 optional EventType event_type = 1;
2196
2197 // The return value of the DNS resolver for each DNS lookups.
2198 //bionic/libc/include/netdb.h
2199 //system/netd/resolv/include/netd_resolv/resolv.h
2200 enum ReturnCode {
2201 EAI_NO_ERROR = 0;
2202 EAI_ADDRFAMILY = 1;
2203 EAI_AGAIN = 2;
2204 EAI_BADFLAGS = 3;
2205 EAI_FAIL = 4;
2206 EAI_FAMILY = 5;
2207 EAI_MEMORY = 6;
2208 EAI_NODATA = 7;
2209 EAI_NONAME = 8;
2210 EAI_SERVICE = 9;
2211 EAI_SOCKTYPE = 10;
2212 EAI_SYSTEM = 11;
2213 EAI_BADHINTS = 12;
2214 EAI_PROTOCOL = 13;
2215 EAI_OVERFLOW = 14;
2216 RESOLV_TIMEOUT = 255;
2217 EAI_MAX = 256;
2218 }
2219 optional ReturnCode return_code = 2;
2220
2221 // The latency period(in microseconds) it took for this DNS lookup to complete.
2222 optional int32 latency_micros = 3;
2223}
2224
Chiachang Wang67f24472019-01-15 15:14:00 +08002225/**
2226 * Logs when a data stall event occurs.
2227 *
2228 * Log from:
2229 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
2230 */
2231message DataStallEvent {
2232 // Data stall evaluation type.
2233 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
2234 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
2235 optional int32 evaluation_type = 1;
2236 // See definition in data_stall_event.proto.
2237 optional com.android.server.connectivity.ProbeResult validation_result = 2;
2238 // See definition in data_stall_event.proto.
2239 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
2240 // See definition in data_stall_event.proto.
2241 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
2242 // See definition in data_stall_event.proto.
2243 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
2244 // See definition in data_stall_event.proto.
2245 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
2246}
Jack Yu6d421bc2019-01-23 17:42:54 +08002247
2248/**
2249 * Logs when a NFC device's error occurred.
2250 * Logged from:
2251 * system/nfc/src/nfc/nfc/nfc_ncif.cc
2252 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
2253 */
2254message NfcErrorOccurred {
2255 enum Type {
2256 UNKNOWN = 0;
2257 CMD_TIMEOUT = 1;
2258 ERROR_NOTIFICATION = 2;
2259 AID_OVERFLOW = 3;
2260 }
2261 optional Type type = 1;
2262 // If it's nci cmd timeout, log the timeout command.
2263 optional uint32 nci_cmd = 2;
2264
2265 optional uint32 error_ntf_status_code = 3;
2266}
2267
2268/**
2269 * Logs when a NFC device's state changed event
2270 * Logged from:
2271 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
2272 */
2273message NfcStateChanged {
2274 enum State {
2275 UNKNOWN = 0;
2276 OFF = 1;
2277 ON = 2;
2278 ON_LOCKED = 3; // Secure Nfc enabled.
2279 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
2280 }
2281 optional State state = 1;
2282}
2283
2284/**
2285 * Logs when a NFC Beam Transaction occurred.
2286 * Logged from:
2287 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
2288 */
2289message NfcBeamOccurred {
2290 enum Operation {
2291 UNKNOWN = 0;
2292 SEND = 1;
2293 RECEIVE = 2;
2294 }
2295 optional Operation operation = 1;
2296}
2297
2298/**
2299 * Logs when a NFC Card Emulation Transaction occurred.
2300 * Logged from:
2301 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
2302 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
2303 */
2304message NfcCardemulationOccurred {
2305 enum Category {
2306 UNKNOWN = 0;
2307 HCE_PAYMENT = 1;
2308 HCE_OTHER = 2;
2309 OFFHOST = 3;
2310 }
2311 // Transaction belongs to HCE payment or HCE other category, or offhost.
2312 optional Category category = 1;
2313 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
2314 optional string se_name = 2;
2315}
2316
2317/**
2318 * Logs when a NFC Tag event occurred.
2319 * Logged from:
2320 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
2321 */
2322message NfcTagOccurred {
2323 enum Type {
2324 UNKNOWN = 0;
2325 URL = 1;
2326 BT_PAIRING = 2;
2327 PROVISION = 3;
2328 WIFI_CONNECT = 4;
2329 APP_LAUNCH = 5;
2330 OTHERS = 6;
2331 }
2332 optional Type type = 1;
2333}
2334
2335/**
2336 * Logs when Hce transaction triggered
2337 * Logged from:
2338 * system/nfc/src/nfc/nfc/nfc_ncif.cc
2339 */
2340message NfcHceTransactionOccurred {
2341 // The latency period(in microseconds) it took for the first HCE data
2342 // exchange.
2343 optional uint32 latency_micros = 1;
2344}
2345
2346/**
2347 * Logs when SecureElement state event changed
2348 * Logged from:
2349 * packages/apps/SecureElement/src/com/android/se/Terminal.java
2350 */
2351message SeStateChanged {
2352 enum State {
2353 UNKNOWN = 0;
2354 INITIALIZED = 1;
2355 DISCONNECTED = 2;
2356 CONNECTED = 3;
2357 HALCRASH = 4;
2358 }
2359 optional State state = 1;
2360
2361 optional string state_change_reason = 2;
2362 // SIMx or eSEx.
2363 optional string terminal = 3;
2364}
2365
2366/**
2367 * Logs when Omapi API used
2368 * Logged from:
2369 * packages/apps/SecureElement/src/com/android/se/Terminal.java
2370 */
2371message SeOmapiReported {
2372 enum Operation {
2373 UNKNOWN = 0;
2374 OPEN_CHANNEL = 1;
2375 }
2376 optional Operation operation = 1;
2377 // SIMx or eSEx.
2378 optional string terminal = 2;
2379
2380 optional string package_name = 3;
2381}