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