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