blob: f04f017d8911f39ac14b4e98c1d4f39da7cc3cef [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";
Jack He924f3462019-01-09 20:54:41 -080026import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080027import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack He52260142018-12-18 15:43:27 -080028import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack He22e4a1d2019-01-09 01:19:13 -080029import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Jack He4d6abe62019-01-20 21:22:46 -080030import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto";
Chiachang Wang67f24472019-01-15 15:14:00 +080031import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080032import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wang67f24472019-01-15 15:14:00 +080033import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080034import "frameworks/base/core/proto/android/server/enums.proto";
Chiachang Wang4d6fe322019-03-21 20:40:01 +080035import "frameworks/base/core/proto/android/stats/connectivity/network_stack.proto";
lifrd1300022019-05-03 12:02:54 +080036import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.proto";
Yao Chen046b5122018-10-24 14:09:20 -070037import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080038import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080039import "frameworks/base/core/proto/android/telephony/enums.proto";
40import "frameworks/base/core/proto/android/view/enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080041
Yao Chend54f9dd2017-10-17 17:37:48 +000042/**
Stefan Lafonae2df012017-11-14 09:17:21 -080043 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000044 * raw stats log events from the Android system, also known as "atoms."
45 *
46 * This field contains a single oneof with all of the available messages.
47 * The stats-log-api-gen tool runs as part of the Android build and
48 * generates the android.util.StatsLog class, which contains the constants
49 * and methods that Android uses to log.
50 *
Stefan Lafonae2df012017-11-14 09:17:21 -080051 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000052 * Instead, statsd on Android constructs these messages synthetically,
53 * in the format defined here and in stats_log.proto.
54 */
Stefan Lafonae2df012017-11-14 09:17:21 -080055message Atom {
56 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070057 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070058 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
59 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080060 // 3 is available for use
Bookatzc1a050a2017-10-10 15:49:28 -070061 BleScanResultReceived ble_scan_result_received = 4;
62 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080063 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070064 SyncStateChanged sync_state_changed = 7;
65 ScheduledJobStateChanged scheduled_job_state_changed = 8;
66 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070067 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080068 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
69 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
70 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Hyunyoung Songcc651c12018-10-17 13:35:32 -070071 // 14 - 18 are available
72 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080073 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
74 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
75 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070076 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080077 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070078 CameraStateChanged camera_state_changed = 25;
79 FlashlightStateChanged flashlight_state_changed = 26;
80 UidProcessStateChanged uid_process_state_changed = 27;
81 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
82 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070083 BatteryLevelChanged battery_level_changed = 30;
84 ChargingStateChanged charging_state_changed = 31;
85 PluggedStateChanged plugged_state_changed = 32;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080086 // 33 - 34 are available
Bookatz8c6571b2017-10-24 15:04:41 -070087 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
88 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -070089 WifiLockStateChanged wifi_lock_state_changed = 37;
90 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
91 WifiScanStateChanged wifi_scan_state_changed = 39;
92 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -070093 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -070094 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -070095 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +090096 PacketWakeupOccurred packet_wakeup_occurred = 44;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080097 // 45 is available
Bookatz8fcd09a2017-12-18 13:01:10 -080098 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -080099 AppBreadcrumbReported app_breadcrumb_reported = 47;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800100 AppStartOccurred app_start_occurred = 48;
101 AppStartCanceled app_start_canceled = 49;
102 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800103 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800104 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800105 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800106 LmkStateChanged lmk_state_changed = 54;
107 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800108 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800109 BootSequenceReported boot_sequence_reported = 57;
Tej Singhbb8554a2018-01-26 11:59:14 -0800110 DaveyOccurred davey_occurred = 58;
Chenjie Yue8904192017-12-08 19:12:57 -0800111 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800112 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800113 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800114 KeyguardStateChanged keyguard_state_changed = 62;
115 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
116 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800117 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800118 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800119 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
120 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Tej Singh02200f92018-04-02 19:37:59 -0700121 // 69 is blank but need not be.
Andrew Chantb56388b2018-03-22 21:07:33 -0700122 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800123 SpeakerImpedanceReported speaker_impedance_reported = 71;
124 HardwareFailed hardware_failed = 72;
125 PhysicalDropDetected physical_drop_detected = 73;
126 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800127 MobileConnectionStateChanged mobile_connection_state_changed = 75;
128 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700129 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800130 AppCrashOccurred app_crash_occurred = 78;
131 ANROccurred anr_occurred = 79;
132 WTFOccurred wtf_occurred = 80;
Yangster4ccebea2018-10-09 17:09:02 -0700133 PhoneServiceStateChanged phone_service_state_changed = 94;
134 PhoneStateChanged phone_state_changed = 95;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800135 LowMemReported low_mem_reported = 81;
Yangster-mac80c44742018-08-26 12:20:16 -0700136 ThermalThrottlingStateChanged thermal_throttling = 86;
lifrd1300022019-05-03 12:02:54 +0800137 NetworkDnsEventReported network_dns_event_reported = 116 [(log_from_module) = "resolv"];
Chiachang Wange987ba62019-04-11 21:24:28 +0800138 DataStallEvent data_stall_event = 121 [(log_from_module) = "network_stack"];
Jack He52260142018-12-18 15:43:27 -0800139 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack He22e4a1d2019-01-09 01:19:13 -0800140 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
141 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Jack Yu6d421bc2019-01-23 17:42:54 +0800142 NfcErrorOccurred nfc_error_occurred = 134;
143 NfcStateChanged nfc_state_changed = 135;
144 NfcBeamOccurred nfc_beam_occurred = 136;
145 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
146 NfcTagOccurred nfc_tag_occurred = 138;
147 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
148 SeStateChanged se_state_changed = 140;
149 SeOmapiReported se_omapi_reported = 141;
Jack He924f3462019-01-09 20:54:41 -0800150 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
151 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
152 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
153 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
154 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
155 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
156 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
157 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
158 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He4d6abe62019-01-20 21:22:46 -0800159 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
160 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
161 BluetoothManufacturerInfoReported bluetooth_device_info_reported = 162;
162 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
163 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
164 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
165 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
166 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Hui Yuf57e4012019-02-13 12:29:38 -0800167 ProcessStartTime process_start_time = 169;
Jack He9c30c7c6b2019-01-30 17:24:55 -0800168 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Chiachang Wange987ba62019-04-11 21:24:28 +0800169 NetworkStackReported network_stack_reported = 182 [(log_from_module) = "network_stack"];
Yao Chend54f9dd2017-10-17 17:37:48 +0000170 }
David Chenc8a43242017-10-17 16:23:28 -0700171
David Chen6e3e6cb2018-01-03 16:14:06 -0800172 // Pulled events will start at field 10000.
Tej Singh40298312018-02-16 00:15:09 -0800173 // Next: 10022
David Chenc8a43242017-10-17 16:23:28 -0700174 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800175 WifiBytesTransfer wifi_bytes_transfer = 10000;
176 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
177 MobileBytesTransfer mobile_bytes_transfer = 10002;
178 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800179 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800180 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800181 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800182 CpuTimePerFreq cpu_time_per_freq = 10008;
183 CpuTimePerUid cpu_time_per_uid = 10009;
184 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800185 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800186 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800187 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800188 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800189 SystemElapsedRealtime system_elapsed_realtime = 10014;
190 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800191 CpuActiveTime cpu_active_time = 10016;
192 CpuClusterTime cpu_cluster_time = 10017;
Chenjie Yu937d7422018-01-10 16:37:53 -0800193 DiskSpace disk_space = 10018;
Tej Singhbf972d92018-01-10 20:51:13 -0800194 RemainingBatteryCapacity remaining_battery_capacity = 10019;
195 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800196 Temperature temperature = 10021;
David Chenc8a43242017-10-17 16:23:28 -0700197 }
yroa1fe77c2018-02-26 14:22:54 -0800198
Bookatz76aafcf2018-09-17 16:17:10 -0700199 // DO NOT USE field numbers above 100,000 in AOSP.
200 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
201 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700202}
203
Yao Chend54f9dd2017-10-17 17:37:48 +0000204/**
Yangster-mac20877162017-12-22 17:19:39 -0800205 * This proto represents a node of an attribution chain.
206 * Note: All attribution chains are represented as a repeated field of type
207 * AttributionNode. It is understood that in such arrays, the order is that
208 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000209 */
Yangster-mac20877162017-12-22 17:19:39 -0800210message AttributionNode {
211 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800212 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800213
Yangster-mac20877162017-12-22 17:19:39 -0800214 // The (optional) string tag for an element in the attribution chain. If the
215 // element has no tag, it is encoded as an empty string.
216 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700217}
218
Yao Chend54f9dd2017-10-17 17:37:48 +0000219/*
220 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800221 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000222 *
223 * RULES:
224 * - The field ids for each atom must start at 1, and count upwards by 1.
225 * Skipping field ids is not allowed.
226 * - These form an API, so renaming, renumbering or removing fields is
227 * not allowed between android releases. (This is not currently enforced,
228 * but there will be a tool to enforce this restriction).
229 * - The types must be built-in protocol buffer types, namely, no sub-messages
230 * are allowed (yet). The bytes type is also not allowed.
231 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800232 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000233 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800234 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000235 * - A field that is a uid should be a string field, tagged with the [xxx]
236 * annotation. The generated code on android will be represented by UIDs,
237 * and those UIDs will be translated in xxx to those strings.
238 *
239 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700240 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000241 * - If there is a UID, it goes first. Think in an object-oriented fashion.
242 * *****************************************************************************
243 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700244
Yao Chend54f9dd2017-10-17 17:37:48 +0000245/**
Yangster-mac80c44742018-08-26 12:20:16 -0700246 * Logs when the Thermal service HAL notifies the throttling start/stop events.
247 *
248 * Logged from:
249 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
250 */
251message ThermalThrottlingStateChanged {
252 optional android.os.TemperatureTypeEnum sensor_type = 1;
253
254 enum State {
255 UNKNOWN = 0;
256 START = 1;
257 STOP = 2;
258 }
259
260 optional State state = 2;
261
262 optional float temperature = 3;
263}
264
265/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000266 * Logs when the screen state changes.
267 *
268 * Logged from:
269 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
270 */
271message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800272 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800273 optional android.view.DisplayStateEnum state = 1 [(stateFieldOption).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700274}
Yao Chend54f9dd2017-10-17 17:37:48 +0000275
276/**
Bookatzc1a050a2017-10-10 15:49:28 -0700277 * Logs that the state of a process state, as per the activity manager, has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000278 *
279 * Logged from:
280 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
281 */
Bookatzc1a050a2017-10-10 15:49:28 -0700282message UidProcessStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700283 optional int32 uid = 1 [(stateFieldOption).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000284
Bookatzdb026a22018-01-10 19:01:56 -0800285 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800286 optional android.app.ProcessStateEnum state = 2 [(stateFieldOption).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000287}
288
289/**
Bookatzc1a050a2017-10-10 15:49:28 -0700290 * Logs that a process started, finished, crashed, or ANRed.
291 *
292 * Logged from:
293 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
294 */
295message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700296 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700297
David Chen0b5c90c2018-01-25 16:51:49 -0800298 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800299 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700300
Bookatzddccf0a2017-11-28 16:48:14 -0800301 // What lifecycle state the process changed to.
302 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800303 enum State {
304 FINISHED = 0;
305 STARTED = 1;
306 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800307 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800308 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700309}
310
Bookatzc1a050a2017-10-10 15:49:28 -0700311/**
312 * Logs when the ble scan state changes.
313 *
314 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700315 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700316 */
317message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800318 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700319
320 enum State {
321 OFF = 0;
322 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700323 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
324 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700325 }
326 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700327
Bookatze5ec0b42018-03-26 13:34:56 -0700328 // Does the scan have a filter.
329 optional bool is_filtered = 3;
330 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
331 optional bool is_first_match = 4;
332 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
333 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700334}
335
336/**
337 * Logs reporting of a ble scan finding results.
338 *
339 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700340 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700341 */
Bookatzae6738e2018-09-13 11:38:56 -0700342// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700343message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800344 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700345
346 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800347 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700348}
349
350/**
351 * Logs when a sensor state changes.
352 *
353 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700354 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700355 */
356message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800357 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700358
Bookatzc1a050a2017-10-10 15:49:28 -0700359 // The id (int) of the sensor.
360 optional int32 sensor_id = 2;
361
362 enum State {
363 OFF = 0;
364 ON = 1;
365 }
366 optional State state = 3;
367}
368
369
370/**
371 * Logs when GPS state changes.
372 *
373 * Logged from:
374 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
375 */
376message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800377 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700378
379 enum State {
380 OFF = 0;
381 ON = 1;
382 }
383 optional State state = 2;
384}
385
386
387/**
388 * Logs when a sync manager sync state changes.
389 *
390 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700391 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700392 */
393message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800394 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700395
David Chen0b5c90c2018-01-25 16:51:49 -0800396 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800397 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700398
399 enum State {
400 OFF = 0;
401 ON = 1;
402 }
403 optional State state = 3;
404}
405
406/**
407 * Logs when a job scheduler job state changes.
408 *
409 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700410 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700411 */
412message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800413 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700414
415 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800416 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700417
418 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800419 FINISHED = 0;
420 STARTED = 1;
421 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700422 }
423 optional State state = 3;
424
Tej Singh33a412b2018-03-16 18:43:59 -0700425 // The reason a job has stopped.
426 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700427 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700428 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700429}
430
431/**
432 * Logs when the audio state changes.
433 *
434 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700435 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700436 */
437message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800438 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700439
440 enum State {
441 OFF = 0;
442 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700443 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
444 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700445 }
446 optional State state = 2;
447}
448
449/**
450 * Logs when the video codec state changes.
451 *
452 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700453 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700454 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800455message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800456 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700457
458 enum State {
459 OFF = 0;
460 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700461 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
462 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700463 }
464 optional State state = 2;
465}
466
467/**
468 * Logs when the flashlight state changes.
469 *
470 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700471 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700472 */
473message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800474 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700475
476 enum State {
477 OFF = 0;
478 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700479 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
480 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700481 }
482 optional State state = 2;
483}
484
485/**
486 * Logs when the camera state changes.
487 *
488 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700489 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700490 */
491message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800492 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700493
494 enum State {
495 OFF = 0;
496 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700497 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
498 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700499 }
500 optional State state = 2;
501}
502
503/**
504 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000505 *
506 * Logged from:
507 * TODO
508 */
Bookatzd6746242017-10-24 18:39:35 -0700509message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800510 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000511
Bookatz1a1b0462018-01-12 11:47:03 -0800512 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
513 // From frameworks/base/core/proto/android/os/enums.proto.
514 optional android.os.WakeLockLevelEnum level = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700515
516 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
517 optional string tag = 3;
518
519 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800520 RELEASE = 0;
521 ACQUIRE = 1;
522 CHANGE_RELEASE = 2;
523 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700524 }
525 optional State state = 4;
526}
527
528/**
Bookatzc1a050a2017-10-10 15:49:28 -0700529 * Logs when a partial wakelock is considered 'long' (over 1 min).
530 *
531 * Logged from:
532 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
533 */
534message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800535 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700536
Yao Chend54f9dd2017-10-17 17:37:48 +0000537 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
538 optional string tag = 2;
539
Bookatzc1a050a2017-10-10 15:49:28 -0700540 // TODO: I have no idea what this is.
541 optional string history_tag = 3;
542
543 enum State {
544 OFF = 0;
545 ON = 1;
546 }
547 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000548}
549
Bookatzc1a050a2017-10-10 15:49:28 -0700550/**
551 * Logs Battery Saver state change.
552 *
553 * Logged from:
554 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
555 */
556message BatterySaverModeStateChanged {
557 enum State {
558 OFF = 0;
559 ON = 1;
560 }
561 optional State state = 1;
562}
563
564/**
565 * Logs Doze mode state change.
566 *
567 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800568 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700569 */
570message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800571 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800572}
573
574
575/**
576 * Logs state change of Doze mode including maintenance windows.
577 *
578 * Logged from:
579 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
580 */
581message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800582 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700583}
584
585/**
586 * Logs screen brightness level.
587 *
588 * Logged from:
589 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
590 */
591message ScreenBrightnessChanged {
592 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
593 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700594}
595
596/**
597 * Logs battery level (percent full, from 0 to 100).
598 *
599 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700600 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700601 */
602message BatteryLevelChanged {
603 // Battery level. Should be in [0, 100].
604 optional int32 battery_level = 1;
605}
606
607/**
608 * Logs change in charging status of the device.
609 *
610 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700611 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700612 */
613message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800614 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
615 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700616}
617
618/**
619 * Logs whether the device is plugged in, and what power source it is using.
620 *
621 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700622 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700623 */
624message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800625 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
626 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700627}
628
Bookatz8c6571b2017-10-24 15:04:41 -0700629/**
630 * Logs when an app's wakeup alarm fires.
631 *
632 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700633 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700634 */
635message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800636 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800637
638 // Name of the wakeup alarm.
639 optional string tag = 2;
640}
641
642/**
643 * Logs when an an app causes the mobile radio to change state.
644 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
645 *
646 * Logged from:
647 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
648 */
649message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800650 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800651
Bookatz1a1b0462018-01-12 11:47:03 -0800652 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
653 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800654}
655
656/**
657 * Logs when an an app causes the wifi radio to change state.
658 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
659 *
660 * Logged from:
661 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
662 */
663message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800664 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800665
Bookatz1a1b0462018-01-12 11:47:03 -0800666 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
667 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700668}
669
670/**
671 * Logs kernel wakeup reasons and aborts.
672 *
673 * Logged from:
674 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
675 */
676message KernelWakeupReported {
677 // Name of the kernel wakeup reason (or abort).
678 optional string wakeup_reason_name = 1;
679
680 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800681 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700682}
683
684/**
685 * Logs wifi locks held by an app.
686 *
687 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700688 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700689 */
690message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800691 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700692
693 enum State {
694 OFF = 0;
695 ON = 1;
696 }
697 optional State state = 2;
698}
699
700/**
701 * Logs wifi signal strength changes.
702 *
703 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700704 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700705 */
706message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800707 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
708 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700709}
710
711/**
712 * Logs wifi scans performed by an app.
713 *
714 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700715 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700716 */
717message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800718 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700719
720 enum State {
721 OFF = 0;
722 ON = 1;
723 }
724 optional State state = 2;
725}
726
727/**
Tej Singh4503e102018-01-04 14:35:01 -0800728 * Logs wifi multicast locks held by an app
729 *
730 * Logged from:
731 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
732 */
733message WifiMulticastLockStateChanged {
734 repeated AttributionNode attribution_node = 1;
735
736 enum State {
737 OFF = 0;
738 ON = 1;
739 }
740 optional State state = 2;
741}
742
743/**
Tej Singh1ea42892018-01-19 09:27:00 -0800744 * Logs shutdown reason and duration on next boot.
745 *
746 * Logged from:
747 * frameworks/base/core/java/com/android/server/BootReceiver.java
748 */
749message ShutdownSequenceReported {
750 // True if shutdown is for a reboot. Default: false if we do not know.
751 optional bool reboot = 1;
752
753 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
754 optional string reason = 2;
755
756 // Beginning of shutdown time in ms using wall clock time since unix epoch.
757 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -0800758 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -0800759
760 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -0800761 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -0800762}
763
Tej Singh6483ea42018-01-25 17:45:49 -0800764
765/**
766 * Logs boot reason and duration.
767 *
768 * Logged from:
769 * system/core/bootstat/bootstat.cpp
770 */
771message BootSequenceReported {
772 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
773 // Default: "<EMPTY>" if not available.
774 optional string bootloader_reason = 1;
775
776 // Reason for system boot. Eg. bootloader, reboot,userrequested
777 // Default: "<EMPTY>" if not available.
778 optional string system_reason = 2;
779
780 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -0800781 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -0800782
783 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800784 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -0800785
786 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800787 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -0800788
789 // Time since last boot in ms. Default: 0 if not available.
790 optional int64 time_since_last_boot = 6;
791}
792
Tej Singhc477d9c2018-02-05 18:31:39 -0800793
794/**
795 * Logs call state and disconnect cause (if applicable).
796 *
797 * Logged from:
798 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
799 */
800message CallStateChanged {
801 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
802 // From frameworks/base/core/proto/android/telecomm/enums.proto.
803 optional android.telecom.CallStateEnum call_state = 1;
804
805 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
806 // This value is only applicable when the call_state is DISCONNECTED, and
807 // should always be UNKNOWN if the call_state is not DISCONNECTED.
808 // From frameworks/base/core/proto/android/telecomm/enums.proto.
809 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
810
811 // True if the call is self-managed, which are apps that use the
812 // telecom infrastructure to make their own calls.
813 optional bool self_managed = 3;
814
815 // True if call is external. External calls are calls on connected Wear
816 // devices but show up in Telecom so the user can pull them onto the device.
817 optional bool external_call = 4;
818}
819
Tej Singh1ea42892018-01-19 09:27:00 -0800820/**
Tej Singhdd7bd352018-02-09 19:33:15 -0800821 * Logs keyguard state. The keyguard is the lock screen.
822 *
823 * Logged from:
824 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
825 */
826message KeyguardStateChanged {
827 enum State {
828 UNKNOWN = 0;
829 // The keyguard is hidden when the phone is unlocked.
830 HIDDEN = 1;
831 // The keyguard is shown when the phone is locked (screen turns off).
832 SHOWN= 2;
833 // The keyguard is occluded when something is overlaying the keyguard.
834 // Eg. Opening the camera while on the lock screen.
835 OCCLUDED = 3;
836 }
837 optional State state = 1;
838}
839
840/**
841 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
842 * prompts the user to enter a password (pattern, pin, etc).
843 *
844 * Logged from:
845 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
846 */
847
848message KeyguardBouncerStateChanged {
849 enum State {
850 UNKNOWN = 0;
851 // Bouncer is hidden, either as a result of successfully entering the
852 // password, screen timing out, or user going back to lock screen.
853 HIDDEN = 1;
854 // This is when the user is being prompted to enter the password.
855 SHOWN = 2;
856 }
857 optional State state = 1;
858}
859
860/**
861 * Logs the result of entering a password into the keyguard bouncer.
862 *
863 * Logged from:
864 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
865 */
866message KeyguardBouncerPasswordEntered {
867 enum BouncerResult {
868 UNKNOWN = 0;
869 // The password entered was incorrect.
870 FAILURE = 1;
871 // The password entered was correct.
872 SUCCESS = 2;
873 }
874 optional BouncerResult result = 1;
875}
876
Tej Singha883b372018-02-15 11:30:01 -0800877/*
878 * Logs changes to the configuration of the device. The configuration is defined
879 * in frameworks/base/core/java/android/content/res/Configuration.java
880 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
881 * Please go there to interpret the possible values each field can be.
882 *
883 * Logged from:
884 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
885 */
886message ResourceConfigurationChanged {
887 // Bit mask of color capabilities of the screen.
888 // Contains information about the color gamut and hdr mode of the screen.
889 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
890 optional int32 colorMode = 1;
891
892 // The target screen density being rendered to.
893 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
894 optional int32 densityDpi = 2;
895
896 // Current user preference for the scaling factor for fonts,
897 // relative to the base density scaling.
898 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
899 optional float fontScale = 3;
900
901 // Flag indicating whether the hard keyboard is hidden.
902 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
903 optional int32 hardKeyboardHidden = 4;
904
905 // The type of keyboard attached to the device.
906 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
907 optional int32 keyboard = 5;
908
909 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
910 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
911 optional int32 keyboardHideen = 6;
912
913 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
914 // 0 if undefined.
915 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
916 optional int32 mcc = 7;
917
918 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
919 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
920 // MNC_ZERO symbol defined in Configuration.java.
921 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
922 optional int32 mnc = 8;
923
924 // The kind of navigation available on the device.
925 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
926 optional int32 navigation = 9;
927
928 // Flag indicating whether the navigation is available.
929 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
930 optional int32 navigationHidden = 10;
931
932 // Overall orientation of the screen.
933 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
934 optional int32 orientation = 11;
935
936 // The current height of the available screen space, in dp units.
937 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
938 optional int32 screenHeightDp = 12;
939
940 // Bit mask of overall layout of the screen.
941 // Contains information about screen size, whether the screen is wider/taller
942 // than normal, whether the screen layout is right-tl-left or left-to-right,
943 // and whether the screen has a rounded shape.
944 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
945 optional int32 screenLayout = 13;
946
947 // Current width of the available screen space, in dp units.
948 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
949 optional int32 screenWidthDp = 14;
950
951 // The smallest screen size an application will see in normal operation.
952 // This is the smallest value of both screenWidthDp and screenHeightDp
953 // in portrait and landscape.
954 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
955 optional int32 smallestScreenWidthDp = 15;
956
957 // The type of touch screen attached to the device.
958 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
959 optional int32 touchscreen = 16;
960
961 // Bit mask of the ui mode.
962 // Contains information about the overall ui mode of the device.
963 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
964 // Also contains information about whether the device is in night mode.
965 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
966 optional int32 uiMode = 17;
967}
968
Tej Singheee317b2018-03-07 19:28:05 -0800969
970/**
971 * Logs changes in the connection state of the mobile radio.
972 *
973 * Logged from:
974 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
975 */
976message MobileConnectionStateChanged {
977 // States are from the state machine DataConnection.java.
978 enum State {
979 UNKNOWN = 0;
980 // The connection is inactive, or disconnected.
981 INACTIVE = 1;
982 // The connection is being activated, or connecting.
983 ACTIVATING = 2;
984 // The connection is active, or connected.
985 ACTIVE = 3;
986 // The connection is disconnecting.
987 DISCONNECTING = 4;
988 // The connection is disconnecting after creating a connection.
989 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
990 }
991 optional State state = 1;
992 // For multi-sim phones, this distinguishes between the sim cards.
993 optional int32 sim_slot_index = 2;
994 // Used to identify the connection. Starts at 0 and increments by 1 for
995 // every new network created. Resets whenever the device reboots.
996 optional int32 data_connection_id = 3;
997 // A bitmask for the capabilities of this connection.
998 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
999 // Default value (if we have no information): 0
1000 optional int64 capabilities = 4;
1001 // If this connection has internet.
1002 // This just checks if the DEFAULT bit of capabilities is set.
1003 optional bool has_internet = 5;
1004}
1005
1006/**
1007 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1008 *
1009 * Logged from:
1010 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1011 */
1012message MobileRadioTechnologyChanged {
1013 optional android.telephony.NetworkTypeEnum state = 1;
1014 // For multi-sim phones, this distinguishes between the sim cards.
1015 optional int32 sim_slot_index = 2;
1016}
1017
Andrew Chantb56388b2018-03-22 21:07:33 -07001018/**
1019 * Logs the VID and PID of any connected USB devices.
1020 *
1021 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1022 *
1023 * Logged by Vendor.
1024 */
1025message UsbDeviceAttached {
1026 optional int32 vid = 1;
1027 optional int32 pid = 2;
1028 optional bool has_audio = 3;
1029 optional bool has_hid = 4;
1030 optional bool has_storage = 5;
1031}
1032
Tej Singheee317b2018-03-07 19:28:05 -08001033
Tej Singhdd7bd352018-02-09 19:33:15 -08001034/**
Tej Singh5d991e12018-03-09 19:48:11 -08001035 * Logs when Bluetooth is enabled and disabled.
1036 *
1037 * Logged from:
1038 * services/core/java/com/android/server/BluetoothManagerService.java
1039 */
1040message BluetoothEnabledStateChanged {
1041 repeated AttributionNode attribution_node = 1;
1042 // Whether or not bluetooth is enabled on the device.
1043 enum State {
1044 UNKNOWN = 0;
1045 ENABLED = 1;
1046 DISABLED = 2;
1047 }
1048 optional State state = 2;
1049 // The reason for being enabled/disabled.
1050 // Eg. Airplane mode, crash, application request.
1051 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1052 // If the reason is an application request, this will be the package name.
1053 optional string pkgName = 4;
1054}
1055
1056/**
Jack He22e4a1d2019-01-09 01:19:13 -08001057 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001058 *
1059 * Logged from:
Jack He22e4a1d2019-01-09 01:19:13 -08001060 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1061 *
1062 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001063 */
1064message BluetoothConnectionStateChanged {
1065 // The state of the connection.
1066 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1067 optional android.bluetooth.ConnectionStateEnum state = 1;
1068 // An identifier that can be used to match connect and disconnect events.
1069 // Currently is last two bytes of a hash of a device level ID and
1070 // the mac address of the bluetooth device that is connected.
Jack He22e4a1d2019-01-09 01:19:13 -08001071 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1072 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001073 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1074 // From android.bluetooth.BluetoothAdapter.java
Jack He22e4a1d2019-01-09 01:19:13 -08001075 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001076 optional int32 bt_profile = 3;
Jack He22e4a1d2019-01-09 01:19:13 -08001077 // An identifier that can be used to match events for this device.
1078 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1079 // Salt: Randomly generated 256 bit value
1080 // Hash algorithm: HMAC-SHA256
1081 // Size: 32 byte
1082 // Default: null or empty if the device identifier is not known
1083 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1084}
1085
1086/**
1087 * Logs when a Bluetooth device connects and disconnects over ACL
1088 *
1089 * Logged from:
1090 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1091 *
1092 * Next Tag: 3
1093 */
1094message BluetoothAclConnectionStateChanged {
1095 // An identifier that can be used to match events for this device.
1096 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1097 // Salt: Randomly generated 256 bit value
1098 // Hash algorithm: HMAC-SHA256
1099 // Size: 32 byte
1100 // Default: null or empty if the device identifier is not known
1101 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1102 // The state of the connection.
1103 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1104 optional android.bluetooth.ConnectionStateEnum state = 2;
1105}
1106
1107/**
1108 * Logs when a Bluetooth device connects and disconnects over SCO
1109 *
1110 * Logged from:
1111 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1112 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1113 *
1114 * Next Tag: 4
1115 */
1116message BluetoothScoConnectionStateChanged {
1117 // An identifier that can be used to match events for this device.
1118 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1119 // Salt: Randomly generated 256 bit value
1120 // Hash algorithm: HMAC-SHA256
1121 // Size: 32 byte
1122 // Default: null or empty if the device identifier is not known
1123 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1124 // The state of the connection.
1125 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1126 optional android.bluetooth.ConnectionStateEnum state = 2;
1127 // Codec used for this SCO connection
1128 // Default: UNKNOWN
1129 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001130}
1131
Jack He924f3462019-01-09 20:54:41 -08001132/**
1133 * Logged when active device of a profile changes
1134 *
1135 * Logged from:
1136 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1137 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1138 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1139 */
1140message BluetoothActiveDeviceChanged {
1141 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1142 // From android.bluetooth.BluetoothProfile
1143 optional int32 bt_profile = 1;
1144 // An identifier that can be used to match events for this new active device.
1145 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1146 // Salt: Randomly generated 256 bit value
1147 // Hash algorithm: HMAC-SHA256
1148 // Size: 32 byte
1149 // Default: null or empty if there is no active device for this profile
1150 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1151}
1152
Jack He52260142018-12-18 15:43:27 -08001153// Logs when there is an event affecting Bluetooth device's link layer connection.
1154// - This event is triggered when there is a related HCI command or event
1155// - Users of this metrics can deduce Bluetooth device's connection state from these events
1156// - HCI commands are logged before the command is sent, after receiving command status, and after
1157// receiving command complete
1158// - HCI events are logged when they arrive
1159//
1160// Low level log from system/bt
1161//
1162// Bluetooth classic commands:
1163// - CMD_CREATE_CONNECTION
1164// - CMD_DISCONNECT
1165// - CMD_CREATE_CONNECTION_CANCEL
1166// - CMD_ACCEPT_CONNECTION_REQUEST
1167// - CMD_REJECT_CONNECTION_REQUEST
1168// - CMD_SETUP_ESCO_CONNECTION
1169// - CMD_ACCEPT_ESCO_CONNECTION
1170// - CMD_REJECT_ESCO_CONNECTION
1171// - CMD_ENH_SETUP_ESCO_CONNECTION
1172// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1173//
1174// Bluetooth low energy commands:
1175// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1176// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1177// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1178// - CMD_BLE_CLEAR_WHITE_LIST
1179// - CMD_BLE_ADD_WHITE_LIST
1180// - CMD_BLE_REMOVE_WHITE_LIST
1181//
1182// Bluetooth classic events:
1183// - EVT_CONNECTION_COMP
1184// - EVT_CONNECTION_REQUEST
1185// - EVT_DISCONNECTION_COMP
1186// - EVT_ESCO_CONNECTION_COMP
1187// - EVT_ESCO_CONNECTION_CHANGED
1188//
1189// Bluetooth low energy meta events:
1190// - BLE_EVT_CONN_COMPLETE_EVT
1191// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1192//
1193// Next tag: 10
1194message BluetoothLinkLayerConnectionEvent {
1195 // An identifier that can be used to match events for this device.
1196 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1197 // Salt: Randomly generated 256 bit value
1198 // Hash algorithm: HMAC-SHA256
1199 // Size: 32 byte
1200 // Default: null or empty if the device identifier is not known
1201 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1202 // Connection handle of this connection if available
1203 // Range: 0x0000 - 0x0EFF (12 bits)
1204 // Default: 0xFFFF if the handle is unknown
1205 optional int32 connection_handle = 2;
1206 // Direction of the link
1207 // Default: DIRECTION_UNKNOWN
1208 optional android.bluetooth.DirectionEnum direction = 3;
1209 // Type of this link
1210 // Default: LINK_TYPE_UNKNOWN
1211 optional android.bluetooth.LinkTypeEnum type = 4;
1212
1213 // Reason metadata for this link layer connection event, rules for interpretation:
1214 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1215 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1216 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1217 // set and valid, ignore hci_ble_event
1218
1219 // HCI command associated with this event
1220 // Default: CMD_UNKNOWN
1221 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1222 // HCI event associated with this event
1223 // Default: EVT_UNKNOWN
1224 optional android.bluetooth.hci.EventEnum hci_event = 6;
1225 // HCI BLE meta event associated with this event
1226 // Default: BLE_EVT_UNKNOWN
1227 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1228 // HCI command status code if this is triggerred by hci_cmd
1229 // Default: STATUS_UNKNOWN
1230 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1231 // HCI reason code associated with this event
1232 // Default: STATUS_UNKNOWN
1233 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1234}
1235
Jack He924f3462019-01-09 20:54:41 -08001236/**
1237 * Logs when there is a change in Bluetooth A2DP playback state
1238 *
1239 * Logged from:
1240 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1241 */
1242message BluetoothA2dpPlaybackStateChanged {
1243 // An identifier that can be used to match events for this device.
1244 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1245 // Salt: Randomly generated 256 bit value
1246 // Hash algorithm: HMAC-SHA256
1247 // Size: 32 byte
1248 // Default: null or empty if the device identifier is not known
1249 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1250 // Current playback state
1251 // Default: PLAYBACK_STATE_UNKNOWN
1252 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1253 // Current audio coding mode
1254 // Default: AUDIO_CODING_MODE_UNKNOWN
1255 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1256}
1257
1258/**
1259 * Logs when there is a change in A2DP codec config for a particular remote device
1260 *
1261 * Logged from:
1262 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1263 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1264 */
1265message BluetoothA2dpCodecConfigChanged {
1266 // An identifier that can be used to match events for this device.
1267 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1268 // Salt: Randomly generated 256 bit value
1269 // Hash algorithm: HMAC-SHA256
1270 // Size: 32 byte
1271 // Default: null or empty if the device identifier is not known
1272 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1273 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1274 // Default SOURCE_CODEC_TYPE_INVALID
1275 optional int32 codec_type = 2;
1276 // Codec priroity, the higher the more preferred, -1 for disabled
1277 // Default: CODEC_PRIORITY_DEFAULT
1278 optional int32 codec_priority = 3;
1279 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1280 // Default: SAMPLE_RATE_NONE
1281 optional int32 sample_rate = 4;
1282 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1283 // Default: BITS_PER_SAMPLE_NONE
1284 optional int32 bits_per_sample = 5;
1285 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1286 // Default: CHANNEL_MODE_NONE
1287 optional int32 channel_mode = 6;
1288 // Codec specific values
1289 // Default 0
1290 optional int64 codec_specific_1 = 7;
1291 optional int64 codec_specific_2 = 8;
1292 optional int64 codec_specific_3 = 9;
1293 optional int64 codec_specific_4 = 10;
1294}
1295
1296/**
1297 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1298 * Each codec's capability is logged separately due to statsd restriction
1299 *
1300 * Logged from:
1301 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1302 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1303 */
1304message BluetoothA2dpCodecCapabilityChanged {
1305 // An identifier that can be used to match events for this device.
1306 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1307 // Salt: Randomly generated 256 bit value
1308 // Hash algorithm: HMAC-SHA256
1309 // Size: 32 byte
1310 // Default: null or empty if the device identifier is not known
1311 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1312 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1313 // Default SOURCE_CODEC_TYPE_INVALID
1314 optional int32 codec_type = 2;
1315 // Codec priroity, the higher the more preferred, -1 for disabled
1316 // Default: CODEC_PRIORITY_DEFAULT
1317 optional int32 codec_priority = 3;
1318 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1319 // in BluetoothCodecConfig
1320 // Default: empty and SAMPLE_RATE_NONE for individual item
1321 optional int32 sample_rate = 4;
1322 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1323 // in BluetoothCodecConfig
1324 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1325 optional int32 bits_per_sample = 5;
1326 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1327 // BluetoothCodecConfig
1328 // Default: empty and CHANNEL_MODE_NONE for individual item
1329 optional int32 channel_mode = 6;
1330 // Codec specific values
1331 // Default 0
1332 optional int64 codec_specific_1 = 7;
1333 optional int64 codec_specific_2 = 8;
1334 optional int64 codec_specific_3 = 9;
1335 optional int64 codec_specific_4 = 10;
1336}
1337
1338/**
1339 * Logs when A2DP failed to read from PCM source.
1340 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1341 *
1342 * Logged from:
1343 * system/bt
1344 */
1345message BluetoothA2dpAudioUnderrunReported {
1346 // An identifier that can be used to match events for this device.
1347 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1348 // Salt: Randomly generated 256 bit value
1349 // Hash algorithm: HMAC-SHA256
1350 // Size: 32 byte
1351 // Default: null or empty if the device identifier is not known
1352 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1353 // Encoding interval in nanoseconds
1354 // Default: 0
1355 optional int64 encoding_interval_nanos = 2;
1356 // Number of bytes of PCM data that could not be read from the source
1357 // Default: 0
1358 optional int32 num_missing_pcm_bytes = 3;
1359}
1360
1361/**
1362 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1363 * buffer queue is full and we have to drop data
1364 *
1365 * Logged from:
1366 * system/bt
1367 */
1368message BluetoothA2dpAudioOverrunReported {
1369 // An identifier that can be used to match events for this device.
1370 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1371 // Salt: Randomly generated 256 bit value
1372 // Hash algorithm: HMAC-SHA256
1373 // Size: 32 byte
1374 // Default: null or empty if the device identifier is not known
1375 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1376 // Encoding interval in nanoseconds
1377 // Default: 0
1378 optional int64 encoding_interval_nanos = 2;
1379 // Number of buffers dropped in this event
1380 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1381 // Default: 0
1382 optional int32 num_dropped_buffers = 3;
1383 // Number of encoded buffers dropped in this event
1384 // Default 0
1385 optional int32 num_dropped_encoded_frames = 4;
1386 // Number of encoded bytes dropped in this event
1387 // Default: 0
1388 optional int32 num_dropped_encoded_bytes = 5;
1389}
1390
1391/**
1392 * Logs when we receive reports regarding a device's RSSI value
1393 *
1394 * Logged from:
1395 * system/bt
1396 */
1397message BluetoothDeviceRssiReported {
1398 // An identifier that can be used to match events for this device.
1399 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1400 // Salt: Randomly generated 256 bit value
1401 // Hash algorithm: HMAC-SHA256
1402 // Size: 32 byte
1403 // Default: null or empty if the device identifier is not known
1404 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1405 // Connection handle of this connection if available
1406 // Range: 0x0000 - 0x0EFF (12 bits)
1407 // Default: 0xFFFF if the handle is unknown
1408 optional int32 connection_handle = 2;
1409 // HCI command status code if this is triggerred by hci_cmd
1410 // Default: STATUS_UNKNOWN
1411 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1412 // BR/EDR
1413 // Range: -128 ≤ N ≤ 127 (signed integer)
1414 // Units: dB
1415 // LE:
1416 // Range: -127 to 20, 127 (signed integer)
1417 // Units: dBm
1418 // Invalid when an out of range value is reported
1419 optional int32 rssi = 4;
1420}
1421
1422/**
1423 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1424 *
1425 * Logged from:
1426 * system/bt
1427 */
1428message BluetoothDeviceFailedContactCounterReported {
1429 // An identifier that can be used to match events for this device.
1430 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1431 // Salt: Randomly generated 256 bit value
1432 // Hash algorithm: HMAC-SHA256
1433 // Size: 32 byte
1434 // Default: null or empty if the device identifier is not known
1435 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1436 // Connection handle of this connection if available
1437 // Range: 0x0000 - 0x0EFF (12 bits)
1438 // Default: 0xFFFF if the handle is unknown
1439 optional int32 connection_handle = 2;
1440 // HCI command status code if this is triggerred by hci_cmd
1441 // Default: STATUS_UNKNOWN
1442 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1443 // Number of consecutive failed contacts for a connection corresponding to the Handle
1444 // Range: uint16_t, 0-0xFFFF
1445 // Default: 0xFFFFF
1446 optional int32 failed_contact_counter = 4;
1447}
1448
1449/**
1450 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1451 *
1452 * Logged from:
1453 * system/bt
1454 */
1455message BluetoothDeviceTxPowerLevelReported {
1456 // An identifier that can be used to match events for this device.
1457 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1458 // Salt: Randomly generated 256 bit value
1459 // Hash algorithm: HMAC-SHA256
1460 // Size: 32 byte
1461 // Default: null or empty if the device identifier is not known
1462 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1463 // Connection handle of this connection if available
1464 // Range: 0x0000 - 0x0EFF (12 bits)
1465 // Default: 0xFFFF if the handle is unknown
1466 optional int32 connection_handle = 2;
Jack He4d6abe62019-01-20 21:22:46 -08001467 // HCI command status code if this is triggered by hci_cmd
Jack He924f3462019-01-09 20:54:41 -08001468 // Default: STATUS_UNKNOWN
1469 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1470 // Range: -30 ≤ N ≤ 20
1471 // Units: dBm
1472 // Invalid when an out of range value is reported
1473 optional int32 transmit_power_level = 4;
1474}
Jack He52260142018-12-18 15:43:27 -08001475
Tej Singh5d991e12018-03-09 19:48:11 -08001476/**
Jack He4d6abe62019-01-20 21:22:46 -08001477 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1478 * receiving an HCI command from the host
1479 *
1480 * Logged from: system/bt
1481 */
1482message BluetoothHciTimeoutReported {
1483 // HCI command associated with this event
1484 // Default: CMD_UNKNOWN
1485 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1486}
1487
1488/**
1489 * Logs when we receive Bluetooth Link Quality Report event from the controller
1490 * See Android Bluetooth HCI specification for more details
1491 *
1492 * Note: all count and bytes field are counted since last event
1493 *
1494 * Logged from: system/bt
1495 */
1496message BluetoothQualityReportReported {
1497 // Quality report ID
1498 // Original type: uint8_t
1499 // Default: BQR_ID_UNKNOWN
1500 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1501 // Packet type of the connection
1502 // Original type: uint8_t
1503 // Default: BQR_PACKET_TYPE_UNKNOWN
1504 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1505 // Connection handle of the connection
1506 // Original type: uint16_t
1507 optional int32 connection_handle = 3;
1508 // Performing Role for the connection
1509 // Original type: uint8_t
1510 optional int32 connection_role = 4;
1511 // Current Transmit Power Level for the connection. This value is the same as the controller's
1512 // response to the HCI_Read_Transmit_Power_Level HCI command
1513 // Original type: uint8_t
1514 optional int32 tx_power_level = 5;
1515 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1516 // absolute receiver signal strength value
1517 // Original type: int8_t
1518 optional int32 rssi = 6;
1519 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1520 // channels used by the link currently
1521 // Original type: uint8_t
1522 optional int32 snr = 7;
1523 // Indicates the number of unused channels in AFH_channel_map
1524 // Original type: uint8_t
1525 optional int32 unused_afh_channel_count = 8;
1526 // Indicates the number of the channels which are interfered and quality is bad but are still
1527 // selected for AFH
1528 // Original type: uint8_t
1529 optional int32 afh_select_unideal_channel_count = 9;
1530 // Current Link Supervision Timeout Setting
1531 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1532 // Original type: uint16_t
1533 optional int32 lsto = 10;
1534 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1535 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1536 // 0x01 (Piconet Clock)
1537 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1538 // Original type: uint32_t
1539 optional int64 connection_piconet_clock = 11;
1540 // The count of retransmission
1541 // Original type: uint32_t
1542 optional int64 retransmission_count = 12;
1543 // The count of no RX
1544 // Original type: uint32_t
1545 optional int64 no_rx_count = 13;
1546 // The count of NAK (Negative Acknowledge)
1547 // Original type: uint32_t
1548 optional int64 nak_count = 14;
1549 // Controller timestamp of last TX ACK
1550 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1551 // Original type: uint32_t
1552 optional int64 last_tx_ack_timestamp = 15;
1553 // The count of Flow-off (STOP)
1554 // Original type: uint32_t
1555 optional int64 flow_off_count = 16;
1556 // Controller timestamp of last Flow-on (GO)
1557 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1558 // Original type: uint32_t
1559 optional int64 last_flow_on_timestamp = 17;
1560 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1561 // Original type: uint32_t
1562 optional int64 buffer_overflow_bytes = 18;
1563 // Buffer underflow count (in byte) since last event
1564 // Original type: uint32_t
1565 optional int64 buffer_underflow_bytes = 19;
1566}
1567
1568/**
1569 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1570 *
1571 * Notes:
1572 * - Each event can be partially filled as we might learn different pieces of device
1573 * information at different time
1574 * - Multiple device info events can be combined to give more complete picture
1575 * - When multiple device info events tries to describe the same information, the
1576 * later one wins
1577 *
1578 * Logged from:
1579 * packages/apps/Bluetooth
1580 */
1581message BluetoothManufacturerInfoReported {
1582 // An identifier that can be used to match events for this device.
1583 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1584 // Salt: Randomly generated 256 bit value
1585 // Hash algorithm: HMAC-SHA256
1586 // Size: 32 byte
1587 // Default: null or empty if the device identifier is not known
1588 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1589 // Where is this device info obtained from
1590 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1591 // Name of the data source
1592 // For EXTERNAL: package name of the data source
1593 // For INTERNAL: null for general case, component name otherwise
1594 optional string source_name = 3;
1595 // Name of the manufacturer of this device
1596 optional string manufacturer = 4;
1597 // Model of this device
1598 optional string model = 5;
1599 // Hardware version of this device
1600 optional string hardware_version = 6;
1601 // Software version of this device
1602 optional string software_version = 7;
1603}
1604
1605/**
1606 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1607 * device, as documented by the Bluetooth Core HCI specification
1608 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1609 * Vol 2, Part E, Page 1118
1610 *
1611 * Logged from:
1612 * system/bt
1613 */
1614message BluetoothRemoteVersionInfoReported {
1615 // Connection handle of the connection
1616 // Original type: uint16_t
1617 optional int32 connection_handle = 1;
1618 // HCI command status code
1619 // Default: STATUS_UNKNOWN
1620 optional android.bluetooth.hci.StatusEnum hci_status = 2;
1621 // 1 byte Version of current LMP in the remote controller
1622 optional int32 lmp_version = 3;
1623 // 2 bytes LMP manufacturer code of the remote controller
1624 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
1625 optional int32 lmp_manufacturer_code = 4;
1626 // 4 bytes subversion of the LMP in the remote controller
1627 optional int32 lmp_subversion = 5;
1628}
1629
1630/**
1631 * Logs when certain Bluetooth SDP attributes are discovered
1632 * Constant definitions are from:
1633 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
1634 *
1635 * Current logged attributes:
1636 * - BluetoothProfileDescriptorList
1637 * - Supported Features Bitmask
1638 *
1639 * Logged from:
1640 * system/bt
1641 */
1642message BluetoothSdpAttributeReported {
1643 // An identifier that can be used to match events for this device.
1644 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1645 // Salt: Randomly generated 256 bit value
1646 // Hash algorithm: HMAC-SHA256
1647 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1648 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
1649 // Original type: uint16_t
1650 optional int32 protocol_uuid = 2;
1651 // Short form UUIDs used to identify Bluetooth SDP attribute types
1652 // Original type: uint16_t
1653 optional int32 attribute_id = 3;
1654 // Attribute value for the particular attribute
1655 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1656}
1657
1658/**
1659 * Logs when bond state of a Bluetooth device changes
1660 *
1661 * Logged from:
1662 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
1663 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
1664 */
1665message BluetoothBondStateChanged {
1666 // An identifier that can be used to match events for this device.
1667 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1668 // Salt: Randomly generated 256 bit value
1669 // Hash algorithm: HMAC-SHA256
1670 // Size: 32 byte
1671 // Default: null or empty if the device identifier is not known
1672 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1673 // Preferred transport type to remote dual mode device
1674 // Default: TRANSPORT_AUTO means no preference
1675 optional android.bluetooth.TransportTypeEnum transport = 2;
1676 // The type of this Bluetooth device (Classic, LE, or Dual mode)
1677 // Default: UNKNOWN
1678 optional android.bluetooth.DeviceTypeEnum type = 3;
1679 // Current bond state (NONE, BONDING, BONDED)
1680 // Default: BOND_STATE_UNKNOWN
1681 optional android.bluetooth.BondStateEnum bond_state = 4;
1682 // Bonding sub state
1683 // Default: BOND_SUB_STATE_UNKNOWN
1684 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
1685 // Unbond Reason
1686 // Default: UNBOND_REASON_UNKNOWN
1687 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
1688}
1689
1690/**
1691 * Logs there is an event related Bluetooth classic pairing
1692 *
1693 * Logged from:
1694 * system/bt
1695 */
1696message BluetoothClassicPairingEventReported {
1697 // An identifier that can be used to match events for this device.
1698 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1699 // Salt: Randomly generated 256 bit value
1700 // Hash algorithm: HMAC-SHA256
1701 // Size: 32 byte
1702 // Default: null or empty if the device identifier is not known
1703 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1704 // Connection handle of this connection if available
1705 // Range: 0x0000 - 0x0EFF (12 bits)
1706 // Default: 0xFFFF if the handle is unknown
1707 optional int32 connection_handle = 2;
1708 // HCI command associated with this event
1709 // Default: CMD_UNKNOWN
1710 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
1711 // HCI event associated with this event
1712 // Default: EVT_UNKNOWN
1713 optional android.bluetooth.hci.EventEnum hci_event = 4;
1714 // HCI command status code if this is triggerred by hci_cmd
1715 // Default: STATUS_UNKNOWN
1716 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
1717 // HCI reason code associated with this event
1718 // Default: STATUS_UNKNOWN
1719 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07001720 // A status value related to this specific event
1721 // Default: 0
1722 optional int64 event_value = 7;
Jack He4d6abe62019-01-20 21:22:46 -08001723}
1724
1725/**
1726 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
1727 *
1728 * Logged from:
1729 * system/bt
1730 */
1731message BluetoothSmpPairingEventReported {
1732 // An identifier that can be used to match events for this device.
1733 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1734 // Salt: Randomly generated 256 bit value
1735 // Hash algorithm: HMAC-SHA256
1736 // Size: 32 byte
1737 // Default: null or empty if the device identifier is not known
1738 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1739 // SMP command sent or received over L2CAP
1740 // Default: CMD_UNKNOWN
1741 optional android.bluetooth.smp.CommandEnum smp_command = 2;
1742 // Whether this command is sent or received
1743 // Default: DIRECTION_UNKNOWN
1744 optional android.bluetooth.DirectionEnum direction = 3;
1745 // SMP failure reason code
1746 // Default: PAIRING_FAIL_REASON_DEFAULT
1747 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
1748}
1749
1750/**
Jack He9c30c7c6b2019-01-30 17:24:55 -08001751 * Logs when a Bluetooth socket’s connection state changed
1752 *
1753 * Logged from:
1754 * system/bt
1755 */
1756message BluetoothSocketConnectionStateChanged {
1757 // An identifier that can be used to match events for this device.
1758 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1759 // Salt: Randomly generated 256 bit value
1760 // Hash algorithm: HMAC-SHA256
1761 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08001762 // Default: null or empty if this is a server listener socket
Jack He9c30c7c6b2019-01-30 17:24:55 -08001763 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08001764 // Temporary port of this socket for the current connection or session only
Jack He9c30c7c6b2019-01-30 17:24:55 -08001765 // Default 0 when unknown or don't care
1766 optional int32 port = 2;
1767 // Socket type as mentioned in
1768 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
1769 // Default: SOCKET_TYPE_UNKNOWN
1770 optional android.bluetooth.SocketTypeEnum type = 3;
1771 // Socket connection state
1772 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
1773 optional android.bluetooth.SocketConnectionstateEnum state = 4;
1774 // Number of bytes sent to remote device during this connection
1775 optional int64 tx_bytes = 5;
1776 // Number of bytes received from remote device during this connection
1777 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08001778 // Socket owner's UID
1779 optional int32 uid = 7 [(is_uid) = true];
1780 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
1781 // |port| must be spawned by |server_port|
1782 // Default 0 when unknown or don't care
1783 optional int32 server_port = 8;
1784 // Whether this is a server listener socket
1785 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He9c30c7c6b2019-01-30 17:24:55 -08001786}
1787
1788/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001789 * Logs when something is plugged into or removed from the USB-C connector.
1790 *
1791 * Logged from:
1792 * Vendor USB HAL.
1793 */
1794message UsbConnectorStateChanged {
1795 enum State {
1796 DISCONNECTED = 0;
1797 CONNECTED = 1;
1798 }
1799 optional State state = 1;
1800}
1801
1802/**
1803 * Logs the reported speaker impedance.
1804 *
1805 * Logged from:
1806 * Vendor audio implementation.
1807 */
1808message SpeakerImpedanceReported {
1809 optional int32 speaker_location = 1;
1810 optional int32 impedance = 2;
1811}
1812
1813/**
1814 * Logs the report of a failed hardware.
1815 *
1816 * Logged from:
1817 * Vendor HALs.
1818 *
1819 */
1820message HardwareFailed {
1821 enum HardwareType {
1822 HARDWARE_FAILED_UNKNOWN = 0;
1823 HARDWARE_FAILED_MICROPHONE = 1;
1824 HARDWARE_FAILED_CODEC = 2;
1825 HARDWARE_FAILED_SPEAKER = 3;
1826 HARDWARE_FAILED_FINGERPRINT = 4;
1827 }
1828 optional HardwareType hardware_type = 1;
1829
1830 /* hardware_location allows vendors to differentiate between multiple instances of
1831 * the same hardware_type. The specific locations are vendor defined integers,
1832 * referring to board-specific numbering schemes.
1833 */
1834 optional int32 hardware_location = 2;
1835
1836 /* failure_code is specific to the HardwareType of the failed hardware.
1837 * It should use the enum values defined below.
1838 */
1839 enum MicrophoneFailureCode {
1840 MICROPHONE_FAILURE_COMPLETE = 0;
1841 }
1842 enum CodecFailureCode {
1843 CODEC_FAILURE_COMPLETE = 0;
1844 }
1845 enum SpeakerFailureCode {
1846 SPEAKER_FAILURE_COMPLETE = 0;
1847 SPEAKER_FAILURE_HIGH_Z = 1;
1848 SPEAKER_FAILURE_SHORT = 2;
1849 }
1850 enum FingerprintFailureCode {
1851 FINGERPRINT_FAILURE_COMPLETE = 0;
1852 FINGERPRINT_SENSOR_BROKEN = 1;
1853 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1854 }
1855 optional int32 failure_code = 3;
1856}
1857
1858/**
1859 * Log an event when the device has been physically dropped.
1860 * Reported from the /vendor partition.
1861 */
1862message PhysicalDropDetected {
1863 // Confidence that the event was actually a drop, 0 -> 100
1864 optional int32 confidence_pctg = 1;
1865 // Peak acceleration of the drop, in 1/1000s of a g.
1866 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001867 // Duration of freefall in ms
1868 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001869}
1870
1871/**
1872 * Log bucketed battery charge cycles.
1873 *
1874 * Each bucket represents cycles of the battery past
1875 * a given charge point. For example, bucket 1 is the
1876 * lowest 1/8th of the battery, and bucket 8 is 100%.
1877 *
1878 * Logged from:
1879 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1880 */
1881message ChargeCyclesReported {
1882 optional int32 cycle_bucket_1 = 1;
1883 optional int32 cycle_bucket_2 = 2;
1884 optional int32 cycle_bucket_3 = 3;
1885 optional int32 cycle_bucket_4 = 4;
1886 optional int32 cycle_bucket_5 = 5;
1887 optional int32 cycle_bucket_6 = 6;
1888 optional int32 cycle_bucket_7 = 7;
1889 optional int32 cycle_bucket_8 = 8;
1890}
1891
1892/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001893 * Logs the duration of a davey (jank of >=700ms) when it occurs
1894 *
1895 * Logged from:
1896 * frameworks/base/libs/hwui/JankTracker.cpp
1897 */
1898message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001899 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001900 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001901
Tej Singhbb8554a2018-01-26 11:59:14 -08001902 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001903 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001904}
1905
1906/**
Bookatze5885242017-10-24 20:10:31 -07001907 * Logs phone signal strength changes.
1908 *
1909 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001910 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001911 */
1912message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001913 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1914 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001915}
1916
Yangster4ccebea2018-10-09 17:09:02 -07001917
1918/**
1919 * Logs when the phone state, sim state or signal strength changes
1920 *
1921 * Logged from:
1922 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1923 */
1924message PhoneServiceStateChanged {
1925 optional android.telephony.ServiceStateEnum state = 1;
1926 optional android.telephony.SimStateEnum sim_state = 2;
1927 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1928}
1929
1930/**
1931 * Logs when the phone becomes on or off.
1932 *
1933 * Logged from:
1934 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1935 */
1936message PhoneStateChanged {
1937 enum State {
1938 OFF = 0;
1939 ON = 1;
1940 }
1941 optional State state = 1;
1942}
1943
Hyunyoung Songcc651c12018-10-17 13:35:32 -07001944message LauncherUIChanged {
Yao Chen046b5122018-10-24 14:09:20 -07001945 optional android.stats.launcher.LauncherAction action = 1;
1946 optional android.stats.launcher.LauncherState src_state = 2;
1947 optional android.stats.launcher.LauncherState dst_state = 3;
1948 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songcc651c12018-10-17 13:35:32 -07001949 optional bool is_swipe_up_enabled = 5;
1950}
1951
David Chenc28b2bb2017-10-24 12:52:52 -07001952/**
1953 * Logs that a setting was updated.
1954 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001955 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001956 * The tag and is_default allow resetting of settings to default values based on the specified
1957 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1958 */
1959message SettingChanged {
1960 // The name of the setting.
1961 optional string setting = 1;
1962
1963 // The change being imposed on this setting. May represent a number, eg "3".
1964 optional string value = 2;
1965
1966 // The new value of this setting. For most settings, this is same as value. For some settings,
1967 // value is +X or -X where X represents an element in a set. For example, if the previous value
1968 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1969 // The +/- feature is currently only used for location_providers_allowed.
1970 optional string new_value = 3;
1971
1972 // The previous value of this setting.
1973 optional string prev_value = 4;
1974
1975 // The tag used with the is_default for resetting sets of settings. This is generally null.
1976 optional string tag = 5;
1977
Bookatz90867622018-01-31 15:05:57 -08001978 // True if this setting with tag should be resettable.
1979 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001980
David Chenbd789912018-03-16 17:19:55 -07001981 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001982 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001983
1984 enum ChangeReason {
1985 UPDATED = 1; // Updated can be an insertion or an update.
1986 DELETED = 2;
1987 }
1988 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001989}
Chenjie Yub3dda412017-10-24 13:41:59 -07001990
Chenjie Yu05013b32017-11-21 10:21:41 -08001991/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001992 * Logs activity going to foreground or background
1993 *
1994 * Logged from:
1995 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1996 */
1997message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001998 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001999 optional string pkg_name = 2;
2000 optional string class_name = 3;
2001
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002002 enum State {
2003 BACKGROUND = 0;
2004 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002005 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002006 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002007}
David Chenc8a43242017-10-17 16:23:28 -07002008
2009/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002010 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002011 * Logged from:
2012 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2013 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002014message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002015 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002016
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002017 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002018
2019 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002020 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002021 optional string process_name = 3;
2022
2023 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002024 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002025
2026 optional string package_name = 5;
2027
2028 enum InstantApp {
2029 UNAVAILABLE = 0;
2030 FALSE = 1;
2031 TRUE = 2;
2032 }
2033 optional InstantApp is_instant_app = 6;
2034
2035 enum ForegroundState {
2036 UNKNOWN = 0;
2037 BACKGROUND = 1;
2038 FOREGROUND = 2;
2039 }
2040 optional ForegroundState foreground_state = 7;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002041}
David Chen9e3808c2017-11-20 17:25:34 -08002042
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002043/**
2044 * Logs when a WTF (What a Terrible Failure) happened.
2045 * Logged from:
2046 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2047 */
2048message WTFOccurred {
2049 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002050
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002051 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002052
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002053 // The name of the process.
2054 // system_server if it is not by an app
2055 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002056
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002057 // The pid if available. -1 means not available.
2058 optional sint32 pid = 4;
2059}
2060
2061/**
2062 * Logs when system server reports low memory.
2063 * Logged from:
2064 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2065 */
2066message LowMemReported {
2067}
2068
2069/**
2070 * Logs when an app ANR (App Not Responding) occurs.
2071 * Logged from:
2072 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2073 */
2074message ANROccurred {
2075 optional int32 uid = 1 [(is_uid) = true];
2076
2077 optional string process_name = 2;
2078
2079 optional string short_component_name = 3;
2080
2081 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002082
2083 enum InstantApp {
2084 UNAVAILABLE = 0;
2085 FALSE = 1;
2086 TRUE = 2;
2087 }
2088 optional InstantApp is_instant_app = 5;
2089
2090 enum ForegroundState {
2091 UNKNOWN = 0;
2092 BACKGROUND = 1;
2093 FOREGROUND = 2;
2094 }
2095 optional ForegroundState foreground_state = 6;
David Chen9e3808c2017-11-20 17:25:34 -08002096}
2097
David Chen0a368b22017-12-06 16:28:16 -08002098/*
2099 * Allows other apps to push events into statsd.
2100 * Logged from:
2101 * frameworks/base/core/java/android/util/StatsLog.java
2102 */
David Chen0b5c90c2018-01-25 16:51:49 -08002103message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002104 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002105 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002106
2107 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2108 optional int32 label = 2;
2109
2110 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2111 // predicates for the metrics).
2112 enum State {
2113 UNKNOWN = 0;
2114 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2115 STOP = 2;
2116 START = 3;
2117 }
2118 optional State state = 3;
2119}
2120
David Chen9e3808c2017-11-20 17:25:34 -08002121/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002122 * Logs when statsd detects an anomaly.
2123 *
2124 * Logged from:
2125 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2126 */
2127message AnomalyDetected {
2128 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002129 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002130
Yangster-mac94e197c2018-01-02 16:03:03 -08002131 // Id of the config whose anomaly detection alert fired.
2132 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002133
Yangster-mac94e197c2018-01-02 16:03:03 -08002134 // Id of the alert (i.e. name of the anomaly that was detected).
2135 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002136}
2137
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002138message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002139 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002140 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002141
2142 // The app package name.
2143 optional string pkg_name = 2;
2144
2145 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002146 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002147 WARM = 1;
2148 HOT = 2;
2149 COLD = 3;
2150 }
2151 // The transition type.
2152 optional TransitionType type = 3;
2153
2154 // The activity name.
2155 optional string activity_name = 4;
2156
2157 // The name of the calling app. Empty if not set.
2158 optional string calling_pkg_name = 5;
2159
2160 // Whether the app is an instant app.
2161 optional bool is_instant_app = 6;
2162
2163 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002164 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002165
Bookatz80d11a02018-01-16 10:46:35 -08002166 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002167
David Chen0b5c90c2018-01-25 16:51:49 -08002168 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002169 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002170 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002171 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002172 optional int32 bind_application_delay_millis = 11;
2173 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002174
2175 // Empty if not set.
2176 optional string launch_token = 13;
2177
Calin Juravle759fbda2018-02-20 19:52:30 +00002178 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002179 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002180
2181 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002182 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002183}
2184
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002185message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002186 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002187 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002188
2189 // The app package name.
2190 optional string pkg_name = 2;
2191
2192 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002193 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002194 WARM = 1;
2195 HOT = 2;
2196 COLD = 3;
2197 }
2198 // The transition type.
2199 optional TransitionType type = 3;
2200
2201 // The activity name.
2202 optional string activity_name = 4;
2203}
2204
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002205message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002206 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002207 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002208
2209 // The app package name.
2210 optional string pkg_name = 2;
2211
2212 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002213 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002214 WITH_BUNDLE = 1;
2215 WITHOUT_BUNDLE = 2;
2216 }
2217 // The transition type.
2218 optional TransitionType type = 3;
2219
2220 // The activity name.
2221 optional string activity_name = 4;
2222
2223 optional bool transition_process_running = 5;
2224
2225 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002226 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002227}
2228
Bookatz8fcd09a2017-12-18 13:01:10 -08002229/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002230 * Logs a picture-in-picture action
2231 * Logged from:
2232 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2233 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2234 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2235 */
2236message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002237 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002238 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002239
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002240 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002241
Chenjie Yu52cacc62017-12-08 18:11:45 -08002242 enum State {
2243 ENTERED = 1;
2244 EXPANDED_TO_FULL_SCREEN = 2;
2245 MINIMIZED = 3;
2246 DISMISSED = 4;
2247 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002248 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002249}
2250
2251/**
Chenjie Yue8904192017-12-08 19:12:57 -08002252 * Logs overlay action
2253 * Logged from:
2254 * services/core/java/com/android/server/wm/Session.java
2255 */
2256message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002257 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002258
2259 optional string package_name = 2;
2260
2261 optional bool using_alert_window = 3;
2262
2263 enum State {
2264 ENTERED = 1;
2265 EXITED = 2;
2266 }
2267 optional State state = 4;
2268}
2269
Chenjie Yuccfe6452018-01-30 11:33:21 -08002270/*
2271 * Logs foreground service starts and stops.
2272 * Note that this is not when a service starts or stops, but when it is
2273 * considered foreground.
2274 * Logged from
2275 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2276 */
2277message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002278 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002279 // package_name + "/" + class_name
2280 optional string short_name = 2;
2281
2282 enum State {
2283 ENTER = 1;
2284 EXIT = 2;
2285 }
2286 optional State state = 3;
2287}
2288
Chenjie Yue8904192017-12-08 19:12:57 -08002289/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002290 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2291 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2292 * attributed back to the parent (host) uid. One example is Chrome.
2293 *
2294 * Logged from:
2295 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2296 */
2297message IsolatedUidChanged {
2298 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002299 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002300 optional int32 parent_uid = 1;
2301
2302 optional int32 isolated_uid = 2;
2303
2304 // We expect an isolated uid to be removed before if it's used for another parent uid.
2305 enum Event {
2306 REMOVED = 0;
2307 CREATED = 1;
2308 }
2309 optional Event event = 3;
2310}
2311
2312/*
2313 * Logs the reception of an incoming network packet causing the main system to wake up for
2314 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2315 * and processed by WakeupController.cpp.
2316 */
2317message PacketWakeupOccurred {
2318 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2319 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002320 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002321 // The interface name on which the packet was received.
2322 optional string iface = 2;
2323 // The ethertype value of the packet.
2324 optional int32 ethertype = 3;
2325 // String representation of the destination MAC address of the packet.
2326 optional string destination_hardware_address = 4;
2327 // String representation of the source address of the packet if this was an IP packet.
2328 optional string source_ip = 5;
2329 // String representation of the destination address of the packet if this was an IP packet.
2330 optional string destination_ip = 6;
2331 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2332 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2333 // families.
2334 optional int32 ip_next_header = 7;
2335 // The source port if this was a TCP or UDP packet.
2336 optional int32 source_port = 8;
2337 // The destination port if this was a TCP or UDP packet.
2338 optional int32 destination_port = 9;
2339}
2340
2341/*
2342 * Logs the memory stats for an app on startup.
2343 * Logged from:
2344 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2345 */
2346message AppStartMemoryStateCaptured {
2347 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002348 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002349
2350 // The process name.
2351 optional string process_name = 2;
2352
2353 // The activity name.
2354 optional string activity_name = 3;
2355
2356 // # of page-faults
2357 optional int64 pgfault = 4;
2358
2359 // # of major page-faults
2360 optional int64 pgmajfault = 5;
2361
2362 // RSS
2363 optional int64 rss_in_bytes = 6;
2364
2365 // CACHE
2366 optional int64 cache_in_bytes = 7;
2367
2368 // SWAP
2369 optional int64 swap_in_bytes = 8;
2370}
2371
2372/*
2373 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2374 * for LMK event.
2375 * Logged from:
2376 * system/core/lmkd/lmkd.c
2377 */
2378message LmkStateChanged {
2379 enum State {
2380 UNKNOWN = 0;
2381 START = 1;
2382 STOP = 2;
2383 }
2384 optional State state = 1;
2385}
2386
2387/*
2388 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2389 * Logged from:
2390 * system/core/lmkd/lmkd.c
2391 */
2392message LmkKillOccurred {
2393 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002394 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002395
2396 // The process name.
2397 optional string process_name = 2;
2398
2399 // oom adj score.
2400 optional int32 oom_score = 3;
2401
2402 // # of page-faults
2403 optional int64 pgfault = 4;
2404
2405 // # of major page-faults
2406 optional int64 pgmajfault = 5;
2407
2408 // RSS
2409 optional int64 rss_in_bytes = 6;
2410
2411 // CACHE
2412 optional int64 cache_in_bytes = 7;
2413
2414 // SWAP
2415 optional int64 swap_in_bytes = 8;
Jim Blackler972a5c52018-11-21 15:24:48 +00002416
2417 // The elapsed real time of start of the process.
2418 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08002419
2420 // Min oom adj score considered by lmkd.
2421 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002422}
2423
Rajeev Kumar51b54602018-03-01 12:18:26 -08002424/*
2425 * Logs when the ActivityManagerService detects that an app died.
2426 *
2427 * Logged from:
2428 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2429 */
2430message AppDied {
2431 // timestamp(elapsedRealtime) of record creation
Yao Chenc40a19d2018-03-15 16:48:25 -07002432 optional uint64 timestamp_millis = 1 [(stateFieldOption).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002433}
2434
Chenjie Yubbcbc602018-02-05 16:51:52 -08002435//////////////////////////////////////////////////////////////////////
2436// Pulled atoms below this line //
2437//////////////////////////////////////////////////////////////////////
2438
2439/**
David Chenc8a43242017-10-17 16:23:28 -07002440 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
2441 *
2442 * Pulled from:
2443 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2444 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002445message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002446 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002447
2448 optional int64 rx_bytes = 2;
2449
2450 optional int64 rx_packets = 3;
2451
2452 optional int64 tx_bytes = 4;
2453
2454 optional int64 tx_packets = 5;
2455}
2456
2457/**
2458 * Pulls bytes transferred via wifi (separated by foreground and background usage).
2459 *
2460 * Pulled from:
2461 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2462 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002463message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002464 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002465
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002466 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2467 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002468
2469 optional int64 rx_bytes = 3;
2470
2471 optional int64 rx_packets = 4;
2472
2473 optional int64 tx_bytes = 5;
2474
2475 optional int64 tx_packets = 6;
2476}
2477
2478/**
2479 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2480 *
2481 * Pulled from:
2482 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2483 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002484message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002485 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002486
2487 optional int64 rx_bytes = 2;
2488
2489 optional int64 rx_packets = 3;
2490
2491 optional int64 tx_bytes = 4;
2492
2493 optional int64 tx_packets = 5;
2494}
2495
2496/**
2497 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
2498 *
2499 * Pulled from:
2500 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2501 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002502message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002503 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002504
Yao Chenc40a19d2018-03-15 16:48:25 -07002505 // 1 denotes foreground and 0 denotes background. This is called Set in
2506 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002507 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002508
2509 optional int64 rx_bytes = 3;
2510
2511 optional int64 rx_packets = 4;
2512
2513 optional int64 tx_bytes = 5;
2514
2515 optional int64 tx_packets = 6;
2516}
2517
2518/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002519 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2520 *
2521 * Pulled from:
2522 * StatsCompanionService
2523 */
2524message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002525 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002526
2527 optional int64 rx_bytes = 2;
2528
2529 optional int64 tx_bytes = 3;
2530}
2531
2532/**
David Chenc8a43242017-10-17 16:23:28 -07002533 * Pulls the kernel wakelock durations. This atom is adapted from
2534 * android/internal/os/KernelWakelockStats.java
2535 *
2536 * Pulled from:
2537 * StatsCompanionService using KernelWakelockReader.
2538 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002539message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002540 optional string name = 1;
2541
2542 optional int32 count = 2;
2543
2544 optional int32 version = 3;
2545
2546 optional int64 time = 4;
2547}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002548
Chenjie Yu05013b32017-11-21 10:21:41 -08002549/**
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002550 * Pulls low power state information. This includes platform and subsystem sleep state information,
2551 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002552 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002553 * hardware/interfaces/power/1.1/types.hal
2554 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002555message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002556 // Subsystem name
2557 optional string subsystem_name = 1;
2558 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2559 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
2560 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002561 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002562 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002563 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002564 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002565}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002566
Chenjie Yu05013b32017-11-21 10:21:41 -08002567/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002568 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002569 * Pulls the time the cpu spend on the frequency index. Frequency index
2570 * starts from highest to lowest. The value should be monotonically
2571 * increasing since boot. However, if there is a cpu
2572 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002573 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002574message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002575 optional uint32 cluster = 1;
2576 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002577 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002578}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002579
Chenjie Yu05013b32017-11-21 10:21:41 -08002580/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002581 * Pulls Cpu Time Per Uid.
2582 * Note that isolated process uid time should be attributed to host uids.
2583 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002584message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002585 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00002586 optional uint64 user_time_micros = 2;
2587 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002588}
2589
2590/**
2591 * Pulls Cpu Time Per Uid per frequency.
2592 * Note that isolated process uid time should be attributed to host uids.
2593 * For each uid, we order the time by descending frequencies.
2594 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002595message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002596 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002597 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002598 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002599}
Hugo Benichi884970e2017-11-14 22:42:46 +09002600
Chenjie Yu05013b32017-11-21 10:21:41 -08002601/**
2602 * Pulls Wifi Controller Activity Energy Info
2603 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002604message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002605 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002606 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002607 // stack reported state
2608 // TODO: replace this with proto enum
2609 optional int32 stack_state = 2;
2610 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002611 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002612 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002613 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002614 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002615 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002616 // product of current(mA), voltage(V) and time(ms)
2617 optional uint64 controller_energy_used = 6;
2618}
2619
2620/**
2621 * Pulls Modem Activity Energy Info
2622 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002623message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002624 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002625 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002626 // sleep time in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08002627 optional uint64 sleep_time_millis = 2;
Chenjie Yu05013b32017-11-21 10:21:41 -08002628 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002629 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002630 /**
2631 * Tx power index
2632 * index 0 = tx_power < 0dBm
2633 * index 1 = 0dBm < tx_power < 5dBm
2634 * index 2 = 5dBm < tx_power < 15dBm
2635 * index 3 = 15dBm < tx_power < 20dBm
2636 * index 4 = tx_power > 20dBm
2637 */
2638 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002639 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002640 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002641 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002642 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002643 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002644 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002645 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002646 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002647 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002648 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002649 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002650 // product of current(mA), voltage(V) and time(ms)
2651 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002652}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002653
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002654/**
2655 * Pulls Bluetooth Activity Energy Info
2656 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2657 */
2658message BluetoothActivityInfo {
2659 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002660 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002661 // bluetooth stack state
2662 optional int32 bluetooth_stack_state = 2;
2663 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002664 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002665 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002666 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002667 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002668 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002669 // product of current(mA), voltage(V) and time(ms)
2670 optional uint64 energy_used = 6;
2671}
2672
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002673/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002674 * Logs the memory stats for a process.
2675 */
2676message ProcessMemoryState {
2677 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002678 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002679
2680 // The process name.
2681 optional string process_name = 2;
2682
2683 // oom adj score.
2684 optional int32 oom_score = 3;
2685
2686 // # of page-faults
2687 optional int64 pgfault = 4;
2688
2689 // # of major page-faults
2690 optional int64 pgmajfault = 5;
2691
Rajeev Kumar90235992018-01-29 11:06:48 -08002692 // RSS
2693 optional int64 rss_in_bytes = 6;
2694
2695 // CACHE
2696 optional int64 cache_in_bytes = 7;
2697
2698 // SWAP
2699 optional int64 swap_in_bytes = 8;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002700}
2701
2702/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002703 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002704 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002705message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002706 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002707}
2708
2709/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002710 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002711 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002712message SystemUptime {
2713 // Milliseconds since the system was booted.
2714 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
2715 // for external input).
2716 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08002717 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002718}
2719
2720/*
2721 * Reads from /proc/uid_concurrent_active_time which has the format:
2722 * active: X (X is # cores)
2723 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
2724 * [uid1]: [time-0] [time-1] [time-2] ... ...
2725 * ...
2726 * Time-N means the CPU time a UID spent running concurrently with N other processes.
2727 * The file contains a monotonically increasing count of time for a single boot.
2728 */
2729message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002730 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002731 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002732}
2733
2734/**
2735 * Reads from /proc/uid_concurrent_policy_time which has the format:
2736 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
2737 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2738 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2739 * ...
2740 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
2741 * The file contains a monotonically increasing count of time for a single boot.
2742 */
2743message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002744 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002745 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002746 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08002747}
2748
2749/*
2750 * Pulls free disk space, for data, system partition and temporary directory.
2751 */
2752message DiskSpace {
2753 // available bytes in data partition
2754 optional uint64 data_available_bytes = 1;
2755 // available bytes in system partition
2756 optional uint64 system_available_bytes = 2;
2757 // available bytes in download cache or temp directories
2758 optional uint64 temp_available_bytes = 3;
2759}
Tej Singhbf972d92018-01-10 20:51:13 -08002760
2761/**
2762 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002763 * Pulled from:
2764 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002765 */
2766message RemainingBatteryCapacity {
2767 optional int32 charge_uAh = 1;
2768}
2769
2770/**
2771 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002772 * Pulled from:
2773 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002774 */
2775message FullBatteryCapacity {
2776 optional int32 capacity_uAh = 1;
Tej Singh40298312018-02-16 00:15:09 -08002777}
2778
2779/**
Tej Singhd89137e2018-03-26 14:51:40 -07002780 * Pulls the temperature of various parts of the device.
2781 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08002782 *
2783 * Pulled from:
2784 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
2785 */
2786message Temperature {
2787 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY.
2788 optional android.os.TemperatureTypeEnum sensor_location = 1;
2789
2790 // The name of the temperature source. Eg. CPU0
2791 optional string sensor_name = 2;
2792
Tej Singhd89137e2018-03-26 14:51:40 -07002793 // Temperature in tenths of a degree C.
2794 optional int32 temperature_dC = 3;
yroa1fe77c2018-02-26 14:22:54 -08002795}
lifr35a7cf02018-12-12 16:38:04 +08002796
2797/**
lifrd1300022019-05-03 12:02:54 +08002798 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
2799 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
2800 *
2801 * The NetworkDnsEventReported message represents the entire lookup operation, which may
2802 * result one or more queries to the recursive DNS resolvers. Those are individually logged
2803 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
2804 * broken up by query type, transport, network interface, etc.
lifr35a7cf02018-12-12 16:38:04 +08002805 */
2806message NetworkDnsEventReported {
lifrd1300022019-05-03 12:02:54 +08002807 optional android.stats.dnsresolver.EventType event_type = 1;
lifr35a7cf02018-12-12 16:38:04 +08002808
lifrd1300022019-05-03 12:02:54 +08002809 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifr35a7cf02018-12-12 16:38:04 +08002810
lifrd1300022019-05-03 12:02:54 +08002811 // The latency in microseconds of the entire DNS lookup operation.
lifr35a7cf02018-12-12 16:38:04 +08002812 optional int32 latency_micros = 3;
lifrd1300022019-05-03 12:02:54 +08002813
2814 // Only valid for event_type = EVENT_GETADDRINFO.
2815 optional int32 hints_ai_flags = 4;
2816
2817 // Flags passed to android_res_nsend() defined in multinetwork.h
2818 // Only valid for event_type = EVENT_RESNSEND.
2819 optional int32 res_nsend_flags = 5;
2820
2821 optional android.stats.dnsresolver.Transport network_type = 6;
2822
2823 // The DNS over TLS mode on a specific netId.
2824 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
2825
2826 // Additional pass-through fields opaque to statsd.
2827 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
2828 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr35a7cf02018-12-12 16:38:04 +08002829}
2830
Chiachang Wang67f24472019-01-15 15:14:00 +08002831/**
2832 * Logs when a data stall event occurs.
2833 *
2834 * Log from:
2835 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
2836 */
2837message DataStallEvent {
2838 // Data stall evaluation type.
2839 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
2840 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
2841 optional int32 evaluation_type = 1;
2842 // See definition in data_stall_event.proto.
2843 optional com.android.server.connectivity.ProbeResult validation_result = 2;
2844 // See definition in data_stall_event.proto.
2845 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
2846 // See definition in data_stall_event.proto.
2847 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
2848 // See definition in data_stall_event.proto.
2849 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
2850 // See definition in data_stall_event.proto.
2851 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
2852}
Jack Yu6d421bc2019-01-23 17:42:54 +08002853
2854/**
2855 * Logs when a NFC device's error occurred.
2856 * Logged from:
2857 * system/nfc/src/nfc/nfc/nfc_ncif.cc
2858 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
2859 */
2860message NfcErrorOccurred {
2861 enum Type {
2862 UNKNOWN = 0;
2863 CMD_TIMEOUT = 1;
2864 ERROR_NOTIFICATION = 2;
2865 AID_OVERFLOW = 3;
2866 }
2867 optional Type type = 1;
2868 // If it's nci cmd timeout, log the timeout command.
2869 optional uint32 nci_cmd = 2;
2870
2871 optional uint32 error_ntf_status_code = 3;
2872}
2873
2874/**
2875 * Logs when a NFC device's state changed event
2876 * Logged from:
2877 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
2878 */
2879message NfcStateChanged {
2880 enum State {
2881 UNKNOWN = 0;
2882 OFF = 1;
2883 ON = 2;
2884 ON_LOCKED = 3; // Secure Nfc enabled.
2885 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
2886 }
2887 optional State state = 1;
2888}
2889
2890/**
2891 * Logs when a NFC Beam Transaction occurred.
2892 * Logged from:
2893 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
2894 */
2895message NfcBeamOccurred {
2896 enum Operation {
2897 UNKNOWN = 0;
2898 SEND = 1;
2899 RECEIVE = 2;
2900 }
2901 optional Operation operation = 1;
2902}
2903
2904/**
2905 * Logs when a NFC Card Emulation Transaction occurred.
2906 * Logged from:
2907 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
2908 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
2909 */
2910message NfcCardemulationOccurred {
2911 enum Category {
2912 UNKNOWN = 0;
2913 HCE_PAYMENT = 1;
2914 HCE_OTHER = 2;
2915 OFFHOST = 3;
2916 }
2917 // Transaction belongs to HCE payment or HCE other category, or offhost.
2918 optional Category category = 1;
2919 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
2920 optional string se_name = 2;
2921}
2922
2923/**
2924 * Logs when a NFC Tag event occurred.
2925 * Logged from:
2926 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
2927 */
2928message NfcTagOccurred {
2929 enum Type {
2930 UNKNOWN = 0;
2931 URL = 1;
2932 BT_PAIRING = 2;
2933 PROVISION = 3;
2934 WIFI_CONNECT = 4;
2935 APP_LAUNCH = 5;
2936 OTHERS = 6;
2937 }
2938 optional Type type = 1;
2939}
2940
2941/**
2942 * Logs when Hce transaction triggered
2943 * Logged from:
2944 * system/nfc/src/nfc/nfc/nfc_ncif.cc
2945 */
2946message NfcHceTransactionOccurred {
2947 // The latency period(in microseconds) it took for the first HCE data
2948 // exchange.
2949 optional uint32 latency_micros = 1;
2950}
2951
2952/**
2953 * Logs when SecureElement state event changed
2954 * Logged from:
2955 * packages/apps/SecureElement/src/com/android/se/Terminal.java
2956 */
2957message SeStateChanged {
2958 enum State {
2959 UNKNOWN = 0;
2960 INITIALIZED = 1;
2961 DISCONNECTED = 2;
2962 CONNECTED = 3;
2963 HALCRASH = 4;
2964 }
2965 optional State state = 1;
2966
2967 optional string state_change_reason = 2;
2968 // SIMx or eSEx.
2969 optional string terminal = 3;
2970}
2971
2972/**
2973 * Logs when Omapi API used
2974 * Logged from:
2975 * packages/apps/SecureElement/src/com/android/se/Terminal.java
2976 */
2977message SeOmapiReported {
2978 enum Operation {
2979 UNKNOWN = 0;
2980 OPEN_CHANNEL = 1;
2981 }
2982 optional Operation operation = 1;
2983 // SIMx or eSEx.
2984 optional string terminal = 2;
2985
2986 optional string package_name = 3;
2987}
Hui Yuf57e4012019-02-13 12:29:38 -08002988
2989/*
2990* Logs number of milliseconds it takes to start a process.
2991* The definition of app process start time is from the app launch time to
2992* the time that Zygote finished forking the app process and loaded the
2993* application package's java classes.
2994
2995* This metric is different from AppStartOccurred which is for foreground
2996* activity only.
2997
2998* ProcessStartTime can report all processes (both foreground and background)
2999* start time.
3000*
3001* Logged from:
3002* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3003*/
3004message ProcessStartTime {
3005 // The uid of the ProcessRecord.
3006 optional int32 uid = 1 [(is_uid) = true];
3007
3008 // The process pid.
3009 optional int32 pid = 2;
3010
3011 // The process name.
3012 // Usually package name, "system" for system server.
3013 // Provided by ActivityManagerService.
3014 optional string process_name = 3;
3015
3016 enum StartType {
3017 UNKNOWN = 0;
3018 WARM = 1;
3019 HOT = 2;
3020 COLD = 3;
3021 }
3022
3023 // The start type.
3024 optional StartType type = 4;
3025
3026 // The elapsed realtime at the start of the process.
3027 optional int64 process_start_time_millis = 5;
3028
3029 // Number of milliseconds it takes to reach bind application.
3030 optional int32 bind_application_delay_millis = 6;
3031
3032 // Number of milliseconds it takes to finish start of the process.
3033 optional int32 process_start_delay_millis = 7;
3034
3035 // hostingType field in ProcessRecord, the component type such as "activity",
3036 // "service", "content provider", "broadcast" or other strings.
3037 optional string hosting_type = 8;
3038
3039 // hostingNameStr field in ProcessRecord. The component class name that runs
3040 // in this process.
3041 optional string hosting_name = 9;
3042}
3043
Chiachang Wang4d6fe322019-03-21 20:40:01 +08003044/**
3045 * Push network stack events.
3046 *
3047 * Log from:
3048 * frameworks/base/packages/NetworkStack/
3049 */
3050message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08003051 // The id that indicates the event reported from NetworkStack.
3052 optional int32 event_id = 1;
3053 // The data for the reported events.
Chiachang Wang4d6fe322019-03-21 20:40:01 +08003054 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
3055}
3056