blob: a79fe775e07bd02187d51809190d24b55d06166d [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;
Chiachang Wange987ba62019-04-11 21:24:28 +0800172 NetworkStackReported network_stack_reported = 182 [(log_from_module) = "network_stack"];
Yao Chend54f9dd2017-10-17 17:37:48 +0000173 }
David Chenc8a43242017-10-17 16:23:28 -0700174
David Chen6e3e6cb2018-01-03 16:14:06 -0800175 // Pulled events will start at field 10000.
Tej Singh40298312018-02-16 00:15:09 -0800176 // Next: 10022
David Chenc8a43242017-10-17 16:23:28 -0700177 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800178 WifiBytesTransfer wifi_bytes_transfer = 10000;
179 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
180 MobileBytesTransfer mobile_bytes_transfer = 10002;
181 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800182 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800183 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800184 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800185 CpuTimePerFreq cpu_time_per_freq = 10008;
186 CpuTimePerUid cpu_time_per_uid = 10009;
187 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800188 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800189 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800190 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800191 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800192 SystemElapsedRealtime system_elapsed_realtime = 10014;
193 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800194 CpuActiveTime cpu_active_time = 10016;
195 CpuClusterTime cpu_cluster_time = 10017;
Chenjie Yu937d7422018-01-10 16:37:53 -0800196 DiskSpace disk_space = 10018;
Tej Singhbf972d92018-01-10 20:51:13 -0800197 RemainingBatteryCapacity remaining_battery_capacity = 10019;
198 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800199 Temperature temperature = 10021;
David Chenc8a43242017-10-17 16:23:28 -0700200 }
yroa1fe77c2018-02-26 14:22:54 -0800201
Bookatz76aafcf2018-09-17 16:17:10 -0700202 // DO NOT USE field numbers above 100,000 in AOSP.
203 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
204 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700205}
206
Yao Chend54f9dd2017-10-17 17:37:48 +0000207/**
Yangster-mac20877162017-12-22 17:19:39 -0800208 * This proto represents a node of an attribution chain.
209 * Note: All attribution chains are represented as a repeated field of type
210 * AttributionNode. It is understood that in such arrays, the order is that
211 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000212 */
Yangster-mac20877162017-12-22 17:19:39 -0800213message AttributionNode {
214 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800215 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800216
Yangster-mac20877162017-12-22 17:19:39 -0800217 // The (optional) string tag for an element in the attribution chain. If the
218 // element has no tag, it is encoded as an empty string.
219 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700220}
221
Yao Chend54f9dd2017-10-17 17:37:48 +0000222/*
223 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800224 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000225 *
226 * RULES:
227 * - The field ids for each atom must start at 1, and count upwards by 1.
228 * Skipping field ids is not allowed.
229 * - These form an API, so renaming, renumbering or removing fields is
230 * not allowed between android releases. (This is not currently enforced,
231 * but there will be a tool to enforce this restriction).
232 * - The types must be built-in protocol buffer types, namely, no sub-messages
233 * are allowed (yet). The bytes type is also not allowed.
234 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800235 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000236 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800237 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000238 * - A field that is a uid should be a string field, tagged with the [xxx]
239 * annotation. The generated code on android will be represented by UIDs,
240 * and those UIDs will be translated in xxx to those strings.
241 *
242 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700243 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000244 * - If there is a UID, it goes first. Think in an object-oriented fashion.
245 * *****************************************************************************
246 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700247
Yao Chend54f9dd2017-10-17 17:37:48 +0000248/**
Yangster-mac80c44742018-08-26 12:20:16 -0700249 * Logs when the Thermal service HAL notifies the throttling start/stop events.
250 *
251 * Logged from:
252 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
253 */
254message ThermalThrottlingStateChanged {
255 optional android.os.TemperatureTypeEnum sensor_type = 1;
256
257 enum State {
258 UNKNOWN = 0;
259 START = 1;
260 STOP = 2;
261 }
262
263 optional State state = 2;
264
265 optional float temperature = 3;
266}
267
268/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000269 * Logs when the screen state changes.
270 *
271 * Logged from:
272 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
273 */
274message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800275 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800276 optional android.view.DisplayStateEnum state = 1 [(stateFieldOption).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700277}
Yao Chend54f9dd2017-10-17 17:37:48 +0000278
279/**
Bookatzc1a050a2017-10-10 15:49:28 -0700280 * Logs that the state of a process state, as per the activity manager, has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000281 *
282 * Logged from:
283 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
284 */
Bookatzc1a050a2017-10-10 15:49:28 -0700285message UidProcessStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700286 optional int32 uid = 1 [(stateFieldOption).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000287
Bookatzdb026a22018-01-10 19:01:56 -0800288 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yao Chen9c1debe2018-02-19 14:39:19 -0800289 optional android.app.ProcessStateEnum state = 2 [(stateFieldOption).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000290}
291
292/**
Bookatzc1a050a2017-10-10 15:49:28 -0700293 * Logs that a process started, finished, crashed, or ANRed.
294 *
295 * Logged from:
296 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
297 */
298message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700299 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700300
David Chen0b5c90c2018-01-25 16:51:49 -0800301 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800302 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700303
Bookatzddccf0a2017-11-28 16:48:14 -0800304 // What lifecycle state the process changed to.
305 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800306 enum State {
307 FINISHED = 0;
308 STARTED = 1;
309 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800310 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800311 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700312}
313
Bookatzc1a050a2017-10-10 15:49:28 -0700314/**
315 * Logs when the ble scan state changes.
316 *
317 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700318 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700319 */
320message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800321 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700322
323 enum State {
324 OFF = 0;
325 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700326 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
327 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700328 }
329 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700330
Bookatze5ec0b42018-03-26 13:34:56 -0700331 // Does the scan have a filter.
332 optional bool is_filtered = 3;
333 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
334 optional bool is_first_match = 4;
335 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
336 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700337}
338
339/**
340 * Logs reporting of a ble scan finding results.
341 *
342 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700343 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700344 */
Bookatzae6738e2018-09-13 11:38:56 -0700345// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700346message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800347 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700348
349 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800350 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700351}
352
353/**
354 * Logs when a sensor state changes.
355 *
356 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700357 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700358 */
359message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800360 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700361
Bookatzc1a050a2017-10-10 15:49:28 -0700362 // The id (int) of the sensor.
363 optional int32 sensor_id = 2;
364
365 enum State {
366 OFF = 0;
367 ON = 1;
368 }
369 optional State state = 3;
370}
371
372
373/**
374 * Logs when GPS state changes.
375 *
376 * Logged from:
377 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
378 */
379message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800380 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700381
382 enum State {
383 OFF = 0;
384 ON = 1;
385 }
386 optional State state = 2;
387}
388
389
390/**
391 * Logs when a sync manager sync state changes.
392 *
393 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700394 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700395 */
396message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800397 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700398
David Chen0b5c90c2018-01-25 16:51:49 -0800399 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800400 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700401
402 enum State {
403 OFF = 0;
404 ON = 1;
405 }
406 optional State state = 3;
407}
408
409/**
410 * Logs when a job scheduler job state changes.
411 *
412 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700413 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700414 */
415message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800416 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700417
418 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800419 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700420
421 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800422 FINISHED = 0;
423 STARTED = 1;
424 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700425 }
426 optional State state = 3;
427
Tej Singh33a412b2018-03-16 18:43:59 -0700428 // The reason a job has stopped.
429 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700430 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700431 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700432}
433
434/**
435 * Logs when the audio state changes.
436 *
437 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700438 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700439 */
440message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800441 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700442
443 enum State {
444 OFF = 0;
445 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700446 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
447 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700448 }
449 optional State state = 2;
450}
451
452/**
453 * Logs when the video codec state changes.
454 *
455 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700456 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700457 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800458message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800459 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700460
461 enum State {
462 OFF = 0;
463 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700464 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
465 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700466 }
467 optional State state = 2;
468}
469
470/**
471 * Logs when the flashlight state changes.
472 *
473 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700474 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700475 */
476message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800477 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700478
479 enum State {
480 OFF = 0;
481 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700482 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
483 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700484 }
485 optional State state = 2;
486}
487
488/**
489 * Logs when the camera state changes.
490 *
491 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700492 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700493 */
494message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800495 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700496
497 enum State {
498 OFF = 0;
499 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700500 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
501 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700502 }
503 optional State state = 2;
504}
505
506/**
507 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000508 *
509 * Logged from:
510 * TODO
511 */
Bookatzd6746242017-10-24 18:39:35 -0700512message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800513 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000514
Bookatz1a1b0462018-01-12 11:47:03 -0800515 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
516 // From frameworks/base/core/proto/android/os/enums.proto.
517 optional android.os.WakeLockLevelEnum level = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700518
519 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
520 optional string tag = 3;
521
522 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800523 RELEASE = 0;
524 ACQUIRE = 1;
525 CHANGE_RELEASE = 2;
526 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700527 }
528 optional State state = 4;
529}
530
531/**
Bookatzc1a050a2017-10-10 15:49:28 -0700532 * Logs when a partial wakelock is considered 'long' (over 1 min).
533 *
534 * Logged from:
535 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
536 */
537message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800538 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700539
Yao Chend54f9dd2017-10-17 17:37:48 +0000540 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
541 optional string tag = 2;
542
Bookatzc1a050a2017-10-10 15:49:28 -0700543 // TODO: I have no idea what this is.
544 optional string history_tag = 3;
545
546 enum State {
547 OFF = 0;
548 ON = 1;
549 }
550 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000551}
552
Bookatzc1a050a2017-10-10 15:49:28 -0700553/**
554 * Logs Battery Saver state change.
555 *
556 * Logged from:
557 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
558 */
559message BatterySaverModeStateChanged {
560 enum State {
561 OFF = 0;
562 ON = 1;
563 }
564 optional State state = 1;
565}
566
567/**
568 * Logs Doze mode state change.
569 *
570 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800571 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700572 */
573message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800574 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800575}
576
577
578/**
579 * Logs state change of Doze mode including maintenance windows.
580 *
581 * Logged from:
582 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
583 */
584message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800585 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700586}
587
588/**
589 * Logs screen brightness level.
590 *
591 * Logged from:
592 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
593 */
594message ScreenBrightnessChanged {
595 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
596 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700597}
598
599/**
600 * Logs battery level (percent full, from 0 to 100).
601 *
602 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700603 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700604 */
605message BatteryLevelChanged {
606 // Battery level. Should be in [0, 100].
607 optional int32 battery_level = 1;
608}
609
610/**
611 * Logs change in charging status of the device.
612 *
613 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700614 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700615 */
616message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800617 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
618 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700619}
620
621/**
622 * Logs whether the device is plugged in, and what power source it is using.
623 *
624 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700625 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700626 */
627message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800628 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
629 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700630}
631
Bookatz8c6571b2017-10-24 15:04:41 -0700632/**
633 * Logs when an app's wakeup alarm fires.
634 *
635 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700636 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700637 */
638message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800639 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800640
641 // Name of the wakeup alarm.
642 optional string tag = 2;
643}
644
645/**
646 * Logs when an an app causes the mobile radio to change state.
647 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
648 *
649 * Logged from:
650 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
651 */
652message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800653 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800654
Bookatz1a1b0462018-01-12 11:47:03 -0800655 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
656 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800657}
658
659/**
660 * Logs when an an app causes the wifi radio to change state.
661 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
662 *
663 * Logged from:
664 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
665 */
666message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800667 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800668
Bookatz1a1b0462018-01-12 11:47:03 -0800669 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
670 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700671}
672
673/**
674 * Logs kernel wakeup reasons and aborts.
675 *
676 * Logged from:
677 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
678 */
679message KernelWakeupReported {
680 // Name of the kernel wakeup reason (or abort).
681 optional string wakeup_reason_name = 1;
682
683 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800684 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700685}
686
687/**
688 * Logs wifi locks held by an app.
689 *
690 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700691 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700692 */
693message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800694 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700695
696 enum State {
697 OFF = 0;
698 ON = 1;
699 }
700 optional State state = 2;
701}
702
703/**
704 * Logs wifi signal strength changes.
705 *
706 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700707 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700708 */
709message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800710 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
711 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700712}
713
714/**
715 * Logs wifi scans performed by an app.
716 *
717 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700718 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700719 */
720message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800721 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700722
723 enum State {
724 OFF = 0;
725 ON = 1;
726 }
727 optional State state = 2;
728}
729
730/**
Tej Singh4503e102018-01-04 14:35:01 -0800731 * Logs wifi multicast locks held by an app
732 *
733 * Logged from:
734 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
735 */
736message WifiMulticastLockStateChanged {
737 repeated AttributionNode attribution_node = 1;
738
739 enum State {
740 OFF = 0;
741 ON = 1;
742 }
743 optional State state = 2;
744}
745
746/**
Tej Singh1ea42892018-01-19 09:27:00 -0800747 * Logs shutdown reason and duration on next boot.
748 *
749 * Logged from:
750 * frameworks/base/core/java/com/android/server/BootReceiver.java
751 */
752message ShutdownSequenceReported {
753 // True if shutdown is for a reboot. Default: false if we do not know.
754 optional bool reboot = 1;
755
756 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
757 optional string reason = 2;
758
759 // Beginning of shutdown time in ms using wall clock time since unix epoch.
760 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -0800761 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -0800762
763 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -0800764 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -0800765}
766
Tej Singh6483ea42018-01-25 17:45:49 -0800767
768/**
769 * Logs boot reason and duration.
770 *
771 * Logged from:
772 * system/core/bootstat/bootstat.cpp
773 */
774message BootSequenceReported {
775 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
776 // Default: "<EMPTY>" if not available.
777 optional string bootloader_reason = 1;
778
779 // Reason for system boot. Eg. bootloader, reboot,userrequested
780 // Default: "<EMPTY>" if not available.
781 optional string system_reason = 2;
782
783 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -0800784 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -0800785
786 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800787 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -0800788
789 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800790 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -0800791
792 // Time since last boot in ms. Default: 0 if not available.
793 optional int64 time_since_last_boot = 6;
794}
795
Tej Singhc477d9c2018-02-05 18:31:39 -0800796
797/**
798 * Logs call state and disconnect cause (if applicable).
799 *
800 * Logged from:
801 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
802 */
803message CallStateChanged {
804 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
805 // From frameworks/base/core/proto/android/telecomm/enums.proto.
806 optional android.telecom.CallStateEnum call_state = 1;
807
808 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
809 // This value is only applicable when the call_state is DISCONNECTED, and
810 // should always be UNKNOWN if the call_state is not DISCONNECTED.
811 // From frameworks/base/core/proto/android/telecomm/enums.proto.
812 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
813
814 // True if the call is self-managed, which are apps that use the
815 // telecom infrastructure to make their own calls.
816 optional bool self_managed = 3;
817
818 // True if call is external. External calls are calls on connected Wear
819 // devices but show up in Telecom so the user can pull them onto the device.
820 optional bool external_call = 4;
821}
822
Tej Singh1ea42892018-01-19 09:27:00 -0800823/**
Tej Singhdd7bd352018-02-09 19:33:15 -0800824 * Logs keyguard state. The keyguard is the lock screen.
825 *
826 * Logged from:
827 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
828 */
829message KeyguardStateChanged {
830 enum State {
831 UNKNOWN = 0;
832 // The keyguard is hidden when the phone is unlocked.
833 HIDDEN = 1;
834 // The keyguard is shown when the phone is locked (screen turns off).
835 SHOWN= 2;
836 // The keyguard is occluded when something is overlaying the keyguard.
837 // Eg. Opening the camera while on the lock screen.
838 OCCLUDED = 3;
839 }
840 optional State state = 1;
841}
842
843/**
844 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
845 * prompts the user to enter a password (pattern, pin, etc).
846 *
847 * Logged from:
848 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
849 */
850
851message KeyguardBouncerStateChanged {
852 enum State {
853 UNKNOWN = 0;
854 // Bouncer is hidden, either as a result of successfully entering the
855 // password, screen timing out, or user going back to lock screen.
856 HIDDEN = 1;
857 // This is when the user is being prompted to enter the password.
858 SHOWN = 2;
859 }
860 optional State state = 1;
861}
862
863/**
864 * Logs the result of entering a password into the keyguard bouncer.
865 *
866 * Logged from:
867 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
868 */
869message KeyguardBouncerPasswordEntered {
870 enum BouncerResult {
871 UNKNOWN = 0;
872 // The password entered was incorrect.
873 FAILURE = 1;
874 // The password entered was correct.
875 SUCCESS = 2;
876 }
877 optional BouncerResult result = 1;
878}
879
Tej Singha883b372018-02-15 11:30:01 -0800880/*
881 * Logs changes to the configuration of the device. The configuration is defined
882 * in frameworks/base/core/java/android/content/res/Configuration.java
883 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
884 * Please go there to interpret the possible values each field can be.
885 *
886 * Logged from:
887 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
888 */
889message ResourceConfigurationChanged {
890 // Bit mask of color capabilities of the screen.
891 // Contains information about the color gamut and hdr mode of the screen.
892 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
893 optional int32 colorMode = 1;
894
895 // The target screen density being rendered to.
896 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
897 optional int32 densityDpi = 2;
898
899 // Current user preference for the scaling factor for fonts,
900 // relative to the base density scaling.
901 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
902 optional float fontScale = 3;
903
904 // Flag indicating whether the hard keyboard is hidden.
905 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
906 optional int32 hardKeyboardHidden = 4;
907
908 // The type of keyboard attached to the device.
909 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
910 optional int32 keyboard = 5;
911
912 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
913 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
914 optional int32 keyboardHideen = 6;
915
916 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
917 // 0 if undefined.
918 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
919 optional int32 mcc = 7;
920
921 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
922 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
923 // MNC_ZERO symbol defined in Configuration.java.
924 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
925 optional int32 mnc = 8;
926
927 // The kind of navigation available on the device.
928 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
929 optional int32 navigation = 9;
930
931 // Flag indicating whether the navigation is available.
932 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
933 optional int32 navigationHidden = 10;
934
935 // Overall orientation of the screen.
936 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
937 optional int32 orientation = 11;
938
939 // The current height of the available screen space, in dp units.
940 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
941 optional int32 screenHeightDp = 12;
942
943 // Bit mask of overall layout of the screen.
944 // Contains information about screen size, whether the screen is wider/taller
945 // than normal, whether the screen layout is right-tl-left or left-to-right,
946 // and whether the screen has a rounded shape.
947 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
948 optional int32 screenLayout = 13;
949
950 // Current width of the available screen space, in dp units.
951 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
952 optional int32 screenWidthDp = 14;
953
954 // The smallest screen size an application will see in normal operation.
955 // This is the smallest value of both screenWidthDp and screenHeightDp
956 // in portrait and landscape.
957 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
958 optional int32 smallestScreenWidthDp = 15;
959
960 // The type of touch screen attached to the device.
961 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
962 optional int32 touchscreen = 16;
963
964 // Bit mask of the ui mode.
965 // Contains information about the overall ui mode of the device.
966 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
967 // Also contains information about whether the device is in night mode.
968 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
969 optional int32 uiMode = 17;
970}
971
Tej Singheee317b2018-03-07 19:28:05 -0800972
973/**
974 * Logs changes in the connection state of the mobile radio.
975 *
976 * Logged from:
977 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
978 */
979message MobileConnectionStateChanged {
980 // States are from the state machine DataConnection.java.
981 enum State {
982 UNKNOWN = 0;
983 // The connection is inactive, or disconnected.
984 INACTIVE = 1;
985 // The connection is being activated, or connecting.
986 ACTIVATING = 2;
987 // The connection is active, or connected.
988 ACTIVE = 3;
989 // The connection is disconnecting.
990 DISCONNECTING = 4;
991 // The connection is disconnecting after creating a connection.
992 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
993 }
994 optional State state = 1;
995 // For multi-sim phones, this distinguishes between the sim cards.
996 optional int32 sim_slot_index = 2;
997 // Used to identify the connection. Starts at 0 and increments by 1 for
998 // every new network created. Resets whenever the device reboots.
999 optional int32 data_connection_id = 3;
1000 // A bitmask for the capabilities of this connection.
1001 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1002 // Default value (if we have no information): 0
1003 optional int64 capabilities = 4;
1004 // If this connection has internet.
1005 // This just checks if the DEFAULT bit of capabilities is set.
1006 optional bool has_internet = 5;
1007}
1008
1009/**
1010 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1011 *
1012 * Logged from:
1013 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1014 */
1015message MobileRadioTechnologyChanged {
1016 optional android.telephony.NetworkTypeEnum state = 1;
1017 // For multi-sim phones, this distinguishes between the sim cards.
1018 optional int32 sim_slot_index = 2;
1019}
1020
Andrew Chantb56388b2018-03-22 21:07:33 -07001021/**
1022 * Logs the VID and PID of any connected USB devices.
1023 *
1024 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1025 *
1026 * Logged by Vendor.
1027 */
1028message UsbDeviceAttached {
1029 optional int32 vid = 1;
1030 optional int32 pid = 2;
1031 optional bool has_audio = 3;
1032 optional bool has_hid = 4;
1033 optional bool has_storage = 5;
1034}
1035
Tej Singheee317b2018-03-07 19:28:05 -08001036
Tej Singhdd7bd352018-02-09 19:33:15 -08001037/**
Tej Singh5d991e12018-03-09 19:48:11 -08001038 * Logs when Bluetooth is enabled and disabled.
1039 *
1040 * Logged from:
1041 * services/core/java/com/android/server/BluetoothManagerService.java
1042 */
1043message BluetoothEnabledStateChanged {
1044 repeated AttributionNode attribution_node = 1;
1045 // Whether or not bluetooth is enabled on the device.
1046 enum State {
1047 UNKNOWN = 0;
1048 ENABLED = 1;
1049 DISABLED = 2;
1050 }
1051 optional State state = 2;
1052 // The reason for being enabled/disabled.
1053 // Eg. Airplane mode, crash, application request.
1054 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1055 // If the reason is an application request, this will be the package name.
1056 optional string pkgName = 4;
1057}
1058
1059/**
Jack He22e4a1d2019-01-09 01:19:13 -08001060 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001061 *
1062 * Logged from:
Jack He22e4a1d2019-01-09 01:19:13 -08001063 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1064 *
1065 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001066 */
1067message BluetoothConnectionStateChanged {
1068 // The state of the connection.
1069 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1070 optional android.bluetooth.ConnectionStateEnum state = 1;
1071 // An identifier that can be used to match connect and disconnect events.
1072 // Currently is last two bytes of a hash of a device level ID and
1073 // the mac address of the bluetooth device that is connected.
Jack He22e4a1d2019-01-09 01:19:13 -08001074 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1075 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001076 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1077 // From android.bluetooth.BluetoothAdapter.java
Jack He22e4a1d2019-01-09 01:19:13 -08001078 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001079 optional int32 bt_profile = 3;
Jack He22e4a1d2019-01-09 01:19:13 -08001080 // An identifier that can be used to match events for this device.
1081 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1082 // Salt: Randomly generated 256 bit value
1083 // Hash algorithm: HMAC-SHA256
1084 // Size: 32 byte
1085 // Default: null or empty if the device identifier is not known
1086 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1087}
1088
1089/**
1090 * Logs when a Bluetooth device connects and disconnects over ACL
1091 *
1092 * Logged from:
1093 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1094 *
1095 * Next Tag: 3
1096 */
1097message BluetoothAclConnectionStateChanged {
1098 // An identifier that can be used to match events for this device.
1099 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1100 // Salt: Randomly generated 256 bit value
1101 // Hash algorithm: HMAC-SHA256
1102 // Size: 32 byte
1103 // Default: null or empty if the device identifier is not known
1104 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1105 // The state of the connection.
1106 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1107 optional android.bluetooth.ConnectionStateEnum state = 2;
1108}
1109
1110/**
1111 * Logs when a Bluetooth device connects and disconnects over SCO
1112 *
1113 * Logged from:
1114 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1115 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1116 *
1117 * Next Tag: 4
1118 */
1119message BluetoothScoConnectionStateChanged {
1120 // An identifier that can be used to match events for this device.
1121 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1122 // Salt: Randomly generated 256 bit value
1123 // Hash algorithm: HMAC-SHA256
1124 // Size: 32 byte
1125 // Default: null or empty if the device identifier is not known
1126 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1127 // The state of the connection.
1128 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1129 optional android.bluetooth.ConnectionStateEnum state = 2;
1130 // Codec used for this SCO connection
1131 // Default: UNKNOWN
1132 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001133}
1134
Jack He924f3462019-01-09 20:54:41 -08001135/**
1136 * Logged when active device of a profile changes
1137 *
1138 * Logged from:
1139 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1140 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1141 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1142 */
1143message BluetoothActiveDeviceChanged {
1144 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1145 // From android.bluetooth.BluetoothProfile
1146 optional int32 bt_profile = 1;
1147 // An identifier that can be used to match events for this new active device.
1148 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1149 // Salt: Randomly generated 256 bit value
1150 // Hash algorithm: HMAC-SHA256
1151 // Size: 32 byte
1152 // Default: null or empty if there is no active device for this profile
1153 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1154}
1155
Jack He52260142018-12-18 15:43:27 -08001156// Logs when there is an event affecting Bluetooth device's link layer connection.
1157// - This event is triggered when there is a related HCI command or event
1158// - Users of this metrics can deduce Bluetooth device's connection state from these events
1159// - HCI commands are logged before the command is sent, after receiving command status, and after
1160// receiving command complete
1161// - HCI events are logged when they arrive
1162//
1163// Low level log from system/bt
1164//
1165// Bluetooth classic commands:
1166// - CMD_CREATE_CONNECTION
1167// - CMD_DISCONNECT
1168// - CMD_CREATE_CONNECTION_CANCEL
1169// - CMD_ACCEPT_CONNECTION_REQUEST
1170// - CMD_REJECT_CONNECTION_REQUEST
1171// - CMD_SETUP_ESCO_CONNECTION
1172// - CMD_ACCEPT_ESCO_CONNECTION
1173// - CMD_REJECT_ESCO_CONNECTION
1174// - CMD_ENH_SETUP_ESCO_CONNECTION
1175// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1176//
1177// Bluetooth low energy commands:
1178// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1179// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1180// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1181// - CMD_BLE_CLEAR_WHITE_LIST
1182// - CMD_BLE_ADD_WHITE_LIST
1183// - CMD_BLE_REMOVE_WHITE_LIST
1184//
1185// Bluetooth classic events:
1186// - EVT_CONNECTION_COMP
1187// - EVT_CONNECTION_REQUEST
1188// - EVT_DISCONNECTION_COMP
1189// - EVT_ESCO_CONNECTION_COMP
1190// - EVT_ESCO_CONNECTION_CHANGED
1191//
1192// Bluetooth low energy meta events:
1193// - BLE_EVT_CONN_COMPLETE_EVT
1194// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1195//
1196// Next tag: 10
1197message BluetoothLinkLayerConnectionEvent {
1198 // An identifier that can be used to match events for this device.
1199 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1200 // Salt: Randomly generated 256 bit value
1201 // Hash algorithm: HMAC-SHA256
1202 // Size: 32 byte
1203 // Default: null or empty if the device identifier is not known
1204 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1205 // Connection handle of this connection if available
1206 // Range: 0x0000 - 0x0EFF (12 bits)
1207 // Default: 0xFFFF if the handle is unknown
1208 optional int32 connection_handle = 2;
1209 // Direction of the link
1210 // Default: DIRECTION_UNKNOWN
1211 optional android.bluetooth.DirectionEnum direction = 3;
1212 // Type of this link
1213 // Default: LINK_TYPE_UNKNOWN
1214 optional android.bluetooth.LinkTypeEnum type = 4;
1215
1216 // Reason metadata for this link layer connection event, rules for interpretation:
1217 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1218 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1219 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1220 // set and valid, ignore hci_ble_event
1221
1222 // HCI command associated with this event
1223 // Default: CMD_UNKNOWN
1224 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1225 // HCI event associated with this event
1226 // Default: EVT_UNKNOWN
1227 optional android.bluetooth.hci.EventEnum hci_event = 6;
1228 // HCI BLE meta event associated with this event
1229 // Default: BLE_EVT_UNKNOWN
1230 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1231 // HCI command status code if this is triggerred by hci_cmd
1232 // Default: STATUS_UNKNOWN
1233 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1234 // HCI reason code associated with this event
1235 // Default: STATUS_UNKNOWN
1236 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1237}
1238
Jack He924f3462019-01-09 20:54:41 -08001239/**
1240 * Logs when there is a change in Bluetooth A2DP playback state
1241 *
1242 * Logged from:
1243 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1244 */
1245message BluetoothA2dpPlaybackStateChanged {
1246 // An identifier that can be used to match events for this device.
1247 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1248 // Salt: Randomly generated 256 bit value
1249 // Hash algorithm: HMAC-SHA256
1250 // Size: 32 byte
1251 // Default: null or empty if the device identifier is not known
1252 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1253 // Current playback state
1254 // Default: PLAYBACK_STATE_UNKNOWN
1255 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1256 // Current audio coding mode
1257 // Default: AUDIO_CODING_MODE_UNKNOWN
1258 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1259}
1260
1261/**
1262 * Logs when there is a change in A2DP codec config for a particular remote device
1263 *
1264 * Logged from:
1265 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1266 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1267 */
1268message BluetoothA2dpCodecConfigChanged {
1269 // An identifier that can be used to match events for this device.
1270 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1271 // Salt: Randomly generated 256 bit value
1272 // Hash algorithm: HMAC-SHA256
1273 // Size: 32 byte
1274 // Default: null or empty if the device identifier is not known
1275 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1276 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1277 // Default SOURCE_CODEC_TYPE_INVALID
1278 optional int32 codec_type = 2;
1279 // Codec priroity, the higher the more preferred, -1 for disabled
1280 // Default: CODEC_PRIORITY_DEFAULT
1281 optional int32 codec_priority = 3;
1282 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1283 // Default: SAMPLE_RATE_NONE
1284 optional int32 sample_rate = 4;
1285 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1286 // Default: BITS_PER_SAMPLE_NONE
1287 optional int32 bits_per_sample = 5;
1288 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1289 // Default: CHANNEL_MODE_NONE
1290 optional int32 channel_mode = 6;
1291 // Codec specific values
1292 // Default 0
1293 optional int64 codec_specific_1 = 7;
1294 optional int64 codec_specific_2 = 8;
1295 optional int64 codec_specific_3 = 9;
1296 optional int64 codec_specific_4 = 10;
1297}
1298
1299/**
1300 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1301 * Each codec's capability is logged separately due to statsd restriction
1302 *
1303 * Logged from:
1304 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1305 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1306 */
1307message BluetoothA2dpCodecCapabilityChanged {
1308 // An identifier that can be used to match events for this device.
1309 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1310 // Salt: Randomly generated 256 bit value
1311 // Hash algorithm: HMAC-SHA256
1312 // Size: 32 byte
1313 // Default: null or empty if the device identifier is not known
1314 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1315 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1316 // Default SOURCE_CODEC_TYPE_INVALID
1317 optional int32 codec_type = 2;
1318 // Codec priroity, the higher the more preferred, -1 for disabled
1319 // Default: CODEC_PRIORITY_DEFAULT
1320 optional int32 codec_priority = 3;
1321 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1322 // in BluetoothCodecConfig
1323 // Default: empty and SAMPLE_RATE_NONE for individual item
1324 optional int32 sample_rate = 4;
1325 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1326 // in BluetoothCodecConfig
1327 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1328 optional int32 bits_per_sample = 5;
1329 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1330 // BluetoothCodecConfig
1331 // Default: empty and CHANNEL_MODE_NONE for individual item
1332 optional int32 channel_mode = 6;
1333 // Codec specific values
1334 // Default 0
1335 optional int64 codec_specific_1 = 7;
1336 optional int64 codec_specific_2 = 8;
1337 optional int64 codec_specific_3 = 9;
1338 optional int64 codec_specific_4 = 10;
1339}
1340
1341/**
1342 * Logs when A2DP failed to read from PCM source.
1343 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1344 *
1345 * Logged from:
1346 * system/bt
1347 */
1348message BluetoothA2dpAudioUnderrunReported {
1349 // An identifier that can be used to match events for this device.
1350 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1351 // Salt: Randomly generated 256 bit value
1352 // Hash algorithm: HMAC-SHA256
1353 // Size: 32 byte
1354 // Default: null or empty if the device identifier is not known
1355 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1356 // Encoding interval in nanoseconds
1357 // Default: 0
1358 optional int64 encoding_interval_nanos = 2;
1359 // Number of bytes of PCM data that could not be read from the source
1360 // Default: 0
1361 optional int32 num_missing_pcm_bytes = 3;
1362}
1363
1364/**
1365 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1366 * buffer queue is full and we have to drop data
1367 *
1368 * Logged from:
1369 * system/bt
1370 */
1371message BluetoothA2dpAudioOverrunReported {
1372 // An identifier that can be used to match events for this device.
1373 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1374 // Salt: Randomly generated 256 bit value
1375 // Hash algorithm: HMAC-SHA256
1376 // Size: 32 byte
1377 // Default: null or empty if the device identifier is not known
1378 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1379 // Encoding interval in nanoseconds
1380 // Default: 0
1381 optional int64 encoding_interval_nanos = 2;
1382 // Number of buffers dropped in this event
1383 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1384 // Default: 0
1385 optional int32 num_dropped_buffers = 3;
1386 // Number of encoded buffers dropped in this event
1387 // Default 0
1388 optional int32 num_dropped_encoded_frames = 4;
1389 // Number of encoded bytes dropped in this event
1390 // Default: 0
1391 optional int32 num_dropped_encoded_bytes = 5;
1392}
1393
1394/**
1395 * Logs when we receive reports regarding a device's RSSI value
1396 *
1397 * Logged from:
1398 * system/bt
1399 */
1400message BluetoothDeviceRssiReported {
1401 // An identifier that can be used to match events for this device.
1402 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1403 // Salt: Randomly generated 256 bit value
1404 // Hash algorithm: HMAC-SHA256
1405 // Size: 32 byte
1406 // Default: null or empty if the device identifier is not known
1407 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1408 // Connection handle of this connection if available
1409 // Range: 0x0000 - 0x0EFF (12 bits)
1410 // Default: 0xFFFF if the handle is unknown
1411 optional int32 connection_handle = 2;
1412 // HCI command status code if this is triggerred by hci_cmd
1413 // Default: STATUS_UNKNOWN
1414 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1415 // BR/EDR
1416 // Range: -128 ≤ N ≤ 127 (signed integer)
1417 // Units: dB
1418 // LE:
1419 // Range: -127 to 20, 127 (signed integer)
1420 // Units: dBm
1421 // Invalid when an out of range value is reported
1422 optional int32 rssi = 4;
1423}
1424
1425/**
1426 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1427 *
1428 * Logged from:
1429 * system/bt
1430 */
1431message BluetoothDeviceFailedContactCounterReported {
1432 // An identifier that can be used to match events for this device.
1433 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1434 // Salt: Randomly generated 256 bit value
1435 // Hash algorithm: HMAC-SHA256
1436 // Size: 32 byte
1437 // Default: null or empty if the device identifier is not known
1438 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1439 // Connection handle of this connection if available
1440 // Range: 0x0000 - 0x0EFF (12 bits)
1441 // Default: 0xFFFF if the handle is unknown
1442 optional int32 connection_handle = 2;
1443 // HCI command status code if this is triggerred by hci_cmd
1444 // Default: STATUS_UNKNOWN
1445 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1446 // Number of consecutive failed contacts for a connection corresponding to the Handle
1447 // Range: uint16_t, 0-0xFFFF
1448 // Default: 0xFFFFF
1449 optional int32 failed_contact_counter = 4;
1450}
1451
1452/**
1453 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1454 *
1455 * Logged from:
1456 * system/bt
1457 */
1458message BluetoothDeviceTxPowerLevelReported {
1459 // An identifier that can be used to match events for this device.
1460 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1461 // Salt: Randomly generated 256 bit value
1462 // Hash algorithm: HMAC-SHA256
1463 // Size: 32 byte
1464 // Default: null or empty if the device identifier is not known
1465 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1466 // Connection handle of this connection if available
1467 // Range: 0x0000 - 0x0EFF (12 bits)
1468 // Default: 0xFFFF if the handle is unknown
1469 optional int32 connection_handle = 2;
Jack He4d6abe62019-01-20 21:22:46 -08001470 // HCI command status code if this is triggered by hci_cmd
Jack He924f3462019-01-09 20:54:41 -08001471 // Default: STATUS_UNKNOWN
1472 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1473 // Range: -30 ≤ N ≤ 20
1474 // Units: dBm
1475 // Invalid when an out of range value is reported
1476 optional int32 transmit_power_level = 4;
1477}
Jack He52260142018-12-18 15:43:27 -08001478
Tej Singh5d991e12018-03-09 19:48:11 -08001479/**
Jack He4d6abe62019-01-20 21:22:46 -08001480 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1481 * receiving an HCI command from the host
1482 *
1483 * Logged from: system/bt
1484 */
1485message BluetoothHciTimeoutReported {
1486 // HCI command associated with this event
1487 // Default: CMD_UNKNOWN
1488 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1489}
1490
1491/**
1492 * Logs when we receive Bluetooth Link Quality Report event from the controller
1493 * See Android Bluetooth HCI specification for more details
1494 *
1495 * Note: all count and bytes field are counted since last event
1496 *
1497 * Logged from: system/bt
1498 */
1499message BluetoothQualityReportReported {
1500 // Quality report ID
1501 // Original type: uint8_t
1502 // Default: BQR_ID_UNKNOWN
1503 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1504 // Packet type of the connection
1505 // Original type: uint8_t
1506 // Default: BQR_PACKET_TYPE_UNKNOWN
1507 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1508 // Connection handle of the connection
1509 // Original type: uint16_t
1510 optional int32 connection_handle = 3;
1511 // Performing Role for the connection
1512 // Original type: uint8_t
1513 optional int32 connection_role = 4;
1514 // Current Transmit Power Level for the connection. This value is the same as the controller's
1515 // response to the HCI_Read_Transmit_Power_Level HCI command
1516 // Original type: uint8_t
1517 optional int32 tx_power_level = 5;
1518 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1519 // absolute receiver signal strength value
1520 // Original type: int8_t
1521 optional int32 rssi = 6;
1522 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1523 // channels used by the link currently
1524 // Original type: uint8_t
1525 optional int32 snr = 7;
1526 // Indicates the number of unused channels in AFH_channel_map
1527 // Original type: uint8_t
1528 optional int32 unused_afh_channel_count = 8;
1529 // Indicates the number of the channels which are interfered and quality is bad but are still
1530 // selected for AFH
1531 // Original type: uint8_t
1532 optional int32 afh_select_unideal_channel_count = 9;
1533 // Current Link Supervision Timeout Setting
1534 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1535 // Original type: uint16_t
1536 optional int32 lsto = 10;
1537 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1538 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1539 // 0x01 (Piconet Clock)
1540 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1541 // Original type: uint32_t
1542 optional int64 connection_piconet_clock = 11;
1543 // The count of retransmission
1544 // Original type: uint32_t
1545 optional int64 retransmission_count = 12;
1546 // The count of no RX
1547 // Original type: uint32_t
1548 optional int64 no_rx_count = 13;
1549 // The count of NAK (Negative Acknowledge)
1550 // Original type: uint32_t
1551 optional int64 nak_count = 14;
1552 // Controller timestamp of last TX ACK
1553 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1554 // Original type: uint32_t
1555 optional int64 last_tx_ack_timestamp = 15;
1556 // The count of Flow-off (STOP)
1557 // Original type: uint32_t
1558 optional int64 flow_off_count = 16;
1559 // Controller timestamp of last Flow-on (GO)
1560 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1561 // Original type: uint32_t
1562 optional int64 last_flow_on_timestamp = 17;
1563 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1564 // Original type: uint32_t
1565 optional int64 buffer_overflow_bytes = 18;
1566 // Buffer underflow count (in byte) since last event
1567 // Original type: uint32_t
1568 optional int64 buffer_underflow_bytes = 19;
1569}
1570
1571/**
1572 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1573 *
1574 * Notes:
1575 * - Each event can be partially filled as we might learn different pieces of device
1576 * information at different time
1577 * - Multiple device info events can be combined to give more complete picture
1578 * - When multiple device info events tries to describe the same information, the
1579 * later one wins
1580 *
1581 * Logged from:
1582 * packages/apps/Bluetooth
1583 */
1584message BluetoothManufacturerInfoReported {
1585 // An identifier that can be used to match events for this device.
1586 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1587 // Salt: Randomly generated 256 bit value
1588 // Hash algorithm: HMAC-SHA256
1589 // Size: 32 byte
1590 // Default: null or empty if the device identifier is not known
1591 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1592 // Where is this device info obtained from
1593 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1594 // Name of the data source
1595 // For EXTERNAL: package name of the data source
1596 // For INTERNAL: null for general case, component name otherwise
1597 optional string source_name = 3;
1598 // Name of the manufacturer of this device
1599 optional string manufacturer = 4;
1600 // Model of this device
1601 optional string model = 5;
1602 // Hardware version of this device
1603 optional string hardware_version = 6;
1604 // Software version of this device
1605 optional string software_version = 7;
1606}
1607
1608/**
1609 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1610 * device, as documented by the Bluetooth Core HCI specification
1611 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1612 * Vol 2, Part E, Page 1118
1613 *
1614 * Logged from:
1615 * system/bt
1616 */
1617message BluetoothRemoteVersionInfoReported {
1618 // Connection handle of the connection
1619 // Original type: uint16_t
1620 optional int32 connection_handle = 1;
1621 // HCI command status code
1622 // Default: STATUS_UNKNOWN
1623 optional android.bluetooth.hci.StatusEnum hci_status = 2;
1624 // 1 byte Version of current LMP in the remote controller
1625 optional int32 lmp_version = 3;
1626 // 2 bytes LMP manufacturer code of the remote controller
1627 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
1628 optional int32 lmp_manufacturer_code = 4;
1629 // 4 bytes subversion of the LMP in the remote controller
1630 optional int32 lmp_subversion = 5;
1631}
1632
1633/**
1634 * Logs when certain Bluetooth SDP attributes are discovered
1635 * Constant definitions are from:
1636 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
1637 *
1638 * Current logged attributes:
1639 * - BluetoothProfileDescriptorList
1640 * - Supported Features Bitmask
1641 *
1642 * Logged from:
1643 * system/bt
1644 */
1645message BluetoothSdpAttributeReported {
1646 // An identifier that can be used to match events for this device.
1647 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1648 // Salt: Randomly generated 256 bit value
1649 // Hash algorithm: HMAC-SHA256
1650 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1651 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
1652 // Original type: uint16_t
1653 optional int32 protocol_uuid = 2;
1654 // Short form UUIDs used to identify Bluetooth SDP attribute types
1655 // Original type: uint16_t
1656 optional int32 attribute_id = 3;
1657 // Attribute value for the particular attribute
1658 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1659}
1660
1661/**
1662 * Logs when bond state of a Bluetooth device changes
1663 *
1664 * Logged from:
1665 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
1666 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
1667 */
1668message BluetoothBondStateChanged {
1669 // An identifier that can be used to match events for this device.
1670 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1671 // Salt: Randomly generated 256 bit value
1672 // Hash algorithm: HMAC-SHA256
1673 // Size: 32 byte
1674 // Default: null or empty if the device identifier is not known
1675 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1676 // Preferred transport type to remote dual mode device
1677 // Default: TRANSPORT_AUTO means no preference
1678 optional android.bluetooth.TransportTypeEnum transport = 2;
1679 // The type of this Bluetooth device (Classic, LE, or Dual mode)
1680 // Default: UNKNOWN
1681 optional android.bluetooth.DeviceTypeEnum type = 3;
1682 // Current bond state (NONE, BONDING, BONDED)
1683 // Default: BOND_STATE_UNKNOWN
1684 optional android.bluetooth.BondStateEnum bond_state = 4;
1685 // Bonding sub state
1686 // Default: BOND_SUB_STATE_UNKNOWN
1687 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
1688 // Unbond Reason
1689 // Default: UNBOND_REASON_UNKNOWN
1690 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
1691}
1692
1693/**
1694 * Logs there is an event related Bluetooth classic pairing
1695 *
1696 * Logged from:
1697 * system/bt
1698 */
1699message BluetoothClassicPairingEventReported {
1700 // An identifier that can be used to match events for this device.
1701 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1702 // Salt: Randomly generated 256 bit value
1703 // Hash algorithm: HMAC-SHA256
1704 // Size: 32 byte
1705 // Default: null or empty if the device identifier is not known
1706 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1707 // Connection handle of this connection if available
1708 // Range: 0x0000 - 0x0EFF (12 bits)
1709 // Default: 0xFFFF if the handle is unknown
1710 optional int32 connection_handle = 2;
1711 // HCI command associated with this event
1712 // Default: CMD_UNKNOWN
1713 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
1714 // HCI event associated with this event
1715 // Default: EVT_UNKNOWN
1716 optional android.bluetooth.hci.EventEnum hci_event = 4;
1717 // HCI command status code if this is triggerred by hci_cmd
1718 // Default: STATUS_UNKNOWN
1719 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
1720 // HCI reason code associated with this event
1721 // Default: STATUS_UNKNOWN
1722 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07001723 // A status value related to this specific event
1724 // Default: 0
1725 optional int64 event_value = 7;
Jack He4d6abe62019-01-20 21:22:46 -08001726}
1727
1728/**
1729 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
1730 *
1731 * Logged from:
1732 * system/bt
1733 */
1734message BluetoothSmpPairingEventReported {
1735 // An identifier that can be used to match events for this device.
1736 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1737 // Salt: Randomly generated 256 bit value
1738 // Hash algorithm: HMAC-SHA256
1739 // Size: 32 byte
1740 // Default: null or empty if the device identifier is not known
1741 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1742 // SMP command sent or received over L2CAP
1743 // Default: CMD_UNKNOWN
1744 optional android.bluetooth.smp.CommandEnum smp_command = 2;
1745 // Whether this command is sent or received
1746 // Default: DIRECTION_UNKNOWN
1747 optional android.bluetooth.DirectionEnum direction = 3;
1748 // SMP failure reason code
1749 // Default: PAIRING_FAIL_REASON_DEFAULT
1750 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
1751}
1752
1753/**
Jack He9c30c7c6b2019-01-30 17:24:55 -08001754 * Logs when a Bluetooth socket’s connection state changed
1755 *
1756 * Logged from:
1757 * system/bt
1758 */
1759message BluetoothSocketConnectionStateChanged {
1760 // An identifier that can be used to match events for this device.
1761 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1762 // Salt: Randomly generated 256 bit value
1763 // Hash algorithm: HMAC-SHA256
1764 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08001765 // Default: null or empty if this is a server listener socket
Jack He9c30c7c6b2019-01-30 17:24:55 -08001766 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08001767 // Temporary port of this socket for the current connection or session only
Jack He9c30c7c6b2019-01-30 17:24:55 -08001768 // Default 0 when unknown or don't care
1769 optional int32 port = 2;
1770 // Socket type as mentioned in
1771 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
1772 // Default: SOCKET_TYPE_UNKNOWN
1773 optional android.bluetooth.SocketTypeEnum type = 3;
1774 // Socket connection state
1775 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
1776 optional android.bluetooth.SocketConnectionstateEnum state = 4;
1777 // Number of bytes sent to remote device during this connection
1778 optional int64 tx_bytes = 5;
1779 // Number of bytes received from remote device during this connection
1780 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08001781 // Socket owner's UID
1782 optional int32 uid = 7 [(is_uid) = true];
1783 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
1784 // |port| must be spawned by |server_port|
1785 // Default 0 when unknown or don't care
1786 optional int32 server_port = 8;
1787 // Whether this is a server listener socket
1788 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He9c30c7c6b2019-01-30 17:24:55 -08001789}
1790
1791/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001792 * Logs when something is plugged into or removed from the USB-C connector.
1793 *
1794 * Logged from:
1795 * Vendor USB HAL.
1796 */
1797message UsbConnectorStateChanged {
1798 enum State {
1799 DISCONNECTED = 0;
1800 CONNECTED = 1;
1801 }
1802 optional State state = 1;
1803}
1804
1805/**
1806 * Logs the reported speaker impedance.
1807 *
1808 * Logged from:
1809 * Vendor audio implementation.
1810 */
1811message SpeakerImpedanceReported {
1812 optional int32 speaker_location = 1;
1813 optional int32 impedance = 2;
1814}
1815
1816/**
1817 * Logs the report of a failed hardware.
1818 *
1819 * Logged from:
1820 * Vendor HALs.
1821 *
1822 */
1823message HardwareFailed {
1824 enum HardwareType {
1825 HARDWARE_FAILED_UNKNOWN = 0;
1826 HARDWARE_FAILED_MICROPHONE = 1;
1827 HARDWARE_FAILED_CODEC = 2;
1828 HARDWARE_FAILED_SPEAKER = 3;
1829 HARDWARE_FAILED_FINGERPRINT = 4;
1830 }
1831 optional HardwareType hardware_type = 1;
1832
1833 /* hardware_location allows vendors to differentiate between multiple instances of
1834 * the same hardware_type. The specific locations are vendor defined integers,
1835 * referring to board-specific numbering schemes.
1836 */
1837 optional int32 hardware_location = 2;
1838
1839 /* failure_code is specific to the HardwareType of the failed hardware.
1840 * It should use the enum values defined below.
1841 */
1842 enum MicrophoneFailureCode {
1843 MICROPHONE_FAILURE_COMPLETE = 0;
1844 }
1845 enum CodecFailureCode {
1846 CODEC_FAILURE_COMPLETE = 0;
1847 }
1848 enum SpeakerFailureCode {
1849 SPEAKER_FAILURE_COMPLETE = 0;
1850 SPEAKER_FAILURE_HIGH_Z = 1;
1851 SPEAKER_FAILURE_SHORT = 2;
1852 }
1853 enum FingerprintFailureCode {
1854 FINGERPRINT_FAILURE_COMPLETE = 0;
1855 FINGERPRINT_SENSOR_BROKEN = 1;
1856 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1857 }
1858 optional int32 failure_code = 3;
1859}
1860
1861/**
1862 * Log an event when the device has been physically dropped.
1863 * Reported from the /vendor partition.
1864 */
1865message PhysicalDropDetected {
1866 // Confidence that the event was actually a drop, 0 -> 100
1867 optional int32 confidence_pctg = 1;
1868 // Peak acceleration of the drop, in 1/1000s of a g.
1869 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001870 // Duration of freefall in ms
1871 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001872}
1873
1874/**
1875 * Log bucketed battery charge cycles.
1876 *
1877 * Each bucket represents cycles of the battery past
1878 * a given charge point. For example, bucket 1 is the
1879 * lowest 1/8th of the battery, and bucket 8 is 100%.
1880 *
1881 * Logged from:
1882 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1883 */
1884message ChargeCyclesReported {
1885 optional int32 cycle_bucket_1 = 1;
1886 optional int32 cycle_bucket_2 = 2;
1887 optional int32 cycle_bucket_3 = 3;
1888 optional int32 cycle_bucket_4 = 4;
1889 optional int32 cycle_bucket_5 = 5;
1890 optional int32 cycle_bucket_6 = 6;
1891 optional int32 cycle_bucket_7 = 7;
1892 optional int32 cycle_bucket_8 = 8;
1893}
1894
1895/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001896 * Logs the duration of a davey (jank of >=700ms) when it occurs
1897 *
1898 * Logged from:
1899 * frameworks/base/libs/hwui/JankTracker.cpp
1900 */
1901message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001902 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001903 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001904
Tej Singhbb8554a2018-01-26 11:59:14 -08001905 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001906 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001907}
1908
1909/**
Bookatze5885242017-10-24 20:10:31 -07001910 * Logs phone signal strength changes.
1911 *
1912 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001913 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001914 */
1915message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001916 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1917 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001918}
1919
Yangster4ccebea2018-10-09 17:09:02 -07001920
1921/**
1922 * Logs when the phone state, sim state or signal strength changes
1923 *
1924 * Logged from:
1925 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1926 */
1927message PhoneServiceStateChanged {
1928 optional android.telephony.ServiceStateEnum state = 1;
1929 optional android.telephony.SimStateEnum sim_state = 2;
1930 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1931}
1932
1933/**
1934 * Logs when the phone becomes on or off.
1935 *
1936 * Logged from:
1937 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1938 */
1939message PhoneStateChanged {
1940 enum State {
1941 OFF = 0;
1942 ON = 1;
1943 }
1944 optional State state = 1;
1945}
1946
Hyunyoung Songcc651c12018-10-17 13:35:32 -07001947message LauncherUIChanged {
Yao Chen046b5122018-10-24 14:09:20 -07001948 optional android.stats.launcher.LauncherAction action = 1;
1949 optional android.stats.launcher.LauncherState src_state = 2;
1950 optional android.stats.launcher.LauncherState dst_state = 3;
1951 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songcc651c12018-10-17 13:35:32 -07001952 optional bool is_swipe_up_enabled = 5;
1953}
1954
David Chenc28b2bb2017-10-24 12:52:52 -07001955/**
1956 * Logs that a setting was updated.
1957 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001958 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001959 * The tag and is_default allow resetting of settings to default values based on the specified
1960 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1961 */
1962message SettingChanged {
1963 // The name of the setting.
1964 optional string setting = 1;
1965
1966 // The change being imposed on this setting. May represent a number, eg "3".
1967 optional string value = 2;
1968
1969 // The new value of this setting. For most settings, this is same as value. For some settings,
1970 // value is +X or -X where X represents an element in a set. For example, if the previous value
1971 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1972 // The +/- feature is currently only used for location_providers_allowed.
1973 optional string new_value = 3;
1974
1975 // The previous value of this setting.
1976 optional string prev_value = 4;
1977
1978 // The tag used with the is_default for resetting sets of settings. This is generally null.
1979 optional string tag = 5;
1980
Bookatz90867622018-01-31 15:05:57 -08001981 // True if this setting with tag should be resettable.
1982 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001983
David Chenbd789912018-03-16 17:19:55 -07001984 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001985 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001986
1987 enum ChangeReason {
1988 UPDATED = 1; // Updated can be an insertion or an update.
1989 DELETED = 2;
1990 }
1991 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001992}
Chenjie Yub3dda412017-10-24 13:41:59 -07001993
Chenjie Yu05013b32017-11-21 10:21:41 -08001994/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001995 * Logs activity going to foreground or background
1996 *
1997 * Logged from:
1998 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1999 */
2000message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002001 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002002 optional string pkg_name = 2;
2003 optional string class_name = 3;
2004
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002005 enum State {
2006 BACKGROUND = 0;
2007 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002008 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002009 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002010}
David Chenc8a43242017-10-17 16:23:28 -07002011
2012/**
Felix Lopez Luis7ca1abd2018-12-12 10:32:32 +00002013 * Logs when a volume entered low Storage state.
2014 * Logged from:
2015 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2016 */
2017message LowStorageStateChanged {
2018 // Volume that ran out of storage.
2019 optional string volume_description = 1;
2020
2021 enum State {
2022 UNKNOWN = 0;
2023 OFF = 1;
2024 ON = 2;
2025 }
2026 optional State state = 2;
2027}
2028
2029/**
2030 * Logs when an app is downgraded.
2031 * Logged from:
2032 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2033 */
2034message AppDowngraded {
2035 optional string package_name = 1;
2036 // Size of the package (all data) before being downgraded.
2037 optional int64 size_in_bytes_before = 2;
2038 // Size of the package (all data) after being downgraded.
2039 optional int64 size_in_bytes_after = 3;
2040
2041 optional bool aggressive = 4;
2042}
2043
2044/**
2045 * Logs when an app is optimized after being downgraded.
2046 * Logged from:
2047 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2048 */
2049message AppOptimizedAfterDowngraded {
2050 optional string package_name = 1;
2051}
2052
2053/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002054 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002055 * Logged from:
2056 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2057 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002058message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002059 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002060
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002061 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002062
2063 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002064 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002065 optional string process_name = 3;
2066
2067 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002068 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002069
2070 optional string package_name = 5;
2071
2072 enum InstantApp {
2073 UNAVAILABLE = 0;
2074 FALSE = 1;
2075 TRUE = 2;
2076 }
2077 optional InstantApp is_instant_app = 6;
2078
2079 enum ForegroundState {
2080 UNKNOWN = 0;
2081 BACKGROUND = 1;
2082 FOREGROUND = 2;
2083 }
2084 optional ForegroundState foreground_state = 7;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002085}
David Chen9e3808c2017-11-20 17:25:34 -08002086
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002087/**
2088 * Logs when a WTF (What a Terrible Failure) happened.
2089 * Logged from:
2090 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2091 */
2092message WTFOccurred {
2093 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002094
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002095 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002096
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002097 // The name of the process.
2098 // system_server if it is not by an app
2099 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002100
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002101 // The pid if available. -1 means not available.
2102 optional sint32 pid = 4;
2103}
2104
2105/**
2106 * Logs when system server reports low memory.
2107 * Logged from:
2108 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2109 */
2110message LowMemReported {
2111}
2112
2113/**
2114 * Logs when an app ANR (App Not Responding) occurs.
2115 * Logged from:
2116 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2117 */
2118message ANROccurred {
2119 optional int32 uid = 1 [(is_uid) = true];
2120
2121 optional string process_name = 2;
2122
2123 optional string short_component_name = 3;
2124
2125 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002126
2127 enum InstantApp {
2128 UNAVAILABLE = 0;
2129 FALSE = 1;
2130 TRUE = 2;
2131 }
2132 optional InstantApp is_instant_app = 5;
2133
2134 enum ForegroundState {
2135 UNKNOWN = 0;
2136 BACKGROUND = 1;
2137 FOREGROUND = 2;
2138 }
2139 optional ForegroundState foreground_state = 6;
David Chen9e3808c2017-11-20 17:25:34 -08002140}
2141
David Chen0a368b22017-12-06 16:28:16 -08002142/*
2143 * Allows other apps to push events into statsd.
2144 * Logged from:
2145 * frameworks/base/core/java/android/util/StatsLog.java
2146 */
David Chen0b5c90c2018-01-25 16:51:49 -08002147message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002148 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002149 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002150
2151 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2152 optional int32 label = 2;
2153
2154 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2155 // predicates for the metrics).
2156 enum State {
2157 UNKNOWN = 0;
2158 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2159 STOP = 2;
2160 START = 3;
2161 }
2162 optional State state = 3;
2163}
2164
David Chen9e3808c2017-11-20 17:25:34 -08002165/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002166 * Logs when statsd detects an anomaly.
2167 *
2168 * Logged from:
2169 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2170 */
2171message AnomalyDetected {
2172 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002173 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002174
Yangster-mac94e197c2018-01-02 16:03:03 -08002175 // Id of the config whose anomaly detection alert fired.
2176 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002177
Yangster-mac94e197c2018-01-02 16:03:03 -08002178 // Id of the alert (i.e. name of the anomaly that was detected).
2179 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002180}
2181
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002182message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002183 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002184 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002185
2186 // The app package name.
2187 optional string pkg_name = 2;
2188
2189 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002190 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002191 WARM = 1;
2192 HOT = 2;
2193 COLD = 3;
2194 }
2195 // The transition type.
2196 optional TransitionType type = 3;
2197
2198 // The activity name.
2199 optional string activity_name = 4;
2200
2201 // The name of the calling app. Empty if not set.
2202 optional string calling_pkg_name = 5;
2203
2204 // Whether the app is an instant app.
2205 optional bool is_instant_app = 6;
2206
2207 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002208 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002209
Bookatz80d11a02018-01-16 10:46:35 -08002210 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002211
David Chen0b5c90c2018-01-25 16:51:49 -08002212 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002213 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002214 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002215 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002216 optional int32 bind_application_delay_millis = 11;
2217 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002218
2219 // Empty if not set.
2220 optional string launch_token = 13;
2221
Calin Juravle759fbda2018-02-20 19:52:30 +00002222 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002223 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002224
2225 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002226 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002227}
2228
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002229message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002230 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002231 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002232
2233 // The app package name.
2234 optional string pkg_name = 2;
2235
2236 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002237 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002238 WARM = 1;
2239 HOT = 2;
2240 COLD = 3;
2241 }
2242 // The transition type.
2243 optional TransitionType type = 3;
2244
2245 // The activity name.
2246 optional string activity_name = 4;
2247}
2248
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002249message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002250 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002251 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002252
2253 // The app package name.
2254 optional string pkg_name = 2;
2255
2256 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002257 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002258 WITH_BUNDLE = 1;
2259 WITHOUT_BUNDLE = 2;
2260 }
2261 // The transition type.
2262 optional TransitionType type = 3;
2263
2264 // The activity name.
2265 optional string activity_name = 4;
2266
2267 optional bool transition_process_running = 5;
2268
2269 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002270 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002271}
2272
Bookatz8fcd09a2017-12-18 13:01:10 -08002273/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002274 * Logs a picture-in-picture action
2275 * Logged from:
2276 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2277 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2278 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2279 */
2280message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002281 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002282 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002283
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002284 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002285
Chenjie Yu52cacc62017-12-08 18:11:45 -08002286 enum State {
2287 ENTERED = 1;
2288 EXPANDED_TO_FULL_SCREEN = 2;
2289 MINIMIZED = 3;
2290 DISMISSED = 4;
2291 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002292 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002293}
2294
2295/**
Chenjie Yue8904192017-12-08 19:12:57 -08002296 * Logs overlay action
2297 * Logged from:
2298 * services/core/java/com/android/server/wm/Session.java
2299 */
2300message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002301 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002302
2303 optional string package_name = 2;
2304
2305 optional bool using_alert_window = 3;
2306
2307 enum State {
2308 ENTERED = 1;
2309 EXITED = 2;
2310 }
2311 optional State state = 4;
2312}
2313
Chenjie Yuccfe6452018-01-30 11:33:21 -08002314/*
2315 * Logs foreground service starts and stops.
2316 * Note that this is not when a service starts or stops, but when it is
2317 * considered foreground.
2318 * Logged from
2319 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2320 */
2321message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002322 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002323 // package_name + "/" + class_name
2324 optional string short_name = 2;
2325
2326 enum State {
2327 ENTER = 1;
2328 EXIT = 2;
2329 }
2330 optional State state = 3;
2331}
2332
Chenjie Yue8904192017-12-08 19:12:57 -08002333/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002334 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2335 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2336 * attributed back to the parent (host) uid. One example is Chrome.
2337 *
2338 * Logged from:
2339 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2340 */
2341message IsolatedUidChanged {
2342 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002343 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002344 optional int32 parent_uid = 1;
2345
2346 optional int32 isolated_uid = 2;
2347
2348 // We expect an isolated uid to be removed before if it's used for another parent uid.
2349 enum Event {
2350 REMOVED = 0;
2351 CREATED = 1;
2352 }
2353 optional Event event = 3;
2354}
2355
2356/*
2357 * Logs the reception of an incoming network packet causing the main system to wake up for
2358 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2359 * and processed by WakeupController.cpp.
2360 */
2361message PacketWakeupOccurred {
2362 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2363 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002364 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002365 // The interface name on which the packet was received.
2366 optional string iface = 2;
2367 // The ethertype value of the packet.
2368 optional int32 ethertype = 3;
2369 // String representation of the destination MAC address of the packet.
2370 optional string destination_hardware_address = 4;
2371 // String representation of the source address of the packet if this was an IP packet.
2372 optional string source_ip = 5;
2373 // String representation of the destination address of the packet if this was an IP packet.
2374 optional string destination_ip = 6;
2375 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2376 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2377 // families.
2378 optional int32 ip_next_header = 7;
2379 // The source port if this was a TCP or UDP packet.
2380 optional int32 source_port = 8;
2381 // The destination port if this was a TCP or UDP packet.
2382 optional int32 destination_port = 9;
2383}
2384
2385/*
2386 * Logs the memory stats for an app on startup.
2387 * Logged from:
2388 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2389 */
2390message AppStartMemoryStateCaptured {
2391 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002392 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002393
2394 // The process name.
2395 optional string process_name = 2;
2396
2397 // The activity name.
2398 optional string activity_name = 3;
2399
2400 // # of page-faults
2401 optional int64 pgfault = 4;
2402
2403 // # of major page-faults
2404 optional int64 pgmajfault = 5;
2405
2406 // RSS
2407 optional int64 rss_in_bytes = 6;
2408
2409 // CACHE
2410 optional int64 cache_in_bytes = 7;
2411
2412 // SWAP
2413 optional int64 swap_in_bytes = 8;
2414}
2415
2416/*
2417 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2418 * for LMK event.
2419 * Logged from:
2420 * system/core/lmkd/lmkd.c
2421 */
2422message LmkStateChanged {
2423 enum State {
2424 UNKNOWN = 0;
2425 START = 1;
2426 STOP = 2;
2427 }
2428 optional State state = 1;
2429}
2430
2431/*
2432 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2433 * Logged from:
2434 * system/core/lmkd/lmkd.c
2435 */
2436message LmkKillOccurred {
2437 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002438 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002439
2440 // The process name.
2441 optional string process_name = 2;
2442
2443 // oom adj score.
2444 optional int32 oom_score = 3;
2445
2446 // # of page-faults
2447 optional int64 pgfault = 4;
2448
2449 // # of major page-faults
2450 optional int64 pgmajfault = 5;
2451
2452 // RSS
2453 optional int64 rss_in_bytes = 6;
2454
2455 // CACHE
2456 optional int64 cache_in_bytes = 7;
2457
2458 // SWAP
2459 optional int64 swap_in_bytes = 8;
Jim Blackler972a5c52018-11-21 15:24:48 +00002460
2461 // The elapsed real time of start of the process.
2462 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08002463
2464 // Min oom adj score considered by lmkd.
2465 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002466}
2467
Rajeev Kumar51b54602018-03-01 12:18:26 -08002468/*
2469 * Logs when the ActivityManagerService detects that an app died.
2470 *
2471 * Logged from:
2472 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2473 */
2474message AppDied {
2475 // timestamp(elapsedRealtime) of record creation
Yao Chenc40a19d2018-03-15 16:48:25 -07002476 optional uint64 timestamp_millis = 1 [(stateFieldOption).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002477}
2478
Chenjie Yubbcbc602018-02-05 16:51:52 -08002479//////////////////////////////////////////////////////////////////////
2480// Pulled atoms below this line //
2481//////////////////////////////////////////////////////////////////////
2482
2483/**
David Chenc8a43242017-10-17 16:23:28 -07002484 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
2485 *
2486 * Pulled from:
2487 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2488 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002489message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002490 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002491
2492 optional int64 rx_bytes = 2;
2493
2494 optional int64 rx_packets = 3;
2495
2496 optional int64 tx_bytes = 4;
2497
2498 optional int64 tx_packets = 5;
2499}
2500
2501/**
2502 * Pulls bytes transferred via wifi (separated by foreground and background usage).
2503 *
2504 * Pulled from:
2505 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2506 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002507message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002508 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002509
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002510 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2511 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002512
2513 optional int64 rx_bytes = 3;
2514
2515 optional int64 rx_packets = 4;
2516
2517 optional int64 tx_bytes = 5;
2518
2519 optional int64 tx_packets = 6;
2520}
2521
2522/**
2523 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2524 *
2525 * Pulled from:
2526 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2527 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002528message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002529 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002530
2531 optional int64 rx_bytes = 2;
2532
2533 optional int64 rx_packets = 3;
2534
2535 optional int64 tx_bytes = 4;
2536
2537 optional int64 tx_packets = 5;
2538}
2539
2540/**
2541 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
2542 *
2543 * Pulled from:
2544 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2545 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002546message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002547 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002548
Yao Chenc40a19d2018-03-15 16:48:25 -07002549 // 1 denotes foreground and 0 denotes background. This is called Set in
2550 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002551 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002552
2553 optional int64 rx_bytes = 3;
2554
2555 optional int64 rx_packets = 4;
2556
2557 optional int64 tx_bytes = 5;
2558
2559 optional int64 tx_packets = 6;
2560}
2561
2562/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002563 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2564 *
2565 * Pulled from:
2566 * StatsCompanionService
2567 */
2568message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002569 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002570
2571 optional int64 rx_bytes = 2;
2572
2573 optional int64 tx_bytes = 3;
2574}
2575
2576/**
David Chenc8a43242017-10-17 16:23:28 -07002577 * Pulls the kernel wakelock durations. This atom is adapted from
2578 * android/internal/os/KernelWakelockStats.java
2579 *
2580 * Pulled from:
2581 * StatsCompanionService using KernelWakelockReader.
2582 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002583message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002584 optional string name = 1;
2585
2586 optional int32 count = 2;
2587
2588 optional int32 version = 3;
2589
2590 optional int64 time = 4;
2591}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002592
Chenjie Yu05013b32017-11-21 10:21:41 -08002593/**
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002594 * Pulls low power state information. This includes platform and subsystem sleep state information,
2595 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002596 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002597 * hardware/interfaces/power/1.1/types.hal
2598 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002599message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002600 // Subsystem name
2601 optional string subsystem_name = 1;
2602 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2603 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
2604 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002605 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002606 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002607 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002608 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002609}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002610
Chenjie Yu05013b32017-11-21 10:21:41 -08002611/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002612 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002613 * Pulls the time the cpu spend on the frequency index. Frequency index
2614 * starts from highest to lowest. The value should be monotonically
2615 * increasing since boot. However, if there is a cpu
2616 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002617 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002618message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002619 optional uint32 cluster = 1;
2620 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002621 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002622}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002623
Chenjie Yu05013b32017-11-21 10:21:41 -08002624/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002625 * Pulls Cpu Time Per Uid.
2626 * Note that isolated process uid time should be attributed to host uids.
2627 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002628message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002629 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00002630 optional uint64 user_time_micros = 2;
2631 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002632}
2633
2634/**
2635 * Pulls Cpu Time Per Uid per frequency.
2636 * Note that isolated process uid time should be attributed to host uids.
2637 * For each uid, we order the time by descending frequencies.
2638 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002639message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002640 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002641 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002642 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002643}
Hugo Benichi884970e2017-11-14 22:42:46 +09002644
Chenjie Yu05013b32017-11-21 10:21:41 -08002645/**
2646 * Pulls Wifi Controller Activity Energy Info
2647 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002648message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002649 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002650 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002651 // stack reported state
2652 // TODO: replace this with proto enum
2653 optional int32 stack_state = 2;
2654 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002655 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002656 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002657 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002658 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002659 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002660 // product of current(mA), voltage(V) and time(ms)
2661 optional uint64 controller_energy_used = 6;
2662}
2663
2664/**
2665 * Pulls Modem Activity Energy Info
2666 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002667message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002668 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002669 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002670 // sleep time in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08002671 optional uint64 sleep_time_millis = 2;
Chenjie Yu05013b32017-11-21 10:21:41 -08002672 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002673 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002674 /**
2675 * Tx power index
2676 * index 0 = tx_power < 0dBm
2677 * index 1 = 0dBm < tx_power < 5dBm
2678 * index 2 = 5dBm < tx_power < 15dBm
2679 * index 3 = 15dBm < tx_power < 20dBm
2680 * index 4 = tx_power > 20dBm
2681 */
2682 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002683 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002684 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002685 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002686 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002687 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002688 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002689 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002690 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002691 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002692 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002693 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002694 // product of current(mA), voltage(V) and time(ms)
2695 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002696}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002697
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002698/**
2699 * Pulls Bluetooth Activity Energy Info
2700 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2701 */
2702message BluetoothActivityInfo {
2703 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002704 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002705 // bluetooth stack state
2706 optional int32 bluetooth_stack_state = 2;
2707 // tx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002708 optional uint64 controller_tx_time_millis = 3;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002709 // rx time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002710 optional uint64 controller_rx_time_millis = 4;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002711 // idle time in ms
David Chen0b5c90c2018-01-25 16:51:49 -08002712 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002713 // product of current(mA), voltage(V) and time(ms)
2714 optional uint64 energy_used = 6;
2715}
2716
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002717/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002718 * Logs the memory stats for a process.
2719 */
2720message ProcessMemoryState {
2721 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002722 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002723
2724 // The process name.
2725 optional string process_name = 2;
2726
2727 // oom adj score.
2728 optional int32 oom_score = 3;
2729
2730 // # of page-faults
2731 optional int64 pgfault = 4;
2732
2733 // # of major page-faults
2734 optional int64 pgmajfault = 5;
2735
Rajeev Kumar90235992018-01-29 11:06:48 -08002736 // RSS
2737 optional int64 rss_in_bytes = 6;
2738
2739 // CACHE
2740 optional int64 cache_in_bytes = 7;
2741
2742 // SWAP
2743 optional int64 swap_in_bytes = 8;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002744}
2745
2746/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002747 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002748 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002749message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002750 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002751}
2752
2753/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002754 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002755 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002756message SystemUptime {
2757 // Milliseconds since the system was booted.
2758 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
2759 // for external input).
2760 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08002761 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002762}
2763
2764/*
2765 * Reads from /proc/uid_concurrent_active_time which has the format:
2766 * active: X (X is # cores)
2767 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
2768 * [uid1]: [time-0] [time-1] [time-2] ... ...
2769 * ...
2770 * Time-N means the CPU time a UID spent running concurrently with N other processes.
2771 * The file contains a monotonically increasing count of time for a single boot.
2772 */
2773message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002774 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002775 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002776}
2777
2778/**
2779 * Reads from /proc/uid_concurrent_policy_time which has the format:
2780 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
2781 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2782 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2783 * ...
2784 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
2785 * The file contains a monotonically increasing count of time for a single boot.
2786 */
2787message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002788 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002789 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002790 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08002791}
2792
2793/*
2794 * Pulls free disk space, for data, system partition and temporary directory.
2795 */
2796message DiskSpace {
2797 // available bytes in data partition
2798 optional uint64 data_available_bytes = 1;
2799 // available bytes in system partition
2800 optional uint64 system_available_bytes = 2;
2801 // available bytes in download cache or temp directories
2802 optional uint64 temp_available_bytes = 3;
2803}
Tej Singhbf972d92018-01-10 20:51:13 -08002804
2805/**
2806 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002807 * Pulled from:
2808 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002809 */
2810message RemainingBatteryCapacity {
2811 optional int32 charge_uAh = 1;
2812}
2813
2814/**
2815 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002816 * Pulled from:
2817 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002818 */
2819message FullBatteryCapacity {
2820 optional int32 capacity_uAh = 1;
Tej Singh40298312018-02-16 00:15:09 -08002821}
2822
2823/**
Tej Singhd89137e2018-03-26 14:51:40 -07002824 * Pulls the temperature of various parts of the device.
2825 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08002826 *
2827 * Pulled from:
2828 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
2829 */
2830message Temperature {
2831 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY.
2832 optional android.os.TemperatureTypeEnum sensor_location = 1;
2833
2834 // The name of the temperature source. Eg. CPU0
2835 optional string sensor_name = 2;
2836
Tej Singhd89137e2018-03-26 14:51:40 -07002837 // Temperature in tenths of a degree C.
2838 optional int32 temperature_dC = 3;
yroa1fe77c2018-02-26 14:22:54 -08002839}
lifr35a7cf02018-12-12 16:38:04 +08002840
2841/**
lifrd1300022019-05-03 12:02:54 +08002842 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
2843 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
2844 *
2845 * The NetworkDnsEventReported message represents the entire lookup operation, which may
2846 * result one or more queries to the recursive DNS resolvers. Those are individually logged
2847 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
2848 * broken up by query type, transport, network interface, etc.
lifr35a7cf02018-12-12 16:38:04 +08002849 */
2850message NetworkDnsEventReported {
lifrd1300022019-05-03 12:02:54 +08002851 optional android.stats.dnsresolver.EventType event_type = 1;
lifr35a7cf02018-12-12 16:38:04 +08002852
lifrd1300022019-05-03 12:02:54 +08002853 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifr35a7cf02018-12-12 16:38:04 +08002854
lifrd1300022019-05-03 12:02:54 +08002855 // The latency in microseconds of the entire DNS lookup operation.
lifr35a7cf02018-12-12 16:38:04 +08002856 optional int32 latency_micros = 3;
lifrd1300022019-05-03 12:02:54 +08002857
2858 // Only valid for event_type = EVENT_GETADDRINFO.
2859 optional int32 hints_ai_flags = 4;
2860
2861 // Flags passed to android_res_nsend() defined in multinetwork.h
2862 // Only valid for event_type = EVENT_RESNSEND.
2863 optional int32 res_nsend_flags = 5;
2864
lifrad9becc2019-05-20 11:04:41 +08002865 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrd1300022019-05-03 12:02:54 +08002866
2867 // The DNS over TLS mode on a specific netId.
2868 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
2869
2870 // Additional pass-through fields opaque to statsd.
2871 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
2872 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr35a7cf02018-12-12 16:38:04 +08002873}
2874
Chiachang Wang67f24472019-01-15 15:14:00 +08002875/**
2876 * Logs when a data stall event occurs.
2877 *
2878 * Log from:
2879 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
2880 */
2881message DataStallEvent {
2882 // Data stall evaluation type.
2883 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
2884 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
2885 optional int32 evaluation_type = 1;
2886 // See definition in data_stall_event.proto.
2887 optional com.android.server.connectivity.ProbeResult validation_result = 2;
2888 // See definition in data_stall_event.proto.
2889 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
2890 // See definition in data_stall_event.proto.
2891 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
2892 // See definition in data_stall_event.proto.
2893 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
2894 // See definition in data_stall_event.proto.
2895 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
2896}
Jack Yu6d421bc2019-01-23 17:42:54 +08002897
2898/**
2899 * Logs when a NFC device's error occurred.
2900 * Logged from:
2901 * system/nfc/src/nfc/nfc/nfc_ncif.cc
2902 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
2903 */
2904message NfcErrorOccurred {
2905 enum Type {
2906 UNKNOWN = 0;
2907 CMD_TIMEOUT = 1;
2908 ERROR_NOTIFICATION = 2;
2909 AID_OVERFLOW = 3;
2910 }
2911 optional Type type = 1;
2912 // If it's nci cmd timeout, log the timeout command.
2913 optional uint32 nci_cmd = 2;
2914
2915 optional uint32 error_ntf_status_code = 3;
2916}
2917
2918/**
2919 * Logs when a NFC device's state changed event
2920 * Logged from:
2921 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
2922 */
2923message NfcStateChanged {
2924 enum State {
2925 UNKNOWN = 0;
2926 OFF = 1;
2927 ON = 2;
2928 ON_LOCKED = 3; // Secure Nfc enabled.
2929 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
2930 }
2931 optional State state = 1;
2932}
2933
2934/**
2935 * Logs when a NFC Beam Transaction occurred.
2936 * Logged from:
2937 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
2938 */
2939message NfcBeamOccurred {
2940 enum Operation {
2941 UNKNOWN = 0;
2942 SEND = 1;
2943 RECEIVE = 2;
2944 }
2945 optional Operation operation = 1;
2946}
2947
2948/**
2949 * Logs when a NFC Card Emulation Transaction occurred.
2950 * Logged from:
2951 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
2952 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
2953 */
2954message NfcCardemulationOccurred {
2955 enum Category {
2956 UNKNOWN = 0;
2957 HCE_PAYMENT = 1;
2958 HCE_OTHER = 2;
2959 OFFHOST = 3;
2960 }
2961 // Transaction belongs to HCE payment or HCE other category, or offhost.
2962 optional Category category = 1;
2963 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
2964 optional string se_name = 2;
2965}
2966
2967/**
2968 * Logs when a NFC Tag event occurred.
2969 * Logged from:
2970 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
2971 */
2972message NfcTagOccurred {
2973 enum Type {
2974 UNKNOWN = 0;
2975 URL = 1;
2976 BT_PAIRING = 2;
2977 PROVISION = 3;
2978 WIFI_CONNECT = 4;
2979 APP_LAUNCH = 5;
2980 OTHERS = 6;
2981 }
2982 optional Type type = 1;
2983}
2984
2985/**
2986 * Logs when Hce transaction triggered
2987 * Logged from:
2988 * system/nfc/src/nfc/nfc/nfc_ncif.cc
2989 */
2990message NfcHceTransactionOccurred {
2991 // The latency period(in microseconds) it took for the first HCE data
2992 // exchange.
2993 optional uint32 latency_micros = 1;
2994}
2995
2996/**
2997 * Logs when SecureElement state event changed
2998 * Logged from:
2999 * packages/apps/SecureElement/src/com/android/se/Terminal.java
3000 */
3001message SeStateChanged {
3002 enum State {
3003 UNKNOWN = 0;
3004 INITIALIZED = 1;
3005 DISCONNECTED = 2;
3006 CONNECTED = 3;
3007 HALCRASH = 4;
3008 }
3009 optional State state = 1;
3010
3011 optional string state_change_reason = 2;
3012 // SIMx or eSEx.
3013 optional string terminal = 3;
3014}
3015
3016/**
3017 * Logs when Omapi API used
3018 * Logged from:
3019 * packages/apps/SecureElement/src/com/android/se/Terminal.java
3020 */
3021message SeOmapiReported {
3022 enum Operation {
3023 UNKNOWN = 0;
3024 OPEN_CHANNEL = 1;
3025 }
3026 optional Operation operation = 1;
3027 // SIMx or eSEx.
3028 optional string terminal = 2;
3029
3030 optional string package_name = 3;
3031}
Hui Yuf57e4012019-02-13 12:29:38 -08003032
3033/*
3034* Logs number of milliseconds it takes to start a process.
3035* The definition of app process start time is from the app launch time to
3036* the time that Zygote finished forking the app process and loaded the
3037* application package's java classes.
3038
3039* This metric is different from AppStartOccurred which is for foreground
3040* activity only.
3041
3042* ProcessStartTime can report all processes (both foreground and background)
3043* start time.
3044*
3045* Logged from:
3046* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3047*/
3048message ProcessStartTime {
3049 // The uid of the ProcessRecord.
3050 optional int32 uid = 1 [(is_uid) = true];
3051
3052 // The process pid.
3053 optional int32 pid = 2;
3054
3055 // The process name.
3056 // Usually package name, "system" for system server.
3057 // Provided by ActivityManagerService.
3058 optional string process_name = 3;
3059
3060 enum StartType {
3061 UNKNOWN = 0;
3062 WARM = 1;
3063 HOT = 2;
3064 COLD = 3;
3065 }
3066
3067 // The start type.
3068 optional StartType type = 4;
3069
3070 // The elapsed realtime at the start of the process.
3071 optional int64 process_start_time_millis = 5;
3072
3073 // Number of milliseconds it takes to reach bind application.
3074 optional int32 bind_application_delay_millis = 6;
3075
3076 // Number of milliseconds it takes to finish start of the process.
3077 optional int32 process_start_delay_millis = 7;
3078
3079 // hostingType field in ProcessRecord, the component type such as "activity",
3080 // "service", "content provider", "broadcast" or other strings.
3081 optional string hosting_type = 8;
3082
3083 // hostingNameStr field in ProcessRecord. The component class name that runs
3084 // in this process.
3085 optional string hosting_name = 9;
3086}
3087
Chiachang Wang4d6fe322019-03-21 20:40:01 +08003088/**
3089 * Push network stack events.
3090 *
3091 * Log from:
3092 * frameworks/base/packages/NetworkStack/
3093 */
3094message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08003095 // The id that indicates the event reported from NetworkStack.
3096 optional int32 event_id = 1;
3097 // The data for the reported events.
Chiachang Wang4d6fe322019-03-21 20:40:01 +08003098 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
3099}
3100