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