blob: 5df47cd045b03e18cd76f01448f59af932ac7cd4 [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;
Bookatzda1798c2018-12-13 14:16:00 -0800172 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
173 WifiRunningStateChanged wifi_running_state_changed = 114;
Yao Chend54f9dd2017-10-17 17:37:48 +0000174 }
David Chenc8a43242017-10-17 16:23:28 -0700175
David Chen6e3e6cb2018-01-03 16:14:06 -0800176 // Pulled events will start at field 10000.
Rafal Slawik3bea8952018-11-15 12:39:33 +0000177 // Next: 10043
David Chenc8a43242017-10-17 16:23:28 -0700178 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800179 WifiBytesTransfer wifi_bytes_transfer = 10000;
180 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
181 MobileBytesTransfer mobile_bytes_transfer = 10002;
182 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800183 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800184 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800185 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800186 CpuTimePerFreq cpu_time_per_freq = 10008;
187 CpuTimePerUid cpu_time_per_uid = 10009;
188 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800189 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800190 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800191 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800192 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800193 SystemElapsedRealtime system_elapsed_realtime = 10014;
194 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800195 CpuActiveTime cpu_active_time = 10016;
196 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000197 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800198 RemainingBatteryCapacity remaining_battery_capacity = 10019;
199 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800200 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100201 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100202 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100203 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000204 DiskStats disk_stats = 10025;
205 DirectoryUsage directory_usage = 10026;
206 AppSize app_size = 10027;
207 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700208 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700209 BatteryVoltage battery_voltage = 10030;
Tej Singhd6d6d772018-09-05 17:41:25 -0700210 NumFingerprints num_fingerprints = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700211 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700212 PowerProfile power_profile = 10033;
Chenjie Yub52779e2018-10-05 12:03:36 -0700213 ProcStats proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700214 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100215 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100216 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700217 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee60422018-11-09 12:27:37 -0800218 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
219 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
220 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000221 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800222 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800223 BuildInformation build_information = 10044;
David Chenc8a43242017-10-17 16:23:28 -0700224 }
yroa1fe77c2018-02-26 14:22:54 -0800225
Bookatz76aafcf2018-09-17 16:17:10 -0700226 // DO NOT USE field numbers above 100,000 in AOSP.
227 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
228 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700229}
230
Yao Chend54f9dd2017-10-17 17:37:48 +0000231/**
Yangster-mac20877162017-12-22 17:19:39 -0800232 * This proto represents a node of an attribution chain.
233 * Note: All attribution chains are represented as a repeated field of type
234 * AttributionNode. It is understood that in such arrays, the order is that
235 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000236 */
Yangster-mac20877162017-12-22 17:19:39 -0800237message AttributionNode {
238 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800239 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800240
Yangster-mac20877162017-12-22 17:19:39 -0800241 // The (optional) string tag for an element in the attribution chain. If the
242 // element has no tag, it is encoded as an empty string.
243 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700244}
245
Yangster-mac48b3d622018-08-18 12:38:11 -0700246message KeyValuePair {
247 optional int32 key = 1;
248 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700249 int32 value_int = 2;
250 int64 value_long = 3;
251 string value_str = 4;
252 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700253 }
254}
255
256message KeyValuePairsAtom {
257 optional int32 uid = 1;
258 repeated KeyValuePair pairs = 2;
259}
260
Yao Chend54f9dd2017-10-17 17:37:48 +0000261/*
262 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800263 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000264 *
265 * RULES:
266 * - The field ids for each atom must start at 1, and count upwards by 1.
267 * Skipping field ids is not allowed.
268 * - These form an API, so renaming, renumbering or removing fields is
269 * not allowed between android releases. (This is not currently enforced,
270 * but there will be a tool to enforce this restriction).
271 * - The types must be built-in protocol buffer types, namely, no sub-messages
272 * are allowed (yet). The bytes type is also not allowed.
273 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800274 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000275 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800276 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000277 * - A field that is a uid should be a string field, tagged with the [xxx]
278 * annotation. The generated code on android will be represented by UIDs,
279 * and those UIDs will be translated in xxx to those strings.
280 *
281 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700282 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000283 * - If there is a UID, it goes first. Think in an object-oriented fashion.
284 * *****************************************************************************
285 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700286
Yao Chend54f9dd2017-10-17 17:37:48 +0000287/**
Yangster-mace16189a2018-08-26 12:20:16 -0700288 * Logs when the Thermal service HAL notifies the throttling start/stop events.
289 *
290 * Logged from:
291 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
292 */
293message ThermalThrottlingStateChanged {
294 optional android.os.TemperatureTypeEnum sensor_type = 1;
295
296 enum State {
297 UNKNOWN = 0;
298 START = 1;
299 STOP = 2;
300 }
301
302 optional State state = 2;
303
304 optional float temperature = 3;
305}
306
307/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000308 * Logs when the screen state changes.
309 *
310 * Logged from:
311 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
312 */
313message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800314 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700315 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700316}
Yao Chend54f9dd2017-10-17 17:37:48 +0000317
318/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700319 * Logs that the process state of the uid, as determined by ActivityManager
320 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000321 *
322 * Logged from:
323 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
324 */
Bookatzc1a050a2017-10-10 15:49:28 -0700325message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700326 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000327
Bookatzdb026a22018-01-10 19:01:56 -0800328 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700329 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000330}
331
332/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700333 * Logs process state change of a process, as per the activity manager.
334 *
335 * Logged from:
336 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
337 */
338message ProcessStateChanged {
339 optional int32 uid = 1;
340 optional string process_name = 2;
341 optional string package_name = 3;
342 // TODO: remove this when validation is done
343 optional int64 version = 5;
344 // The state, from frameworks/base/core/proto/android/app/enums.proto.
345 optional android.app.ProcessStateEnum state = 4;
346}
347
348/**
349 * Logs when ActivityManagerService sleep state is changed.
350 *
351 * Logged from:
352 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
353 */
354message ActivityManagerSleepStateChanged {
355 // TODO: import frameworks proto
356 enum State {
357 UNKNOWN = 0;
358 ASLEEP = 1;
359 AWAKE = 2;
360 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700361 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700362}
363
364/**
365 * Logs when system memory state changes.
366 *
367 * Logged from:
368 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
369 */
370message MemoryFactorStateChanged {
371 // TODO: import frameworks proto
372 enum State {
373 MEMORY_UNKNOWN = 0;
374 NORMAL = 1; // normal.
375 MODERATE = 2; // moderate memory pressure.
376 LOW = 3; // low memory.
377 CRITICAL = 4; // critical memory.
378
379 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700380 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700381}
382
383/**
384 * Logs when app is using too much cpu, according to ActivityManagerService.
385 *
386 * Logged from:
387 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
388 */
389message ExcessiveCpuUsageReported {
390 optional int32 uid = 1;
391 optional string process_name = 2;
392 optional string package_name = 3;
393 // package version. TODO: remove this when validation is done
394 optional int64 version = 4;
395}
396
397/**
398 * Logs when a cached process is killed, along with its pss.
399 *
400 * Logged from:
401 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
402 */
403message CachedKillReported {
404 optional int32 uid = 1;
405 optional string process_name = 2;
406 optional string package_name = 3;
407 // TODO: remove this when validation is done
408 optional int64 version = 5;
409 optional int64 pss = 4;
410}
411
412/**
413 * Logs when memory stats of a process is reported.
414 *
415 * Logged from:
416 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
417 */
418message ProcessMemoryStatReported {
419 optional int32 uid = 1;
420 optional string process_name = 2;
421 optional string package_name = 3;
422 //TODO: remove this when validation is done
423 optional int64 version = 9;
424 optional int64 pss = 4;
425 optional int64 uss = 5;
426 optional int64 rss = 6;
427 enum Type {
428 ADD_PSS_INTERNAL_SINGLE = 0;
429 ADD_PSS_INTERNAL_ALL_MEM = 1;
430 ADD_PSS_INTERNAL_ALL_POLL = 2;
431 ADD_PSS_EXTERNAL = 3;
432 ADD_PSS_EXTERNAL_SLOW = 4;
433 }
434 optional Type type = 7;
435 optional int64 duration = 8;
436}
437
438/**
Bookatzc1a050a2017-10-10 15:49:28 -0700439 * Logs that a process started, finished, crashed, or ANRed.
440 *
441 * Logged from:
442 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
443 */
444message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700445 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700446
David Chen0b5c90c2018-01-25 16:51:49 -0800447 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800448 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700449
Bookatzddccf0a2017-11-28 16:48:14 -0800450 // What lifecycle state the process changed to.
451 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800452 enum State {
453 FINISHED = 0;
454 STARTED = 1;
455 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800456 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800457 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700458}
459
Bookatzc1a050a2017-10-10 15:49:28 -0700460/**
461 * Logs when the ble scan state changes.
462 *
463 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700464 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700465 */
466message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800467 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700468
469 enum State {
470 OFF = 0;
471 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700472 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
473 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700474 }
475 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700476
Bookatze5ec0b42018-03-26 13:34:56 -0700477 // Does the scan have a filter.
478 optional bool is_filtered = 3;
479 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
480 optional bool is_first_match = 4;
481 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
482 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700483}
484
485/**
486 * Logs reporting of a ble scan finding results.
487 *
488 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700489 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700490 */
Bookatzae6738e2018-09-13 11:38:56 -0700491// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700492message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800493 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700494
495 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800496 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700497}
498
499/**
500 * Logs when a sensor state changes.
501 *
502 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700503 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700504 */
505message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800506 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700507
Bookatzc1a050a2017-10-10 15:49:28 -0700508 // The id (int) of the sensor.
509 optional int32 sensor_id = 2;
510
511 enum State {
512 OFF = 0;
513 ON = 1;
514 }
515 optional State state = 3;
516}
517
Bookatzc1a050a2017-10-10 15:49:28 -0700518/**
519 * Logs when GPS state changes.
520 *
521 * Logged from:
522 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
523 */
524message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800525 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700526
527 enum State {
528 OFF = 0;
529 ON = 1;
530 }
531 optional State state = 2;
532}
533
Bookatz48d362e2018-11-06 15:49:08 -0800534/**
535 * Logs when GPS signal quality.
536 *
537 * Logged from:
538 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
539 */
540message GpsSignalQualityChanged {
541 optional android.server.location.GpsSignalQualityEnum level = 1;
542}
543
Bookatzc1a050a2017-10-10 15:49:28 -0700544
545/**
546 * Logs when a sync manager sync state changes.
547 *
548 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700549 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700550 */
551message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800552 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700553
David Chen0b5c90c2018-01-25 16:51:49 -0800554 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800555 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700556
557 enum State {
558 OFF = 0;
559 ON = 1;
560 }
561 optional State state = 3;
562}
563
Yangster-mac96353002018-09-05 11:18:55 -0700564/*
565 * Deferred job stats.
566 *
567 * Logged from:
568 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
569*/
570message DeferredJobStatsReported {
571 repeated AttributionNode attribution_node = 1;
572
573 // Number of jobs deferred.
574 optional int32 num_jobs_deferred = 2;
575
576 // Time since the last job runs.
577 optional int64 time_since_last_job_millis = 3;
578}
579
Bookatzc1a050a2017-10-10 15:49:28 -0700580/**
581 * Logs when a job scheduler job state changes.
582 *
583 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700584 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700585 */
586message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800587 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700588
589 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800590 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700591
592 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800593 FINISHED = 0;
594 STARTED = 1;
595 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700596 }
597 optional State state = 3;
598
Tej Singh33a412b2018-03-16 18:43:59 -0700599 // The reason a job has stopped.
600 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700601 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700602 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700603}
604
605/**
606 * Logs when the audio state changes.
607 *
608 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700609 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700610 */
611message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800612 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700613
614 enum State {
615 OFF = 0;
616 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700617 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
618 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700619 }
620 optional State state = 2;
621}
622
623/**
624 * Logs when the video codec state changes.
625 *
626 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700627 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700628 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800629message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800630 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700631
632 enum State {
633 OFF = 0;
634 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700635 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
636 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700637 }
638 optional State state = 2;
639}
640
641/**
642 * Logs when the flashlight state changes.
643 *
644 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700645 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700646 */
647message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800648 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700649
650 enum State {
651 OFF = 0;
652 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700653 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
654 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700655 }
656 optional State state = 2;
657}
658
659/**
660 * Logs when the camera state changes.
661 *
662 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700663 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700664 */
665message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800666 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700667
668 enum State {
669 OFF = 0;
670 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700671 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
672 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700673 }
674 optional State state = 2;
675}
676
677/**
678 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000679 *
680 * Logged from:
681 * TODO
682 */
Bookatzd6746242017-10-24 18:39:35 -0700683message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800684 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000685
Bookatz1a1b0462018-01-12 11:47:03 -0800686 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
687 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700688 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700689
690 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
691 optional string tag = 3;
692
693 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800694 RELEASE = 0;
695 ACQUIRE = 1;
696 CHANGE_RELEASE = 2;
697 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700698 }
699 optional State state = 4;
700}
701
702/**
Bookatzc1a050a2017-10-10 15:49:28 -0700703 * Logs when a partial wakelock is considered 'long' (over 1 min).
704 *
705 * Logged from:
706 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
707 */
708message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800709 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700710
Yao Chend54f9dd2017-10-17 17:37:48 +0000711 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
712 optional string tag = 2;
713
Bookatzc1a050a2017-10-10 15:49:28 -0700714 // TODO: I have no idea what this is.
715 optional string history_tag = 3;
716
717 enum State {
718 OFF = 0;
719 ON = 1;
720 }
721 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000722}
723
Bookatzc1a050a2017-10-10 15:49:28 -0700724/**
Bookatza66083f2018-09-20 17:24:00 -0700725 * Logs when the device is interactive, according to the PowerManager Notifier.
726 *
727 * Logged from:
728 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
729 */
730message InteractiveStateChanged {
731 enum State {
732 OFF = 0;
733 ON = 1;
734 }
735 optional State state = 1;
736}
737
738/**
Bookatzc1a050a2017-10-10 15:49:28 -0700739 * Logs Battery Saver state change.
740 *
741 * Logged from:
742 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
743 */
744message BatterySaverModeStateChanged {
745 enum State {
746 OFF = 0;
747 ON = 1;
748 }
749 optional State state = 1;
750}
751
752/**
753 * Logs Doze mode state change.
754 *
755 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800756 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700757 */
758message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800759 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800760}
761
762
763/**
764 * Logs state change of Doze mode including maintenance windows.
765 *
766 * Logged from:
767 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
768 */
769message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800770 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700771}
772
773/**
774 * Logs screen brightness level.
775 *
776 * Logged from:
777 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
778 */
779message ScreenBrightnessChanged {
780 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
781 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700782}
783
784/**
785 * Logs battery level (percent full, from 0 to 100).
786 *
787 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700788 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700789 */
790message BatteryLevelChanged {
791 // Battery level. Should be in [0, 100].
792 optional int32 battery_level = 1;
793}
794
795/**
796 * Logs change in charging status of the device.
797 *
798 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700799 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700800 */
801message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800802 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
803 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700804}
805
806/**
807 * Logs whether the device is plugged in, and what power source it is using.
808 *
809 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700810 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700811 */
812message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800813 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
814 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700815}
816
Bookatz8c6571b2017-10-24 15:04:41 -0700817/**
818 * Logs when an app's wakeup alarm fires.
819 *
820 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700821 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700822 */
823message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800824 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800825
826 // Name of the wakeup alarm.
827 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700828
829 // Name of source package (for historical reasons, since BatteryStats tracked it).
830 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800831}
832
833/**
834 * Logs when an an app causes the mobile radio to change state.
835 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
836 *
837 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700838 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800839 */
840message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800841 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800842
Bookatz1a1b0462018-01-12 11:47:03 -0800843 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
844 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800845}
846
847/**
848 * Logs when an an app causes the wifi radio to change state.
849 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
850 *
851 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700852 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800853 */
854message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800855 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800856
Bookatz1a1b0462018-01-12 11:47:03 -0800857 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
858 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700859}
860
861/**
862 * Logs kernel wakeup reasons and aborts.
863 *
864 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700865 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700866 */
867message KernelWakeupReported {
868 // Name of the kernel wakeup reason (or abort).
869 optional string wakeup_reason_name = 1;
870
871 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800872 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700873}
874
875/**
Bookatzda1798c2018-12-13 14:16:00 -0800876 * Logs when Wifi is toggled on/off.
877 *
878 * Logged from:
879 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
880 */
881message WifiEnabledStateChanged {
882 enum State {
883 OFF = 0;
884 ON = 1;
885 }
886 optional State state = 1;
887}
888
889/**
890 * Logs when an app causes Wifi to run. In this context, 'to run' means to use Wifi Client Mode.
891 * TODO: Include support for Hotspot.
892 *
893 * Logged from:
894 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
895 */
896message WifiRunningStateChanged {
897 repeated AttributionNode attribution_node = 1;
898
899 enum State {
900 OFF = 0;
901 ON = 1;
902 }
903 optional State state = 2;
904}
905
906/**
Bookatze5885242017-10-24 20:10:31 -0700907 * Logs wifi locks held by an app.
908 *
909 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700910 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700911 */
912message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800913 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700914
915 enum State {
916 OFF = 0;
917 ON = 1;
918 }
919 optional State state = 2;
920}
921
922/**
923 * Logs wifi signal strength changes.
924 *
925 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700926 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700927 */
928message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800929 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
930 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700931}
932
933/**
934 * Logs wifi scans performed by an app.
935 *
936 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700937 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700938 */
939message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800940 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700941
942 enum State {
943 OFF = 0;
944 ON = 1;
945 }
946 optional State state = 2;
947}
948
949/**
Tej Singh4503e102018-01-04 14:35:01 -0800950 * Logs wifi multicast locks held by an app
951 *
952 * Logged from:
953 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
954 */
955message WifiMulticastLockStateChanged {
956 repeated AttributionNode attribution_node = 1;
957
958 enum State {
959 OFF = 0;
960 ON = 1;
961 }
962 optional State state = 2;
963}
964
965/**
Tej Singh1ea42892018-01-19 09:27:00 -0800966 * Logs shutdown reason and duration on next boot.
967 *
968 * Logged from:
969 * frameworks/base/core/java/com/android/server/BootReceiver.java
970 */
971message ShutdownSequenceReported {
972 // True if shutdown is for a reboot. Default: false if we do not know.
973 optional bool reboot = 1;
974
975 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
976 optional string reason = 2;
977
978 // Beginning of shutdown time in ms using wall clock time since unix epoch.
979 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -0800980 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -0800981
982 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -0800983 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -0800984}
985
Tej Singh6483ea42018-01-25 17:45:49 -0800986
987/**
988 * Logs boot reason and duration.
989 *
990 * Logged from:
991 * system/core/bootstat/bootstat.cpp
992 */
993message BootSequenceReported {
994 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
995 // Default: "<EMPTY>" if not available.
996 optional string bootloader_reason = 1;
997
998 // Reason for system boot. Eg. bootloader, reboot,userrequested
999 // Default: "<EMPTY>" if not available.
1000 optional string system_reason = 2;
1001
1002 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001003 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001004
1005 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001006 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001007
1008 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001009 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001010
1011 // Time since last boot in ms. Default: 0 if not available.
1012 optional int64 time_since_last_boot = 6;
1013}
1014
Tej Singhc477d9c2018-02-05 18:31:39 -08001015
1016/**
1017 * Logs call state and disconnect cause (if applicable).
1018 *
1019 * Logged from:
1020 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1021 */
1022message CallStateChanged {
1023 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1024 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1025 optional android.telecom.CallStateEnum call_state = 1;
1026
1027 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1028 // This value is only applicable when the call_state is DISCONNECTED, and
1029 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1030 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1031 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1032
1033 // True if the call is self-managed, which are apps that use the
1034 // telecom infrastructure to make their own calls.
1035 optional bool self_managed = 3;
1036
1037 // True if call is external. External calls are calls on connected Wear
1038 // devices but show up in Telecom so the user can pull them onto the device.
1039 optional bool external_call = 4;
1040}
1041
Tej Singh1ea42892018-01-19 09:27:00 -08001042/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001043 * Logs keyguard state. The keyguard is the lock screen.
1044 *
1045 * Logged from:
1046 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1047 */
1048message KeyguardStateChanged {
1049 enum State {
1050 UNKNOWN = 0;
1051 // The keyguard is hidden when the phone is unlocked.
1052 HIDDEN = 1;
1053 // The keyguard is shown when the phone is locked (screen turns off).
1054 SHOWN= 2;
1055 // The keyguard is occluded when something is overlaying the keyguard.
1056 // Eg. Opening the camera while on the lock screen.
1057 OCCLUDED = 3;
1058 }
1059 optional State state = 1;
1060}
1061
1062/**
1063 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1064 * prompts the user to enter a password (pattern, pin, etc).
1065 *
1066 * Logged from:
1067 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1068 */
1069
1070message KeyguardBouncerStateChanged {
1071 enum State {
1072 UNKNOWN = 0;
1073 // Bouncer is hidden, either as a result of successfully entering the
1074 // password, screen timing out, or user going back to lock screen.
1075 HIDDEN = 1;
1076 // This is when the user is being prompted to enter the password.
1077 SHOWN = 2;
1078 }
1079 optional State state = 1;
1080}
1081
1082/**
1083 * Logs the result of entering a password into the keyguard bouncer.
1084 *
1085 * Logged from:
1086 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1087 */
1088message KeyguardBouncerPasswordEntered {
1089 enum BouncerResult {
1090 UNKNOWN = 0;
1091 // The password entered was incorrect.
1092 FAILURE = 1;
1093 // The password entered was correct.
1094 SUCCESS = 2;
1095 }
1096 optional BouncerResult result = 1;
1097}
1098
Tej Singha883b372018-02-15 11:30:01 -08001099/*
1100 * Logs changes to the configuration of the device. The configuration is defined
1101 * in frameworks/base/core/java/android/content/res/Configuration.java
1102 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1103 * Please go there to interpret the possible values each field can be.
1104 *
1105 * Logged from:
1106 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1107 */
1108message ResourceConfigurationChanged {
1109 // Bit mask of color capabilities of the screen.
1110 // Contains information about the color gamut and hdr mode of the screen.
1111 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001112 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001113
1114 // The target screen density being rendered to.
1115 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001116 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001117
1118 // Current user preference for the scaling factor for fonts,
1119 // relative to the base density scaling.
1120 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001121 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001122
1123 // Flag indicating whether the hard keyboard is hidden.
1124 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001125 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001126
1127 // The type of keyboard attached to the device.
1128 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1129 optional int32 keyboard = 5;
1130
1131 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1132 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001133 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001134
1135 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1136 // 0 if undefined.
1137 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1138 optional int32 mcc = 7;
1139
1140 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1141 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1142 // MNC_ZERO symbol defined in Configuration.java.
1143 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1144 optional int32 mnc = 8;
1145
1146 // The kind of navigation available on the device.
1147 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1148 optional int32 navigation = 9;
1149
1150 // Flag indicating whether the navigation is available.
1151 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001152 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001153
1154 // Overall orientation of the screen.
1155 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1156 optional int32 orientation = 11;
1157
1158 // The current height of the available screen space, in dp units.
1159 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001160 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001161
1162 // Bit mask of overall layout of the screen.
1163 // Contains information about screen size, whether the screen is wider/taller
1164 // than normal, whether the screen layout is right-tl-left or left-to-right,
1165 // and whether the screen has a rounded shape.
1166 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001167 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001168
1169 // Current width of the available screen space, in dp units.
1170 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001171 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001172
1173 // The smallest screen size an application will see in normal operation.
1174 // This is the smallest value of both screenWidthDp and screenHeightDp
1175 // in portrait and landscape.
1176 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001177 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001178
1179 // The type of touch screen attached to the device.
1180 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1181 optional int32 touchscreen = 16;
1182
1183 // Bit mask of the ui mode.
1184 // Contains information about the overall ui mode of the device.
1185 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1186 // Also contains information about whether the device is in night mode.
1187 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001188 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001189}
1190
Tej Singheee317b2018-03-07 19:28:05 -08001191
1192/**
1193 * Logs changes in the connection state of the mobile radio.
1194 *
1195 * Logged from:
1196 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1197 */
1198message MobileConnectionStateChanged {
1199 // States are from the state machine DataConnection.java.
1200 enum State {
1201 UNKNOWN = 0;
1202 // The connection is inactive, or disconnected.
1203 INACTIVE = 1;
1204 // The connection is being activated, or connecting.
1205 ACTIVATING = 2;
1206 // The connection is active, or connected.
1207 ACTIVE = 3;
1208 // The connection is disconnecting.
1209 DISCONNECTING = 4;
1210 // The connection is disconnecting after creating a connection.
1211 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1212 }
1213 optional State state = 1;
1214 // For multi-sim phones, this distinguishes between the sim cards.
1215 optional int32 sim_slot_index = 2;
1216 // Used to identify the connection. Starts at 0 and increments by 1 for
1217 // every new network created. Resets whenever the device reboots.
1218 optional int32 data_connection_id = 3;
1219 // A bitmask for the capabilities of this connection.
1220 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1221 // Default value (if we have no information): 0
1222 optional int64 capabilities = 4;
1223 // If this connection has internet.
1224 // This just checks if the DEFAULT bit of capabilities is set.
1225 optional bool has_internet = 5;
1226}
1227
1228/**
1229 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1230 *
1231 * Logged from:
1232 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1233 */
1234message MobileRadioTechnologyChanged {
1235 optional android.telephony.NetworkTypeEnum state = 1;
1236 // For multi-sim phones, this distinguishes between the sim cards.
1237 optional int32 sim_slot_index = 2;
1238}
1239
Andrew Chantb56388b2018-03-22 21:07:33 -07001240/**
1241 * Logs the VID and PID of any connected USB devices.
1242 *
1243 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1244 *
1245 * Logged by Vendor.
1246 */
1247message UsbDeviceAttached {
1248 optional int32 vid = 1;
1249 optional int32 pid = 2;
1250 optional bool has_audio = 3;
1251 optional bool has_hid = 4;
1252 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001253 enum State {
1254 STATE_DISCONNECTED = 0;
1255 STATE_CONNECTED = 1;
1256 }
1257 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001258 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001259}
1260
Tej Singheee317b2018-03-07 19:28:05 -08001261
Tej Singhdd7bd352018-02-09 19:33:15 -08001262/**
Tej Singh5d991e12018-03-09 19:48:11 -08001263 * Logs when Bluetooth is enabled and disabled.
1264 *
1265 * Logged from:
1266 * services/core/java/com/android/server/BluetoothManagerService.java
1267 */
1268message BluetoothEnabledStateChanged {
1269 repeated AttributionNode attribution_node = 1;
1270 // Whether or not bluetooth is enabled on the device.
1271 enum State {
1272 UNKNOWN = 0;
1273 ENABLED = 1;
1274 DISABLED = 2;
1275 }
1276 optional State state = 2;
1277 // The reason for being enabled/disabled.
1278 // Eg. Airplane mode, crash, application request.
1279 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1280 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001281 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001282}
1283
1284/**
1285 * Logs when a Bluetooth device connects and disconnects.
1286 *
1287 * Logged from:
1288 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1289 */
1290message BluetoothConnectionStateChanged {
1291 // The state of the connection.
1292 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1293 optional android.bluetooth.ConnectionStateEnum state = 1;
1294 // An identifier that can be used to match connect and disconnect events.
1295 // Currently is last two bytes of a hash of a device level ID and
1296 // the mac address of the bluetooth device that is connected.
1297 optional int32 obfuscated_id = 2;
1298 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1299 // From android.bluetooth.BluetoothAdapter.java
1300 optional int32 bt_profile = 3;
1301}
1302
1303/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001304 * Logs when something is plugged into or removed from the USB-C connector.
1305 *
1306 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001307 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08001308 */
1309message UsbConnectorStateChanged {
1310 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001311 STATE_DISCONNECTED = 0;
1312 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08001313 }
1314 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001315 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08001316 // Last active session in ms.
1317 // 0 when the port is in connected state.
1318 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001319}
1320
1321/**
1322 * Logs the reported speaker impedance.
1323 *
1324 * Logged from:
1325 * Vendor audio implementation.
1326 */
1327message SpeakerImpedanceReported {
1328 optional int32 speaker_location = 1;
1329 optional int32 impedance = 2;
1330}
1331
1332/**
1333 * Logs the report of a failed hardware.
1334 *
1335 * Logged from:
1336 * Vendor HALs.
1337 *
1338 */
1339message HardwareFailed {
1340 enum HardwareType {
1341 HARDWARE_FAILED_UNKNOWN = 0;
1342 HARDWARE_FAILED_MICROPHONE = 1;
1343 HARDWARE_FAILED_CODEC = 2;
1344 HARDWARE_FAILED_SPEAKER = 3;
1345 HARDWARE_FAILED_FINGERPRINT = 4;
1346 }
1347 optional HardwareType hardware_type = 1;
1348
1349 /* hardware_location allows vendors to differentiate between multiple instances of
1350 * the same hardware_type. The specific locations are vendor defined integers,
1351 * referring to board-specific numbering schemes.
1352 */
1353 optional int32 hardware_location = 2;
1354
1355 /* failure_code is specific to the HardwareType of the failed hardware.
1356 * It should use the enum values defined below.
1357 */
1358 enum MicrophoneFailureCode {
1359 MICROPHONE_FAILURE_COMPLETE = 0;
1360 }
1361 enum CodecFailureCode {
1362 CODEC_FAILURE_COMPLETE = 0;
1363 }
1364 enum SpeakerFailureCode {
1365 SPEAKER_FAILURE_COMPLETE = 0;
1366 SPEAKER_FAILURE_HIGH_Z = 1;
1367 SPEAKER_FAILURE_SHORT = 2;
1368 }
1369 enum FingerprintFailureCode {
1370 FINGERPRINT_FAILURE_COMPLETE = 0;
1371 FINGERPRINT_SENSOR_BROKEN = 1;
1372 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1373 }
1374 optional int32 failure_code = 3;
1375}
1376
1377/**
1378 * Log an event when the device has been physically dropped.
1379 * Reported from the /vendor partition.
1380 */
1381message PhysicalDropDetected {
1382 // Confidence that the event was actually a drop, 0 -> 100
1383 optional int32 confidence_pctg = 1;
1384 // Peak acceleration of the drop, in 1/1000s of a g.
1385 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001386 // Duration of freefall in ms
1387 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001388}
1389
1390/**
1391 * Log bucketed battery charge cycles.
1392 *
1393 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08001394 * a given charge point. For example, if 10 cycle buckets are
1395 * initialized, bucket 1 is the lowest 1/10th of the battery,
1396 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08001397 *
1398 * Logged from:
1399 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1400 */
1401message ChargeCyclesReported {
1402 optional int32 cycle_bucket_1 = 1;
1403 optional int32 cycle_bucket_2 = 2;
1404 optional int32 cycle_bucket_3 = 3;
1405 optional int32 cycle_bucket_4 = 4;
1406 optional int32 cycle_bucket_5 = 5;
1407 optional int32 cycle_bucket_6 = 6;
1408 optional int32 cycle_bucket_7 = 7;
1409 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08001410 optional int32 cycle_bucket_9 = 9;
1411 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08001412}
1413
1414/**
Howard Roa46b6582018-09-18 16:45:02 -07001415 * Log battery health snapshot.
1416 *
1417 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
1418 * are snapshotted periodically over 24hrs.
1419 */
1420message BatteryHealthSnapshot {
1421 enum BatterySnapshotType {
1422 UNKNOWN = 0;
1423 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
1424 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
1425 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
1426 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
1427 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
1428 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
1429 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
1430 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
1431 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
1432 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
1433 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
1434 }
1435 optional BatterySnapshotType type = 1;
1436 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07001437 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07001438 // Voltage Battery Voltage, in microVolts.
1439 optional int32 voltage_micro_volt = 3;
1440 // Current Battery current, in microAmps.
1441 optional int32 current_micro_amps = 4;
1442 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
1443 optional int32 open_circuit_micro_volt = 5;
1444 // Resistance Battery Resistance, in microOhms.
1445 optional int32 resistance_micro_ohm = 6;
1446 // Level Battery Level, as % of full.
1447 optional int32 level_percent = 7;
1448}
1449
1450/**
1451 * Log slow I/O operations on the primary storage.
1452 */
1453message SlowIo {
1454 // Classifications of IO Operations.
1455 enum IoOperation {
1456 UNKNOWN = 0;
1457 READ = 1;
1458 WRITE = 2;
1459 UNMAP = 3;
1460 SYNC = 4;
1461 }
1462 optional IoOperation operation = 1;
1463
1464 // The number of slow IO operations of this type over 24 hours.
1465 optional int32 count = 2;
1466}
1467
1468/**
1469 * Log battery caused shutdown with the last recorded voltage.
1470 */
1471message BatteryCausedShutdown {
1472 // The last recorded battery voltage prior to shutdown.
1473 optional int32 last_recorded_micro_volt = 1;
1474}
1475
1476/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001477 * Logs the duration of a davey (jank of >=700ms) when it occurs
1478 *
1479 * Logged from:
1480 * frameworks/base/libs/hwui/JankTracker.cpp
1481 */
1482message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001483 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001484 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001485
Tej Singhbb8554a2018-01-26 11:59:14 -08001486 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001487 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001488}
1489
1490/**
Bookatze5885242017-10-24 20:10:31 -07001491 * Logs phone signal strength changes.
1492 *
1493 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001494 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001495 */
1496message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001497 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1498 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001499}
1500
Yangster4ccebea2018-10-09 17:09:02 -07001501
1502/**
1503 * Logs when the phone state, sim state or signal strength changes
1504 *
1505 * Logged from:
1506 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1507 */
1508message PhoneServiceStateChanged {
1509 optional android.telephony.ServiceStateEnum state = 1;
1510 optional android.telephony.SimStateEnum sim_state = 2;
1511 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1512}
1513
1514/**
1515 * Logs when the phone becomes on or off.
1516 *
1517 * Logged from:
1518 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1519 */
1520message PhoneStateChanged {
1521 enum State {
1522 OFF = 0;
1523 ON = 1;
1524 }
1525 optional State state = 1;
1526}
1527
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001528message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07001529 optional android.stats.launcher.LauncherAction action = 1;
1530 optional android.stats.launcher.LauncherState src_state = 2;
1531 optional android.stats.launcher.LauncherState dst_state = 3;
1532 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001533 optional bool is_swipe_up_enabled = 5;
1534}
1535
David Chenc28b2bb2017-10-24 12:52:52 -07001536/**
Fan Zhang916c13b2018-10-16 22:49:45 -07001537 * Logs when Settings UI has changed.
1538 *
1539 * Logged from:
1540 * packages/apps/Settings
1541 */
1542message SettingsUIChanged {
1543 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07001544 * Where this SettingsUIChange event comes from. For example, if
1545 * it's a PAGE_VISIBLE event, where the page is opened from.
1546 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001547 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07001548
1549 /**
1550 * What the UI action is.
1551 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001552 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07001553
1554 /**
1555 * Where the action is happening
1556 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001557 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07001558
1559 /**
1560 * What preference changed in this event.
1561 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001562 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07001563
1564 /**
1565 * The new value of the changed preference.
1566 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001567 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07001568}
1569
1570/**
David Chenc28b2bb2017-10-24 12:52:52 -07001571 * Logs that a setting was updated.
1572 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001573 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001574 * The tag and is_default allow resetting of settings to default values based on the specified
1575 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1576 */
1577message SettingChanged {
1578 // The name of the setting.
1579 optional string setting = 1;
1580
1581 // The change being imposed on this setting. May represent a number, eg "3".
1582 optional string value = 2;
1583
1584 // The new value of this setting. For most settings, this is same as value. For some settings,
1585 // value is +X or -X where X represents an element in a set. For example, if the previous value
1586 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1587 // The +/- feature is currently only used for location_providers_allowed.
1588 optional string new_value = 3;
1589
1590 // The previous value of this setting.
1591 optional string prev_value = 4;
1592
1593 // The tag used with the is_default for resetting sets of settings. This is generally null.
1594 optional string tag = 5;
1595
Bookatz90867622018-01-31 15:05:57 -08001596 // True if this setting with tag should be resettable.
1597 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001598
David Chenbd789912018-03-16 17:19:55 -07001599 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001600 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001601
1602 enum ChangeReason {
1603 UPDATED = 1; // Updated can be an insertion or an update.
1604 DELETED = 2;
1605 }
1606 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001607}
Chenjie Yub3dda412017-10-24 13:41:59 -07001608
Chenjie Yu05013b32017-11-21 10:21:41 -08001609/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001610 * Logs activity going to foreground or background
1611 *
1612 * Logged from:
1613 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1614 */
1615message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001616 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001617 optional string pkg_name = 2;
1618 optional string class_name = 3;
1619
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001620 enum State {
1621 BACKGROUND = 0;
1622 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001623 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001624 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001625}
David Chenc8a43242017-10-17 16:23:28 -07001626
1627/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001628 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001629 * Logged from:
1630 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1631 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001632message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001633 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001634
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001635 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001636
1637 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001638 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001639 optional string process_name = 3;
1640
1641 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001642 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07001643
1644 optional string package_name = 5;
1645
1646 enum InstantApp {
1647 UNAVAILABLE = 0;
1648 FALSE = 1;
1649 TRUE = 2;
1650 }
1651 optional InstantApp is_instant_app = 6;
1652
1653 enum ForegroundState {
1654 UNKNOWN = 0;
1655 BACKGROUND = 1;
1656 FOREGROUND = 2;
1657 }
1658 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08001659
1660 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001661}
David Chen9e3808c2017-11-20 17:25:34 -08001662
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001663/**
1664 * Logs when a WTF (What a Terrible Failure) happened.
1665 * Logged from:
1666 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1667 */
1668message WTFOccurred {
1669 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001670
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001671 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001672
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001673 // The name of the process.
1674 // system_server if it is not by an app
1675 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001676
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001677 // The pid if available. -1 means not available.
1678 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08001679
1680 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001681}
1682
1683/**
1684 * Logs when system server reports low memory.
1685 * Logged from:
1686 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1687 */
1688message LowMemReported {
1689}
1690
1691/**
1692 * Logs when an app ANR (App Not Responding) occurs.
1693 * Logged from:
1694 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1695 */
1696message ANROccurred {
1697 optional int32 uid = 1 [(is_uid) = true];
1698
1699 optional string process_name = 2;
1700
1701 optional string short_component_name = 3;
1702
1703 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07001704
1705 enum InstantApp {
1706 UNAVAILABLE = 0;
1707 FALSE = 1;
1708 TRUE = 2;
1709 }
1710 optional InstantApp is_instant_app = 5;
1711
1712 enum ForegroundState {
1713 UNKNOWN = 0;
1714 BACKGROUND = 1;
1715 FOREGROUND = 2;
1716 }
1717 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08001718
1719 optional android.server.ErrorSource error_source = 7;
1720
1721 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08001722}
1723
Bookatza7020bd2018-08-28 16:29:35 -07001724/**
1725 * Logs when the vibrator state changes.
1726 * Logged from:
1727 * frameworks/base/services/core/java/com/android/server/VibratorService.java
1728 */
1729message VibratorStateChanged {
1730 repeated AttributionNode attribution_node = 1;
1731
1732 enum State {
1733 OFF = 0;
1734 ON = 1;
1735 }
1736 optional State state = 2;
1737
1738 // Duration (in milliseconds) requested to keep the vibrator on.
1739 // Only applicable for State == ON.
1740 optional int64 duration_millis = 3;
1741}
1742
David Chen0a368b22017-12-06 16:28:16 -08001743/*
1744 * Allows other apps to push events into statsd.
1745 * Logged from:
1746 * frameworks/base/core/java/android/util/StatsLog.java
1747 */
David Chen0b5c90c2018-01-25 16:51:49 -08001748message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08001749 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001750 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08001751
1752 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
1753 optional int32 label = 2;
1754
1755 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
1756 // predicates for the metrics).
1757 enum State {
1758 UNKNOWN = 0;
1759 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
1760 STOP = 2;
1761 START = 3;
1762 }
1763 optional State state = 3;
1764}
1765
David Chen9e3808c2017-11-20 17:25:34 -08001766/**
Bookatz7948c872018-09-04 12:58:33 -07001767 * Logs the wall-clock time when a significant wall-clock time shift occurs.
1768 * For example, this could be due to the user manually changing the time.
1769 *
1770 * Logged from:
1771 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
1772 */
1773message WallClockTimeShifted {
1774 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
1775 optional int64 wall_clock_timestamp_millis = 1;
1776}
1777
1778/**
Bookatz8fcd09a2017-12-18 13:01:10 -08001779 * Logs when statsd detects an anomaly.
1780 *
1781 * Logged from:
1782 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
1783 */
1784message AnomalyDetected {
1785 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07001786 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08001787
Yangster-mac94e197c2018-01-02 16:03:03 -08001788 // Id of the config whose anomaly detection alert fired.
1789 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08001790
Yangster-mac94e197c2018-01-02 16:03:03 -08001791 // Id of the alert (i.e. name of the anomaly that was detected).
1792 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08001793}
1794
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001795message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001796 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001797 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001798
1799 // The app package name.
1800 optional string pkg_name = 2;
1801
1802 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001803 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001804 WARM = 1;
1805 HOT = 2;
1806 COLD = 3;
1807 }
1808 // The transition type.
1809 optional TransitionType type = 3;
1810
1811 // The activity name.
1812 optional string activity_name = 4;
1813
1814 // The name of the calling app. Empty if not set.
1815 optional string calling_pkg_name = 5;
1816
1817 // Whether the app is an instant app.
1818 optional bool is_instant_app = 6;
1819
1820 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08001821 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001822
Bookatz80d11a02018-01-16 10:46:35 -08001823 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001824
David Chen0b5c90c2018-01-25 16:51:49 -08001825 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001826 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001827 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001828 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08001829 optional int32 bind_application_delay_millis = 11;
1830 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001831
1832 // Empty if not set.
1833 optional string launch_token = 13;
1834
Calin Juravle759fbda2018-02-20 19:52:30 +00001835 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001836 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00001837
1838 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07001839 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001840}
1841
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001842message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001843 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001844 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001845
1846 // The app package name.
1847 optional string pkg_name = 2;
1848
1849 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001850 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001851 WARM = 1;
1852 HOT = 2;
1853 COLD = 3;
1854 }
1855 // The transition type.
1856 optional TransitionType type = 3;
1857
1858 // The activity name.
1859 optional string activity_name = 4;
1860}
1861
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001862message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001863 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07001864 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001865
1866 // The app package name.
1867 optional string pkg_name = 2;
1868
1869 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001870 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001871 WITH_BUNDLE = 1;
1872 WITHOUT_BUNDLE = 2;
1873 }
1874 // The transition type.
1875 optional TransitionType type = 3;
1876
1877 // The activity name.
1878 optional string activity_name = 4;
1879
1880 optional bool transition_process_running = 5;
1881
1882 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08001883 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00001884}
1885
Bookatz8fcd09a2017-12-18 13:01:10 -08001886/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08001887 * Logs a picture-in-picture action
1888 * Logged from:
1889 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1890 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
1891 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
1892 */
1893message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001894 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07001895 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08001896
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001897 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001898
Chenjie Yu52cacc62017-12-08 18:11:45 -08001899 enum State {
1900 ENTERED = 1;
1901 EXPANDED_TO_FULL_SCREEN = 2;
1902 MINIMIZED = 3;
1903 DISMISSED = 4;
1904 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08001905 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08001906}
1907
1908/**
Chenjie Yue8904192017-12-08 19:12:57 -08001909 * Logs overlay action
1910 * Logged from:
1911 * services/core/java/com/android/server/wm/Session.java
1912 */
1913message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001914 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08001915
1916 optional string package_name = 2;
1917
1918 optional bool using_alert_window = 3;
1919
1920 enum State {
1921 ENTERED = 1;
1922 EXITED = 2;
1923 }
1924 optional State state = 4;
1925}
1926
Chenjie Yuccfe6452018-01-30 11:33:21 -08001927/*
1928 * Logs foreground service starts and stops.
1929 * Note that this is not when a service starts or stops, but when it is
1930 * considered foreground.
1931 * Logged from
1932 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
1933 */
1934message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001935 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08001936 // package_name + "/" + class_name
1937 optional string short_name = 2;
1938
1939 enum State {
1940 ENTER = 1;
1941 EXIT = 2;
1942 }
1943 optional State state = 3;
1944}
1945
Chenjie Yue8904192017-12-08 19:12:57 -08001946/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08001947 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
1948 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
1949 * attributed back to the parent (host) uid. One example is Chrome.
1950 *
1951 * Logged from:
1952 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1953 */
1954message IsolatedUidChanged {
1955 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001956 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07001957 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08001958 optional int32 parent_uid = 1;
1959
1960 optional int32 isolated_uid = 2;
1961
1962 // We expect an isolated uid to be removed before if it's used for another parent uid.
1963 enum Event {
1964 REMOVED = 0;
1965 CREATED = 1;
1966 }
1967 optional Event event = 3;
1968}
1969
1970/*
1971 * Logs the reception of an incoming network packet causing the main system to wake up for
1972 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
1973 * and processed by WakeupController.cpp.
1974 */
1975message PacketWakeupOccurred {
1976 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
1977 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07001978 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08001979 // The interface name on which the packet was received.
1980 optional string iface = 2;
1981 // The ethertype value of the packet.
1982 optional int32 ethertype = 3;
1983 // String representation of the destination MAC address of the packet.
1984 optional string destination_hardware_address = 4;
1985 // String representation of the source address of the packet if this was an IP packet.
1986 optional string source_ip = 5;
1987 // String representation of the destination address of the packet if this was an IP packet.
1988 optional string destination_ip = 6;
1989 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
1990 // field if this was an IPv6 packet. The range of possible values is the same for both IP
1991 // families.
1992 optional int32 ip_next_header = 7;
1993 // The source port if this was a TCP or UDP packet.
1994 optional int32 source_port = 8;
1995 // The destination port if this was a TCP or UDP packet.
1996 optional int32 destination_port = 9;
1997}
1998
1999/*
2000 * Logs the memory stats for an app on startup.
2001 * Logged from:
2002 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2003 */
2004message AppStartMemoryStateCaptured {
2005 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002006 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002007
2008 // The process name.
2009 optional string process_name = 2;
2010
2011 // The activity name.
2012 optional string activity_name = 3;
2013
2014 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002015 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002016
2017 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002018 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002019
2020 // RSS
2021 optional int64 rss_in_bytes = 6;
2022
2023 // CACHE
2024 optional int64 cache_in_bytes = 7;
2025
2026 // SWAP
2027 optional int64 swap_in_bytes = 8;
2028}
2029
2030/*
2031 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2032 * for LMK event.
2033 * Logged from:
2034 * system/core/lmkd/lmkd.c
2035 */
2036message LmkStateChanged {
2037 enum State {
2038 UNKNOWN = 0;
2039 START = 1;
2040 STOP = 2;
2041 }
2042 optional State state = 1;
2043}
2044
2045/*
2046 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2047 * Logged from:
2048 * system/core/lmkd/lmkd.c
2049 */
2050message LmkKillOccurred {
2051 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002052 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002053
2054 // The process name.
2055 optional string process_name = 2;
2056
2057 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002058 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002059
2060 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002061 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002062
2063 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002064 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002065
2066 // RSS
2067 optional int64 rss_in_bytes = 6;
2068
2069 // CACHE
2070 optional int64 cache_in_bytes = 7;
2071
2072 // SWAP
2073 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002074
2075 // The elapsed real time of start of the process.
2076 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002077}
2078
Rajeev Kumar51b54602018-03-01 12:18:26 -08002079/*
2080 * Logs when the ActivityManagerService detects that an app died.
2081 *
2082 * Logged from:
2083 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2084 */
2085message AppDied {
2086 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002087 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002088}
2089
Howard Ro21a039c2018-08-06 14:55:47 -07002090/**
2091 * An atom for generic metrics logging. Available from Android Q.
2092 */
2093message GenericAtom {
2094 // The uid of the application that sent this custom atom.
2095 optional int32 uid = 1 [(is_uid) = true];
2096
2097 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002098 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002099}
2100
Tej Singhd6d6d772018-09-05 17:41:25 -07002101/**
2102 * Logs when a fingerprint acquire event occurs.
2103 *
2104 * Logged from:
2105 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2106 */
2107message FingerprintAcquired {
2108 // The associated user. Eg: 0 for owners, 10+ for others.
2109 // Defined in android/os/UserHandle.java
2110 optional int32 user = 1;
2111 // If this acquire is for a crypto fingerprint.
2112 // e.g. Secure purchases, unlock password storage.
2113 optional bool is_crypto = 2;
2114}
2115
2116/**
2117 * Logs when a fingerprint authentication event occurs.
2118 *
2119 * Logged from:
2120 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2121 */
2122message FingerprintAuthenticated {
2123 // The associated user. Eg: 0 for owners, 10+ for others.
2124 // Defined in android/os/UserHandle.java
2125 optional int32 user = 1;
2126 // If this authentication is for a crypto fingerprint.
2127 // e.g. Secure purchases, unlock password storage.
2128 optional bool is_crypto = 2;
2129 // Whether or not this authentication was successful.
2130 optional bool is_authenticated = 3;
2131}
2132
2133/**
2134 * Logs when a fingerprint error occurs.
2135 *
2136 * Logged from:
2137 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2138 */
2139message FingerprintErrorOccurred {
2140 // The associated user. Eg: 0 for owners, 10+ for others.
2141 // Defined in android/os/UserHandle.java
2142 optional int32 user = 1;
2143 // If this error is for a crypto fingerprint.
2144 // e.g. Secure purchases, unlock password storage.
2145 optional bool is_crypto = 2;
2146
2147 enum Error {
2148 UNKNOWN = 0;
2149 LOCKOUT = 1;
2150 PERMANENT_LOCKOUT = 2;
2151 }
2152 // The type of error.
2153 optional Error error = 3;
2154}
Howard Ro688ae182018-09-25 00:09:36 -07002155
2156message Notification {
2157
2158 // Type of notification event.
2159 enum Type {
2160 TYPE_UNKNOWN = 0;
2161 // Notification became visible to the user.
2162 TYPE_OPEN = 1;
2163 // Notification became hidden.
2164 TYPE_CLOSE = 2;
2165 // Notification switched to detail mode.
2166 TYPE_DETAIL = 3;
2167 // Notification was clicked.
2168 TYPE_ACTION = 4;
2169 // Notification was dismissed.
2170 TYPE_DISMISS = 5;
2171 // Notification switched to summary mode. The enum value of 14 is to
2172 // match that of metrics_constants.
2173 TYPE_COLLAPSE = 14;
2174 }
2175 optional Type type = 1;
2176
2177 // Package name associated with the notification.
2178 optional string package_name = 2;
2179
2180 // Tag associated with notification.
2181 optional string tag = 3;
2182
2183 // Application-supplied ID associated with the notification.
2184 optional int32 id = 4;
2185
2186 // Index of notification in the notification panel.
2187 optional int32 shade_index = 5;
2188
2189 // The number of notifications in the notification panel.
2190 optional int32 shade_count = 6;
2191
2192 // Importance for the notification.
2193 optional int32 importance = 7;
2194
2195 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07002196 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07002197
2198 // Importance for the notification channel.
2199 optional int32 channel_importance = 9;
2200
Howard Ro183c2bd2018-10-18 13:52:10 -07002201 // Application-supplied ID associated with the notifications group.
2202 optional string group_id = 10;
2203
Howard Ro688ae182018-09-25 00:09:36 -07002204 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07002205 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07002206
Howard Ro183c2bd2018-10-18 13:52:10 -07002207 // Reason for dismissal of a notification. This field is only meaningful for
2208 // TYPE_DISMISS events.
2209 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07002210
Howard Ro183c2bd2018-10-18 13:52:10 -07002211 // The first post time of notification, stable across updates.
2212 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07002213
Howard Ro183c2bd2018-10-18 13:52:10 -07002214 // The most recent interruption time, or the creation time if no updates.
2215 // Differs from update_millis because updates are filtered based on whether
2216 // they actually interrupted the user.
2217 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07002218
Howard Ro183c2bd2018-10-18 13:52:10 -07002219 // The most recent update time, or the creation time if no updates.
2220 optional int64 update_millis = 15;
2221
2222 // The most recent visibility event.
2223 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07002224}
2225
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002226/*
Yangster-macb89807e2018-11-15 21:10:57 -08002227 * Logs when a flag flip state changes.
2228 * Logged in P/h.
2229 */
2230message PhenotypeFlagStateChanged {
2231 // Mendel configuration name.
2232 optional string mendel_config_name = 1;
2233 // State
2234 enum State {
2235 STATE_UNKNOWN = 0;
2236 COMMITTED = 1;
2237 }
2238 optional State state = 2;
2239}
2240
2241/*
2242 * Logs when a binary push state changes.
2243 * Logged in Play store
2244 */
2245message BinaryPushStateChanged {
2246 // Binary package name.
2247 optional string binary_name = 1;
2248 // Version code.
2249 optional int64 version = 2;
2250 // State
2251 enum State {
2252 STATE_UNKNOWN = 0;
2253 DOWNLOAD_START = 1;
2254 DOWNLOAD_DONE = 2;
2255 INSTALL_START = 3;
2256 INSTALL_DONE = 4;
2257 REBOOT_START = 5;
2258 REBOOT_DONE = 6;
2259 }
2260 optional State state = 3;
2261}
2262
2263/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002264 * Logs when a connection becomes available and lost.
2265 * Logged in StatsCompanionService.java
2266 */
2267message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002268 // Id of the network.
2269 optional int32 net_id = 1;
2270
2271 enum State {
2272 UNKNOWN = 0;
2273 CONNECTED = 1;
2274 DISCONNECTED = 2;
2275 }
2276 // Connected state of a network.
2277 optional State state = 2;
2278}
2279
2280/**
2281 * Logs when a service starts and stops.
2282 * Logged from:
2283 * services/core/java/com/android/server/am/ActiveServices.java
2284 */
2285message ServiceStateChanged {
2286
2287 optional int32 uid = 1 [(is_uid) = true];
2288
2289 optional string package_name = 2;
2290
2291 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002292
2293 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002294 START = 1;
2295 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002296 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07002297
2298 optional State state = 4;
2299}
2300
2301/**
2302 * Logs when a service is launched.
2303 * Logged from:
2304 * services/core/java/com/android/server/am/ActiveServices.java
2305 */
2306message ServiceLaunchReported {
2307
2308 optional int32 uid = 1 [(is_uid) = true];
2309
2310 optional string package_name = 2;
2311
2312 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002313}
Howard Ro688ae182018-09-25 00:09:36 -07002314
Chenjie Yubbcbc602018-02-05 16:51:52 -08002315//////////////////////////////////////////////////////////////////////
2316// Pulled atoms below this line //
2317//////////////////////////////////////////////////////////////////////
2318
2319/**
David Chenc8a43242017-10-17 16:23:28 -07002320 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
2321 *
2322 * Pulled from:
2323 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2324 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002325message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002326 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002327
2328 optional int64 rx_bytes = 2;
2329
2330 optional int64 rx_packets = 3;
2331
2332 optional int64 tx_bytes = 4;
2333
2334 optional int64 tx_packets = 5;
2335}
2336
2337/**
2338 * Pulls bytes transferred via wifi (separated by foreground and background usage).
2339 *
2340 * Pulled from:
2341 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2342 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002343message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002344 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002345
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002346 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2347 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002348
2349 optional int64 rx_bytes = 3;
2350
2351 optional int64 rx_packets = 4;
2352
2353 optional int64 tx_bytes = 5;
2354
2355 optional int64 tx_packets = 6;
2356}
2357
2358/**
2359 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2360 *
2361 * Pulled from:
2362 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2363 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002364message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002365 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002366
2367 optional int64 rx_bytes = 2;
2368
2369 optional int64 rx_packets = 3;
2370
2371 optional int64 tx_bytes = 4;
2372
2373 optional int64 tx_packets = 5;
2374}
2375
2376/**
2377 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
2378 *
2379 * Pulled from:
2380 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2381 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002382message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002383 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002384
Yao Chenc40a19d2018-03-15 16:48:25 -07002385 // 1 denotes foreground and 0 denotes background. This is called Set in
2386 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002387 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002388
2389 optional int64 rx_bytes = 3;
2390
2391 optional int64 rx_packets = 4;
2392
2393 optional int64 tx_bytes = 5;
2394
2395 optional int64 tx_packets = 6;
2396}
2397
2398/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002399 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2400 *
2401 * Pulled from:
2402 * StatsCompanionService
2403 */
2404message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002405 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002406
2407 optional int64 rx_bytes = 2;
2408
2409 optional int64 tx_bytes = 3;
2410}
2411
2412/**
David Chenc8a43242017-10-17 16:23:28 -07002413 * Pulls the kernel wakelock durations. This atom is adapted from
2414 * android/internal/os/KernelWakelockStats.java
2415 *
2416 * Pulled from:
2417 * StatsCompanionService using KernelWakelockReader.
2418 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002419message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002420 optional string name = 1;
2421
2422 optional int32 count = 2;
2423
2424 optional int32 version = 3;
2425
Yangster-maca8a30442018-10-13 23:46:34 -07002426 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07002427}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002428
Chenjie Yu05013b32017-11-21 10:21:41 -08002429/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002430 * Pulls low power state information. If power.stats HAL is not available, this
2431 * includes platform and subsystem sleep state information,
2432 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
2433 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002434 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002435 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002436 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
2437 * as defined in:
2438 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002439 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002440message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002441 // Subsystem name
2442 optional string subsystem_name = 1;
2443 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2444 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002445 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
2446 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002447 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002448 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002449 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002450 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002451 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002452}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002453
Chenjie Yu05013b32017-11-21 10:21:41 -08002454/**
Bookatz92da2832018-11-01 18:10:03 -07002455 * Pulls on-device power measurement information.
2456 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
2457 * Pulled from:
2458 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
2459 */
2460message OnDevicePowerMeasurement {
2461 // Name of the subsystem (to which the rail belongs).
2462 optional string subsystem_name = 1;
2463
2464 // Rail name. The rail lies within the subsystem.
2465 optional string rail_name = 2;
2466
2467 // Time (in ms since boot) at which the rail energy value was measured.
2468 // This may differ slightly from the time that statsd logs this information.
2469 optional uint64 measurement_timestamp_millis = 3;
2470
2471 // Accumulated energy used via the rail since device boot in uWs.
2472 optional uint64 energy_microwatt_secs = 4;
2473}
2474
2475/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002476 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002477 * Pulls the time the cpu spend on the frequency index. Frequency index
2478 * starts from highest to lowest. The value should be monotonically
2479 * increasing since boot. However, if there is a cpu
2480 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002481 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002482message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002483 optional uint32 cluster = 1;
2484 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002485 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002486}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002487
Chenjie Yu05013b32017-11-21 10:21:41 -08002488/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002489 * Pulls Cpu Time Per Uid.
2490 * Note that isolated process uid time should be attributed to host uids.
2491 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002492message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002493 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00002494 optional uint64 user_time_micros = 2;
2495 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002496}
2497
2498/**
2499 * Pulls Cpu Time Per Uid per frequency.
2500 * Note that isolated process uid time should be attributed to host uids.
2501 * For each uid, we order the time by descending frequencies.
2502 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002503message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002504 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002505 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002506 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002507}
Hugo Benichi884970e2017-11-14 22:42:46 +09002508
Chenjie Yu05013b32017-11-21 10:21:41 -08002509/**
2510 * Pulls Wifi Controller Activity Energy Info
2511 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002512message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002513 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002514 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002515 // stack reported state
2516 // TODO: replace this with proto enum
2517 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002518 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002519 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002520 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002521 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002522 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002523 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002524 // product of current(mA), voltage(V) and time(ms)
2525 optional uint64 controller_energy_used = 6;
2526}
2527
2528/**
2529 * Pulls Modem Activity Energy Info
2530 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002531message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002532 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002533 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07002534 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08002535 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002536 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002537 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002538 /**
2539 * Tx power index
2540 * index 0 = tx_power < 0dBm
2541 * index 1 = 0dBm < tx_power < 5dBm
2542 * index 2 = 5dBm < tx_power < 15dBm
2543 * index 3 = 15dBm < tx_power < 20dBm
2544 * index 4 = tx_power > 20dBm
2545 */
2546 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002547 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002548 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002549 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002550 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002551 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002552 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002553 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002554 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002555 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002556 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002557 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002558 // product of current(mA), voltage(V) and time(ms)
2559 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002560}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002561
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002562/**
2563 * Pulls Bluetooth Activity Energy Info
2564 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2565 */
2566message BluetoothActivityInfo {
2567 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002568 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002569 // bluetooth stack state
2570 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002571 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002572 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002573 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002574 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002575 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002576 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002577 // product of current(mA), voltage(V) and time(ms)
2578 optional uint64 energy_used = 6;
2579}
2580
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002581/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002582 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00002583 *
2584 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002585 */
2586message ProcessMemoryState {
2587 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002588 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002589
2590 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002591 // Usually package name, "system" for system server.
2592 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002593 optional string process_name = 2;
2594
Rafal Slawikda51b932018-12-13 16:31:33 +00002595 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07002596 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002597
2598 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002599 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002600
2601 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002602 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002603
Rajeev Kumar90235992018-01-29 11:06:48 -08002604 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00002605 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
2606 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08002607 optional int64 rss_in_bytes = 6;
2608
2609 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00002610 // Value is read from memory.stat, field total_cache if per-app memory
2611 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002612 optional int64 cache_in_bytes = 7;
2613
2614 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00002615 // Value is read from memory.stat, field total_swap if per-app memory
2616 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002617 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01002618
Rafal Slawikd03ae422018-11-20 11:27:45 +00002619 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002620 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00002621
2622 // Elapsed real time when the process started.
2623 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
2624 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002625}
2626
2627/*
Rafal Slawik08621582018-10-15 14:53:07 +01002628 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00002629 *
2630 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01002631 */
2632message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01002633 // The uid if available. -1 means not available.
2634 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01002635
Rafal Slawikbf67d072018-10-23 11:07:54 +01002636 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002637 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01002638 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01002639
Rafal Slawikbf67d072018-10-23 11:07:54 +01002640 // # of page-faults
2641 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01002642
Rafal Slawikbf67d072018-10-23 11:07:54 +01002643 // # of major page-faults
2644 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01002645
Rafal Slawikbf67d072018-10-23 11:07:54 +01002646 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00002647 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01002648 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01002649
Rafal Slawikd03ae422018-11-20 11:27:45 +00002650 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002651 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01002652
2653 // Elapsed real time when the process started.
2654 // Value is read from /proc/PID/stat, field 22.
2655 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01002656}
2657
2658/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00002659 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00002660 *
2661 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
2662 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00002663 *
2664 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002665 */
2666message ProcessMemoryHighWaterMark {
2667 // The uid if available. -1 means not available.
2668 optional int32 uid = 1 [(is_uid) = true];
2669
Rafal Slawikda51b932018-12-13 16:31:33 +00002670 // The process name.
2671 // Usually package name or process cmdline.
2672 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002673 optional string process_name = 2;
2674
2675 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
2676 // /proc/PID/status.
2677 optional int64 rss_high_water_mark_in_bytes = 3;
2678}
2679
2680/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002681 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002682 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002683message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002684 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002685}
2686
2687/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002688 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002689 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002690message SystemUptime {
2691 // Milliseconds since the system was booted.
2692 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
2693 // for external input).
2694 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08002695 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002696}
2697
2698/*
2699 * Reads from /proc/uid_concurrent_active_time which has the format:
2700 * active: X (X is # cores)
2701 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
2702 * [uid1]: [time-0] [time-1] [time-2] ... ...
2703 * ...
2704 * Time-N means the CPU time a UID spent running concurrently with N other processes.
2705 * The file contains a monotonically increasing count of time for a single boot.
2706 */
2707message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002708 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002709 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002710}
2711
2712/**
2713 * Reads from /proc/uid_concurrent_policy_time which has the format:
2714 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
2715 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2716 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2717 * ...
2718 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
2719 * The file contains a monotonically increasing count of time for a single boot.
2720 */
2721message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002722 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002723 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002724 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08002725}
2726
2727/*
2728 * Pulls free disk space, for data, system partition and temporary directory.
2729 */
2730message DiskSpace {
2731 // available bytes in data partition
2732 optional uint64 data_available_bytes = 1;
2733 // available bytes in system partition
2734 optional uint64 system_available_bytes = 2;
2735 // available bytes in download cache or temp directories
2736 optional uint64 temp_available_bytes = 3;
2737}
Tej Singhbf972d92018-01-10 20:51:13 -08002738
2739/**
2740 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002741 * Pulled from:
2742 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002743 */
2744message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07002745 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08002746}
2747
2748/**
2749 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002750 * Pulled from:
2751 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002752 */
2753message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07002754 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08002755}
2756
2757/**
Bookatz17f0d8a2018-09-13 12:56:32 -07002758 * Pulls battery voltage.
2759 * Pulled from:
2760 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2761 */
2762message BatteryVoltage {
2763 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07002764 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07002765}
2766
2767/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08002768 * Pulls battery level (percent full, from 0 to 100).
2769 *
2770 * Pulled from:
2771 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2772 */
2773message BatteryLevel {
2774 // Battery level. Should be in [0, 100].
2775 optional int32 battery_level = 1;
2776}
2777
2778/**
Tej Singhd89137e2018-03-26 14:51:40 -07002779 * Pulls the temperature of various parts of the device.
2780 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08002781 *
2782 * Pulled from:
2783 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
2784 */
2785message Temperature {
2786 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY.
2787 optional android.os.TemperatureTypeEnum sensor_location = 1;
2788
2789 // The name of the temperature source. Eg. CPU0
2790 optional string sensor_name = 2;
2791
Tej Singhd89137e2018-03-26 14:51:40 -07002792 // Temperature in tenths of a degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002793 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08002794}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002795
2796/**
2797 * Pulls the statistics of calls to Binder.
2798 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01002799 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
2800 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002801 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00002802 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002803 */
2804message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00002805 // UID of the process responsible for the binder transaction. It will be set if the process
2806 // executing the binder transaction attribute the transaction to another uid using
2807 // Binder.setThreadWorkSource().
2808 //
2809 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002810 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00002811 // UID of the process executing the binder transaction.
2812 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01002813 // Fully qualified class name of the API call.
2814 //
2815 // This is a system server class name.
2816 //
2817 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
2818 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
2819 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
2820 // commonly used APIs.
2821 optional string service_class_name = 2;
2822 // Method name of the API call. It can also be a transaction code if we cannot
2823 // resolve it to a name. See Binder#getTransactionName.
2824 //
2825 // This is a system server method name.
2826 optional string service_method_name = 3;
2827 // Total number of API calls.
2828 optional int64 call_count = 4;
2829 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
2830 optional bool screen_interactive = 13;
2831 // Total number of API calls we have data recorded for. If we collected data for all the calls,
2832 // call_count will be equal to recorded_call_count.
2833 //
2834 // If recorded_call_count is different than call_count, it means data collection has been
2835 // sampled. All the fields below will be sampled in this case.
2836 optional int64 recorded_call_count = 12;
2837 // Number of exceptions thrown by the API.
2838 optional int64 recorded_exception_count = 5;
2839 // Total latency of all API calls.
2840 // Average can be computed using total_latency_micros / recorded_call_count.
2841 optional int64 recorded_total_latency_micros = 6;
2842 // Maximum latency of one API call.
2843 optional int64 recorded_max_latency_micros = 7;
2844 // Total CPU usage of all API calls.
2845 // Average can be computed using total_cpu_micros / recorded_call_count.
2846 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
2847 optional int64 recorded_total_cpu_micros = 8;
2848 // Maximum CPU usage of one API call.
2849 optional int64 recorded_max_cpu_micros = 9;
2850 // Maximum parcel reply size of one API call.
2851 optional int64 recorded_max_reply_size_bytes = 10;
2852 // Maximum parcel request size of one API call.
2853 optional int64 recorded_max_request_size_bytes = 11;
2854}
2855
2856/**
2857 * Pulls the statistics of exceptions during calls to Binder.
2858 *
2859 * Binder stats are cumulative from boot unless somebody reset the data using
2860 * > adb shell dumpsys binder_calls_stats --reset
2861 */
2862message BinderCallsExceptions {
2863 // Exception class name, e.g. java.lang.IllegalArgumentException.
2864 //
2865 // This is an exception class name thrown by the system server.
2866 optional string exception_class_name = 1;
2867 // Total number of exceptions.
2868 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01002869}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002870
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002871/**
2872 * Pulls the statistics of message dispatching on HandlerThreads.
2873 *
2874 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
2875 * config on the device.
2876 *
2877 * Next tag: 11
2878 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002879message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01002880 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002881 optional int32 uid = 1 [(is_uid) = true];
2882
2883 // Fully qualified class name of the handler target class.
2884 //
2885 // This field does not contain PII. This is a system server class name.
2886 optional string handler_class_name = 2;
2887
2888 // The name of the thread that runs the Looper.
2889 //
2890 // This field does not contain PII. This is a system server thread name.
2891 optional string looper_thread_name = 3;
2892
2893 // The name of the dispatched message.
2894 //
2895 // This field does not contain PII. This is a system server constant or class
2896 // name.
2897 optional string message_name = 4;
2898
2899 // Total number of successfully dispatched messages.
2900 optional int64 message_count = 5;
2901
2902 // Total number of messages that failed dispatching.
2903 optional int64 exception_count = 6;
2904
2905 // Total number of processed messages we have data recorded for. If we
2906 // collected data for all the messages, message_count will be equal to
2907 // recorded_message_count.
2908 //
2909 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01002910 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002911 optional int64 recorded_message_count = 7;
2912
2913 // Total latency of all processed messages.
2914 // Average can be computed using recorded_total_latency_micros /
2915 // recorded_message_count.
2916 optional int64 recorded_total_latency_micros = 8;
2917
2918 // Total CPU usage of all processed message.
2919 // Average can be computed using recorded_total_cpu_micros /
2920 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002921 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002922 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01002923
2924 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
2925 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01002926
2927 // Max recorded CPU usage of all processed messages.
2928 optional int64 recorded_max_cpu_micros = 11;
2929
2930 // Max recorded latency of all processed messages.
2931 optional int64 recorded_max_latency_micros = 12;
2932
2933 // Total number of messages we tracked the dispatching delay for. If we
2934 // collected data for all the messages, message_count will be equal to
2935 // recorded_delay_message_count.
2936 //
2937 // If recorded_delay_message_count is different than message_count, it means data
2938 // collection has been sampled or/and not all messages specified the target dispatch time.
2939 // The fields below will be sampled in this case.
2940 optional int64 recorded_delay_message_count = 13;
2941
2942 // Total dispatching delay of all processed messages.
2943 // Calculated as a difference between the target dispatching time (Message.when)
2944 // and the actual dispatching time.
2945 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
2946 optional int64 recorded_total_delay_millis = 14;
2947
2948 // Max dispatching delay of all processed messages.
2949 // Calculated as a difference between the target dispatching time (Message.when)
2950 // and the actual dispatching time.
2951 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01002952}
Tej Singh86dc9db2018-09-06 00:39:57 +00002953
2954/**
2955 * Pulls disk information, such as write speed and latency.
2956 */
2957message DiskStats {
2958 // Time taken to open, write 512B to, and close a file.
2959 // -1 if error performing the check.
2960 optional int64 data_write_latency_millis = 1;
2961
2962 optional bool file_based_encryption = 2;
2963
2964 // Recent disk write speed in kB/s.
2965 // -1 if error querying storageed.
2966 // 0 if data is unavailable.
2967 optional int32 recent_disk_write_speed = 3;
2968}
2969
2970
2971/**
2972 * Free and total bytes of the Data, Cache, and System partition.
2973 */
2974message DirectoryUsage {
2975 enum Directory {
2976 UNKNOWN = 0;
2977 DATA = 1;
2978 CACHE = 2;
2979 SYSTEM = 3;
2980 }
2981 optional Directory directory = 1;
2982 optional int64 free_bytes = 2;
2983 optional int64 total_bytes = 3;
2984}
2985
2986
2987/**
2988 * Size of an application: apk size, data size, and cache size.
2989 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
2990 * Information is only reported for apps with the primary user (user 0).
2991 * Sizes are aggregated by package name.
2992 */
2993message AppSize {
2994 // Including uids will involve modifying diskstats logic.
2995 optional string package_name = 1;
2996 // App size in bytes. -1 if unavailable.
2997 optional int64 app_size_bytes = 2;
2998 // App data size in bytes. -1 if unavailable.
2999 optional int64 app_data_size_bytes = 3;
3000 // App cache size in bytes. -1 if unavailable.
3001 optional int64 app_cache_size_bytes = 4;
3002 // Time that the cache file was produced.
3003 // Uses System.currentTimeMillis(), which is wall clock time.
3004 optional int64 cache_time_millis = 5;
3005}
3006
3007
3008/**
3009 * Size of a particular category. Eg: photos, videos.
3010 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3011 */
3012message CategorySize {
3013 enum Category {
3014 UNKNOWN = 0;
3015 APP_SIZE = 1;
3016 APP_DATA_SIZE = 2;
3017 APP_CACHE_SIZE = 3;
3018 PHOTOS = 4;
3019 VIDEOS = 5;
3020 AUDIO = 6;
3021 DOWNLOADS = 7;
3022 SYSTEM = 8;
3023 OTHER = 9;
3024 }
3025 optional Category category = 1;
3026 // Category size in bytes.
3027 optional int64 size_bytes = 2;
3028 // Time that the cache file was produced.
3029 // Uses System.currentTimeMillis(), which is wall clock time.
3030 optional int64 cache_time_millis = 3;
3031}
Tej Singhd6d6d772018-09-05 17:41:25 -07003032
3033/**
Tej Singhe7726dc2018-09-21 11:42:12 -07003034 * Pulls per uid I/O stats. The stats are cumulative since boot.
3035 *
3036 * Read/write bytes are I/O events from a storage device
3037 * Read/write chars are data requested by read/write syscalls, and can be
3038 * satisfied by caching.
3039 *
3040 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
3041 */
3042message DiskIo {
3043 optional int32 uid = 1 [(is_uid) = true];
3044 optional int64 fg_chars_read = 2;
3045 optional int64 fg_chars_write = 3;
3046 optional int64 fg_bytes_read = 4;
3047 optional int64 fg_bytes_write = 5;
3048 optional int64 bg_chars_read = 6;
3049 optional int64 bg_chars_write = 7;
3050 optional int64 bg_bytes_read = 8;
3051 optional int64 bg_bytes_write = 9;
3052 optional int64 fg_fsync = 10;
3053 optional int64 bg_fsync= 11;
3054}
3055
3056
3057/**
Tej Singhd6d6d772018-09-05 17:41:25 -07003058 * Pulls the number of fingerprints for each user.
3059 *
3060 * Pulled from StatsCompanionService, which queries FingerprintManager.
3061 */
3062message NumFingerprints {
3063 // The associated user. Eg: 0 for owners, 10+ for others.
3064 // Defined in android/os/UserHandle.java
3065 optional int32 user = 1;
3066 // Number of fingerprints registered to that user.
3067 optional int32 num_fingerprints = 2;
3068}
Chenjie Yu12e5e672018-09-14 15:54:59 -07003069
Yangsteraf9aee72018-10-12 09:26:16 -07003070message AggStats {
3071 optional int64 min = 1;
3072
3073 optional int64 average = 2;
3074
3075 optional int64 max = 3;
3076}
3077
3078message ProcessStatsStateProto {
3079 optional android.service.procstats.ScreenState screen_state = 1;
3080
3081 optional android.service.procstats.MemoryState memory_state = 2;
3082
3083 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
3084 // and not frameworks/base/core/java/android/app/ActivityManager.java
3085 optional android.service.procstats.ProcessState process_state = 3;
3086
3087 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003088 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003089
3090 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003091 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07003092
3093 // # of samples taken
3094 optional int32 sample_size = 5;
3095
3096 // PSS is memory reserved for this process
3097 optional AggStats pss = 6;
3098
3099 // USS is memory shared between processes, divided evenly for accounting
3100 optional AggStats uss = 7;
3101
3102 // RSS is memory resident for this process
3103 optional AggStats rss = 8;
3104}
3105
3106// Next Tag: 7
3107message ProcessStatsProto {
3108 // Name of process.
3109 optional string process = 1;
3110
3111 // Uid of the process.
3112 optional int32 uid = 2;
3113
3114 // Information about how often kills occurred
3115 message Kill {
3116 // Count of excessive CPU kills
3117 optional int32 cpu = 1;
3118
3119 // Count of kills when cached
3120 optional int32 cached = 2;
3121
3122 // PSS stats during cached kill
3123 optional AggStats cached_pss = 3;
3124 }
3125 optional Kill kill = 3;
3126
3127 // Time and memory spent in various states.
3128 repeated ProcessStatsStateProto states = 5;
3129
3130 // Total time process has been running... screen_state, memory_state, and process_state
3131 // will not be set.
3132 optional ProcessStatsStateProto total_running_state = 6;
3133}
3134
3135message PackageServiceOperationStatsProto {
3136 // Operate enum: Started, Foreground, Bound, Executing
3137 optional android.service.procstats.ServiceOperationState operation = 1;
3138
3139 // Number of times the service was in this operation.
3140 optional int32 count = 2;
3141
3142 // Information about a state the service can be in.
3143 message StateStats {
3144 // Screen state enum.
3145 optional android.service.procstats.ScreenState screen_state = 1;
3146 // Memory state enum.
3147 optional android.service.procstats.MemoryState memory_state = 2;
3148
3149 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07003150 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003151 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003152 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003153 }
3154 repeated StateStats state_stats = 3;
3155}
3156
3157message PackageServiceStatsProto {
3158 // Name of service component.
3159 optional string service_name = 1;
3160
3161 // The operation stats.
3162 // The package_name, package_uid, package_version, service_name will not be set to save space.
3163 repeated PackageServiceOperationStatsProto operation_stats = 2;
3164}
3165
3166message PackageAssociationSourceProcessStatsProto {
3167 // Uid of the process.
3168 optional int32 process_uid = 1;
3169 // Process name.
3170 optional string process_name = 2;
3171
3172 // Total count of the times this association appeared.
3173 optional int32 total_count = 3;
3174
3175 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07003176 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003177
3178 // Total count of the times this association became actively impacting its target process.
3179 optional int32 active_count = 5;
3180
3181 // Information on one source in this association.
3182 message StateStats {
3183 // Process state enum.
3184 optional android.service.procstats.ProcessState process_state = 1;
3185 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003186 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003187 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003188 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003189 }
3190 repeated StateStats active_state_stats = 6;
3191}
3192
3193message PackageAssociationProcessStatsProto {
3194 // Name of the target component.
3195 optional string component_name = 1;
3196 // Information on one source in this association.
3197 repeated PackageAssociationSourceProcessStatsProto sources = 2;
3198}
3199
3200
3201message ProcessStatsPackageProto {
3202 // Name of package.
3203 optional string package = 1;
3204
3205 // Uid of the package.
3206 optional int32 uid = 2;
3207
3208 // Version of the package.
3209 optional int64 version = 3;
3210
3211 // Stats for each process running with the package loaded in to it.
3212 repeated ProcessStatsProto process_stats = 4;
3213
3214 // Stats for each of the package's services.
3215 repeated PackageServiceStatsProto service_stats = 5;
3216
3217 // Stats for each association with the package.
3218 repeated PackageAssociationProcessStatsProto association_stats = 6;
3219}
3220
3221message ProcessStatsSectionProto {
3222 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003223 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07003224
3225 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003226 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003227
3228 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003229 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003230
3231 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003232 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003233
3234 // System runtime library. e.g. "libdvm.so", "libart.so".
3235 optional string runtime = 5;
3236
3237 // whether kernel reports swapped pss.
3238 optional bool has_swapped_pss = 6;
3239
3240 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
3241 enum Status {
3242 STATUS_UNKNOWN = 0;
3243 STATUS_COMPLETE = 1;
3244 STATUS_PARTIAL = 2;
3245 STATUS_SHUTDOWN = 3;
3246 STATUS_SYSPROPS = 4;
3247 }
3248 repeated Status status = 7;
3249
3250 // Stats for each process.
3251 repeated ProcessStatsProto process_stats = 8;
3252
3253 // Stats for each package.
3254 repeated ProcessStatsPackageProto package_stats = 9;
3255}
3256
Chenjie Yu12e5e672018-09-14 15:54:59 -07003257/**
3258 * Pulled from ProcessStatsService.java
3259 */
3260message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07003261 optional ProcessStatsSectionProto proc_stats_section = 1;
3262}
3263
3264message PowerProfileProto {
3265 optional double cpu_suspend = 1;
3266
3267 optional double cpu_idle = 2;
3268
3269 optional double cpu_active = 3;
3270
3271 message CpuCluster {
3272 optional int32 id = 1;
3273 optional double cluster_power = 2;
3274 optional int32 cores = 3;
3275 repeated int64 speed = 4;
3276 repeated double core_power = 5;
3277 }
3278
3279 repeated CpuCluster cpu_cluster = 40;
3280
3281 optional double wifi_scan = 4;
3282
3283 optional double wifi_on = 5;
3284
3285 optional double wifi_active = 6;
3286
3287 optional double wifi_controller_idle = 7;
3288
3289 optional double wifi_controller_rx = 8;
3290
3291 optional double wifi_controller_tx = 9;
3292
3293 repeated double wifi_controller_tx_levels = 10;
3294
3295 optional double wifi_controller_operating_voltage = 11;
3296
3297 optional double bluetooth_controller_idle = 12;
3298
3299 optional double bluetooth_controller_rx = 13;
3300
3301 optional double bluetooth_controller_tx = 14;
3302
3303 optional double bluetooth_controller_operating_voltage = 15;
3304
3305 optional double modem_controller_sleep = 16;
3306
3307 optional double modem_controller_idle = 17;
3308
3309 optional double modem_controller_rx = 18;
3310
3311 repeated double modem_controller_tx = 19;
3312
3313 optional double modem_controller_operating_voltage = 20;
3314
3315 optional double gps_on = 21;
3316
3317 repeated double gps_signal_quality_based = 22;
3318
3319 optional double gps_operating_voltage = 23;
3320
3321 optional double bluetooth_on = 24;
3322
3323 optional double bluetooth_active = 25;
3324
3325 optional double bluetooth_at_cmd = 26;
3326
3327 optional double ambient_display = 27;
3328
3329 optional double screen_on = 28;
3330
3331 optional double radio_on = 29;
3332
3333 optional double radio_scanning = 30;
3334
3335 optional double radio_active = 31;
3336
3337 optional double screen_full = 32;
3338
3339 optional double audio = 33;
3340
3341 optional double video = 34;
3342
3343 optional double flashlight = 35;
3344
3345 optional double memory = 36;
3346
3347 optional double camera = 37;
3348
3349 optional double wifi_batched_scan = 38;
3350
3351 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07003352}
Chenjie Yuab530202018-09-26 12:39:20 -07003353
3354/**
3355 * power_profile.xml and other constants for power model calculations.
3356 * Pulled from PowerProfile.java
3357 */
3358message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07003359 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07003360}
Chenjie Yub35b5f72018-10-13 23:25:11 -07003361
3362/**
arangelovd5db50e2018-10-12 20:24:39 +01003363 * Logs when a user restriction was added or removed.
3364 *
3365 * Logged from:
3366 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3367 */
3368message UserRestrictionChanged {
3369 // The raw string of the user restriction as defined in UserManager.
3370 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
3371 optional string restriction = 1;
3372 // Whether the restriction is enabled or disabled.
3373 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07003374}
Yangster-mac308ea0c2018-10-22 13:10:25 -07003375
3376/**
3377 * Pulls process user time and system time. Puller takes a snapshot of all pids
3378 * in the system and returns cpu stats for those that are working at the time.
3379 * Dead pids will be dropped. Kernel processes are excluded.
3380 * Min cool-down is 5 sec.
3381 */
3382message ProcessCpuTime {
3383 optional int32 uid = 1 [(is_uid) = true];
3384
3385 optional string process_name = 2;
3386 // Process cpu time in user space, cumulative from boot/process start
3387 optional int64 user_time_millis = 3;
3388 // Process cpu time in system space, cumulative from boot/process start
3389 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01003390}
Misha Wagner5a51e002018-10-03 15:04:09 +01003391
3392/**
3393 * Pulls the CPU usage for each thread.
3394 *
3395 * Read from /proc/$PID/task/$TID/time_in_state files.
3396 *
3397 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
3398 * time_in_state files not being present on some phones, have not been addressed. These should be
3399 * considered before a public release.
3400 */
3401message CpuTimePerThreadFreq {
3402 // UID that owns the process.
3403 optional int32 uid = 1 [(is_uid) = true];
3404 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003405 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01003406 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003407 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01003408 // Name of the process taken from `/proc/$PID/cmdline`.
3409 optional string process_name = 4;
3410 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
3411 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00003412
3413 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
3414 // are given in KHz, and time is given in milliseconds since the thread started. All eight
3415 // frequencies are given here as the alternative is sending eight separate atoms. This method
3416 // significantly reduces the amount of data created
3417 optional int32 frequency1_khz = 6;
3418 optional int32 time1_millis = 7;
3419 optional int32 frequency2_khz = 8;
3420 optional int32 time2_millis = 9;
3421 optional int32 frequency3_khz = 10;
3422 optional int32 time3_millis = 11;
3423 optional int32 frequency4_khz = 12;
3424 optional int32 time4_millis = 13;
3425 optional int32 frequency5_khz = 14;
3426 optional int32 time5_millis = 15;
3427 optional int32 frequency6_khz = 16;
3428 optional int32 time6_millis = 17;
3429 optional int32 frequency7_khz = 18;
3430 optional int32 time7_millis = 19;
3431 optional int32 frequency8_khz = 20;
3432 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01003433}
Bookatz75ee60422018-11-09 12:27:37 -08003434
3435/**
Bookatz366a4432018-11-20 09:42:33 -08003436 * Pulls information about the device's build.
3437 */
3438message BuildInformation {
3439 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
3440 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
3441 optional string fingerprint = 1;
3442
3443 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
3444 optional string brand = 2;
3445
3446 // Build.PRODUCT. The name of the overall product.
3447 optional string product = 3;
3448
3449 // Build.DEVICE. The name of the industrial design.
3450 optional string device = 4;
3451
3452 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
3453 optional string version_release = 5;
3454
3455 // Build.ID. E.g. a label like "M4-rc20".
3456 optional string id = 6;
3457
3458 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
3459 // represent this build.
3460 optional string version_incremental = 7;
3461
3462 // Build.TYPE. The type of build, like "user" or "eng".
3463 optional string type = 8;
3464
3465 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
3466 optional string tags = 9;
3467}
3468
3469/**
Bookatz75ee60422018-11-09 12:27:37 -08003470 * Pulls on-device BatteryStats power use calculations for the overall device.
3471 */
3472message DeviceCalculatedPowerUse {
3473 // Power used by the device in mAh, as computed by BatteryStats, since BatteryStats last reset
3474 // (i.e. roughly since device was last significantly charged).
3475 // Currently, this is BatteryStatsHelper.getComputedPower() (not getTotalPower()).
3476 optional float computed_power_milli_amp_hours = 1;
3477}
3478
3479/**
3480 * Pulls on-device BatteryStats power use calculations broken down by uid.
3481 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
3482 * that is attributed to non-uid items. They must all be included to get the total power use.
3483 */
3484message DeviceCalculatedPowerBlameUid {
3485 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
3486 optional int32 uid = 1 [(is_uid) = true];
3487
3488 // Power used by this uid in mAh, as computed by BatteryStats, since BatteryStats last reset
3489 // (i.e. roughly since device was last significantly charged).
3490 optional float power_milli_amp_hours = 2;
3491}
3492
3493/**
3494 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
3495 * drain type.
3496 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
3497 * is attributed uids. They must all be included to get the total power use.
3498 */
3499message DeviceCalculatedPowerBlameOther {
3500 // The type of item whose power use is being reported.
3501 enum DrainType {
3502 AMBIENT_DISPLAY = 0;
3503 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
3504 BLUETOOTH = 2;
3505 CAMERA = 3;
3506 // Cell-standby
3507 CELL = 4;
3508 FLASHLIGHT = 5;
3509 IDLE = 6;
3510 MEMORY = 7;
3511 // Amount that total computed drain exceeded the drain estimated using the
3512 // battery level changes and capacity.
3513 OVERCOUNTED = 8;
3514 PHONE = 9;
3515 SCREEN = 10;
3516 // Amount that total computed drain was below the drain estimated using the
3517 // battery level changes and capacity.
3518 UNACCOUNTED = 11;
3519 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
3520 WIFI = 13;
3521 }
3522 optional DrainType drain_type = 1;
3523
3524 // Power used by this item in mAh, as computed by BatteryStats, since BatteryStats last reset
3525 // (i.e. roughly since device was last significantly charged).
3526 optional float power_milli_amp_hours = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00003527}
arangelov4e994062018-11-13 16:12:38 +00003528
3529/**
3530 * Logs device policy features.
3531 *
3532 * Logged from:
3533 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3534 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
3535 */
3536message DevicePolicyEvent {
3537 // The event id - unique for each event.
3538 optional android.stats.devicepolicy.EventId event_id = 1;
3539 // The admin package name.
3540 optional string admin_package_name = 2;
3541 // A generic integer parameter.
3542 optional int32 integer_value = 3;
3543 // A generic boolean parameter.
3544 optional bool boolean_value = 4;
3545 // A parameter specifying a time period in milliseconds.
3546 optional uint64 time_period_millis = 5;
3547 // A parameter specifying a list of package names, bundle extras or string parameters.
3548 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
3549}
shawnlinea5b66b2018-11-13 15:05:29 +08003550
3551/**
3552 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
3553 *
3554 * Logged from:
3555 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3556 */
3557message DocsUILaunchReported {
3558 optional android.stats.docsui.LaunchAction launch_action = 1;
3559 optional bool has_initial_uri = 2;
3560 optional android.stats.docsui.MimeType mime_type = 3;
3561 optional android.stats.docsui.Root initial_root = 4;
3562}
3563
3564/**
3565 * Logs root/app visited event in file managers/picker. Call this when the user
3566 * taps on root/app in hamburger menu.
3567 *
3568 * Logged from:
3569 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3570 */
3571message DocsUIRootVisitedReported {
3572 optional android.stats.docsui.ContextScope scope = 1;
3573 optional android.stats.docsui.Root root = 2;
3574}
3575
3576/**
3577 * Logs file operation stats. Call this when a file operation has completed.
3578 *
3579 * Logged from:
3580 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3581 */
3582message DocsUIFileOperationReported {
3583 optional android.stats.docsui.Provider provider = 1;
3584 optional android.stats.docsui.FileOperation file_op = 2;
3585}
3586
3587/**
3588 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
3589 * mode.
3590 *
3591 * Logged from:
3592 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3593 */
3594message DocsUIFileOperationCopyMoveModeReported {
3595 optional android.stats.docsui.FileOperation file_op = 1;
3596 optional android.stats.docsui.CopyMoveOpMode mode = 2;
3597}
3598
3599
3600/**
3601 * Logs file sub operation stats. Call this when a file operation has failed.
3602 *
3603 * Logged from:
3604 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3605 */
3606message DocsUIFileOperationFailureReported {
3607 optional android.stats.docsui.Authority authority = 1;
3608 optional android.stats.docsui.SubFileOperation sub_op = 2;
3609}
3610
3611/**
3612* Logs the cancellation of a file operation. Call this when a job is canceled
3613*
3614* Logged from:
3615* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3616*/
3617message DocsUIFileOperationCanceledReported {
3618 optional android.stats.docsui.FileOperation file_op = 1;
3619}
3620
3621/**
3622 * Logs startup time in milliseconds.
3623 *
3624 * Logged from:
3625 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3626 */
3627message DocsUIStartupMsReported {
3628 optional int32 startup_millis = 1;
3629}
3630
3631/**
3632 * Logs the action that was started by user.
3633 *
3634 * Logged from:
3635 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3636 */
3637message DocsUIUserActionReported {
3638 optional android.stats.docsui.UserAction action = 1;
3639}
3640
3641/**
3642 * Logs the invalid type when invalid scoped access is requested.
3643 *
3644 * Logged from:
3645 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
3646 */
3647message DocsUIInvalidScopedAccessRequestReported {
3648 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00003649}