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