Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | syntax = "proto2"; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 18 | |
| 19 | package android.os.statsd; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 20 | option java_package = "com.android.os"; |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 21 | option java_outer_classname = "AtomsProto"; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 22 | |
Yao Chen | 9c1debe | 2018-02-19 14:39:19 -0800 | [diff] [blame] | 23 | import "frameworks/base/cmds/statsd/src/atom_field_options.proto"; |
Bookatz | db026a2 | 2018-01-10 19:01:56 -0800 | [diff] [blame] | 24 | import "frameworks/base/core/proto/android/app/enums.proto"; |
Tej Singh | 33a412b | 2018-03-16 18:43:59 -0700 | [diff] [blame] | 25 | import "frameworks/base/core/proto/android/app/job/enums.proto"; |
Jack He | 924f346 | 2019-01-09 20:54:41 -0800 | [diff] [blame] | 26 | import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto"; |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 27 | import "frameworks/base/core/proto/android/bluetooth/enums.proto"; |
Jack He | 5226014 | 2018-12-18 15:43:27 -0800 | [diff] [blame] | 28 | import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto"; |
Jack He | 22e4a1d | 2019-01-09 01:19:13 -0800 | [diff] [blame] | 29 | import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto"; |
Jack He | 4d6abe6 | 2019-01-20 21:22:46 -0800 | [diff] [blame] | 30 | import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto"; |
Chiachang Wang | 67f2447 | 2019-01-15 15:14:00 +0800 | [diff] [blame] | 31 | import "frameworks/base/core/proto/android/net/networkcapabilities.proto"; |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 32 | import "frameworks/base/core/proto/android/os/enums.proto"; |
Chiachang Wang | 67f2447 | 2019-01-15 15:14:00 +0800 | [diff] [blame] | 33 | import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto"; |
Bookatz | 8bdae8d | 2018-01-16 11:24:30 -0800 | [diff] [blame] | 34 | import "frameworks/base/core/proto/android/server/enums.proto"; |
Yao Chen | 046b512 | 2018-10-24 14:09:20 -0700 | [diff] [blame] | 35 | import "frameworks/base/core/proto/android/stats/launcher/launcher.proto"; |
Tej Singh | c477d9c | 2018-02-05 18:31:39 -0800 | [diff] [blame] | 36 | import "frameworks/base/core/proto/android/telecomm/enums.proto"; |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 37 | import "frameworks/base/core/proto/android/telephony/enums.proto"; |
| 38 | import "frameworks/base/core/proto/android/view/enums.proto"; |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 39 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 40 | /** |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 41 | * The master atom class. This message defines all of the available |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 42 | * raw stats log events from the Android system, also known as "atoms." |
| 43 | * |
| 44 | * This field contains a single oneof with all of the available messages. |
| 45 | * The stats-log-api-gen tool runs as part of the Android build and |
| 46 | * generates the android.util.StatsLog class, which contains the constants |
| 47 | * and methods that Android uses to log. |
| 48 | * |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 49 | * This Atom class is not actually built into the Android system. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 50 | * Instead, statsd on Android constructs these messages synthetically, |
| 51 | * in the format defined here and in stats_log.proto. |
| 52 | */ |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 53 | message Atom { |
| 54 | // Pushed atoms start at 2. |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 55 | oneof pushed { |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 56 | // For StatsLog reasons, 1 is illegal and will not work. Must start at 2. |
| 57 | BleScanStateChanged ble_scan_state_changed = 2; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 58 | // 3 is available for use |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 59 | BleScanResultReceived ble_scan_result_received = 4; |
| 60 | SensorStateChanged sensor_state_changed = 5; |
Bookatz | db026a2 | 2018-01-10 19:01:56 -0800 | [diff] [blame] | 61 | GpsScanStateChanged gps_scan_state_changed = 6; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 62 | SyncStateChanged sync_state_changed = 7; |
| 63 | ScheduledJobStateChanged scheduled_job_state_changed = 8; |
| 64 | ScreenBrightnessChanged screen_brightness_changed = 9; |
Bookatz | d674624 | 2017-10-24 18:39:35 -0700 | [diff] [blame] | 65 | WakelockStateChanged wakelock_state_changed = 10; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 66 | LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11; |
| 67 | MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12; |
| 68 | WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13; |
Hyunyoung Song | cc651c1 | 2018-10-17 13:35:32 -0700 | [diff] [blame] | 69 | // 14 - 18 are available |
| 70 | LauncherUIChanged launcher_event = 19; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 71 | BatterySaverModeStateChanged battery_saver_mode_state_changed = 20; |
| 72 | DeviceIdleModeStateChanged device_idle_mode_state_changed = 21; |
| 73 | DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 74 | AudioStateChanged audio_state_changed = 23; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 75 | MediaCodecStateChanged media_codec_state_changed = 24; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 76 | CameraStateChanged camera_state_changed = 25; |
| 77 | FlashlightStateChanged flashlight_state_changed = 26; |
| 78 | UidProcessStateChanged uid_process_state_changed = 27; |
| 79 | ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28; |
| 80 | ScreenStateChanged screen_state_changed = 29; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 81 | BatteryLevelChanged battery_level_changed = 30; |
| 82 | ChargingStateChanged charging_state_changed = 31; |
| 83 | PluggedStateChanged plugged_state_changed = 32; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 84 | // 33 - 34 are available |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 85 | WakeupAlarmOccurred wakeup_alarm_occurred = 35; |
| 86 | KernelWakeupReported kernel_wakeup_reported = 36; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 87 | WifiLockStateChanged wifi_lock_state_changed = 37; |
| 88 | WifiSignalStrengthChanged wifi_signal_strength_changed = 38; |
| 89 | WifiScanStateChanged wifi_scan_state_changed = 39; |
| 90 | PhoneSignalStrengthChanged phone_signal_strength_changed = 40; |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 91 | SettingChanged setting_changed = 41; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 92 | ActivityForegroundStateChanged activity_foreground_state_changed = 42; |
David Chen | 2158296 | 2017-11-01 17:32:46 -0700 | [diff] [blame] | 93 | IsolatedUidChanged isolated_uid_changed = 43; |
Hugo Benichi | 884970e | 2017-11-14 22:42:46 +0900 | [diff] [blame] | 94 | PacketWakeupOccurred packet_wakeup_occurred = 44; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 95 | // 45 is available |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 96 | AnomalyDetected anomaly_detected = 46; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 97 | AppBreadcrumbReported app_breadcrumb_reported = 47; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 98 | AppStartOccurred app_start_occurred = 48; |
| 99 | AppStartCanceled app_start_canceled = 49; |
| 100 | AppStartFullyDrawn app_start_fully_drawn = 50; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 101 | LmkKillOccurred lmk_kill_occurred = 51; |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 102 | PictureInPictureStateChanged picture_in_picture_state_changed = 52; |
Tej Singh | 4503e10 | 2018-01-04 14:35:01 -0800 | [diff] [blame] | 103 | WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 104 | LmkStateChanged lmk_state_changed = 54; |
| 105 | AppStartMemoryStateCaptured app_start_memory_state_captured = 55; |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 106 | ShutdownSequenceReported shutdown_sequence_reported = 56; |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 107 | BootSequenceReported boot_sequence_reported = 57; |
Tej Singh | bb8554a | 2018-01-26 11:59:14 -0800 | [diff] [blame] | 108 | DaveyOccurred davey_occurred = 58; |
Chenjie Yu | e890419 | 2017-12-08 19:12:57 -0800 | [diff] [blame] | 109 | OverlayStateChanged overlay_state_changed = 59; |
Chenjie Yu | ccfe645 | 2018-01-30 11:33:21 -0800 | [diff] [blame] | 110 | ForegroundServiceStateChanged foreground_service_state_changed = 60; |
Tej Singh | c477d9c | 2018-02-05 18:31:39 -0800 | [diff] [blame] | 111 | CallStateChanged call_state_changed = 61; |
Tej Singh | dd7bd35 | 2018-02-09 19:33:15 -0800 | [diff] [blame] | 112 | KeyguardStateChanged keyguard_state_changed = 62; |
| 113 | KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63; |
| 114 | KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 115 | AppDied app_died = 65; |
Tej Singh | a883b37 | 2018-02-15 11:30:01 -0800 | [diff] [blame] | 116 | ResourceConfigurationChanged resource_configuration_changed = 66; |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 117 | BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67; |
| 118 | BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68; |
Tej Singh | 02200f9 | 2018-04-02 19:37:59 -0700 | [diff] [blame] | 119 | // 69 is blank but need not be. |
Andrew Chant | b56388b | 2018-03-22 21:07:33 -0700 | [diff] [blame] | 120 | UsbConnectorStateChanged usb_connector_state_changed = 70; |
Andrew Chant | 28d627e | 2018-02-22 15:17:05 -0800 | [diff] [blame] | 121 | SpeakerImpedanceReported speaker_impedance_reported = 71; |
| 122 | HardwareFailed hardware_failed = 72; |
| 123 | PhysicalDropDetected physical_drop_detected = 73; |
| 124 | ChargeCyclesReported charge_cycles_reported = 74; |
Tej Singh | eee317b | 2018-03-07 19:28:05 -0800 | [diff] [blame] | 125 | MobileConnectionStateChanged mobile_connection_state_changed = 75; |
| 126 | MobileRadioTechnologyChanged mobile_radio_technology_changed = 76; |
Andrew Chant | b56388b | 2018-03-22 21:07:33 -0700 | [diff] [blame] | 127 | UsbDeviceAttached usb_device_attached = 77; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 128 | AppCrashOccurred app_crash_occurred = 78; |
| 129 | ANROccurred anr_occurred = 79; |
| 130 | WTFOccurred wtf_occurred = 80; |
Yangster | 4ccebea | 2018-10-09 17:09:02 -0700 | [diff] [blame] | 131 | PhoneServiceStateChanged phone_service_state_changed = 94; |
| 132 | PhoneStateChanged phone_state_changed = 95; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 133 | LowMemReported low_mem_reported = 81; |
Chiachang Wang | 6936b956 | 2019-01-16 13:28:35 +0800 | [diff] [blame] | 134 | ThermalThrottlingStateChanged thermal_throttling = 86; |
lifr | 35a7cf0 | 2018-12-12 16:38:04 +0800 | [diff] [blame] | 135 | NetworkDnsEventReported network_dns_event_reported = 116; |
Chiachang Wang | 67f2447 | 2019-01-15 15:14:00 +0800 | [diff] [blame] | 136 | DataStallEvent data_stall_event = 121; |
Jack He | 5226014 | 2018-12-18 15:43:27 -0800 | [diff] [blame] | 137 | BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125; |
Jack He | 22e4a1d | 2019-01-09 01:19:13 -0800 | [diff] [blame] | 138 | BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126; |
| 139 | BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127; |
Jack Yu | 6d421bc | 2019-01-23 17:42:54 +0800 | [diff] [blame] | 140 | NfcErrorOccurred nfc_error_occurred = 134; |
| 141 | NfcStateChanged nfc_state_changed = 135; |
| 142 | NfcBeamOccurred nfc_beam_occurred = 136; |
| 143 | NfcCardemulationOccurred nfc_cardemulation_occurred = 137; |
| 144 | NfcTagOccurred nfc_tag_occurred = 138; |
| 145 | NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139; |
| 146 | SeStateChanged se_state_changed = 140; |
| 147 | SeOmapiReported se_omapi_reported = 141; |
Jack He | 924f346 | 2019-01-09 20:54:41 -0800 | [diff] [blame] | 148 | BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151; |
| 149 | BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152; |
| 150 | BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153; |
| 151 | BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154; |
| 152 | BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155; |
| 153 | BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156; |
| 154 | BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157; |
| 155 | BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158; |
| 156 | BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159; |
Jack He | 4d6abe6 | 2019-01-20 21:22:46 -0800 | [diff] [blame] | 157 | BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160; |
| 158 | BluetoothQualityReportReported bluetooth_quality_report_reported = 161; |
| 159 | BluetoothManufacturerInfoReported bluetooth_device_info_reported = 162; |
| 160 | BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163; |
| 161 | BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164; |
| 162 | BluetoothBondStateChanged bluetooth_bond_state_changed = 165; |
| 163 | BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166; |
| 164 | BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167; |
Jack He | 9c30c7c6b | 2019-01-30 17:24:55 -0800 | [diff] [blame] | 165 | BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 166 | } |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 167 | |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 168 | // Pulled events will start at field 10000. |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 169 | // Next: 10022 |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 170 | oneof pulled { |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 171 | WifiBytesTransfer wifi_bytes_transfer = 10000; |
| 172 | WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001; |
| 173 | MobileBytesTransfer mobile_bytes_transfer = 10002; |
| 174 | MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 175 | BluetoothBytesTransfer bluetooth_bytes_transfer = 10006; |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 176 | KernelWakelock kernel_wakelock = 10004; |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 177 | SubsystemSleepState subsystem_sleep_state = 10005; |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 178 | CpuTimePerFreq cpu_time_per_freq = 10008; |
| 179 | CpuTimePerUid cpu_time_per_uid = 10009; |
| 180 | CpuTimePerUidFreq cpu_time_per_uid_freq = 10010; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 181 | WifiActivityInfo wifi_activity_info = 10011; |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 182 | ModemActivityInfo modem_activity_info = 10012; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 183 | BluetoothActivityInfo bluetooth_activity_info = 10007; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 184 | ProcessMemoryState process_memory_state = 10013; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 185 | SystemElapsedRealtime system_elapsed_realtime = 10014; |
| 186 | SystemUptime system_uptime = 10015; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 187 | CpuActiveTime cpu_active_time = 10016; |
| 188 | CpuClusterTime cpu_cluster_time = 10017; |
Chenjie Yu | 937d742 | 2018-01-10 16:37:53 -0800 | [diff] [blame] | 189 | DiskSpace disk_space = 10018; |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 190 | RemainingBatteryCapacity remaining_battery_capacity = 10019; |
| 191 | FullBatteryCapacity full_battery_capacity = 10020; |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 192 | Temperature temperature = 10021; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 193 | } |
yro | a1fe77c | 2018-02-26 14:22:54 -0800 | [diff] [blame] | 194 | |
Bookatz | 76aafcf | 2018-09-17 16:17:10 -0700 | [diff] [blame] | 195 | // DO NOT USE field numbers above 100,000 in AOSP. |
| 196 | // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use. |
| 197 | // Field numbers 200,000 and above are reserved for future use; do not use them at all. |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 198 | } |
| 199 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 200 | /** |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 201 | * This proto represents a node of an attribution chain. |
| 202 | * Note: All attribution chains are represented as a repeated field of type |
| 203 | * AttributionNode. It is understood that in such arrays, the order is that |
| 204 | * of calls, that is [A, B, C] if A calls B that calls C. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 205 | */ |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 206 | message AttributionNode { |
| 207 | // The uid for a given element in the attribution chain. |
Yangster-mac | 7604aea | 2017-12-11 22:55:49 -0800 | [diff] [blame] | 208 | optional int32 uid = 1; |
Yangster-mac | 7604aea | 2017-12-11 22:55:49 -0800 | [diff] [blame] | 209 | |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 210 | // The (optional) string tag for an element in the attribution chain. If the |
| 211 | // element has no tag, it is encoded as an empty string. |
| 212 | optional string tag = 2; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 213 | } |
| 214 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 215 | /* |
| 216 | * ***************************************************************************** |
yro | de4ca10 | 2017-11-15 22:57:24 -0800 | [diff] [blame] | 217 | * Below are all of the individual atoms that are logged by Android via statsd. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 218 | * |
| 219 | * RULES: |
| 220 | * - The field ids for each atom must start at 1, and count upwards by 1. |
| 221 | * Skipping field ids is not allowed. |
| 222 | * - These form an API, so renaming, renumbering or removing fields is |
| 223 | * not allowed between android releases. (This is not currently enforced, |
| 224 | * but there will be a tool to enforce this restriction). |
| 225 | * - The types must be built-in protocol buffer types, namely, no sub-messages |
| 226 | * are allowed (yet). The bytes type is also not allowed. |
| 227 | * - The CamelCase name of the message type should match the |
Stefan Lafon | ae2df01 | 2017-11-14 09:17:21 -0800 | [diff] [blame] | 228 | * underscore_separated name as defined in Atom. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 229 | * - If an atom represents work that can be attributed to an app, there can |
Yangster-mac | 7604aea | 2017-12-11 22:55:49 -0800 | [diff] [blame] | 230 | * be exactly one AttributionChain field. It must be field number 1. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 231 | * - A field that is a uid should be a string field, tagged with the [xxx] |
| 232 | * annotation. The generated code on android will be represented by UIDs, |
| 233 | * and those UIDs will be translated in xxx to those strings. |
| 234 | * |
| 235 | * CONVENTIONS: |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 236 | * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 237 | * - If there is a UID, it goes first. Think in an object-oriented fashion. |
| 238 | * ***************************************************************************** |
| 239 | */ |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 240 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 241 | /** |
Yangster-mac | 80c4474 | 2018-08-26 12:20:16 -0700 | [diff] [blame] | 242 | * Logs when the Thermal service HAL notifies the throttling start/stop events. |
| 243 | * |
| 244 | * Logged from: |
| 245 | * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java |
| 246 | */ |
| 247 | message ThermalThrottlingStateChanged { |
| 248 | optional android.os.TemperatureTypeEnum sensor_type = 1; |
| 249 | |
| 250 | enum State { |
| 251 | UNKNOWN = 0; |
| 252 | START = 1; |
| 253 | STOP = 2; |
| 254 | } |
| 255 | |
| 256 | optional State state = 2; |
| 257 | |
| 258 | optional float temperature = 3; |
| 259 | } |
| 260 | |
| 261 | /** |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 262 | * Logs when the screen state changes. |
| 263 | * |
| 264 | * Logged from: |
| 265 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 266 | */ |
| 267 | message ScreenStateChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 268 | // New screen state, from frameworks/base/core/proto/android/view/enums.proto. |
Yao Chen | 9c1debe | 2018-02-19 14:39:19 -0800 | [diff] [blame] | 269 | optional android.view.DisplayStateEnum state = 1 [(stateFieldOption).option = EXCLUSIVE]; |
Stefan Lafon | cdb1a0e | 2017-09-27 20:24:15 -0700 | [diff] [blame] | 270 | } |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 271 | |
| 272 | /** |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 273 | * Logs that the state of a process state, as per the activity manager, has changed. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 274 | * |
| 275 | * Logged from: |
| 276 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 277 | */ |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 278 | message UidProcessStateChanged { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 279 | optional int32 uid = 1 [(stateFieldOption).option = PRIMARY, (is_uid) = true]; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 280 | |
Bookatz | db026a2 | 2018-01-10 19:01:56 -0800 | [diff] [blame] | 281 | // The state, from frameworks/base/core/proto/android/app/enums.proto. |
Yao Chen | 9c1debe | 2018-02-19 14:39:19 -0800 | [diff] [blame] | 282 | optional android.app.ProcessStateEnum state = 2 [(stateFieldOption).option = EXCLUSIVE]; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 283 | } |
| 284 | |
| 285 | /** |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 286 | * Logs that a process started, finished, crashed, or ANRed. |
| 287 | * |
| 288 | * Logged from: |
| 289 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 290 | */ |
| 291 | message ProcessLifeCycleStateChanged { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 292 | optional int32 uid = 1 [(is_uid) = true]; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 293 | |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 294 | // The process name (usually same as the app name). |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 295 | optional string process_name = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 296 | |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 297 | // What lifecycle state the process changed to. |
| 298 | // This enum is specific to atoms.proto. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 299 | enum State { |
| 300 | FINISHED = 0; |
| 301 | STARTED = 1; |
| 302 | CRASHED = 2; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 303 | } |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 304 | optional State state = 3; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 305 | } |
| 306 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 307 | /** |
| 308 | * Logs when the ble scan state changes. |
| 309 | * |
| 310 | * Logged from: |
Bookatz | 17a879d | 2018-03-28 15:05:28 -0700 | [diff] [blame] | 311 | * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 312 | */ |
| 313 | message BleScanStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 314 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 315 | |
| 316 | enum State { |
| 317 | OFF = 0; |
| 318 | ON = 1; |
Bookatz | e5ec0b4 | 2018-03-26 13:34:56 -0700 | [diff] [blame] | 319 | // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes). |
| 320 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 321 | } |
| 322 | optional State state = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 323 | |
Bookatz | e5ec0b4 | 2018-03-26 13:34:56 -0700 | [diff] [blame] | 324 | // Does the scan have a filter. |
| 325 | optional bool is_filtered = 3; |
| 326 | // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally. |
| 327 | optional bool is_first_match = 4; |
| 328 | // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC). |
| 329 | optional bool is_opportunistic = 5; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 330 | } |
| 331 | |
| 332 | /** |
| 333 | * Logs reporting of a ble scan finding results. |
| 334 | * |
| 335 | * Logged from: |
Bookatz | ae6738e | 2018-09-13 11:38:56 -0700 | [diff] [blame] | 336 | * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 337 | */ |
Bookatz | ae6738e | 2018-09-13 11:38:56 -0700 | [diff] [blame] | 338 | // TODO: Consider also tracking per-scanner-id. |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 339 | message BleScanResultReceived { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 340 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 341 | |
| 342 | // Number of ble scan results returned. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 343 | optional int32 num_results = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 344 | } |
| 345 | |
| 346 | /** |
| 347 | * Logs when a sensor state changes. |
| 348 | * |
| 349 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 350 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 351 | */ |
| 352 | message SensorStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 353 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 354 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 355 | // The id (int) of the sensor. |
| 356 | optional int32 sensor_id = 2; |
| 357 | |
| 358 | enum State { |
| 359 | OFF = 0; |
| 360 | ON = 1; |
| 361 | } |
| 362 | optional State state = 3; |
| 363 | } |
| 364 | |
| 365 | |
| 366 | /** |
| 367 | * Logs when GPS state changes. |
| 368 | * |
| 369 | * Logged from: |
| 370 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 371 | */ |
| 372 | message GpsScanStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 373 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 374 | |
| 375 | enum State { |
| 376 | OFF = 0; |
| 377 | ON = 1; |
| 378 | } |
| 379 | optional State state = 2; |
| 380 | } |
| 381 | |
| 382 | |
| 383 | /** |
| 384 | * Logs when a sync manager sync state changes. |
| 385 | * |
| 386 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 387 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 388 | */ |
| 389 | message SyncStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 390 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 391 | |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 392 | // Name of the sync (as named in the app). Can be chosen at run-time. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 393 | optional string sync_name = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 394 | |
| 395 | enum State { |
| 396 | OFF = 0; |
| 397 | ON = 1; |
| 398 | } |
| 399 | optional State state = 3; |
| 400 | } |
| 401 | |
| 402 | /** |
| 403 | * Logs when a job scheduler job state changes. |
| 404 | * |
| 405 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 406 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 407 | */ |
| 408 | message ScheduledJobStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 409 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 410 | |
| 411 | // Name of the job (as named in the app) |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 412 | optional string job_name = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 413 | |
| 414 | enum State { |
Tej Singh | d5747a6 | 2018-01-08 20:57:35 -0800 | [diff] [blame] | 415 | FINISHED = 0; |
| 416 | STARTED = 1; |
| 417 | SCHEDULED = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 418 | } |
| 419 | optional State state = 3; |
| 420 | |
Tej Singh | 33a412b | 2018-03-16 18:43:59 -0700 | [diff] [blame] | 421 | // The reason a job has stopped. |
| 422 | // This is only applicable when the state is FINISHED. |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 423 | // The default value is STOP_REASON_UNKNOWN. |
Tej Singh | 33a412b | 2018-03-16 18:43:59 -0700 | [diff] [blame] | 424 | optional android.app.job.StopReasonEnum stop_reason = 4; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 425 | } |
| 426 | |
| 427 | /** |
| 428 | * Logs when the audio state changes. |
| 429 | * |
| 430 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 431 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 432 | */ |
| 433 | message AudioStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 434 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 435 | |
| 436 | enum State { |
| 437 | OFF = 0; |
| 438 | ON = 1; |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 439 | // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes). |
| 440 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 441 | } |
| 442 | optional State state = 2; |
| 443 | } |
| 444 | |
| 445 | /** |
| 446 | * Logs when the video codec state changes. |
| 447 | * |
| 448 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 449 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 450 | */ |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 451 | message MediaCodecStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 452 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 453 | |
| 454 | enum State { |
| 455 | OFF = 0; |
| 456 | ON = 1; |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 457 | // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes). |
| 458 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 459 | } |
| 460 | optional State state = 2; |
| 461 | } |
| 462 | |
| 463 | /** |
| 464 | * Logs when the flashlight state changes. |
| 465 | * |
| 466 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 467 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 468 | */ |
| 469 | message FlashlightStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 470 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 471 | |
| 472 | enum State { |
| 473 | OFF = 0; |
| 474 | ON = 1; |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 475 | // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes). |
| 476 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 477 | } |
| 478 | optional State state = 2; |
| 479 | } |
| 480 | |
| 481 | /** |
| 482 | * Logs when the camera state changes. |
| 483 | * |
| 484 | * Logged from: |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 485 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 486 | */ |
| 487 | message CameraStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 488 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 489 | |
| 490 | enum State { |
| 491 | OFF = 0; |
| 492 | ON = 1; |
Bookatz | 235343d | 2018-03-26 13:03:50 -0700 | [diff] [blame] | 493 | // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes). |
| 494 | RESET = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 495 | } |
| 496 | optional State state = 2; |
| 497 | } |
| 498 | |
| 499 | /** |
| 500 | * Logs that the state of a wakelock (per app and per wakelock name) has changed. |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 501 | * |
| 502 | * Logged from: |
| 503 | * TODO |
| 504 | */ |
Bookatz | d674624 | 2017-10-24 18:39:35 -0700 | [diff] [blame] | 505 | message WakelockStateChanged { |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 506 | repeated AttributionNode attribution_node = 1; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 507 | |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 508 | // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock. |
| 509 | // From frameworks/base/core/proto/android/os/enums.proto. |
| 510 | optional android.os.WakeLockLevelEnum level = 2; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 511 | |
| 512 | // The wakelock tag (Called tag in the Java API, sometimes name elsewhere). |
| 513 | optional string tag = 3; |
| 514 | |
| 515 | enum State { |
Yangster-mac | cfdf3a4 | 2017-12-06 13:42:38 -0800 | [diff] [blame] | 516 | RELEASE = 0; |
| 517 | ACQUIRE = 1; |
| 518 | CHANGE_RELEASE = 2; |
| 519 | CHANGE_ACQUIRE = 3; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 520 | } |
| 521 | optional State state = 4; |
| 522 | } |
| 523 | |
| 524 | /** |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 525 | * Logs when a partial wakelock is considered 'long' (over 1 min). |
| 526 | * |
| 527 | * Logged from: |
| 528 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 529 | */ |
| 530 | message LongPartialWakelockStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 531 | repeated AttributionNode attribution_node = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 532 | |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 533 | // The wakelock tag (Called tag in the Java API, sometimes name elsewhere). |
| 534 | optional string tag = 2; |
| 535 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 536 | // TODO: I have no idea what this is. |
| 537 | optional string history_tag = 3; |
| 538 | |
| 539 | enum State { |
| 540 | OFF = 0; |
| 541 | ON = 1; |
| 542 | } |
| 543 | optional State state = 4; |
Yao Chen | d54f9dd | 2017-10-17 17:37:48 +0000 | [diff] [blame] | 544 | } |
| 545 | |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 546 | /** |
| 547 | * Logs Battery Saver state change. |
| 548 | * |
| 549 | * Logged from: |
| 550 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 551 | */ |
| 552 | message BatterySaverModeStateChanged { |
| 553 | enum State { |
| 554 | OFF = 0; |
| 555 | ON = 1; |
| 556 | } |
| 557 | optional State state = 1; |
| 558 | } |
| 559 | |
| 560 | /** |
| 561 | * Logs Doze mode state change. |
| 562 | * |
| 563 | * Logged from: |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 564 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 565 | */ |
| 566 | message DeviceIdleModeStateChanged { |
Bookatz | 8bdae8d | 2018-01-16 11:24:30 -0800 | [diff] [blame] | 567 | optional android.server.DeviceIdleModeEnum state = 1; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 568 | } |
| 569 | |
| 570 | |
| 571 | /** |
| 572 | * Logs state change of Doze mode including maintenance windows. |
| 573 | * |
| 574 | * Logged from: |
| 575 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 576 | */ |
| 577 | message DeviceIdlingModeStateChanged { |
Bookatz | 8bdae8d | 2018-01-16 11:24:30 -0800 | [diff] [blame] | 578 | optional android.server.DeviceIdleModeEnum state = 1; |
Bookatz | c1a050a | 2017-10-10 15:49:28 -0700 | [diff] [blame] | 579 | } |
| 580 | |
| 581 | /** |
| 582 | * Logs screen brightness level. |
| 583 | * |
| 584 | * Logged from: |
| 585 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 586 | */ |
| 587 | message ScreenBrightnessChanged { |
| 588 | // Screen brightness level. Should be in [-1, 255] according to PowerManager.java. |
| 589 | optional int32 level = 1; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 590 | } |
| 591 | |
| 592 | /** |
| 593 | * Logs battery level (percent full, from 0 to 100). |
| 594 | * |
| 595 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 596 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 597 | */ |
| 598 | message BatteryLevelChanged { |
| 599 | // Battery level. Should be in [0, 100]. |
| 600 | optional int32 battery_level = 1; |
| 601 | } |
| 602 | |
| 603 | /** |
| 604 | * Logs change in charging status of the device. |
| 605 | * |
| 606 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 607 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 608 | */ |
| 609 | message ChargingStateChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 610 | // State of the battery, from frameworks/base/core/proto/android/os/enums.proto. |
| 611 | optional android.os.BatteryStatusEnum state = 1; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 612 | } |
| 613 | |
| 614 | /** |
| 615 | * Logs whether the device is plugged in, and what power source it is using. |
| 616 | * |
| 617 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 618 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 619 | */ |
| 620 | message PluggedStateChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 621 | // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto. |
| 622 | optional android.os.BatteryPluggedStateEnum state = 1; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 623 | } |
| 624 | |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 625 | /** |
| 626 | * Logs when an app's wakeup alarm fires. |
| 627 | * |
| 628 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 629 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 630 | */ |
| 631 | message WakeupAlarmOccurred { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 632 | repeated AttributionNode attribution_node = 1; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 633 | |
| 634 | // Name of the wakeup alarm. |
| 635 | optional string tag = 2; |
| 636 | } |
| 637 | |
| 638 | /** |
| 639 | * Logs when an an app causes the mobile radio to change state. |
| 640 | * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio. |
| 641 | * |
| 642 | * Logged from: |
| 643 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 644 | */ |
| 645 | message MobileRadioPowerStateChanged { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 646 | repeated AttributionNode attribution_node = 1; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 647 | |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 648 | // Power state, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 649 | optional android.telephony.DataConnectionPowerStateEnum state = 2; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 650 | } |
| 651 | |
| 652 | /** |
| 653 | * Logs when an an app causes the wifi radio to change state. |
| 654 | * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio. |
| 655 | * |
| 656 | * Logged from: |
| 657 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 658 | */ |
| 659 | message WifiRadioPowerStateChanged { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 660 | repeated AttributionNode attribution_node = 1; |
Bookatz | ddccf0a | 2017-11-28 16:48:14 -0800 | [diff] [blame] | 661 | |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 662 | // Power state, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 663 | optional android.telephony.DataConnectionPowerStateEnum state = 2; |
Bookatz | 8c6571b | 2017-10-24 15:04:41 -0700 | [diff] [blame] | 664 | } |
| 665 | |
| 666 | /** |
| 667 | * Logs kernel wakeup reasons and aborts. |
| 668 | * |
| 669 | * Logged from: |
| 670 | * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java |
| 671 | */ |
| 672 | message KernelWakeupReported { |
| 673 | // Name of the kernel wakeup reason (or abort). |
| 674 | optional string wakeup_reason_name = 1; |
| 675 | |
| 676 | // Duration (in microseconds) for the wake-up interrupt to be serviced. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 677 | optional int64 duration_micros = 2; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 678 | } |
| 679 | |
| 680 | /** |
| 681 | * Logs wifi locks held by an app. |
| 682 | * |
| 683 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 684 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 685 | */ |
| 686 | message WifiLockStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 687 | repeated AttributionNode attribution_node = 1; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 688 | |
| 689 | enum State { |
| 690 | OFF = 0; |
| 691 | ON = 1; |
| 692 | } |
| 693 | optional State state = 2; |
| 694 | } |
| 695 | |
| 696 | /** |
| 697 | * Logs wifi signal strength changes. |
| 698 | * |
| 699 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 700 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 701 | */ |
| 702 | message WifiSignalStrengthChanged { |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 703 | // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 704 | optional android.telephony.SignalStrengthEnum signal_strength = 1; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 705 | } |
| 706 | |
| 707 | /** |
| 708 | * Logs wifi scans performed by an app. |
| 709 | * |
| 710 | * Logged from: |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 711 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 712 | */ |
| 713 | message WifiScanStateChanged { |
Yangster-mac | afad8c6 | 2018-01-05 22:30:49 -0800 | [diff] [blame] | 714 | repeated AttributionNode attribution_node = 1; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 715 | |
| 716 | enum State { |
| 717 | OFF = 0; |
| 718 | ON = 1; |
| 719 | } |
| 720 | optional State state = 2; |
| 721 | } |
| 722 | |
| 723 | /** |
Tej Singh | 4503e10 | 2018-01-04 14:35:01 -0800 | [diff] [blame] | 724 | * Logs wifi multicast locks held by an app |
| 725 | * |
| 726 | * Logged from: |
| 727 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 728 | */ |
| 729 | message WifiMulticastLockStateChanged { |
| 730 | repeated AttributionNode attribution_node = 1; |
| 731 | |
| 732 | enum State { |
| 733 | OFF = 0; |
| 734 | ON = 1; |
| 735 | } |
| 736 | optional State state = 2; |
| 737 | } |
| 738 | |
| 739 | /** |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 740 | * Logs shutdown reason and duration on next boot. |
| 741 | * |
| 742 | * Logged from: |
| 743 | * frameworks/base/core/java/com/android/server/BootReceiver.java |
| 744 | */ |
| 745 | message ShutdownSequenceReported { |
| 746 | // True if shutdown is for a reboot. Default: false if we do not know. |
| 747 | optional bool reboot = 1; |
| 748 | |
| 749 | // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>". |
| 750 | optional string reason = 2; |
| 751 | |
| 752 | // Beginning of shutdown time in ms using wall clock time since unix epoch. |
| 753 | // Default: 0 if no start time received. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 754 | optional int64 start_time_millis = 3; |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 755 | |
| 756 | // Duration of shutdown in ms. Default: 0 if no duration received. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 757 | optional int64 duration_millis = 4; |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 758 | } |
| 759 | |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 760 | |
| 761 | /** |
| 762 | * Logs boot reason and duration. |
| 763 | * |
| 764 | * Logged from: |
| 765 | * system/core/bootstat/bootstat.cpp |
| 766 | */ |
| 767 | message BootSequenceReported { |
| 768 | // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list |
| 769 | // Default: "<EMPTY>" if not available. |
| 770 | optional string bootloader_reason = 1; |
| 771 | |
| 772 | // Reason for system boot. Eg. bootloader, reboot,userrequested |
| 773 | // Default: "<EMPTY>" if not available. |
| 774 | optional string system_reason = 2; |
| 775 | |
| 776 | // End of boot time in ms from unix epoch using system wall clock. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 777 | optional int64 end_time_millis = 3; |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 778 | |
| 779 | // Total boot duration in ms. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 780 | optional int64 total_duration_millis = 4; |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 781 | |
| 782 | // Bootloader duration in ms. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 783 | optional int64 bootloader_duration_millis = 5; |
Tej Singh | 6483ea4 | 2018-01-25 17:45:49 -0800 | [diff] [blame] | 784 | |
| 785 | // Time since last boot in ms. Default: 0 if not available. |
| 786 | optional int64 time_since_last_boot = 6; |
| 787 | } |
| 788 | |
Tej Singh | c477d9c | 2018-02-05 18:31:39 -0800 | [diff] [blame] | 789 | |
| 790 | /** |
| 791 | * Logs call state and disconnect cause (if applicable). |
| 792 | * |
| 793 | * Logged from: |
| 794 | * packages/services/Telecomm/src/com/android/server/telecom/Call.java |
| 795 | */ |
| 796 | message CallStateChanged { |
| 797 | // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED. |
| 798 | // From frameworks/base/core/proto/android/telecomm/enums.proto. |
| 799 | optional android.telecom.CallStateEnum call_state = 1; |
| 800 | |
| 801 | // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY. |
| 802 | // This value is only applicable when the call_state is DISCONNECTED, and |
| 803 | // should always be UNKNOWN if the call_state is not DISCONNECTED. |
| 804 | // From frameworks/base/core/proto/android/telecomm/enums.proto. |
| 805 | optional android.telecom.DisconnectCauseEnum disconnect_cause = 2; |
| 806 | |
| 807 | // True if the call is self-managed, which are apps that use the |
| 808 | // telecom infrastructure to make their own calls. |
| 809 | optional bool self_managed = 3; |
| 810 | |
| 811 | // True if call is external. External calls are calls on connected Wear |
| 812 | // devices but show up in Telecom so the user can pull them onto the device. |
| 813 | optional bool external_call = 4; |
| 814 | } |
| 815 | |
Tej Singh | 1ea4289 | 2018-01-19 09:27:00 -0800 | [diff] [blame] | 816 | /** |
Tej Singh | dd7bd35 | 2018-02-09 19:33:15 -0800 | [diff] [blame] | 817 | * Logs keyguard state. The keyguard is the lock screen. |
| 818 | * |
| 819 | * Logged from: |
| 820 | * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java |
| 821 | */ |
| 822 | message KeyguardStateChanged { |
| 823 | enum State { |
| 824 | UNKNOWN = 0; |
| 825 | // The keyguard is hidden when the phone is unlocked. |
| 826 | HIDDEN = 1; |
| 827 | // The keyguard is shown when the phone is locked (screen turns off). |
| 828 | SHOWN= 2; |
| 829 | // The keyguard is occluded when something is overlaying the keyguard. |
| 830 | // Eg. Opening the camera while on the lock screen. |
| 831 | OCCLUDED = 3; |
| 832 | } |
| 833 | optional State state = 1; |
| 834 | } |
| 835 | |
| 836 | /** |
| 837 | * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and |
| 838 | * prompts the user to enter a password (pattern, pin, etc). |
| 839 | * |
| 840 | * Logged from: |
| 841 | * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java |
| 842 | */ |
| 843 | |
| 844 | message KeyguardBouncerStateChanged { |
| 845 | enum State { |
| 846 | UNKNOWN = 0; |
| 847 | // Bouncer is hidden, either as a result of successfully entering the |
| 848 | // password, screen timing out, or user going back to lock screen. |
| 849 | HIDDEN = 1; |
| 850 | // This is when the user is being prompted to enter the password. |
| 851 | SHOWN = 2; |
| 852 | } |
| 853 | optional State state = 1; |
| 854 | } |
| 855 | |
| 856 | /** |
| 857 | * Logs the result of entering a password into the keyguard bouncer. |
| 858 | * |
| 859 | * Logged from: |
| 860 | * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java |
| 861 | */ |
| 862 | message KeyguardBouncerPasswordEntered { |
| 863 | enum BouncerResult { |
| 864 | UNKNOWN = 0; |
| 865 | // The password entered was incorrect. |
| 866 | FAILURE = 1; |
| 867 | // The password entered was correct. |
| 868 | SUCCESS = 2; |
| 869 | } |
| 870 | optional BouncerResult result = 1; |
| 871 | } |
| 872 | |
Tej Singh | a883b37 | 2018-02-15 11:30:01 -0800 | [diff] [blame] | 873 | /* |
| 874 | * Logs changes to the configuration of the device. The configuration is defined |
| 875 | * in frameworks/base/core/java/android/content/res/Configuration.java |
| 876 | * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html |
| 877 | * Please go there to interpret the possible values each field can be. |
| 878 | * |
| 879 | * Logged from: |
| 880 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 881 | */ |
| 882 | message ResourceConfigurationChanged { |
| 883 | // Bit mask of color capabilities of the screen. |
| 884 | // Contains information about the color gamut and hdr mode of the screen. |
| 885 | // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode |
| 886 | optional int32 colorMode = 1; |
| 887 | |
| 888 | // The target screen density being rendered to. |
| 889 | // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi |
| 890 | optional int32 densityDpi = 2; |
| 891 | |
| 892 | // Current user preference for the scaling factor for fonts, |
| 893 | // relative to the base density scaling. |
| 894 | // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale |
| 895 | optional float fontScale = 3; |
| 896 | |
| 897 | // Flag indicating whether the hard keyboard is hidden. |
| 898 | // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden |
| 899 | optional int32 hardKeyboardHidden = 4; |
| 900 | |
| 901 | // The type of keyboard attached to the device. |
| 902 | // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard |
| 903 | optional int32 keyboard = 5; |
| 904 | |
| 905 | // Flag indicating whether any keyboard is available. Takes soft keyboards into account. |
| 906 | // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden |
| 907 | optional int32 keyboardHideen = 6; |
| 908 | |
| 909 | // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier. |
| 910 | // 0 if undefined. |
| 911 | // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc |
| 912 | optional int32 mcc = 7; |
| 913 | |
| 914 | // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier. |
| 915 | // 0 if undefined. Note: the actual MNC may be 0, to check for this use the |
| 916 | // MNC_ZERO symbol defined in Configuration.java. |
| 917 | // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc |
| 918 | optional int32 mnc = 8; |
| 919 | |
| 920 | // The kind of navigation available on the device. |
| 921 | // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation |
| 922 | optional int32 navigation = 9; |
| 923 | |
| 924 | // Flag indicating whether the navigation is available. |
| 925 | // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden |
| 926 | optional int32 navigationHidden = 10; |
| 927 | |
| 928 | // Overall orientation of the screen. |
| 929 | // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation |
| 930 | optional int32 orientation = 11; |
| 931 | |
| 932 | // The current height of the available screen space, in dp units. |
| 933 | // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp |
| 934 | optional int32 screenHeightDp = 12; |
| 935 | |
| 936 | // Bit mask of overall layout of the screen. |
| 937 | // Contains information about screen size, whether the screen is wider/taller |
| 938 | // than normal, whether the screen layout is right-tl-left or left-to-right, |
| 939 | // and whether the screen has a rounded shape. |
| 940 | // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout |
| 941 | optional int32 screenLayout = 13; |
| 942 | |
| 943 | // Current width of the available screen space, in dp units. |
| 944 | // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp |
| 945 | optional int32 screenWidthDp = 14; |
| 946 | |
| 947 | // The smallest screen size an application will see in normal operation. |
| 948 | // This is the smallest value of both screenWidthDp and screenHeightDp |
| 949 | // in portrait and landscape. |
| 950 | // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp |
| 951 | optional int32 smallestScreenWidthDp = 15; |
| 952 | |
| 953 | // The type of touch screen attached to the device. |
| 954 | // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen |
| 955 | optional int32 touchscreen = 16; |
| 956 | |
| 957 | // Bit mask of the ui mode. |
| 958 | // Contains information about the overall ui mode of the device. |
| 959 | // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET |
| 960 | // Also contains information about whether the device is in night mode. |
| 961 | // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode |
| 962 | optional int32 uiMode = 17; |
| 963 | } |
| 964 | |
Tej Singh | eee317b | 2018-03-07 19:28:05 -0800 | [diff] [blame] | 965 | |
| 966 | /** |
| 967 | * Logs changes in the connection state of the mobile radio. |
| 968 | * |
| 969 | * Logged from: |
| 970 | * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java |
| 971 | */ |
| 972 | message MobileConnectionStateChanged { |
| 973 | // States are from the state machine DataConnection.java. |
| 974 | enum State { |
| 975 | UNKNOWN = 0; |
| 976 | // The connection is inactive, or disconnected. |
| 977 | INACTIVE = 1; |
| 978 | // The connection is being activated, or connecting. |
| 979 | ACTIVATING = 2; |
| 980 | // The connection is active, or connected. |
| 981 | ACTIVE = 3; |
| 982 | // The connection is disconnecting. |
| 983 | DISCONNECTING = 4; |
| 984 | // The connection is disconnecting after creating a connection. |
| 985 | DISCONNECTION_ERROR_CREATING_CONNECTION = 5; |
| 986 | } |
| 987 | optional State state = 1; |
| 988 | // For multi-sim phones, this distinguishes between the sim cards. |
| 989 | optional int32 sim_slot_index = 2; |
| 990 | // Used to identify the connection. Starts at 0 and increments by 1 for |
| 991 | // every new network created. Resets whenever the device reboots. |
| 992 | optional int32 data_connection_id = 3; |
| 993 | // A bitmask for the capabilities of this connection. |
| 994 | // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS. |
| 995 | // Default value (if we have no information): 0 |
| 996 | optional int64 capabilities = 4; |
| 997 | // If this connection has internet. |
| 998 | // This just checks if the DEFAULT bit of capabilities is set. |
| 999 | optional bool has_internet = 5; |
| 1000 | } |
| 1001 | |
| 1002 | /** |
| 1003 | * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA. |
| 1004 | * |
| 1005 | * Logged from: |
| 1006 | * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java |
| 1007 | */ |
| 1008 | message MobileRadioTechnologyChanged { |
| 1009 | optional android.telephony.NetworkTypeEnum state = 1; |
| 1010 | // For multi-sim phones, this distinguishes between the sim cards. |
| 1011 | optional int32 sim_slot_index = 2; |
| 1012 | } |
| 1013 | |
Andrew Chant | b56388b | 2018-03-22 21:07:33 -0700 | [diff] [blame] | 1014 | /** |
| 1015 | * Logs the VID and PID of any connected USB devices. |
| 1016 | * |
| 1017 | * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present. |
| 1018 | * |
| 1019 | * Logged by Vendor. |
| 1020 | */ |
| 1021 | message UsbDeviceAttached { |
| 1022 | optional int32 vid = 1; |
| 1023 | optional int32 pid = 2; |
| 1024 | optional bool has_audio = 3; |
| 1025 | optional bool has_hid = 4; |
| 1026 | optional bool has_storage = 5; |
| 1027 | } |
| 1028 | |
Tej Singh | eee317b | 2018-03-07 19:28:05 -0800 | [diff] [blame] | 1029 | |
Tej Singh | dd7bd35 | 2018-02-09 19:33:15 -0800 | [diff] [blame] | 1030 | /** |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 1031 | * Logs when Bluetooth is enabled and disabled. |
| 1032 | * |
| 1033 | * Logged from: |
| 1034 | * services/core/java/com/android/server/BluetoothManagerService.java |
| 1035 | */ |
| 1036 | message BluetoothEnabledStateChanged { |
| 1037 | repeated AttributionNode attribution_node = 1; |
| 1038 | // Whether or not bluetooth is enabled on the device. |
| 1039 | enum State { |
| 1040 | UNKNOWN = 0; |
| 1041 | ENABLED = 1; |
| 1042 | DISABLED = 2; |
| 1043 | } |
| 1044 | optional State state = 2; |
| 1045 | // The reason for being enabled/disabled. |
| 1046 | // Eg. Airplane mode, crash, application request. |
| 1047 | optional android.bluetooth.EnableDisableReasonEnum reason = 3; |
| 1048 | // If the reason is an application request, this will be the package name. |
| 1049 | optional string pkgName = 4; |
| 1050 | } |
| 1051 | |
| 1052 | /** |
Jack He | 22e4a1d | 2019-01-09 01:19:13 -0800 | [diff] [blame] | 1053 | * Logs when profiles on a Bluetooth device connects and disconnects. |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 1054 | * |
| 1055 | * Logged from: |
Jack He | 22e4a1d | 2019-01-09 01:19:13 -0800 | [diff] [blame] | 1056 | * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java |
| 1057 | * |
| 1058 | * Next Tag: 5 |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 1059 | */ |
| 1060 | message BluetoothConnectionStateChanged { |
| 1061 | // The state of the connection. |
| 1062 | // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED. |
| 1063 | optional android.bluetooth.ConnectionStateEnum state = 1; |
| 1064 | // An identifier that can be used to match connect and disconnect events. |
| 1065 | // Currently is last two bytes of a hash of a device level ID and |
| 1066 | // the mac address of the bluetooth device that is connected. |
Jack He | 22e4a1d | 2019-01-09 01:19:13 -0800 | [diff] [blame] | 1067 | // Deprecated: use obfuscated_id instead, this one is always 0 for Q+ |
| 1068 | optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true]; |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 1069 | // The profile that is connected. Eg. GATT, A2DP, HEADSET. |
| 1070 | // From android.bluetooth.BluetoothAdapter.java |
Jack He | 22e4a1d | 2019-01-09 01:19:13 -0800 | [diff] [blame] | 1071 | // Default: 0 when not used |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 1072 | optional int32 bt_profile = 3; |
Jack He | 22e4a1d | 2019-01-09 01:19:13 -0800 | [diff] [blame] | 1073 | // An identifier that can be used to match events for this device. |
| 1074 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1075 | // Salt: Randomly generated 256 bit value |
| 1076 | // Hash algorithm: HMAC-SHA256 |
| 1077 | // Size: 32 byte |
| 1078 | // Default: null or empty if the device identifier is not known |
| 1079 | optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1080 | } |
| 1081 | |
| 1082 | /** |
| 1083 | * Logs when a Bluetooth device connects and disconnects over ACL |
| 1084 | * |
| 1085 | * Logged from: |
| 1086 | * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java |
| 1087 | * |
| 1088 | * Next Tag: 3 |
| 1089 | */ |
| 1090 | message BluetoothAclConnectionStateChanged { |
| 1091 | // An identifier that can be used to match events for this device. |
| 1092 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1093 | // Salt: Randomly generated 256 bit value |
| 1094 | // Hash algorithm: HMAC-SHA256 |
| 1095 | // Size: 32 byte |
| 1096 | // Default: null or empty if the device identifier is not known |
| 1097 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1098 | // The state of the connection. |
| 1099 | // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED. |
| 1100 | optional android.bluetooth.ConnectionStateEnum state = 2; |
| 1101 | } |
| 1102 | |
| 1103 | /** |
| 1104 | * Logs when a Bluetooth device connects and disconnects over SCO |
| 1105 | * |
| 1106 | * Logged from: |
| 1107 | * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java |
| 1108 | * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java |
| 1109 | * |
| 1110 | * Next Tag: 4 |
| 1111 | */ |
| 1112 | message BluetoothScoConnectionStateChanged { |
| 1113 | // An identifier that can be used to match events for this device. |
| 1114 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1115 | // Salt: Randomly generated 256 bit value |
| 1116 | // Hash algorithm: HMAC-SHA256 |
| 1117 | // Size: 32 byte |
| 1118 | // Default: null or empty if the device identifier is not known |
| 1119 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1120 | // The state of the connection. |
| 1121 | // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED. |
| 1122 | optional android.bluetooth.ConnectionStateEnum state = 2; |
| 1123 | // Codec used for this SCO connection |
| 1124 | // Default: UNKNOWN |
| 1125 | optional android.bluetooth.hfp.ScoCodec codec = 3; |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 1126 | } |
| 1127 | |
Jack He | 924f346 | 2019-01-09 20:54:41 -0800 | [diff] [blame] | 1128 | /** |
| 1129 | * Logged when active device of a profile changes |
| 1130 | * |
| 1131 | * Logged from: |
| 1132 | * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java |
| 1133 | * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java |
| 1134 | * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java |
| 1135 | */ |
| 1136 | message BluetoothActiveDeviceChanged { |
| 1137 | // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID |
| 1138 | // From android.bluetooth.BluetoothProfile |
| 1139 | optional int32 bt_profile = 1; |
| 1140 | // An identifier that can be used to match events for this new active device. |
| 1141 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1142 | // Salt: Randomly generated 256 bit value |
| 1143 | // Hash algorithm: HMAC-SHA256 |
| 1144 | // Size: 32 byte |
| 1145 | // Default: null or empty if there is no active device for this profile |
| 1146 | optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1147 | } |
| 1148 | |
Jack He | 5226014 | 2018-12-18 15:43:27 -0800 | [diff] [blame] | 1149 | // Logs when there is an event affecting Bluetooth device's link layer connection. |
| 1150 | // - This event is triggered when there is a related HCI command or event |
| 1151 | // - Users of this metrics can deduce Bluetooth device's connection state from these events |
| 1152 | // - HCI commands are logged before the command is sent, after receiving command status, and after |
| 1153 | // receiving command complete |
| 1154 | // - HCI events are logged when they arrive |
| 1155 | // |
| 1156 | // Low level log from system/bt |
| 1157 | // |
| 1158 | // Bluetooth classic commands: |
| 1159 | // - CMD_CREATE_CONNECTION |
| 1160 | // - CMD_DISCONNECT |
| 1161 | // - CMD_CREATE_CONNECTION_CANCEL |
| 1162 | // - CMD_ACCEPT_CONNECTION_REQUEST |
| 1163 | // - CMD_REJECT_CONNECTION_REQUEST |
| 1164 | // - CMD_SETUP_ESCO_CONNECTION |
| 1165 | // - CMD_ACCEPT_ESCO_CONNECTION |
| 1166 | // - CMD_REJECT_ESCO_CONNECTION |
| 1167 | // - CMD_ENH_SETUP_ESCO_CONNECTION |
| 1168 | // - CMD_ENH_ACCEPT_ESCO_CONNECTION |
| 1169 | // |
| 1170 | // Bluetooth low energy commands: |
| 1171 | // - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00] |
| 1172 | // - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error] |
| 1173 | // - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00] |
| 1174 | // - CMD_BLE_CLEAR_WHITE_LIST |
| 1175 | // - CMD_BLE_ADD_WHITE_LIST |
| 1176 | // - CMD_BLE_REMOVE_WHITE_LIST |
| 1177 | // |
| 1178 | // Bluetooth classic events: |
| 1179 | // - EVT_CONNECTION_COMP |
| 1180 | // - EVT_CONNECTION_REQUEST |
| 1181 | // - EVT_DISCONNECTION_COMP |
| 1182 | // - EVT_ESCO_CONNECTION_COMP |
| 1183 | // - EVT_ESCO_CONNECTION_CHANGED |
| 1184 | // |
| 1185 | // Bluetooth low energy meta events: |
| 1186 | // - BLE_EVT_CONN_COMPLETE_EVT |
| 1187 | // - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT |
| 1188 | // |
| 1189 | // Next tag: 10 |
| 1190 | message BluetoothLinkLayerConnectionEvent { |
| 1191 | // An identifier that can be used to match events for this device. |
| 1192 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1193 | // Salt: Randomly generated 256 bit value |
| 1194 | // Hash algorithm: HMAC-SHA256 |
| 1195 | // Size: 32 byte |
| 1196 | // Default: null or empty if the device identifier is not known |
| 1197 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1198 | // Connection handle of this connection if available |
| 1199 | // Range: 0x0000 - 0x0EFF (12 bits) |
| 1200 | // Default: 0xFFFF if the handle is unknown |
| 1201 | optional int32 connection_handle = 2; |
| 1202 | // Direction of the link |
| 1203 | // Default: DIRECTION_UNKNOWN |
| 1204 | optional android.bluetooth.DirectionEnum direction = 3; |
| 1205 | // Type of this link |
| 1206 | // Default: LINK_TYPE_UNKNOWN |
| 1207 | optional android.bluetooth.LinkTypeEnum type = 4; |
| 1208 | |
| 1209 | // Reason metadata for this link layer connection event, rules for interpretation: |
| 1210 | // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or |
| 1211 | // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case |
| 1212 | // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is |
| 1213 | // set and valid, ignore hci_ble_event |
| 1214 | |
| 1215 | // HCI command associated with this event |
| 1216 | // Default: CMD_UNKNOWN |
| 1217 | optional android.bluetooth.hci.CommandEnum hci_cmd = 5; |
| 1218 | // HCI event associated with this event |
| 1219 | // Default: EVT_UNKNOWN |
| 1220 | optional android.bluetooth.hci.EventEnum hci_event = 6; |
| 1221 | // HCI BLE meta event associated with this event |
| 1222 | // Default: BLE_EVT_UNKNOWN |
| 1223 | optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7; |
| 1224 | // HCI command status code if this is triggerred by hci_cmd |
| 1225 | // Default: STATUS_UNKNOWN |
| 1226 | optional android.bluetooth.hci.StatusEnum cmd_status = 8; |
| 1227 | // HCI reason code associated with this event |
| 1228 | // Default: STATUS_UNKNOWN |
| 1229 | optional android.bluetooth.hci.StatusEnum reason_code = 9; |
| 1230 | } |
| 1231 | |
Jack He | 924f346 | 2019-01-09 20:54:41 -0800 | [diff] [blame] | 1232 | /** |
| 1233 | * Logs when there is a change in Bluetooth A2DP playback state |
| 1234 | * |
| 1235 | * Logged from: |
| 1236 | * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java |
| 1237 | */ |
| 1238 | message BluetoothA2dpPlaybackStateChanged { |
| 1239 | // An identifier that can be used to match events for this device. |
| 1240 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1241 | // Salt: Randomly generated 256 bit value |
| 1242 | // Hash algorithm: HMAC-SHA256 |
| 1243 | // Size: 32 byte |
| 1244 | // Default: null or empty if the device identifier is not known |
| 1245 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1246 | // Current playback state |
| 1247 | // Default: PLAYBACK_STATE_UNKNOWN |
| 1248 | optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2; |
| 1249 | // Current audio coding mode |
| 1250 | // Default: AUDIO_CODING_MODE_UNKNOWN |
| 1251 | optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3; |
| 1252 | } |
| 1253 | |
| 1254 | /** |
| 1255 | * Logs when there is a change in A2DP codec config for a particular remote device |
| 1256 | * |
| 1257 | * Logged from: |
| 1258 | * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java |
| 1259 | * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java |
| 1260 | */ |
| 1261 | message BluetoothA2dpCodecConfigChanged { |
| 1262 | // An identifier that can be used to match events for this device. |
| 1263 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1264 | // Salt: Randomly generated 256 bit value |
| 1265 | // Hash algorithm: HMAC-SHA256 |
| 1266 | // Size: 32 byte |
| 1267 | // Default: null or empty if the device identifier is not known |
| 1268 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1269 | // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig |
| 1270 | // Default SOURCE_CODEC_TYPE_INVALID |
| 1271 | optional int32 codec_type = 2; |
| 1272 | // Codec priroity, the higher the more preferred, -1 for disabled |
| 1273 | // Default: CODEC_PRIORITY_DEFAULT |
| 1274 | optional int32 codec_priority = 3; |
| 1275 | // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig |
| 1276 | // Default: SAMPLE_RATE_NONE |
| 1277 | optional int32 sample_rate = 4; |
| 1278 | // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig |
| 1279 | // Default: BITS_PER_SAMPLE_NONE |
| 1280 | optional int32 bits_per_sample = 5; |
| 1281 | // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig |
| 1282 | // Default: CHANNEL_MODE_NONE |
| 1283 | optional int32 channel_mode = 6; |
| 1284 | // Codec specific values |
| 1285 | // Default 0 |
| 1286 | optional int64 codec_specific_1 = 7; |
| 1287 | optional int64 codec_specific_2 = 8; |
| 1288 | optional int64 codec_specific_3 = 9; |
| 1289 | optional int64 codec_specific_4 = 10; |
| 1290 | } |
| 1291 | |
| 1292 | /** |
| 1293 | * Logs when there is a change in selectable A2DP codec capability for a paricular remote device |
| 1294 | * Each codec's capability is logged separately due to statsd restriction |
| 1295 | * |
| 1296 | * Logged from: |
| 1297 | * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java |
| 1298 | * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java |
| 1299 | */ |
| 1300 | message BluetoothA2dpCodecCapabilityChanged { |
| 1301 | // An identifier that can be used to match events for this device. |
| 1302 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1303 | // Salt: Randomly generated 256 bit value |
| 1304 | // Hash algorithm: HMAC-SHA256 |
| 1305 | // Size: 32 byte |
| 1306 | // Default: null or empty if the device identifier is not known |
| 1307 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1308 | // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig |
| 1309 | // Default SOURCE_CODEC_TYPE_INVALID |
| 1310 | optional int32 codec_type = 2; |
| 1311 | // Codec priroity, the higher the more preferred, -1 for disabled |
| 1312 | // Default: CODEC_PRIORITY_DEFAULT |
| 1313 | optional int32 codec_priority = 3; |
| 1314 | // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants |
| 1315 | // in BluetoothCodecConfig |
| 1316 | // Default: empty and SAMPLE_RATE_NONE for individual item |
| 1317 | optional int32 sample_rate = 4; |
| 1318 | // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants |
| 1319 | // in BluetoothCodecConfig |
| 1320 | // Default: empty and BITS_PER_SAMPLE_NONE for individual item |
| 1321 | optional int32 bits_per_sample = 5; |
| 1322 | // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in |
| 1323 | // BluetoothCodecConfig |
| 1324 | // Default: empty and CHANNEL_MODE_NONE for individual item |
| 1325 | optional int32 channel_mode = 6; |
| 1326 | // Codec specific values |
| 1327 | // Default 0 |
| 1328 | optional int64 codec_specific_1 = 7; |
| 1329 | optional int64 codec_specific_2 = 8; |
| 1330 | optional int64 codec_specific_3 = 9; |
| 1331 | optional int64 codec_specific_4 = 10; |
| 1332 | } |
| 1333 | |
| 1334 | /** |
| 1335 | * Logs when A2DP failed to read from PCM source. |
| 1336 | * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding. |
| 1337 | * |
| 1338 | * Logged from: |
| 1339 | * system/bt |
| 1340 | */ |
| 1341 | message BluetoothA2dpAudioUnderrunReported { |
| 1342 | // An identifier that can be used to match events for this device. |
| 1343 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1344 | // Salt: Randomly generated 256 bit value |
| 1345 | // Hash algorithm: HMAC-SHA256 |
| 1346 | // Size: 32 byte |
| 1347 | // Default: null or empty if the device identifier is not known |
| 1348 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1349 | // Encoding interval in nanoseconds |
| 1350 | // Default: 0 |
| 1351 | optional int64 encoding_interval_nanos = 2; |
| 1352 | // Number of bytes of PCM data that could not be read from the source |
| 1353 | // Default: 0 |
| 1354 | optional int32 num_missing_pcm_bytes = 3; |
| 1355 | } |
| 1356 | |
| 1357 | /** |
| 1358 | * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit |
| 1359 | * buffer queue is full and we have to drop data |
| 1360 | * |
| 1361 | * Logged from: |
| 1362 | * system/bt |
| 1363 | */ |
| 1364 | message BluetoothA2dpAudioOverrunReported { |
| 1365 | // An identifier that can be used to match events for this device. |
| 1366 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1367 | // Salt: Randomly generated 256 bit value |
| 1368 | // Hash algorithm: HMAC-SHA256 |
| 1369 | // Size: 32 byte |
| 1370 | // Default: null or empty if the device identifier is not known |
| 1371 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1372 | // Encoding interval in nanoseconds |
| 1373 | // Default: 0 |
| 1374 | optional int64 encoding_interval_nanos = 2; |
| 1375 | // Number of buffers dropped in this event |
| 1376 | // Each buffer is encoded in one encoding interval and consists of multiple encoded frames |
| 1377 | // Default: 0 |
| 1378 | optional int32 num_dropped_buffers = 3; |
| 1379 | // Number of encoded buffers dropped in this event |
| 1380 | // Default 0 |
| 1381 | optional int32 num_dropped_encoded_frames = 4; |
| 1382 | // Number of encoded bytes dropped in this event |
| 1383 | // Default: 0 |
| 1384 | optional int32 num_dropped_encoded_bytes = 5; |
| 1385 | } |
| 1386 | |
| 1387 | /** |
| 1388 | * Logs when we receive reports regarding a device's RSSI value |
| 1389 | * |
| 1390 | * Logged from: |
| 1391 | * system/bt |
| 1392 | */ |
| 1393 | message BluetoothDeviceRssiReported { |
| 1394 | // An identifier that can be used to match events for this device. |
| 1395 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1396 | // Salt: Randomly generated 256 bit value |
| 1397 | // Hash algorithm: HMAC-SHA256 |
| 1398 | // Size: 32 byte |
| 1399 | // Default: null or empty if the device identifier is not known |
| 1400 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1401 | // Connection handle of this connection if available |
| 1402 | // Range: 0x0000 - 0x0EFF (12 bits) |
| 1403 | // Default: 0xFFFF if the handle is unknown |
| 1404 | optional int32 connection_handle = 2; |
| 1405 | // HCI command status code if this is triggerred by hci_cmd |
| 1406 | // Default: STATUS_UNKNOWN |
| 1407 | optional android.bluetooth.hci.StatusEnum hci_status = 3; |
| 1408 | // BR/EDR |
| 1409 | // Range: -128 ≤ N ≤ 127 (signed integer) |
| 1410 | // Units: dB |
| 1411 | // LE: |
| 1412 | // Range: -127 to 20, 127 (signed integer) |
| 1413 | // Units: dBm |
| 1414 | // Invalid when an out of range value is reported |
| 1415 | optional int32 rssi = 4; |
| 1416 | } |
| 1417 | |
| 1418 | /** |
| 1419 | * Logs when we receive reports regarding how many consecutive failed contacts for a connection |
| 1420 | * |
| 1421 | * Logged from: |
| 1422 | * system/bt |
| 1423 | */ |
| 1424 | message BluetoothDeviceFailedContactCounterReported { |
| 1425 | // An identifier that can be used to match events for this device. |
| 1426 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1427 | // Salt: Randomly generated 256 bit value |
| 1428 | // Hash algorithm: HMAC-SHA256 |
| 1429 | // Size: 32 byte |
| 1430 | // Default: null or empty if the device identifier is not known |
| 1431 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1432 | // Connection handle of this connection if available |
| 1433 | // Range: 0x0000 - 0x0EFF (12 bits) |
| 1434 | // Default: 0xFFFF if the handle is unknown |
| 1435 | optional int32 connection_handle = 2; |
| 1436 | // HCI command status code if this is triggerred by hci_cmd |
| 1437 | // Default: STATUS_UNKNOWN |
| 1438 | optional android.bluetooth.hci.StatusEnum cmd_status = 3; |
| 1439 | // Number of consecutive failed contacts for a connection corresponding to the Handle |
| 1440 | // Range: uint16_t, 0-0xFFFF |
| 1441 | // Default: 0xFFFFF |
| 1442 | optional int32 failed_contact_counter = 4; |
| 1443 | } |
| 1444 | |
| 1445 | /** |
| 1446 | * Logs when we receive reports regarding the tranmit power level used for a specific connection |
| 1447 | * |
| 1448 | * Logged from: |
| 1449 | * system/bt |
| 1450 | */ |
| 1451 | message BluetoothDeviceTxPowerLevelReported { |
| 1452 | // An identifier that can be used to match events for this device. |
| 1453 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1454 | // Salt: Randomly generated 256 bit value |
| 1455 | // Hash algorithm: HMAC-SHA256 |
| 1456 | // Size: 32 byte |
| 1457 | // Default: null or empty if the device identifier is not known |
| 1458 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1459 | // Connection handle of this connection if available |
| 1460 | // Range: 0x0000 - 0x0EFF (12 bits) |
| 1461 | // Default: 0xFFFF if the handle is unknown |
| 1462 | optional int32 connection_handle = 2; |
Jack He | 4d6abe6 | 2019-01-20 21:22:46 -0800 | [diff] [blame] | 1463 | // HCI command status code if this is triggered by hci_cmd |
Jack He | 924f346 | 2019-01-09 20:54:41 -0800 | [diff] [blame] | 1464 | // Default: STATUS_UNKNOWN |
| 1465 | optional android.bluetooth.hci.StatusEnum hci_status = 3; |
| 1466 | // Range: -30 ≤ N ≤ 20 |
| 1467 | // Units: dBm |
| 1468 | // Invalid when an out of range value is reported |
| 1469 | optional int32 transmit_power_level = 4; |
| 1470 | } |
Jack He | 5226014 | 2018-12-18 15:43:27 -0800 | [diff] [blame] | 1471 | |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 1472 | /** |
Jack He | 4d6abe6 | 2019-01-20 21:22:46 -0800 | [diff] [blame] | 1473 | * Logs when Bluetooth controller failed to reply with command status within a timeout period after |
| 1474 | * receiving an HCI command from the host |
| 1475 | * |
| 1476 | * Logged from: system/bt |
| 1477 | */ |
| 1478 | message BluetoothHciTimeoutReported { |
| 1479 | // HCI command associated with this event |
| 1480 | // Default: CMD_UNKNOWN |
| 1481 | optional android.bluetooth.hci.CommandEnum hci_command = 1; |
| 1482 | } |
| 1483 | |
| 1484 | /** |
| 1485 | * Logs when we receive Bluetooth Link Quality Report event from the controller |
| 1486 | * See Android Bluetooth HCI specification for more details |
| 1487 | * |
| 1488 | * Note: all count and bytes field are counted since last event |
| 1489 | * |
| 1490 | * Logged from: system/bt |
| 1491 | */ |
| 1492 | message BluetoothQualityReportReported { |
| 1493 | // Quality report ID |
| 1494 | // Original type: uint8_t |
| 1495 | // Default: BQR_ID_UNKNOWN |
| 1496 | optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1; |
| 1497 | // Packet type of the connection |
| 1498 | // Original type: uint8_t |
| 1499 | // Default: BQR_PACKET_TYPE_UNKNOWN |
| 1500 | optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2; |
| 1501 | // Connection handle of the connection |
| 1502 | // Original type: uint16_t |
| 1503 | optional int32 connection_handle = 3; |
| 1504 | // Performing Role for the connection |
| 1505 | // Original type: uint8_t |
| 1506 | optional int32 connection_role = 4; |
| 1507 | // Current Transmit Power Level for the connection. This value is the same as the controller's |
| 1508 | // response to the HCI_Read_Transmit_Power_Level HCI command |
| 1509 | // Original type: uint8_t |
| 1510 | optional int32 tx_power_level = 5; |
| 1511 | // Received Signal Strength Indication (RSSI) value for the connection. This value is an |
| 1512 | // absolute receiver signal strength value |
| 1513 | // Original type: int8_t |
| 1514 | optional int32 rssi = 6; |
| 1515 | // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the |
| 1516 | // channels used by the link currently |
| 1517 | // Original type: uint8_t |
| 1518 | optional int32 snr = 7; |
| 1519 | // Indicates the number of unused channels in AFH_channel_map |
| 1520 | // Original type: uint8_t |
| 1521 | optional int32 unused_afh_channel_count = 8; |
| 1522 | // Indicates the number of the channels which are interfered and quality is bad but are still |
| 1523 | // selected for AFH |
| 1524 | // Original type: uint8_t |
| 1525 | optional int32 afh_select_unideal_channel_count = 9; |
| 1526 | // Current Link Supervision Timeout Setting |
| 1527 | // Unit: N * 0.3125 ms (1 Bluetooth Clock) |
| 1528 | // Original type: uint16_t |
| 1529 | optional int32 lsto = 10; |
| 1530 | // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's |
| 1531 | // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of |
| 1532 | // 0x01 (Piconet Clock) |
| 1533 | // Unit: N * 0.3125 ms (1 Bluetooth Clock) |
| 1534 | // Original type: uint32_t |
| 1535 | optional int64 connection_piconet_clock = 11; |
| 1536 | // The count of retransmission |
| 1537 | // Original type: uint32_t |
| 1538 | optional int64 retransmission_count = 12; |
| 1539 | // The count of no RX |
| 1540 | // Original type: uint32_t |
| 1541 | optional int64 no_rx_count = 13; |
| 1542 | // The count of NAK (Negative Acknowledge) |
| 1543 | // Original type: uint32_t |
| 1544 | optional int64 nak_count = 14; |
| 1545 | // Controller timestamp of last TX ACK |
| 1546 | // Unit: N * 0.3125 ms (1 Bluetooth Clock) |
| 1547 | // Original type: uint32_t |
| 1548 | optional int64 last_tx_ack_timestamp = 15; |
| 1549 | // The count of Flow-off (STOP) |
| 1550 | // Original type: uint32_t |
| 1551 | optional int64 flow_off_count = 16; |
| 1552 | // Controller timestamp of last Flow-on (GO) |
| 1553 | // Unit: N * 0.3125 ms (1 Bluetooth Clock) |
| 1554 | // Original type: uint32_t |
| 1555 | optional int64 last_flow_on_timestamp = 17; |
| 1556 | // Buffer overflow count (how many bytes of TX data are dropped) since the last event |
| 1557 | // Original type: uint32_t |
| 1558 | optional int64 buffer_overflow_bytes = 18; |
| 1559 | // Buffer underflow count (in byte) since last event |
| 1560 | // Original type: uint32_t |
| 1561 | optional int64 buffer_underflow_bytes = 19; |
| 1562 | } |
| 1563 | |
| 1564 | /** |
| 1565 | * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack |
| 1566 | * |
| 1567 | * Notes: |
| 1568 | * - Each event can be partially filled as we might learn different pieces of device |
| 1569 | * information at different time |
| 1570 | * - Multiple device info events can be combined to give more complete picture |
| 1571 | * - When multiple device info events tries to describe the same information, the |
| 1572 | * later one wins |
| 1573 | * |
| 1574 | * Logged from: |
| 1575 | * packages/apps/Bluetooth |
| 1576 | */ |
| 1577 | message BluetoothManufacturerInfoReported { |
| 1578 | // An identifier that can be used to match events for this device. |
| 1579 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1580 | // Salt: Randomly generated 256 bit value |
| 1581 | // Hash algorithm: HMAC-SHA256 |
| 1582 | // Size: 32 byte |
| 1583 | // Default: null or empty if the device identifier is not known |
| 1584 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1585 | // Where is this device info obtained from |
| 1586 | optional android.bluetooth.DeviceInfoSrcEnum source_type = 2; |
| 1587 | // Name of the data source |
| 1588 | // For EXTERNAL: package name of the data source |
| 1589 | // For INTERNAL: null for general case, component name otherwise |
| 1590 | optional string source_name = 3; |
| 1591 | // Name of the manufacturer of this device |
| 1592 | optional string manufacturer = 4; |
| 1593 | // Model of this device |
| 1594 | optional string model = 5; |
| 1595 | // Hardware version of this device |
| 1596 | optional string hardware_version = 6; |
| 1597 | // Software version of this device |
| 1598 | optional string software_version = 7; |
| 1599 | } |
| 1600 | |
| 1601 | /** |
| 1602 | * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote |
| 1603 | * device, as documented by the Bluetooth Core HCI specification |
| 1604 | * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification |
| 1605 | * Vol 2, Part E, Page 1118 |
| 1606 | * |
| 1607 | * Logged from: |
| 1608 | * system/bt |
| 1609 | */ |
| 1610 | message BluetoothRemoteVersionInfoReported { |
| 1611 | // Connection handle of the connection |
| 1612 | // Original type: uint16_t |
| 1613 | optional int32 connection_handle = 1; |
| 1614 | // HCI command status code |
| 1615 | // Default: STATUS_UNKNOWN |
| 1616 | optional android.bluetooth.hci.StatusEnum hci_status = 2; |
| 1617 | // 1 byte Version of current LMP in the remote controller |
| 1618 | optional int32 lmp_version = 3; |
| 1619 | // 2 bytes LMP manufacturer code of the remote controller |
| 1620 | // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers |
| 1621 | optional int32 lmp_manufacturer_code = 4; |
| 1622 | // 4 bytes subversion of the LMP in the remote controller |
| 1623 | optional int32 lmp_subversion = 5; |
| 1624 | } |
| 1625 | |
| 1626 | /** |
| 1627 | * Logs when certain Bluetooth SDP attributes are discovered |
| 1628 | * Constant definitions are from: |
| 1629 | * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery |
| 1630 | * |
| 1631 | * Current logged attributes: |
| 1632 | * - BluetoothProfileDescriptorList |
| 1633 | * - Supported Features Bitmask |
| 1634 | * |
| 1635 | * Logged from: |
| 1636 | * system/bt |
| 1637 | */ |
| 1638 | message BluetoothSdpAttributeReported { |
| 1639 | // An identifier that can be used to match events for this device. |
| 1640 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1641 | // Salt: Randomly generated 256 bit value |
| 1642 | // Hash algorithm: HMAC-SHA256 |
| 1643 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1644 | // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes |
| 1645 | // Original type: uint16_t |
| 1646 | optional int32 protocol_uuid = 2; |
| 1647 | // Short form UUIDs used to identify Bluetooth SDP attribute types |
| 1648 | // Original type: uint16_t |
| 1649 | optional int32 attribute_id = 3; |
| 1650 | // Attribute value for the particular attribute |
| 1651 | optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1652 | } |
| 1653 | |
| 1654 | /** |
| 1655 | * Logs when bond state of a Bluetooth device changes |
| 1656 | * |
| 1657 | * Logged from: |
| 1658 | * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java |
| 1659 | * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java |
| 1660 | */ |
| 1661 | message BluetoothBondStateChanged { |
| 1662 | // An identifier that can be used to match events for this device. |
| 1663 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1664 | // Salt: Randomly generated 256 bit value |
| 1665 | // Hash algorithm: HMAC-SHA256 |
| 1666 | // Size: 32 byte |
| 1667 | // Default: null or empty if the device identifier is not known |
| 1668 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1669 | // Preferred transport type to remote dual mode device |
| 1670 | // Default: TRANSPORT_AUTO means no preference |
| 1671 | optional android.bluetooth.TransportTypeEnum transport = 2; |
| 1672 | // The type of this Bluetooth device (Classic, LE, or Dual mode) |
| 1673 | // Default: UNKNOWN |
| 1674 | optional android.bluetooth.DeviceTypeEnum type = 3; |
| 1675 | // Current bond state (NONE, BONDING, BONDED) |
| 1676 | // Default: BOND_STATE_UNKNOWN |
| 1677 | optional android.bluetooth.BondStateEnum bond_state = 4; |
| 1678 | // Bonding sub state |
| 1679 | // Default: BOND_SUB_STATE_UNKNOWN |
| 1680 | optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5; |
| 1681 | // Unbond Reason |
| 1682 | // Default: UNBOND_REASON_UNKNOWN |
| 1683 | optional android.bluetooth.UnbondReasonEnum unbond_reason = 6; |
| 1684 | } |
| 1685 | |
| 1686 | /** |
| 1687 | * Logs there is an event related Bluetooth classic pairing |
| 1688 | * |
| 1689 | * Logged from: |
| 1690 | * system/bt |
| 1691 | */ |
| 1692 | message BluetoothClassicPairingEventReported { |
| 1693 | // An identifier that can be used to match events for this device. |
| 1694 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1695 | // Salt: Randomly generated 256 bit value |
| 1696 | // Hash algorithm: HMAC-SHA256 |
| 1697 | // Size: 32 byte |
| 1698 | // Default: null or empty if the device identifier is not known |
| 1699 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1700 | // Connection handle of this connection if available |
| 1701 | // Range: 0x0000 - 0x0EFF (12 bits) |
| 1702 | // Default: 0xFFFF if the handle is unknown |
| 1703 | optional int32 connection_handle = 2; |
| 1704 | // HCI command associated with this event |
| 1705 | // Default: CMD_UNKNOWN |
| 1706 | optional android.bluetooth.hci.CommandEnum hci_cmd = 3; |
| 1707 | // HCI event associated with this event |
| 1708 | // Default: EVT_UNKNOWN |
| 1709 | optional android.bluetooth.hci.EventEnum hci_event = 4; |
| 1710 | // HCI command status code if this is triggerred by hci_cmd |
| 1711 | // Default: STATUS_UNKNOWN |
| 1712 | optional android.bluetooth.hci.StatusEnum cmd_status = 5; |
| 1713 | // HCI reason code associated with this event |
| 1714 | // Default: STATUS_UNKNOWN |
| 1715 | optional android.bluetooth.hci.StatusEnum reason_code = 6; |
| 1716 | } |
| 1717 | |
| 1718 | /** |
| 1719 | * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP) |
| 1720 | * |
| 1721 | * Logged from: |
| 1722 | * system/bt |
| 1723 | */ |
| 1724 | message BluetoothSmpPairingEventReported { |
| 1725 | // An identifier that can be used to match events for this device. |
| 1726 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1727 | // Salt: Randomly generated 256 bit value |
| 1728 | // Hash algorithm: HMAC-SHA256 |
| 1729 | // Size: 32 byte |
| 1730 | // Default: null or empty if the device identifier is not known |
| 1731 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
| 1732 | // SMP command sent or received over L2CAP |
| 1733 | // Default: CMD_UNKNOWN |
| 1734 | optional android.bluetooth.smp.CommandEnum smp_command = 2; |
| 1735 | // Whether this command is sent or received |
| 1736 | // Default: DIRECTION_UNKNOWN |
| 1737 | optional android.bluetooth.DirectionEnum direction = 3; |
| 1738 | // SMP failure reason code |
| 1739 | // Default: PAIRING_FAIL_REASON_DEFAULT |
| 1740 | optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4; |
| 1741 | } |
Andrew Chant | 28d627e | 2018-02-22 15:17:05 -0800 | [diff] [blame] | 1742 | |
Tej Singh | 5d991e1 | 2018-03-09 19:48:11 -0800 | [diff] [blame] | 1743 | /** |
Jack He | 9c30c7c6b | 2019-01-30 17:24:55 -0800 | [diff] [blame] | 1744 | * Logs when a Bluetooth socket’s connection state changed |
| 1745 | * |
| 1746 | * Logged from: |
| 1747 | * system/bt |
| 1748 | */ |
| 1749 | message BluetoothSocketConnectionStateChanged { |
| 1750 | // An identifier that can be used to match events for this device. |
| 1751 | // Currently, this is a salted hash of the MAC address of this Bluetooth device. |
| 1752 | // Salt: Randomly generated 256 bit value |
| 1753 | // Hash algorithm: HMAC-SHA256 |
| 1754 | // Size: 32 byte |
Jack He | e4ae0e7 | 2019-02-07 13:52:45 -0800 | [diff] [blame] | 1755 | // Default: null or empty if this is a server listener socket |
Jack He | 9c30c7c6b | 2019-01-30 17:24:55 -0800 | [diff] [blame] | 1756 | optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES]; |
Jack He | e4ae0e7 | 2019-02-07 13:52:45 -0800 | [diff] [blame] | 1757 | // Temporary port of this socket for the current connection or session only |
Jack He | 9c30c7c6b | 2019-01-30 17:24:55 -0800 | [diff] [blame] | 1758 | // Default 0 when unknown or don't care |
| 1759 | optional int32 port = 2; |
| 1760 | // Socket type as mentioned in |
| 1761 | // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java |
| 1762 | // Default: SOCKET_TYPE_UNKNOWN |
| 1763 | optional android.bluetooth.SocketTypeEnum type = 3; |
| 1764 | // Socket connection state |
| 1765 | // Default: SOCKET_CONNECTION_STATE_UNKNOWN |
| 1766 | optional android.bluetooth.SocketConnectionstateEnum state = 4; |
| 1767 | // Number of bytes sent to remote device during this connection |
| 1768 | optional int64 tx_bytes = 5; |
| 1769 | // Number of bytes received from remote device during this connection |
| 1770 | optional int64 rx_bytes = 6; |
Jack He | e4ae0e7 | 2019-02-07 13:52:45 -0800 | [diff] [blame] | 1771 | // Socket owner's UID |
| 1772 | optional int32 uid = 7 [(is_uid) = true]; |
| 1773 | // Server port of this socket, if any. When both |server_port| and |port| fields are populated, |
| 1774 | // |port| must be spawned by |server_port| |
| 1775 | // Default 0 when unknown or don't care |
| 1776 | optional int32 server_port = 8; |
| 1777 | // Whether this is a server listener socket |
| 1778 | optional android.bluetooth.SocketRoleEnum is_server = 9; |
Jack He | 9c30c7c6b | 2019-01-30 17:24:55 -0800 | [diff] [blame] | 1779 | } |
| 1780 | |
| 1781 | /** |
Andrew Chant | 28d627e | 2018-02-22 15:17:05 -0800 | [diff] [blame] | 1782 | * Logs when something is plugged into or removed from the USB-C connector. |
| 1783 | * |
| 1784 | * Logged from: |
| 1785 | * Vendor USB HAL. |
| 1786 | */ |
| 1787 | message UsbConnectorStateChanged { |
| 1788 | enum State { |
| 1789 | DISCONNECTED = 0; |
| 1790 | CONNECTED = 1; |
| 1791 | } |
| 1792 | optional State state = 1; |
| 1793 | } |
| 1794 | |
| 1795 | /** |
| 1796 | * Logs the reported speaker impedance. |
| 1797 | * |
| 1798 | * Logged from: |
| 1799 | * Vendor audio implementation. |
| 1800 | */ |
| 1801 | message SpeakerImpedanceReported { |
| 1802 | optional int32 speaker_location = 1; |
| 1803 | optional int32 impedance = 2; |
| 1804 | } |
| 1805 | |
| 1806 | /** |
| 1807 | * Logs the report of a failed hardware. |
| 1808 | * |
| 1809 | * Logged from: |
| 1810 | * Vendor HALs. |
| 1811 | * |
| 1812 | */ |
| 1813 | message HardwareFailed { |
| 1814 | enum HardwareType { |
| 1815 | HARDWARE_FAILED_UNKNOWN = 0; |
| 1816 | HARDWARE_FAILED_MICROPHONE = 1; |
| 1817 | HARDWARE_FAILED_CODEC = 2; |
| 1818 | HARDWARE_FAILED_SPEAKER = 3; |
| 1819 | HARDWARE_FAILED_FINGERPRINT = 4; |
| 1820 | } |
| 1821 | optional HardwareType hardware_type = 1; |
| 1822 | |
| 1823 | /* hardware_location allows vendors to differentiate between multiple instances of |
| 1824 | * the same hardware_type. The specific locations are vendor defined integers, |
| 1825 | * referring to board-specific numbering schemes. |
| 1826 | */ |
| 1827 | optional int32 hardware_location = 2; |
| 1828 | |
| 1829 | /* failure_code is specific to the HardwareType of the failed hardware. |
| 1830 | * It should use the enum values defined below. |
| 1831 | */ |
| 1832 | enum MicrophoneFailureCode { |
| 1833 | MICROPHONE_FAILURE_COMPLETE = 0; |
| 1834 | } |
| 1835 | enum CodecFailureCode { |
| 1836 | CODEC_FAILURE_COMPLETE = 0; |
| 1837 | } |
| 1838 | enum SpeakerFailureCode { |
| 1839 | SPEAKER_FAILURE_COMPLETE = 0; |
| 1840 | SPEAKER_FAILURE_HIGH_Z = 1; |
| 1841 | SPEAKER_FAILURE_SHORT = 2; |
| 1842 | } |
| 1843 | enum FingerprintFailureCode { |
| 1844 | FINGERPRINT_FAILURE_COMPLETE = 0; |
| 1845 | FINGERPRINT_SENSOR_BROKEN = 1; |
| 1846 | FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2; |
| 1847 | } |
| 1848 | optional int32 failure_code = 3; |
| 1849 | } |
| 1850 | |
| 1851 | /** |
| 1852 | * Log an event when the device has been physically dropped. |
| 1853 | * Reported from the /vendor partition. |
| 1854 | */ |
| 1855 | message PhysicalDropDetected { |
| 1856 | // Confidence that the event was actually a drop, 0 -> 100 |
| 1857 | optional int32 confidence_pctg = 1; |
| 1858 | // Peak acceleration of the drop, in 1/1000s of a g. |
| 1859 | optional int32 accel_peak_thousandths_g = 2; |
| 1860 | // Duration of freefall in ms |
| 1861 | optional int32 freefall_time_millis = 3; |
| 1862 | } |
| 1863 | |
| 1864 | /** |
| 1865 | * Log bucketed battery charge cycles. |
| 1866 | * |
| 1867 | * Each bucket represents cycles of the battery past |
Tej Singh | bb8554a | 2018-01-26 11:59:14 -0800 | [diff] [blame] | 1868 | * a given charge point. For example, bucket 1 is the |
| 1869 | * lowest 1/8th of the battery, and bucket 8 is 100%. |
| 1870 | * |
| 1871 | * Logged from: |
| 1872 | * /sys/class/power_supply/bms/cycle_count, via Vendor. |
| 1873 | */ |
David Chen | 77ef671 | 2018-02-23 18:23:42 -0800 | [diff] [blame] | 1874 | message ChargeCyclesReported { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1875 | optional int32 cycle_bucket_1 = 1; |
| 1876 | optional int32 cycle_bucket_2 = 2; |
David Chen | 77ef671 | 2018-02-23 18:23:42 -0800 | [diff] [blame] | 1877 | optional int32 cycle_bucket_3 = 3; |
Tej Singh | bb8554a | 2018-01-26 11:59:14 -0800 | [diff] [blame] | 1878 | optional int32 cycle_bucket_4 = 4; |
David Chen | 77ef671 | 2018-02-23 18:23:42 -0800 | [diff] [blame] | 1879 | optional int32 cycle_bucket_5 = 5; |
Tej Singh | bb8554a | 2018-01-26 11:59:14 -0800 | [diff] [blame] | 1880 | optional int32 cycle_bucket_6 = 6; |
| 1881 | optional int32 cycle_bucket_7 = 7; |
| 1882 | optional int32 cycle_bucket_8 = 8; |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 1883 | } |
| 1884 | |
| 1885 | /** |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1886 | * Logs the duration of a davey (jank of >=700ms) when it occurs |
Bookatz | e588524 | 2017-10-24 20:10:31 -0700 | [diff] [blame] | 1887 | * |
| 1888 | * Logged from: |
Bookatz | 1a1b046 | 2018-01-12 11:47:03 -0800 | [diff] [blame] | 1889 | * frameworks/base/libs/hwui/JankTracker.cpp |
| 1890 | */ |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1891 | message DaveyOccurred { |
| 1892 | // The UID that logged this atom. |
| 1893 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1894 | |
| 1895 | // Amount of time it took to render the frame. Should be >=700ms. |
| 1896 | optional int64 jank_duration_millis = 2; |
| 1897 | } |
| 1898 | |
| 1899 | /** |
| 1900 | * Logs phone signal strength changes. |
| 1901 | * |
| 1902 | * Logged from: |
| 1903 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 1904 | */ |
| 1905 | message PhoneSignalStrengthChanged { |
| 1906 | // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto. |
| 1907 | optional android.telephony.SignalStrengthEnum signal_strength = 1; |
| 1908 | } |
| 1909 | |
Yangster | 4ccebea | 2018-10-09 17:09:02 -0700 | [diff] [blame] | 1910 | |
| 1911 | /** |
| 1912 | * Logs when the phone state, sim state or signal strength changes |
| 1913 | * |
| 1914 | * Logged from: |
| 1915 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 1916 | */ |
| 1917 | message PhoneServiceStateChanged { |
| 1918 | optional android.telephony.ServiceStateEnum state = 1; |
| 1919 | optional android.telephony.SimStateEnum sim_state = 2; |
| 1920 | optional android.telephony.SignalStrengthEnum signal_strength = 3; |
| 1921 | } |
| 1922 | |
| 1923 | /** |
| 1924 | * Logs when the phone becomes on or off. |
| 1925 | * |
| 1926 | * Logged from: |
| 1927 | * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java |
| 1928 | */ |
| 1929 | message PhoneStateChanged { |
| 1930 | enum State { |
| 1931 | OFF = 0; |
| 1932 | ON = 1; |
| 1933 | } |
| 1934 | optional State state = 1; |
| 1935 | } |
| 1936 | |
Hyunyoung Song | cc651c1 | 2018-10-17 13:35:32 -0700 | [diff] [blame] | 1937 | message LauncherUIChanged { |
Yao Chen | 046b512 | 2018-10-24 14:09:20 -0700 | [diff] [blame] | 1938 | optional android.stats.launcher.LauncherAction action = 1; |
| 1939 | optional android.stats.launcher.LauncherState src_state = 2; |
| 1940 | optional android.stats.launcher.LauncherState dst_state = 3; |
| 1941 | optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES]; |
Hyunyoung Song | cc651c1 | 2018-10-17 13:35:32 -0700 | [diff] [blame] | 1942 | optional bool is_swipe_up_enabled = 5; |
| 1943 | } |
| 1944 | |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1945 | /** |
| 1946 | * Logs that a setting was updated. |
| 1947 | * Logged from: |
David Chen | bd78991 | 2018-03-16 17:19:55 -0700 | [diff] [blame] | 1948 | * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1949 | * The tag and is_default allow resetting of settings to default values based on the specified |
| 1950 | * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details. |
| 1951 | */ |
| 1952 | message SettingChanged { |
| 1953 | // The name of the setting. |
| 1954 | optional string setting = 1; |
| 1955 | |
| 1956 | // The change being imposed on this setting. May represent a number, eg "3". |
| 1957 | optional string value = 2; |
| 1958 | |
| 1959 | // The new value of this setting. For most settings, this is same as value. For some settings, |
| 1960 | // value is +X or -X where X represents an element in a set. For example, if the previous value |
| 1961 | // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C. |
| 1962 | // The +/- feature is currently only used for location_providers_allowed. |
| 1963 | optional string new_value = 3; |
| 1964 | |
| 1965 | // The previous value of this setting. |
| 1966 | optional string prev_value = 4; |
| 1967 | |
| 1968 | // The tag used with the is_default for resetting sets of settings. This is generally null. |
| 1969 | optional string tag = 5; |
| 1970 | |
Bookatz | 9086762 | 2018-01-31 15:05:57 -0800 | [diff] [blame] | 1971 | // True if this setting with tag should be resettable. |
| 1972 | optional bool is_default = 6; |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1973 | |
David Chen | bd78991 | 2018-03-16 17:19:55 -0700 | [diff] [blame] | 1974 | // The associated user (for multi-user feature). Defined in android/os/UserHandle.java |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1975 | optional int32 user = 7; |
David Chen | bd78991 | 2018-03-16 17:19:55 -0700 | [diff] [blame] | 1976 | |
| 1977 | enum ChangeReason { |
| 1978 | UPDATED = 1; // Updated can be an insertion or an update. |
| 1979 | DELETED = 2; |
| 1980 | } |
| 1981 | optional ChangeReason reason = 8; |
David Chen | c28b2bb | 2017-10-24 12:52:52 -0700 | [diff] [blame] | 1982 | } |
Chenjie Yu | b3dda41 | 2017-10-24 13:41:59 -0700 | [diff] [blame] | 1983 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 1984 | /** |
Chenjie Yu | 3d4f604 | 2017-10-27 15:39:34 -0700 | [diff] [blame] | 1985 | * Logs activity going to foreground or background |
| 1986 | * |
| 1987 | * Logged from: |
| 1988 | * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java |
| 1989 | */ |
| 1990 | message ActivityForegroundStateChanged { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 1991 | optional int32 uid = 1 [(is_uid) = true]; |
Yangster-mac | 2087716 | 2017-12-22 17:19:39 -0800 | [diff] [blame] | 1992 | optional string pkg_name = 2; |
| 1993 | optional string class_name = 3; |
| 1994 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1995 | enum State { |
| 1996 | BACKGROUND = 0; |
| 1997 | FOREGROUND = 1; |
Chenjie Yu | 3d4f604 | 2017-10-27 15:39:34 -0700 | [diff] [blame] | 1998 | } |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 1999 | optional State state = 4; |
Chenjie Yu | 3d4f604 | 2017-10-27 15:39:34 -0700 | [diff] [blame] | 2000 | } |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2001 | |
| 2002 | /** |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2003 | * Logs when an app crashes. |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 2004 | * Logged from: |
| 2005 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 2006 | */ |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2007 | message AppCrashOccurred { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2008 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 2009 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2010 | optional string event_type = 2; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 2011 | |
| 2012 | // The name of the process. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2013 | // system_server if it is not by an app |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 2014 | optional string process_name = 3; |
| 2015 | |
| 2016 | // The pid if available. -1 means not available. |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 2017 | optional sint32 pid = 4; |
Chenjie Yu | f17bf62 | 2018-04-02 14:22:19 -0700 | [diff] [blame] | 2018 | |
| 2019 | optional string package_name = 5; |
| 2020 | |
| 2021 | enum InstantApp { |
| 2022 | UNAVAILABLE = 0; |
| 2023 | FALSE = 1; |
| 2024 | TRUE = 2; |
| 2025 | } |
| 2026 | optional InstantApp is_instant_app = 6; |
| 2027 | |
| 2028 | enum ForegroundState { |
| 2029 | UNKNOWN = 0; |
| 2030 | BACKGROUND = 1; |
| 2031 | FOREGROUND = 2; |
| 2032 | } |
| 2033 | optional ForegroundState foreground_state = 7; |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2034 | } |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 2035 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2036 | /** |
| 2037 | * Logs when a WTF (What a Terrible Failure) happened. |
| 2038 | * Logged from: |
| 2039 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 2040 | */ |
| 2041 | message WTFOccurred { |
| 2042 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 2043 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2044 | optional string tag = 2; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 2045 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2046 | // The name of the process. |
| 2047 | // system_server if it is not by an app |
| 2048 | optional string process_name = 3; |
David Chen | 6e3e6cb | 2018-01-03 16:14:06 -0800 | [diff] [blame] | 2049 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2050 | // The pid if available. -1 means not available. |
| 2051 | optional sint32 pid = 4; |
| 2052 | } |
| 2053 | |
| 2054 | /** |
| 2055 | * Logs when system server reports low memory. |
| 2056 | * Logged from: |
| 2057 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 2058 | */ |
| 2059 | message LowMemReported { |
| 2060 | } |
| 2061 | |
| 2062 | /** |
| 2063 | * Logs when an app ANR (App Not Responding) occurs. |
| 2064 | * Logged from: |
| 2065 | * frameworks/base/services/core/java/com/android/server/am/AppErrors.java |
| 2066 | */ |
| 2067 | message ANROccurred { |
| 2068 | optional int32 uid = 1 [(is_uid) = true]; |
| 2069 | |
| 2070 | optional string process_name = 2; |
| 2071 | |
| 2072 | optional string short_component_name = 3; |
| 2073 | |
| 2074 | optional string reason = 4; |
Chenjie Yu | f17bf62 | 2018-04-02 14:22:19 -0700 | [diff] [blame] | 2075 | |
| 2076 | enum InstantApp { |
| 2077 | UNAVAILABLE = 0; |
| 2078 | FALSE = 1; |
| 2079 | TRUE = 2; |
| 2080 | } |
| 2081 | optional InstantApp is_instant_app = 5; |
| 2082 | |
| 2083 | enum ForegroundState { |
| 2084 | UNKNOWN = 0; |
| 2085 | BACKGROUND = 1; |
| 2086 | FOREGROUND = 2; |
| 2087 | } |
| 2088 | optional ForegroundState foreground_state = 6; |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 2089 | } |
| 2090 | |
David Chen | 0a368b2 | 2017-12-06 16:28:16 -0800 | [diff] [blame] | 2091 | /* |
| 2092 | * Allows other apps to push events into statsd. |
| 2093 | * Logged from: |
| 2094 | * frameworks/base/core/java/android/util/StatsLog.java |
| 2095 | */ |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2096 | message AppBreadcrumbReported { |
David Chen | 0a368b2 | 2017-12-06 16:28:16 -0800 | [diff] [blame] | 2097 | // The uid of the application that sent this custom atom. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2098 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | 0a368b2 | 2017-12-06 16:28:16 -0800 | [diff] [blame] | 2099 | |
| 2100 | // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16). |
| 2101 | optional int32 label = 2; |
| 2102 | |
| 2103 | // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom |
| 2104 | // predicates for the metrics). |
| 2105 | enum State { |
| 2106 | UNKNOWN = 0; |
| 2107 | UNSPECIFIED = 1; // For events that are known to not represent START/STOP. |
| 2108 | STOP = 2; |
| 2109 | START = 3; |
| 2110 | } |
| 2111 | optional State state = 3; |
| 2112 | } |
| 2113 | |
David Chen | 9e3808c | 2017-11-20 17:25:34 -0800 | [diff] [blame] | 2114 | /** |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 2115 | * Logs when statsd detects an anomaly. |
| 2116 | * |
| 2117 | * Logged from: |
| 2118 | * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp |
| 2119 | */ |
| 2120 | message AnomalyDetected { |
| 2121 | // Uid that owns the config whose anomaly detection alert fired. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2122 | optional int32 config_uid = 1 [(is_uid) = true]; |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 2123 | |
Yangster-mac | 94e197c | 2018-01-02 16:03:03 -0800 | [diff] [blame] | 2124 | // Id of the config whose anomaly detection alert fired. |
| 2125 | optional int64 config_id = 2; |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 2126 | |
Yangster-mac | 94e197c | 2018-01-02 16:03:03 -0800 | [diff] [blame] | 2127 | // Id of the alert (i.e. name of the anomaly that was detected). |
| 2128 | optional int64 alert_id = 3; |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 2129 | } |
| 2130 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2131 | message AppStartOccurred { |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2132 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2133 | optional int32 uid = 1 [(is_uid) = true]; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2134 | |
| 2135 | // The app package name. |
| 2136 | optional string pkg_name = 2; |
| 2137 | |
| 2138 | enum TransitionType { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2139 | UNKNOWN = 0; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2140 | WARM = 1; |
| 2141 | HOT = 2; |
| 2142 | COLD = 3; |
| 2143 | } |
| 2144 | // The transition type. |
| 2145 | optional TransitionType type = 3; |
| 2146 | |
| 2147 | // The activity name. |
| 2148 | optional string activity_name = 4; |
| 2149 | |
| 2150 | // The name of the calling app. Empty if not set. |
| 2151 | optional string calling_pkg_name = 5; |
| 2152 | |
| 2153 | // Whether the app is an instant app. |
| 2154 | optional bool is_instant_app = 6; |
| 2155 | |
| 2156 | // Device uptime when activity started. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2157 | optional int64 activity_start_millis = 7; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2158 | |
Bookatz | 80d11a0 | 2018-01-16 10:46:35 -0800 | [diff] [blame] | 2159 | optional android.app.AppTransitionReasonEnum reason = 8; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2160 | |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2161 | optional int32 transition_delay_millis = 9; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2162 | // -1 if not set. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2163 | optional int32 starting_window_delay_millis = 10; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2164 | // -1 if not set. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2165 | optional int32 bind_application_delay_millis = 11; |
| 2166 | optional int32 windows_drawn_delay_millis = 12; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2167 | |
| 2168 | // Empty if not set. |
| 2169 | optional string launch_token = 13; |
| 2170 | |
Calin Juravle | 759fbda | 2018-02-20 19:52:30 +0000 | [diff] [blame] | 2171 | // The compiler filter used when when the package was optimized. |
Calin Juravle | a86783b | 2018-03-21 14:25:59 -0700 | [diff] [blame] | 2172 | optional int32 package_optimization_compilation_filter = 14; |
Calin Juravle | 759fbda | 2018-02-20 19:52:30 +0000 | [diff] [blame] | 2173 | |
| 2174 | // The reason why the package was optimized. |
Calin Juravle | a86783b | 2018-03-21 14:25:59 -0700 | [diff] [blame] | 2175 | optional int32 package_optimization_compilation_reason = 15; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2176 | } |
| 2177 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2178 | message AppStartCanceled { |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2179 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2180 | optional int32 uid = 1 [(is_uid) = true]; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2181 | |
| 2182 | // The app package name. |
| 2183 | optional string pkg_name = 2; |
| 2184 | |
| 2185 | enum TransitionType { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2186 | UNKNOWN = 0; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2187 | WARM = 1; |
| 2188 | HOT = 2; |
| 2189 | COLD = 3; |
| 2190 | } |
| 2191 | // The transition type. |
| 2192 | optional TransitionType type = 3; |
| 2193 | |
| 2194 | // The activity name. |
| 2195 | optional string activity_name = 4; |
| 2196 | } |
| 2197 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2198 | message AppStartFullyDrawn { |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2199 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2200 | optional int32 uid = 1 [(is_uid) = true]; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2201 | |
| 2202 | // The app package name. |
| 2203 | optional string pkg_name = 2; |
| 2204 | |
| 2205 | enum TransitionType { |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2206 | UNKNOWN = 0; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2207 | WITH_BUNDLE = 1; |
| 2208 | WITHOUT_BUNDLE = 2; |
| 2209 | } |
| 2210 | // The transition type. |
| 2211 | optional TransitionType type = 3; |
| 2212 | |
| 2213 | // The activity name. |
| 2214 | optional string activity_name = 4; |
| 2215 | |
| 2216 | optional bool transition_process_running = 5; |
| 2217 | |
| 2218 | // App startup time (until call to Activity#reportFullyDrawn()). |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2219 | optional int64 app_startup_time_millis = 6; |
Olivier Gaillard | aed7f12 | 2017-12-12 14:26:22 +0000 | [diff] [blame] | 2220 | } |
| 2221 | |
Bookatz | 8fcd09a | 2017-12-18 13:01:10 -0800 | [diff] [blame] | 2222 | /** |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 2223 | * Logs a picture-in-picture action |
| 2224 | * Logged from: |
| 2225 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 2226 | * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java |
| 2227 | * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java |
| 2228 | */ |
| 2229 | message PictureInPictureStateChanged { |
Chenjie Yu | ae9fdf04 | 2018-02-15 10:19:32 -0800 | [diff] [blame] | 2230 | // -1 if it is not available |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2231 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 2232 | |
Chenjie Yu | ae9fdf04 | 2018-02-15 10:19:32 -0800 | [diff] [blame] | 2233 | optional string short_name = 2; |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 2234 | |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 2235 | enum State { |
| 2236 | ENTERED = 1; |
| 2237 | EXPANDED_TO_FULL_SCREEN = 2; |
| 2238 | MINIMIZED = 3; |
| 2239 | DISMISSED = 4; |
| 2240 | } |
Chenjie Yu | ae9fdf04 | 2018-02-15 10:19:32 -0800 | [diff] [blame] | 2241 | optional State state = 3; |
Chenjie Yu | 52cacc6 | 2017-12-08 18:11:45 -0800 | [diff] [blame] | 2242 | } |
| 2243 | |
| 2244 | /** |
Chenjie Yu | e890419 | 2017-12-08 19:12:57 -0800 | [diff] [blame] | 2245 | * Logs overlay action |
| 2246 | * Logged from: |
| 2247 | * services/core/java/com/android/server/wm/Session.java |
| 2248 | */ |
| 2249 | message OverlayStateChanged { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2250 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | e890419 | 2017-12-08 19:12:57 -0800 | [diff] [blame] | 2251 | |
| 2252 | optional string package_name = 2; |
| 2253 | |
| 2254 | optional bool using_alert_window = 3; |
| 2255 | |
| 2256 | enum State { |
| 2257 | ENTERED = 1; |
| 2258 | EXITED = 2; |
| 2259 | } |
| 2260 | optional State state = 4; |
| 2261 | } |
| 2262 | |
Chenjie Yu | ccfe645 | 2018-01-30 11:33:21 -0800 | [diff] [blame] | 2263 | /* |
| 2264 | * Logs foreground service starts and stops. |
| 2265 | * Note that this is not when a service starts or stops, but when it is |
| 2266 | * considered foreground. |
| 2267 | * Logged from |
| 2268 | * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java |
| 2269 | */ |
| 2270 | message ForegroundServiceStateChanged { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2271 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | ccfe645 | 2018-01-30 11:33:21 -0800 | [diff] [blame] | 2272 | // package_name + "/" + class_name |
| 2273 | optional string short_name = 2; |
| 2274 | |
| 2275 | enum State { |
| 2276 | ENTER = 1; |
| 2277 | EXIT = 2; |
| 2278 | } |
| 2279 | optional State state = 3; |
| 2280 | } |
| 2281 | |
Chenjie Yu | e890419 | 2017-12-08 19:12:57 -0800 | [diff] [blame] | 2282 | /** |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2283 | * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky |
| 2284 | * behavior in its own uid. However, the metrics of these isolated uid's almost always should be |
| 2285 | * attributed back to the parent (host) uid. One example is Chrome. |
| 2286 | * |
| 2287 | * Logged from: |
| 2288 | * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java |
| 2289 | */ |
| 2290 | message IsolatedUidChanged { |
| 2291 | // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2292 | // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd. |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2293 | optional int32 parent_uid = 1; |
| 2294 | |
| 2295 | optional int32 isolated_uid = 2; |
| 2296 | |
| 2297 | // We expect an isolated uid to be removed before if it's used for another parent uid. |
| 2298 | enum Event { |
| 2299 | REMOVED = 0; |
| 2300 | CREATED = 1; |
| 2301 | } |
| 2302 | optional Event event = 3; |
| 2303 | } |
| 2304 | |
| 2305 | /* |
| 2306 | * Logs the reception of an incoming network packet causing the main system to wake up for |
| 2307 | * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd |
| 2308 | * and processed by WakeupController.cpp. |
| 2309 | */ |
| 2310 | message PacketWakeupOccurred { |
| 2311 | // The uid owning the socket into which the packet was delivered, or -1 if the packet was |
| 2312 | // delivered nowhere. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2313 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2314 | // The interface name on which the packet was received. |
| 2315 | optional string iface = 2; |
| 2316 | // The ethertype value of the packet. |
| 2317 | optional int32 ethertype = 3; |
| 2318 | // String representation of the destination MAC address of the packet. |
| 2319 | optional string destination_hardware_address = 4; |
| 2320 | // String representation of the source address of the packet if this was an IP packet. |
| 2321 | optional string source_ip = 5; |
| 2322 | // String representation of the destination address of the packet if this was an IP packet. |
| 2323 | optional string destination_ip = 6; |
| 2324 | // The value of the protocol field if this was an IPv4 packet or the value of the Next Header |
| 2325 | // field if this was an IPv6 packet. The range of possible values is the same for both IP |
| 2326 | // families. |
| 2327 | optional int32 ip_next_header = 7; |
| 2328 | // The source port if this was a TCP or UDP packet. |
| 2329 | optional int32 source_port = 8; |
| 2330 | // The destination port if this was a TCP or UDP packet. |
| 2331 | optional int32 destination_port = 9; |
| 2332 | } |
| 2333 | |
| 2334 | /* |
| 2335 | * Logs the memory stats for an app on startup. |
| 2336 | * Logged from: |
| 2337 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 2338 | */ |
| 2339 | message AppStartMemoryStateCaptured { |
| 2340 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2341 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2342 | |
| 2343 | // The process name. |
| 2344 | optional string process_name = 2; |
| 2345 | |
| 2346 | // The activity name. |
| 2347 | optional string activity_name = 3; |
| 2348 | |
| 2349 | // # of page-faults |
| 2350 | optional int64 pgfault = 4; |
| 2351 | |
| 2352 | // # of major page-faults |
| 2353 | optional int64 pgmajfault = 5; |
| 2354 | |
| 2355 | // RSS |
| 2356 | optional int64 rss_in_bytes = 6; |
| 2357 | |
| 2358 | // CACHE |
| 2359 | optional int64 cache_in_bytes = 7; |
| 2360 | |
| 2361 | // SWAP |
| 2362 | optional int64 swap_in_bytes = 8; |
| 2363 | } |
| 2364 | |
| 2365 | /* |
| 2366 | * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries |
| 2367 | * for LMK event. |
| 2368 | * Logged from: |
| 2369 | * system/core/lmkd/lmkd.c |
| 2370 | */ |
| 2371 | message LmkStateChanged { |
| 2372 | enum State { |
| 2373 | UNKNOWN = 0; |
| 2374 | START = 1; |
| 2375 | STOP = 2; |
| 2376 | } |
| 2377 | optional State state = 1; |
| 2378 | } |
| 2379 | |
| 2380 | /* |
| 2381 | * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure. |
| 2382 | * Logged from: |
| 2383 | * system/core/lmkd/lmkd.c |
| 2384 | */ |
| 2385 | message LmkKillOccurred { |
| 2386 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2387 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2388 | |
| 2389 | // The process name. |
| 2390 | optional string process_name = 2; |
| 2391 | |
| 2392 | // oom adj score. |
| 2393 | optional int32 oom_score = 3; |
| 2394 | |
| 2395 | // # of page-faults |
| 2396 | optional int64 pgfault = 4; |
| 2397 | |
| 2398 | // # of major page-faults |
| 2399 | optional int64 pgmajfault = 5; |
| 2400 | |
| 2401 | // RSS |
| 2402 | optional int64 rss_in_bytes = 6; |
| 2403 | |
| 2404 | // CACHE |
| 2405 | optional int64 cache_in_bytes = 7; |
| 2406 | |
| 2407 | // SWAP |
| 2408 | optional int64 swap_in_bytes = 8; |
Jim Blackler | 972a5c5 | 2018-11-21 15:24:48 +0000 | [diff] [blame] | 2409 | |
| 2410 | // The elapsed real time of start of the process. |
| 2411 | optional int64 process_start_time_nanos = 9; |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2412 | } |
| 2413 | |
Rajeev Kumar | 51b5460 | 2018-03-01 12:18:26 -0800 | [diff] [blame] | 2414 | /* |
| 2415 | * Logs when the ActivityManagerService detects that an app died. |
| 2416 | * |
| 2417 | * Logged from: |
| 2418 | * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java |
| 2419 | */ |
| 2420 | message AppDied { |
| 2421 | // timestamp(elapsedRealtime) of record creation |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2422 | optional uint64 timestamp_millis = 1 [(stateFieldOption).option = EXCLUSIVE]; |
Rajeev Kumar | 51b5460 | 2018-03-01 12:18:26 -0800 | [diff] [blame] | 2423 | } |
| 2424 | |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2425 | ////////////////////////////////////////////////////////////////////// |
| 2426 | // Pulled atoms below this line // |
| 2427 | ////////////////////////////////////////////////////////////////////// |
| 2428 | |
| 2429 | /** |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2430 | * Pulls bytes transferred via wifi (Sum of foreground and background usage). |
| 2431 | * |
| 2432 | * Pulled from: |
| 2433 | * StatsCompanionService (using BatteryStats to get which interfaces are wifi) |
| 2434 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2435 | message WifiBytesTransfer { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2436 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2437 | |
| 2438 | optional int64 rx_bytes = 2; |
| 2439 | |
| 2440 | optional int64 rx_packets = 3; |
| 2441 | |
| 2442 | optional int64 tx_bytes = 4; |
| 2443 | |
| 2444 | optional int64 tx_packets = 5; |
| 2445 | } |
| 2446 | |
| 2447 | /** |
| 2448 | * Pulls bytes transferred via wifi (separated by foreground and background usage). |
| 2449 | * |
| 2450 | * Pulled from: |
| 2451 | * StatsCompanionService (using BatteryStats to get which interfaces are wifi) |
| 2452 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2453 | message WifiBytesTransferByFgBg { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2454 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2455 | |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2456 | // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats. |
| 2457 | optional bool is_foreground = 2; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2458 | |
| 2459 | optional int64 rx_bytes = 3; |
| 2460 | |
| 2461 | optional int64 rx_packets = 4; |
| 2462 | |
| 2463 | optional int64 tx_bytes = 5; |
| 2464 | |
| 2465 | optional int64 tx_packets = 6; |
| 2466 | } |
| 2467 | |
| 2468 | /** |
| 2469 | * Pulls bytes transferred via mobile networks (Sum of foreground and background usage). |
| 2470 | * |
| 2471 | * Pulled from: |
| 2472 | * StatsCompanionService (using BatteryStats to get which interfaces are mobile data) |
| 2473 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2474 | message MobileBytesTransfer { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2475 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2476 | |
| 2477 | optional int64 rx_bytes = 2; |
| 2478 | |
| 2479 | optional int64 rx_packets = 3; |
| 2480 | |
| 2481 | optional int64 tx_bytes = 4; |
| 2482 | |
| 2483 | optional int64 tx_packets = 5; |
| 2484 | } |
| 2485 | |
| 2486 | /** |
| 2487 | * Pulls bytes transferred via mobile networks (separated by foreground and background usage). |
| 2488 | * |
| 2489 | * Pulled from: |
| 2490 | * StatsCompanionService (using BatteryStats to get which interfaces are mobile data) |
| 2491 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2492 | message MobileBytesTransferByFgBg { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2493 | optional int32 uid = 1 [(is_uid) = true]; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2494 | |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2495 | // 1 denotes foreground and 0 denotes background. This is called Set in |
| 2496 | // NetworkStats. |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2497 | optional bool is_foreground = 2; |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2498 | |
| 2499 | optional int64 rx_bytes = 3; |
| 2500 | |
| 2501 | optional int64 rx_packets = 4; |
| 2502 | |
| 2503 | optional int64 tx_bytes = 5; |
| 2504 | |
| 2505 | optional int64 tx_packets = 6; |
| 2506 | } |
| 2507 | |
| 2508 | /** |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2509 | * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller. |
| 2510 | * |
| 2511 | * Pulled from: |
| 2512 | * StatsCompanionService |
| 2513 | */ |
| 2514 | message BluetoothBytesTransfer { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2515 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2516 | |
| 2517 | optional int64 rx_bytes = 2; |
| 2518 | |
| 2519 | optional int64 tx_bytes = 3; |
| 2520 | } |
| 2521 | |
| 2522 | /** |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2523 | * Pulls the kernel wakelock durations. This atom is adapted from |
| 2524 | * android/internal/os/KernelWakelockStats.java |
| 2525 | * |
| 2526 | * Pulled from: |
| 2527 | * StatsCompanionService using KernelWakelockReader. |
| 2528 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2529 | message KernelWakelock { |
David Chen | c8a4324 | 2017-10-17 16:23:28 -0700 | [diff] [blame] | 2530 | optional string name = 1; |
| 2531 | |
| 2532 | optional int32 count = 2; |
| 2533 | |
| 2534 | optional int32 version = 3; |
| 2535 | |
| 2536 | optional int64 time = 4; |
| 2537 | } |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 2538 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2539 | /** |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 2540 | * Pulls low power state information. This includes platform and subsystem sleep state information, |
| 2541 | * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState as defined in |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 2542 | * hardware/interfaces/power/1.0/types.hal |
Chenjie Yu | 5305e1d | 2017-10-31 13:49:36 -0700 | [diff] [blame] | 2543 | * hardware/interfaces/power/1.1/types.hal |
| 2544 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2545 | message SubsystemSleepState { |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2546 | // Subsystem name |
| 2547 | optional string subsystem_name = 1; |
| 2548 | // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty. |
| 2549 | // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name. |
| 2550 | optional string subname = 2; |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 2551 | // The number of times it entered, or voted for entering the sleep state |
Chenjie Yu | bbcbc60 | 2018-02-05 16:51:52 -0800 | [diff] [blame] | 2552 | optional uint64 count = 3; |
Chenjie Yu | c8b7f22 | 2018-01-11 23:25:57 -0800 | [diff] [blame] | 2553 | // The length of time spent in, or spent voting for, the sleep state |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2554 | optional uint64 time_millis = 4; |
David Chen | 2158296 | 2017-11-01 17:32:46 -0700 | [diff] [blame] | 2555 | } |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 2556 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2557 | /** |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 2558 | * Pulls Cpu time per frequency. |
Chenjie Yu | 1ee9b74 | 2018-01-10 16:02:57 -0800 | [diff] [blame] | 2559 | * Pulls the time the cpu spend on the frequency index. Frequency index |
| 2560 | * starts from highest to lowest. The value should be monotonically |
| 2561 | * increasing since boot. However, if there is a cpu |
| 2562 | * hotplug event, the value would be reset as well. |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 2563 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2564 | message CpuTimePerFreq { |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 2565 | optional uint32 cluster = 1; |
| 2566 | optional uint32 freq_index = 2; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2567 | optional uint64 time_millis = 3; |
Chenjie Yu | 7f8def9 | 2017-11-03 09:33:15 -0700 | [diff] [blame] | 2568 | } |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 2569 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2570 | /** |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 2571 | * Pulls Cpu Time Per Uid. |
| 2572 | * Note that isolated process uid time should be attributed to host uids. |
| 2573 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2574 | message CpuTimePerUid { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2575 | optional int32 uid = 1 [(is_uid) = true]; |
Misha Wagner | 6bc6c91 | 2018-11-16 13:19:54 +0000 | [diff] [blame] | 2576 | optional uint64 user_time_micros = 2; |
| 2577 | optional uint64 sys_time_micros = 3; |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 2578 | } |
| 2579 | |
| 2580 | /** |
| 2581 | * Pulls Cpu Time Per Uid per frequency. |
| 2582 | * Note that isolated process uid time should be attributed to host uids. |
| 2583 | * For each uid, we order the time by descending frequencies. |
| 2584 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2585 | message CpuTimePerUidFreq { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2586 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | ec67661 | 2018-03-07 09:19:17 -0800 | [diff] [blame] | 2587 | optional uint32 freq_index = 2; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2588 | optional uint64 time_millis = 3; |
Chenjie Yu | e33bc3b | 2017-11-06 17:56:44 -0800 | [diff] [blame] | 2589 | } |
Hugo Benichi | 884970e | 2017-11-14 22:42:46 +0900 | [diff] [blame] | 2590 | |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2591 | /** |
| 2592 | * Pulls Wifi Controller Activity Energy Info |
| 2593 | */ |
Chenjie Yu | 5caaa9d | 2018-03-06 15:48:54 -0800 | [diff] [blame] | 2594 | message WifiActivityInfo { |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2595 | // timestamp(wall clock) of record creation |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2596 | optional uint64 timestamp_millis = 1; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2597 | // stack reported state |
| 2598 | // TODO: replace this with proto enum |
| 2599 | optional int32 stack_state = 2; |
| 2600 | // tx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2601 | optional uint64 controller_tx_time_millis = 3; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2602 | // rx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2603 | optional uint64 controller_rx_time_millis = 4; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2604 | // idle time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2605 | optional uint64 controller_idle_time_millis = 5; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2606 | // product of current(mA), voltage(V) and time(ms) |
| 2607 | optional uint64 controller_energy_used = 6; |
| 2608 | } |
| 2609 | |
| 2610 | /** |
| 2611 | * Pulls Modem Activity Energy Info |
| 2612 | */ |
Chenjie Yu | 31d14d7 | 2017-12-12 17:54:33 -0800 | [diff] [blame] | 2613 | message ModemActivityInfo { |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2614 | // timestamp(wall clock) of record creation |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2615 | optional uint64 timestamp_millis = 1; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2616 | // sleep time in ms. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2617 | optional uint64 sleep_time_millis = 2; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2618 | // idle time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2619 | optional uint64 controller_idle_time_millis = 3; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2620 | /** |
| 2621 | * Tx power index |
| 2622 | * index 0 = tx_power < 0dBm |
| 2623 | * index 1 = 0dBm < tx_power < 5dBm |
| 2624 | * index 2 = 5dBm < tx_power < 15dBm |
| 2625 | * index 3 = 15dBm < tx_power < 20dBm |
| 2626 | * index 4 = tx_power > 20dBm |
| 2627 | */ |
| 2628 | // tx time in ms at power level 0 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2629 | optional uint64 controller_tx_time_pl0_millis = 4; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2630 | // tx time in ms at power level 1 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2631 | optional uint64 controller_tx_time_pl1_millis = 5; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2632 | // tx time in ms at power level 2 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2633 | optional uint64 controller_tx_time_pl2_millis = 6; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2634 | // tx time in ms at power level 3 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2635 | optional uint64 controller_tx_time_pl3_millis = 7; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2636 | // tx time in ms at power level 4 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2637 | optional uint64 controller_tx_time_pl4_millis = 8; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2638 | // rx time in ms at power level 5 |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2639 | optional uint64 controller_rx_time_millis = 9; |
Chenjie Yu | 05013b3 | 2017-11-21 10:21:41 -0800 | [diff] [blame] | 2640 | // product of current(mA), voltage(V) and time(ms) |
| 2641 | optional uint64 energy_used = 10; |
Joe Onorato | 62c220b | 2017-11-18 20:32:56 -0800 | [diff] [blame] | 2642 | } |
Rajeev Kumar | 508a9bf | 2018-01-18 15:49:11 -0800 | [diff] [blame] | 2643 | |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2644 | /** |
| 2645 | * Pulls Bluetooth Activity Energy Info |
| 2646 | * Note: BluetoothBytesTransfer is pulled at the same time from the controller. |
| 2647 | */ |
| 2648 | message BluetoothActivityInfo { |
| 2649 | // timestamp(wall clock) of record creation |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2650 | optional uint64 timestamp_millis = 1; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2651 | // bluetooth stack state |
| 2652 | optional int32 bluetooth_stack_state = 2; |
| 2653 | // tx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2654 | optional uint64 controller_tx_time_millis = 3; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2655 | // rx time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2656 | optional uint64 controller_rx_time_millis = 4; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2657 | // idle time in ms |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2658 | optional uint64 controller_idle_time_millis = 5; |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2659 | // product of current(mA), voltage(V) and time(ms) |
| 2660 | optional uint64 energy_used = 6; |
| 2661 | } |
| 2662 | |
Rajeev Kumar | 508a9bf | 2018-01-18 15:49:11 -0800 | [diff] [blame] | 2663 | /* |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 2664 | * Logs the memory stats for a process. |
| 2665 | */ |
| 2666 | message ProcessMemoryState { |
| 2667 | // The uid if available. -1 means not available. |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2668 | optional int32 uid = 1 [(is_uid) = true]; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 2669 | |
| 2670 | // The process name. |
| 2671 | optional string process_name = 2; |
| 2672 | |
| 2673 | // oom adj score. |
| 2674 | optional int32 oom_score = 3; |
| 2675 | |
| 2676 | // # of page-faults |
| 2677 | optional int64 pgfault = 4; |
| 2678 | |
| 2679 | // # of major page-faults |
| 2680 | optional int64 pgmajfault = 5; |
| 2681 | |
Rajeev Kumar | 9023599 | 2018-01-29 11:06:48 -0800 | [diff] [blame] | 2682 | // RSS |
| 2683 | optional int64 rss_in_bytes = 6; |
| 2684 | |
| 2685 | // CACHE |
| 2686 | optional int64 cache_in_bytes = 7; |
| 2687 | |
| 2688 | // SWAP |
| 2689 | optional int64 swap_in_bytes = 8; |
Rajeev Kumar | 8a9fa05 | 2018-01-25 19:03:09 -0800 | [diff] [blame] | 2690 | } |
| 2691 | |
| 2692 | /* |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2693 | * Elapsed real time from SystemClock. |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 2694 | */ |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2695 | message SystemElapsedRealtime { |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2696 | optional uint64 time_millis = 1; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 2697 | } |
| 2698 | |
| 2699 | /* |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2700 | * Up time from SystemClock. |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 2701 | */ |
Chenjie Yu | 9d7720b | 2018-01-24 10:34:48 -0800 | [diff] [blame] | 2702 | message SystemUptime { |
| 2703 | // Milliseconds since the system was booted. |
| 2704 | // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting |
| 2705 | // for external input). |
| 2706 | // It is not affected by clock scaling, idle, or other power saving mechanisms. |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2707 | optional uint64 uptime_millis = 1; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 2708 | } |
| 2709 | |
| 2710 | /* |
| 2711 | * Reads from /proc/uid_concurrent_active_time which has the format: |
| 2712 | * active: X (X is # cores) |
| 2713 | * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores) |
| 2714 | * [uid1]: [time-0] [time-1] [time-2] ... ... |
| 2715 | * ... |
| 2716 | * Time-N means the CPU time a UID spent running concurrently with N other processes. |
| 2717 | * The file contains a monotonically increasing count of time for a single boot. |
| 2718 | */ |
| 2719 | message CpuActiveTime { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2720 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | ec67661 | 2018-03-07 09:19:17 -0800 | [diff] [blame] | 2721 | optional uint64 time_millis = 2; |
Chenjie Yu | 9da105b | 2018-01-13 12:41:08 -0800 | [diff] [blame] | 2722 | } |
| 2723 | |
| 2724 | /** |
| 2725 | * Reads from /proc/uid_concurrent_policy_time which has the format: |
| 2726 | * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4) |
| 2727 | * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ... |
| 2728 | * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ... |
| 2729 | * ... |
| 2730 | * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes. |
| 2731 | * The file contains a monotonically increasing count of time for a single boot. |
| 2732 | */ |
| 2733 | message CpuClusterTime { |
Yao Chen | c40a19d | 2018-03-15 16:48:25 -0700 | [diff] [blame] | 2734 | optional int32 uid = 1 [(is_uid) = true]; |
Chenjie Yu | ec67661 | 2018-03-07 09:19:17 -0800 | [diff] [blame] | 2735 | optional int32 cluster_index = 2; |
David Chen | 0b5c90c | 2018-01-25 16:51:49 -0800 | [diff] [blame] | 2736 | optional uint64 time_millis = 3; |
Chenjie Yu | 937d742 | 2018-01-10 16:37:53 -0800 | [diff] [blame] | 2737 | } |
| 2738 | |
| 2739 | /* |
| 2740 | * Pulls free disk space, for data, system partition and temporary directory. |
| 2741 | */ |
| 2742 | message DiskSpace { |
| 2743 | // available bytes in data partition |
| 2744 | optional uint64 data_available_bytes = 1; |
| 2745 | // available bytes in system partition |
| 2746 | optional uint64 system_available_bytes = 2; |
| 2747 | // available bytes in download cache or temp directories |
| 2748 | optional uint64 temp_available_bytes = 3; |
| 2749 | } |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 2750 | |
| 2751 | /** |
| 2752 | * Pulls battery coulomb counter, which is the remaining battery charge in uAh. |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 2753 | * Pulled from: |
| 2754 | * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 2755 | */ |
| 2756 | message RemainingBatteryCapacity { |
| 2757 | optional int32 charge_uAh = 1; |
| 2758 | } |
| 2759 | |
| 2760 | /** |
| 2761 | * Pulls battery capacity, which is the battery capacity when full in uAh. |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 2762 | * Pulled from: |
| 2763 | * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp |
Tej Singh | bf972d9 | 2018-01-10 20:51:13 -0800 | [diff] [blame] | 2764 | */ |
| 2765 | message FullBatteryCapacity { |
| 2766 | optional int32 capacity_uAh = 1; |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 2767 | } |
| 2768 | |
| 2769 | /** |
Tej Singh | d89137e | 2018-03-26 14:51:40 -0700 | [diff] [blame] | 2770 | * Pulls the temperature of various parts of the device. |
| 2771 | * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303. |
Tej Singh | 4029831 | 2018-02-16 00:15:09 -0800 | [diff] [blame] | 2772 | * |
| 2773 | * Pulled from: |
| 2774 | * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp |
| 2775 | */ |
| 2776 | message Temperature { |
| 2777 | // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY. |
| 2778 | optional android.os.TemperatureTypeEnum sensor_location = 1; |
| 2779 | |
| 2780 | // The name of the temperature source. Eg. CPU0 |
| 2781 | optional string sensor_name = 2; |
| 2782 | |
Tej Singh | d89137e | 2018-03-26 14:51:40 -0700 | [diff] [blame] | 2783 | // Temperature in tenths of a degree C. |
| 2784 | optional int32 temperature_dC = 3; |
yro | a1fe77c | 2018-02-26 14:22:54 -0800 | [diff] [blame] | 2785 | } |
lifr | 35a7cf0 | 2018-12-12 16:38:04 +0800 | [diff] [blame] | 2786 | |
| 2787 | /** |
| 2788 | * Logs the latency period(in microseconds) and the return code of |
| 2789 | * the DNS(Domain Name System) lookups. |
| 2790 | * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND) |
| 2791 | * to get info(address or hostname) from DNS server(or DNS cache). |
| 2792 | * Logged from: |
| 2793 | * /system/netd/server/DnsProxyListener.cpp |
| 2794 | */ |
| 2795 | message NetworkDnsEventReported { |
| 2796 | // The types of the DNS lookups, as defined in |
| 2797 | //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl |
| 2798 | enum EventType { |
| 2799 | EVENT_UNKNOWN = 0; |
| 2800 | EVENT_GETADDRINFO = 1; |
| 2801 | EVENT_GETHOSTBYNAME = 2; |
| 2802 | EVENT_GETHOSTBYADDR = 3; |
| 2803 | EVENT_RES_NSEND = 4; |
| 2804 | } |
| 2805 | optional EventType event_type = 1; |
| 2806 | |
| 2807 | // The return value of the DNS resolver for each DNS lookups. |
| 2808 | //bionic/libc/include/netdb.h |
| 2809 | //system/netd/resolv/include/netd_resolv/resolv.h |
| 2810 | enum ReturnCode { |
| 2811 | EAI_NO_ERROR = 0; |
| 2812 | EAI_ADDRFAMILY = 1; |
| 2813 | EAI_AGAIN = 2; |
| 2814 | EAI_BADFLAGS = 3; |
| 2815 | EAI_FAIL = 4; |
| 2816 | EAI_FAMILY = 5; |
| 2817 | EAI_MEMORY = 6; |
| 2818 | EAI_NODATA = 7; |
| 2819 | EAI_NONAME = 8; |
| 2820 | EAI_SERVICE = 9; |
| 2821 | EAI_SOCKTYPE = 10; |
| 2822 | EAI_SYSTEM = 11; |
| 2823 | EAI_BADHINTS = 12; |
| 2824 | EAI_PROTOCOL = 13; |
| 2825 | EAI_OVERFLOW = 14; |
| 2826 | RESOLV_TIMEOUT = 255; |
| 2827 | EAI_MAX = 256; |
| 2828 | } |
| 2829 | optional ReturnCode return_code = 2; |
| 2830 | |
| 2831 | // The latency period(in microseconds) it took for this DNS lookup to complete. |
| 2832 | optional int32 latency_micros = 3; |
| 2833 | } |
| 2834 | |
Chiachang Wang | 67f2447 | 2019-01-15 15:14:00 +0800 | [diff] [blame] | 2835 | /** |
| 2836 | * Logs when a data stall event occurs. |
| 2837 | * |
| 2838 | * Log from: |
| 2839 | * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java |
| 2840 | */ |
| 2841 | message DataStallEvent { |
| 2842 | // Data stall evaluation type. |
| 2843 | // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java |
| 2844 | // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*. |
| 2845 | optional int32 evaluation_type = 1; |
| 2846 | // See definition in data_stall_event.proto. |
| 2847 | optional com.android.server.connectivity.ProbeResult validation_result = 2; |
| 2848 | // See definition in data_stall_event.proto. |
| 2849 | optional android.net.NetworkCapabilitiesProto.Transport network_type = 3; |
| 2850 | // See definition in data_stall_event.proto. |
| 2851 | optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES]; |
| 2852 | // See definition in data_stall_event.proto. |
| 2853 | optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES]; |
| 2854 | // See definition in data_stall_event.proto. |
| 2855 | optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES]; |
| 2856 | } |
Jack Yu | 6d421bc | 2019-01-23 17:42:54 +0800 | [diff] [blame] | 2857 | |
| 2858 | /** |
| 2859 | * Logs when a NFC device's error occurred. |
| 2860 | * Logged from: |
| 2861 | * system/nfc/src/nfc/nfc/nfc_ncif.cc |
| 2862 | * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java |
| 2863 | */ |
| 2864 | message NfcErrorOccurred { |
| 2865 | enum Type { |
| 2866 | UNKNOWN = 0; |
| 2867 | CMD_TIMEOUT = 1; |
| 2868 | ERROR_NOTIFICATION = 2; |
| 2869 | AID_OVERFLOW = 3; |
| 2870 | } |
| 2871 | optional Type type = 1; |
| 2872 | // If it's nci cmd timeout, log the timeout command. |
| 2873 | optional uint32 nci_cmd = 2; |
| 2874 | |
| 2875 | optional uint32 error_ntf_status_code = 3; |
| 2876 | } |
| 2877 | |
| 2878 | /** |
| 2879 | * Logs when a NFC device's state changed event |
| 2880 | * Logged from: |
| 2881 | * packages/apps/Nfc/src/com/android/nfc/NfcService.java |
| 2882 | */ |
| 2883 | message NfcStateChanged { |
| 2884 | enum State { |
| 2885 | UNKNOWN = 0; |
| 2886 | OFF = 1; |
| 2887 | ON = 2; |
| 2888 | ON_LOCKED = 3; // Secure Nfc enabled. |
| 2889 | CRASH_RESTART = 4; // NfcService watchdog timeout restart. |
| 2890 | } |
| 2891 | optional State state = 1; |
| 2892 | } |
| 2893 | |
| 2894 | /** |
| 2895 | * Logs when a NFC Beam Transaction occurred. |
| 2896 | * Logged from: |
| 2897 | * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java |
| 2898 | */ |
| 2899 | message NfcBeamOccurred { |
| 2900 | enum Operation { |
| 2901 | UNKNOWN = 0; |
| 2902 | SEND = 1; |
| 2903 | RECEIVE = 2; |
| 2904 | } |
| 2905 | optional Operation operation = 1; |
| 2906 | } |
| 2907 | |
| 2908 | /** |
| 2909 | * Logs when a NFC Card Emulation Transaction occurred. |
| 2910 | * Logged from: |
| 2911 | * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java |
| 2912 | * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java |
| 2913 | */ |
| 2914 | message NfcCardemulationOccurred { |
| 2915 | enum Category { |
| 2916 | UNKNOWN = 0; |
| 2917 | HCE_PAYMENT = 1; |
| 2918 | HCE_OTHER = 2; |
| 2919 | OFFHOST = 3; |
| 2920 | } |
| 2921 | // Transaction belongs to HCE payment or HCE other category, or offhost. |
| 2922 | optional Category category = 1; |
| 2923 | // SeName from transaction: SIMx, eSEx, HCE, HCEF. |
| 2924 | optional string se_name = 2; |
| 2925 | } |
| 2926 | |
| 2927 | /** |
| 2928 | * Logs when a NFC Tag event occurred. |
| 2929 | * Logged from: |
| 2930 | * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java |
| 2931 | */ |
| 2932 | message NfcTagOccurred { |
| 2933 | enum Type { |
| 2934 | UNKNOWN = 0; |
| 2935 | URL = 1; |
| 2936 | BT_PAIRING = 2; |
| 2937 | PROVISION = 3; |
| 2938 | WIFI_CONNECT = 4; |
| 2939 | APP_LAUNCH = 5; |
| 2940 | OTHERS = 6; |
| 2941 | } |
| 2942 | optional Type type = 1; |
| 2943 | } |
| 2944 | |
| 2945 | /** |
| 2946 | * Logs when Hce transaction triggered |
| 2947 | * Logged from: |
| 2948 | * system/nfc/src/nfc/nfc/nfc_ncif.cc |
| 2949 | */ |
| 2950 | message NfcHceTransactionOccurred { |
| 2951 | // The latency period(in microseconds) it took for the first HCE data |
| 2952 | // exchange. |
| 2953 | optional uint32 latency_micros = 1; |
| 2954 | } |
| 2955 | |
| 2956 | /** |
| 2957 | * Logs when SecureElement state event changed |
| 2958 | * Logged from: |
| 2959 | * packages/apps/SecureElement/src/com/android/se/Terminal.java |
| 2960 | */ |
| 2961 | message SeStateChanged { |
| 2962 | enum State { |
| 2963 | UNKNOWN = 0; |
| 2964 | INITIALIZED = 1; |
| 2965 | DISCONNECTED = 2; |
| 2966 | CONNECTED = 3; |
| 2967 | HALCRASH = 4; |
| 2968 | } |
| 2969 | optional State state = 1; |
| 2970 | |
| 2971 | optional string state_change_reason = 2; |
| 2972 | // SIMx or eSEx. |
| 2973 | optional string terminal = 3; |
| 2974 | } |
| 2975 | |
| 2976 | /** |
| 2977 | * Logs when Omapi API used |
| 2978 | * Logged from: |
| 2979 | * packages/apps/SecureElement/src/com/android/se/Terminal.java |
| 2980 | */ |
| 2981 | message SeOmapiReported { |
| 2982 | enum Operation { |
| 2983 | UNKNOWN = 0; |
| 2984 | OPEN_CHANNEL = 1; |
| 2985 | } |
| 2986 | optional Operation operation = 1; |
| 2987 | // SIMx or eSEx. |
| 2988 | optional string terminal = 2; |
| 2989 | |
| 2990 | optional string package_name = 3; |
| 2991 | } |