blob: 7a30c9adea937afc8e624d8c9944979c9392cf3f [file] [log] [blame]
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -07001/*
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
17syntax = "proto2";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070018
19package android.os.statsd;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070020option java_package = "com.android.os";
Stefan Lafonae2df012017-11-14 09:17:21 -080021option java_outer_classname = "AtomsProto";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070022
Yao Chen9c1debe2018-02-19 14:39:19 -080023import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
Bookatzdb026a22018-01-10 19:01:56 -080024import "frameworks/base/core/proto/android/app/enums.proto";
Fan Zhangf837b8e2018-10-23 12:38:30 -070025import "frameworks/base/core/proto/android/app/settings_enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070026import "frameworks/base/core/proto/android/app/job/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080027import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080028import "frameworks/base/core/proto/android/os/enums.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080029import "frameworks/base/core/proto/android/server/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080030import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070031import "frameworks/base/core/proto/android/service/procstats_enum.proto";
32import "frameworks/base/core/proto/android/stats/enums.proto";
shawnlinea5b66b2018-11-13 15:05:29 +080033import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070034import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080035import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080036import "frameworks/base/core/proto/android/telephony/enums.proto";
37import "frameworks/base/core/proto/android/view/enums.proto";
arangelov4e994062018-11-13 16:12:38 +000038import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
39import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080040
Yao Chend54f9dd2017-10-17 17:37:48 +000041/**
Stefan Lafonae2df012017-11-14 09:17:21 -080042 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000043 * raw stats log events from the Android system, also known as "atoms."
44 *
45 * This field contains a single oneof with all of the available messages.
46 * The stats-log-api-gen tool runs as part of the Android build and
47 * generates the android.util.StatsLog class, which contains the constants
48 * and methods that Android uses to log.
49 *
Stefan Lafonae2df012017-11-14 09:17:21 -080050 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000051 * Instead, statsd on Android constructs these messages synthetically,
52 * in the format defined here and in stats_log.proto.
53 */
Stefan Lafonae2df012017-11-14 09:17:21 -080054message Atom {
55 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070056 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070057 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
58 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070059 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070060 BleScanResultReceived ble_scan_result_received = 4;
61 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080062 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070063 SyncStateChanged sync_state_changed = 7;
64 ScheduledJobStateChanged scheduled_job_state_changed = 8;
65 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070066 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080067 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
68 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
69 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070070 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
71 MemoryFactorStateChanged memory_factor_state_changed = 15;
72 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
73 CachedKillReported cached_kill_reported = 17;
74 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070075 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080076 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
77 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
78 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070079 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080080 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070081 CameraStateChanged camera_state_changed = 25;
82 FlashlightStateChanged flashlight_state_changed = 26;
83 UidProcessStateChanged uid_process_state_changed = 27;
84 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
85 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070086 BatteryLevelChanged battery_level_changed = 30;
87 ChargingStateChanged charging_state_changed = 31;
88 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -070089 InteractiveStateChanged interactive_state_changed = 33;
90 // 34 is available
Bookatz8c6571b2017-10-24 15:04:41 -070091 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
92 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -070093 WifiLockStateChanged wifi_lock_state_changed = 37;
94 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
95 WifiScanStateChanged wifi_scan_state_changed = 39;
96 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -070097 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -070098 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -070099 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900100 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700101 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800102 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -0800103 AppBreadcrumbReported app_breadcrumb_reported = 47;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800104 AppStartOccurred app_start_occurred = 48;
105 AppStartCanceled app_start_canceled = 49;
106 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800107 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800108 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800109 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800110 LmkStateChanged lmk_state_changed = 54;
111 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800112 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800113 BootSequenceReported boot_sequence_reported = 57;
Tej Singhbb8554a2018-01-26 11:59:14 -0800114 DaveyOccurred davey_occurred = 58;
Chenjie Yue8904192017-12-08 19:12:57 -0800115 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800116 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800117 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800118 KeyguardStateChanged keyguard_state_changed = 62;
119 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
120 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800121 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800122 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800123 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
124 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800125 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700126 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800127 SpeakerImpedanceReported speaker_impedance_reported = 71;
128 HardwareFailed hardware_failed = 72;
129 PhysicalDropDetected physical_drop_detected = 73;
130 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800131 MobileConnectionStateChanged mobile_connection_state_changed = 75;
132 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700133 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800134 AppCrashOccurred app_crash_occurred = 78;
135 ANROccurred anr_occurred = 79;
136 WTFOccurred wtf_occurred = 80;
137 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700138 GenericAtom generic_atom = 82;
Yangster-mac48b3d622018-08-18 12:38:11 -0700139 KeyValuePairsAtom key_value_pairs_atom = 83;
Bookatza7020bd2018-08-28 16:29:35 -0700140 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700141 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700142 ThermalThrottlingStateChanged thermal_throttling = 86;
Tej Singhd6d6d772018-09-05 17:41:25 -0700143 FingerprintAcquired fingerprint_acquired = 87;
144 FingerprintAuthenticated fingerprint_authenticated = 88;
145 FingerprintErrorOccurred fingerprint_error_occurred = 89;
Howard Ro688ae182018-09-25 00:09:36 -0700146 Notification notification = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700147 BatteryHealthSnapshot battery_health_snapshot = 91;
148 SlowIo slow_io = 92;
149 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700150 PhoneServiceStateChanged phone_service_state_changed = 94;
151 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100152 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700153 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700154 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700155 // TODO: service state change is very noisy shortly after boot, as well
156 // as at other transitions - coming out of doze, device plugged in, etc.
157 // Consider removing this if it becomes a problem
158 ServiceStateChanged service_state_changed = 99;
159 ServiceLaunchReported service_launch_reported = 100;
Yangster-macb89807e2018-11-15 21:10:57 -0800160 PhenotypeFlagStateChanged phenotype_flag_state_changed = 101;
161 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000162 DevicePolicyEvent device_policy_event = 103;
shawnlinea5b66b2018-11-13 15:05:29 +0800163 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104;
164 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported = 105;
165 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106;
166 DocsUIFileOperationReported docs_ui_provider_file_op = 107;
167 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request = 108;
168 DocsUILaunchReported docs_ui_launch_reported = 109;
169 DocsUIRootVisitedReported docs_ui_root_visited = 110;
170 DocsUIStartupMsReported docs_ui_startup_ms = 111;
171 DocsUIUserActionReported docs_ui_user_action_reported = 112;
Yao Chend54f9dd2017-10-17 17:37:48 +0000172 }
David Chenc8a43242017-10-17 16:23:28 -0700173
David Chen6e3e6cb2018-01-03 16:14:06 -0800174 // Pulled events will start at field 10000.
Rafal Slawik3bea8952018-11-15 12:39:33 +0000175 // Next: 10043
David Chenc8a43242017-10-17 16:23:28 -0700176 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800177 WifiBytesTransfer wifi_bytes_transfer = 10000;
178 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
179 MobileBytesTransfer mobile_bytes_transfer = 10002;
180 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800181 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800182 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800183 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800184 CpuTimePerFreq cpu_time_per_freq = 10008;
185 CpuTimePerUid cpu_time_per_uid = 10009;
186 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800187 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800188 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800189 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800190 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800191 SystemElapsedRealtime system_elapsed_realtime = 10014;
192 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800193 CpuActiveTime cpu_active_time = 10016;
194 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000195 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800196 RemainingBatteryCapacity remaining_battery_capacity = 10019;
197 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800198 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100199 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100200 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100201 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000202 DiskStats disk_stats = 10025;
203 DirectoryUsage directory_usage = 10026;
204 AppSize app_size = 10027;
205 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700206 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700207 BatteryVoltage battery_voltage = 10030;
Tej Singhd6d6d772018-09-05 17:41:25 -0700208 NumFingerprints num_fingerprints = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700209 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700210 PowerProfile power_profile = 10033;
Chenjie Yub52779e2018-10-05 12:03:36 -0700211 ProcStats proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700212 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100213 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100214 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700215 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800216 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
217 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
218 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000219 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800220 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800221 BuildInformation build_information = 10044;
David Chenc8a43242017-10-17 16:23:28 -0700222 }
yroa1fe77c2018-02-26 14:22:54 -0800223
Bookatz76aafcf2018-09-17 16:17:10 -0700224 // DO NOT USE field numbers above 100,000 in AOSP.
225 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
226 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700227}
228
Yao Chend54f9dd2017-10-17 17:37:48 +0000229/**
Yangster-mac20877162017-12-22 17:19:39 -0800230 * This proto represents a node of an attribution chain.
231 * Note: All attribution chains are represented as a repeated field of type
232 * AttributionNode. It is understood that in such arrays, the order is that
233 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000234 */
Yangster-mac20877162017-12-22 17:19:39 -0800235message AttributionNode {
236 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800237 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800238
Yangster-mac20877162017-12-22 17:19:39 -0800239 // The (optional) string tag for an element in the attribution chain. If the
240 // element has no tag, it is encoded as an empty string.
241 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700242}
243
Yangster-mac48b3d622018-08-18 12:38:11 -0700244message KeyValuePair {
245 optional int32 key = 1;
246 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700247 int32 value_int = 2;
248 int64 value_long = 3;
249 string value_str = 4;
250 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700251 }
252}
253
254message KeyValuePairsAtom {
255 optional int32 uid = 1;
256 repeated KeyValuePair pairs = 2;
257}
258
Yao Chend54f9dd2017-10-17 17:37:48 +0000259/*
260 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800261 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000262 *
263 * RULES:
264 * - The field ids for each atom must start at 1, and count upwards by 1.
265 * Skipping field ids is not allowed.
266 * - These form an API, so renaming, renumbering or removing fields is
267 * not allowed between android releases. (This is not currently enforced,
268 * but there will be a tool to enforce this restriction).
269 * - The types must be built-in protocol buffer types, namely, no sub-messages
270 * are allowed (yet). The bytes type is also not allowed.
271 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800272 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000273 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800274 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000275 * - A field that is a uid should be a string field, tagged with the [xxx]
276 * annotation. The generated code on android will be represented by UIDs,
277 * and those UIDs will be translated in xxx to those strings.
278 *
279 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700280 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000281 * - If there is a UID, it goes first. Think in an object-oriented fashion.
282 * *****************************************************************************
283 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700284
Yao Chend54f9dd2017-10-17 17:37:48 +0000285/**
Yangster-mace16189a2018-08-26 12:20:16 -0700286 * Logs when the Thermal service HAL notifies the throttling start/stop events.
287 *
288 * Logged from:
289 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
290 */
291message ThermalThrottlingStateChanged {
292 optional android.os.TemperatureTypeEnum sensor_type = 1;
293
294 enum State {
295 UNKNOWN = 0;
296 START = 1;
297 STOP = 2;
298 }
299
300 optional State state = 2;
301
302 optional float temperature = 3;
303}
304
305/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000306 * Logs when the screen state changes.
307 *
308 * Logged from:
309 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
310 */
311message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800312 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700313 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700314}
Yao Chend54f9dd2017-10-17 17:37:48 +0000315
316/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700317 * Logs that the process state of the uid, as determined by ActivityManager
318 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000319 *
320 * Logged from:
321 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
322 */
Bookatzc1a050a2017-10-10 15:49:28 -0700323message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700324 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000325
Bookatzdb026a22018-01-10 19:01:56 -0800326 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700327 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000328}
329
330/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700331 * Logs process state change of a process, as per the activity manager.
332 *
333 * Logged from:
334 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
335 */
336message ProcessStateChanged {
337 optional int32 uid = 1;
338 optional string process_name = 2;
339 optional string package_name = 3;
340 // TODO: remove this when validation is done
341 optional int64 version = 5;
342 // The state, from frameworks/base/core/proto/android/app/enums.proto.
343 optional android.app.ProcessStateEnum state = 4;
344}
345
346/**
347 * Logs when ActivityManagerService sleep state is changed.
348 *
349 * Logged from:
350 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
351 */
352message ActivityManagerSleepStateChanged {
353 // TODO: import frameworks proto
354 enum State {
355 UNKNOWN = 0;
356 ASLEEP = 1;
357 AWAKE = 2;
358 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700359 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700360}
361
362/**
363 * Logs when system memory state changes.
364 *
365 * Logged from:
366 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
367 */
368message MemoryFactorStateChanged {
369 // TODO: import frameworks proto
370 enum State {
371 MEMORY_UNKNOWN = 0;
372 NORMAL = 1; // normal.
373 MODERATE = 2; // moderate memory pressure.
374 LOW = 3; // low memory.
375 CRITICAL = 4; // critical memory.
376
377 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700378 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700379}
380
381/**
382 * Logs when app is using too much cpu, according to ActivityManagerService.
383 *
384 * Logged from:
385 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
386 */
387message ExcessiveCpuUsageReported {
388 optional int32 uid = 1;
389 optional string process_name = 2;
390 optional string package_name = 3;
391 // package version. TODO: remove this when validation is done
392 optional int64 version = 4;
393}
394
395/**
396 * Logs when a cached process is killed, along with its pss.
397 *
398 * Logged from:
399 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
400 */
401message CachedKillReported {
402 optional int32 uid = 1;
403 optional string process_name = 2;
404 optional string package_name = 3;
405 // TODO: remove this when validation is done
406 optional int64 version = 5;
407 optional int64 pss = 4;
408}
409
410/**
411 * Logs when memory stats of a process is reported.
412 *
413 * Logged from:
414 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
415 */
416message ProcessMemoryStatReported {
417 optional int32 uid = 1;
418 optional string process_name = 2;
419 optional string package_name = 3;
420 //TODO: remove this when validation is done
421 optional int64 version = 9;
422 optional int64 pss = 4;
423 optional int64 uss = 5;
424 optional int64 rss = 6;
425 enum Type {
426 ADD_PSS_INTERNAL_SINGLE = 0;
427 ADD_PSS_INTERNAL_ALL_MEM = 1;
428 ADD_PSS_INTERNAL_ALL_POLL = 2;
429 ADD_PSS_EXTERNAL = 3;
430 ADD_PSS_EXTERNAL_SLOW = 4;
431 }
432 optional Type type = 7;
433 optional int64 duration = 8;
434}
435
436/**
Bookatzc1a050a2017-10-10 15:49:28 -0700437 * Logs that a process started, finished, crashed, or ANRed.
438 *
439 * Logged from:
440 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
441 */
442message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700443 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700444
David Chen0b5c90c2018-01-25 16:51:49 -0800445 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800446 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700447
Bookatzddccf0a2017-11-28 16:48:14 -0800448 // What lifecycle state the process changed to.
449 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800450 enum State {
451 FINISHED = 0;
452 STARTED = 1;
453 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800454 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800455 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700456}
457
Bookatzc1a050a2017-10-10 15:49:28 -0700458/**
459 * Logs when the ble scan state changes.
460 *
461 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700462 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700463 */
464message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800465 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700466
467 enum State {
468 OFF = 0;
469 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700470 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
471 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700472 }
473 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700474
Bookatze5ec0b42018-03-26 13:34:56 -0700475 // Does the scan have a filter.
476 optional bool is_filtered = 3;
477 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
478 optional bool is_first_match = 4;
479 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
480 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700481}
482
483/**
484 * Logs reporting of a ble scan finding results.
485 *
486 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700487 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700488 */
Bookatzae6738e2018-09-13 11:38:56 -0700489// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700490message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800491 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700492
493 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800494 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700495}
496
497/**
498 * Logs when a sensor state changes.
499 *
500 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700501 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700502 */
503message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800504 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700505
Bookatzc1a050a2017-10-10 15:49:28 -0700506 // The id (int) of the sensor.
507 optional int32 sensor_id = 2;
508
509 enum State {
510 OFF = 0;
511 ON = 1;
512 }
513 optional State state = 3;
514}
515
Bookatzc1a050a2017-10-10 15:49:28 -0700516/**
517 * Logs when GPS state changes.
518 *
519 * Logged from:
520 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
521 */
522message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800523 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700524
525 enum State {
526 OFF = 0;
527 ON = 1;
528 }
529 optional State state = 2;
530}
531
Bookatz48d362e2018-11-06 15:49:08 -0800532/**
533 * Logs when GPS signal quality.
534 *
535 * Logged from:
536 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
537 */
538message GpsSignalQualityChanged {
539 optional android.server.location.GpsSignalQualityEnum level = 1;
540}
541
Bookatzc1a050a2017-10-10 15:49:28 -0700542
543/**
544 * Logs when a sync manager sync state changes.
545 *
546 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700547 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700548 */
549message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800550 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700551
David Chen0b5c90c2018-01-25 16:51:49 -0800552 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800553 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700554
555 enum State {
556 OFF = 0;
557 ON = 1;
558 }
559 optional State state = 3;
560}
561
Yangster-mac96353002018-09-05 11:18:55 -0700562/*
563 * Deferred job stats.
564 *
565 * Logged from:
566 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
567*/
568message DeferredJobStatsReported {
569 repeated AttributionNode attribution_node = 1;
570
571 // Number of jobs deferred.
572 optional int32 num_jobs_deferred = 2;
573
574 // Time since the last job runs.
575 optional int64 time_since_last_job_millis = 3;
576}
577
Bookatzc1a050a2017-10-10 15:49:28 -0700578/**
579 * Logs when a job scheduler job state changes.
580 *
581 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700582 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700583 */
584message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800585 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700586
587 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800588 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700589
590 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800591 FINISHED = 0;
592 STARTED = 1;
593 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700594 }
595 optional State state = 3;
596
Tej Singh33a412b2018-03-16 18:43:59 -0700597 // The reason a job has stopped.
598 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700599 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700600 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700601}
602
603/**
604 * Logs when the audio state changes.
605 *
606 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700607 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700608 */
609message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800610 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700611
612 enum State {
613 OFF = 0;
614 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700615 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
616 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700617 }
618 optional State state = 2;
619}
620
621/**
622 * Logs when the video codec state changes.
623 *
624 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700625 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700626 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800627message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800628 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700629
630 enum State {
631 OFF = 0;
632 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700633 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
634 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700635 }
636 optional State state = 2;
637}
638
639/**
640 * Logs when the flashlight state changes.
641 *
642 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700643 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700644 */
645message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800646 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700647
648 enum State {
649 OFF = 0;
650 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700651 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
652 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700653 }
654 optional State state = 2;
655}
656
657/**
658 * Logs when the camera state changes.
659 *
660 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700661 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700662 */
663message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800664 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700665
666 enum State {
667 OFF = 0;
668 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700669 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
670 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700671 }
672 optional State state = 2;
673}
674
675/**
676 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000677 *
678 * Logged from:
679 * TODO
680 */
Bookatzd6746242017-10-24 18:39:35 -0700681message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800682 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000683
Bookatz1a1b0462018-01-12 11:47:03 -0800684 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
685 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700686 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700687
688 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
689 optional string tag = 3;
690
691 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800692 RELEASE = 0;
693 ACQUIRE = 1;
694 CHANGE_RELEASE = 2;
695 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700696 }
697 optional State state = 4;
698}
699
700/**
Bookatzc1a050a2017-10-10 15:49:28 -0700701 * Logs when a partial wakelock is considered 'long' (over 1 min).
702 *
703 * Logged from:
704 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
705 */
706message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800707 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700708
Yao Chend54f9dd2017-10-17 17:37:48 +0000709 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
710 optional string tag = 2;
711
Bookatzc1a050a2017-10-10 15:49:28 -0700712 // TODO: I have no idea what this is.
713 optional string history_tag = 3;
714
715 enum State {
716 OFF = 0;
717 ON = 1;
718 }
719 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000720}
721
Bookatzc1a050a2017-10-10 15:49:28 -0700722/**
Bookatza66083f2018-09-20 17:24:00 -0700723 * Logs when the device is interactive, according to the PowerManager Notifier.
724 *
725 * Logged from:
726 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
727 */
728message InteractiveStateChanged {
729 enum State {
730 OFF = 0;
731 ON = 1;
732 }
733 optional State state = 1;
734}
735
736/**
Bookatzc1a050a2017-10-10 15:49:28 -0700737 * Logs Battery Saver state change.
738 *
739 * Logged from:
740 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
741 */
742message BatterySaverModeStateChanged {
743 enum State {
744 OFF = 0;
745 ON = 1;
746 }
747 optional State state = 1;
748}
749
750/**
751 * Logs Doze mode state change.
752 *
753 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800754 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700755 */
756message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800757 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800758}
759
760
761/**
762 * Logs state change of Doze mode including maintenance windows.
763 *
764 * Logged from:
765 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
766 */
767message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800768 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700769}
770
771/**
772 * Logs screen brightness level.
773 *
774 * Logged from:
775 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
776 */
777message ScreenBrightnessChanged {
778 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
779 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700780}
781
782/**
783 * Logs battery level (percent full, from 0 to 100).
784 *
785 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700786 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700787 */
788message BatteryLevelChanged {
789 // Battery level. Should be in [0, 100].
790 optional int32 battery_level = 1;
791}
792
793/**
794 * Logs change in charging status of the device.
795 *
796 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700797 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700798 */
799message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800800 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
801 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700802}
803
804/**
805 * Logs whether the device is plugged in, and what power source it is using.
806 *
807 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700808 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700809 */
810message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800811 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
812 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700813}
814
Bookatz8c6571b2017-10-24 15:04:41 -0700815/**
816 * Logs when an app's wakeup alarm fires.
817 *
818 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700819 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700820 */
821message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800822 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800823
824 // Name of the wakeup alarm.
825 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700826
827 // Name of source package (for historical reasons, since BatteryStats tracked it).
828 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800829}
830
831/**
832 * Logs when an an app causes the mobile radio to change state.
833 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
834 *
835 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700836 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800837 */
838message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800839 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800840
Bookatz1a1b0462018-01-12 11:47:03 -0800841 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
842 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800843}
844
845/**
846 * Logs when an an app causes the wifi radio to change state.
847 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
848 *
849 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700850 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800851 */
852message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800853 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800854
Bookatz1a1b0462018-01-12 11:47:03 -0800855 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
856 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700857}
858
859/**
860 * Logs kernel wakeup reasons and aborts.
861 *
862 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700863 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700864 */
865message KernelWakeupReported {
866 // Name of the kernel wakeup reason (or abort).
867 optional string wakeup_reason_name = 1;
868
869 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800870 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700871}
872
873/**
874 * Logs wifi locks held by an app.
875 *
876 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700877 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700878 */
879message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800880 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700881
882 enum State {
883 OFF = 0;
884 ON = 1;
885 }
886 optional State state = 2;
887}
888
889/**
890 * Logs wifi signal strength changes.
891 *
892 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700893 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700894 */
895message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800896 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
897 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700898}
899
900/**
901 * Logs wifi scans performed by an app.
902 *
903 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700904 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700905 */
906message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800907 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700908
909 enum State {
910 OFF = 0;
911 ON = 1;
912 }
913 optional State state = 2;
914}
915
916/**
Tej Singh4503e102018-01-04 14:35:01 -0800917 * Logs wifi multicast locks held by an app
918 *
919 * Logged from:
920 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
921 */
922message WifiMulticastLockStateChanged {
923 repeated AttributionNode attribution_node = 1;
924
925 enum State {
926 OFF = 0;
927 ON = 1;
928 }
929 optional State state = 2;
930}
931
932/**
Tej Singh1ea42892018-01-19 09:27:00 -0800933 * Logs shutdown reason and duration on next boot.
934 *
935 * Logged from:
936 * frameworks/base/core/java/com/android/server/BootReceiver.java
937 */
938message ShutdownSequenceReported {
939 // True if shutdown is for a reboot. Default: false if we do not know.
940 optional bool reboot = 1;
941
942 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
943 optional string reason = 2;
944
945 // Beginning of shutdown time in ms using wall clock time since unix epoch.
946 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -0800947 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -0800948
949 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -0800950 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -0800951}
952
Tej Singh6483ea42018-01-25 17:45:49 -0800953
954/**
955 * Logs boot reason and duration.
956 *
957 * Logged from:
958 * system/core/bootstat/bootstat.cpp
959 */
960message BootSequenceReported {
961 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
962 // Default: "<EMPTY>" if not available.
963 optional string bootloader_reason = 1;
964
965 // Reason for system boot. Eg. bootloader, reboot,userrequested
966 // Default: "<EMPTY>" if not available.
967 optional string system_reason = 2;
968
969 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -0800970 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -0800971
972 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800973 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -0800974
975 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -0800976 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -0800977
978 // Time since last boot in ms. Default: 0 if not available.
979 optional int64 time_since_last_boot = 6;
980}
981
Tej Singhc477d9c2018-02-05 18:31:39 -0800982
983/**
984 * Logs call state and disconnect cause (if applicable).
985 *
986 * Logged from:
987 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
988 */
989message CallStateChanged {
990 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
991 // From frameworks/base/core/proto/android/telecomm/enums.proto.
992 optional android.telecom.CallStateEnum call_state = 1;
993
994 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
995 // This value is only applicable when the call_state is DISCONNECTED, and
996 // should always be UNKNOWN if the call_state is not DISCONNECTED.
997 // From frameworks/base/core/proto/android/telecomm/enums.proto.
998 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
999
1000 // True if the call is self-managed, which are apps that use the
1001 // telecom infrastructure to make their own calls.
1002 optional bool self_managed = 3;
1003
1004 // True if call is external. External calls are calls on connected Wear
1005 // devices but show up in Telecom so the user can pull them onto the device.
1006 optional bool external_call = 4;
1007}
1008
Tej Singh1ea42892018-01-19 09:27:00 -08001009/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001010 * Logs keyguard state. The keyguard is the lock screen.
1011 *
1012 * Logged from:
1013 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1014 */
1015message KeyguardStateChanged {
1016 enum State {
1017 UNKNOWN = 0;
1018 // The keyguard is hidden when the phone is unlocked.
1019 HIDDEN = 1;
1020 // The keyguard is shown when the phone is locked (screen turns off).
1021 SHOWN= 2;
1022 // The keyguard is occluded when something is overlaying the keyguard.
1023 // Eg. Opening the camera while on the lock screen.
1024 OCCLUDED = 3;
1025 }
1026 optional State state = 1;
1027}
1028
1029/**
1030 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1031 * prompts the user to enter a password (pattern, pin, etc).
1032 *
1033 * Logged from:
1034 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1035 */
1036
1037message KeyguardBouncerStateChanged {
1038 enum State {
1039 UNKNOWN = 0;
1040 // Bouncer is hidden, either as a result of successfully entering the
1041 // password, screen timing out, or user going back to lock screen.
1042 HIDDEN = 1;
1043 // This is when the user is being prompted to enter the password.
1044 SHOWN = 2;
1045 }
1046 optional State state = 1;
1047}
1048
1049/**
1050 * Logs the result of entering a password into the keyguard bouncer.
1051 *
1052 * Logged from:
1053 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1054 */
1055message KeyguardBouncerPasswordEntered {
1056 enum BouncerResult {
1057 UNKNOWN = 0;
1058 // The password entered was incorrect.
1059 FAILURE = 1;
1060 // The password entered was correct.
1061 SUCCESS = 2;
1062 }
1063 optional BouncerResult result = 1;
1064}
1065
Tej Singha883b372018-02-15 11:30:01 -08001066/*
1067 * Logs changes to the configuration of the device. The configuration is defined
1068 * in frameworks/base/core/java/android/content/res/Configuration.java
1069 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1070 * Please go there to interpret the possible values each field can be.
1071 *
1072 * Logged from:
1073 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1074 */
1075message ResourceConfigurationChanged {
1076 // Bit mask of color capabilities of the screen.
1077 // Contains information about the color gamut and hdr mode of the screen.
1078 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001079 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001080
1081 // The target screen density being rendered to.
1082 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001083 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001084
1085 // Current user preference for the scaling factor for fonts,
1086 // relative to the base density scaling.
1087 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001088 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001089
1090 // Flag indicating whether the hard keyboard is hidden.
1091 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001092 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001093
1094 // The type of keyboard attached to the device.
1095 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1096 optional int32 keyboard = 5;
1097
1098 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1099 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001100 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001101
1102 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1103 // 0 if undefined.
1104 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1105 optional int32 mcc = 7;
1106
1107 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1108 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1109 // MNC_ZERO symbol defined in Configuration.java.
1110 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1111 optional int32 mnc = 8;
1112
1113 // The kind of navigation available on the device.
1114 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1115 optional int32 navigation = 9;
1116
1117 // Flag indicating whether the navigation is available.
1118 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001119 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001120
1121 // Overall orientation of the screen.
1122 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1123 optional int32 orientation = 11;
1124
1125 // The current height of the available screen space, in dp units.
1126 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001127 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001128
1129 // Bit mask of overall layout of the screen.
1130 // Contains information about screen size, whether the screen is wider/taller
1131 // than normal, whether the screen layout is right-tl-left or left-to-right,
1132 // and whether the screen has a rounded shape.
1133 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001134 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001135
1136 // Current width of the available screen space, in dp units.
1137 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001138 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001139
1140 // The smallest screen size an application will see in normal operation.
1141 // This is the smallest value of both screenWidthDp and screenHeightDp
1142 // in portrait and landscape.
1143 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001144 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001145
1146 // The type of touch screen attached to the device.
1147 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1148 optional int32 touchscreen = 16;
1149
1150 // Bit mask of the ui mode.
1151 // Contains information about the overall ui mode of the device.
1152 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1153 // Also contains information about whether the device is in night mode.
1154 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001155 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001156}
1157
Tej Singheee317b2018-03-07 19:28:05 -08001158
1159/**
1160 * Logs changes in the connection state of the mobile radio.
1161 *
1162 * Logged from:
1163 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1164 */
1165message MobileConnectionStateChanged {
1166 // States are from the state machine DataConnection.java.
1167 enum State {
1168 UNKNOWN = 0;
1169 // The connection is inactive, or disconnected.
1170 INACTIVE = 1;
1171 // The connection is being activated, or connecting.
1172 ACTIVATING = 2;
1173 // The connection is active, or connected.
1174 ACTIVE = 3;
1175 // The connection is disconnecting.
1176 DISCONNECTING = 4;
1177 // The connection is disconnecting after creating a connection.
1178 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1179 }
1180 optional State state = 1;
1181 // For multi-sim phones, this distinguishes between the sim cards.
1182 optional int32 sim_slot_index = 2;
1183 // Used to identify the connection. Starts at 0 and increments by 1 for
1184 // every new network created. Resets whenever the device reboots.
1185 optional int32 data_connection_id = 3;
1186 // A bitmask for the capabilities of this connection.
1187 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1188 // Default value (if we have no information): 0
1189 optional int64 capabilities = 4;
1190 // If this connection has internet.
1191 // This just checks if the DEFAULT bit of capabilities is set.
1192 optional bool has_internet = 5;
1193}
1194
1195/**
1196 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1197 *
1198 * Logged from:
1199 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1200 */
1201message MobileRadioTechnologyChanged {
1202 optional android.telephony.NetworkTypeEnum state = 1;
1203 // For multi-sim phones, this distinguishes between the sim cards.
1204 optional int32 sim_slot_index = 2;
1205}
1206
Andrew Chantb56388b2018-03-22 21:07:33 -07001207/**
1208 * Logs the VID and PID of any connected USB devices.
1209 *
1210 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1211 *
1212 * Logged by Vendor.
1213 */
1214message UsbDeviceAttached {
1215 optional int32 vid = 1;
1216 optional int32 pid = 2;
1217 optional bool has_audio = 3;
1218 optional bool has_hid = 4;
1219 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001220 enum State {
1221 STATE_DISCONNECTED = 0;
1222 STATE_CONNECTED = 1;
1223 }
1224 optional State state = 6;
1225 optional int64 last_connect_duration_ms = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001226}
1227
Tej Singheee317b2018-03-07 19:28:05 -08001228
Tej Singhdd7bd352018-02-09 19:33:15 -08001229/**
Tej Singh5d991e12018-03-09 19:48:11 -08001230 * Logs when Bluetooth is enabled and disabled.
1231 *
1232 * Logged from:
1233 * services/core/java/com/android/server/BluetoothManagerService.java
1234 */
1235message BluetoothEnabledStateChanged {
1236 repeated AttributionNode attribution_node = 1;
1237 // Whether or not bluetooth is enabled on the device.
1238 enum State {
1239 UNKNOWN = 0;
1240 ENABLED = 1;
1241 DISABLED = 2;
1242 }
1243 optional State state = 2;
1244 // The reason for being enabled/disabled.
1245 // Eg. Airplane mode, crash, application request.
1246 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1247 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001248 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001249}
1250
1251/**
1252 * Logs when a Bluetooth device connects and disconnects.
1253 *
1254 * Logged from:
1255 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1256 */
1257message BluetoothConnectionStateChanged {
1258 // The state of the connection.
1259 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1260 optional android.bluetooth.ConnectionStateEnum state = 1;
1261 // An identifier that can be used to match connect and disconnect events.
1262 // Currently is last two bytes of a hash of a device level ID and
1263 // the mac address of the bluetooth device that is connected.
1264 optional int32 obfuscated_id = 2;
1265 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1266 // From android.bluetooth.BluetoothAdapter.java
1267 optional int32 bt_profile = 3;
1268}
1269
1270/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001271 * Logs when something is plugged into or removed from the USB-C connector.
1272 *
1273 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001274 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08001275 */
1276message UsbConnectorStateChanged {
1277 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001278 STATE_DISCONNECTED = 0;
1279 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08001280 }
1281 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001282 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08001283 // Last active session in ms.
1284 // 0 when the port is in connected state.
1285 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001286}
1287
1288/**
1289 * Logs the reported speaker impedance.
1290 *
1291 * Logged from:
1292 * Vendor audio implementation.
1293 */
1294message SpeakerImpedanceReported {
1295 optional int32 speaker_location = 1;
1296 optional int32 impedance = 2;
1297}
1298
1299/**
1300 * Logs the report of a failed hardware.
1301 *
1302 * Logged from:
1303 * Vendor HALs.
1304 *
1305 */
1306message HardwareFailed {
1307 enum HardwareType {
1308 HARDWARE_FAILED_UNKNOWN = 0;
1309 HARDWARE_FAILED_MICROPHONE = 1;
1310 HARDWARE_FAILED_CODEC = 2;
1311 HARDWARE_FAILED_SPEAKER = 3;
1312 HARDWARE_FAILED_FINGERPRINT = 4;
1313 }
1314 optional HardwareType hardware_type = 1;
1315
1316 /* hardware_location allows vendors to differentiate between multiple instances of
1317 * the same hardware_type. The specific locations are vendor defined integers,
1318 * referring to board-specific numbering schemes.
1319 */
1320 optional int32 hardware_location = 2;
1321
1322 /* failure_code is specific to the HardwareType of the failed hardware.
1323 * It should use the enum values defined below.
1324 */
1325 enum MicrophoneFailureCode {
1326 MICROPHONE_FAILURE_COMPLETE = 0;
1327 }
1328 enum CodecFailureCode {
1329 CODEC_FAILURE_COMPLETE = 0;
1330 }
1331 enum SpeakerFailureCode {
1332 SPEAKER_FAILURE_COMPLETE = 0;
1333 SPEAKER_FAILURE_HIGH_Z = 1;
1334 SPEAKER_FAILURE_SHORT = 2;
1335 }
1336 enum FingerprintFailureCode {
1337 FINGERPRINT_FAILURE_COMPLETE = 0;
1338 FINGERPRINT_SENSOR_BROKEN = 1;
1339 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1340 }
1341 optional int32 failure_code = 3;
1342}
1343
1344/**
1345 * Log an event when the device has been physically dropped.
1346 * Reported from the /vendor partition.
1347 */
1348message PhysicalDropDetected {
1349 // Confidence that the event was actually a drop, 0 -> 100
1350 optional int32 confidence_pctg = 1;
1351 // Peak acceleration of the drop, in 1/1000s of a g.
1352 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001353 // Duration of freefall in ms
1354 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001355}
1356
1357/**
1358 * Log bucketed battery charge cycles.
1359 *
1360 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08001361 * a given charge point. For example, if 10 cycle buckets are
1362 * initialized, bucket 1 is the lowest 1/10th of the battery,
1363 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08001364 *
1365 * Logged from:
1366 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1367 */
1368message ChargeCyclesReported {
1369 optional int32 cycle_bucket_1 = 1;
1370 optional int32 cycle_bucket_2 = 2;
1371 optional int32 cycle_bucket_3 = 3;
1372 optional int32 cycle_bucket_4 = 4;
1373 optional int32 cycle_bucket_5 = 5;
1374 optional int32 cycle_bucket_6 = 6;
1375 optional int32 cycle_bucket_7 = 7;
1376 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08001377 optional int32 cycle_bucket_9 = 9;
1378 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08001379}
1380
1381/**
Howard Roa46b6582018-09-18 16:45:02 -07001382 * Log battery health snapshot.
1383 *
1384 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
1385 * are snapshotted periodically over 24hrs.
1386 */
1387message BatteryHealthSnapshot {
1388 enum BatterySnapshotType {
1389 UNKNOWN = 0;
1390 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
1391 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
1392 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
1393 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
1394 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
1395 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
1396 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
1397 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
1398 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
1399 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
1400 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
1401 }
1402 optional BatterySnapshotType type = 1;
1403 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07001404 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07001405 // Voltage Battery Voltage, in microVolts.
1406 optional int32 voltage_micro_volt = 3;
1407 // Current Battery current, in microAmps.
1408 optional int32 current_micro_amps = 4;
1409 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
1410 optional int32 open_circuit_micro_volt = 5;
1411 // Resistance Battery Resistance, in microOhms.
1412 optional int32 resistance_micro_ohm = 6;
1413 // Level Battery Level, as % of full.
1414 optional int32 level_percent = 7;
1415}
1416
1417/**
1418 * Log slow I/O operations on the primary storage.
1419 */
1420message SlowIo {
1421 // Classifications of IO Operations.
1422 enum IoOperation {
1423 UNKNOWN = 0;
1424 READ = 1;
1425 WRITE = 2;
1426 UNMAP = 3;
1427 SYNC = 4;
1428 }
1429 optional IoOperation operation = 1;
1430
1431 // The number of slow IO operations of this type over 24 hours.
1432 optional int32 count = 2;
1433}
1434
1435/**
1436 * Log battery caused shutdown with the last recorded voltage.
1437 */
1438message BatteryCausedShutdown {
1439 // The last recorded battery voltage prior to shutdown.
1440 optional int32 last_recorded_micro_volt = 1;
1441}
1442
1443/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001444 * Logs the duration of a davey (jank of >=700ms) when it occurs
1445 *
1446 * Logged from:
1447 * frameworks/base/libs/hwui/JankTracker.cpp
1448 */
1449message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001450 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001451 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001452
Tej Singhbb8554a2018-01-26 11:59:14 -08001453 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001454 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001455}
1456
1457/**
Bookatze5885242017-10-24 20:10:31 -07001458 * Logs phone signal strength changes.
1459 *
1460 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001461 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001462 */
1463message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001464 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1465 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001466}
1467
Yangster4ccebea2018-10-09 17:09:02 -07001468
1469/**
1470 * Logs when the phone state, sim state or signal strength changes
1471 *
1472 * Logged from:
1473 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1474 */
1475message PhoneServiceStateChanged {
1476 optional android.telephony.ServiceStateEnum state = 1;
1477 optional android.telephony.SimStateEnum sim_state = 2;
1478 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1479}
1480
1481/**
1482 * Logs when the phone becomes on or off.
1483 *
1484 * Logged from:
1485 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1486 */
1487message PhoneStateChanged {
1488 enum State {
1489 OFF = 0;
1490 ON = 1;
1491 }
1492 optional State state = 1;
1493}
1494
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001495message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07001496 optional android.stats.launcher.LauncherAction action = 1;
1497 optional android.stats.launcher.LauncherState src_state = 2;
1498 optional android.stats.launcher.LauncherState dst_state = 3;
1499 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001500 optional bool is_swipe_up_enabled = 5;
1501}
1502
David Chenc28b2bb2017-10-24 12:52:52 -07001503/**
Fan Zhang916c13b2018-10-16 22:49:45 -07001504 * Logs when Settings UI has changed.
1505 *
1506 * Logged from:
1507 * packages/apps/Settings
1508 */
1509message SettingsUIChanged {
1510 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07001511 * Where this SettingsUIChange event comes from. For example, if
1512 * it's a PAGE_VISIBLE event, where the page is opened from.
1513 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001514 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07001515
1516 /**
1517 * What the UI action is.
1518 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001519 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07001520
1521 /**
1522 * Where the action is happening
1523 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001524 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07001525
1526 /**
1527 * What preference changed in this event.
1528 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001529 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07001530
1531 /**
1532 * The new value of the changed preference.
1533 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001534 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07001535}
1536
1537/**
David Chenc28b2bb2017-10-24 12:52:52 -07001538 * Logs that a setting was updated.
1539 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001540 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001541 * The tag and is_default allow resetting of settings to default values based on the specified
1542 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1543 */
1544message SettingChanged {
1545 // The name of the setting.
1546 optional string setting = 1;
1547
1548 // The change being imposed on this setting. May represent a number, eg "3".
1549 optional string value = 2;
1550
1551 // The new value of this setting. For most settings, this is same as value. For some settings,
1552 // value is +X or -X where X represents an element in a set. For example, if the previous value
1553 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1554 // The +/- feature is currently only used for location_providers_allowed.
1555 optional string new_value = 3;
1556
1557 // The previous value of this setting.
1558 optional string prev_value = 4;
1559
1560 // The tag used with the is_default for resetting sets of settings. This is generally null.
1561 optional string tag = 5;
1562
Bookatz90867622018-01-31 15:05:57 -08001563 // True if this setting with tag should be resettable.
1564 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001565
David Chenbd789912018-03-16 17:19:55 -07001566 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001567 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001568
1569 enum ChangeReason {
1570 UPDATED = 1; // Updated can be an insertion or an update.
1571 DELETED = 2;
1572 }
1573 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001574}
Chenjie Yub3dda412017-10-24 13:41:59 -07001575
Chenjie Yu05013b32017-11-21 10:21:41 -08001576/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001577 * Logs activity going to foreground or background
1578 *
1579 * Logged from:
1580 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1581 */
1582message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001583 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001584 optional string pkg_name = 2;
1585 optional string class_name = 3;
1586
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001587 enum State {
1588 BACKGROUND = 0;
1589 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001590 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001591 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001592}
David Chenc8a43242017-10-17 16:23:28 -07001593
1594/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001595 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001596 * Logged from:
1597 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1598 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001599message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001600 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001601
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001602 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001603
1604 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001605 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001606 optional string process_name = 3;
1607
1608 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001609 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001610
1611 optional string package_name = 5;
1612
1613 enum InstantApp {
1614 UNAVAILABLE = 0;
1615 FALSE = 1;
1616 TRUE = 2;
1617 }
1618 optional InstantApp is_instant_app = 6;
1619
1620 enum ForegroundState {
1621 UNKNOWN = 0;
1622 BACKGROUND = 1;
1623 FOREGROUND = 2;
1624 }
1625 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08001626
1627 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001628}
David Chen9e3808c2017-11-20 17:25:34 -08001629
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001630/**
1631 * Logs when a WTF (What a Terrible Failure) happened.
1632 * Logged from:
1633 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1634 */
1635message WTFOccurred {
1636 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001637
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001638 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001639
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001640 // The name of the process.
1641 // system_server if it is not by an app
1642 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001643
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001644 // The pid if available. -1 means not available.
1645 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08001646
1647 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001648}
1649
1650/**
1651 * Logs when system server reports low memory.
1652 * Logged from:
1653 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1654 */
1655message LowMemReported {
1656}
1657
1658/**
1659 * Logs when an app ANR (App Not Responding) occurs.
1660 * Logged from:
1661 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1662 */
1663message ANROccurred {
1664 optional int32 uid = 1 [(is_uid) = true];
1665
1666 optional string process_name = 2;
1667
1668 optional string short_component_name = 3;
1669
1670 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001671
1672 enum InstantApp {
1673 UNAVAILABLE = 0;
1674 FALSE = 1;
1675 TRUE = 2;
1676 }
1677 optional InstantApp is_instant_app = 5;
1678
1679 enum ForegroundState {
1680 UNKNOWN = 0;
1681 BACKGROUND = 1;
1682 FOREGROUND = 2;
1683 }
1684 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08001685
1686 optional android.server.ErrorSource error_source = 7;
1687
1688 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08001689}
1690
Bookatza7020bd2018-08-28 16:29:35 -07001691/**
1692 * Logs when the vibrator state changes.
1693 * Logged from:
1694 * frameworks/base/services/core/java/com/android/server/VibratorService.java
1695 */
1696message VibratorStateChanged {
1697 repeated AttributionNode attribution_node = 1;
1698
1699 enum State {
1700 OFF = 0;
1701 ON = 1;
1702 }
1703 optional State state = 2;
1704
1705 // Duration (in milliseconds) requested to keep the vibrator on.
1706 // Only applicable for State == ON.
1707 optional int64 duration_millis = 3;
1708}
1709
David Chen0a368b22017-12-06 16:28:16 -08001710/*
1711 * Allows other apps to push events into statsd.
1712 * Logged from:
1713 * frameworks/base/core/java/android/util/StatsLog.java
1714 */
David Chen0b5c90c2018-01-25 16:51:49 -08001715message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08001716 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001717 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08001718
1719 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
1720 optional int32 label = 2;
1721
1722 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
1723 // predicates for the metrics).
1724 enum State {
1725 UNKNOWN = 0;
1726 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
1727 STOP = 2;
1728 START = 3;
1729 }
1730 optional State state = 3;
1731}
1732
David Chen9e3808c2017-11-20 17:25:34 -08001733/**
Bookatz7948c872018-09-04 12:58:33 -07001734 * Logs the wall-clock time when a significant wall-clock time shift occurs.
1735 * For example, this could be due to the user manually changing the time.
1736 *
1737 * Logged from:
1738 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
1739 */
1740message WallClockTimeShifted {
1741 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
1742 optional int64 wall_clock_timestamp_millis = 1;
1743}
1744
1745/**
Bookatz8fcd09a2017-12-18 13:01:10 -08001746 * Logs when statsd detects an anomaly.
1747 *
1748 * Logged from:
1749 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
1750 */
1751message AnomalyDetected {
1752 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07001753 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08001754
Yangster-mac94e197c2018-01-02 16:03:03 -08001755 // Id of the config whose anomaly detection alert fired.
1756 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08001757
Yangster-mac94e197c2018-01-02 16:03:03 -08001758 // Id of the alert (i.e. name of the anomaly that was detected).
1759 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08001760}
1761
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001762message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001763 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001764 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001765
1766 // The app package name.
1767 optional string pkg_name = 2;
1768
1769 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001770 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001771 WARM = 1;
1772 HOT = 2;
1773 COLD = 3;
1774 }
1775 // The transition type.
1776 optional TransitionType type = 3;
1777
1778 // The activity name.
1779 optional string activity_name = 4;
1780
1781 // The name of the calling app. Empty if not set.
1782 optional string calling_pkg_name = 5;
1783
1784 // Whether the app is an instant app.
1785 optional bool is_instant_app = 6;
1786
1787 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08001788 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001789
Bookatz80d11a02018-01-16 10:46:35 -08001790 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001791
David Chen0b5c90c2018-01-25 16:51:49 -08001792 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001793 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001794 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001795 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001796 optional int32 bind_application_delay_millis = 11;
1797 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001798
1799 // Empty if not set.
1800 optional string launch_token = 13;
1801
Calin Juravle759fbda2018-02-20 19:52:30 +00001802 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001803 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00001804
1805 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001806 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001807}
1808
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001809message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001810 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001811 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001812
1813 // The app package name.
1814 optional string pkg_name = 2;
1815
1816 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001817 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001818 WARM = 1;
1819 HOT = 2;
1820 COLD = 3;
1821 }
1822 // The transition type.
1823 optional TransitionType type = 3;
1824
1825 // The activity name.
1826 optional string activity_name = 4;
1827}
1828
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001829message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001830 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001831 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001832
1833 // The app package name.
1834 optional string pkg_name = 2;
1835
1836 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001837 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001838 WITH_BUNDLE = 1;
1839 WITHOUT_BUNDLE = 2;
1840 }
1841 // The transition type.
1842 optional TransitionType type = 3;
1843
1844 // The activity name.
1845 optional string activity_name = 4;
1846
1847 optional bool transition_process_running = 5;
1848
1849 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08001850 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001851}
1852
Bookatz8fcd09a2017-12-18 13:01:10 -08001853/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08001854 * Logs a picture-in-picture action
1855 * Logged from:
1856 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1857 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
1858 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
1859 */
1860message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001861 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07001862 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08001863
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001864 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001865
Chenjie Yu52cacc62017-12-08 18:11:45 -08001866 enum State {
1867 ENTERED = 1;
1868 EXPANDED_TO_FULL_SCREEN = 2;
1869 MINIMIZED = 3;
1870 DISMISSED = 4;
1871 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001872 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001873}
1874
1875/**
Chenjie Yue8904192017-12-08 19:12:57 -08001876 * Logs overlay action
1877 * Logged from:
1878 * services/core/java/com/android/server/wm/Session.java
1879 */
1880message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001881 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08001882
1883 optional string package_name = 2;
1884
1885 optional bool using_alert_window = 3;
1886
1887 enum State {
1888 ENTERED = 1;
1889 EXITED = 2;
1890 }
1891 optional State state = 4;
1892}
1893
Chenjie Yuccfe6452018-01-30 11:33:21 -08001894/*
1895 * Logs foreground service starts and stops.
1896 * Note that this is not when a service starts or stops, but when it is
1897 * considered foreground.
1898 * Logged from
1899 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
1900 */
1901message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001902 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08001903 // package_name + "/" + class_name
1904 optional string short_name = 2;
1905
1906 enum State {
1907 ENTER = 1;
1908 EXIT = 2;
1909 }
1910 optional State state = 3;
1911}
1912
Chenjie Yue8904192017-12-08 19:12:57 -08001913/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08001914 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
1915 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
1916 * attributed back to the parent (host) uid. One example is Chrome.
1917 *
1918 * Logged from:
1919 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1920 */
1921message IsolatedUidChanged {
1922 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001923 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07001924 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08001925 optional int32 parent_uid = 1;
1926
1927 optional int32 isolated_uid = 2;
1928
1929 // We expect an isolated uid to be removed before if it's used for another parent uid.
1930 enum Event {
1931 REMOVED = 0;
1932 CREATED = 1;
1933 }
1934 optional Event event = 3;
1935}
1936
1937/*
1938 * Logs the reception of an incoming network packet causing the main system to wake up for
1939 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
1940 * and processed by WakeupController.cpp.
1941 */
1942message PacketWakeupOccurred {
1943 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
1944 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07001945 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001946 // The interface name on which the packet was received.
1947 optional string iface = 2;
1948 // The ethertype value of the packet.
1949 optional int32 ethertype = 3;
1950 // String representation of the destination MAC address of the packet.
1951 optional string destination_hardware_address = 4;
1952 // String representation of the source address of the packet if this was an IP packet.
1953 optional string source_ip = 5;
1954 // String representation of the destination address of the packet if this was an IP packet.
1955 optional string destination_ip = 6;
1956 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
1957 // field if this was an IPv6 packet. The range of possible values is the same for both IP
1958 // families.
1959 optional int32 ip_next_header = 7;
1960 // The source port if this was a TCP or UDP packet.
1961 optional int32 source_port = 8;
1962 // The destination port if this was a TCP or UDP packet.
1963 optional int32 destination_port = 9;
1964}
1965
1966/*
1967 * Logs the memory stats for an app on startup.
1968 * Logged from:
1969 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1970 */
1971message AppStartMemoryStateCaptured {
1972 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001973 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001974
1975 // The process name.
1976 optional string process_name = 2;
1977
1978 // The activity name.
1979 optional string activity_name = 3;
1980
1981 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07001982 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08001983
1984 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07001985 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08001986
1987 // RSS
1988 optional int64 rss_in_bytes = 6;
1989
1990 // CACHE
1991 optional int64 cache_in_bytes = 7;
1992
1993 // SWAP
1994 optional int64 swap_in_bytes = 8;
1995}
1996
1997/*
1998 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
1999 * for LMK event.
2000 * Logged from:
2001 * system/core/lmkd/lmkd.c
2002 */
2003message LmkStateChanged {
2004 enum State {
2005 UNKNOWN = 0;
2006 START = 1;
2007 STOP = 2;
2008 }
2009 optional State state = 1;
2010}
2011
2012/*
2013 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2014 * Logged from:
2015 * system/core/lmkd/lmkd.c
2016 */
2017message LmkKillOccurred {
2018 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002019 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002020
2021 // The process name.
2022 optional string process_name = 2;
2023
2024 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002025 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002026
2027 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002028 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002029
2030 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002031 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002032
2033 // RSS
2034 optional int64 rss_in_bytes = 6;
2035
2036 // CACHE
2037 optional int64 cache_in_bytes = 7;
2038
2039 // SWAP
2040 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002041
2042 // The elapsed real time of start of the process.
2043 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002044}
2045
Rajeev Kumar51b54602018-03-01 12:18:26 -08002046/*
2047 * Logs when the ActivityManagerService detects that an app died.
2048 *
2049 * Logged from:
2050 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2051 */
2052message AppDied {
2053 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002054 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002055}
2056
Howard Ro21a039c2018-08-06 14:55:47 -07002057/**
2058 * An atom for generic metrics logging. Available from Android Q.
2059 */
2060message GenericAtom {
2061 // The uid of the application that sent this custom atom.
2062 optional int32 uid = 1 [(is_uid) = true];
2063
2064 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002065 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002066}
2067
Tej Singhd6d6d772018-09-05 17:41:25 -07002068/**
2069 * Logs when a fingerprint acquire event occurs.
2070 *
2071 * Logged from:
2072 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2073 */
2074message FingerprintAcquired {
2075 // The associated user. Eg: 0 for owners, 10+ for others.
2076 // Defined in android/os/UserHandle.java
2077 optional int32 user = 1;
2078 // If this acquire is for a crypto fingerprint.
2079 // e.g. Secure purchases, unlock password storage.
2080 optional bool is_crypto = 2;
2081}
2082
2083/**
2084 * Logs when a fingerprint authentication event occurs.
2085 *
2086 * Logged from:
2087 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2088 */
2089message FingerprintAuthenticated {
2090 // The associated user. Eg: 0 for owners, 10+ for others.
2091 // Defined in android/os/UserHandle.java
2092 optional int32 user = 1;
2093 // If this authentication is for a crypto fingerprint.
2094 // e.g. Secure purchases, unlock password storage.
2095 optional bool is_crypto = 2;
2096 // Whether or not this authentication was successful.
2097 optional bool is_authenticated = 3;
2098}
2099
2100/**
2101 * Logs when a fingerprint error occurs.
2102 *
2103 * Logged from:
2104 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2105 */
2106message FingerprintErrorOccurred {
2107 // The associated user. Eg: 0 for owners, 10+ for others.
2108 // Defined in android/os/UserHandle.java
2109 optional int32 user = 1;
2110 // If this error is for a crypto fingerprint.
2111 // e.g. Secure purchases, unlock password storage.
2112 optional bool is_crypto = 2;
2113
2114 enum Error {
2115 UNKNOWN = 0;
2116 LOCKOUT = 1;
2117 PERMANENT_LOCKOUT = 2;
2118 }
2119 // The type of error.
2120 optional Error error = 3;
2121}
Howard Ro688ae182018-09-25 00:09:36 -07002122
2123message Notification {
2124
2125 // Type of notification event.
2126 enum Type {
2127 TYPE_UNKNOWN = 0;
2128 // Notification became visible to the user.
2129 TYPE_OPEN = 1;
2130 // Notification became hidden.
2131 TYPE_CLOSE = 2;
2132 // Notification switched to detail mode.
2133 TYPE_DETAIL = 3;
2134 // Notification was clicked.
2135 TYPE_ACTION = 4;
2136 // Notification was dismissed.
2137 TYPE_DISMISS = 5;
2138 // Notification switched to summary mode. The enum value of 14 is to
2139 // match that of metrics_constants.
2140 TYPE_COLLAPSE = 14;
2141 }
2142 optional Type type = 1;
2143
2144 // Package name associated with the notification.
2145 optional string package_name = 2;
2146
2147 // Tag associated with notification.
2148 optional string tag = 3;
2149
2150 // Application-supplied ID associated with the notification.
2151 optional int32 id = 4;
2152
2153 // Index of notification in the notification panel.
2154 optional int32 shade_index = 5;
2155
2156 // The number of notifications in the notification panel.
2157 optional int32 shade_count = 6;
2158
2159 // Importance for the notification.
2160 optional int32 importance = 7;
2161
2162 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07002163 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07002164
2165 // Importance for the notification channel.
2166 optional int32 channel_importance = 9;
2167
Howard Ro183c2bd2018-10-18 13:52:10 -07002168 // Application-supplied ID associated with the notifications group.
2169 optional string group_id = 10;
2170
Howard Ro688ae182018-09-25 00:09:36 -07002171 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07002172 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07002173
Howard Ro183c2bd2018-10-18 13:52:10 -07002174 // Reason for dismissal of a notification. This field is only meaningful for
2175 // TYPE_DISMISS events.
2176 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07002177
Howard Ro183c2bd2018-10-18 13:52:10 -07002178 // The first post time of notification, stable across updates.
2179 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07002180
Howard Ro183c2bd2018-10-18 13:52:10 -07002181 // The most recent interruption time, or the creation time if no updates.
2182 // Differs from update_millis because updates are filtered based on whether
2183 // they actually interrupted the user.
2184 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07002185
Howard Ro183c2bd2018-10-18 13:52:10 -07002186 // The most recent update time, or the creation time if no updates.
2187 optional int64 update_millis = 15;
2188
2189 // The most recent visibility event.
2190 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07002191}
2192
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002193/*
Yangster-macb89807e2018-11-15 21:10:57 -08002194 * Logs when a flag flip state changes.
2195 * Logged in P/h.
2196 */
2197message PhenotypeFlagStateChanged {
2198 // Mendel configuration name.
2199 optional string mendel_config_name = 1;
2200 // State
2201 enum State {
2202 STATE_UNKNOWN = 0;
2203 COMMITTED = 1;
2204 }
2205 optional State state = 2;
2206}
2207
2208/*
2209 * Logs when a binary push state changes.
2210 * Logged in Play store
2211 */
2212message BinaryPushStateChanged {
2213 // Binary package name.
2214 optional string binary_name = 1;
2215 // Version code.
2216 optional int64 version = 2;
2217 // State
2218 enum State {
2219 STATE_UNKNOWN = 0;
2220 DOWNLOAD_START = 1;
2221 DOWNLOAD_DONE = 2;
2222 INSTALL_START = 3;
2223 INSTALL_DONE = 4;
2224 REBOOT_START = 5;
2225 REBOOT_DONE = 6;
2226 }
2227 optional State state = 3;
2228}
2229
2230/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002231 * Logs when a connection becomes available and lost.
2232 * Logged in StatsCompanionService.java
2233 */
2234message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002235 // Id of the network.
2236 optional int32 net_id = 1;
2237
2238 enum State {
2239 UNKNOWN = 0;
2240 CONNECTED = 1;
2241 DISCONNECTED = 2;
2242 }
2243 // Connected state of a network.
2244 optional State state = 2;
2245}
2246
2247/**
2248 * Logs when a service starts and stops.
2249 * Logged from:
2250 * services/core/java/com/android/server/am/ActiveServices.java
2251 */
2252message ServiceStateChanged {
2253
2254 optional int32 uid = 1 [(is_uid) = true];
2255
2256 optional string package_name = 2;
2257
2258 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002259
2260 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002261 START = 1;
2262 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002263 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07002264
2265 optional State state = 4;
2266}
2267
2268/**
2269 * Logs when a service is launched.
2270 * Logged from:
2271 * services/core/java/com/android/server/am/ActiveServices.java
2272 */
2273message ServiceLaunchReported {
2274
2275 optional int32 uid = 1 [(is_uid) = true];
2276
2277 optional string package_name = 2;
2278
2279 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002280}
Howard Ro688ae182018-09-25 00:09:36 -07002281
Chenjie Yubbcbc602018-02-05 16:51:52 -08002282//////////////////////////////////////////////////////////////////////
2283// Pulled atoms below this line //
2284//////////////////////////////////////////////////////////////////////
2285
2286/**
David Chenc8a43242017-10-17 16:23:28 -07002287 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
2288 *
2289 * Pulled from:
2290 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2291 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002292message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002293 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002294
2295 optional int64 rx_bytes = 2;
2296
2297 optional int64 rx_packets = 3;
2298
2299 optional int64 tx_bytes = 4;
2300
2301 optional int64 tx_packets = 5;
2302}
2303
2304/**
2305 * Pulls bytes transferred via wifi (separated by foreground and background usage).
2306 *
2307 * Pulled from:
2308 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2309 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002310message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002311 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002312
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002313 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2314 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002315
2316 optional int64 rx_bytes = 3;
2317
2318 optional int64 rx_packets = 4;
2319
2320 optional int64 tx_bytes = 5;
2321
2322 optional int64 tx_packets = 6;
2323}
2324
2325/**
2326 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2327 *
2328 * Pulled from:
2329 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2330 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002331message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002332 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002333
2334 optional int64 rx_bytes = 2;
2335
2336 optional int64 rx_packets = 3;
2337
2338 optional int64 tx_bytes = 4;
2339
2340 optional int64 tx_packets = 5;
2341}
2342
2343/**
2344 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
2345 *
2346 * Pulled from:
2347 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2348 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002349message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002350 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002351
Yao Chenc40a19d2018-03-15 16:48:25 -07002352 // 1 denotes foreground and 0 denotes background. This is called Set in
2353 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002354 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002355
2356 optional int64 rx_bytes = 3;
2357
2358 optional int64 rx_packets = 4;
2359
2360 optional int64 tx_bytes = 5;
2361
2362 optional int64 tx_packets = 6;
2363}
2364
2365/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002366 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2367 *
2368 * Pulled from:
2369 * StatsCompanionService
2370 */
2371message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002372 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002373
2374 optional int64 rx_bytes = 2;
2375
2376 optional int64 tx_bytes = 3;
2377}
2378
2379/**
David Chenc8a43242017-10-17 16:23:28 -07002380 * Pulls the kernel wakelock durations. This atom is adapted from
2381 * android/internal/os/KernelWakelockStats.java
2382 *
2383 * Pulled from:
2384 * StatsCompanionService using KernelWakelockReader.
2385 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002386message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002387 optional string name = 1;
2388
2389 optional int32 count = 2;
2390
2391 optional int32 version = 3;
2392
Yangster-maca8a30442018-10-13 23:46:34 -07002393 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07002394}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002395
Chenjie Yu05013b32017-11-21 10:21:41 -08002396/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002397 * Pulls low power state information. If power.stats HAL is not available, this
2398 * includes platform and subsystem sleep state information,
2399 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
2400 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002401 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002402 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002403 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
2404 * as defined in:
2405 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002406 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002407message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002408 // Subsystem name
2409 optional string subsystem_name = 1;
2410 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2411 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002412 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
2413 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002414 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002415 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002416 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002417 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002418 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002419}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002420
Chenjie Yu05013b32017-11-21 10:21:41 -08002421/**
Bookatz92da2832018-11-01 18:10:03 -07002422 * Pulls on-device power measurement information.
2423 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
2424 * Pulled from:
2425 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
2426 */
2427message OnDevicePowerMeasurement {
2428 // Name of the subsystem (to which the rail belongs).
2429 optional string subsystem_name = 1;
2430
2431 // Rail name. The rail lies within the subsystem.
2432 optional string rail_name = 2;
2433
2434 // Time (in ms since boot) at which the rail energy value was measured.
2435 // This may differ slightly from the time that statsd logs this information.
2436 optional uint64 measurement_timestamp_millis = 3;
2437
2438 // Accumulated energy used via the rail since device boot in uWs.
2439 optional uint64 energy_microwatt_secs = 4;
2440}
2441
2442/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002443 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002444 * Pulls the time the cpu spend on the frequency index. Frequency index
2445 * starts from highest to lowest. The value should be monotonically
2446 * increasing since boot. However, if there is a cpu
2447 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002448 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002449message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002450 optional uint32 cluster = 1;
2451 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002452 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002453}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002454
Chenjie Yu05013b32017-11-21 10:21:41 -08002455/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002456 * Pulls Cpu Time Per Uid.
2457 * Note that isolated process uid time should be attributed to host uids.
2458 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002459message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002460 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00002461 optional uint64 user_time_micros = 2;
2462 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002463}
2464
2465/**
2466 * Pulls Cpu Time Per Uid per frequency.
2467 * Note that isolated process uid time should be attributed to host uids.
2468 * For each uid, we order the time by descending frequencies.
2469 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002470message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002471 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002472 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002473 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002474}
Hugo Benichi884970e2017-11-14 22:42:46 +09002475
Chenjie Yu05013b32017-11-21 10:21:41 -08002476/**
2477 * Pulls Wifi Controller Activity Energy Info
2478 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002479message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002480 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002481 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002482 // stack reported state
2483 // TODO: replace this with proto enum
2484 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002485 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002486 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002487 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002488 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002489 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002490 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002491 // product of current(mA), voltage(V) and time(ms)
2492 optional uint64 controller_energy_used = 6;
2493}
2494
2495/**
2496 * Pulls Modem Activity Energy Info
2497 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002498message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002499 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002500 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07002501 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08002502 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002503 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002504 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002505 /**
2506 * Tx power index
2507 * index 0 = tx_power < 0dBm
2508 * index 1 = 0dBm < tx_power < 5dBm
2509 * index 2 = 5dBm < tx_power < 15dBm
2510 * index 3 = 15dBm < tx_power < 20dBm
2511 * index 4 = tx_power > 20dBm
2512 */
2513 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002514 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002515 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002516 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002517 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002518 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002519 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002520 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002521 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002522 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002523 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002524 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002525 // product of current(mA), voltage(V) and time(ms)
2526 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002527}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002528
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002529/**
2530 * Pulls Bluetooth Activity Energy Info
2531 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2532 */
2533message BluetoothActivityInfo {
2534 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002535 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002536 // bluetooth stack state
2537 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002538 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002539 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002540 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002541 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002542 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002543 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002544 // product of current(mA), voltage(V) and time(ms)
2545 optional uint64 energy_used = 6;
2546}
2547
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002548/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002549 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00002550 *
2551 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002552 */
2553message ProcessMemoryState {
2554 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002555 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002556
2557 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002558 // Usually package name, "system" for system server.
2559 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002560 optional string process_name = 2;
2561
Rafal Slawikda51b932018-12-13 16:31:33 +00002562 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07002563 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002564
2565 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002566 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002567
2568 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002569 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002570
Rajeev Kumar90235992018-01-29 11:06:48 -08002571 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00002572 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
2573 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08002574 optional int64 rss_in_bytes = 6;
2575
2576 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00002577 // Value is read from memory.stat, field total_cache if per-app memory
2578 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002579 optional int64 cache_in_bytes = 7;
2580
2581 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00002582 // Value is read from memory.stat, field total_swap if per-app memory
2583 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002584 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01002585
Rafal Slawikd03ae422018-11-20 11:27:45 +00002586 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002587 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00002588
2589 // Elapsed real time when the process started.
2590 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
2591 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002592}
2593
2594/*
Rafal Slawik08621582018-10-15 14:53:07 +01002595 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00002596 *
2597 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01002598 */
2599message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01002600 // The uid if available. -1 means not available.
2601 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01002602
Rafal Slawikbf67d072018-10-23 11:07:54 +01002603 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002604 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01002605 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01002606
Rafal Slawikbf67d072018-10-23 11:07:54 +01002607 // # of page-faults
2608 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01002609
Rafal Slawikbf67d072018-10-23 11:07:54 +01002610 // # of major page-faults
2611 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01002612
Rafal Slawikbf67d072018-10-23 11:07:54 +01002613 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00002614 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01002615 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01002616
Rafal Slawikd03ae422018-11-20 11:27:45 +00002617 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002618 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01002619
2620 // Elapsed real time when the process started.
2621 // Value is read from /proc/PID/stat, field 22.
2622 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01002623}
2624
2625/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00002626 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00002627 *
2628 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
2629 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00002630 *
2631 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002632 */
2633message ProcessMemoryHighWaterMark {
2634 // The uid if available. -1 means not available.
2635 optional int32 uid = 1 [(is_uid) = true];
2636
Rafal Slawikda51b932018-12-13 16:31:33 +00002637 // The process name.
2638 // Usually package name or process cmdline.
2639 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002640 optional string process_name = 2;
2641
2642 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
2643 // /proc/PID/status.
2644 optional int64 rss_high_water_mark_in_bytes = 3;
2645}
2646
2647/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002648 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002649 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002650message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002651 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002652}
2653
2654/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002655 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002656 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002657message SystemUptime {
2658 // Milliseconds since the system was booted.
2659 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
2660 // for external input).
2661 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08002662 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002663}
2664
2665/*
2666 * Reads from /proc/uid_concurrent_active_time which has the format:
2667 * active: X (X is # cores)
2668 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
2669 * [uid1]: [time-0] [time-1] [time-2] ... ...
2670 * ...
2671 * Time-N means the CPU time a UID spent running concurrently with N other processes.
2672 * The file contains a monotonically increasing count of time for a single boot.
2673 */
2674message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002675 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002676 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002677}
2678
2679/**
2680 * Reads from /proc/uid_concurrent_policy_time which has the format:
2681 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
2682 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2683 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2684 * ...
2685 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
2686 * The file contains a monotonically increasing count of time for a single boot.
2687 */
2688message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002689 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002690 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002691 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08002692}
2693
2694/*
2695 * Pulls free disk space, for data, system partition and temporary directory.
2696 */
2697message DiskSpace {
2698 // available bytes in data partition
2699 optional uint64 data_available_bytes = 1;
2700 // available bytes in system partition
2701 optional uint64 system_available_bytes = 2;
2702 // available bytes in download cache or temp directories
2703 optional uint64 temp_available_bytes = 3;
2704}
Tej Singhbf972d92018-01-10 20:51:13 -08002705
2706/**
2707 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002708 * Pulled from:
2709 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002710 */
2711message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07002712 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08002713}
2714
2715/**
2716 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002717 * Pulled from:
2718 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002719 */
2720message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07002721 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08002722}
2723
2724/**
Bookatz17f0d8a2018-09-13 12:56:32 -07002725 * Pulls battery voltage.
2726 * Pulled from:
2727 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2728 */
2729message BatteryVoltage {
2730 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07002731 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07002732}
2733
2734/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08002735 * Pulls battery level (percent full, from 0 to 100).
2736 *
2737 * Pulled from:
2738 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2739 */
2740message BatteryLevel {
2741 // Battery level. Should be in [0, 100].
2742 optional int32 battery_level = 1;
2743}
2744
2745/**
Tej Singhd89137e2018-03-26 14:51:40 -07002746 * Pulls the temperature of various parts of the device.
2747 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08002748 *
2749 * Pulled from:
2750 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
2751 */
2752message Temperature {
2753 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY.
2754 optional android.os.TemperatureTypeEnum sensor_location = 1;
2755
2756 // The name of the temperature source. Eg. CPU0
2757 optional string sensor_name = 2;
2758
Tej Singhd89137e2018-03-26 14:51:40 -07002759 // Temperature in tenths of a degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002760 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08002761}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002762
2763/**
2764 * Pulls the statistics of calls to Binder.
2765 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01002766 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
2767 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002768 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00002769 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002770 */
2771message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00002772 // UID of the process responsible for the binder transaction. It will be set if the process
2773 // executing the binder transaction attribute the transaction to another uid using
2774 // Binder.setThreadWorkSource().
2775 //
2776 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002777 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00002778 // UID of the process executing the binder transaction.
2779 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002780 // Fully qualified class name of the API call.
2781 //
2782 // This is a system server class name.
2783 //
2784 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
2785 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
2786 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
2787 // commonly used APIs.
2788 optional string service_class_name = 2;
2789 // Method name of the API call. It can also be a transaction code if we cannot
2790 // resolve it to a name. See Binder#getTransactionName.
2791 //
2792 // This is a system server method name.
2793 optional string service_method_name = 3;
2794 // Total number of API calls.
2795 optional int64 call_count = 4;
2796 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
2797 optional bool screen_interactive = 13;
2798 // Total number of API calls we have data recorded for. If we collected data for all the calls,
2799 // call_count will be equal to recorded_call_count.
2800 //
2801 // If recorded_call_count is different than call_count, it means data collection has been
2802 // sampled. All the fields below will be sampled in this case.
2803 optional int64 recorded_call_count = 12;
2804 // Number of exceptions thrown by the API.
2805 optional int64 recorded_exception_count = 5;
2806 // Total latency of all API calls.
2807 // Average can be computed using total_latency_micros / recorded_call_count.
2808 optional int64 recorded_total_latency_micros = 6;
2809 // Maximum latency of one API call.
2810 optional int64 recorded_max_latency_micros = 7;
2811 // Total CPU usage of all API calls.
2812 // Average can be computed using total_cpu_micros / recorded_call_count.
2813 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
2814 optional int64 recorded_total_cpu_micros = 8;
2815 // Maximum CPU usage of one API call.
2816 optional int64 recorded_max_cpu_micros = 9;
2817 // Maximum parcel reply size of one API call.
2818 optional int64 recorded_max_reply_size_bytes = 10;
2819 // Maximum parcel request size of one API call.
2820 optional int64 recorded_max_request_size_bytes = 11;
2821}
2822
2823/**
2824 * Pulls the statistics of exceptions during calls to Binder.
2825 *
2826 * Binder stats are cumulative from boot unless somebody reset the data using
2827 * > adb shell dumpsys binder_calls_stats --reset
2828 */
2829message BinderCallsExceptions {
2830 // Exception class name, e.g. java.lang.IllegalArgumentException.
2831 //
2832 // This is an exception class name thrown by the system server.
2833 optional string exception_class_name = 1;
2834 // Total number of exceptions.
2835 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002836}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002837
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002838/**
2839 * Pulls the statistics of message dispatching on HandlerThreads.
2840 *
2841 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
2842 * config on the device.
2843 *
2844 * Next tag: 11
2845 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002846message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01002847 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002848 optional int32 uid = 1 [(is_uid) = true];
2849
2850 // Fully qualified class name of the handler target class.
2851 //
2852 // This field does not contain PII. This is a system server class name.
2853 optional string handler_class_name = 2;
2854
2855 // The name of the thread that runs the Looper.
2856 //
2857 // This field does not contain PII. This is a system server thread name.
2858 optional string looper_thread_name = 3;
2859
2860 // The name of the dispatched message.
2861 //
2862 // This field does not contain PII. This is a system server constant or class
2863 // name.
2864 optional string message_name = 4;
2865
2866 // Total number of successfully dispatched messages.
2867 optional int64 message_count = 5;
2868
2869 // Total number of messages that failed dispatching.
2870 optional int64 exception_count = 6;
2871
2872 // Total number of processed messages we have data recorded for. If we
2873 // collected data for all the messages, message_count will be equal to
2874 // recorded_message_count.
2875 //
2876 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01002877 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002878 optional int64 recorded_message_count = 7;
2879
2880 // Total latency of all processed messages.
2881 // Average can be computed using recorded_total_latency_micros /
2882 // recorded_message_count.
2883 optional int64 recorded_total_latency_micros = 8;
2884
2885 // Total CPU usage of all processed message.
2886 // Average can be computed using recorded_total_cpu_micros /
2887 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002888 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002889 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002890
2891 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
2892 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01002893
2894 // Max recorded CPU usage of all processed messages.
2895 optional int64 recorded_max_cpu_micros = 11;
2896
2897 // Max recorded latency of all processed messages.
2898 optional int64 recorded_max_latency_micros = 12;
2899
2900 // Total number of messages we tracked the dispatching delay for. If we
2901 // collected data for all the messages, message_count will be equal to
2902 // recorded_delay_message_count.
2903 //
2904 // If recorded_delay_message_count is different than message_count, it means data
2905 // collection has been sampled or/and not all messages specified the target dispatch time.
2906 // The fields below will be sampled in this case.
2907 optional int64 recorded_delay_message_count = 13;
2908
2909 // Total dispatching delay of all processed messages.
2910 // Calculated as a difference between the target dispatching time (Message.when)
2911 // and the actual dispatching time.
2912 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
2913 optional int64 recorded_total_delay_millis = 14;
2914
2915 // Max dispatching delay of all processed messages.
2916 // Calculated as a difference between the target dispatching time (Message.when)
2917 // and the actual dispatching time.
2918 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002919}
Tej Singh86dc9db2018-09-06 00:39:57 +00002920
2921/**
2922 * Pulls disk information, such as write speed and latency.
2923 */
2924message DiskStats {
2925 // Time taken to open, write 512B to, and close a file.
2926 // -1 if error performing the check.
2927 optional int64 data_write_latency_millis = 1;
2928
2929 optional bool file_based_encryption = 2;
2930
2931 // Recent disk write speed in kB/s.
2932 // -1 if error querying storageed.
2933 // 0 if data is unavailable.
2934 optional int32 recent_disk_write_speed = 3;
2935}
2936
2937
2938/**
2939 * Free and total bytes of the Data, Cache, and System partition.
2940 */
2941message DirectoryUsage {
2942 enum Directory {
2943 UNKNOWN = 0;
2944 DATA = 1;
2945 CACHE = 2;
2946 SYSTEM = 3;
2947 }
2948 optional Directory directory = 1;
2949 optional int64 free_bytes = 2;
2950 optional int64 total_bytes = 3;
2951}
2952
2953
2954/**
2955 * Size of an application: apk size, data size, and cache size.
2956 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
2957 * Information is only reported for apps with the primary user (user 0).
2958 * Sizes are aggregated by package name.
2959 */
2960message AppSize {
2961 // Including uids will involve modifying diskstats logic.
2962 optional string package_name = 1;
2963 // App size in bytes. -1 if unavailable.
2964 optional int64 app_size_bytes = 2;
2965 // App data size in bytes. -1 if unavailable.
2966 optional int64 app_data_size_bytes = 3;
2967 // App cache size in bytes. -1 if unavailable.
2968 optional int64 app_cache_size_bytes = 4;
2969 // Time that the cache file was produced.
2970 // Uses System.currentTimeMillis(), which is wall clock time.
2971 optional int64 cache_time_millis = 5;
2972}
2973
2974
2975/**
2976 * Size of a particular category. Eg: photos, videos.
2977 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
2978 */
2979message CategorySize {
2980 enum Category {
2981 UNKNOWN = 0;
2982 APP_SIZE = 1;
2983 APP_DATA_SIZE = 2;
2984 APP_CACHE_SIZE = 3;
2985 PHOTOS = 4;
2986 VIDEOS = 5;
2987 AUDIO = 6;
2988 DOWNLOADS = 7;
2989 SYSTEM = 8;
2990 OTHER = 9;
2991 }
2992 optional Category category = 1;
2993 // Category size in bytes.
2994 optional int64 size_bytes = 2;
2995 // Time that the cache file was produced.
2996 // Uses System.currentTimeMillis(), which is wall clock time.
2997 optional int64 cache_time_millis = 3;
2998}
Tej Singhd6d6d772018-09-05 17:41:25 -07002999
3000/**
Tej Singhe7726dc2018-09-21 11:42:12 -07003001 * Pulls per uid I/O stats. The stats are cumulative since boot.
3002 *
3003 * Read/write bytes are I/O events from a storage device
3004 * Read/write chars are data requested by read/write syscalls, and can be
3005 * satisfied by caching.
3006 *
3007 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
3008 */
3009message DiskIo {
3010 optional int32 uid = 1 [(is_uid) = true];
3011 optional int64 fg_chars_read = 2;
3012 optional int64 fg_chars_write = 3;
3013 optional int64 fg_bytes_read = 4;
3014 optional int64 fg_bytes_write = 5;
3015 optional int64 bg_chars_read = 6;
3016 optional int64 bg_chars_write = 7;
3017 optional int64 bg_bytes_read = 8;
3018 optional int64 bg_bytes_write = 9;
3019 optional int64 fg_fsync = 10;
3020 optional int64 bg_fsync= 11;
3021}
3022
3023
3024/**
Tej Singhd6d6d772018-09-05 17:41:25 -07003025 * Pulls the number of fingerprints for each user.
3026 *
3027 * Pulled from StatsCompanionService, which queries FingerprintManager.
3028 */
3029message NumFingerprints {
3030 // The associated user. Eg: 0 for owners, 10+ for others.
3031 // Defined in android/os/UserHandle.java
3032 optional int32 user = 1;
3033 // Number of fingerprints registered to that user.
3034 optional int32 num_fingerprints = 2;
3035}
Chenjie Yu12e5e672018-09-14 15:54:59 -07003036
Yangsteraf9aee72018-10-12 09:26:16 -07003037message AggStats {
3038 optional int64 min = 1;
3039
3040 optional int64 average = 2;
3041
3042 optional int64 max = 3;
3043}
3044
3045message ProcessStatsStateProto {
3046 optional android.service.procstats.ScreenState screen_state = 1;
3047
3048 optional android.service.procstats.MemoryState memory_state = 2;
3049
3050 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
3051 // and not frameworks/base/core/java/android/app/ActivityManager.java
3052 optional android.service.procstats.ProcessState process_state = 3;
3053
3054 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003055 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003056
3057 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003058 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07003059
3060 // # of samples taken
3061 optional int32 sample_size = 5;
3062
3063 // PSS is memory reserved for this process
3064 optional AggStats pss = 6;
3065
3066 // USS is memory shared between processes, divided evenly for accounting
3067 optional AggStats uss = 7;
3068
3069 // RSS is memory resident for this process
3070 optional AggStats rss = 8;
3071}
3072
3073// Next Tag: 7
3074message ProcessStatsProto {
3075 // Name of process.
3076 optional string process = 1;
3077
3078 // Uid of the process.
3079 optional int32 uid = 2;
3080
3081 // Information about how often kills occurred
3082 message Kill {
3083 // Count of excessive CPU kills
3084 optional int32 cpu = 1;
3085
3086 // Count of kills when cached
3087 optional int32 cached = 2;
3088
3089 // PSS stats during cached kill
3090 optional AggStats cached_pss = 3;
3091 }
3092 optional Kill kill = 3;
3093
3094 // Time and memory spent in various states.
3095 repeated ProcessStatsStateProto states = 5;
3096
3097 // Total time process has been running... screen_state, memory_state, and process_state
3098 // will not be set.
3099 optional ProcessStatsStateProto total_running_state = 6;
3100}
3101
3102message PackageServiceOperationStatsProto {
3103 // Operate enum: Started, Foreground, Bound, Executing
3104 optional android.service.procstats.ServiceOperationState operation = 1;
3105
3106 // Number of times the service was in this operation.
3107 optional int32 count = 2;
3108
3109 // Information about a state the service can be in.
3110 message StateStats {
3111 // Screen state enum.
3112 optional android.service.procstats.ScreenState screen_state = 1;
3113 // Memory state enum.
3114 optional android.service.procstats.MemoryState memory_state = 2;
3115
3116 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07003117 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003118 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003119 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003120 }
3121 repeated StateStats state_stats = 3;
3122}
3123
3124message PackageServiceStatsProto {
3125 // Name of service component.
3126 optional string service_name = 1;
3127
3128 // The operation stats.
3129 // The package_name, package_uid, package_version, service_name will not be set to save space.
3130 repeated PackageServiceOperationStatsProto operation_stats = 2;
3131}
3132
3133message PackageAssociationSourceProcessStatsProto {
3134 // Uid of the process.
3135 optional int32 process_uid = 1;
3136 // Process name.
3137 optional string process_name = 2;
3138
3139 // Total count of the times this association appeared.
3140 optional int32 total_count = 3;
3141
3142 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07003143 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003144
3145 // Total count of the times this association became actively impacting its target process.
3146 optional int32 active_count = 5;
3147
3148 // Information on one source in this association.
3149 message StateStats {
3150 // Process state enum.
3151 optional android.service.procstats.ProcessState process_state = 1;
3152 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003153 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003154 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003155 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003156 }
3157 repeated StateStats active_state_stats = 6;
3158}
3159
3160message PackageAssociationProcessStatsProto {
3161 // Name of the target component.
3162 optional string component_name = 1;
3163 // Information on one source in this association.
3164 repeated PackageAssociationSourceProcessStatsProto sources = 2;
3165}
3166
3167
3168message ProcessStatsPackageProto {
3169 // Name of package.
3170 optional string package = 1;
3171
3172 // Uid of the package.
3173 optional int32 uid = 2;
3174
3175 // Version of the package.
3176 optional int64 version = 3;
3177
3178 // Stats for each process running with the package loaded in to it.
3179 repeated ProcessStatsProto process_stats = 4;
3180
3181 // Stats for each of the package's services.
3182 repeated PackageServiceStatsProto service_stats = 5;
3183
3184 // Stats for each association with the package.
3185 repeated PackageAssociationProcessStatsProto association_stats = 6;
3186}
3187
3188message ProcessStatsSectionProto {
3189 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003190 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07003191
3192 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003193 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003194
3195 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003196 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003197
3198 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003199 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003200
3201 // System runtime library. e.g. "libdvm.so", "libart.so".
3202 optional string runtime = 5;
3203
3204 // whether kernel reports swapped pss.
3205 optional bool has_swapped_pss = 6;
3206
3207 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
3208 enum Status {
3209 STATUS_UNKNOWN = 0;
3210 STATUS_COMPLETE = 1;
3211 STATUS_PARTIAL = 2;
3212 STATUS_SHUTDOWN = 3;
3213 STATUS_SYSPROPS = 4;
3214 }
3215 repeated Status status = 7;
3216
3217 // Stats for each process.
3218 repeated ProcessStatsProto process_stats = 8;
3219
3220 // Stats for each package.
3221 repeated ProcessStatsPackageProto package_stats = 9;
3222}
3223
Chenjie Yu12e5e672018-09-14 15:54:59 -07003224/**
3225 * Pulled from ProcessStatsService.java
3226 */
3227message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07003228 optional ProcessStatsSectionProto proc_stats_section = 1;
3229}
3230
3231message PowerProfileProto {
3232 optional double cpu_suspend = 1;
3233
3234 optional double cpu_idle = 2;
3235
3236 optional double cpu_active = 3;
3237
3238 message CpuCluster {
3239 optional int32 id = 1;
3240 optional double cluster_power = 2;
3241 optional int32 cores = 3;
3242 repeated int64 speed = 4;
3243 repeated double core_power = 5;
3244 }
3245
3246 repeated CpuCluster cpu_cluster = 40;
3247
3248 optional double wifi_scan = 4;
3249
3250 optional double wifi_on = 5;
3251
3252 optional double wifi_active = 6;
3253
3254 optional double wifi_controller_idle = 7;
3255
3256 optional double wifi_controller_rx = 8;
3257
3258 optional double wifi_controller_tx = 9;
3259
3260 repeated double wifi_controller_tx_levels = 10;
3261
3262 optional double wifi_controller_operating_voltage = 11;
3263
3264 optional double bluetooth_controller_idle = 12;
3265
3266 optional double bluetooth_controller_rx = 13;
3267
3268 optional double bluetooth_controller_tx = 14;
3269
3270 optional double bluetooth_controller_operating_voltage = 15;
3271
3272 optional double modem_controller_sleep = 16;
3273
3274 optional double modem_controller_idle = 17;
3275
3276 optional double modem_controller_rx = 18;
3277
3278 repeated double modem_controller_tx = 19;
3279
3280 optional double modem_controller_operating_voltage = 20;
3281
3282 optional double gps_on = 21;
3283
3284 repeated double gps_signal_quality_based = 22;
3285
3286 optional double gps_operating_voltage = 23;
3287
3288 optional double bluetooth_on = 24;
3289
3290 optional double bluetooth_active = 25;
3291
3292 optional double bluetooth_at_cmd = 26;
3293
3294 optional double ambient_display = 27;
3295
3296 optional double screen_on = 28;
3297
3298 optional double radio_on = 29;
3299
3300 optional double radio_scanning = 30;
3301
3302 optional double radio_active = 31;
3303
3304 optional double screen_full = 32;
3305
3306 optional double audio = 33;
3307
3308 optional double video = 34;
3309
3310 optional double flashlight = 35;
3311
3312 optional double memory = 36;
3313
3314 optional double camera = 37;
3315
3316 optional double wifi_batched_scan = 38;
3317
3318 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07003319}
Chenjie Yuab530202018-09-26 12:39:20 -07003320
3321/**
3322 * power_profile.xml and other constants for power model calculations.
3323 * Pulled from PowerProfile.java
3324 */
3325message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07003326 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07003327}
Chenjie Yub35b5f72018-10-13 23:25:11 -07003328
3329/**
arangelovd5db50e2018-10-12 20:24:39 +01003330 * Logs when a user restriction was added or removed.
3331 *
3332 * Logged from:
3333 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3334 */
3335message UserRestrictionChanged {
3336 // The raw string of the user restriction as defined in UserManager.
3337 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
3338 optional string restriction = 1;
3339 // Whether the restriction is enabled or disabled.
3340 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07003341}
Yangster-mac308ea0c2018-10-22 13:10:25 -07003342
3343/**
3344 * Pulls process user time and system time. Puller takes a snapshot of all pids
3345 * in the system and returns cpu stats for those that are working at the time.
3346 * Dead pids will be dropped. Kernel processes are excluded.
3347 * Min cool-down is 5 sec.
3348 */
3349message ProcessCpuTime {
3350 optional int32 uid = 1 [(is_uid) = true];
3351
3352 optional string process_name = 2;
3353 // Process cpu time in user space, cumulative from boot/process start
3354 optional int64 user_time_millis = 3;
3355 // Process cpu time in system space, cumulative from boot/process start
3356 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01003357}
Misha Wagner5a51e002018-10-03 15:04:09 +01003358
3359/**
3360 * Pulls the CPU usage for each thread.
3361 *
3362 * Read from /proc/$PID/task/$TID/time_in_state files.
3363 *
3364 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
3365 * time_in_state files not being present on some phones, have not been addressed. These should be
3366 * considered before a public release.
3367 */
3368message CpuTimePerThreadFreq {
3369 // UID that owns the process.
3370 optional int32 uid = 1 [(is_uid) = true];
3371 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003372 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01003373 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003374 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01003375 // Name of the process taken from `/proc/$PID/cmdline`.
3376 optional string process_name = 4;
3377 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
3378 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00003379
3380 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
3381 // are given in KHz, and time is given in milliseconds since the thread started. All eight
3382 // frequencies are given here as the alternative is sending eight separate atoms. This method
3383 // significantly reduces the amount of data created
3384 optional int32 frequency1_khz = 6;
3385 optional int32 time1_millis = 7;
3386 optional int32 frequency2_khz = 8;
3387 optional int32 time2_millis = 9;
3388 optional int32 frequency3_khz = 10;
3389 optional int32 time3_millis = 11;
3390 optional int32 frequency4_khz = 12;
3391 optional int32 time4_millis = 13;
3392 optional int32 frequency5_khz = 14;
3393 optional int32 time5_millis = 15;
3394 optional int32 frequency6_khz = 16;
3395 optional int32 time6_millis = 17;
3396 optional int32 frequency7_khz = 18;
3397 optional int32 time7_millis = 19;
3398 optional int32 frequency8_khz = 20;
3399 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01003400}
Bookatz75ee6042018-11-09 12:27:37 -08003401
3402/**
Bookatz366a4432018-11-20 09:42:33 -08003403 * Pulls information about the device's build.
3404 */
3405message BuildInformation {
3406 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
3407 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
3408 optional string fingerprint = 1;
3409
3410 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
3411 optional string brand = 2;
3412
3413 // Build.PRODUCT. The name of the overall product.
3414 optional string product = 3;
3415
3416 // Build.DEVICE. The name of the industrial design.
3417 optional string device = 4;
3418
3419 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
3420 optional string version_release = 5;
3421
3422 // Build.ID. E.g. a label like "M4-rc20".
3423 optional string id = 6;
3424
3425 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
3426 // represent this build.
3427 optional string version_incremental = 7;
3428
3429 // Build.TYPE. The type of build, like "user" or "eng".
3430 optional string type = 8;
3431
3432 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
3433 optional string tags = 9;
3434}
3435
3436/**
Bookatz75ee6042018-11-09 12:27:37 -08003437 * Pulls on-device BatteryStats power use calculations for the overall device.
3438 */
3439message DeviceCalculatedPowerUse {
3440 // Power used by the device in mAh, as computed by BatteryStats, since BatteryStats last reset
3441 // (i.e. roughly since device was last significantly charged).
3442 // Currently, this is BatteryStatsHelper.getComputedPower() (not getTotalPower()).
3443 optional float computed_power_milli_amp_hours = 1;
3444}
3445
3446/**
3447 * Pulls on-device BatteryStats power use calculations broken down by uid.
3448 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
3449 * that is attributed to non-uid items. They must all be included to get the total power use.
3450 */
3451message DeviceCalculatedPowerBlameUid {
3452 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
3453 optional int32 uid = 1 [(is_uid) = true];
3454
3455 // Power used by this uid in mAh, as computed by BatteryStats, since BatteryStats last reset
3456 // (i.e. roughly since device was last significantly charged).
3457 optional float power_milli_amp_hours = 2;
3458}
3459
3460/**
3461 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
3462 * drain type.
3463 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
3464 * is attributed uids. They must all be included to get the total power use.
3465 */
3466message DeviceCalculatedPowerBlameOther {
3467 // The type of item whose power use is being reported.
3468 enum DrainType {
3469 AMBIENT_DISPLAY = 0;
3470 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
3471 BLUETOOTH = 2;
3472 CAMERA = 3;
3473 // Cell-standby
3474 CELL = 4;
3475 FLASHLIGHT = 5;
3476 IDLE = 6;
3477 MEMORY = 7;
3478 // Amount that total computed drain exceeded the drain estimated using the
3479 // battery level changes and capacity.
3480 OVERCOUNTED = 8;
3481 PHONE = 9;
3482 SCREEN = 10;
3483 // Amount that total computed drain was below the drain estimated using the
3484 // battery level changes and capacity.
3485 UNACCOUNTED = 11;
3486 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
3487 WIFI = 13;
3488 }
3489 optional DrainType drain_type = 1;
3490
3491 // Power used by this item in mAh, as computed by BatteryStats, since BatteryStats last reset
3492 // (i.e. roughly since device was last significantly charged).
3493 optional float power_milli_amp_hours = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00003494}
arangelov4e994062018-11-13 16:12:38 +00003495
3496/**
3497 * Logs device policy features.
3498 *
3499 * Logged from:
3500 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3501 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
3502 */
3503message DevicePolicyEvent {
3504 // The event id - unique for each event.
3505 optional android.stats.devicepolicy.EventId event_id = 1;
3506 // The admin package name.
3507 optional string admin_package_name = 2;
3508 // A generic integer parameter.
3509 optional int32 integer_value = 3;
3510 // A generic boolean parameter.
3511 optional bool boolean_value = 4;
3512 // A parameter specifying a time period in milliseconds.
3513 optional uint64 time_period_millis = 5;
3514 // A parameter specifying a list of package names, bundle extras or string parameters.
3515 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
3516}
shawnlinea5b66b2018-11-13 15:05:29 +08003517
3518/**
3519 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
3520 *
3521 * Logged from:
3522 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3523 */
3524message DocsUILaunchReported {
3525 optional android.stats.docsui.LaunchAction launch_action = 1;
3526 optional bool has_initial_uri = 2;
3527 optional android.stats.docsui.MimeType mime_type = 3;
3528 optional android.stats.docsui.Root initial_root = 4;
3529}
3530
3531/**
3532 * Logs root/app visited event in file managers/picker. Call this when the user
3533 * taps on root/app in hamburger menu.
3534 *
3535 * Logged from:
3536 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3537 */
3538message DocsUIRootVisitedReported {
3539 optional android.stats.docsui.ContextScope scope = 1;
3540 optional android.stats.docsui.Root root = 2;
3541}
3542
3543/**
3544 * Logs file operation stats. Call this when a file operation has completed.
3545 *
3546 * Logged from:
3547 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3548 */
3549message DocsUIFileOperationReported {
3550 optional android.stats.docsui.Provider provider = 1;
3551 optional android.stats.docsui.FileOperation file_op = 2;
3552}
3553
3554/**
3555 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
3556 * mode.
3557 *
3558 * Logged from:
3559 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3560 */
3561message DocsUIFileOperationCopyMoveModeReported {
3562 optional android.stats.docsui.FileOperation file_op = 1;
3563 optional android.stats.docsui.CopyMoveOpMode mode = 2;
3564}
3565
3566
3567/**
3568 * Logs file sub operation stats. Call this when a file operation has failed.
3569 *
3570 * Logged from:
3571 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3572 */
3573message DocsUIFileOperationFailureReported {
3574 optional android.stats.docsui.Authority authority = 1;
3575 optional android.stats.docsui.SubFileOperation sub_op = 2;
3576}
3577
3578/**
3579* Logs the cancellation of a file operation. Call this when a job is canceled
3580*
3581* Logged from:
3582* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3583*/
3584message DocsUIFileOperationCanceledReported {
3585 optional android.stats.docsui.FileOperation file_op = 1;
3586}
3587
3588/**
3589 * Logs startup time in milliseconds.
3590 *
3591 * Logged from:
3592 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3593 */
3594message DocsUIStartupMsReported {
3595 optional int32 startup_millis = 1;
3596}
3597
3598/**
3599 * Logs the action that was started by user.
3600 *
3601 * Logged from:
3602 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3603 */
3604message DocsUIUserActionReported {
3605 optional android.stats.docsui.UserAction action = 1;
3606}
3607
3608/**
3609 * Logs the invalid type when invalid scoped access is requested.
3610 *
3611 * Logged from:
3612 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
3613 */
3614message DocsUIInvalidScopedAccessRequestReported {
3615 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00003616}