blob: f75e58406a83bfc03f4866373309c25e26115637 [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";
Jack Heab86dbd22018-12-18 15:43:27 -080028import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080029import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080030import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080031import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080032import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080033import "frameworks/base/core/proto/android/server/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080034import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070035import "frameworks/base/core/proto/android/service/procstats_enum.proto";
36import "frameworks/base/core/proto/android/stats/enums.proto";
shawnlinea5b66b2018-11-13 15:05:29 +080037import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070038import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080039import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080040import "frameworks/base/core/proto/android/telephony/enums.proto";
41import "frameworks/base/core/proto/android/view/enums.proto";
arangelov4e994062018-11-13 16:12:38 +000042import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
43import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080044
Yao Chend54f9dd2017-10-17 17:37:48 +000045/**
Stefan Lafonae2df012017-11-14 09:17:21 -080046 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000047 * raw stats log events from the Android system, also known as "atoms."
48 *
49 * This field contains a single oneof with all of the available messages.
50 * The stats-log-api-gen tool runs as part of the Android build and
51 * generates the android.util.StatsLog class, which contains the constants
52 * and methods that Android uses to log.
53 *
Stefan Lafonae2df012017-11-14 09:17:21 -080054 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000055 * Instead, statsd on Android constructs these messages synthetically,
56 * in the format defined here and in stats_log.proto.
57 */
Stefan Lafonae2df012017-11-14 09:17:21 -080058message Atom {
59 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070060 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070061 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
62 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070063 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070064 BleScanResultReceived ble_scan_result_received = 4;
65 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080066 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070067 SyncStateChanged sync_state_changed = 7;
68 ScheduledJobStateChanged scheduled_job_state_changed = 8;
69 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070070 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080071 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
72 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
73 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070074 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
75 MemoryFactorStateChanged memory_factor_state_changed = 15;
76 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
77 CachedKillReported cached_kill_reported = 17;
78 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070079 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080080 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
81 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
82 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070083 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080084 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070085 CameraStateChanged camera_state_changed = 25;
86 FlashlightStateChanged flashlight_state_changed = 26;
87 UidProcessStateChanged uid_process_state_changed = 27;
88 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
89 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070090 BatteryLevelChanged battery_level_changed = 30;
91 ChargingStateChanged charging_state_changed = 31;
92 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -070093 InteractiveStateChanged interactive_state_changed = 33;
94 // 34 is available
Bookatz8c6571b2017-10-24 15:04:41 -070095 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
96 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -070097 WifiLockStateChanged wifi_lock_state_changed = 37;
98 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
99 WifiScanStateChanged wifi_scan_state_changed = 39;
100 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700101 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700102 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700103 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900104 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700105 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800106 AnomalyDetected anomaly_detected = 46;
David Chen0b5c90c2018-01-25 16:51:49 -0800107 AppBreadcrumbReported app_breadcrumb_reported = 47;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800108 AppStartOccurred app_start_occurred = 48;
109 AppStartCanceled app_start_canceled = 49;
110 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800111 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800112 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800113 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800114 LmkStateChanged lmk_state_changed = 54;
115 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800116 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800117 BootSequenceReported boot_sequence_reported = 57;
Tej Singhbb8554a2018-01-26 11:59:14 -0800118 DaveyOccurred davey_occurred = 58;
Chenjie Yue8904192017-12-08 19:12:57 -0800119 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800120 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800121 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800122 KeyguardStateChanged keyguard_state_changed = 62;
123 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
124 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800125 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800126 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800127 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
128 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800129 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700130 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800131 SpeakerImpedanceReported speaker_impedance_reported = 71;
132 HardwareFailed hardware_failed = 72;
133 PhysicalDropDetected physical_drop_detected = 73;
134 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800135 MobileConnectionStateChanged mobile_connection_state_changed = 75;
136 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700137 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800138 AppCrashOccurred app_crash_occurred = 78;
139 ANROccurred anr_occurred = 79;
140 WTFOccurred wtf_occurred = 80;
141 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700142 GenericAtom generic_atom = 82;
Yangster-mac48b3d622018-08-18 12:38:11 -0700143 KeyValuePairsAtom key_value_pairs_atom = 83;
Bookatza7020bd2018-08-28 16:29:35 -0700144 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700145 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700146 ThermalThrottlingStateChanged thermal_throttling = 86;
Tej Singhd6d6d772018-09-05 17:41:25 -0700147 FingerprintAcquired fingerprint_acquired = 87;
148 FingerprintAuthenticated fingerprint_authenticated = 88;
149 FingerprintErrorOccurred fingerprint_error_occurred = 89;
Howard Ro688ae182018-09-25 00:09:36 -0700150 Notification notification = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700151 BatteryHealthSnapshot battery_health_snapshot = 91;
152 SlowIo slow_io = 92;
153 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700154 PhoneServiceStateChanged phone_service_state_changed = 94;
155 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100156 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700157 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700158 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700159 // TODO: service state change is very noisy shortly after boot, as well
160 // as at other transitions - coming out of doze, device plugged in, etc.
161 // Consider removing this if it becomes a problem
162 ServiceStateChanged service_state_changed = 99;
163 ServiceLaunchReported service_launch_reported = 100;
Yangster-macb89807e2018-11-15 21:10:57 -0800164 PhenotypeFlagStateChanged phenotype_flag_state_changed = 101;
165 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000166 DevicePolicyEvent device_policy_event = 103;
shawnlinea5b66b2018-11-13 15:05:29 +0800167 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104;
168 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported = 105;
169 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106;
170 DocsUIFileOperationReported docs_ui_provider_file_op = 107;
171 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request = 108;
172 DocsUILaunchReported docs_ui_launch_reported = 109;
173 DocsUIRootVisitedReported docs_ui_root_visited = 110;
174 DocsUIStartupMsReported docs_ui_startup_ms = 111;
175 DocsUIUserActionReported docs_ui_user_action_reported = 112;
Bookatzda1798c2018-12-13 14:16:00 -0800176 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
177 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f2018-12-06 11:01:38 +0000178 AppCompacted app_compacted = 115;
lifr030d23a2019-01-11 16:54:51 +0800179 NetworkDnsEventReported network_dns_event_reported = 116;
shawnlina75e82d2019-01-07 10:31:12 +0800180 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported = 117;
181 DocsUIPickResultReported docs_ui_pick_result_reported = 118;
182 DocsUISearchModeReported docs_ui_search_mode_reported = 119;
183 DocsUISearchTypeReported docs_ui_search_type_reported = 120;
Chiachang Wangf6bedc22019-01-14 11:54:32 +0800184 DataStallEvent data_stall_event = 121;
Christian Brunschenf86039e2018-12-21 12:26:14 +0000185 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000186 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800187 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800188 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800189 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
190 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000191 AppDowngraded app_downgraded = 128;
192 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
193 LowStorageStateChanged low_storage_state_changed = 130;
Yao Chend54f9dd2017-10-17 17:37:48 +0000194 }
David Chenc8a43242017-10-17 16:23:28 -0700195
David Chen6e3e6cb2018-01-03 16:14:06 -0800196 // Pulled events will start at field 10000.
Rafal Slawik3bea8952018-11-15 12:39:33 +0000197 // Next: 10043
David Chenc8a43242017-10-17 16:23:28 -0700198 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800199 WifiBytesTransfer wifi_bytes_transfer = 10000;
200 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
201 MobileBytesTransfer mobile_bytes_transfer = 10002;
202 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800203 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800204 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800205 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800206 CpuTimePerFreq cpu_time_per_freq = 10008;
207 CpuTimePerUid cpu_time_per_uid = 10009;
208 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800209 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800210 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800211 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800212 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800213 SystemElapsedRealtime system_elapsed_realtime = 10014;
214 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800215 CpuActiveTime cpu_active_time = 10016;
216 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000217 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800218 RemainingBatteryCapacity remaining_battery_capacity = 10019;
219 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800220 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100221 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100222 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100223 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000224 DiskStats disk_stats = 10025;
225 DirectoryUsage directory_usage = 10026;
226 AppSize app_size = 10027;
227 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700228 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700229 BatteryVoltage battery_voltage = 10030;
Tej Singhd6d6d772018-09-05 17:41:25 -0700230 NumFingerprints num_fingerprints = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700231 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700232 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800233 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700234 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100235 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100236 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700237 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800238 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
239 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
240 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000241 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800242 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800243 BuildInformation build_information = 10044;
David Chenc8a43242017-10-17 16:23:28 -0700244 }
yroa1fe77c2018-02-26 14:22:54 -0800245
Bookatz76aafcf2018-09-17 16:17:10 -0700246 // DO NOT USE field numbers above 100,000 in AOSP.
247 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
248 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700249}
250
Yao Chend54f9dd2017-10-17 17:37:48 +0000251/**
Yangster-mac20877162017-12-22 17:19:39 -0800252 * This proto represents a node of an attribution chain.
253 * Note: All attribution chains are represented as a repeated field of type
254 * AttributionNode. It is understood that in such arrays, the order is that
255 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000256 */
Yangster-mac20877162017-12-22 17:19:39 -0800257message AttributionNode {
258 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800259 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800260
Yangster-mac20877162017-12-22 17:19:39 -0800261 // The (optional) string tag for an element in the attribution chain. If the
262 // element has no tag, it is encoded as an empty string.
263 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700264}
265
Yangster-mac48b3d622018-08-18 12:38:11 -0700266message KeyValuePair {
267 optional int32 key = 1;
268 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700269 int32 value_int = 2;
270 int64 value_long = 3;
271 string value_str = 4;
272 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700273 }
274}
275
276message KeyValuePairsAtom {
277 optional int32 uid = 1;
278 repeated KeyValuePair pairs = 2;
279}
280
Yao Chend54f9dd2017-10-17 17:37:48 +0000281/*
282 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800283 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000284 *
285 * RULES:
286 * - The field ids for each atom must start at 1, and count upwards by 1.
287 * Skipping field ids is not allowed.
288 * - These form an API, so renaming, renumbering or removing fields is
289 * not allowed between android releases. (This is not currently enforced,
290 * but there will be a tool to enforce this restriction).
291 * - The types must be built-in protocol buffer types, namely, no sub-messages
292 * are allowed (yet). The bytes type is also not allowed.
293 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800294 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000295 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800296 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000297 * - A field that is a uid should be a string field, tagged with the [xxx]
298 * annotation. The generated code on android will be represented by UIDs,
299 * and those UIDs will be translated in xxx to those strings.
300 *
301 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700302 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000303 * - If there is a UID, it goes first. Think in an object-oriented fashion.
304 * *****************************************************************************
305 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700306
Yao Chend54f9dd2017-10-17 17:37:48 +0000307/**
Yangster-mace16189a2018-08-26 12:20:16 -0700308 * Logs when the Thermal service HAL notifies the throttling start/stop events.
309 *
310 * Logged from:
311 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
312 */
313message ThermalThrottlingStateChanged {
314 optional android.os.TemperatureTypeEnum sensor_type = 1;
315
316 enum State {
317 UNKNOWN = 0;
318 START = 1;
319 STOP = 2;
320 }
321
322 optional State state = 2;
323
324 optional float temperature = 3;
325}
326
327/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000328 * Logs when the screen state changes.
329 *
330 * Logged from:
331 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
332 */
333message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800334 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700335 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700336}
Yao Chend54f9dd2017-10-17 17:37:48 +0000337
338/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700339 * Logs that the process state of the uid, as determined by ActivityManager
340 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000341 *
342 * Logged from:
343 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
344 */
Bookatzc1a050a2017-10-10 15:49:28 -0700345message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700346 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000347
Bookatzdb026a22018-01-10 19:01:56 -0800348 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700349 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000350}
351
352/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700353 * Logs process state change of a process, as per the activity manager.
354 *
355 * Logged from:
356 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
357 */
358message ProcessStateChanged {
359 optional int32 uid = 1;
360 optional string process_name = 2;
361 optional string package_name = 3;
362 // TODO: remove this when validation is done
363 optional int64 version = 5;
364 // The state, from frameworks/base/core/proto/android/app/enums.proto.
365 optional android.app.ProcessStateEnum state = 4;
366}
367
368/**
369 * Logs when ActivityManagerService sleep state is changed.
370 *
371 * Logged from:
372 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
373 */
374message ActivityManagerSleepStateChanged {
375 // TODO: import frameworks proto
376 enum State {
377 UNKNOWN = 0;
378 ASLEEP = 1;
379 AWAKE = 2;
380 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700381 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700382}
383
384/**
385 * Logs when system memory state changes.
386 *
387 * Logged from:
388 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
389 */
390message MemoryFactorStateChanged {
391 // TODO: import frameworks proto
392 enum State {
393 MEMORY_UNKNOWN = 0;
394 NORMAL = 1; // normal.
395 MODERATE = 2; // moderate memory pressure.
396 LOW = 3; // low memory.
397 CRITICAL = 4; // critical memory.
398
399 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700400 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700401}
402
403/**
404 * Logs when app is using too much cpu, according to ActivityManagerService.
405 *
406 * Logged from:
407 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
408 */
409message ExcessiveCpuUsageReported {
410 optional int32 uid = 1;
411 optional string process_name = 2;
412 optional string package_name = 3;
413 // package version. TODO: remove this when validation is done
414 optional int64 version = 4;
415}
416
417/**
418 * Logs when a cached process is killed, along with its pss.
419 *
420 * Logged from:
421 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
422 */
423message CachedKillReported {
424 optional int32 uid = 1;
425 optional string process_name = 2;
426 optional string package_name = 3;
427 // TODO: remove this when validation is done
428 optional int64 version = 5;
429 optional int64 pss = 4;
430}
431
432/**
433 * Logs when memory stats of a process is reported.
434 *
435 * Logged from:
436 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
437 */
438message ProcessMemoryStatReported {
439 optional int32 uid = 1;
440 optional string process_name = 2;
441 optional string package_name = 3;
442 //TODO: remove this when validation is done
443 optional int64 version = 9;
444 optional int64 pss = 4;
445 optional int64 uss = 5;
446 optional int64 rss = 6;
447 enum Type {
448 ADD_PSS_INTERNAL_SINGLE = 0;
449 ADD_PSS_INTERNAL_ALL_MEM = 1;
450 ADD_PSS_INTERNAL_ALL_POLL = 2;
451 ADD_PSS_EXTERNAL = 3;
452 ADD_PSS_EXTERNAL_SLOW = 4;
453 }
454 optional Type type = 7;
455 optional int64 duration = 8;
456}
457
458/**
Bookatzc1a050a2017-10-10 15:49:28 -0700459 * Logs that a process started, finished, crashed, or ANRed.
460 *
461 * Logged from:
462 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
463 */
464message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700465 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700466
David Chen0b5c90c2018-01-25 16:51:49 -0800467 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800468 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700469
Bookatzddccf0a2017-11-28 16:48:14 -0800470 // What lifecycle state the process changed to.
471 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800472 enum State {
473 FINISHED = 0;
474 STARTED = 1;
475 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800476 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800477 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700478}
479
Bookatzc1a050a2017-10-10 15:49:28 -0700480/**
481 * Logs when the ble scan state changes.
482 *
483 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700484 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700485 */
486message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800487 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700488
489 enum State {
490 OFF = 0;
491 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700492 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
493 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700494 }
495 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700496
Bookatze5ec0b42018-03-26 13:34:56 -0700497 // Does the scan have a filter.
498 optional bool is_filtered = 3;
499 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
500 optional bool is_first_match = 4;
501 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
502 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700503}
504
505/**
506 * Logs reporting of a ble scan finding results.
507 *
508 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700509 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700510 */
Bookatzae6738e2018-09-13 11:38:56 -0700511// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700512message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800513 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700514
515 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800516 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700517}
518
519/**
520 * Logs when a sensor state changes.
521 *
522 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700523 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700524 */
525message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800526 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700527
Bookatzc1a050a2017-10-10 15:49:28 -0700528 // The id (int) of the sensor.
529 optional int32 sensor_id = 2;
530
531 enum State {
532 OFF = 0;
533 ON = 1;
534 }
535 optional State state = 3;
536}
537
Bookatzc1a050a2017-10-10 15:49:28 -0700538/**
539 * Logs when GPS state changes.
540 *
541 * Logged from:
542 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
543 */
544message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800545 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700546
547 enum State {
548 OFF = 0;
549 ON = 1;
550 }
551 optional State state = 2;
552}
553
Bookatz48d362e2018-11-06 15:49:08 -0800554/**
555 * Logs when GPS signal quality.
556 *
557 * Logged from:
558 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
559 */
560message GpsSignalQualityChanged {
561 optional android.server.location.GpsSignalQualityEnum level = 1;
562}
563
Bookatzc1a050a2017-10-10 15:49:28 -0700564
565/**
566 * Logs when a sync manager sync state changes.
567 *
568 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700569 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700570 */
571message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800572 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700573
David Chen0b5c90c2018-01-25 16:51:49 -0800574 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800575 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700576
577 enum State {
578 OFF = 0;
579 ON = 1;
580 }
581 optional State state = 3;
582}
583
Yangster-mac96353002018-09-05 11:18:55 -0700584/*
585 * Deferred job stats.
586 *
587 * Logged from:
588 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
589*/
590message DeferredJobStatsReported {
591 repeated AttributionNode attribution_node = 1;
592
593 // Number of jobs deferred.
594 optional int32 num_jobs_deferred = 2;
595
596 // Time since the last job runs.
597 optional int64 time_since_last_job_millis = 3;
598}
599
Bookatzc1a050a2017-10-10 15:49:28 -0700600/**
601 * Logs when a job scheduler job state changes.
602 *
603 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700604 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700605 */
606message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800607 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700608
609 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800610 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700611
612 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800613 FINISHED = 0;
614 STARTED = 1;
615 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700616 }
617 optional State state = 3;
618
Tej Singh33a412b2018-03-16 18:43:59 -0700619 // The reason a job has stopped.
620 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700621 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700622 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700623}
624
625/**
626 * Logs when the audio state changes.
627 *
628 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700629 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700630 */
631message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800632 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700633
634 enum State {
635 OFF = 0;
636 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700637 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
638 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700639 }
640 optional State state = 2;
641}
642
643/**
644 * Logs when the video codec state changes.
645 *
646 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700647 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700648 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800649message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800650 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700651
652 enum State {
653 OFF = 0;
654 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700655 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
656 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700657 }
658 optional State state = 2;
659}
660
661/**
662 * Logs when the flashlight state changes.
663 *
664 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700665 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700666 */
667message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800668 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700669
670 enum State {
671 OFF = 0;
672 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700673 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
674 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700675 }
676 optional State state = 2;
677}
678
679/**
680 * Logs when the camera state changes.
681 *
682 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700683 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700684 */
685message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800686 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700687
688 enum State {
689 OFF = 0;
690 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700691 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
692 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700693 }
694 optional State state = 2;
695}
696
697/**
698 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000699 *
700 * Logged from:
701 * TODO
702 */
Bookatzd6746242017-10-24 18:39:35 -0700703message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800704 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000705
Bookatz1a1b0462018-01-12 11:47:03 -0800706 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
707 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700708 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700709
710 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
711 optional string tag = 3;
712
713 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800714 RELEASE = 0;
715 ACQUIRE = 1;
716 CHANGE_RELEASE = 2;
717 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700718 }
719 optional State state = 4;
720}
721
722/**
Bookatzc1a050a2017-10-10 15:49:28 -0700723 * Logs when a partial wakelock is considered 'long' (over 1 min).
724 *
725 * Logged from:
726 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
727 */
728message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800729 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700730
Yao Chend54f9dd2017-10-17 17:37:48 +0000731 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
732 optional string tag = 2;
733
Bookatzc1a050a2017-10-10 15:49:28 -0700734 // TODO: I have no idea what this is.
735 optional string history_tag = 3;
736
737 enum State {
738 OFF = 0;
739 ON = 1;
740 }
741 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000742}
743
Bookatzc1a050a2017-10-10 15:49:28 -0700744/**
Bookatza66083f2018-09-20 17:24:00 -0700745 * Logs when the device is interactive, according to the PowerManager Notifier.
746 *
747 * Logged from:
748 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
749 */
750message InteractiveStateChanged {
751 enum State {
752 OFF = 0;
753 ON = 1;
754 }
755 optional State state = 1;
756}
757
758/**
Bookatzc1a050a2017-10-10 15:49:28 -0700759 * Logs Battery Saver state change.
760 *
761 * Logged from:
762 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
763 */
764message BatterySaverModeStateChanged {
765 enum State {
766 OFF = 0;
767 ON = 1;
768 }
769 optional State state = 1;
770}
771
772/**
773 * Logs Doze mode state change.
774 *
775 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800776 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700777 */
778message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800779 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800780}
781
782
783/**
784 * Logs state change of Doze mode including maintenance windows.
785 *
786 * Logged from:
787 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
788 */
789message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800790 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700791}
792
793/**
794 * Logs screen brightness level.
795 *
796 * Logged from:
797 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
798 */
799message ScreenBrightnessChanged {
800 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
801 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700802}
803
804/**
805 * Logs battery level (percent full, from 0 to 100).
806 *
807 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700808 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700809 */
810message BatteryLevelChanged {
811 // Battery level. Should be in [0, 100].
812 optional int32 battery_level = 1;
813}
814
815/**
816 * Logs change in charging status of the device.
817 *
818 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700819 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700820 */
821message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800822 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
823 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700824}
825
826/**
827 * Logs whether the device is plugged in, and what power source it is using.
828 *
829 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700830 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700831 */
832message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800833 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
834 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700835}
836
Bookatz8c6571b2017-10-24 15:04:41 -0700837/**
838 * Logs when an app's wakeup alarm fires.
839 *
840 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700841 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700842 */
843message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800844 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800845
846 // Name of the wakeup alarm.
847 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700848
849 // Name of source package (for historical reasons, since BatteryStats tracked it).
850 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800851}
852
853/**
854 * Logs when an an app causes the mobile radio to change state.
855 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
856 *
857 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700858 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800859 */
860message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800861 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800862
Bookatz1a1b0462018-01-12 11:47:03 -0800863 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
864 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800865}
866
867/**
868 * Logs when an an app causes the wifi radio to change state.
869 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
870 *
871 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700872 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800873 */
874message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800875 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800876
Bookatz1a1b0462018-01-12 11:47:03 -0800877 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
878 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700879}
880
881/**
882 * Logs kernel wakeup reasons and aborts.
883 *
884 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700885 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700886 */
887message KernelWakeupReported {
888 // Name of the kernel wakeup reason (or abort).
889 optional string wakeup_reason_name = 1;
890
891 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800892 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700893}
894
895/**
Bookatzda1798c2018-12-13 14:16:00 -0800896 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800897 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800898 *
899 * Logged from:
900 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
901 */
902message WifiEnabledStateChanged {
903 enum State {
904 OFF = 0;
905 ON = 1;
906 }
907 optional State state = 1;
908}
909
910/**
911 * Logs when an app causes Wifi to run. In this context, 'to run' means to use Wifi Client Mode.
Bookatza0a1f8a2018-12-17 12:28:32 -0800912 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
913 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800914 *
915 * Logged from:
916 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
917 */
918message WifiRunningStateChanged {
919 repeated AttributionNode attribution_node = 1;
920
921 enum State {
922 OFF = 0;
923 ON = 1;
924 }
925 optional State state = 2;
926}
927
928/**
Bookatze5885242017-10-24 20:10:31 -0700929 * Logs wifi locks held by an app.
930 *
931 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700932 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700933 */
934message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800935 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700936
937 enum State {
938 OFF = 0;
939 ON = 1;
940 }
941 optional State state = 2;
942}
943
944/**
945 * Logs wifi signal strength changes.
946 *
947 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800948 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -0700949 */
950message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800951 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
952 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -0700953}
954
955/**
956 * Logs wifi scans performed by an app.
957 *
958 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800959 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -0700960 */
961message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800962 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700963
964 enum State {
965 OFF = 0;
966 ON = 1;
967 }
968 optional State state = 2;
969}
970
971/**
Tej Singh4503e102018-01-04 14:35:01 -0800972 * Logs wifi multicast locks held by an app
973 *
974 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -0800975 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -0800976 */
977message WifiMulticastLockStateChanged {
978 repeated AttributionNode attribution_node = 1;
979
980 enum State {
981 OFF = 0;
982 ON = 1;
983 }
984 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -0800985
986 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -0800987}
988
989/**
Tej Singh1ea42892018-01-19 09:27:00 -0800990 * Logs shutdown reason and duration on next boot.
991 *
992 * Logged from:
993 * frameworks/base/core/java/com/android/server/BootReceiver.java
994 */
995message ShutdownSequenceReported {
996 // True if shutdown is for a reboot. Default: false if we do not know.
997 optional bool reboot = 1;
998
999 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1000 optional string reason = 2;
1001
1002 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1003 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001004 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001005
1006 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001007 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001008}
1009
Tej Singh6483ea42018-01-25 17:45:49 -08001010
1011/**
1012 * Logs boot reason and duration.
1013 *
1014 * Logged from:
1015 * system/core/bootstat/bootstat.cpp
1016 */
1017message BootSequenceReported {
1018 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1019 // Default: "<EMPTY>" if not available.
1020 optional string bootloader_reason = 1;
1021
1022 // Reason for system boot. Eg. bootloader, reboot,userrequested
1023 // Default: "<EMPTY>" if not available.
1024 optional string system_reason = 2;
1025
1026 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001027 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001028
1029 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001030 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001031
1032 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001033 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001034
1035 // Time since last boot in ms. Default: 0 if not available.
1036 optional int64 time_since_last_boot = 6;
1037}
1038
Tej Singhc477d9c2018-02-05 18:31:39 -08001039
1040/**
1041 * Logs call state and disconnect cause (if applicable).
1042 *
1043 * Logged from:
1044 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1045 */
1046message CallStateChanged {
1047 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1048 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1049 optional android.telecom.CallStateEnum call_state = 1;
1050
1051 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1052 // This value is only applicable when the call_state is DISCONNECTED, and
1053 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1054 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1055 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1056
1057 // True if the call is self-managed, which are apps that use the
1058 // telecom infrastructure to make their own calls.
1059 optional bool self_managed = 3;
1060
1061 // True if call is external. External calls are calls on connected Wear
1062 // devices but show up in Telecom so the user can pull them onto the device.
1063 optional bool external_call = 4;
1064}
1065
Tej Singh1ea42892018-01-19 09:27:00 -08001066/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001067 * Logs keyguard state. The keyguard is the lock screen.
1068 *
1069 * Logged from:
1070 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1071 */
1072message KeyguardStateChanged {
1073 enum State {
1074 UNKNOWN = 0;
1075 // The keyguard is hidden when the phone is unlocked.
1076 HIDDEN = 1;
1077 // The keyguard is shown when the phone is locked (screen turns off).
1078 SHOWN= 2;
1079 // The keyguard is occluded when something is overlaying the keyguard.
1080 // Eg. Opening the camera while on the lock screen.
1081 OCCLUDED = 3;
1082 }
1083 optional State state = 1;
1084}
1085
1086/**
1087 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1088 * prompts the user to enter a password (pattern, pin, etc).
1089 *
1090 * Logged from:
1091 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1092 */
1093
1094message KeyguardBouncerStateChanged {
1095 enum State {
1096 UNKNOWN = 0;
1097 // Bouncer is hidden, either as a result of successfully entering the
1098 // password, screen timing out, or user going back to lock screen.
1099 HIDDEN = 1;
1100 // This is when the user is being prompted to enter the password.
1101 SHOWN = 2;
1102 }
1103 optional State state = 1;
1104}
1105
1106/**
1107 * Logs the result of entering a password into the keyguard bouncer.
1108 *
1109 * Logged from:
1110 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1111 */
1112message KeyguardBouncerPasswordEntered {
1113 enum BouncerResult {
1114 UNKNOWN = 0;
1115 // The password entered was incorrect.
1116 FAILURE = 1;
1117 // The password entered was correct.
1118 SUCCESS = 2;
1119 }
1120 optional BouncerResult result = 1;
1121}
1122
Tej Singha883b372018-02-15 11:30:01 -08001123/*
1124 * Logs changes to the configuration of the device. The configuration is defined
1125 * in frameworks/base/core/java/android/content/res/Configuration.java
1126 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1127 * Please go there to interpret the possible values each field can be.
1128 *
1129 * Logged from:
1130 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1131 */
1132message ResourceConfigurationChanged {
1133 // Bit mask of color capabilities of the screen.
1134 // Contains information about the color gamut and hdr mode of the screen.
1135 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001136 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001137
1138 // The target screen density being rendered to.
1139 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001140 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001141
1142 // Current user preference for the scaling factor for fonts,
1143 // relative to the base density scaling.
1144 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001145 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001146
1147 // Flag indicating whether the hard keyboard is hidden.
1148 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001149 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001150
1151 // The type of keyboard attached to the device.
1152 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1153 optional int32 keyboard = 5;
1154
1155 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1156 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001157 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001158
1159 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1160 // 0 if undefined.
1161 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1162 optional int32 mcc = 7;
1163
1164 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1165 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1166 // MNC_ZERO symbol defined in Configuration.java.
1167 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1168 optional int32 mnc = 8;
1169
1170 // The kind of navigation available on the device.
1171 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1172 optional int32 navigation = 9;
1173
1174 // Flag indicating whether the navigation is available.
1175 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001176 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001177
1178 // Overall orientation of the screen.
1179 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1180 optional int32 orientation = 11;
1181
1182 // The current height of the available screen space, in dp units.
1183 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001184 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001185
1186 // Bit mask of overall layout of the screen.
1187 // Contains information about screen size, whether the screen is wider/taller
1188 // than normal, whether the screen layout is right-tl-left or left-to-right,
1189 // and whether the screen has a rounded shape.
1190 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001191 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001192
1193 // Current width of the available screen space, in dp units.
1194 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001195 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001196
1197 // The smallest screen size an application will see in normal operation.
1198 // This is the smallest value of both screenWidthDp and screenHeightDp
1199 // in portrait and landscape.
1200 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001201 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001202
1203 // The type of touch screen attached to the device.
1204 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1205 optional int32 touchscreen = 16;
1206
1207 // Bit mask of the ui mode.
1208 // Contains information about the overall ui mode of the device.
1209 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1210 // Also contains information about whether the device is in night mode.
1211 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001212 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001213}
1214
Tej Singheee317b2018-03-07 19:28:05 -08001215
1216/**
1217 * Logs changes in the connection state of the mobile radio.
1218 *
1219 * Logged from:
1220 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1221 */
1222message MobileConnectionStateChanged {
1223 // States are from the state machine DataConnection.java.
1224 enum State {
1225 UNKNOWN = 0;
1226 // The connection is inactive, or disconnected.
1227 INACTIVE = 1;
1228 // The connection is being activated, or connecting.
1229 ACTIVATING = 2;
1230 // The connection is active, or connected.
1231 ACTIVE = 3;
1232 // The connection is disconnecting.
1233 DISCONNECTING = 4;
1234 // The connection is disconnecting after creating a connection.
1235 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1236 }
1237 optional State state = 1;
1238 // For multi-sim phones, this distinguishes between the sim cards.
1239 optional int32 sim_slot_index = 2;
1240 // Used to identify the connection. Starts at 0 and increments by 1 for
1241 // every new network created. Resets whenever the device reboots.
1242 optional int32 data_connection_id = 3;
1243 // A bitmask for the capabilities of this connection.
1244 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1245 // Default value (if we have no information): 0
1246 optional int64 capabilities = 4;
1247 // If this connection has internet.
1248 // This just checks if the DEFAULT bit of capabilities is set.
1249 optional bool has_internet = 5;
1250}
1251
1252/**
1253 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1254 *
1255 * Logged from:
1256 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1257 */
1258message MobileRadioTechnologyChanged {
1259 optional android.telephony.NetworkTypeEnum state = 1;
1260 // For multi-sim phones, this distinguishes between the sim cards.
1261 optional int32 sim_slot_index = 2;
1262}
1263
Andrew Chantb56388b2018-03-22 21:07:33 -07001264/**
1265 * Logs the VID and PID of any connected USB devices.
1266 *
1267 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1268 *
1269 * Logged by Vendor.
1270 */
1271message UsbDeviceAttached {
1272 optional int32 vid = 1;
1273 optional int32 pid = 2;
1274 optional bool has_audio = 3;
1275 optional bool has_hid = 4;
1276 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001277 enum State {
1278 STATE_DISCONNECTED = 0;
1279 STATE_CONNECTED = 1;
1280 }
1281 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001282 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001283}
1284
Tej Singheee317b2018-03-07 19:28:05 -08001285
Tej Singhdd7bd352018-02-09 19:33:15 -08001286/**
Tej Singh5d991e12018-03-09 19:48:11 -08001287 * Logs when Bluetooth is enabled and disabled.
1288 *
1289 * Logged from:
1290 * services/core/java/com/android/server/BluetoothManagerService.java
1291 */
1292message BluetoothEnabledStateChanged {
1293 repeated AttributionNode attribution_node = 1;
1294 // Whether or not bluetooth is enabled on the device.
1295 enum State {
1296 UNKNOWN = 0;
1297 ENABLED = 1;
1298 DISABLED = 2;
1299 }
1300 optional State state = 2;
1301 // The reason for being enabled/disabled.
1302 // Eg. Airplane mode, crash, application request.
1303 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1304 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001305 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001306}
1307
1308/**
Jack Hed9837c82019-01-09 01:19:13 -08001309 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001310 *
1311 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001312 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1313 *
1314 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001315 */
1316message BluetoothConnectionStateChanged {
1317 // The state of the connection.
1318 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1319 optional android.bluetooth.ConnectionStateEnum state = 1;
1320 // An identifier that can be used to match connect and disconnect events.
1321 // Currently is last two bytes of a hash of a device level ID and
1322 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001323 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1324 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001325 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1326 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001327 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001328 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001329 // An identifier that can be used to match events for this device.
1330 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1331 // Salt: Randomly generated 256 bit value
1332 // Hash algorithm: HMAC-SHA256
1333 // Size: 32 byte
1334 // Default: null or empty if the device identifier is not known
1335 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1336}
1337
1338/**
1339 * Logs when a Bluetooth device connects and disconnects over ACL
1340 *
1341 * Logged from:
1342 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1343 *
1344 * Next Tag: 3
1345 */
1346message BluetoothAclConnectionStateChanged {
1347 // An identifier that can be used to match events for this device.
1348 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1349 // Salt: Randomly generated 256 bit value
1350 // Hash algorithm: HMAC-SHA256
1351 // Size: 32 byte
1352 // Default: null or empty if the device identifier is not known
1353 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1354 // The state of the connection.
1355 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1356 optional android.bluetooth.ConnectionStateEnum state = 2;
1357}
1358
1359/**
1360 * Logs when a Bluetooth device connects and disconnects over SCO
1361 *
1362 * Logged from:
1363 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1364 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1365 *
1366 * Next Tag: 4
1367 */
1368message BluetoothScoConnectionStateChanged {
1369 // An identifier that can be used to match events for this device.
1370 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1371 // Salt: Randomly generated 256 bit value
1372 // Hash algorithm: HMAC-SHA256
1373 // Size: 32 byte
1374 // Default: null or empty if the device identifier is not known
1375 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1376 // The state of the connection.
1377 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1378 optional android.bluetooth.ConnectionStateEnum state = 2;
1379 // Codec used for this SCO connection
1380 // Default: UNKNOWN
1381 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001382}
1383
Jack Heab86dbd22018-12-18 15:43:27 -08001384// Logs when there is an event affecting Bluetooth device's link layer connection.
1385// - This event is triggered when there is a related HCI command or event
1386// - Users of this metrics can deduce Bluetooth device's connection state from these events
1387// - HCI commands are logged before the command is sent, after receiving command status, and after
1388// receiving command complete
1389// - HCI events are logged when they arrive
1390//
1391// Low level log from system/bt
1392//
1393// Bluetooth classic commands:
1394// - CMD_CREATE_CONNECTION
1395// - CMD_DISCONNECT
1396// - CMD_CREATE_CONNECTION_CANCEL
1397// - CMD_ACCEPT_CONNECTION_REQUEST
1398// - CMD_REJECT_CONNECTION_REQUEST
1399// - CMD_SETUP_ESCO_CONNECTION
1400// - CMD_ACCEPT_ESCO_CONNECTION
1401// - CMD_REJECT_ESCO_CONNECTION
1402// - CMD_ENH_SETUP_ESCO_CONNECTION
1403// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1404//
1405// Bluetooth low energy commands:
1406// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1407// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1408// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1409// - CMD_BLE_CLEAR_WHITE_LIST
1410// - CMD_BLE_ADD_WHITE_LIST
1411// - CMD_BLE_REMOVE_WHITE_LIST
1412//
1413// Bluetooth classic events:
1414// - EVT_CONNECTION_COMP
1415// - EVT_CONNECTION_REQUEST
1416// - EVT_DISCONNECTION_COMP
1417// - EVT_ESCO_CONNECTION_COMP
1418// - EVT_ESCO_CONNECTION_CHANGED
1419//
1420// Bluetooth low energy meta events:
1421// - BLE_EVT_CONN_COMPLETE_EVT
1422// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1423//
1424// Next tag: 10
1425message BluetoothLinkLayerConnectionEvent {
1426 // An identifier that can be used to match events for this device.
1427 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1428 // Salt: Randomly generated 256 bit value
1429 // Hash algorithm: HMAC-SHA256
1430 // Size: 32 byte
1431 // Default: null or empty if the device identifier is not known
1432 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1433 // Connection handle of this connection if available
1434 // Range: 0x0000 - 0x0EFF (12 bits)
1435 // Default: 0xFFFF if the handle is unknown
1436 optional int32 connection_handle = 2;
1437 // Direction of the link
1438 // Default: DIRECTION_UNKNOWN
1439 optional android.bluetooth.DirectionEnum direction = 3;
1440 // Type of this link
1441 // Default: LINK_TYPE_UNKNOWN
1442 optional android.bluetooth.LinkTypeEnum type = 4;
1443
1444 // Reason metadata for this link layer connection event, rules for interpretation:
1445 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1446 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1447 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1448 // set and valid, ignore hci_ble_event
1449
1450 // HCI command associated with this event
1451 // Default: CMD_UNKNOWN
1452 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1453 // HCI event associated with this event
1454 // Default: EVT_UNKNOWN
1455 optional android.bluetooth.hci.EventEnum hci_event = 6;
1456 // HCI BLE meta event associated with this event
1457 // Default: BLE_EVT_UNKNOWN
1458 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1459 // HCI command status code if this is triggerred by hci_cmd
1460 // Default: STATUS_UNKNOWN
1461 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1462 // HCI reason code associated with this event
1463 // Default: STATUS_UNKNOWN
1464 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1465}
1466
1467
Tej Singh5d991e12018-03-09 19:48:11 -08001468/**
Andrew Chant28d627e2018-02-22 15:17:05 -08001469 * Logs when something is plugged into or removed from the USB-C connector.
1470 *
1471 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001472 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08001473 */
1474message UsbConnectorStateChanged {
1475 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001476 STATE_DISCONNECTED = 0;
1477 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08001478 }
1479 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08001480 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08001481 // Last active session in ms.
1482 // 0 when the port is in connected state.
1483 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001484}
1485
1486/**
1487 * Logs the reported speaker impedance.
1488 *
1489 * Logged from:
1490 * Vendor audio implementation.
1491 */
1492message SpeakerImpedanceReported {
1493 optional int32 speaker_location = 1;
1494 optional int32 impedance = 2;
1495}
1496
1497/**
1498 * Logs the report of a failed hardware.
1499 *
1500 * Logged from:
1501 * Vendor HALs.
1502 *
1503 */
1504message HardwareFailed {
1505 enum HardwareType {
1506 HARDWARE_FAILED_UNKNOWN = 0;
1507 HARDWARE_FAILED_MICROPHONE = 1;
1508 HARDWARE_FAILED_CODEC = 2;
1509 HARDWARE_FAILED_SPEAKER = 3;
1510 HARDWARE_FAILED_FINGERPRINT = 4;
1511 }
1512 optional HardwareType hardware_type = 1;
1513
1514 /* hardware_location allows vendors to differentiate between multiple instances of
1515 * the same hardware_type. The specific locations are vendor defined integers,
1516 * referring to board-specific numbering schemes.
1517 */
1518 optional int32 hardware_location = 2;
1519
1520 /* failure_code is specific to the HardwareType of the failed hardware.
1521 * It should use the enum values defined below.
1522 */
1523 enum MicrophoneFailureCode {
1524 MICROPHONE_FAILURE_COMPLETE = 0;
1525 }
1526 enum CodecFailureCode {
1527 CODEC_FAILURE_COMPLETE = 0;
1528 }
1529 enum SpeakerFailureCode {
1530 SPEAKER_FAILURE_COMPLETE = 0;
1531 SPEAKER_FAILURE_HIGH_Z = 1;
1532 SPEAKER_FAILURE_SHORT = 2;
1533 }
1534 enum FingerprintFailureCode {
1535 FINGERPRINT_FAILURE_COMPLETE = 0;
1536 FINGERPRINT_SENSOR_BROKEN = 1;
1537 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 2;
1538 }
1539 optional int32 failure_code = 3;
1540}
1541
1542/**
1543 * Log an event when the device has been physically dropped.
1544 * Reported from the /vendor partition.
1545 */
1546message PhysicalDropDetected {
1547 // Confidence that the event was actually a drop, 0 -> 100
1548 optional int32 confidence_pctg = 1;
1549 // Peak acceleration of the drop, in 1/1000s of a g.
1550 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07001551 // Duration of freefall in ms
1552 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08001553}
1554
1555/**
1556 * Log bucketed battery charge cycles.
1557 *
1558 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08001559 * a given charge point. For example, if 10 cycle buckets are
1560 * initialized, bucket 1 is the lowest 1/10th of the battery,
1561 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08001562 *
1563 * Logged from:
1564 * /sys/class/power_supply/bms/cycle_count, via Vendor.
1565 */
1566message ChargeCyclesReported {
1567 optional int32 cycle_bucket_1 = 1;
1568 optional int32 cycle_bucket_2 = 2;
1569 optional int32 cycle_bucket_3 = 3;
1570 optional int32 cycle_bucket_4 = 4;
1571 optional int32 cycle_bucket_5 = 5;
1572 optional int32 cycle_bucket_6 = 6;
1573 optional int32 cycle_bucket_7 = 7;
1574 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08001575 optional int32 cycle_bucket_9 = 9;
1576 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08001577}
1578
1579/**
Howard Roa46b6582018-09-18 16:45:02 -07001580 * Log battery health snapshot.
1581 *
1582 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
1583 * are snapshotted periodically over 24hrs.
1584 */
1585message BatteryHealthSnapshot {
1586 enum BatterySnapshotType {
1587 UNKNOWN = 0;
1588 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
1589 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
1590 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
1591 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
1592 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
1593 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
1594 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
1595 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
1596 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
1597 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
1598 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
1599 }
1600 optional BatterySnapshotType type = 1;
1601 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07001602 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07001603 // Voltage Battery Voltage, in microVolts.
1604 optional int32 voltage_micro_volt = 3;
1605 // Current Battery current, in microAmps.
1606 optional int32 current_micro_amps = 4;
1607 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
1608 optional int32 open_circuit_micro_volt = 5;
1609 // Resistance Battery Resistance, in microOhms.
1610 optional int32 resistance_micro_ohm = 6;
1611 // Level Battery Level, as % of full.
1612 optional int32 level_percent = 7;
1613}
1614
1615/**
1616 * Log slow I/O operations on the primary storage.
1617 */
1618message SlowIo {
1619 // Classifications of IO Operations.
1620 enum IoOperation {
1621 UNKNOWN = 0;
1622 READ = 1;
1623 WRITE = 2;
1624 UNMAP = 3;
1625 SYNC = 4;
1626 }
1627 optional IoOperation operation = 1;
1628
1629 // The number of slow IO operations of this type over 24 hours.
1630 optional int32 count = 2;
1631}
1632
1633/**
1634 * Log battery caused shutdown with the last recorded voltage.
1635 */
1636message BatteryCausedShutdown {
1637 // The last recorded battery voltage prior to shutdown.
1638 optional int32 last_recorded_micro_volt = 1;
1639}
1640
1641/**
Tej Singhbb8554a2018-01-26 11:59:14 -08001642 * Logs the duration of a davey (jank of >=700ms) when it occurs
1643 *
1644 * Logged from:
1645 * frameworks/base/libs/hwui/JankTracker.cpp
1646 */
1647message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08001648 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001649 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08001650
Tej Singhbb8554a2018-01-26 11:59:14 -08001651 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08001652 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08001653}
1654
1655/**
Bookatze5885242017-10-24 20:10:31 -07001656 * Logs phone signal strength changes.
1657 *
1658 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001659 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001660 */
1661message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001662 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1663 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07001664}
1665
Yangster4ccebea2018-10-09 17:09:02 -07001666
1667/**
1668 * Logs when the phone state, sim state or signal strength changes
1669 *
1670 * Logged from:
1671 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1672 */
1673message PhoneServiceStateChanged {
1674 optional android.telephony.ServiceStateEnum state = 1;
1675 optional android.telephony.SimStateEnum sim_state = 2;
1676 optional android.telephony.SignalStrengthEnum signal_strength = 3;
1677}
1678
1679/**
1680 * Logs when the phone becomes on or off.
1681 *
1682 * Logged from:
1683 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
1684 */
1685message PhoneStateChanged {
1686 enum State {
1687 OFF = 0;
1688 ON = 1;
1689 }
1690 optional State state = 1;
1691}
1692
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001693message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07001694 optional android.stats.launcher.LauncherAction action = 1;
1695 optional android.stats.launcher.LauncherState src_state = 2;
1696 optional android.stats.launcher.LauncherState dst_state = 3;
1697 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07001698 optional bool is_swipe_up_enabled = 5;
1699}
1700
David Chenc28b2bb2017-10-24 12:52:52 -07001701/**
Fan Zhang916c13b2018-10-16 22:49:45 -07001702 * Logs when Settings UI has changed.
1703 *
1704 * Logged from:
1705 * packages/apps/Settings
1706 */
1707message SettingsUIChanged {
1708 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07001709 * Where this SettingsUIChange event comes from. For example, if
1710 * it's a PAGE_VISIBLE event, where the page is opened from.
1711 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001712 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07001713
1714 /**
1715 * What the UI action is.
1716 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07001717 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07001718
1719 /**
1720 * Where the action is happening
1721 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001722 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07001723
1724 /**
1725 * What preference changed in this event.
1726 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001727 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07001728
1729 /**
1730 * The new value of the changed preference.
1731 */
Fan Zhangff2332b2018-12-06 15:16:41 -08001732 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07001733}
1734
1735/**
David Chenc28b2bb2017-10-24 12:52:52 -07001736 * Logs that a setting was updated.
1737 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07001738 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07001739 * The tag and is_default allow resetting of settings to default values based on the specified
1740 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
1741 */
1742message SettingChanged {
1743 // The name of the setting.
1744 optional string setting = 1;
1745
1746 // The change being imposed on this setting. May represent a number, eg "3".
1747 optional string value = 2;
1748
1749 // The new value of this setting. For most settings, this is same as value. For some settings,
1750 // value is +X or -X where X represents an element in a set. For example, if the previous value
1751 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
1752 // The +/- feature is currently only used for location_providers_allowed.
1753 optional string new_value = 3;
1754
1755 // The previous value of this setting.
1756 optional string prev_value = 4;
1757
1758 // The tag used with the is_default for resetting sets of settings. This is generally null.
1759 optional string tag = 5;
1760
Bookatz90867622018-01-31 15:05:57 -08001761 // True if this setting with tag should be resettable.
1762 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07001763
David Chenbd789912018-03-16 17:19:55 -07001764 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07001765 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07001766
1767 enum ChangeReason {
1768 UPDATED = 1; // Updated can be an insertion or an update.
1769 DELETED = 2;
1770 }
1771 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07001772}
Chenjie Yub3dda412017-10-24 13:41:59 -07001773
Chenjie Yu05013b32017-11-21 10:21:41 -08001774/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001775 * Logs activity going to foreground or background
1776 *
1777 * Logged from:
1778 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
1779 */
1780message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07001781 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08001782 optional string pkg_name = 2;
1783 optional string class_name = 3;
1784
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001785 enum State {
1786 BACKGROUND = 0;
1787 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001788 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001789 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07001790}
David Chenc8a43242017-10-17 16:23:28 -07001791
1792/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00001793 * Logs when a volume entered low Storage state.
1794 * Logged from:
1795 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
1796 */
1797message LowStorageStateChanged {
1798 // Volume that ran out of storage.
1799 optional string volume_description = 1;
1800
1801 enum State {
1802 UNKNOWN = 0;
1803 OFF = 1;
1804 ON = 2;
1805 }
1806 optional State state = 2;
1807}
1808
1809/**
1810 * Logs when an app is downgraded.
1811 * Logged from:
1812 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
1813 */
1814message AppDowngraded {
1815 optional string package_name = 1;
1816 // Size of the package (all data) before being downgraded.
1817 optional int64 size_in_bytes_before = 2;
1818 // Size of the package (all data) after being downgraded.
1819 optional int64 size_in_bytes_after = 3;
1820
1821 optional bool aggressive = 4;
1822}
1823
1824/**
1825 * Logs when an app is optimized after being downgraded.
1826 * Logged from:
1827 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
1828 */
1829message AppOptimizedAfterDowngraded {
1830 optional string package_name = 1;
1831}
1832
1833/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001834 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08001835 * Logged from:
1836 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1837 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001838message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07001839 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001840
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001841 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001842
1843 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001844 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08001845 optional string process_name = 3;
1846
1847 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08001848 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001849
1850 optional string package_name = 5;
1851
1852 enum InstantApp {
1853 UNAVAILABLE = 0;
1854 FALSE = 1;
1855 TRUE = 2;
1856 }
1857 optional InstantApp is_instant_app = 6;
1858
1859 enum ForegroundState {
1860 UNKNOWN = 0;
1861 BACKGROUND = 1;
1862 FOREGROUND = 2;
1863 }
1864 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08001865
1866 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001867}
David Chen9e3808c2017-11-20 17:25:34 -08001868
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001869/**
1870 * Logs when a WTF (What a Terrible Failure) happened.
1871 * Logged from:
1872 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1873 */
1874message WTFOccurred {
1875 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08001876
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001877 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08001878
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001879 // The name of the process.
1880 // system_server if it is not by an app
1881 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08001882
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001883 // The pid if available. -1 means not available.
1884 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08001885
1886 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001887}
1888
1889/**
1890 * Logs when system server reports low memory.
1891 * Logged from:
1892 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1893 */
1894message LowMemReported {
1895}
1896
1897/**
1898 * Logs when an app ANR (App Not Responding) occurs.
1899 * Logged from:
1900 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
1901 */
1902message ANROccurred {
1903 optional int32 uid = 1 [(is_uid) = true];
1904
1905 optional string process_name = 2;
1906
1907 optional string short_component_name = 3;
1908
1909 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07001910
1911 enum InstantApp {
1912 UNAVAILABLE = 0;
1913 FALSE = 1;
1914 TRUE = 2;
1915 }
1916 optional InstantApp is_instant_app = 5;
1917
1918 enum ForegroundState {
1919 UNKNOWN = 0;
1920 BACKGROUND = 1;
1921 FOREGROUND = 2;
1922 }
1923 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08001924
1925 optional android.server.ErrorSource error_source = 7;
1926
1927 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08001928}
1929
Bookatza7020bd2018-08-28 16:29:35 -07001930/**
1931 * Logs when the vibrator state changes.
1932 * Logged from:
1933 * frameworks/base/services/core/java/com/android/server/VibratorService.java
1934 */
1935message VibratorStateChanged {
1936 repeated AttributionNode attribution_node = 1;
1937
1938 enum State {
1939 OFF = 0;
1940 ON = 1;
1941 }
1942 optional State state = 2;
1943
1944 // Duration (in milliseconds) requested to keep the vibrator on.
1945 // Only applicable for State == ON.
1946 optional int64 duration_millis = 3;
1947}
1948
David Chen0a368b22017-12-06 16:28:16 -08001949/*
1950 * Allows other apps to push events into statsd.
1951 * Logged from:
1952 * frameworks/base/core/java/android/util/StatsLog.java
1953 */
David Chen0b5c90c2018-01-25 16:51:49 -08001954message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08001955 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07001956 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08001957
1958 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
1959 optional int32 label = 2;
1960
1961 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
1962 // predicates for the metrics).
1963 enum State {
1964 UNKNOWN = 0;
1965 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
1966 STOP = 2;
1967 START = 3;
1968 }
1969 optional State state = 3;
1970}
1971
David Chen9e3808c2017-11-20 17:25:34 -08001972/**
Bookatz7948c872018-09-04 12:58:33 -07001973 * Logs the wall-clock time when a significant wall-clock time shift occurs.
1974 * For example, this could be due to the user manually changing the time.
1975 *
1976 * Logged from:
1977 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
1978 */
1979message WallClockTimeShifted {
1980 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
1981 optional int64 wall_clock_timestamp_millis = 1;
1982}
1983
1984/**
Bookatz8fcd09a2017-12-18 13:01:10 -08001985 * Logs when statsd detects an anomaly.
1986 *
1987 * Logged from:
1988 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
1989 */
1990message AnomalyDetected {
1991 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07001992 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08001993
Yangster-mac94e197c2018-01-02 16:03:03 -08001994 // Id of the config whose anomaly detection alert fired.
1995 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08001996
Yangster-mac94e197c2018-01-02 16:03:03 -08001997 // Id of the alert (i.e. name of the anomaly that was detected).
1998 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08001999}
2000
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002001message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002002 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002003 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002004
2005 // The app package name.
2006 optional string pkg_name = 2;
2007
2008 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002009 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002010 WARM = 1;
2011 HOT = 2;
2012 COLD = 3;
2013 }
2014 // The transition type.
2015 optional TransitionType type = 3;
2016
2017 // The activity name.
2018 optional string activity_name = 4;
2019
2020 // The name of the calling app. Empty if not set.
2021 optional string calling_pkg_name = 5;
2022
2023 // Whether the app is an instant app.
2024 optional bool is_instant_app = 6;
2025
2026 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002027 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002028
Bookatz80d11a02018-01-16 10:46:35 -08002029 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002030
David Chen0b5c90c2018-01-25 16:51:49 -08002031 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002032 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002033 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002034 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002035 optional int32 bind_application_delay_millis = 11;
2036 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002037
2038 // Empty if not set.
2039 optional string launch_token = 13;
2040
Calin Juravle759fbda2018-02-20 19:52:30 +00002041 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002042 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002043
2044 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002045 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002046}
2047
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002048message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002049 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002050 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002051
2052 // The app package name.
2053 optional string pkg_name = 2;
2054
2055 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002056 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002057 WARM = 1;
2058 HOT = 2;
2059 COLD = 3;
2060 }
2061 // The transition type.
2062 optional TransitionType type = 3;
2063
2064 // The activity name.
2065 optional string activity_name = 4;
2066}
2067
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002068message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002069 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002070 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002071
2072 // The app package name.
2073 optional string pkg_name = 2;
2074
2075 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002076 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002077 WITH_BUNDLE = 1;
2078 WITHOUT_BUNDLE = 2;
2079 }
2080 // The transition type.
2081 optional TransitionType type = 3;
2082
2083 // The activity name.
2084 optional string activity_name = 4;
2085
2086 optional bool transition_process_running = 5;
2087
2088 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002089 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002090}
2091
Bookatz8fcd09a2017-12-18 13:01:10 -08002092/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002093 * Logs a picture-in-picture action
2094 * Logged from:
2095 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2096 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2097 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2098 */
2099message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002100 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002101 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002102
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002103 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002104
Chenjie Yu52cacc62017-12-08 18:11:45 -08002105 enum State {
2106 ENTERED = 1;
2107 EXPANDED_TO_FULL_SCREEN = 2;
2108 MINIMIZED = 3;
2109 DISMISSED = 4;
2110 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002111 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002112}
2113
2114/**
Chenjie Yue8904192017-12-08 19:12:57 -08002115 * Logs overlay action
2116 * Logged from:
2117 * services/core/java/com/android/server/wm/Session.java
2118 */
2119message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002120 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002121
2122 optional string package_name = 2;
2123
2124 optional bool using_alert_window = 3;
2125
2126 enum State {
2127 ENTERED = 1;
2128 EXITED = 2;
2129 }
2130 optional State state = 4;
2131}
2132
Chenjie Yuccfe6452018-01-30 11:33:21 -08002133/*
2134 * Logs foreground service starts and stops.
2135 * Note that this is not when a service starts or stops, but when it is
2136 * considered foreground.
2137 * Logged from
2138 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2139 */
2140message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002141 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002142 // package_name + "/" + class_name
2143 optional string short_name = 2;
2144
2145 enum State {
2146 ENTER = 1;
2147 EXIT = 2;
2148 }
2149 optional State state = 3;
2150}
2151
Chenjie Yue8904192017-12-08 19:12:57 -08002152/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002153 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2154 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2155 * attributed back to the parent (host) uid. One example is Chrome.
2156 *
2157 * Logged from:
2158 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2159 */
2160message IsolatedUidChanged {
2161 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002162 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002163 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002164 optional int32 parent_uid = 1;
2165
2166 optional int32 isolated_uid = 2;
2167
2168 // We expect an isolated uid to be removed before if it's used for another parent uid.
2169 enum Event {
2170 REMOVED = 0;
2171 CREATED = 1;
2172 }
2173 optional Event event = 3;
2174}
2175
2176/*
2177 * Logs the reception of an incoming network packet causing the main system to wake up for
2178 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2179 * and processed by WakeupController.cpp.
2180 */
2181message PacketWakeupOccurred {
2182 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2183 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002184 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002185 // The interface name on which the packet was received.
2186 optional string iface = 2;
2187 // The ethertype value of the packet.
2188 optional int32 ethertype = 3;
2189 // String representation of the destination MAC address of the packet.
2190 optional string destination_hardware_address = 4;
2191 // String representation of the source address of the packet if this was an IP packet.
2192 optional string source_ip = 5;
2193 // String representation of the destination address of the packet if this was an IP packet.
2194 optional string destination_ip = 6;
2195 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2196 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2197 // families.
2198 optional int32 ip_next_header = 7;
2199 // The source port if this was a TCP or UDP packet.
2200 optional int32 source_port = 8;
2201 // The destination port if this was a TCP or UDP packet.
2202 optional int32 destination_port = 9;
2203}
2204
2205/*
2206 * Logs the memory stats for an app on startup.
2207 * Logged from:
2208 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2209 */
2210message AppStartMemoryStateCaptured {
2211 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002212 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002213
2214 // The process name.
2215 optional string process_name = 2;
2216
2217 // The activity name.
2218 optional string activity_name = 3;
2219
2220 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002221 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002222
2223 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002224 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002225
2226 // RSS
2227 optional int64 rss_in_bytes = 6;
2228
2229 // CACHE
2230 optional int64 cache_in_bytes = 7;
2231
2232 // SWAP
2233 optional int64 swap_in_bytes = 8;
2234}
2235
2236/*
2237 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2238 * for LMK event.
2239 * Logged from:
2240 * system/core/lmkd/lmkd.c
2241 */
2242message LmkStateChanged {
2243 enum State {
2244 UNKNOWN = 0;
2245 START = 1;
2246 STOP = 2;
2247 }
2248 optional State state = 1;
2249}
2250
2251/*
2252 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2253 * Logged from:
2254 * system/core/lmkd/lmkd.c
2255 */
2256message LmkKillOccurred {
2257 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002258 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002259
2260 // The process name.
2261 optional string process_name = 2;
2262
2263 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002264 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002265
2266 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002267 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002268
2269 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002270 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002271
2272 // RSS
2273 optional int64 rss_in_bytes = 6;
2274
2275 // CACHE
2276 optional int64 cache_in_bytes = 7;
2277
2278 // SWAP
2279 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002280
2281 // The elapsed real time of start of the process.
2282 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002283}
2284
Rajeev Kumar51b54602018-03-01 12:18:26 -08002285/*
2286 * Logs when the ActivityManagerService detects that an app died.
2287 *
2288 * Logged from:
2289 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2290 */
2291message AppDied {
2292 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002293 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002294}
2295
Howard Ro21a039c2018-08-06 14:55:47 -07002296/**
2297 * An atom for generic metrics logging. Available from Android Q.
2298 */
2299message GenericAtom {
2300 // The uid of the application that sent this custom atom.
2301 optional int32 uid = 1 [(is_uid) = true];
2302
2303 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002304 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002305}
2306
Tej Singhd6d6d772018-09-05 17:41:25 -07002307/**
2308 * Logs when a fingerprint acquire event occurs.
2309 *
2310 * Logged from:
2311 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2312 */
2313message FingerprintAcquired {
2314 // The associated user. Eg: 0 for owners, 10+ for others.
2315 // Defined in android/os/UserHandle.java
2316 optional int32 user = 1;
2317 // If this acquire is for a crypto fingerprint.
2318 // e.g. Secure purchases, unlock password storage.
2319 optional bool is_crypto = 2;
2320}
2321
2322/**
2323 * Logs when a fingerprint authentication event occurs.
2324 *
2325 * Logged from:
2326 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2327 */
2328message FingerprintAuthenticated {
2329 // The associated user. Eg: 0 for owners, 10+ for others.
2330 // Defined in android/os/UserHandle.java
2331 optional int32 user = 1;
2332 // If this authentication is for a crypto fingerprint.
2333 // e.g. Secure purchases, unlock password storage.
2334 optional bool is_crypto = 2;
2335 // Whether or not this authentication was successful.
2336 optional bool is_authenticated = 3;
2337}
2338
2339/**
2340 * Logs when a fingerprint error occurs.
2341 *
2342 * Logged from:
2343 * frameworks/base/services/core/java/com/android/server/biometrics/fingerprint/FingerprintService.java
2344 */
2345message FingerprintErrorOccurred {
2346 // The associated user. Eg: 0 for owners, 10+ for others.
2347 // Defined in android/os/UserHandle.java
2348 optional int32 user = 1;
2349 // If this error is for a crypto fingerprint.
2350 // e.g. Secure purchases, unlock password storage.
2351 optional bool is_crypto = 2;
2352
2353 enum Error {
2354 UNKNOWN = 0;
2355 LOCKOUT = 1;
2356 PERMANENT_LOCKOUT = 2;
2357 }
2358 // The type of error.
2359 optional Error error = 3;
2360}
Howard Ro688ae182018-09-25 00:09:36 -07002361
2362message Notification {
2363
2364 // Type of notification event.
2365 enum Type {
2366 TYPE_UNKNOWN = 0;
2367 // Notification became visible to the user.
2368 TYPE_OPEN = 1;
2369 // Notification became hidden.
2370 TYPE_CLOSE = 2;
2371 // Notification switched to detail mode.
2372 TYPE_DETAIL = 3;
2373 // Notification was clicked.
2374 TYPE_ACTION = 4;
2375 // Notification was dismissed.
2376 TYPE_DISMISS = 5;
2377 // Notification switched to summary mode. The enum value of 14 is to
2378 // match that of metrics_constants.
2379 TYPE_COLLAPSE = 14;
2380 }
2381 optional Type type = 1;
2382
2383 // Package name associated with the notification.
2384 optional string package_name = 2;
2385
2386 // Tag associated with notification.
2387 optional string tag = 3;
2388
2389 // Application-supplied ID associated with the notification.
2390 optional int32 id = 4;
2391
2392 // Index of notification in the notification panel.
2393 optional int32 shade_index = 5;
2394
2395 // The number of notifications in the notification panel.
2396 optional int32 shade_count = 6;
2397
2398 // Importance for the notification.
2399 optional int32 importance = 7;
2400
2401 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07002402 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07002403
2404 // Importance for the notification channel.
2405 optional int32 channel_importance = 9;
2406
Howard Ro183c2bd2018-10-18 13:52:10 -07002407 // Application-supplied ID associated with the notifications group.
2408 optional string group_id = 10;
2409
Howard Ro688ae182018-09-25 00:09:36 -07002410 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07002411 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07002412
Howard Ro183c2bd2018-10-18 13:52:10 -07002413 // Reason for dismissal of a notification. This field is only meaningful for
2414 // TYPE_DISMISS events.
2415 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07002416
Howard Ro183c2bd2018-10-18 13:52:10 -07002417 // The first post time of notification, stable across updates.
2418 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07002419
Howard Ro183c2bd2018-10-18 13:52:10 -07002420 // The most recent interruption time, or the creation time if no updates.
2421 // Differs from update_millis because updates are filtered based on whether
2422 // they actually interrupted the user.
2423 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07002424
Howard Ro183c2bd2018-10-18 13:52:10 -07002425 // The most recent update time, or the creation time if no updates.
2426 optional int64 update_millis = 15;
2427
2428 // The most recent visibility event.
2429 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07002430}
2431
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002432/*
Yangster-macb89807e2018-11-15 21:10:57 -08002433 * Logs when a flag flip state changes.
2434 * Logged in P/h.
2435 */
2436message PhenotypeFlagStateChanged {
2437 // Mendel configuration name.
2438 optional string mendel_config_name = 1;
2439 // State
2440 enum State {
2441 STATE_UNKNOWN = 0;
2442 COMMITTED = 1;
2443 }
2444 optional State state = 2;
2445}
2446
2447/*
2448 * Logs when a binary push state changes.
2449 * Logged in Play store
2450 */
2451message BinaryPushStateChanged {
2452 // Binary package name.
2453 optional string binary_name = 1;
2454 // Version code.
2455 optional int64 version = 2;
2456 // State
2457 enum State {
2458 STATE_UNKNOWN = 0;
2459 DOWNLOAD_START = 1;
2460 DOWNLOAD_DONE = 2;
2461 INSTALL_START = 3;
2462 INSTALL_DONE = 4;
2463 REBOOT_START = 5;
2464 REBOOT_DONE = 6;
2465 }
2466 optional State state = 3;
2467}
2468
2469/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002470 * Logs when a connection becomes available and lost.
2471 * Logged in StatsCompanionService.java
2472 */
2473message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002474 // Id of the network.
2475 optional int32 net_id = 1;
2476
2477 enum State {
2478 UNKNOWN = 0;
2479 CONNECTED = 1;
2480 DISCONNECTED = 2;
2481 }
2482 // Connected state of a network.
2483 optional State state = 2;
2484}
2485
2486/**
2487 * Logs when a service starts and stops.
2488 * Logged from:
2489 * services/core/java/com/android/server/am/ActiveServices.java
2490 */
2491message ServiceStateChanged {
2492
2493 optional int32 uid = 1 [(is_uid) = true];
2494
2495 optional string package_name = 2;
2496
2497 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002498
2499 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07002500 START = 1;
2501 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002502 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07002503
2504 optional State state = 4;
2505}
2506
2507/**
2508 * Logs when a service is launched.
2509 * Logged from:
2510 * services/core/java/com/android/server/am/ActiveServices.java
2511 */
2512message ServiceLaunchReported {
2513
2514 optional int32 uid = 1 [(is_uid) = true];
2515
2516 optional string package_name = 2;
2517
2518 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07002519}
Howard Ro688ae182018-09-25 00:09:36 -07002520
Chenjie Yubbcbc602018-02-05 16:51:52 -08002521//////////////////////////////////////////////////////////////////////
2522// Pulled atoms below this line //
2523//////////////////////////////////////////////////////////////////////
2524
2525/**
David Chenc8a43242017-10-17 16:23:28 -07002526 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
2527 *
2528 * Pulled from:
2529 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2530 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002531message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002532 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002533
2534 optional int64 rx_bytes = 2;
2535
2536 optional int64 rx_packets = 3;
2537
2538 optional int64 tx_bytes = 4;
2539
2540 optional int64 tx_packets = 5;
2541}
2542
2543/**
2544 * Pulls bytes transferred via wifi (separated by foreground and background usage).
2545 *
2546 * Pulled from:
2547 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
2548 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002549message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002550 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002551
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002552 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
2553 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002554
2555 optional int64 rx_bytes = 3;
2556
2557 optional int64 rx_packets = 4;
2558
2559 optional int64 tx_bytes = 5;
2560
2561 optional int64 tx_packets = 6;
2562}
2563
2564/**
2565 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
2566 *
2567 * Pulled from:
2568 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2569 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002570message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002571 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002572
2573 optional int64 rx_bytes = 2;
2574
2575 optional int64 rx_packets = 3;
2576
2577 optional int64 tx_bytes = 4;
2578
2579 optional int64 tx_packets = 5;
2580}
2581
2582/**
2583 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
2584 *
2585 * Pulled from:
2586 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
2587 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002588message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07002589 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07002590
Yao Chenc40a19d2018-03-15 16:48:25 -07002591 // 1 denotes foreground and 0 denotes background. This is called Set in
2592 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002593 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07002594
2595 optional int64 rx_bytes = 3;
2596
2597 optional int64 rx_packets = 4;
2598
2599 optional int64 tx_bytes = 5;
2600
2601 optional int64 tx_packets = 6;
2602}
2603
2604/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002605 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
2606 *
2607 * Pulled from:
2608 * StatsCompanionService
2609 */
2610message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07002611 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002612
2613 optional int64 rx_bytes = 2;
2614
2615 optional int64 tx_bytes = 3;
2616}
2617
2618/**
David Chenc8a43242017-10-17 16:23:28 -07002619 * Pulls the kernel wakelock durations. This atom is adapted from
2620 * android/internal/os/KernelWakelockStats.java
2621 *
2622 * Pulled from:
2623 * StatsCompanionService using KernelWakelockReader.
2624 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002625message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07002626 optional string name = 1;
2627
2628 optional int32 count = 2;
2629
2630 optional int32 version = 3;
2631
Yangster-maca8a30442018-10-13 23:46:34 -07002632 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07002633}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002634
Chenjie Yu05013b32017-11-21 10:21:41 -08002635/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002636 * Pulls low power state information. If power.stats HAL is not available, this
2637 * includes platform and subsystem sleep state information,
2638 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
2639 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002640 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002641 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002642 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
2643 * as defined in:
2644 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07002645 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002646message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08002647 // Subsystem name
2648 optional string subsystem_name = 1;
2649 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
2650 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08002651 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
2652 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002653 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002654 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08002655 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08002656 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08002657 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07002658}
Chenjie Yu7f8def92017-11-03 09:33:15 -07002659
Chenjie Yu05013b32017-11-21 10:21:41 -08002660/**
Bookatz92da2832018-11-01 18:10:03 -07002661 * Pulls on-device power measurement information.
2662 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
2663 * Pulled from:
2664 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
2665 */
2666message OnDevicePowerMeasurement {
2667 // Name of the subsystem (to which the rail belongs).
2668 optional string subsystem_name = 1;
2669
2670 // Rail name. The rail lies within the subsystem.
2671 optional string rail_name = 2;
2672
2673 // Time (in ms since boot) at which the rail energy value was measured.
2674 // This may differ slightly from the time that statsd logs this information.
2675 optional uint64 measurement_timestamp_millis = 3;
2676
2677 // Accumulated energy used via the rail since device boot in uWs.
2678 optional uint64 energy_microwatt_secs = 4;
2679}
2680
2681/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07002682 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08002683 * Pulls the time the cpu spend on the frequency index. Frequency index
2684 * starts from highest to lowest. The value should be monotonically
2685 * increasing since boot. However, if there is a cpu
2686 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07002687 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002688message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07002689 optional uint32 cluster = 1;
2690 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002691 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07002692}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002693
Chenjie Yu05013b32017-11-21 10:21:41 -08002694/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002695 * Pulls Cpu Time Per Uid.
2696 * Note that isolated process uid time should be attributed to host uids.
2697 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002698message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07002699 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00002700 optional uint64 user_time_micros = 2;
2701 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002702}
2703
2704/**
2705 * Pulls Cpu Time Per Uid per frequency.
2706 * Note that isolated process uid time should be attributed to host uids.
2707 * For each uid, we order the time by descending frequencies.
2708 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002709message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07002710 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002711 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002712 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08002713}
Hugo Benichi884970e2017-11-14 22:42:46 +09002714
Chenjie Yu05013b32017-11-21 10:21:41 -08002715/**
2716 * Pulls Wifi Controller Activity Energy Info
2717 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002718message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002719 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002720 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08002721 // stack reported state
2722 // TODO: replace this with proto enum
2723 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002724 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002725 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002726 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002727 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002728 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002729 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002730 // product of current(mA), voltage(V) and time(ms)
2731 optional uint64 controller_energy_used = 6;
2732}
2733
2734/**
2735 * Pulls Modem Activity Energy Info
2736 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08002737message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08002738 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002739 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07002740 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08002741 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002742 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002743 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08002744 /**
2745 * Tx power index
2746 * index 0 = tx_power < 0dBm
2747 * index 1 = 0dBm < tx_power < 5dBm
2748 * index 2 = 5dBm < tx_power < 15dBm
2749 * index 3 = 15dBm < tx_power < 20dBm
2750 * index 4 = tx_power > 20dBm
2751 */
2752 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08002753 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08002754 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08002755 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08002756 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08002757 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08002758 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08002759 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08002760 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08002761 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08002762 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08002763 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08002764 // product of current(mA), voltage(V) and time(ms)
2765 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08002766}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002767
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002768/**
2769 * Pulls Bluetooth Activity Energy Info
2770 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
2771 */
2772message BluetoothActivityInfo {
2773 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08002774 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002775 // bluetooth stack state
2776 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07002777 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002778 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07002779 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002780 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07002781 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08002782 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002783 // product of current(mA), voltage(V) and time(ms)
2784 optional uint64 energy_used = 6;
2785}
2786
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08002787/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002788 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00002789 *
2790 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002791 */
2792message ProcessMemoryState {
2793 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002794 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002795
2796 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002797 // Usually package name, "system" for system server.
2798 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002799 optional string process_name = 2;
2800
Rafal Slawikda51b932018-12-13 16:31:33 +00002801 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07002802 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002803
2804 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002805 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002806
2807 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002808 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002809
Rajeev Kumar90235992018-01-29 11:06:48 -08002810 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00002811 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
2812 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08002813 optional int64 rss_in_bytes = 6;
2814
2815 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00002816 // Value is read from memory.stat, field total_cache if per-app memory
2817 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002818 optional int64 cache_in_bytes = 7;
2819
2820 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00002821 // Value is read from memory.stat, field total_swap if per-app memory
2822 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08002823 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01002824
Rafal Slawikd03ae422018-11-20 11:27:45 +00002825 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002826 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00002827
2828 // Elapsed real time when the process started.
2829 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
2830 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08002831}
2832
2833/*
Rafal Slawik08621582018-10-15 14:53:07 +01002834 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00002835 *
2836 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01002837 */
2838message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01002839 // The uid if available. -1 means not available.
2840 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01002841
Rafal Slawikbf67d072018-10-23 11:07:54 +01002842 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00002843 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01002844 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01002845
Rafal Slawikbf67d072018-10-23 11:07:54 +01002846 // # of page-faults
2847 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01002848
Rafal Slawikbf67d072018-10-23 11:07:54 +01002849 // # of major page-faults
2850 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01002851
Rafal Slawikbf67d072018-10-23 11:07:54 +01002852 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00002853 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01002854 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01002855
Rafal Slawikd03ae422018-11-20 11:27:45 +00002856 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002857 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01002858
2859 // Elapsed real time when the process started.
2860 // Value is read from /proc/PID/stat, field 22.
2861 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01002862}
2863
2864/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00002865 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00002866 *
2867 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
2868 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00002869 *
2870 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002871 */
2872message ProcessMemoryHighWaterMark {
2873 // The uid if available. -1 means not available.
2874 optional int32 uid = 1 [(is_uid) = true];
2875
Rafal Slawikda51b932018-12-13 16:31:33 +00002876 // The process name.
2877 // Usually package name or process cmdline.
2878 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00002879 optional string process_name = 2;
2880
2881 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
2882 // /proc/PID/status.
2883 optional int64 rss_high_water_mark_in_bytes = 3;
2884}
2885
2886/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002887 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002888 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002889message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08002890 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002891}
2892
2893/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002894 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08002895 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08002896message SystemUptime {
2897 // Milliseconds since the system was booted.
2898 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
2899 // for external input).
2900 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08002901 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002902}
2903
2904/*
2905 * Reads from /proc/uid_concurrent_active_time which has the format:
2906 * active: X (X is # cores)
2907 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
2908 * [uid1]: [time-0] [time-1] [time-2] ... ...
2909 * ...
2910 * Time-N means the CPU time a UID spent running concurrently with N other processes.
2911 * The file contains a monotonically increasing count of time for a single boot.
2912 */
2913message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002914 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002915 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08002916}
2917
2918/**
2919 * Reads from /proc/uid_concurrent_policy_time which has the format:
2920 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
2921 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2922 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
2923 * ...
2924 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
2925 * The file contains a monotonically increasing count of time for a single boot.
2926 */
2927message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07002928 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08002929 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08002930 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08002931}
2932
2933/*
2934 * Pulls free disk space, for data, system partition and temporary directory.
2935 */
2936message DiskSpace {
2937 // available bytes in data partition
2938 optional uint64 data_available_bytes = 1;
2939 // available bytes in system partition
2940 optional uint64 system_available_bytes = 2;
2941 // available bytes in download cache or temp directories
2942 optional uint64 temp_available_bytes = 3;
2943}
Tej Singhbf972d92018-01-10 20:51:13 -08002944
2945/**
2946 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002947 * Pulled from:
2948 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002949 */
2950message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07002951 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08002952}
2953
2954/**
2955 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08002956 * Pulled from:
2957 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08002958 */
2959message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07002960 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08002961}
2962
2963/**
Bookatz17f0d8a2018-09-13 12:56:32 -07002964 * Pulls battery voltage.
2965 * Pulled from:
2966 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2967 */
2968message BatteryVoltage {
2969 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07002970 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07002971}
2972
2973/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08002974 * Pulls battery level (percent full, from 0 to 100).
2975 *
2976 * Pulled from:
2977 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
2978 */
2979message BatteryLevel {
2980 // Battery level. Should be in [0, 100].
2981 optional int32 battery_level = 1;
2982}
2983
2984/**
Tej Singhd89137e2018-03-26 14:51:40 -07002985 * Pulls the temperature of various parts of the device.
2986 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08002987 *
2988 * Pulled from:
2989 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
2990 */
2991message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08002992 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08002993 optional android.os.TemperatureTypeEnum sensor_location = 1;
2994
2995 // The name of the temperature source. Eg. CPU0
2996 optional string sensor_name = 2;
2997
Tej Singhd89137e2018-03-26 14:51:40 -07002998 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08002999 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003000 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003001}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003002
3003/**
3004 * Pulls the statistics of calls to Binder.
3005 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003006 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3007 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003008 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003009 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003010 */
3011message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003012 // UID of the process responsible for the binder transaction. It will be set if the process
3013 // executing the binder transaction attribute the transaction to another uid using
3014 // Binder.setThreadWorkSource().
3015 //
3016 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003017 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003018 // UID of the process executing the binder transaction.
3019 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003020 // Fully qualified class name of the API call.
3021 //
3022 // This is a system server class name.
3023 //
3024 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3025 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3026 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3027 // commonly used APIs.
3028 optional string service_class_name = 2;
3029 // Method name of the API call. It can also be a transaction code if we cannot
3030 // resolve it to a name. See Binder#getTransactionName.
3031 //
3032 // This is a system server method name.
3033 optional string service_method_name = 3;
3034 // Total number of API calls.
3035 optional int64 call_count = 4;
3036 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3037 optional bool screen_interactive = 13;
3038 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3039 // call_count will be equal to recorded_call_count.
3040 //
3041 // If recorded_call_count is different than call_count, it means data collection has been
3042 // sampled. All the fields below will be sampled in this case.
3043 optional int64 recorded_call_count = 12;
3044 // Number of exceptions thrown by the API.
3045 optional int64 recorded_exception_count = 5;
3046 // Total latency of all API calls.
3047 // Average can be computed using total_latency_micros / recorded_call_count.
3048 optional int64 recorded_total_latency_micros = 6;
3049 // Maximum latency of one API call.
3050 optional int64 recorded_max_latency_micros = 7;
3051 // Total CPU usage of all API calls.
3052 // Average can be computed using total_cpu_micros / recorded_call_count.
3053 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3054 optional int64 recorded_total_cpu_micros = 8;
3055 // Maximum CPU usage of one API call.
3056 optional int64 recorded_max_cpu_micros = 9;
3057 // Maximum parcel reply size of one API call.
3058 optional int64 recorded_max_reply_size_bytes = 10;
3059 // Maximum parcel request size of one API call.
3060 optional int64 recorded_max_request_size_bytes = 11;
3061}
3062
3063/**
3064 * Pulls the statistics of exceptions during calls to Binder.
3065 *
3066 * Binder stats are cumulative from boot unless somebody reset the data using
3067 * > adb shell dumpsys binder_calls_stats --reset
3068 */
3069message BinderCallsExceptions {
3070 // Exception class name, e.g. java.lang.IllegalArgumentException.
3071 //
3072 // This is an exception class name thrown by the system server.
3073 optional string exception_class_name = 1;
3074 // Total number of exceptions.
3075 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003076}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003077
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003078/**
3079 * Pulls the statistics of message dispatching on HandlerThreads.
3080 *
3081 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
3082 * config on the device.
3083 *
3084 * Next tag: 11
3085 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003086message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01003087 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003088 optional int32 uid = 1 [(is_uid) = true];
3089
3090 // Fully qualified class name of the handler target class.
3091 //
3092 // This field does not contain PII. This is a system server class name.
3093 optional string handler_class_name = 2;
3094
3095 // The name of the thread that runs the Looper.
3096 //
3097 // This field does not contain PII. This is a system server thread name.
3098 optional string looper_thread_name = 3;
3099
3100 // The name of the dispatched message.
3101 //
3102 // This field does not contain PII. This is a system server constant or class
3103 // name.
3104 optional string message_name = 4;
3105
3106 // Total number of successfully dispatched messages.
3107 optional int64 message_count = 5;
3108
3109 // Total number of messages that failed dispatching.
3110 optional int64 exception_count = 6;
3111
3112 // Total number of processed messages we have data recorded for. If we
3113 // collected data for all the messages, message_count will be equal to
3114 // recorded_message_count.
3115 //
3116 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003117 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003118 optional int64 recorded_message_count = 7;
3119
3120 // Total latency of all processed messages.
3121 // Average can be computed using recorded_total_latency_micros /
3122 // recorded_message_count.
3123 optional int64 recorded_total_latency_micros = 8;
3124
3125 // Total CPU usage of all processed message.
3126 // Average can be computed using recorded_total_cpu_micros /
3127 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003128 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003129 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003130
3131 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3132 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003133
3134 // Max recorded CPU usage of all processed messages.
3135 optional int64 recorded_max_cpu_micros = 11;
3136
3137 // Max recorded latency of all processed messages.
3138 optional int64 recorded_max_latency_micros = 12;
3139
3140 // Total number of messages we tracked the dispatching delay for. If we
3141 // collected data for all the messages, message_count will be equal to
3142 // recorded_delay_message_count.
3143 //
3144 // If recorded_delay_message_count is different than message_count, it means data
3145 // collection has been sampled or/and not all messages specified the target dispatch time.
3146 // The fields below will be sampled in this case.
3147 optional int64 recorded_delay_message_count = 13;
3148
3149 // Total dispatching delay of all processed messages.
3150 // Calculated as a difference between the target dispatching time (Message.when)
3151 // and the actual dispatching time.
3152 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
3153 optional int64 recorded_total_delay_millis = 14;
3154
3155 // Max dispatching delay of all processed messages.
3156 // Calculated as a difference between the target dispatching time (Message.when)
3157 // and the actual dispatching time.
3158 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003159}
Tej Singh86dc9db2018-09-06 00:39:57 +00003160
3161/**
3162 * Pulls disk information, such as write speed and latency.
3163 */
3164message DiskStats {
3165 // Time taken to open, write 512B to, and close a file.
3166 // -1 if error performing the check.
3167 optional int64 data_write_latency_millis = 1;
3168
3169 optional bool file_based_encryption = 2;
3170
3171 // Recent disk write speed in kB/s.
3172 // -1 if error querying storageed.
3173 // 0 if data is unavailable.
3174 optional int32 recent_disk_write_speed = 3;
3175}
3176
3177
3178/**
3179 * Free and total bytes of the Data, Cache, and System partition.
3180 */
3181message DirectoryUsage {
3182 enum Directory {
3183 UNKNOWN = 0;
3184 DATA = 1;
3185 CACHE = 2;
3186 SYSTEM = 3;
3187 }
3188 optional Directory directory = 1;
3189 optional int64 free_bytes = 2;
3190 optional int64 total_bytes = 3;
3191}
3192
3193
3194/**
3195 * Size of an application: apk size, data size, and cache size.
3196 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3197 * Information is only reported for apps with the primary user (user 0).
3198 * Sizes are aggregated by package name.
3199 */
3200message AppSize {
3201 // Including uids will involve modifying diskstats logic.
3202 optional string package_name = 1;
3203 // App size in bytes. -1 if unavailable.
3204 optional int64 app_size_bytes = 2;
3205 // App data size in bytes. -1 if unavailable.
3206 optional int64 app_data_size_bytes = 3;
3207 // App cache size in bytes. -1 if unavailable.
3208 optional int64 app_cache_size_bytes = 4;
3209 // Time that the cache file was produced.
3210 // Uses System.currentTimeMillis(), which is wall clock time.
3211 optional int64 cache_time_millis = 5;
3212}
3213
3214
3215/**
3216 * Size of a particular category. Eg: photos, videos.
3217 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3218 */
3219message CategorySize {
3220 enum Category {
3221 UNKNOWN = 0;
3222 APP_SIZE = 1;
3223 APP_DATA_SIZE = 2;
3224 APP_CACHE_SIZE = 3;
3225 PHOTOS = 4;
3226 VIDEOS = 5;
3227 AUDIO = 6;
3228 DOWNLOADS = 7;
3229 SYSTEM = 8;
3230 OTHER = 9;
3231 }
3232 optional Category category = 1;
3233 // Category size in bytes.
3234 optional int64 size_bytes = 2;
3235 // Time that the cache file was produced.
3236 // Uses System.currentTimeMillis(), which is wall clock time.
3237 optional int64 cache_time_millis = 3;
3238}
Tej Singhd6d6d772018-09-05 17:41:25 -07003239
3240/**
Tej Singhe7726dc2018-09-21 11:42:12 -07003241 * Pulls per uid I/O stats. The stats are cumulative since boot.
3242 *
3243 * Read/write bytes are I/O events from a storage device
3244 * Read/write chars are data requested by read/write syscalls, and can be
3245 * satisfied by caching.
3246 *
3247 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
3248 */
3249message DiskIo {
3250 optional int32 uid = 1 [(is_uid) = true];
3251 optional int64 fg_chars_read = 2;
3252 optional int64 fg_chars_write = 3;
3253 optional int64 fg_bytes_read = 4;
3254 optional int64 fg_bytes_write = 5;
3255 optional int64 bg_chars_read = 6;
3256 optional int64 bg_chars_write = 7;
3257 optional int64 bg_bytes_read = 8;
3258 optional int64 bg_bytes_write = 9;
3259 optional int64 fg_fsync = 10;
3260 optional int64 bg_fsync= 11;
3261}
3262
3263
3264/**
Tej Singhd6d6d772018-09-05 17:41:25 -07003265 * Pulls the number of fingerprints for each user.
3266 *
3267 * Pulled from StatsCompanionService, which queries FingerprintManager.
3268 */
3269message NumFingerprints {
3270 // The associated user. Eg: 0 for owners, 10+ for others.
3271 // Defined in android/os/UserHandle.java
3272 optional int32 user = 1;
3273 // Number of fingerprints registered to that user.
3274 optional int32 num_fingerprints = 2;
3275}
Chenjie Yu12e5e672018-09-14 15:54:59 -07003276
Yangsteraf9aee72018-10-12 09:26:16 -07003277message AggStats {
3278 optional int64 min = 1;
3279
3280 optional int64 average = 2;
3281
3282 optional int64 max = 3;
3283}
3284
3285message ProcessStatsStateProto {
3286 optional android.service.procstats.ScreenState screen_state = 1;
3287
3288 optional android.service.procstats.MemoryState memory_state = 2;
3289
3290 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
3291 // and not frameworks/base/core/java/android/app/ActivityManager.java
3292 optional android.service.procstats.ProcessState process_state = 3;
3293
3294 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003295 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003296
3297 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003298 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07003299
3300 // # of samples taken
3301 optional int32 sample_size = 5;
3302
3303 // PSS is memory reserved for this process
3304 optional AggStats pss = 6;
3305
3306 // USS is memory shared between processes, divided evenly for accounting
3307 optional AggStats uss = 7;
3308
3309 // RSS is memory resident for this process
3310 optional AggStats rss = 8;
3311}
3312
3313// Next Tag: 7
3314message ProcessStatsProto {
3315 // Name of process.
3316 optional string process = 1;
3317
3318 // Uid of the process.
3319 optional int32 uid = 2;
3320
3321 // Information about how often kills occurred
3322 message Kill {
3323 // Count of excessive CPU kills
3324 optional int32 cpu = 1;
3325
3326 // Count of kills when cached
3327 optional int32 cached = 2;
3328
3329 // PSS stats during cached kill
3330 optional AggStats cached_pss = 3;
3331 }
3332 optional Kill kill = 3;
3333
3334 // Time and memory spent in various states.
3335 repeated ProcessStatsStateProto states = 5;
3336
3337 // Total time process has been running... screen_state, memory_state, and process_state
3338 // will not be set.
3339 optional ProcessStatsStateProto total_running_state = 6;
3340}
3341
3342message PackageServiceOperationStatsProto {
3343 // Operate enum: Started, Foreground, Bound, Executing
3344 optional android.service.procstats.ServiceOperationState operation = 1;
3345
3346 // Number of times the service was in this operation.
3347 optional int32 count = 2;
3348
3349 // Information about a state the service can be in.
3350 message StateStats {
3351 // Screen state enum.
3352 optional android.service.procstats.ScreenState screen_state = 1;
3353 // Memory state enum.
3354 optional android.service.procstats.MemoryState memory_state = 2;
3355
3356 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07003357 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003358 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003359 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003360 }
3361 repeated StateStats state_stats = 3;
3362}
3363
3364message PackageServiceStatsProto {
3365 // Name of service component.
3366 optional string service_name = 1;
3367
3368 // The operation stats.
3369 // The package_name, package_uid, package_version, service_name will not be set to save space.
3370 repeated PackageServiceOperationStatsProto operation_stats = 2;
3371}
3372
3373message PackageAssociationSourceProcessStatsProto {
3374 // Uid of the process.
3375 optional int32 process_uid = 1;
3376 // Process name.
3377 optional string process_name = 2;
3378
3379 // Total count of the times this association appeared.
3380 optional int32 total_count = 3;
3381
3382 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07003383 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003384
3385 // Total count of the times this association became actively impacting its target process.
3386 optional int32 active_count = 5;
3387
3388 // Information on one source in this association.
3389 message StateStats {
3390 // Process state enum.
3391 optional android.service.procstats.ProcessState process_state = 1;
3392 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003393 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003394 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07003395 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003396 }
3397 repeated StateStats active_state_stats = 6;
3398}
3399
3400message PackageAssociationProcessStatsProto {
3401 // Name of the target component.
3402 optional string component_name = 1;
3403 // Information on one source in this association.
3404 repeated PackageAssociationSourceProcessStatsProto sources = 2;
3405}
3406
3407
3408message ProcessStatsPackageProto {
3409 // Name of package.
3410 optional string package = 1;
3411
3412 // Uid of the package.
3413 optional int32 uid = 2;
3414
3415 // Version of the package.
3416 optional int64 version = 3;
3417
3418 // Stats for each process running with the package loaded in to it.
3419 repeated ProcessStatsProto process_stats = 4;
3420
3421 // Stats for each of the package's services.
3422 repeated PackageServiceStatsProto service_stats = 5;
3423
3424 // Stats for each association with the package.
3425 repeated PackageAssociationProcessStatsProto association_stats = 6;
3426}
3427
3428message ProcessStatsSectionProto {
3429 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003430 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07003431
3432 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003433 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07003434
3435 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003436 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07003437
3438 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07003439 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07003440
3441 // System runtime library. e.g. "libdvm.so", "libart.so".
3442 optional string runtime = 5;
3443
3444 // whether kernel reports swapped pss.
3445 optional bool has_swapped_pss = 6;
3446
3447 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
3448 enum Status {
3449 STATUS_UNKNOWN = 0;
3450 STATUS_COMPLETE = 1;
3451 STATUS_PARTIAL = 2;
3452 STATUS_SHUTDOWN = 3;
3453 STATUS_SYSPROPS = 4;
3454 }
3455 repeated Status status = 7;
3456
3457 // Stats for each process.
3458 repeated ProcessStatsProto process_stats = 8;
3459
3460 // Stats for each package.
3461 repeated ProcessStatsPackageProto package_stats = 9;
3462}
3463
Chenjie Yu12e5e672018-09-14 15:54:59 -07003464/**
3465 * Pulled from ProcessStatsService.java
3466 */
3467message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07003468 optional ProcessStatsSectionProto proc_stats_section = 1;
3469}
3470
Chenjie Yuf910b7802019-01-11 16:08:20 -08003471/**
3472 * Pulled from ProcessStatsService.java
3473 */
3474message ProcStatsPkgProc {
3475 optional ProcessStatsSectionProto proc_stats_section = 1;
3476}
3477
Yangsteraf9aee72018-10-12 09:26:16 -07003478message PowerProfileProto {
3479 optional double cpu_suspend = 1;
3480
3481 optional double cpu_idle = 2;
3482
3483 optional double cpu_active = 3;
3484
3485 message CpuCluster {
3486 optional int32 id = 1;
3487 optional double cluster_power = 2;
3488 optional int32 cores = 3;
3489 repeated int64 speed = 4;
3490 repeated double core_power = 5;
3491 }
3492
3493 repeated CpuCluster cpu_cluster = 40;
3494
3495 optional double wifi_scan = 4;
3496
3497 optional double wifi_on = 5;
3498
3499 optional double wifi_active = 6;
3500
3501 optional double wifi_controller_idle = 7;
3502
3503 optional double wifi_controller_rx = 8;
3504
3505 optional double wifi_controller_tx = 9;
3506
3507 repeated double wifi_controller_tx_levels = 10;
3508
3509 optional double wifi_controller_operating_voltage = 11;
3510
3511 optional double bluetooth_controller_idle = 12;
3512
3513 optional double bluetooth_controller_rx = 13;
3514
3515 optional double bluetooth_controller_tx = 14;
3516
3517 optional double bluetooth_controller_operating_voltage = 15;
3518
3519 optional double modem_controller_sleep = 16;
3520
3521 optional double modem_controller_idle = 17;
3522
3523 optional double modem_controller_rx = 18;
3524
3525 repeated double modem_controller_tx = 19;
3526
3527 optional double modem_controller_operating_voltage = 20;
3528
3529 optional double gps_on = 21;
3530
3531 repeated double gps_signal_quality_based = 22;
3532
3533 optional double gps_operating_voltage = 23;
3534
3535 optional double bluetooth_on = 24;
3536
3537 optional double bluetooth_active = 25;
3538
3539 optional double bluetooth_at_cmd = 26;
3540
3541 optional double ambient_display = 27;
3542
3543 optional double screen_on = 28;
3544
3545 optional double radio_on = 29;
3546
3547 optional double radio_scanning = 30;
3548
3549 optional double radio_active = 31;
3550
3551 optional double screen_full = 32;
3552
3553 optional double audio = 33;
3554
3555 optional double video = 34;
3556
3557 optional double flashlight = 35;
3558
3559 optional double memory = 36;
3560
3561 optional double camera = 37;
3562
3563 optional double wifi_batched_scan = 38;
3564
3565 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07003566}
Chenjie Yuab530202018-09-26 12:39:20 -07003567
3568/**
3569 * power_profile.xml and other constants for power model calculations.
3570 * Pulled from PowerProfile.java
3571 */
3572message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07003573 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07003574}
Chenjie Yub35b5f72018-10-13 23:25:11 -07003575
3576/**
arangelovd5db50e2018-10-12 20:24:39 +01003577 * Logs when a user restriction was added or removed.
3578 *
3579 * Logged from:
3580 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3581 */
3582message UserRestrictionChanged {
3583 // The raw string of the user restriction as defined in UserManager.
3584 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
3585 optional string restriction = 1;
3586 // Whether the restriction is enabled or disabled.
3587 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07003588}
Yangster-mac308ea0c2018-10-22 13:10:25 -07003589
3590/**
3591 * Pulls process user time and system time. Puller takes a snapshot of all pids
3592 * in the system and returns cpu stats for those that are working at the time.
3593 * Dead pids will be dropped. Kernel processes are excluded.
3594 * Min cool-down is 5 sec.
3595 */
3596message ProcessCpuTime {
3597 optional int32 uid = 1 [(is_uid) = true];
3598
3599 optional string process_name = 2;
3600 // Process cpu time in user space, cumulative from boot/process start
3601 optional int64 user_time_millis = 3;
3602 // Process cpu time in system space, cumulative from boot/process start
3603 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01003604}
Misha Wagner5a51e002018-10-03 15:04:09 +01003605
3606/**
3607 * Pulls the CPU usage for each thread.
3608 *
3609 * Read from /proc/$PID/task/$TID/time_in_state files.
3610 *
3611 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
3612 * time_in_state files not being present on some phones, have not been addressed. These should be
3613 * considered before a public release.
3614 */
3615message CpuTimePerThreadFreq {
3616 // UID that owns the process.
3617 optional int32 uid = 1 [(is_uid) = true];
3618 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003619 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01003620 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00003621 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01003622 // Name of the process taken from `/proc/$PID/cmdline`.
3623 optional string process_name = 4;
3624 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
3625 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00003626
3627 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
3628 // are given in KHz, and time is given in milliseconds since the thread started. All eight
3629 // frequencies are given here as the alternative is sending eight separate atoms. This method
3630 // significantly reduces the amount of data created
3631 optional int32 frequency1_khz = 6;
3632 optional int32 time1_millis = 7;
3633 optional int32 frequency2_khz = 8;
3634 optional int32 time2_millis = 9;
3635 optional int32 frequency3_khz = 10;
3636 optional int32 time3_millis = 11;
3637 optional int32 frequency4_khz = 12;
3638 optional int32 time4_millis = 13;
3639 optional int32 frequency5_khz = 14;
3640 optional int32 time5_millis = 15;
3641 optional int32 frequency6_khz = 16;
3642 optional int32 time6_millis = 17;
3643 optional int32 frequency7_khz = 18;
3644 optional int32 time7_millis = 19;
3645 optional int32 frequency8_khz = 20;
3646 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01003647}
Bookatz75ee6042018-11-09 12:27:37 -08003648
3649/**
Bookatz366a4432018-11-20 09:42:33 -08003650 * Pulls information about the device's build.
3651 */
3652message BuildInformation {
3653 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
3654 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
3655 optional string fingerprint = 1;
3656
3657 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
3658 optional string brand = 2;
3659
3660 // Build.PRODUCT. The name of the overall product.
3661 optional string product = 3;
3662
3663 // Build.DEVICE. The name of the industrial design.
3664 optional string device = 4;
3665
3666 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
3667 optional string version_release = 5;
3668
3669 // Build.ID. E.g. a label like "M4-rc20".
3670 optional string id = 6;
3671
3672 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
3673 // represent this build.
3674 optional string version_incremental = 7;
3675
3676 // Build.TYPE. The type of build, like "user" or "eng".
3677 optional string type = 8;
3678
3679 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
3680 optional string tags = 9;
3681}
3682
3683/**
Bookatz75ee6042018-11-09 12:27:37 -08003684 * Pulls on-device BatteryStats power use calculations for the overall device.
3685 */
3686message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08003687 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3688 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3689 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
3690 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08003691}
3692
3693/**
3694 * Pulls on-device BatteryStats power use calculations broken down by uid.
3695 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
3696 * that is attributed to non-uid items. They must all be included to get the total power use.
3697 */
3698message DeviceCalculatedPowerBlameUid {
3699 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
3700 optional int32 uid = 1 [(is_uid) = true];
3701
Bookatz3dbc13a2018-12-21 12:16:51 -08003702 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3703 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3704 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08003705}
3706
3707/**
3708 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
3709 * drain type.
3710 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
3711 * is attributed uids. They must all be included to get the total power use.
3712 */
3713message DeviceCalculatedPowerBlameOther {
3714 // The type of item whose power use is being reported.
3715 enum DrainType {
3716 AMBIENT_DISPLAY = 0;
3717 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
3718 BLUETOOTH = 2;
3719 CAMERA = 3;
3720 // Cell-standby
3721 CELL = 4;
3722 FLASHLIGHT = 5;
3723 IDLE = 6;
3724 MEMORY = 7;
3725 // Amount that total computed drain exceeded the drain estimated using the
3726 // battery level changes and capacity.
3727 OVERCOUNTED = 8;
3728 PHONE = 9;
3729 SCREEN = 10;
3730 // Amount that total computed drain was below the drain estimated using the
3731 // battery level changes and capacity.
3732 UNACCOUNTED = 11;
3733 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
3734 WIFI = 13;
3735 }
3736 optional DrainType drain_type = 1;
3737
Bookatz3dbc13a2018-12-21 12:16:51 -08003738 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
3739 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
3740 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00003741}
arangelov4e994062018-11-13 16:12:38 +00003742
3743/**
3744 * Logs device policy features.
3745 *
3746 * Logged from:
3747 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
3748 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
3749 */
3750message DevicePolicyEvent {
3751 // The event id - unique for each event.
3752 optional android.stats.devicepolicy.EventId event_id = 1;
3753 // The admin package name.
3754 optional string admin_package_name = 2;
3755 // A generic integer parameter.
3756 optional int32 integer_value = 3;
3757 // A generic boolean parameter.
3758 optional bool boolean_value = 4;
3759 // A parameter specifying a time period in milliseconds.
3760 optional uint64 time_period_millis = 5;
3761 // A parameter specifying a list of package names, bundle extras or string parameters.
3762 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
3763}
shawnlinea5b66b2018-11-13 15:05:29 +08003764
3765/**
3766 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
3767 *
3768 * Logged from:
3769 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3770 */
3771message DocsUILaunchReported {
3772 optional android.stats.docsui.LaunchAction launch_action = 1;
3773 optional bool has_initial_uri = 2;
3774 optional android.stats.docsui.MimeType mime_type = 3;
3775 optional android.stats.docsui.Root initial_root = 4;
3776}
3777
3778/**
3779 * Logs root/app visited event in file managers/picker. Call this when the user
3780 * taps on root/app in hamburger menu.
3781 *
3782 * Logged from:
3783 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3784 */
3785message DocsUIRootVisitedReported {
3786 optional android.stats.docsui.ContextScope scope = 1;
3787 optional android.stats.docsui.Root root = 2;
3788}
3789
3790/**
3791 * Logs file operation stats. Call this when a file operation has completed.
3792 *
3793 * Logged from:
3794 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3795 */
3796message DocsUIFileOperationReported {
3797 optional android.stats.docsui.Provider provider = 1;
3798 optional android.stats.docsui.FileOperation file_op = 2;
3799}
3800
3801/**
3802 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
3803 * mode.
3804 *
3805 * Logged from:
3806 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3807 */
3808message DocsUIFileOperationCopyMoveModeReported {
3809 optional android.stats.docsui.FileOperation file_op = 1;
3810 optional android.stats.docsui.CopyMoveOpMode mode = 2;
3811}
3812
3813
3814/**
3815 * Logs file sub operation stats. Call this when a file operation has failed.
3816 *
3817 * Logged from:
3818 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3819 */
3820message DocsUIFileOperationFailureReported {
3821 optional android.stats.docsui.Authority authority = 1;
3822 optional android.stats.docsui.SubFileOperation sub_op = 2;
3823}
3824
3825/**
3826* Logs the cancellation of a file operation. Call this when a job is canceled
3827*
3828* Logged from:
3829* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3830*/
3831message DocsUIFileOperationCanceledReported {
3832 optional android.stats.docsui.FileOperation file_op = 1;
3833}
3834
3835/**
3836 * Logs startup time in milliseconds.
3837 *
3838 * Logged from:
3839 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3840 */
3841message DocsUIStartupMsReported {
3842 optional int32 startup_millis = 1;
3843}
3844
3845/**
3846 * Logs the action that was started by user.
3847 *
3848 * Logged from:
3849 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3850 */
3851message DocsUIUserActionReported {
3852 optional android.stats.docsui.UserAction action = 1;
3853}
3854
3855/**
3856 * Logs the invalid type when invalid scoped access is requested.
3857 *
3858 * Logged from:
3859 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
3860 */
3861message DocsUIInvalidScopedAccessRequestReported {
3862 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00003863}
Ben Murdochbab399f2018-12-06 11:01:38 +00003864
3865/**
shawnlina75e82d2019-01-07 10:31:12 +08003866 * Logs the package name that launches docsui picker mode.
3867 *
3868 * Logged from:
3869 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3870 */
3871message DocsUIPickerLaunchedFromReported {
3872 optional string package_name = 1;
3873}
3874
3875/**
3876 * Logs the search type.
3877 *
3878 * Logged from:
3879 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3880 */
3881message DocsUISearchTypeReported {
3882 optional android.stats.docsui.SearchType search_type = 1;
3883}
3884
3885/**
3886 * Logs the search mode.
3887 *
3888 * Logged from:
3889 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3890 */
3891message DocsUISearchModeReported {
3892 optional android.stats.docsui.SearchMode search_mode = 1;
3893}
3894
3895/**
3896 * Logs the pick result information.
3897 *
3898 * Logged from:
3899 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
3900 */
3901message DocsUIPickResultReported {
3902 optional int32 total_action_count = 1;
3903 optional int64 duration_millis = 2;
3904 optional int32 file_count= 3;
3905 optional bool is_searching = 4;
3906 optional android.stats.docsui.Root picked_from = 5;
3907 optional android.stats.docsui.MimeType mime_type = 6;
3908 optional int32 repeatedly_pick_times = 7;
3909}
3910
3911/**
Ben Murdochbab399f2018-12-06 11:01:38 +00003912 * Logs when an app's memory is compacted.
3913 *
3914 * Logged from:
3915 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3916 */
3917message AppCompacted {
3918 // The pid of the process being compacted.
3919 optional int32 pid = 1;
3920
3921 // The name of the process being compacted.
3922 optional string process_name = 2;
3923
3924 // The type of compaction.
3925 enum Action {
3926 UNKNOWN = 0;
3927 SOME = 1;
3928 FULL = 2;
3929 }
Ben Murdoch01720b82018-12-19 18:03:44 +00003930 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00003931
3932 // Total RSS in kilobytes consumed by the process prior to compaction.
3933 optional int64 before_rss_total_kilobytes = 4;
3934
3935 // File RSS in kilobytes consumed by the process prior to compaction.
3936 optional int64 before_rss_file_kilobytes = 5;
3937
3938 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
3939 optional int64 before_rss_anon_kilobytes = 6;
3940
3941 // Swap in kilobytes consumed by the process prior to compaction.
3942 optional int64 before_swap_kilobytes = 7;
3943
3944 // Total RSS in kilobytes consumed by the process after compaction.
3945 optional int64 after_rss_total_kilobytes = 8;
3946
3947 // File RSS in kilobytes consumed by the process after compaction.
3948 optional int64 after_rss_file_kilobytes = 9;
3949
3950 // Anonymous RSS in kilobytes consumed by the process after compaction.
3951 optional int64 after_rss_anon_kilobytes = 10;
3952
3953 // Swap in kilobytes consumed by the process after compaction.
3954 optional int64 after_swap_kilobytes = 11;
3955
3956 // The time taken to perform compaction in milliseconds.
3957 optional int64 time_to_compact_millis = 12;
3958
3959 // The last compaction action performed for this app.
3960 optional Action last_action = 13;
3961
Ben Murdoch01720b82018-12-19 18:03:44 +00003962 // The last time that compaction was attempted on this process in milliseconds
3963 // since boot, not including sleep (see SystemClock.uptimeMillis()).
3964 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00003965
Ben Murdoch01720b82018-12-19 18:03:44 +00003966 // The oom_score_adj at the time of compaction.
3967 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00003968
3969 // The process state at the time of compaction.
3970 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
3971}
lifr157fc552018-12-12 16:38:04 +08003972
3973/**
3974 * Logs the latency period(in microseconds) and the return code of
3975 * the DNS(Domain Name System) lookups.
3976 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
3977 * to get info(address or hostname) from DNS server(or DNS cache).
3978 * Logged from:
3979 * /system/netd/server/DnsProxyListener.cpp
3980 */
3981message NetworkDnsEventReported {
3982 // The types of the DNS lookups, as defined in
3983 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
3984 enum EventType {
3985 EVENT_UNKNOWN = 0;
3986 EVENT_GETADDRINFO = 1;
3987 EVENT_GETHOSTBYNAME = 2;
3988 EVENT_GETHOSTBYADDR = 3;
3989 EVENT_RES_NSEND = 4;
3990 }
3991 optional EventType event_type = 1;
3992
3993 // The return value of the DNS resolver for each DNS lookups.
3994 //bionic/libc/include/netdb.h
3995 //system/netd/resolv/include/netd_resolv/resolv.h
3996 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08003997 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08003998 EAI_ADDRFAMILY = 1;
3999 EAI_AGAIN = 2;
4000 EAI_BADFLAGS = 3;
4001 EAI_FAIL = 4;
4002 EAI_FAMILY = 5;
4003 EAI_MEMORY = 6;
4004 EAI_NODATA = 7;
4005 EAI_NONAME = 8;
4006 EAI_SERVICE = 9;
4007 EAI_SOCKTYPE = 10;
4008 EAI_SYSTEM = 11;
4009 EAI_BADHINTS = 12;
4010 EAI_PROTOCOL = 13;
4011 EAI_OVERFLOW = 14;
4012 RESOLV_TIMEOUT = 255;
4013 EAI_MAX = 256;
4014 }
4015 optional ReturnCode return_code = 2;
4016
4017 // The latency period(in microseconds) it took for this DNS lookup to complete.
4018 optional int32 latency_micros = 3;
4019}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08004020
4021/**
4022 * Logs when a data stall event occurs.
4023 *
4024 * Log from:
4025 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4026 */
4027message DataStallEvent {
4028 // Data stall evaluation type.
4029 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4030 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
4031 optional int32 evaluation_type = 1;
4032 // See definition in data_stall_event.proto.
4033 optional com.android.server.connectivity.ProbeResult validation_result = 2;
4034 // See definition in data_stall_event.proto.
4035 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
4036 // See definition in data_stall_event.proto.
4037 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
4038 // See definition in data_stall_event.proto.
4039 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
4040 // See definition in data_stall_event.proto.
4041 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
4042}
Christian Brunschenf86039e2018-12-21 12:26:14 +00004043
4044/*
4045 * Logs when RescueParty resets some set of experiment flags.
4046 *
4047 * Logged from:
4048 * frameworks/base/services/core/java/com/android/server/RescueParty.java
4049 */
4050message RescuePartyResetReported {
4051 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
4052 optional int32 rescue_level = 1;
4053}
Mathew Inwoodb375be52019-01-04 11:36:25 +00004054
4055/**
4056 * Logs when signed config is received from an APK, and if that config was applied successfully.
4057 * Logged from:
4058 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
4059 */
4060message SignedConfigReported {
4061 enum Type {
4062 UNKNOWN_TYPE = 0;
4063 GLOBAL_SETTINGS = 1;
4064 }
4065 optional Type type = 1;
4066
4067 // The final status of the signed config received.
4068 enum Status {
4069 UNKNOWN_STATUS = 0;
4070 APPLIED = 1;
4071 BASE64_FAILURE_CONFIG = 2;
4072 BASE64_FAILURE_SIGNATURE = 3;
4073 SECURITY_EXCEPTION = 4;
4074 INVALID_CONFIG = 5;
4075 OLD_CONFIG = 6;
4076 SIGNATURE_CHECK_FAILED = 7;
4077 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00004078 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00004079 }
4080 optional Status status = 2;
4081
4082 // The version of the signed config processed.
4083 optional int32 version = 3;
4084
4085 // The package name that the config was extracted from.
4086 optional string from_package = 4;
4087
4088 enum Key {
4089 NO_KEY = 0;
4090 DEBUG = 1;
4091 PRODUCTION = 2;
4092 }
4093 // Which key was used to verify the config.
4094 optional Key verified_with = 5;
4095}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004096
4097/*
4098 * Logs GNSS Network-Initiated (NI) location events.
4099 *
4100 * Logged from:
4101 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4102 */
4103message GnssNiEventReported {
4104 // The type of GnssNiEvent.
4105 enum EventType {
4106 UNKNOWN = 0;
4107 NI_REQUEST = 1;
4108 NI_RESPONSE = 2;
4109 }
4110 optional EventType event_type = 1;
4111
4112 // An ID generated by HAL to associate NI notifications and UI responses.
4113 optional int32 notification_id = 2;
4114
4115 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
4116 optional int32 ni_type = 3;
4117
4118 // NI requires notification.
4119 optional bool need_notify = 4;
4120
4121 // NI requires verification.
4122 optional bool need_verify = 5;
4123
4124 // NI requires privacy override, no notification/minimal trace.
4125 optional bool privacy_override = 6;
4126
4127 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
4128 // seconds.
4129 optional int32 timeout = 7;
4130
4131 // Default response when timeout.
4132 optional int32 default_response = 8;
4133
4134 // String representing the requester of the network inititated location request.
4135 optional string requestor_id = 9;
4136
4137 // Notification message text string representing the service(for eg. SUPL-service) who sent the
4138 // network initiated location request.
4139 optional string text = 10;
4140
4141 // requestorId decoding scheme.
4142 optional int32 requestor_id_encoding = 11;
4143
4144 // Notification message text decoding scheme.
4145 optional int32 text_encoding = 12;
4146
4147 // True if SUPL ES is enabled.
4148 optional bool is_supl_es_enabled = 13;
4149
4150 // True if GNSS location is enabled.
4151 optional bool is_location_enabled = 14;
4152
4153 // GNSS NI responses which define the response in NI structures.
4154 optional int32 user_response = 15;
4155}