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