blob: 1254f1a3afa098f6ebe54003e6b88a454e1b28eb [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;
Felix Lopez Luis7ca1abd2018-12-12 10:32:32 +0000142 AppDowngraded app_downgraded = 128;
143 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
144 LowStorageStateChanged low_storage_state_changed = 130;
Jack Yu6d421bc2019-01-23 17:42:54 +0800145 NfcErrorOccurred nfc_error_occurred = 134;
146 NfcStateChanged nfc_state_changed = 135;
147 NfcBeamOccurred nfc_beam_occurred = 136;
148 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
149 NfcTagOccurred nfc_tag_occurred = 138;
150 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
151 SeStateChanged se_state_changed = 140;
152 SeOmapiReported se_omapi_reported = 141;
Jack He924f3462019-01-09 20:54:41 -0800153 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
154 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
155 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
156 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
157 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
158 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
159 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
160 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
161 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He4d6abe62019-01-20 21:22:46 -0800162 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
163 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
164 BluetoothManufacturerInfoReported bluetooth_device_info_reported = 162;
165 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
166 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
167 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
168 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
169 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Hui Yuf57e4012019-02-13 12:29:38 -0800170 ProcessStartTime process_start_time = 169;
Jack He9c30c7c6b2019-01-30 17:24:55 -0800171 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Michael Groover94672ce2019-06-27 15:17:48 -0700172 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Chiachang Wange987ba62019-04-11 21:24:28 +0800173 NetworkStackReported network_stack_reported = 182 [(log_from_module) = "network_stack"];
Yao Chend54f9dd2017-10-17 17:37:48 +0000174 }
David Chenc8a43242017-10-17 16:23:28 -0700175
David Chen6e3e6cb2018-01-03 16:14:06 -0800176 // Pulled events will start at field 10000.
Tej Singh40298312018-02-16 00:15:09 -0800177 // Next: 10022
David Chenc8a43242017-10-17 16:23:28 -0700178 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800179 WifiBytesTransfer wifi_bytes_transfer = 10000;
180 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
181 MobileBytesTransfer mobile_bytes_transfer = 10002;
182 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800183 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800184 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800185 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800186 CpuTimePerFreq cpu_time_per_freq = 10008;
187 CpuTimePerUid cpu_time_per_uid = 10009;
188 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800189 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800190 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800191 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800192 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800193 SystemElapsedRealtime system_elapsed_realtime = 10014;
194 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800195 CpuActiveTime cpu_active_time = 10016;
196 CpuClusterTime cpu_cluster_time = 10017;
Chenjie Yu937d7422018-01-10 16:37:53 -0800197 DiskSpace disk_space = 10018;
Tej Singhbf972d92018-01-10 20:51:13 -0800198 RemainingBatteryCapacity remaining_battery_capacity = 10019;
199 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800200 Temperature temperature = 10021;
David Chenc8a43242017-10-17 16:23:28 -0700201 }
yroa1fe77c2018-02-26 14:22:54 -0800202
Bookatz76aafcf2018-09-17 16:17:10 -0700203 // DO NOT USE field numbers above 100,000 in AOSP.
204 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
205 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700206}
207
Yao Chend54f9dd2017-10-17 17:37:48 +0000208/**
Yangster-mac20877162017-12-22 17:19:39 -0800209 * This proto represents a node of an attribution chain.
210 * Note: All attribution chains are represented as a repeated field of type
211 * AttributionNode. It is understood that in such arrays, the order is that
212 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000213 */
Yangster-mac20877162017-12-22 17:19:39 -0800214message AttributionNode {
215 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800216 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800217
Yangster-mac20877162017-12-22 17:19:39 -0800218 // The (optional) string tag for an element in the attribution chain. If the
219 // element has no tag, it is encoded as an empty string.
220 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700221}
222
Yao Chend54f9dd2017-10-17 17:37:48 +0000223/*
224 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800225 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000226 *
227 * RULES:
228 * - The field ids for each atom must start at 1, and count upwards by 1.
229 * Skipping field ids is not allowed.
230 * - These form an API, so renaming, renumbering or removing fields is
231 * not allowed between android releases. (This is not currently enforced,
232 * but there will be a tool to enforce this restriction).
233 * - The types must be built-in protocol buffer types, namely, no sub-messages
234 * are allowed (yet). The bytes type is also not allowed.
235 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800236 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000237 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800238 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000239 * - A field that is a uid should be a string field, tagged with the [xxx]
240 * annotation. The generated code on android will be represented by UIDs,
241 * and those UIDs will be translated in xxx to those strings.
242 *
243 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700244 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000245 * - If there is a UID, it goes first. Think in an object-oriented fashion.
246 * *****************************************************************************
247 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700248
Yao Chend54f9dd2017-10-17 17:37:48 +0000249/**
Yangster-mac80c44742018-08-26 12:20:16 -0700250 * Logs when the Thermal service HAL notifies the throttling start/stop events.
251 *
252 * Logged from:
253 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
254 */
255message ThermalThrottlingStateChanged {
256 optional android.os.TemperatureTypeEnum sensor_type = 1;
257
258 enum State {
259 UNKNOWN = 0;
260 START = 1;
261 STOP = 2;
262 }
263
264 optional State state = 2;
265
266 optional float temperature = 3;
267}
268
269/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000270 * Logs when the screen state changes.
271 *
272 * Logged from:
273 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
274 */
275message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800276 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800277 optional android.view.DisplayStateEnum state = 1 [(stateFieldOption).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700278}
Yao Chend54f9dd2017-10-17 17:37:48 +0000279
280/**
Bookatzc1a050a2017-10-10 15:49:28 -0700281 * Logs that the state of a process state, as per the activity manager, has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000282 *
283 * Logged from:
284 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
285 */
Bookatzc1a050a2017-10-10 15:49:28 -0700286message UidProcessStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700287 optional int32 uid = 1 [(stateFieldOption).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000288
Bookatzdb026a22018-01-10 19:01:56 -0800289 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800290 optional android.app.ProcessStateEnum state = 2 [(stateFieldOption).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000291}
292
293/**
Bookatzc1a050a2017-10-10 15:49:28 -0700294 * Logs that a process started, finished, crashed, or ANRed.
295 *
296 * Logged from:
297 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
298 */
299message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700300 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700301
David Chen0b5c90c2018-01-25 16:51:49 -0800302 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800303 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700304
Bookatzddccf0a2017-11-28 16:48:14 -0800305 // What lifecycle state the process changed to.
306 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800307 enum State {
308 FINISHED = 0;
309 STARTED = 1;
310 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800311 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800312 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700313}
314
Bookatzc1a050a2017-10-10 15:49:28 -0700315/**
316 * Logs when the ble scan state changes.
317 *
318 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700319 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700320 */
321message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800322 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700323
324 enum State {
325 OFF = 0;
326 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700327 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
328 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700329 }
330 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700331
Bookatze5ec0b42018-03-26 13:34:56 -0700332 // Does the scan have a filter.
333 optional bool is_filtered = 3;
334 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
335 optional bool is_first_match = 4;
336 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
337 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700338}
339
340/**
341 * Logs reporting of a ble scan finding results.
342 *
343 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700344 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700345 */
Bookatzae6738e2018-09-13 11:38:56 -0700346// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700347message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800348 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700349
350 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800351 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700352}
353
354/**
355 * Logs when a sensor state changes.
356 *
357 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700358 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700359 */
360message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800361 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700362
Bookatzc1a050a2017-10-10 15:49:28 -0700363 // The id (int) of the sensor.
364 optional int32 sensor_id = 2;
365
366 enum State {
367 OFF = 0;
368 ON = 1;
369 }
370 optional State state = 3;
371}
372
373
374/**
375 * Logs when GPS state changes.
376 *
377 * Logged from:
378 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
379 */
380message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800381 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700382
383 enum State {
384 OFF = 0;
385 ON = 1;
386 }
387 optional State state = 2;
388}
389
390
391/**
392 * Logs when a sync manager sync state changes.
393 *
394 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700395 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700396 */
397message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800398 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700399
David Chen0b5c90c2018-01-25 16:51:49 -0800400 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800401 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700402
403 enum State {
404 OFF = 0;
405 ON = 1;
406 }
407 optional State state = 3;
408}
409
410/**
411 * Logs when a job scheduler job state changes.
412 *
413 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700414 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700415 */
416message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800417 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700418
419 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800420 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700421
422 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800423 FINISHED = 0;
424 STARTED = 1;
425 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700426 }
427 optional State state = 3;
428
Tej Singh33a412b2018-03-16 18:43:59 -0700429 // The reason a job has stopped.
430 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700431 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700432 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700433}
434
435/**
436 * Logs when the audio state changes.
437 *
438 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700439 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700440 */
441message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800442 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700443
444 enum State {
445 OFF = 0;
446 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700447 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
448 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700449 }
450 optional State state = 2;
451}
452
453/**
454 * Logs when the video codec state changes.
455 *
456 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700457 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700458 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800459message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800460 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700461
462 enum State {
463 OFF = 0;
464 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700465 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
466 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700467 }
468 optional State state = 2;
469}
470
471/**
472 * Logs when the flashlight state changes.
473 *
474 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700475 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700476 */
477message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800478 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700479
480 enum State {
481 OFF = 0;
482 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700483 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
484 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700485 }
486 optional State state = 2;
487}
488
489/**
490 * Logs when the camera state changes.
491 *
492 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700493 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700494 */
495message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800496 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700497
498 enum State {
499 OFF = 0;
500 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700501 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
502 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700503 }
504 optional State state = 2;
505}
506
507/**
508 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000509 *
510 * Logged from:
511 * TODO
512 */
Bookatzd6746242017-10-24 18:39:35 -0700513message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800514 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000515
Bookatz1a1b0462018-01-12 11:47:03 -0800516 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
517 // From frameworks/base/core/proto/android/os/enums.proto.
518 optional android.os.WakeLockLevelEnum level = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700519
520 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
521 optional string tag = 3;
522
523 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800524 RELEASE = 0;
525 ACQUIRE = 1;
526 CHANGE_RELEASE = 2;
527 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700528 }
529 optional State state = 4;
530}
531
532/**
Bookatzc1a050a2017-10-10 15:49:28 -0700533 * Logs when a partial wakelock is considered 'long' (over 1 min).
534 *
535 * Logged from:
536 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
537 */
538message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800539 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700540
Yao Chend54f9dd2017-10-17 17:37:48 +0000541 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
542 optional string tag = 2;
543
Bookatzc1a050a2017-10-10 15:49:28 -0700544 // TODO: I have no idea what this is.
545 optional string history_tag = 3;
546
547 enum State {
548 OFF = 0;
549 ON = 1;
550 }
551 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000552}
553
Bookatzc1a050a2017-10-10 15:49:28 -0700554/**
555 * Logs Battery Saver state change.
556 *
557 * Logged from:
558 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
559 */
560message BatterySaverModeStateChanged {
561 enum State {
562 OFF = 0;
563 ON = 1;
564 }
565 optional State state = 1;
566}
567
568/**
569 * Logs Doze mode state change.
570 *
571 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800572 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700573 */
574message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800575 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800576}
577
578
579/**
580 * Logs state change of Doze mode including maintenance windows.
581 *
582 * Logged from:
583 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
584 */
585message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800586 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700587}
588
589/**
590 * Logs screen brightness level.
591 *
592 * Logged from:
593 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
594 */
595message ScreenBrightnessChanged {
596 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
597 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700598}
599
600/**
601 * Logs battery level (percent full, from 0 to 100).
602 *
603 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700604 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700605 */
606message BatteryLevelChanged {
607 // Battery level. Should be in [0, 100].
608 optional int32 battery_level = 1;
609}
610
611/**
612 * Logs change in charging status of the device.
613 *
614 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700615 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700616 */
617message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800618 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
619 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700620}
621
622/**
623 * Logs whether the device is plugged in, and what power source it is using.
624 *
625 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700626 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700627 */
628message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800629 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
630 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700631}
632
Bookatz8c6571b2017-10-24 15:04:41 -0700633/**
634 * Logs when an app's wakeup alarm fires.
635 *
636 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700637 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700638 */
639message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800640 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800641
642 // Name of the wakeup alarm.
643 optional string tag = 2;
644}
645
646/**
647 * Logs when an an app causes the mobile radio to change state.
648 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
649 *
650 * Logged from:
651 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
652 */
653message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800654 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800655
Bookatz1a1b0462018-01-12 11:47:03 -0800656 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
657 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800658}
659
660/**
661 * Logs when an an app causes the wifi radio to change state.
662 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
663 *
664 * Logged from:
665 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
666 */
667message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800668 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800669
Bookatz1a1b0462018-01-12 11:47:03 -0800670 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
671 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700672}
673
674/**
675 * Logs kernel wakeup reasons and aborts.
676 *
677 * Logged from:
678 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
679 */
680message KernelWakeupReported {
681 // Name of the kernel wakeup reason (or abort).
682 optional string wakeup_reason_name = 1;
683
684 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800685 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700686}
687
688/**
689 * Logs wifi locks held by an app.
690 *
691 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700692 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700693 */
694message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800695 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700696
697 enum State {
698 OFF = 0;
699 ON = 1;
700 }
701 optional State state = 2;
702}
703
704/**
705 * Logs wifi signal strength changes.
706 *
707 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700708 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700709 */
710message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800711 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
712 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700713}
714
715/**
716 * Logs wifi scans performed by an app.
717 *
718 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700719 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700720 */
721message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800722 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700723
724 enum State {
725 OFF = 0;
726 ON = 1;
727 }
728 optional State state = 2;
729}
730
731/**
Tej Singh4503e102018-01-04 14:35:01 -0800732 * Logs wifi multicast locks held by an app
733 *
734 * Logged from:
735 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
736 */
737message WifiMulticastLockStateChanged {
738 repeated AttributionNode attribution_node = 1;
739
740 enum State {
741 OFF = 0;
742 ON = 1;
743 }
744 optional State state = 2;
745}
746
747/**
Tej Singh1ea42892018-01-19 09:27:00 -0800748 * Logs shutdown reason and duration on next boot.
749 *
750 * Logged from:
751 * frameworks/base/core/java/com/android/server/BootReceiver.java
752 */
753message ShutdownSequenceReported {
754 // True if shutdown is for a reboot. Default: false if we do not know.
755 optional bool reboot = 1;
756
757 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
758 optional string reason = 2;
759
760 // Beginning of shutdown time in ms using wall clock time since unix epoch.
761 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -0800762 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -0800763
764 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -0800765 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -0800766}
767
Tej Singh6483ea42018-01-25 17:45:49 -0800768
769/**
770 * Logs boot reason and duration.
771 *
772 * Logged from:
773 * system/core/bootstat/bootstat.cpp
774 */
775message BootSequenceReported {
776 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
777 // Default: "<EMPTY>" if not available.
778 optional string bootloader_reason = 1;
779
780 // Reason for system boot. Eg. bootloader, reboot,userrequested
781 // Default: "<EMPTY>" if not available.
782 optional string system_reason = 2;
783
784 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -0800785 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -0800786
787 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800788 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -0800789
790 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800791 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -0800792
793 // Time since last boot in ms. Default: 0 if not available.
794 optional int64 time_since_last_boot = 6;
795}
796
Tej Singhc477d9c2018-02-05 18:31:39 -0800797
798/**
799 * Logs call state and disconnect cause (if applicable).
800 *
801 * Logged from:
802 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
803 */
804message CallStateChanged {
805 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
806 // From frameworks/base/core/proto/android/telecomm/enums.proto.
807 optional android.telecom.CallStateEnum call_state = 1;
808
809 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
810 // This value is only applicable when the call_state is DISCONNECTED, and
811 // should always be UNKNOWN if the call_state is not DISCONNECTED.
812 // From frameworks/base/core/proto/android/telecomm/enums.proto.
813 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
814
815 // True if the call is self-managed, which are apps that use the
816 // telecom infrastructure to make their own calls.
817 optional bool self_managed = 3;
818
819 // True if call is external. External calls are calls on connected Wear
820 // devices but show up in Telecom so the user can pull them onto the device.
821 optional bool external_call = 4;
822}
823
Tej Singh1ea42892018-01-19 09:27:00 -0800824/**
Tej Singhdd7bd352018-02-09 19:33:15 -0800825 * Logs keyguard state. The keyguard is the lock screen.
826 *
827 * Logged from:
828 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
829 */
830message KeyguardStateChanged {
831 enum State {
832 UNKNOWN = 0;
833 // The keyguard is hidden when the phone is unlocked.
834 HIDDEN = 1;
835 // The keyguard is shown when the phone is locked (screen turns off).
836 SHOWN= 2;
837 // The keyguard is occluded when something is overlaying the keyguard.
838 // Eg. Opening the camera while on the lock screen.
839 OCCLUDED = 3;
840 }
841 optional State state = 1;
842}
843
844/**
845 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
846 * prompts the user to enter a password (pattern, pin, etc).
847 *
848 * Logged from:
849 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
850 */
851
852message KeyguardBouncerStateChanged {
853 enum State {
854 UNKNOWN = 0;
855 // Bouncer is hidden, either as a result of successfully entering the
856 // password, screen timing out, or user going back to lock screen.
857 HIDDEN = 1;
858 // This is when the user is being prompted to enter the password.
859 SHOWN = 2;
860 }
861 optional State state = 1;
862}
863
864/**
865 * Logs the result of entering a password into the keyguard bouncer.
866 *
867 * Logged from:
868 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
869 */
870message KeyguardBouncerPasswordEntered {
871 enum BouncerResult {
872 UNKNOWN = 0;
873 // The password entered was incorrect.
874 FAILURE = 1;
875 // The password entered was correct.
876 SUCCESS = 2;
877 }
878 optional BouncerResult result = 1;
879}
880
Tej Singha883b372018-02-15 11:30:01 -0800881/*
882 * Logs changes to the configuration of the device. The configuration is defined
883 * in frameworks/base/core/java/android/content/res/Configuration.java
884 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
885 * Please go there to interpret the possible values each field can be.
886 *
887 * Logged from:
888 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
889 */
890message ResourceConfigurationChanged {
891 // Bit mask of color capabilities of the screen.
892 // Contains information about the color gamut and hdr mode of the screen.
893 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
894 optional int32 colorMode = 1;
895
896 // The target screen density being rendered to.
897 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
898 optional int32 densityDpi = 2;
899
900 // Current user preference for the scaling factor for fonts,
901 // relative to the base density scaling.
902 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
903 optional float fontScale = 3;
904
905 // Flag indicating whether the hard keyboard is hidden.
906 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
907 optional int32 hardKeyboardHidden = 4;
908
909 // The type of keyboard attached to the device.
910 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
911 optional int32 keyboard = 5;
912
913 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
914 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
915 optional int32 keyboardHideen = 6;
916
917 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
918 // 0 if undefined.
919 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
920 optional int32 mcc = 7;
921
922 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
923 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
924 // MNC_ZERO symbol defined in Configuration.java.
925 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
926 optional int32 mnc = 8;
927
928 // The kind of navigation available on the device.
929 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
930 optional int32 navigation = 9;
931
932 // Flag indicating whether the navigation is available.
933 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
934 optional int32 navigationHidden = 10;
935
936 // Overall orientation of the screen.
937 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
938 optional int32 orientation = 11;
939
940 // The current height of the available screen space, in dp units.
941 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
942 optional int32 screenHeightDp = 12;
943
944 // Bit mask of overall layout of the screen.
945 // Contains information about screen size, whether the screen is wider/taller
946 // than normal, whether the screen layout is right-tl-left or left-to-right,
947 // and whether the screen has a rounded shape.
948 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
949 optional int32 screenLayout = 13;
950
951 // Current width of the available screen space, in dp units.
952 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
953 optional int32 screenWidthDp = 14;
954
955 // The smallest screen size an application will see in normal operation.
956 // This is the smallest value of both screenWidthDp and screenHeightDp
957 // in portrait and landscape.
958 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
959 optional int32 smallestScreenWidthDp = 15;
960
961 // The type of touch screen attached to the device.
962 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
963 optional int32 touchscreen = 16;
964
965 // Bit mask of the ui mode.
966 // Contains information about the overall ui mode of the device.
967 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
968 // Also contains information about whether the device is in night mode.
969 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
970 optional int32 uiMode = 17;
971}
972
Tej Singheee317b2018-03-07 19:28:05 -0800973
974/**
975 * Logs changes in the connection state of the mobile radio.
976 *
977 * Logged from:
978 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
979 */
980message MobileConnectionStateChanged {
981 // States are from the state machine DataConnection.java.
982 enum State {
983 UNKNOWN = 0;
984 // The connection is inactive, or disconnected.
985 INACTIVE = 1;
986 // The connection is being activated, or connecting.
987 ACTIVATING = 2;
988 // The connection is active, or connected.
989 ACTIVE = 3;
990 // The connection is disconnecting.
991 DISCONNECTING = 4;
992 // The connection is disconnecting after creating a connection.
993 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
994 }
995 optional State state = 1;
996 // For multi-sim phones, this distinguishes between the sim cards.
997 optional int32 sim_slot_index = 2;
998 // Used to identify the connection. Starts at 0 and increments by 1 for
999 // every new network created. Resets whenever the device reboots.
1000 optional int32 data_connection_id = 3;
1001 // A bitmask for the capabilities of this connection.
1002 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1003 // Default value (if we have no information): 0
1004 optional int64 capabilities = 4;
1005 // If this connection has internet.
1006 // This just checks if the DEFAULT bit of capabilities is set.
1007 optional bool has_internet = 5;
1008}
1009
1010/**
1011 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1012 *
1013 * Logged from:
1014 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1015 */
1016message MobileRadioTechnologyChanged {
1017 optional android.telephony.NetworkTypeEnum state = 1;
1018 // For multi-sim phones, this distinguishes between the sim cards.
1019 optional int32 sim_slot_index = 2;
1020}
1021
Andrew Chantb56388b2018-03-22 21:07:33 -07001022/**
1023 * Logs the VID and PID of any connected USB devices.
1024 *
1025 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1026 *
1027 * Logged by Vendor.
1028 */
1029message UsbDeviceAttached {
1030 optional int32 vid = 1;
1031 optional int32 pid = 2;
1032 optional bool has_audio = 3;
1033 optional bool has_hid = 4;
1034 optional bool has_storage = 5;
1035}
1036
Tej Singheee317b2018-03-07 19:28:05 -08001037
Tej Singhdd7bd352018-02-09 19:33:15 -08001038/**
Tej Singh5d991e12018-03-09 19:48:11 -08001039 * Logs when Bluetooth is enabled and disabled.
1040 *
1041 * Logged from:
1042 * services/core/java/com/android/server/BluetoothManagerService.java
1043 */
1044message BluetoothEnabledStateChanged {
1045 repeated AttributionNode attribution_node = 1;
1046 // Whether or not bluetooth is enabled on the device.
1047 enum State {
1048 UNKNOWN = 0;
1049 ENABLED = 1;
1050 DISABLED = 2;
1051 }
1052 optional State state = 2;
1053 // The reason for being enabled/disabled.
1054 // Eg. Airplane mode, crash, application request.
1055 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1056 // If the reason is an application request, this will be the package name.
1057 optional string pkgName = 4;
1058}
1059
1060/**
Jack He22e4a1d2019-01-09 01:19:13 -08001061 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001062 *
1063 * Logged from:
Jack He22e4a1d2019-01-09 01:19:13 -08001064 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1065 *
1066 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001067 */
1068message BluetoothConnectionStateChanged {
1069 // The state of the connection.
1070 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1071 optional android.bluetooth.ConnectionStateEnum state = 1;
1072 // An identifier that can be used to match connect and disconnect events.
1073 // Currently is last two bytes of a hash of a device level ID and
1074 // the mac address of the bluetooth device that is connected.
Jack He22e4a1d2019-01-09 01:19:13 -08001075 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1076 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001077 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1078 // From android.bluetooth.BluetoothAdapter.java
Jack He22e4a1d2019-01-09 01:19:13 -08001079 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001080 optional int32 bt_profile = 3;
Jack He22e4a1d2019-01-09 01:19:13 -08001081 // An identifier that can be used to match events for this device.
1082 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1083 // Salt: Randomly generated 256 bit value
1084 // Hash algorithm: HMAC-SHA256
1085 // Size: 32 byte
1086 // Default: null or empty if the device identifier is not known
1087 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1088}
1089
1090/**
1091 * Logs when a Bluetooth device connects and disconnects over ACL
1092 *
1093 * Logged from:
1094 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1095 *
1096 * Next Tag: 3
1097 */
1098message BluetoothAclConnectionStateChanged {
1099 // An identifier that can be used to match events for this device.
1100 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1101 // Salt: Randomly generated 256 bit value
1102 // Hash algorithm: HMAC-SHA256
1103 // Size: 32 byte
1104 // Default: null or empty if the device identifier is not known
1105 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1106 // The state of the connection.
1107 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1108 optional android.bluetooth.ConnectionStateEnum state = 2;
1109}
1110
1111/**
1112 * Logs when a Bluetooth device connects and disconnects over SCO
1113 *
1114 * Logged from:
1115 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1116 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1117 *
1118 * Next Tag: 4
1119 */
1120message BluetoothScoConnectionStateChanged {
1121 // An identifier that can be used to match events for this device.
1122 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1123 // Salt: Randomly generated 256 bit value
1124 // Hash algorithm: HMAC-SHA256
1125 // Size: 32 byte
1126 // Default: null or empty if the device identifier is not known
1127 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1128 // The state of the connection.
1129 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1130 optional android.bluetooth.ConnectionStateEnum state = 2;
1131 // Codec used for this SCO connection
1132 // Default: UNKNOWN
1133 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001134}
1135
Jack He924f3462019-01-09 20:54:41 -08001136/**
1137 * Logged when active device of a profile changes
1138 *
1139 * Logged from:
1140 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1141 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1142 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1143 */
1144message BluetoothActiveDeviceChanged {
1145 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1146 // From android.bluetooth.BluetoothProfile
1147 optional int32 bt_profile = 1;
1148 // An identifier that can be used to match events for this new active device.
1149 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1150 // Salt: Randomly generated 256 bit value
1151 // Hash algorithm: HMAC-SHA256
1152 // Size: 32 byte
1153 // Default: null or empty if there is no active device for this profile
1154 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1155}
1156
Jack He52260142018-12-18 15:43:27 -08001157// Logs when there is an event affecting Bluetooth device's link layer connection.
1158// - This event is triggered when there is a related HCI command or event
1159// - Users of this metrics can deduce Bluetooth device's connection state from these events
1160// - HCI commands are logged before the command is sent, after receiving command status, and after
1161// receiving command complete
1162// - HCI events are logged when they arrive
1163//
1164// Low level log from system/bt
1165//
1166// Bluetooth classic commands:
1167// - CMD_CREATE_CONNECTION
1168// - CMD_DISCONNECT
1169// - CMD_CREATE_CONNECTION_CANCEL
1170// - CMD_ACCEPT_CONNECTION_REQUEST
1171// - CMD_REJECT_CONNECTION_REQUEST
1172// - CMD_SETUP_ESCO_CONNECTION
1173// - CMD_ACCEPT_ESCO_CONNECTION
1174// - CMD_REJECT_ESCO_CONNECTION
1175// - CMD_ENH_SETUP_ESCO_CONNECTION
1176// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1177//
1178// Bluetooth low energy commands:
1179// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1180// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1181// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1182// - CMD_BLE_CLEAR_WHITE_LIST
1183// - CMD_BLE_ADD_WHITE_LIST
1184// - CMD_BLE_REMOVE_WHITE_LIST
1185//
1186// Bluetooth classic events:
1187// - EVT_CONNECTION_COMP
1188// - EVT_CONNECTION_REQUEST
1189// - EVT_DISCONNECTION_COMP
1190// - EVT_ESCO_CONNECTION_COMP
1191// - EVT_ESCO_CONNECTION_CHANGED
1192//
1193// Bluetooth low energy meta events:
1194// - BLE_EVT_CONN_COMPLETE_EVT
1195// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1196//
1197// Next tag: 10
1198message BluetoothLinkLayerConnectionEvent {
1199 // An identifier that can be used to match events for this device.
1200 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1201 // Salt: Randomly generated 256 bit value
1202 // Hash algorithm: HMAC-SHA256
1203 // Size: 32 byte
1204 // Default: null or empty if the device identifier is not known
1205 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1206 // Connection handle of this connection if available
1207 // Range: 0x0000 - 0x0EFF (12 bits)
1208 // Default: 0xFFFF if the handle is unknown
1209 optional int32 connection_handle = 2;
1210 // Direction of the link
1211 // Default: DIRECTION_UNKNOWN
1212 optional android.bluetooth.DirectionEnum direction = 3;
1213 // Type of this link
1214 // Default: LINK_TYPE_UNKNOWN
1215 optional android.bluetooth.LinkTypeEnum type = 4;
1216
1217 // Reason metadata for this link layer connection event, rules for interpretation:
1218 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1219 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1220 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1221 // set and valid, ignore hci_ble_event
1222
1223 // HCI command associated with this event
1224 // Default: CMD_UNKNOWN
1225 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1226 // HCI event associated with this event
1227 // Default: EVT_UNKNOWN
1228 optional android.bluetooth.hci.EventEnum hci_event = 6;
1229 // HCI BLE meta event associated with this event
1230 // Default: BLE_EVT_UNKNOWN
1231 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1232 // HCI command status code if this is triggerred by hci_cmd
1233 // Default: STATUS_UNKNOWN
1234 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1235 // HCI reason code associated with this event
1236 // Default: STATUS_UNKNOWN
1237 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1238}
1239
Jack He924f3462019-01-09 20:54:41 -08001240/**
1241 * Logs when there is a change in Bluetooth A2DP playback state
1242 *
1243 * Logged from:
1244 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1245 */
1246message BluetoothA2dpPlaybackStateChanged {
1247 // An identifier that can be used to match events for this device.
1248 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1249 // Salt: Randomly generated 256 bit value
1250 // Hash algorithm: HMAC-SHA256
1251 // Size: 32 byte
1252 // Default: null or empty if the device identifier is not known
1253 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1254 // Current playback state
1255 // Default: PLAYBACK_STATE_UNKNOWN
1256 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1257 // Current audio coding mode
1258 // Default: AUDIO_CODING_MODE_UNKNOWN
1259 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1260}
1261
1262/**
1263 * Logs when there is a change in A2DP codec config for a particular remote device
1264 *
1265 * Logged from:
1266 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1267 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1268 */
1269message BluetoothA2dpCodecConfigChanged {
1270 // An identifier that can be used to match events for this device.
1271 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1272 // Salt: Randomly generated 256 bit value
1273 // Hash algorithm: HMAC-SHA256
1274 // Size: 32 byte
1275 // Default: null or empty if the device identifier is not known
1276 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1277 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1278 // Default SOURCE_CODEC_TYPE_INVALID
1279 optional int32 codec_type = 2;
1280 // Codec priroity, the higher the more preferred, -1 for disabled
1281 // Default: CODEC_PRIORITY_DEFAULT
1282 optional int32 codec_priority = 3;
1283 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1284 // Default: SAMPLE_RATE_NONE
1285 optional int32 sample_rate = 4;
1286 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1287 // Default: BITS_PER_SAMPLE_NONE
1288 optional int32 bits_per_sample = 5;
1289 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1290 // Default: CHANNEL_MODE_NONE
1291 optional int32 channel_mode = 6;
1292 // Codec specific values
1293 // Default 0
1294 optional int64 codec_specific_1 = 7;
1295 optional int64 codec_specific_2 = 8;
1296 optional int64 codec_specific_3 = 9;
1297 optional int64 codec_specific_4 = 10;
1298}
1299
1300/**
1301 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1302 * Each codec's capability is logged separately due to statsd restriction
1303 *
1304 * Logged from:
1305 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1306 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1307 */
1308message BluetoothA2dpCodecCapabilityChanged {
1309 // An identifier that can be used to match events for this device.
1310 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1311 // Salt: Randomly generated 256 bit value
1312 // Hash algorithm: HMAC-SHA256
1313 // Size: 32 byte
1314 // Default: null or empty if the device identifier is not known
1315 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1316 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1317 // Default SOURCE_CODEC_TYPE_INVALID
1318 optional int32 codec_type = 2;
1319 // Codec priroity, the higher the more preferred, -1 for disabled
1320 // Default: CODEC_PRIORITY_DEFAULT
1321 optional int32 codec_priority = 3;
1322 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1323 // in BluetoothCodecConfig
1324 // Default: empty and SAMPLE_RATE_NONE for individual item
1325 optional int32 sample_rate = 4;
1326 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1327 // in BluetoothCodecConfig
1328 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1329 optional int32 bits_per_sample = 5;
1330 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1331 // BluetoothCodecConfig
1332 // Default: empty and CHANNEL_MODE_NONE for individual item
1333 optional int32 channel_mode = 6;
1334 // Codec specific values
1335 // Default 0
1336 optional int64 codec_specific_1 = 7;
1337 optional int64 codec_specific_2 = 8;
1338 optional int64 codec_specific_3 = 9;
1339 optional int64 codec_specific_4 = 10;
1340}
1341
1342/**
1343 * Logs when A2DP failed to read from PCM source.
1344 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1345 *
1346 * Logged from:
1347 * system/bt
1348 */
1349message BluetoothA2dpAudioUnderrunReported {
1350 // An identifier that can be used to match events for this device.
1351 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1352 // Salt: Randomly generated 256 bit value
1353 // Hash algorithm: HMAC-SHA256
1354 // Size: 32 byte
1355 // Default: null or empty if the device identifier is not known
1356 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1357 // Encoding interval in nanoseconds
1358 // Default: 0
1359 optional int64 encoding_interval_nanos = 2;
1360 // Number of bytes of PCM data that could not be read from the source
1361 // Default: 0
1362 optional int32 num_missing_pcm_bytes = 3;
1363}
1364
1365/**
1366 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1367 * buffer queue is full and we have to drop data
1368 *
1369 * Logged from:
1370 * system/bt
1371 */
1372message BluetoothA2dpAudioOverrunReported {
1373 // An identifier that can be used to match events for this device.
1374 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1375 // Salt: Randomly generated 256 bit value
1376 // Hash algorithm: HMAC-SHA256
1377 // Size: 32 byte
1378 // Default: null or empty if the device identifier is not known
1379 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1380 // Encoding interval in nanoseconds
1381 // Default: 0
1382 optional int64 encoding_interval_nanos = 2;
1383 // Number of buffers dropped in this event
1384 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1385 // Default: 0
1386 optional int32 num_dropped_buffers = 3;
1387 // Number of encoded buffers dropped in this event
1388 // Default 0
1389 optional int32 num_dropped_encoded_frames = 4;
1390 // Number of encoded bytes dropped in this event
1391 // Default: 0
1392 optional int32 num_dropped_encoded_bytes = 5;
1393}
1394
1395/**
1396 * Logs when we receive reports regarding a device's RSSI value
1397 *
1398 * Logged from:
1399 * system/bt
1400 */
1401message BluetoothDeviceRssiReported {
1402 // An identifier that can be used to match events for this device.
1403 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1404 // Salt: Randomly generated 256 bit value
1405 // Hash algorithm: HMAC-SHA256
1406 // Size: 32 byte
1407 // Default: null or empty if the device identifier is not known
1408 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1409 // Connection handle of this connection if available
1410 // Range: 0x0000 - 0x0EFF (12 bits)
1411 // Default: 0xFFFF if the handle is unknown
1412 optional int32 connection_handle = 2;
1413 // HCI command status code if this is triggerred by hci_cmd
1414 // Default: STATUS_UNKNOWN
1415 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1416 // BR/EDR
1417 // Range: -128 ≤ N ≤ 127 (signed integer)
1418 // Units: dB
1419 // LE:
1420 // Range: -127 to 20, 127 (signed integer)
1421 // Units: dBm
1422 // Invalid when an out of range value is reported
1423 optional int32 rssi = 4;
1424}
1425
1426/**
1427 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1428 *
1429 * Logged from:
1430 * system/bt
1431 */
1432message BluetoothDeviceFailedContactCounterReported {
1433 // An identifier that can be used to match events for this device.
1434 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1435 // Salt: Randomly generated 256 bit value
1436 // Hash algorithm: HMAC-SHA256
1437 // Size: 32 byte
1438 // Default: null or empty if the device identifier is not known
1439 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1440 // Connection handle of this connection if available
1441 // Range: 0x0000 - 0x0EFF (12 bits)
1442 // Default: 0xFFFF if the handle is unknown
1443 optional int32 connection_handle = 2;
1444 // HCI command status code if this is triggerred by hci_cmd
1445 // Default: STATUS_UNKNOWN
1446 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1447 // Number of consecutive failed contacts for a connection corresponding to the Handle
1448 // Range: uint16_t, 0-0xFFFF
1449 // Default: 0xFFFFF
1450 optional int32 failed_contact_counter = 4;
1451}
1452
1453/**
1454 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1455 *
1456 * Logged from:
1457 * system/bt
1458 */
1459message BluetoothDeviceTxPowerLevelReported {
1460 // An identifier that can be used to match events for this device.
1461 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1462 // Salt: Randomly generated 256 bit value
1463 // Hash algorithm: HMAC-SHA256
1464 // Size: 32 byte
1465 // Default: null or empty if the device identifier is not known
1466 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1467 // Connection handle of this connection if available
1468 // Range: 0x0000 - 0x0EFF (12 bits)
1469 // Default: 0xFFFF if the handle is unknown
1470 optional int32 connection_handle = 2;
Jack He4d6abe62019-01-20 21:22:46 -08001471 // HCI command status code if this is triggered by hci_cmd
Jack He924f3462019-01-09 20:54:41 -08001472 // Default: STATUS_UNKNOWN
1473 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1474 // Range: -30 ≤ N ≤ 20
1475 // Units: dBm
1476 // Invalid when an out of range value is reported
1477 optional int32 transmit_power_level = 4;
1478}
Jack He52260142018-12-18 15:43:27 -08001479
Tej Singh5d991e12018-03-09 19:48:11 -08001480/**
Jack He4d6abe62019-01-20 21:22:46 -08001481 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1482 * receiving an HCI command from the host
1483 *
1484 * Logged from: system/bt
1485 */
1486message BluetoothHciTimeoutReported {
1487 // HCI command associated with this event
1488 // Default: CMD_UNKNOWN
1489 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1490}
1491
1492/**
1493 * Logs when we receive Bluetooth Link Quality Report event from the controller
1494 * See Android Bluetooth HCI specification for more details
1495 *
1496 * Note: all count and bytes field are counted since last event
1497 *
1498 * Logged from: system/bt
1499 */
1500message BluetoothQualityReportReported {
1501 // Quality report ID
1502 // Original type: uint8_t
1503 // Default: BQR_ID_UNKNOWN
1504 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1505 // Packet type of the connection
1506 // Original type: uint8_t
1507 // Default: BQR_PACKET_TYPE_UNKNOWN
1508 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1509 // Connection handle of the connection
1510 // Original type: uint16_t
1511 optional int32 connection_handle = 3;
1512 // Performing Role for the connection
1513 // Original type: uint8_t
1514 optional int32 connection_role = 4;
1515 // Current Transmit Power Level for the connection. This value is the same as the controller's
1516 // response to the HCI_Read_Transmit_Power_Level HCI command
1517 // Original type: uint8_t
1518 optional int32 tx_power_level = 5;
1519 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1520 // absolute receiver signal strength value
1521 // Original type: int8_t
1522 optional int32 rssi = 6;
1523 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1524 // channels used by the link currently
1525 // Original type: uint8_t
1526 optional int32 snr = 7;
1527 // Indicates the number of unused channels in AFH_channel_map
1528 // Original type: uint8_t
1529 optional int32 unused_afh_channel_count = 8;
1530 // Indicates the number of the channels which are interfered and quality is bad but are still
1531 // selected for AFH
1532 // Original type: uint8_t
1533 optional int32 afh_select_unideal_channel_count = 9;
1534 // Current Link Supervision Timeout Setting
1535 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1536 // Original type: uint16_t
1537 optional int32 lsto = 10;
1538 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1539 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1540 // 0x01 (Piconet Clock)
1541 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1542 // Original type: uint32_t
1543 optional int64 connection_piconet_clock = 11;
1544 // The count of retransmission
1545 // Original type: uint32_t
1546 optional int64 retransmission_count = 12;
1547 // The count of no RX
1548 // Original type: uint32_t
1549 optional int64 no_rx_count = 13;
1550 // The count of NAK (Negative Acknowledge)
1551 // Original type: uint32_t
1552 optional int64 nak_count = 14;
1553 // Controller timestamp of last TX ACK
1554 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1555 // Original type: uint32_t
1556 optional int64 last_tx_ack_timestamp = 15;
1557 // The count of Flow-off (STOP)
1558 // Original type: uint32_t
1559 optional int64 flow_off_count = 16;
1560 // Controller timestamp of last Flow-on (GO)
1561 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1562 // Original type: uint32_t
1563 optional int64 last_flow_on_timestamp = 17;
1564 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1565 // Original type: uint32_t
1566 optional int64 buffer_overflow_bytes = 18;
1567 // Buffer underflow count (in byte) since last event
1568 // Original type: uint32_t
1569 optional int64 buffer_underflow_bytes = 19;
1570}
1571
1572/**
1573 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1574 *
1575 * Notes:
1576 * - Each event can be partially filled as we might learn different pieces of device
1577 * information at different time
1578 * - Multiple device info events can be combined to give more complete picture
1579 * - When multiple device info events tries to describe the same information, the
1580 * later one wins
1581 *
1582 * Logged from:
1583 * packages/apps/Bluetooth
1584 */
1585message BluetoothManufacturerInfoReported {
1586 // An identifier that can be used to match events for this device.
1587 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1588 // Salt: Randomly generated 256 bit value
1589 // Hash algorithm: HMAC-SHA256
1590 // Size: 32 byte
1591 // Default: null or empty if the device identifier is not known
1592 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1593 // Where is this device info obtained from
1594 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1595 // Name of the data source
1596 // For EXTERNAL: package name of the data source
1597 // For INTERNAL: null for general case, component name otherwise
1598 optional string source_name = 3;
1599 // Name of the manufacturer of this device
1600 optional string manufacturer = 4;
1601 // Model of this device
1602 optional string model = 5;
1603 // Hardware version of this device
1604 optional string hardware_version = 6;
1605 // Software version of this device
1606 optional string software_version = 7;
1607}
1608
1609/**
1610 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1611 * device, as documented by the Bluetooth Core HCI specification
1612 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1613 * Vol 2, Part E, Page 1118
1614 *
1615 * Logged from:
1616 * system/bt
1617 */
1618message BluetoothRemoteVersionInfoReported {
1619 // Connection handle of the connection
1620 // Original type: uint16_t
1621 optional int32 connection_handle = 1;
1622 // HCI command status code
1623 // Default: STATUS_UNKNOWN
1624 optional android.bluetooth.hci.StatusEnum hci_status = 2;
1625 // 1 byte Version of current LMP in the remote controller
1626 optional int32 lmp_version = 3;
1627 // 2 bytes LMP manufacturer code of the remote controller
1628 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
1629 optional int32 lmp_manufacturer_code = 4;
1630 // 4 bytes subversion of the LMP in the remote controller
1631 optional int32 lmp_subversion = 5;
1632}
1633
1634/**
1635 * Logs when certain Bluetooth SDP attributes are discovered
1636 * Constant definitions are from:
1637 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
1638 *
1639 * Current logged attributes:
1640 * - BluetoothProfileDescriptorList
1641 * - Supported Features Bitmask
1642 *
1643 * Logged from:
1644 * system/bt
1645 */
1646message BluetoothSdpAttributeReported {
1647 // An identifier that can be used to match events for this device.
1648 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1649 // Salt: Randomly generated 256 bit value
1650 // Hash algorithm: HMAC-SHA256
1651 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1652 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
1653 // Original type: uint16_t
1654 optional int32 protocol_uuid = 2;
1655 // Short form UUIDs used to identify Bluetooth SDP attribute types
1656 // Original type: uint16_t
1657 optional int32 attribute_id = 3;
1658 // Attribute value for the particular attribute
1659 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1660}
1661
1662/**
1663 * Logs when bond state of a Bluetooth device changes
1664 *
1665 * Logged from:
1666 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
1667 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
1668 */
1669message BluetoothBondStateChanged {
1670 // An identifier that can be used to match events for this device.
1671 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1672 // Salt: Randomly generated 256 bit value
1673 // Hash algorithm: HMAC-SHA256
1674 // Size: 32 byte
1675 // Default: null or empty if the device identifier is not known
1676 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1677 // Preferred transport type to remote dual mode device
1678 // Default: TRANSPORT_AUTO means no preference
1679 optional android.bluetooth.TransportTypeEnum transport = 2;
1680 // The type of this Bluetooth device (Classic, LE, or Dual mode)
1681 // Default: UNKNOWN
1682 optional android.bluetooth.DeviceTypeEnum type = 3;
1683 // Current bond state (NONE, BONDING, BONDED)
1684 // Default: BOND_STATE_UNKNOWN
1685 optional android.bluetooth.BondStateEnum bond_state = 4;
1686 // Bonding sub state
1687 // Default: BOND_SUB_STATE_UNKNOWN
1688 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
1689 // Unbond Reason
1690 // Default: UNBOND_REASON_UNKNOWN
1691 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
1692}
1693
1694/**
1695 * Logs there is an event related Bluetooth classic pairing
1696 *
1697 * Logged from:
1698 * system/bt
1699 */
1700message BluetoothClassicPairingEventReported {
1701 // An identifier that can be used to match events for this device.
1702 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1703 // Salt: Randomly generated 256 bit value
1704 // Hash algorithm: HMAC-SHA256
1705 // Size: 32 byte
1706 // Default: null or empty if the device identifier is not known
1707 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1708 // Connection handle of this connection if available
1709 // Range: 0x0000 - 0x0EFF (12 bits)
1710 // Default: 0xFFFF if the handle is unknown
1711 optional int32 connection_handle = 2;
1712 // HCI command associated with this event
1713 // Default: CMD_UNKNOWN
1714 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
1715 // HCI event associated with this event
1716 // Default: EVT_UNKNOWN
1717 optional android.bluetooth.hci.EventEnum hci_event = 4;
1718 // HCI command status code if this is triggerred by hci_cmd
1719 // Default: STATUS_UNKNOWN
1720 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
1721 // HCI reason code associated with this event
1722 // Default: STATUS_UNKNOWN
1723 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07001724 // A status value related to this specific event
1725 // Default: 0
1726 optional int64 event_value = 7;
Jack He4d6abe62019-01-20 21:22:46 -08001727}
1728
1729/**
1730 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
1731 *
1732 * Logged from:
1733 * system/bt
1734 */
1735message BluetoothSmpPairingEventReported {
1736 // An identifier that can be used to match events for this device.
1737 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1738 // Salt: Randomly generated 256 bit value
1739 // Hash algorithm: HMAC-SHA256
1740 // Size: 32 byte
1741 // Default: null or empty if the device identifier is not known
1742 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1743 // SMP command sent or received over L2CAP
1744 // Default: CMD_UNKNOWN
1745 optional android.bluetooth.smp.CommandEnum smp_command = 2;
1746 // Whether this command is sent or received
1747 // Default: DIRECTION_UNKNOWN
1748 optional android.bluetooth.DirectionEnum direction = 3;
1749 // SMP failure reason code
1750 // Default: PAIRING_FAIL_REASON_DEFAULT
1751 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
1752}
1753
1754/**
Jack He9c30c7c6b2019-01-30 17:24:55 -08001755 * Logs when a Bluetooth socket’s connection state changed
1756 *
1757 * Logged from:
1758 * system/bt
1759 */
1760message BluetoothSocketConnectionStateChanged {
1761 // An identifier that can be used to match events for this device.
1762 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1763 // Salt: Randomly generated 256 bit value
1764 // Hash algorithm: HMAC-SHA256
1765 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08001766 // Default: null or empty if this is a server listener socket
Jack He9c30c7c6b2019-01-30 17:24:55 -08001767 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08001768 // Temporary port of this socket for the current connection or session only
Jack He9c30c7c6b2019-01-30 17:24:55 -08001769 // Default 0 when unknown or don't care
1770 optional int32 port = 2;
1771 // Socket type as mentioned in
1772 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
1773 // Default: SOCKET_TYPE_UNKNOWN
1774 optional android.bluetooth.SocketTypeEnum type = 3;
1775 // Socket connection state
1776 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
1777 optional android.bluetooth.SocketConnectionstateEnum state = 4;
1778 // Number of bytes sent to remote device during this connection
1779 optional int64 tx_bytes = 5;
1780 // Number of bytes received from remote device during this connection
1781 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08001782 // Socket owner's UID
1783 optional int32 uid = 7 [(is_uid) = true];
1784 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
1785 // |port| must be spawned by |server_port|
1786 // Default 0 when unknown or don't care
1787 optional int32 server_port = 8;
1788 // Whether this is a server listener socket
1789 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He9c30c7c6b2019-01-30 17:24:55 -08001790}
1791
1792/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001793 * Logs when something is plugged into or removed from the USB-C connector.
1794 *
1795 * Logged from:
1796 * Vendor USB HAL.
1797 */
1798message UsbConnectorStateChanged {
1799 enum State {
1800 DISCONNECTED = 0;
1801 CONNECTED = 1;
1802 }
1803 optional State state = 1;
1804}
1805
1806/**
1807 * Logs the reported speaker impedance.
1808 *
1809 * Logged from:
1810 * Vendor audio implementation.
1811 */
1812message SpeakerImpedanceReported {
1813 optional int32 speaker_location = 1;
1814 optional int32 impedance = 2;
1815}
1816
1817/**
1818 * Logs the report of a failed hardware.
1819 *
1820 * Logged from:
1821 * Vendor HALs.
1822 *
1823 */
1824message HardwareFailed {
1825 enum HardwareType {
1826 HARDWARE_FAILED_UNKNOWN = 0;
1827 HARDWARE_FAILED_MICROPHONE = 1;
1828 HARDWARE_FAILED_CODEC = 2;
1829 HARDWARE_FAILED_SPEAKER = 3;
1830 HARDWARE_FAILED_FINGERPRINT = 4;
1831 }
1832 optional HardwareType hardware_type = 1;
1833
1834 /* hardware_location allows vendors to differentiate between multiple instances of
1835 * the same hardware_type. The specific locations are vendor defined integers,
1836 * referring to board-specific numbering schemes.
1837 */
1838 optional int32 hardware_location = 2;
1839
1840 /* failure_code is specific to the HardwareType of the failed hardware.
1841 * It should use the enum values defined below.
1842 */
1843 enum MicrophoneFailureCode {
1844 MICROPHONE_FAILURE_COMPLETE = 0;
1845 }
1846 enum CodecFailureCode {
1847 CODEC_FAILURE_COMPLETE = 0;
1848 }
1849 enum SpeakerFailureCode {
1850 SPEAKER_FAILURE_COMPLETE = 0;
1851 SPEAKER_FAILURE_HIGH_Z = 1;
1852 SPEAKER_FAILURE_SHORT = 2;
1853 }
1854 enum FingerprintFailureCode {
1855 FINGERPRINT_FAILURE_COMPLETE = 0;
1856 FINGERPRINT_SENSOR_BROKEN = 1;
1857 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1858 }
1859 optional int32 failure_code = 3;
1860}
1861
1862/**
1863 * Log an event when the device has been physically dropped.
1864 * Reported from the /vendor partition.
1865 */
1866message PhysicalDropDetected {
1867 // Confidence that the event was actually a drop, 0 -> 100
1868 optional int32 confidence_pctg = 1;
1869 // Peak acceleration of the drop, in 1/1000s of a g.
1870 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001871 // Duration of freefall in ms
1872 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001873}
1874
1875/**
1876 * Log bucketed battery charge cycles.
1877 *
1878 * Each bucket represents cycles of the battery past
1879 * a given charge point. For example, bucket 1 is the
1880 * lowest 1/8th of the battery, and bucket 8 is 100%.
1881 *
1882 * Logged from:
1883 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1884 */
1885message ChargeCyclesReported {
1886 optional int32 cycle_bucket_1 = 1;
1887 optional int32 cycle_bucket_2 = 2;
1888 optional int32 cycle_bucket_3 = 3;
1889 optional int32 cycle_bucket_4 = 4;
1890 optional int32 cycle_bucket_5 = 5;
1891 optional int32 cycle_bucket_6 = 6;
1892 optional int32 cycle_bucket_7 = 7;
1893 optional int32 cycle_bucket_8 = 8;
1894}
1895
1896/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001897 * Logs the duration of a davey (jank of >=700ms) when it occurs
1898 *
1899 * Logged from:
1900 * frameworks/base/libs/hwui/JankTracker.cpp
1901 */
1902message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001903 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001904 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001905
Tej Singhbb8554a2018-01-26 11:59:14 -08001906 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001907 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001908}
1909
1910/**
Bookatze5885242017-10-24 20:10:31 -07001911 * Logs phone signal strength changes.
1912 *
1913 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001914 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001915 */
1916message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001917 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1918 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001919}
1920
Yangster4ccebea2018-10-09 17:09:02 -07001921
1922/**
1923 * Logs when the phone state, sim state or signal strength changes
1924 *
1925 * Logged from:
1926 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1927 */
1928message PhoneServiceStateChanged {
1929 optional android.telephony.ServiceStateEnum state = 1;
1930 optional android.telephony.SimStateEnum sim_state = 2;
1931 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1932}
1933
1934/**
1935 * Logs when the phone becomes on or off.
1936 *
1937 * Logged from:
1938 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1939 */
1940message PhoneStateChanged {
1941 enum State {
1942 OFF = 0;
1943 ON = 1;
1944 }
1945 optional State state = 1;
1946}
1947
Hyunyoung Songcc651c12018-10-17 13:35:32 -07001948message LauncherUIChanged {
Yao Chen046b5122018-10-24 14:09:20 -07001949 optional android.stats.launcher.LauncherAction action = 1;
1950 optional android.stats.launcher.LauncherState src_state = 2;
1951 optional android.stats.launcher.LauncherState dst_state = 3;
1952 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songcc651c12018-10-17 13:35:32 -07001953 optional bool is_swipe_up_enabled = 5;
1954}
1955
David Chenc28b2bb2017-10-24 12:52:52 -07001956/**
1957 * Logs that a setting was updated.
1958 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001959 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001960 * The tag and is_default allow resetting of settings to default values based on the specified
1961 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1962 */
1963message SettingChanged {
1964 // The name of the setting.
1965 optional string setting = 1;
1966
1967 // The change being imposed on this setting. May represent a number, eg "3".
1968 optional string value = 2;
1969
1970 // The new value of this setting. For most settings, this is same as value. For some settings,
1971 // value is +X or -X where X represents an element in a set. For example, if the previous value
1972 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1973 // The +/- feature is currently only used for location_providers_allowed.
1974 optional string new_value = 3;
1975
1976 // The previous value of this setting.
1977 optional string prev_value = 4;
1978
1979 // The tag used with the is_default for resetting sets of settings. This is generally null.
1980 optional string tag = 5;
1981
Bookatz90867622018-01-31 15:05:57 -08001982 // True if this setting with tag should be resettable.
1983 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001984
David Chenbd789912018-03-16 17:19:55 -07001985 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001986 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001987
1988 enum ChangeReason {
1989 UPDATED = 1; // Updated can be an insertion or an update.
1990 DELETED = 2;
1991 }
1992 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001993}
Chenjie Yub3dda412017-10-24 13:41:59 -07001994
Chenjie Yu05013b32017-11-21 10:21:41 -08001995/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001996 * Logs activity going to foreground or background
1997 *
1998 * Logged from:
1999 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2000 */
2001message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002002 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002003 optional string pkg_name = 2;
2004 optional string class_name = 3;
2005
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002006 enum State {
2007 BACKGROUND = 0;
2008 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002009 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002010 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002011}
David Chenc8a43242017-10-17 16:23:28 -07002012
2013/**
Felix Lopez Luis7ca1abd2018-12-12 10:32:32 +00002014 * Logs when a volume entered low Storage state.
2015 * Logged from:
2016 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2017 */
2018message LowStorageStateChanged {
2019 // Volume that ran out of storage.
2020 optional string volume_description = 1;
2021
2022 enum State {
2023 UNKNOWN = 0;
2024 OFF = 1;
2025 ON = 2;
2026 }
2027 optional State state = 2;
2028}
2029
2030/**
2031 * Logs when an app is downgraded.
2032 * Logged from:
2033 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2034 */
2035message AppDowngraded {
2036 optional string package_name = 1;
2037 // Size of the package (all data) before being downgraded.
2038 optional int64 size_in_bytes_before = 2;
2039 // Size of the package (all data) after being downgraded.
2040 optional int64 size_in_bytes_after = 3;
2041
2042 optional bool aggressive = 4;
2043}
2044
2045/**
2046 * Logs when an app is optimized after being downgraded.
2047 * Logged from:
2048 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2049 */
2050message AppOptimizedAfterDowngraded {
2051 optional string package_name = 1;
2052}
2053
2054/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002055 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002056 * Logged from:
2057 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2058 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002059message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002060 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002061
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002062 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002063
2064 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002065 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002066 optional string process_name = 3;
2067
2068 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002069 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002070
2071 optional string package_name = 5;
2072
2073 enum InstantApp {
2074 UNAVAILABLE = 0;
2075 FALSE = 1;
2076 TRUE = 2;
2077 }
2078 optional InstantApp is_instant_app = 6;
2079
2080 enum ForegroundState {
2081 UNKNOWN = 0;
2082 BACKGROUND = 1;
2083 FOREGROUND = 2;
2084 }
2085 optional ForegroundState foreground_state = 7;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002086}
David Chen9e3808c2017-11-20 17:25:34 -08002087
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002088/**
2089 * Logs when a WTF (What a Terrible Failure) happened.
2090 * Logged from:
2091 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2092 */
2093message WTFOccurred {
2094 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002095
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002096 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002097
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002098 // The name of the process.
2099 // system_server if it is not by an app
2100 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002101
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002102 // The pid if available. -1 means not available.
2103 optional sint32 pid = 4;
2104}
2105
2106/**
2107 * Logs when system server reports low memory.
2108 * Logged from:
2109 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2110 */
2111message LowMemReported {
2112}
2113
2114/**
2115 * Logs when an app ANR (App Not Responding) occurs.
2116 * Logged from:
2117 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2118 */
2119message ANROccurred {
2120 optional int32 uid = 1 [(is_uid) = true];
2121
2122 optional string process_name = 2;
2123
2124 optional string short_component_name = 3;
2125
2126 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002127
2128 enum InstantApp {
2129 UNAVAILABLE = 0;
2130 FALSE = 1;
2131 TRUE = 2;
2132 }
2133 optional InstantApp is_instant_app = 5;
2134
2135 enum ForegroundState {
2136 UNKNOWN = 0;
2137 BACKGROUND = 1;
2138 FOREGROUND = 2;
2139 }
2140 optional ForegroundState foreground_state = 6;
David Chen9e3808c2017-11-20 17:25:34 -08002141}
2142
David Chen0a368b22017-12-06 16:28:16 -08002143/*
2144 * Allows other apps to push events into statsd.
2145 * Logged from:
2146 * frameworks/base/core/java/android/util/StatsLog.java
2147 */
David Chen0b5c90c2018-01-25 16:51:49 -08002148message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002149 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002150 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002151
2152 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2153 optional int32 label = 2;
2154
2155 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2156 // predicates for the metrics).
2157 enum State {
2158 UNKNOWN = 0;
2159 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2160 STOP = 2;
2161 START = 3;
2162 }
2163 optional State state = 3;
2164}
2165
David Chen9e3808c2017-11-20 17:25:34 -08002166/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002167 * Logs when statsd detects an anomaly.
2168 *
2169 * Logged from:
2170 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2171 */
2172message AnomalyDetected {
2173 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002174 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002175
Yangster-mac94e197c2018-01-02 16:03:03 -08002176 // Id of the config whose anomaly detection alert fired.
2177 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002178
Yangster-mac94e197c2018-01-02 16:03:03 -08002179 // Id of the alert (i.e. name of the anomaly that was detected).
2180 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002181}
2182
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002183message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002184 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002185 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002186
2187 // The app package name.
2188 optional string pkg_name = 2;
2189
2190 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002191 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002192 WARM = 1;
2193 HOT = 2;
2194 COLD = 3;
2195 }
2196 // The transition type.
2197 optional TransitionType type = 3;
2198
2199 // The activity name.
2200 optional string activity_name = 4;
2201
2202 // The name of the calling app. Empty if not set.
2203 optional string calling_pkg_name = 5;
2204
2205 // Whether the app is an instant app.
2206 optional bool is_instant_app = 6;
2207
2208 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002209 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002210
Bookatz80d11a02018-01-16 10:46:35 -08002211 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002212
David Chen0b5c90c2018-01-25 16:51:49 -08002213 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002214 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002215 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002216 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002217 optional int32 bind_application_delay_millis = 11;
2218 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002219
2220 // Empty if not set.
2221 optional string launch_token = 13;
2222
Calin Juravle759fbda2018-02-20 19:52:30 +00002223 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002224 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002225
2226 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002227 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002228}
2229
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002230message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002231 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002232 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002233
2234 // The app package name.
2235 optional string pkg_name = 2;
2236
2237 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002238 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002239 WARM = 1;
2240 HOT = 2;
2241 COLD = 3;
2242 }
2243 // The transition type.
2244 optional TransitionType type = 3;
2245
2246 // The activity name.
2247 optional string activity_name = 4;
2248}
2249
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002250message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002251 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002252 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002253
2254 // The app package name.
2255 optional string pkg_name = 2;
2256
2257 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002258 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002259 WITH_BUNDLE = 1;
2260 WITHOUT_BUNDLE = 2;
2261 }
2262 // The transition type.
2263 optional TransitionType type = 3;
2264
2265 // The activity name.
2266 optional string activity_name = 4;
2267
2268 optional bool transition_process_running = 5;
2269
2270 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002271 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002272}
2273
Bookatz8fcd09a2017-12-18 13:01:10 -08002274/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002275 * Logs a picture-in-picture action
2276 * Logged from:
2277 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2278 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2279 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2280 */
2281message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002282 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002283 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002284
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002285 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002286
Chenjie Yu52cacc62017-12-08 18:11:45 -08002287 enum State {
2288 ENTERED = 1;
2289 EXPANDED_TO_FULL_SCREEN = 2;
2290 MINIMIZED = 3;
2291 DISMISSED = 4;
2292 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002293 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002294}
2295
2296/**
Chenjie Yue8904192017-12-08 19:12:57 -08002297 * Logs overlay action
2298 * Logged from:
2299 * services/core/java/com/android/server/wm/Session.java
2300 */
2301message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002302 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002303
2304 optional string package_name = 2;
2305
2306 optional bool using_alert_window = 3;
2307
2308 enum State {
2309 ENTERED = 1;
2310 EXITED = 2;
2311 }
2312 optional State state = 4;
2313}
2314
Chenjie Yuccfe6452018-01-30 11:33:21 -08002315/*
2316 * Logs foreground service starts and stops.
2317 * Note that this is not when a service starts or stops, but when it is
2318 * considered foreground.
2319 * Logged from
2320 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2321 */
2322message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002323 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002324 // package_name + "/" + class_name
2325 optional string short_name = 2;
2326
2327 enum State {
2328 ENTER = 1;
2329 EXIT = 2;
2330 }
2331 optional State state = 3;
2332}
2333
Chenjie Yue8904192017-12-08 19:12:57 -08002334/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002335 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2336 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2337 * attributed back to the parent (host) uid. One example is Chrome.
2338 *
2339 * Logged from:
2340 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2341 */
2342message IsolatedUidChanged {
2343 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002344 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002345 optional int32 parent_uid = 1;
2346
2347 optional int32 isolated_uid = 2;
2348
2349 // We expect an isolated uid to be removed before if it's used for another parent uid.
2350 enum Event {
2351 REMOVED = 0;
2352 CREATED = 1;
2353 }
2354 optional Event event = 3;
2355}
2356
2357/*
2358 * Logs the reception of an incoming network packet causing the main system to wake up for
2359 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2360 * and processed by WakeupController.cpp.
2361 */
2362message PacketWakeupOccurred {
2363 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2364 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002365 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002366 // The interface name on which the packet was received.
2367 optional string iface = 2;
2368 // The ethertype value of the packet.
2369 optional int32 ethertype = 3;
2370 // String representation of the destination MAC address of the packet.
2371 optional string destination_hardware_address = 4;
2372 // String representation of the source address of the packet if this was an IP packet.
2373 optional string source_ip = 5;
2374 // String representation of the destination address of the packet if this was an IP packet.
2375 optional string destination_ip = 6;
2376 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2377 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2378 // families.
2379 optional int32 ip_next_header = 7;
2380 // The source port if this was a TCP or UDP packet.
2381 optional int32 source_port = 8;
2382 // The destination port if this was a TCP or UDP packet.
2383 optional int32 destination_port = 9;
2384}
2385
2386/*
2387 * Logs the memory stats for an app on startup.
2388 * Logged from:
2389 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2390 */
2391message AppStartMemoryStateCaptured {
2392 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002393 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002394
2395 // The process name.
2396 optional string process_name = 2;
2397
2398 // The activity name.
2399 optional string activity_name = 3;
2400
2401 // # of page-faults
2402 optional int64 pgfault = 4;
2403
2404 // # of major page-faults
2405 optional int64 pgmajfault = 5;
2406
2407 // RSS
2408 optional int64 rss_in_bytes = 6;
2409
2410 // CACHE
2411 optional int64 cache_in_bytes = 7;
2412
2413 // SWAP
2414 optional int64 swap_in_bytes = 8;
2415}
2416
2417/*
2418 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2419 * for LMK event.
2420 * Logged from:
2421 * system/core/lmkd/lmkd.c
2422 */
2423message LmkStateChanged {
2424 enum State {
2425 UNKNOWN = 0;
2426 START = 1;
2427 STOP = 2;
2428 }
2429 optional State state = 1;
2430}
2431
2432/*
2433 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2434 * Logged from:
2435 * system/core/lmkd/lmkd.c
2436 */
2437message LmkKillOccurred {
2438 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002439 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002440
2441 // The process name.
2442 optional string process_name = 2;
2443
2444 // oom adj score.
2445 optional int32 oom_score = 3;
2446
2447 // # of page-faults
2448 optional int64 pgfault = 4;
2449
2450 // # of major page-faults
2451 optional int64 pgmajfault = 5;
2452
2453 // RSS
2454 optional int64 rss_in_bytes = 6;
2455
2456 // CACHE
2457 optional int64 cache_in_bytes = 7;
2458
2459 // SWAP
2460 optional int64 swap_in_bytes = 8;
Jim Blackler972a5c52018-11-21 15:24:48 +00002461
2462 // The elapsed real time of start of the process.
2463 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08002464
2465 // Min oom adj score considered by lmkd.
2466 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002467}
2468
Rajeev Kumar51b54602018-03-01 12:18:26 -08002469/*
2470 * Logs when the ActivityManagerService detects that an app died.
2471 *
2472 * Logged from:
2473 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2474 */
2475message AppDied {
2476 // timestamp(elapsedRealtime) of record creation
Yao Chenc40a19d2018-03-15 16:48:25 -07002477 optional uint64 timestamp_millis = 1 [(stateFieldOption).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002478}
2479
Chenjie Yubbcbc602018-02-05 16:51:52 -08002480//////////////////////////////////////////////////////////////////////
2481// Pulled atoms below this line //
2482//////////////////////////////////////////////////////////////////////
2483
2484/**
David Chenc8a43242017-10-17 16:23:28 -07002485 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
2486 *
2487 * Pulled from:
2488 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2489 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002490message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002491 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002492
2493 optional int64 rx_bytes = 2;
2494
2495 optional int64 rx_packets = 3;
2496
2497 optional int64 tx_bytes = 4;
2498
2499 optional int64 tx_packets = 5;
2500}
2501
2502/**
2503 * Pulls bytes transferred via wifi (separated by foreground and background usage).
2504 *
2505 * Pulled from:
2506 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2507 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002508message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002509 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002510
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002511 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2512 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002513
2514 optional int64 rx_bytes = 3;
2515
2516 optional int64 rx_packets = 4;
2517
2518 optional int64 tx_bytes = 5;
2519
2520 optional int64 tx_packets = 6;
2521}
2522
2523/**
2524 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2525 *
2526 * Pulled from:
2527 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2528 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002529message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002530 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002531
2532 optional int64 rx_bytes = 2;
2533
2534 optional int64 rx_packets = 3;
2535
2536 optional int64 tx_bytes = 4;
2537
2538 optional int64 tx_packets = 5;
2539}
2540
2541/**
2542 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
2543 *
2544 * Pulled from:
2545 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2546 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002547message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002548 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002549
Yao Chenc40a19d2018-03-15 16:48:25 -07002550 // 1 denotes foreground and 0 denotes background. This is called Set in
2551 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002552 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002553
2554 optional int64 rx_bytes = 3;
2555
2556 optional int64 rx_packets = 4;
2557
2558 optional int64 tx_bytes = 5;
2559
2560 optional int64 tx_packets = 6;
2561}
2562
2563/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002564 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2565 *
2566 * Pulled from:
2567 * StatsCompanionService
2568 */
2569message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002570 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002571
2572 optional int64 rx_bytes = 2;
2573
2574 optional int64 tx_bytes = 3;
2575}
2576
2577/**
David Chenc8a43242017-10-17 16:23:28 -07002578 * Pulls the kernel wakelock durations. This atom is adapted from
2579 * android/internal/os/KernelWakelockStats.java
2580 *
2581 * Pulled from:
2582 * StatsCompanionService using KernelWakelockReader.
2583 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002584message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002585 optional string name = 1;
2586
2587 optional int32 count = 2;
2588
2589 optional int32 version = 3;
2590
2591 optional int64 time = 4;
2592}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002593
Chenjie Yu05013b32017-11-21 10:21:41 -08002594/**
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002595 * Pulls low power state information. This includes platform and subsystem sleep state information,
2596 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002597 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002598 * hardware/interfaces/power/1.1/types.hal
2599 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002600message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002601 // Subsystem name
2602 optional string subsystem_name = 1;
2603 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2604 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
2605 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002606 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002607 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002608 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002609 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002610}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002611
Chenjie Yu05013b32017-11-21 10:21:41 -08002612/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002613 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002614 * Pulls the time the cpu spend on the frequency index. Frequency index
2615 * starts from highest to lowest. The value should be monotonically
2616 * increasing since boot. However, if there is a cpu
2617 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002618 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002619message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002620 optional uint32 cluster = 1;
2621 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002622 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002623}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002624
Chenjie Yu05013b32017-11-21 10:21:41 -08002625/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002626 * Pulls Cpu Time Per Uid.
2627 * Note that isolated process uid time should be attributed to host uids.
2628 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002629message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002630 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00002631 optional uint64 user_time_micros = 2;
2632 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002633}
2634
2635/**
2636 * Pulls Cpu Time Per Uid per frequency.
2637 * Note that isolated process uid time should be attributed to host uids.
2638 * For each uid, we order the time by descending frequencies.
2639 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002640message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002641 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002642 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002643 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002644}
Hugo Benichi884970e2017-11-14 22:42:46 +09002645
Chenjie Yu05013b32017-11-21 10:21:41 -08002646/**
2647 * Pulls Wifi Controller Activity Energy Info
2648 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002649message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002650 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002651 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002652 // stack reported state
2653 // TODO: replace this with proto enum
2654 optional int32 stack_state = 2;
2655 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002656 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002657 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002658 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002659 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002660 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002661 // product of current(mA), voltage(V) and time(ms)
2662 optional uint64 controller_energy_used = 6;
2663}
2664
2665/**
2666 * Pulls Modem Activity Energy Info
2667 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002668message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002669 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002670 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002671 // sleep time in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08002672 optional uint64 sleep_time_millis = 2;
Chenjie Yu05013b32017-11-21 10:21:41 -08002673 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002674 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002675 /**
2676 * Tx power index
2677 * index 0 = tx_power < 0dBm
2678 * index 1 = 0dBm < tx_power < 5dBm
2679 * index 2 = 5dBm < tx_power < 15dBm
2680 * index 3 = 15dBm < tx_power < 20dBm
2681 * index 4 = tx_power > 20dBm
2682 */
2683 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002684 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002685 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002686 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002687 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002688 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002689 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002690 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002691 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002692 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002693 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002694 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002695 // product of current(mA), voltage(V) and time(ms)
2696 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002697}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002698
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002699/**
2700 * Pulls Bluetooth Activity Energy Info
2701 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2702 */
2703message BluetoothActivityInfo {
2704 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002705 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002706 // bluetooth stack state
2707 optional int32 bluetooth_stack_state = 2;
2708 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002709 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002710 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002711 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002712 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002713 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002714 // product of current(mA), voltage(V) and time(ms)
2715 optional uint64 energy_used = 6;
2716}
2717
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002718/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002719 * Logs the memory stats for a process.
2720 */
2721message ProcessMemoryState {
2722 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002723 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002724
2725 // The process name.
2726 optional string process_name = 2;
2727
2728 // oom adj score.
2729 optional int32 oom_score = 3;
2730
2731 // # of page-faults
2732 optional int64 pgfault = 4;
2733
2734 // # of major page-faults
2735 optional int64 pgmajfault = 5;
2736
Rajeev Kumar90235992018-01-29 11:06:48 -08002737 // RSS
2738 optional int64 rss_in_bytes = 6;
2739
2740 // CACHE
2741 optional int64 cache_in_bytes = 7;
2742
2743 // SWAP
2744 optional int64 swap_in_bytes = 8;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002745}
2746
2747/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002748 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002749 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002750message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002751 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002752}
2753
2754/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002755 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002756 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002757message SystemUptime {
2758 // Milliseconds since the system was booted.
2759 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
2760 // for external input).
2761 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08002762 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002763}
2764
2765/*
2766 * Reads from /proc/uid_concurrent_active_time which has the format:
2767 * active: X (X is # cores)
2768 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
2769 * [uid1]: [time-0] [time-1] [time-2] ... ...
2770 * ...
2771 * Time-N means the CPU time a UID spent running concurrently with N other processes.
2772 * The file contains a monotonically increasing count of time for a single boot.
2773 */
2774message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002775 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002776 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002777}
2778
2779/**
2780 * Reads from /proc/uid_concurrent_policy_time which has the format:
2781 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
2782 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2783 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2784 * ...
2785 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
2786 * The file contains a monotonically increasing count of time for a single boot.
2787 */
2788message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002789 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002790 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002791 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08002792}
2793
2794/*
2795 * Pulls free disk space, for data, system partition and temporary directory.
2796 */
2797message DiskSpace {
2798 // available bytes in data partition
2799 optional uint64 data_available_bytes = 1;
2800 // available bytes in system partition
2801 optional uint64 system_available_bytes = 2;
2802 // available bytes in download cache or temp directories
2803 optional uint64 temp_available_bytes = 3;
2804}
Tej Singhbf972d92018-01-10 20:51:13 -08002805
2806/**
2807 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002808 * Pulled from:
2809 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002810 */
2811message RemainingBatteryCapacity {
2812 optional int32 charge_uAh = 1;
2813}
2814
2815/**
2816 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002817 * Pulled from:
2818 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002819 */
2820message FullBatteryCapacity {
2821 optional int32 capacity_uAh = 1;
Tej Singh40298312018-02-16 00:15:09 -08002822}
2823
2824/**
Tej Singhd89137e2018-03-26 14:51:40 -07002825 * Pulls the temperature of various parts of the device.
2826 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08002827 *
2828 * Pulled from:
2829 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
2830 */
2831message Temperature {
2832 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY.
2833 optional android.os.TemperatureTypeEnum sensor_location = 1;
2834
2835 // The name of the temperature source. Eg. CPU0
2836 optional string sensor_name = 2;
2837
Tej Singhd89137e2018-03-26 14:51:40 -07002838 // Temperature in tenths of a degree C.
2839 optional int32 temperature_dC = 3;
yroa1fe77c2018-02-26 14:22:54 -08002840}
lifr35a7cf02018-12-12 16:38:04 +08002841
2842/**
lifrd1300022019-05-03 12:02:54 +08002843 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
2844 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
2845 *
2846 * The NetworkDnsEventReported message represents the entire lookup operation, which may
2847 * result one or more queries to the recursive DNS resolvers. Those are individually logged
2848 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
2849 * broken up by query type, transport, network interface, etc.
lifr35a7cf02018-12-12 16:38:04 +08002850 */
2851message NetworkDnsEventReported {
lifrd1300022019-05-03 12:02:54 +08002852 optional android.stats.dnsresolver.EventType event_type = 1;
lifr35a7cf02018-12-12 16:38:04 +08002853
lifrd1300022019-05-03 12:02:54 +08002854 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifr35a7cf02018-12-12 16:38:04 +08002855
lifrd1300022019-05-03 12:02:54 +08002856 // The latency in microseconds of the entire DNS lookup operation.
lifr35a7cf02018-12-12 16:38:04 +08002857 optional int32 latency_micros = 3;
lifrd1300022019-05-03 12:02:54 +08002858
2859 // Only valid for event_type = EVENT_GETADDRINFO.
2860 optional int32 hints_ai_flags = 4;
2861
2862 // Flags passed to android_res_nsend() defined in multinetwork.h
2863 // Only valid for event_type = EVENT_RESNSEND.
2864 optional int32 res_nsend_flags = 5;
2865
lifrad9becc2019-05-20 11:04:41 +08002866 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrd1300022019-05-03 12:02:54 +08002867
2868 // The DNS over TLS mode on a specific netId.
2869 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
2870
2871 // Additional pass-through fields opaque to statsd.
2872 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
2873 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr35a7cf02018-12-12 16:38:04 +08002874}
2875
Chiachang Wang67f24472019-01-15 15:14:00 +08002876/**
2877 * Logs when a data stall event occurs.
2878 *
2879 * Log from:
2880 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
2881 */
2882message DataStallEvent {
2883 // Data stall evaluation type.
2884 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
2885 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
2886 optional int32 evaluation_type = 1;
2887 // See definition in data_stall_event.proto.
2888 optional com.android.server.connectivity.ProbeResult validation_result = 2;
2889 // See definition in data_stall_event.proto.
2890 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
2891 // See definition in data_stall_event.proto.
2892 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
2893 // See definition in data_stall_event.proto.
2894 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
2895 // See definition in data_stall_event.proto.
2896 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
2897}
Jack Yu6d421bc2019-01-23 17:42:54 +08002898
2899/**
2900 * Logs when a NFC device's error occurred.
2901 * Logged from:
2902 * system/nfc/src/nfc/nfc/nfc_ncif.cc
2903 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
2904 */
2905message NfcErrorOccurred {
2906 enum Type {
2907 UNKNOWN = 0;
2908 CMD_TIMEOUT = 1;
2909 ERROR_NOTIFICATION = 2;
2910 AID_OVERFLOW = 3;
2911 }
2912 optional Type type = 1;
2913 // If it's nci cmd timeout, log the timeout command.
2914 optional uint32 nci_cmd = 2;
2915
2916 optional uint32 error_ntf_status_code = 3;
2917}
2918
2919/**
2920 * Logs when a NFC device's state changed event
2921 * Logged from:
2922 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
2923 */
2924message NfcStateChanged {
2925 enum State {
2926 UNKNOWN = 0;
2927 OFF = 1;
2928 ON = 2;
2929 ON_LOCKED = 3; // Secure Nfc enabled.
2930 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
2931 }
2932 optional State state = 1;
2933}
2934
2935/**
2936 * Logs when a NFC Beam Transaction occurred.
2937 * Logged from:
2938 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
2939 */
2940message NfcBeamOccurred {
2941 enum Operation {
2942 UNKNOWN = 0;
2943 SEND = 1;
2944 RECEIVE = 2;
2945 }
2946 optional Operation operation = 1;
2947}
2948
2949/**
2950 * Logs when a NFC Card Emulation Transaction occurred.
2951 * Logged from:
2952 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
2953 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
2954 */
2955message NfcCardemulationOccurred {
2956 enum Category {
2957 UNKNOWN = 0;
2958 HCE_PAYMENT = 1;
2959 HCE_OTHER = 2;
2960 OFFHOST = 3;
2961 }
2962 // Transaction belongs to HCE payment or HCE other category, or offhost.
2963 optional Category category = 1;
2964 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
2965 optional string se_name = 2;
2966}
2967
2968/**
2969 * Logs when a NFC Tag event occurred.
2970 * Logged from:
2971 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
2972 */
2973message NfcTagOccurred {
2974 enum Type {
2975 UNKNOWN = 0;
2976 URL = 1;
2977 BT_PAIRING = 2;
2978 PROVISION = 3;
2979 WIFI_CONNECT = 4;
2980 APP_LAUNCH = 5;
2981 OTHERS = 6;
2982 }
2983 optional Type type = 1;
2984}
2985
2986/**
2987 * Logs when Hce transaction triggered
2988 * Logged from:
2989 * system/nfc/src/nfc/nfc/nfc_ncif.cc
2990 */
2991message NfcHceTransactionOccurred {
2992 // The latency period(in microseconds) it took for the first HCE data
2993 // exchange.
2994 optional uint32 latency_micros = 1;
2995}
2996
2997/**
2998 * Logs when SecureElement state event changed
2999 * Logged from:
3000 * packages/apps/SecureElement/src/com/android/se/Terminal.java
3001 */
3002message SeStateChanged {
3003 enum State {
3004 UNKNOWN = 0;
3005 INITIALIZED = 1;
3006 DISCONNECTED = 2;
3007 CONNECTED = 3;
3008 HALCRASH = 4;
3009 }
3010 optional State state = 1;
3011
3012 optional string state_change_reason = 2;
3013 // SIMx or eSEx.
3014 optional string terminal = 3;
3015}
3016
3017/**
3018 * Logs when Omapi API used
3019 * Logged from:
3020 * packages/apps/SecureElement/src/com/android/se/Terminal.java
3021 */
3022message SeOmapiReported {
3023 enum Operation {
3024 UNKNOWN = 0;
3025 OPEN_CHANNEL = 1;
3026 }
3027 optional Operation operation = 1;
3028 // SIMx or eSEx.
3029 optional string terminal = 2;
3030
3031 optional string package_name = 3;
3032}
Hui Yuf57e4012019-02-13 12:29:38 -08003033
3034/*
3035* Logs number of milliseconds it takes to start a process.
3036* The definition of app process start time is from the app launch time to
3037* the time that Zygote finished forking the app process and loaded the
3038* application package's java classes.
3039
3040* This metric is different from AppStartOccurred which is for foreground
3041* activity only.
3042
3043* ProcessStartTime can report all processes (both foreground and background)
3044* start time.
3045*
3046* Logged from:
3047* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3048*/
3049message ProcessStartTime {
3050 // The uid of the ProcessRecord.
3051 optional int32 uid = 1 [(is_uid) = true];
3052
3053 // The process pid.
3054 optional int32 pid = 2;
3055
3056 // The process name.
3057 // Usually package name, "system" for system server.
3058 // Provided by ActivityManagerService.
3059 optional string process_name = 3;
3060
3061 enum StartType {
3062 UNKNOWN = 0;
3063 WARM = 1;
3064 HOT = 2;
3065 COLD = 3;
3066 }
3067
3068 // The start type.
3069 optional StartType type = 4;
3070
3071 // The elapsed realtime at the start of the process.
3072 optional int64 process_start_time_millis = 5;
3073
3074 // Number of milliseconds it takes to reach bind application.
3075 optional int32 bind_application_delay_millis = 6;
3076
3077 // Number of milliseconds it takes to finish start of the process.
3078 optional int32 process_start_delay_millis = 7;
3079
3080 // hostingType field in ProcessRecord, the component type such as "activity",
3081 // "service", "content provider", "broadcast" or other strings.
3082 optional string hosting_type = 8;
3083
3084 // hostingNameStr field in ProcessRecord. The component class name that runs
3085 // in this process.
3086 optional string hosting_name = 9;
3087}
3088
Chiachang Wang4d6fe322019-03-21 20:40:01 +08003089/**
3090 * Push network stack events.
3091 *
3092 * Log from:
3093 * frameworks/base/packages/NetworkStack/
3094 */
3095message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08003096 // The id that indicates the event reported from NetworkStack.
3097 optional int32 event_id = 1;
3098 // The data for the reported events.
Chiachang Wang4d6fe322019-03-21 20:40:01 +08003099 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
3100}
3101
Michael Groover94672ce2019-06-27 15:17:48 -07003102/**
3103 * Logs when a package is denied access to a device identifier based on the new access requirements.
3104 *
3105 * Logged from:
3106 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
3107 */
3108message DeviceIdentifierAccessDenied {
3109 // The name of the package denied access to the requested device identifier.
3110 optional string package_name = 1;
3111
3112 // The name of the device identifier method the package attempted to invoke.
3113 optional string method_name = 2;
3114
3115 // True if the package is preinstalled.
3116 optional bool is_preinstalled = 3;
3117
3118 // True if the package is privileged.
3119 optional bool is_priv_app = 4;
3120}