blob: 2efb7894381212d9ef79bfb962587cb4645f8771 [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";
Tej Singh33a412b2018-03-16 18:43:59 -070025import "frameworks/base/core/proto/android/app/job/enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070026import "frameworks/base/core/proto/android/app/settings_enums.proto";
Jack Hec27040a2019-01-09 20:54:41 -080027import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080028import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack Heab86dbd22018-12-18 15:43:27 -080029import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080030import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Jack He1021a612019-01-20 21:22:46 -080031import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto";
Michael Groover9e7b06e2018-12-28 19:55:51 -080032import "frameworks/base/core/proto/android/debug/enums.proto";
Kevin Chyn1741a072019-01-17 11:54:40 -080033import "frameworks/base/core/proto/android/hardware/biometrics/enums.proto";
joshmccloskey8c3322e2019-01-09 18:25:57 -080034import "frameworks/base/core/proto/android/hardware/sensor/assist/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080035import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080036import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080037import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080038import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080039import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080040import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070041import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080042import "frameworks/base/core/proto/android/service/usb.proto";
Chiachang Wang0e88ebf2019-03-21 10:18:07 +080043import "frameworks/base/core/proto/android/stats/connectivity/network_stack.proto";
lifr1f74b052019-04-16 22:16:30 +080044import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.proto";
Bookatz11257ca2018-12-05 18:22:39 -080045import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
46import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070047import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
48import "frameworks/base/core/proto/android/stats/enums.proto";
49import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070050import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Hongyi Zhang700137e2019-05-23 21:19:36 -070051import "frameworks/base/core/proto/android/stats/location/location_enums.proto";
Ray Essick8ab04df2019-02-15 11:01:02 -080052import "frameworks/base/core/proto/android/stats/mediametrics/mediametrics.proto";
Jeff Sharkey6bd21572019-11-15 20:45:33 -070053import "frameworks/base/core/proto/android/stats/mediaprovider/mediaprovider_enums.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000054import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080055import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080056import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080057import "frameworks/base/core/proto/android/telephony/enums.proto";
58import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080059import "frameworks/base/core/proto/android/wifi/enums.proto";
Tony Make2b1b672019-07-29 16:59:47 +010060import "frameworks/base/core/proto/android/stats/textclassifier/textclassifier_enums.proto";
Tianjie Xu167c3db2019-07-22 14:25:14 -070061import "frameworks/base/core/proto/android/stats/otaupdate/updateengine_enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080062
Yao Chend54f9dd2017-10-17 17:37:48 +000063/**
Stefan Lafonae2df012017-11-14 09:17:21 -080064 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000065 * raw stats log events from the Android system, also known as "atoms."
66 *
67 * This field contains a single oneof with all of the available messages.
68 * The stats-log-api-gen tool runs as part of the Android build and
69 * generates the android.util.StatsLog class, which contains the constants
70 * and methods that Android uses to log.
71 *
Stefan Lafonae2df012017-11-14 09:17:21 -080072 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000073 * Instead, statsd on Android constructs these messages synthetically,
74 * in the format defined here and in stats_log.proto.
75 */
Stefan Lafonae2df012017-11-14 09:17:21 -080076message Atom {
77 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070078 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070079 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
80 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070081 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070082 BleScanResultReceived ble_scan_result_received = 4;
83 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080084 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070085 SyncStateChanged sync_state_changed = 7;
86 ScheduledJobStateChanged scheduled_job_state_changed = 8;
87 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070088 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080089 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
90 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
91 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070092 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
93 MemoryFactorStateChanged memory_factor_state_changed = 15;
94 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
95 CachedKillReported cached_kill_reported = 17;
96 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070097 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080098 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
99 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
100 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -0700101 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800102 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -0700103 CameraStateChanged camera_state_changed = 25;
104 FlashlightStateChanged flashlight_state_changed = 26;
105 UidProcessStateChanged uid_process_state_changed = 27;
106 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
107 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -0700108 BatteryLevelChanged battery_level_changed = 30;
109 ChargingStateChanged charging_state_changed = 31;
110 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -0700111 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800112 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -0700113 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
114 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -0700115 WifiLockStateChanged wifi_lock_state_changed = 37;
116 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
117 WifiScanStateChanged wifi_scan_state_changed = 39;
118 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700119 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700120 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700121 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900122 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700123 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800124 AnomalyDetected anomaly_detected = 46;
Andrei Oneada01ea52019-01-30 15:28:36 +0000125 AppBreadcrumbReported app_breadcrumb_reported = 47 [(allow_from_any_uid) = true];
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800126 AppStartOccurred app_start_occurred = 48;
127 AppStartCanceled app_start_canceled = 49;
128 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800129 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800130 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800131 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800132 LmkStateChanged lmk_state_changed = 54;
133 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800134 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800135 BootSequenceReported boot_sequence_reported = 57;
Andrei Oneada01ea52019-01-30 15:28:36 +0000136 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -0800137 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800138 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800139 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800140 KeyguardStateChanged keyguard_state_changed = 62;
141 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
142 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800143 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800144 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800145 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
146 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800147 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700148 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800149 SpeakerImpedanceReported speaker_impedance_reported = 71;
150 HardwareFailed hardware_failed = 72;
151 PhysicalDropDetected physical_drop_detected = 73;
152 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800153 MobileConnectionStateChanged mobile_connection_state_changed = 75;
154 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700155 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800156 AppCrashOccurred app_crash_occurred = 78;
157 ANROccurred anr_occurred = 79;
158 WTFOccurred wtf_occurred = 80;
159 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700160 GenericAtom generic_atom = 82;
jianjin6eada302019-02-28 11:25:57 -0800161 KeyValuePairsAtom key_value_pairs_atom = 83 [(allow_from_any_uid) = true];
Bookatza7020bd2018-08-28 16:29:35 -0700162 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700163 DeferredJobStatsReported deferred_job_stats_reported = 85;
Tej Singha72344992019-04-17 18:55:08 -0700164 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Kevin Chyn1741a072019-01-17 11:54:40 -0800165 BiometricAcquired biometric_acquired = 87;
166 BiometricAuthenticated biometric_authenticated = 88;
167 BiometricErrorOccurred biometric_error_occurred = 89;
Will Brockmanfbaa7912019-10-24 15:15:09 -0400168 UiEventReported ui_event_reported = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700169 BatteryHealthSnapshot battery_health_snapshot = 91;
170 SlowIo slow_io = 92;
171 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700172 PhoneServiceStateChanged phone_service_state_changed = 94;
173 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100174 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700175 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700176 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700177 // TODO: service state change is very noisy shortly after boot, as well
178 // as at other transitions - coming out of doze, device plugged in, etc.
179 // Consider removing this if it becomes a problem
180 ServiceStateChanged service_state_changed = 99;
181 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800182 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800183 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000184 DevicePolicyEvent device_policy_event = 103;
shawnlin9a1392a2019-04-09 16:21:17 +0800185 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled =
186 104 [(log_from_module) = "docsui"];
187 DocsUIFileOperationCopyMoveModeReported
188 docs_ui_file_op_copy_move_mode_reported =
189 105 [(log_from_module) = "docsui"];
190 DocsUIFileOperationFailureReported docs_ui_file_op_failure =
191 106 [(log_from_module) = "docsui"];
192 DocsUIFileOperationReported docs_ui_provider_file_op =
193 107 [(log_from_module) = "docsui"];
194 DocsUIInvalidScopedAccessRequestReported
195 docs_ui_invalid_scoped_access_request =
196 108 [(log_from_module) = "docsui"];
197 DocsUILaunchReported docs_ui_launch_reported =
198 109 [(log_from_module) = "docsui"];
199 DocsUIRootVisitedReported docs_ui_root_visited =
200 110 [(log_from_module) = "docsui"];
201 DocsUIStartupMsReported docs_ui_startup_ms =
202 111 [(log_from_module) = "docsui"];
203 DocsUIUserActionReported docs_ui_user_action_reported =
204 112 [(log_from_module) = "docsui"];
Bookatzda1798c2018-12-13 14:16:00 -0800205 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
206 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f62018-12-06 11:01:38 +0000207 AppCompacted app_compacted = 115;
lifre82d8f62019-03-25 20:33:21 +0800208 NetworkDnsEventReported network_dns_event_reported = 116 [(log_from_module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800209 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
210 117 [(log_from_module) = "docsui"];
211 DocsUIPickResultReported docs_ui_pick_result_reported =
212 118 [(log_from_module) = "docsui"];
213 DocsUISearchModeReported docs_ui_search_mode_reported =
214 119 [(log_from_module) = "docsui"];
215 DocsUISearchTypeReported docs_ui_search_type_reported =
216 120 [(log_from_module) = "docsui"];
Chiachang Wange512b262019-04-11 21:24:28 +0800217 DataStallEvent data_stall_event = 121 [(log_from_module) = "network_stack"];
Christian Brunschenf86039e2018-12-21 12:26:14 +0000218 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000219 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800220 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800221 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800222 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
223 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000224 AppDowngraded app_downgraded = 128;
225 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
226 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800227 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
228 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800229 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800230 NfcErrorOccurred nfc_error_occurred = 134;
231 NfcStateChanged nfc_state_changed = 135;
232 NfcBeamOccurred nfc_beam_occurred = 136;
233 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
234 NfcTagOccurred nfc_tag_occurred = 138;
235 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
236 SeStateChanged se_state_changed = 140;
237 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800238 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800239 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800240 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800241 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800242 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800243 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyne5a37fb2019-02-08 13:10:36 -0800244 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500245 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800246 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Jack Hec27040a2019-01-09 20:54:41 -0800247 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
248 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
249 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
250 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
251 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
252 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
253 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
254 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
255 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He1021a612019-01-20 21:22:46 -0800256 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
257 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
Jack Heaea26982019-04-04 11:19:48 -0700258 BluetoothDeviceInfoReported bluetooth_device_info_reported = 162;
Jack He1021a612019-01-20 21:22:46 -0800259 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
260 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
261 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
262 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
263 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Alex Salod7c3eef2019-01-25 14:43:27 -0800264 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800265 ProcessStartTime process_start_time = 169;
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700266 PermissionGrantRequestResultReported permission_grant_request_result_reported =
267 170 [(log_from_module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800268 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Michael Groover4a0ca942019-01-24 17:41:25 -0800269 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Steven Wu552f63f2019-02-05 13:41:36 -0500270 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
joshmccloskey8c3322e2019-01-09 18:25:57 -0800271 AssistGestureStageReported assist_gesture_stage_reported = 174;
272 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
273 AssistGestureProgressReported assist_gesture_progress_reported = 176;
Philip Quinn0eded622019-01-29 12:46:28 -0800274 TouchGestureClassified touch_gesture_classified = 177;
Andrei Onea4ad6d0c2019-02-08 13:54:12 +0000275 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true];
Kunhung Li286c52f2019-05-21 20:10:43 +0800276 StyleUIChanged style_ui_changed = 179 [(log_from_module) = "style"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700277 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Tej Singha72344992019-04-17 18:55:08 -0700278 180 [(log_from_module) = "permissioncontroller"];
Carmen Agimof6688a352019-01-30 19:36:04 +0000279 AppInstallOnExternalStorageReported app_install_on_external_storage_reported = 181;
Chiachang Wange512b262019-04-11 21:24:28 +0800280 NetworkStackReported network_stack_reported = 182 [(log_from_module) = "network_stack"];
Carmen Agimof6dcc5032019-03-01 16:20:09 +0000281 AppMovedStorageReported app_moved_storage_reported = 183;
joshmccloskey6f952b22019-03-25 20:59:35 -0700282 BiometricEnrolled biometric_enrolled = 184;
jianjin8f2dee02019-03-29 14:03:08 -0700283 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185;
284 TombStoneOccurred tomb_stone_occurred = 186;
Jack He71426802019-04-02 13:32:52 -0700285 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported = 187;
Ben Blount763a5d52019-04-10 11:48:58 -0700286 IntelligenceEventReported intelligence_event_reported =
287 188 [(log_from_module) = "intelligence"];
Tej Singha72344992019-04-17 18:55:08 -0700288 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed = 189;
Hai Zhang5d3328d2019-04-13 21:25:06 +0800289 RoleRequestResultReported role_request_result_reported =
290 190 [(log_from_module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800291 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
292 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
293 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
294 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
295 MediametricsCodecReported mediametrics_codec_reported = 195;
296 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
297 MediametricsExtractorReported mediametrics_extractor_reported = 197;
298 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
299 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
300 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700301 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Yuncheol Heod1a85d22019-05-08 17:13:42 -0700302 CarPowerStateChanged car_power_state_changed = 203;
303 GarageModeInfo garage_mode_info = 204;
Tej Singhc9203082019-05-03 13:42:23 -0700304 TestAtomReported test_atom_reported = 205 [(log_from_module) = "cts"];
Adam He420947c2019-01-23 15:59:09 -0800305 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported = 206;
306 ContentCaptureServiceEvents content_capture_service_events = 207;
307 ContentCaptureSessionEvents content_capture_session_events = 208;
308 ContentCaptureFlushed content_capture_flushed = 209;
Hongyi Zhang700137e2019-05-23 21:19:36 -0700309 LocationManagerApiUsageReported location_manager_api_usage_reported = 210;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100310 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
311 211 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100312 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
313 212 [(log_from_module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100314 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
315 213 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100316 LocationAccessCheckNotificationAction location_access_check_notification_action =
317 214 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100318 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
319 215 [(log_from_module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100320 AppPermissionFragmentViewed app_permission_fragment_viewed =
321 216 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100322 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
323 217 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100324 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
325 218 [(log_from_module) = "permissioncontroller"];
Tony Make2b1b672019-07-29 16:59:47 +0100326 TextSelectionEvent text_selection_event =
327 219 [(log_from_module) = "textclassifier"];
328 TextLinkifyEvent text_linkify_event =
329 220 [(log_from_module) = "textclassifier"];
330 ConversationActionsEvent conversation_actions_event =
331 221 [(log_from_module) = "textclassifier"];
332 LanguageDetectionEvent language_detection_event =
333 222 [(log_from_module) = "textclassifier"];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -0700334 ExclusionRectStateChanged exclusion_rect_state_changed = 223;
335 BackGesture back_gesture_reported_reported = 224;
Tianjie Xu167c3db2019-07-22 14:25:14 -0700336 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
337 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Emilian Peev6729f372019-08-29 09:14:09 -0700338 CameraActionEvent camera_action_event = 227;
atrost01a20932019-08-28 15:40:37 +0100339 AppCompatibilityChangeReported app_compatibility_change_reported =
340 228 [(allow_from_any_uid) = true];
Hector Dearman40579f62019-11-01 13:19:30 +0000341 PerfettoUploaded perfetto_uploaded =
342 229 [(log_from_module) = "perfetto"];
Mark Tabrya824a642019-11-05 12:26:12 -0800343 VmsClientConnectionStateChanged vms_client_connection_state_changed = 230;
Blake Kragten212edc72019-10-15 13:26:50 -0700344 GpsLocationStatusReported gps_location_status_reported = 231;
345 GpsTimeToFirstFixReported gps_time_to_first_fix_reported = 232;
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700346 MediaProviderScanEvent media_provider_scan_event =
347 233 [(log_from_module) = "mediaprovider"];
348 MediaProviderDeletionEvent media_provider_deletion_event =
349 234 [(log_from_module) = "mediaprovider"];
350 MediaProviderPermissionEvent media_provider_permission_event =
351 235 [(log_from_module) = "mediaprovider"];
352 MediaProviderSchemaChange media_provider_schema_change =
353 236 [(log_from_module) = "mediaprovider"];
354 MediaProviderIdleMaintenance media_provider_idle_maintenance =
355 237 [(log_from_module) = "mediaprovider"];
Yao Chend54f9dd2017-10-17 17:37:48 +0000356 }
David Chenc8a43242017-10-17 16:23:28 -0700357
David Chen6e3e6cb2018-01-03 16:14:06 -0800358 // Pulled events will start at field 10000.
Rafal Slawik7efcefb2019-09-20 11:16:20 +0100359 // Next: 10065
David Chenc8a43242017-10-17 16:23:28 -0700360 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800361 WifiBytesTransfer wifi_bytes_transfer = 10000;
362 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
363 MobileBytesTransfer mobile_bytes_transfer = 10002;
364 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800365 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800366 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800367 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800368 CpuTimePerFreq cpu_time_per_freq = 10008;
369 CpuTimePerUid cpu_time_per_uid = 10009;
370 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800371 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800372 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800373 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800374 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800375 SystemElapsedRealtime system_elapsed_realtime = 10014;
376 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800377 CpuActiveTime cpu_active_time = 10016;
378 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000379 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800380 RemainingBatteryCapacity remaining_battery_capacity = 10019;
381 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800382 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100383 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100384 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100385 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000386 DiskStats disk_stats = 10025;
387 DirectoryUsage directory_usage = 10026;
388 AppSize app_size = 10027;
389 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700390 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700391 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800392 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700393 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700394 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800395 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700396 ProcessCpuTime process_cpu_time = 10035;
Misha Wagner5a51e002018-10-03 15:04:09 +0100397 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700398 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee60422018-11-09 12:27:37 -0800399 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
400 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
401 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000402 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800403 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800404 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800405 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000406 DebugElapsedClock debug_elapsed_clock = 10046;
407 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800408 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800409 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800410 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800411 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000412 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000413 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800414 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
415 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000416 SystemIonHeapSize system_ion_heap_size = 10056;
Carmen Agimofa769c152019-03-04 14:39:14 +0000417 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700418 FaceSettings face_settings = 10058;
Maggie White442b6312019-04-05 16:26:44 -0700419 CoolingDevice cooling_device = 10059;
Martijn Coenencd95d462019-04-25 17:09:45 +0200420 AppOps app_ops = 10060;
Rafal Slawik77987ed2019-06-17 12:28:23 +0100421 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061;
Alec Mourie088e762019-07-02 13:10:55 -0700422 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
423 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Rafal Slawik7efcefb2019-09-20 11:16:20 +0100424 ProcessMemorySnapshot process_memory_snapshot = 10064;
Mark Tabrya824a642019-11-05 12:26:12 -0800425 VmsClientStats vms_client_stats = 10065;
David Chenc8a43242017-10-17 16:23:28 -0700426 }
yroa1fe77c2018-02-26 14:22:54 -0800427
Bookatz76aafcf2018-09-17 16:17:10 -0700428 // DO NOT USE field numbers above 100,000 in AOSP.
429 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
430 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100431
432 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700433}
434
Yao Chend54f9dd2017-10-17 17:37:48 +0000435/**
Yangster-mac20877162017-12-22 17:19:39 -0800436 * This proto represents a node of an attribution chain.
437 * Note: All attribution chains are represented as a repeated field of type
438 * AttributionNode. It is understood that in such arrays, the order is that
439 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000440 */
Yangster-mac20877162017-12-22 17:19:39 -0800441message AttributionNode {
442 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800443 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800444
Yangster-mac20877162017-12-22 17:19:39 -0800445 // The (optional) string tag for an element in the attribution chain. If the
446 // element has no tag, it is encoded as an empty string.
447 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700448}
449
Yangster-mac48b3d622018-08-18 12:38:11 -0700450message KeyValuePair {
451 optional int32 key = 1;
452 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700453 int32 value_int = 2;
454 int64 value_long = 3;
455 string value_str = 4;
456 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700457 }
458}
459
460message KeyValuePairsAtom {
461 optional int32 uid = 1;
462 repeated KeyValuePair pairs = 2;
463}
464
Yao Chend54f9dd2017-10-17 17:37:48 +0000465/*
466 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800467 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000468 *
469 * RULES:
470 * - The field ids for each atom must start at 1, and count upwards by 1.
471 * Skipping field ids is not allowed.
472 * - These form an API, so renaming, renumbering or removing fields is
473 * not allowed between android releases. (This is not currently enforced,
474 * but there will be a tool to enforce this restriction).
475 * - The types must be built-in protocol buffer types, namely, no sub-messages
476 * are allowed (yet). The bytes type is also not allowed.
477 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800478 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000479 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800480 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000481 * - A field that is a uid should be a string field, tagged with the [xxx]
482 * annotation. The generated code on android will be represented by UIDs,
483 * and those UIDs will be translated in xxx to those strings.
484 *
485 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700486 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000487 * - If there is a UID, it goes first. Think in an object-oriented fashion.
488 * *****************************************************************************
489 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700490
Yao Chend54f9dd2017-10-17 17:37:48 +0000491/**
Tej Singha72344992019-04-17 18:55:08 -0700492 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700493 * Logs when the Thermal service HAL notifies the throttling start/stop events.
494 *
495 * Logged from:
496 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
497 */
498message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700499 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700500 optional android.os.TemperatureTypeEnum sensor_type = 1;
501
Maggie White442b6312019-04-05 16:26:44 -0700502 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700503 enum State {
504 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700505 START = 1; // START indicated that throttling was triggered.
506 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700507 }
Yangster-mace16189a2018-08-26 12:20:16 -0700508 optional State state = 2;
509
510 optional float temperature = 3;
511}
512
513/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000514 * Logs when the screen state changes.
515 *
516 * Logged from:
517 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
518 */
519message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800520 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700521 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700522}
Yao Chend54f9dd2017-10-17 17:37:48 +0000523
524/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700525 * Logs that the process state of the uid, as determined by ActivityManager
526 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000527 *
528 * Logged from:
529 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
530 */
Bookatzc1a050a2017-10-10 15:49:28 -0700531message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700532 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000533
Bookatzdb026a22018-01-10 19:01:56 -0800534 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700535 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000536}
537
538/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700539 * Logs process state change of a process, as per the activity manager.
540 *
541 * Logged from:
542 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
543 */
544message ProcessStateChanged {
545 optional int32 uid = 1;
546 optional string process_name = 2;
547 optional string package_name = 3;
548 // TODO: remove this when validation is done
549 optional int64 version = 5;
550 // The state, from frameworks/base/core/proto/android/app/enums.proto.
551 optional android.app.ProcessStateEnum state = 4;
552}
553
554/**
555 * Logs when ActivityManagerService sleep state is changed.
556 *
557 * Logged from:
558 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
559 */
560message ActivityManagerSleepStateChanged {
561 // TODO: import frameworks proto
562 enum State {
563 UNKNOWN = 0;
564 ASLEEP = 1;
565 AWAKE = 2;
566 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700567 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700568}
569
570/**
571 * Logs when system memory state changes.
572 *
573 * Logged from:
574 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
575 */
576message MemoryFactorStateChanged {
577 // TODO: import frameworks proto
578 enum State {
579 MEMORY_UNKNOWN = 0;
580 NORMAL = 1; // normal.
581 MODERATE = 2; // moderate memory pressure.
582 LOW = 3; // low memory.
583 CRITICAL = 4; // critical memory.
584
585 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700586 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700587}
588
589/**
590 * Logs when app is using too much cpu, according to ActivityManagerService.
591 *
592 * Logged from:
593 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
594 */
595message ExcessiveCpuUsageReported {
596 optional int32 uid = 1;
597 optional string process_name = 2;
598 optional string package_name = 3;
599 // package version. TODO: remove this when validation is done
600 optional int64 version = 4;
601}
602
603/**
604 * Logs when a cached process is killed, along with its pss.
605 *
606 * Logged from:
607 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
608 */
609message CachedKillReported {
610 optional int32 uid = 1;
611 optional string process_name = 2;
612 optional string package_name = 3;
613 // TODO: remove this when validation is done
614 optional int64 version = 5;
615 optional int64 pss = 4;
616}
617
618/**
619 * Logs when memory stats of a process is reported.
620 *
621 * Logged from:
622 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
623 */
624message ProcessMemoryStatReported {
625 optional int32 uid = 1;
626 optional string process_name = 2;
627 optional string package_name = 3;
628 //TODO: remove this when validation is done
629 optional int64 version = 9;
630 optional int64 pss = 4;
631 optional int64 uss = 5;
632 optional int64 rss = 6;
633 enum Type {
634 ADD_PSS_INTERNAL_SINGLE = 0;
635 ADD_PSS_INTERNAL_ALL_MEM = 1;
636 ADD_PSS_INTERNAL_ALL_POLL = 2;
637 ADD_PSS_EXTERNAL = 3;
638 ADD_PSS_EXTERNAL_SLOW = 4;
639 }
640 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800641 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700642}
643
644/**
Bookatzc1a050a2017-10-10 15:49:28 -0700645 * Logs that a process started, finished, crashed, or ANRed.
646 *
647 * Logged from:
648 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
649 */
650message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700651 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700652
David Chen0b5c90c2018-01-25 16:51:49 -0800653 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800654 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700655
Bookatzddccf0a2017-11-28 16:48:14 -0800656 // What lifecycle state the process changed to.
657 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800658 enum State {
659 FINISHED = 0;
660 STARTED = 1;
661 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800662 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800663 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700664}
665
Bookatzc1a050a2017-10-10 15:49:28 -0700666/**
667 * Logs when the ble scan state changes.
668 *
669 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700670 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700671 */
672message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800673 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700674
675 enum State {
676 OFF = 0;
677 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700678 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
679 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700680 }
681 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700682
Bookatze5ec0b42018-03-26 13:34:56 -0700683 // Does the scan have a filter.
684 optional bool is_filtered = 3;
685 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
686 optional bool is_first_match = 4;
687 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
688 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700689}
690
691/**
692 * Logs reporting of a ble scan finding results.
693 *
694 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700695 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700696 */
Bookatzae6738e2018-09-13 11:38:56 -0700697// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700698message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800699 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700700
701 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800702 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700703}
704
705/**
706 * Logs when a sensor state changes.
707 *
708 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700709 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700710 */
711message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800712 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700713
Bookatzc1a050a2017-10-10 15:49:28 -0700714 // The id (int) of the sensor.
715 optional int32 sensor_id = 2;
716
717 enum State {
718 OFF = 0;
719 ON = 1;
720 }
721 optional State state = 3;
722}
723
Bookatzc1a050a2017-10-10 15:49:28 -0700724/**
725 * Logs when GPS state changes.
726 *
727 * Logged from:
728 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
729 */
730message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800731 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700732
733 enum State {
734 OFF = 0;
735 ON = 1;
736 }
737 optional State state = 2;
738}
739
Bookatz48d362e2018-11-06 15:49:08 -0800740/**
741 * Logs when GPS signal quality.
742 *
743 * Logged from:
744 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
745 */
746message GpsSignalQualityChanged {
747 optional android.server.location.GpsSignalQualityEnum level = 1;
748}
749
Blake Kragten212edc72019-10-15 13:26:50 -0700750/**
751 * Gps location status report
752 *
753 * Logged from:
754 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
755 */
756message GpsLocationStatusReported {
757 // Boolean stating if location was acquired
758 optional bool location_success = 1;
759}
760
761/**
762 * Gps log time to first fix report
763 *
764 * Logged from:
765 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
766 */
767message GpsTimeToFirstFixReported {
768 // int32 reporting the time to first fix in milliseconds
769 optional int32 time_to_first_fix_millis = 1;
770}
Bookatzc1a050a2017-10-10 15:49:28 -0700771
772/**
773 * Logs when a sync manager sync state changes.
774 *
775 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700776 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700777 */
778message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800779 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700780
David Chen0b5c90c2018-01-25 16:51:49 -0800781 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800782 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700783
784 enum State {
785 OFF = 0;
786 ON = 1;
787 }
788 optional State state = 3;
789}
790
Yangster-mac96353002018-09-05 11:18:55 -0700791/*
792 * Deferred job stats.
793 *
794 * Logged from:
795 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
796*/
797message DeferredJobStatsReported {
798 repeated AttributionNode attribution_node = 1;
799
800 // Number of jobs deferred.
801 optional int32 num_jobs_deferred = 2;
802
803 // Time since the last job runs.
804 optional int64 time_since_last_job_millis = 3;
805}
806
Bookatzc1a050a2017-10-10 15:49:28 -0700807/**
808 * Logs when a job scheduler job state changes.
809 *
810 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700811 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700812 */
813message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800814 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700815
816 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800817 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700818
819 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800820 FINISHED = 0;
821 STARTED = 1;
822 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700823 }
824 optional State state = 3;
825
Tej Singh33a412b2018-03-16 18:43:59 -0700826 // The reason a job has stopped.
827 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700828 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700829 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100830
831 // The standby bucket of the app that scheduled the job. These match the framework constants
832 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
833 // already assigned 0.
834 enum Bucket {
835 UNKNOWN = -1;
836 ACTIVE = 0;
837 WORKING_SET = 1;
838 FREQUENT = 2;
839 RARE = 3;
840 NEVER = 4;
841 }
842 optional Bucket standby_bucket = 5 [default = UNKNOWN];
843
844 // The job id (as assigned by the app).
845 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700846}
847
848/**
849 * Logs when the audio state changes.
850 *
851 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700852 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700853 */
854message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800855 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700856
857 enum State {
858 OFF = 0;
859 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700860 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
861 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700862 }
863 optional State state = 2;
864}
865
866/**
867 * Logs when the video codec state changes.
868 *
869 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700870 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700871 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800872message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800873 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700874
875 enum State {
876 OFF = 0;
877 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700878 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
879 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700880 }
881 optional State state = 2;
882}
883
884/**
885 * Logs when the flashlight state changes.
886 *
887 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700888 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700889 */
890message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800891 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700892
893 enum State {
894 OFF = 0;
895 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700896 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
897 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700898 }
899 optional State state = 2;
900}
901
902/**
903 * Logs when the camera state changes.
904 *
905 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700906 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700907 */
908message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800909 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700910
911 enum State {
912 OFF = 0;
913 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700914 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
915 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700916 }
917 optional State state = 2;
918}
919
920/**
921 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000922 *
923 * Logged from:
924 * TODO
925 */
Bookatzd6746242017-10-24 18:39:35 -0700926message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800927 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000928
Bookatz1a1b0462018-01-12 11:47:03 -0800929 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
930 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700931 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700932
933 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
934 optional string tag = 3;
935
936 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800937 RELEASE = 0;
938 ACQUIRE = 1;
939 CHANGE_RELEASE = 2;
940 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700941 }
942 optional State state = 4;
943}
944
945/**
Bookatzc1a050a2017-10-10 15:49:28 -0700946 * Logs when a partial wakelock is considered 'long' (over 1 min).
947 *
948 * Logged from:
949 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
950 */
951message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800952 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700953
Yao Chend54f9dd2017-10-17 17:37:48 +0000954 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
955 optional string tag = 2;
956
Bookatzc1a050a2017-10-10 15:49:28 -0700957 // TODO: I have no idea what this is.
958 optional string history_tag = 3;
959
960 enum State {
961 OFF = 0;
962 ON = 1;
963 }
964 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000965}
966
Bookatzc1a050a2017-10-10 15:49:28 -0700967/**
Bookatza66083f2018-09-20 17:24:00 -0700968 * Logs when the device is interactive, according to the PowerManager Notifier.
969 *
970 * Logged from:
971 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
972 */
973message InteractiveStateChanged {
974 enum State {
975 OFF = 0;
976 ON = 1;
977 }
978 optional State state = 1;
979}
980
981/**
Bookatzc1a050a2017-10-10 15:49:28 -0700982 * Logs Battery Saver state change.
983 *
984 * Logged from:
985 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
986 */
987message BatterySaverModeStateChanged {
988 enum State {
989 OFF = 0;
990 ON = 1;
991 }
992 optional State state = 1;
993}
994
995/**
996 * Logs Doze mode state change.
997 *
998 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800999 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -07001000 */
1001message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001002 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001003}
1004
1005
1006/**
1007 * Logs state change of Doze mode including maintenance windows.
1008 *
1009 * Logged from:
1010 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1011 */
1012message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001013 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001014}
1015
1016/**
1017 * Logs screen brightness level.
1018 *
1019 * Logged from:
1020 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1021 */
1022message ScreenBrightnessChanged {
1023 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1024 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001025}
1026
1027/**
1028 * Logs battery level (percent full, from 0 to 100).
1029 *
1030 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001031 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001032 */
1033message BatteryLevelChanged {
1034 // Battery level. Should be in [0, 100].
1035 optional int32 battery_level = 1;
1036}
1037
1038/**
1039 * Logs change in charging status of the device.
1040 *
1041 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001042 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001043 */
1044message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001045 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1046 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001047}
1048
1049/**
1050 * Logs whether the device is plugged in, and what power source it is using.
1051 *
1052 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001053 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001054 */
1055message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001056 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1057 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001058}
1059
Bookatz8c6571b2017-10-24 15:04:41 -07001060/**
1061 * Logs when an app's wakeup alarm fires.
1062 *
1063 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001064 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001065 */
1066message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001067 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001068
1069 // Name of the wakeup alarm.
1070 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001071
1072 // Name of source package (for historical reasons, since BatteryStats tracked it).
1073 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001074
1075 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1076 enum Bucket {
1077 UNKNOWN = 0;
1078 EXEMPTED = 5;
1079 ACTIVE = 10;
1080 WORKING_SET = 20;
1081 FREQUENT = 30;
1082 RARE = 40;
1083 NEVER = 50;
1084 }
1085 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1086 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001087}
1088
1089/**
1090 * Logs when an an app causes the mobile radio to change state.
1091 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1092 *
1093 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001094 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001095 */
1096message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001097 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001098
Bookatz1a1b0462018-01-12 11:47:03 -08001099 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1100 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001101}
1102
1103/**
1104 * Logs when an an app causes the wifi radio to change state.
1105 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1106 *
1107 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001108 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001109 */
1110message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001111 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001112
Bookatz1a1b0462018-01-12 11:47:03 -08001113 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1114 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001115}
1116
1117/**
1118 * Logs kernel wakeup reasons and aborts.
1119 *
1120 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001121 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001122 */
1123message KernelWakeupReported {
1124 // Name of the kernel wakeup reason (or abort).
1125 optional string wakeup_reason_name = 1;
1126
1127 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001128 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001129}
1130
1131/**
Bookatzda1798c2018-12-13 14:16:00 -08001132 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001133 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001134 *
1135 * Logged from:
1136 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1137 */
1138message WifiEnabledStateChanged {
1139 enum State {
1140 OFF = 0;
1141 ON = 1;
1142 }
1143 optional State state = 1;
1144}
1145
1146/**
1147 * 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 -08001148 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1149 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001150 *
1151 * Logged from:
1152 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1153 */
1154message WifiRunningStateChanged {
1155 repeated AttributionNode attribution_node = 1;
1156
1157 enum State {
1158 OFF = 0;
1159 ON = 1;
1160 }
1161 optional State state = 2;
1162}
1163
1164/**
Bookatze5885242017-10-24 20:10:31 -07001165 * Logs wifi locks held by an app.
1166 *
1167 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001168 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001169 */
1170message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001171 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001172
1173 enum State {
1174 OFF = 0;
1175 ON = 1;
1176 }
1177 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001178
1179 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1180 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001181}
1182
1183/**
1184 * Logs wifi signal strength changes.
1185 *
1186 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001187 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001188 */
1189message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001190 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1191 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001192}
1193
1194/**
1195 * Logs wifi scans performed by an app.
1196 *
1197 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001198 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001199 */
1200message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001201 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001202
1203 enum State {
1204 OFF = 0;
1205 ON = 1;
1206 }
1207 optional State state = 2;
1208}
1209
1210/**
Tej Singh4503e102018-01-04 14:35:01 -08001211 * Logs wifi multicast locks held by an app
1212 *
1213 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001214 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001215 */
1216message WifiMulticastLockStateChanged {
1217 repeated AttributionNode attribution_node = 1;
1218
1219 enum State {
1220 OFF = 0;
1221 ON = 1;
1222 }
1223 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001224
1225 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001226}
1227
1228/**
Tej Singh1ea42892018-01-19 09:27:00 -08001229 * Logs shutdown reason and duration on next boot.
1230 *
1231 * Logged from:
1232 * frameworks/base/core/java/com/android/server/BootReceiver.java
1233 */
1234message ShutdownSequenceReported {
1235 // True if shutdown is for a reboot. Default: false if we do not know.
1236 optional bool reboot = 1;
1237
1238 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1239 optional string reason = 2;
1240
1241 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1242 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001243 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001244
1245 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001246 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001247}
1248
Tej Singh6483ea42018-01-25 17:45:49 -08001249
1250/**
1251 * Logs boot reason and duration.
1252 *
1253 * Logged from:
1254 * system/core/bootstat/bootstat.cpp
1255 */
1256message BootSequenceReported {
1257 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1258 // Default: "<EMPTY>" if not available.
1259 optional string bootloader_reason = 1;
1260
1261 // Reason for system boot. Eg. bootloader, reboot,userrequested
1262 // Default: "<EMPTY>" if not available.
1263 optional string system_reason = 2;
1264
1265 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001266 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001267
1268 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001269 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001270
1271 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001272 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001273
1274 // Time since last boot in ms. Default: 0 if not available.
1275 optional int64 time_since_last_boot = 6;
1276}
1277
Tej Singhc477d9c2018-02-05 18:31:39 -08001278
1279/**
1280 * Logs call state and disconnect cause (if applicable).
1281 *
1282 * Logged from:
1283 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1284 */
1285message CallStateChanged {
1286 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1287 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1288 optional android.telecom.CallStateEnum call_state = 1;
1289
1290 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1291 // This value is only applicable when the call_state is DISCONNECTED, and
1292 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1293 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1294 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1295
1296 // True if the call is self-managed, which are apps that use the
1297 // telecom infrastructure to make their own calls.
1298 optional bool self_managed = 3;
1299
1300 // True if call is external. External calls are calls on connected Wear
1301 // devices but show up in Telecom so the user can pull them onto the device.
1302 optional bool external_call = 4;
1303}
1304
Tej Singh1ea42892018-01-19 09:27:00 -08001305/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001306 * Logs keyguard state. The keyguard is the lock screen.
1307 *
1308 * Logged from:
1309 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1310 */
1311message KeyguardStateChanged {
1312 enum State {
1313 UNKNOWN = 0;
1314 // The keyguard is hidden when the phone is unlocked.
1315 HIDDEN = 1;
1316 // The keyguard is shown when the phone is locked (screen turns off).
1317 SHOWN= 2;
1318 // The keyguard is occluded when something is overlaying the keyguard.
1319 // Eg. Opening the camera while on the lock screen.
1320 OCCLUDED = 3;
1321 }
1322 optional State state = 1;
1323}
1324
1325/**
1326 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1327 * prompts the user to enter a password (pattern, pin, etc).
1328 *
1329 * Logged from:
1330 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1331 */
1332
1333message KeyguardBouncerStateChanged {
1334 enum State {
1335 UNKNOWN = 0;
1336 // Bouncer is hidden, either as a result of successfully entering the
1337 // password, screen timing out, or user going back to lock screen.
1338 HIDDEN = 1;
1339 // This is when the user is being prompted to enter the password.
1340 SHOWN = 2;
1341 }
1342 optional State state = 1;
1343}
1344
1345/**
1346 * Logs the result of entering a password into the keyguard bouncer.
1347 *
1348 * Logged from:
1349 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1350 */
1351message KeyguardBouncerPasswordEntered {
1352 enum BouncerResult {
1353 UNKNOWN = 0;
1354 // The password entered was incorrect.
1355 FAILURE = 1;
1356 // The password entered was correct.
1357 SUCCESS = 2;
1358 }
1359 optional BouncerResult result = 1;
1360}
1361
Tej Singha883b372018-02-15 11:30:01 -08001362/*
1363 * Logs changes to the configuration of the device. The configuration is defined
1364 * in frameworks/base/core/java/android/content/res/Configuration.java
1365 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1366 * Please go there to interpret the possible values each field can be.
1367 *
1368 * Logged from:
1369 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1370 */
1371message ResourceConfigurationChanged {
1372 // Bit mask of color capabilities of the screen.
1373 // Contains information about the color gamut and hdr mode of the screen.
1374 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001375 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001376
1377 // The target screen density being rendered to.
1378 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001379 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001380
1381 // Current user preference for the scaling factor for fonts,
1382 // relative to the base density scaling.
1383 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001384 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001385
1386 // Flag indicating whether the hard keyboard is hidden.
1387 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001388 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001389
1390 // The type of keyboard attached to the device.
1391 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1392 optional int32 keyboard = 5;
1393
1394 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1395 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001396 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001397
1398 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1399 // 0 if undefined.
1400 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1401 optional int32 mcc = 7;
1402
1403 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1404 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1405 // MNC_ZERO symbol defined in Configuration.java.
1406 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1407 optional int32 mnc = 8;
1408
1409 // The kind of navigation available on the device.
1410 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1411 optional int32 navigation = 9;
1412
1413 // Flag indicating whether the navigation is available.
1414 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001415 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001416
1417 // Overall orientation of the screen.
1418 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1419 optional int32 orientation = 11;
1420
1421 // The current height of the available screen space, in dp units.
1422 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001423 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001424
1425 // Bit mask of overall layout of the screen.
1426 // Contains information about screen size, whether the screen is wider/taller
1427 // than normal, whether the screen layout is right-tl-left or left-to-right,
1428 // and whether the screen has a rounded shape.
1429 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001430 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001431
1432 // Current width of the available screen space, in dp units.
1433 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001434 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001435
1436 // The smallest screen size an application will see in normal operation.
1437 // This is the smallest value of both screenWidthDp and screenHeightDp
1438 // in portrait and landscape.
1439 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001440 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001441
1442 // The type of touch screen attached to the device.
1443 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1444 optional int32 touchscreen = 16;
1445
1446 // Bit mask of the ui mode.
1447 // Contains information about the overall ui mode of the device.
1448 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1449 // Also contains information about whether the device is in night mode.
1450 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001451 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001452}
1453
Tej Singheee317b2018-03-07 19:28:05 -08001454
1455/**
1456 * Logs changes in the connection state of the mobile radio.
1457 *
1458 * Logged from:
1459 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1460 */
1461message MobileConnectionStateChanged {
1462 // States are from the state machine DataConnection.java.
1463 enum State {
1464 UNKNOWN = 0;
1465 // The connection is inactive, or disconnected.
1466 INACTIVE = 1;
1467 // The connection is being activated, or connecting.
1468 ACTIVATING = 2;
1469 // The connection is active, or connected.
1470 ACTIVE = 3;
1471 // The connection is disconnecting.
1472 DISCONNECTING = 4;
1473 // The connection is disconnecting after creating a connection.
1474 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1475 }
1476 optional State state = 1;
1477 // For multi-sim phones, this distinguishes between the sim cards.
1478 optional int32 sim_slot_index = 2;
1479 // Used to identify the connection. Starts at 0 and increments by 1 for
1480 // every new network created. Resets whenever the device reboots.
1481 optional int32 data_connection_id = 3;
1482 // A bitmask for the capabilities of this connection.
1483 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1484 // Default value (if we have no information): 0
1485 optional int64 capabilities = 4;
1486 // If this connection has internet.
1487 // This just checks if the DEFAULT bit of capabilities is set.
1488 optional bool has_internet = 5;
1489}
1490
1491/**
1492 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1493 *
1494 * Logged from:
1495 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1496 */
1497message MobileRadioTechnologyChanged {
1498 optional android.telephony.NetworkTypeEnum state = 1;
1499 // For multi-sim phones, this distinguishes between the sim cards.
1500 optional int32 sim_slot_index = 2;
1501}
1502
Andrew Chantb56388b2018-03-22 21:07:33 -07001503/**
1504 * Logs the VID and PID of any connected USB devices.
1505 *
1506 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1507 *
1508 * Logged by Vendor.
1509 */
1510message UsbDeviceAttached {
1511 optional int32 vid = 1;
1512 optional int32 pid = 2;
1513 optional bool has_audio = 3;
1514 optional bool has_hid = 4;
1515 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001516 enum State {
1517 STATE_DISCONNECTED = 0;
1518 STATE_CONNECTED = 1;
1519 }
1520 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001521 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001522}
1523
Tej Singheee317b2018-03-07 19:28:05 -08001524
Tej Singhdd7bd352018-02-09 19:33:15 -08001525/**
Tej Singh5d991e12018-03-09 19:48:11 -08001526 * Logs when Bluetooth is enabled and disabled.
1527 *
1528 * Logged from:
1529 * services/core/java/com/android/server/BluetoothManagerService.java
1530 */
1531message BluetoothEnabledStateChanged {
1532 repeated AttributionNode attribution_node = 1;
1533 // Whether or not bluetooth is enabled on the device.
1534 enum State {
1535 UNKNOWN = 0;
1536 ENABLED = 1;
1537 DISABLED = 2;
1538 }
1539 optional State state = 2;
1540 // The reason for being enabled/disabled.
1541 // Eg. Airplane mode, crash, application request.
1542 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1543 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001544 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001545}
1546
1547/**
Jack Hed9837c82019-01-09 01:19:13 -08001548 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001549 *
1550 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001551 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1552 *
1553 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001554 */
1555message BluetoothConnectionStateChanged {
1556 // The state of the connection.
1557 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1558 optional android.bluetooth.ConnectionStateEnum state = 1;
1559 // An identifier that can be used to match connect and disconnect events.
1560 // Currently is last two bytes of a hash of a device level ID and
1561 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001562 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001563 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001564 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1565 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001566 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001567 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001568 // An identifier that can be used to match events for this device.
1569 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1570 // Salt: Randomly generated 256 bit value
1571 // Hash algorithm: HMAC-SHA256
1572 // Size: 32 byte
1573 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001574 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001575}
1576
1577/**
1578 * Logs when a Bluetooth device connects and disconnects over ACL
1579 *
1580 * Logged from:
1581 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1582 *
1583 * Next Tag: 3
1584 */
1585message BluetoothAclConnectionStateChanged {
1586 // An identifier that can be used to match events for this device.
1587 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1588 // Salt: Randomly generated 256 bit value
1589 // Hash algorithm: HMAC-SHA256
1590 // Size: 32 byte
1591 // Default: null or empty if the device identifier is not known
1592 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1593 // The state of the connection.
1594 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1595 optional android.bluetooth.ConnectionStateEnum state = 2;
1596}
1597
1598/**
1599 * Logs when a Bluetooth device connects and disconnects over SCO
1600 *
1601 * Logged from:
1602 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1603 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1604 *
1605 * Next Tag: 4
1606 */
1607message BluetoothScoConnectionStateChanged {
1608 // An identifier that can be used to match events for this device.
1609 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1610 // Salt: Randomly generated 256 bit value
1611 // Hash algorithm: HMAC-SHA256
1612 // Size: 32 byte
1613 // Default: null or empty if the device identifier is not known
1614 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1615 // The state of the connection.
1616 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1617 optional android.bluetooth.ConnectionStateEnum state = 2;
1618 // Codec used for this SCO connection
1619 // Default: UNKNOWN
1620 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001621}
1622
Jack Hec27040a2019-01-09 20:54:41 -08001623/**
1624 * Logged when active device of a profile changes
1625 *
1626 * Logged from:
1627 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1628 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1629 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1630 */
1631message BluetoothActiveDeviceChanged {
1632 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1633 // From android.bluetooth.BluetoothProfile
1634 optional int32 bt_profile = 1;
1635 // An identifier that can be used to match events for this new active device.
1636 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1637 // Salt: Randomly generated 256 bit value
1638 // Hash algorithm: HMAC-SHA256
1639 // Size: 32 byte
1640 // Default: null or empty if there is no active device for this profile
1641 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1642}
1643
Jack Heab86dbd22018-12-18 15:43:27 -08001644// Logs when there is an event affecting Bluetooth device's link layer connection.
1645// - This event is triggered when there is a related HCI command or event
1646// - Users of this metrics can deduce Bluetooth device's connection state from these events
1647// - HCI commands are logged before the command is sent, after receiving command status, and after
1648// receiving command complete
1649// - HCI events are logged when they arrive
1650//
1651// Low level log from system/bt
1652//
1653// Bluetooth classic commands:
1654// - CMD_CREATE_CONNECTION
1655// - CMD_DISCONNECT
1656// - CMD_CREATE_CONNECTION_CANCEL
1657// - CMD_ACCEPT_CONNECTION_REQUEST
1658// - CMD_REJECT_CONNECTION_REQUEST
1659// - CMD_SETUP_ESCO_CONNECTION
1660// - CMD_ACCEPT_ESCO_CONNECTION
1661// - CMD_REJECT_ESCO_CONNECTION
1662// - CMD_ENH_SETUP_ESCO_CONNECTION
1663// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1664//
1665// Bluetooth low energy commands:
1666// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1667// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1668// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1669// - CMD_BLE_CLEAR_WHITE_LIST
1670// - CMD_BLE_ADD_WHITE_LIST
1671// - CMD_BLE_REMOVE_WHITE_LIST
1672//
1673// Bluetooth classic events:
1674// - EVT_CONNECTION_COMP
1675// - EVT_CONNECTION_REQUEST
1676// - EVT_DISCONNECTION_COMP
1677// - EVT_ESCO_CONNECTION_COMP
1678// - EVT_ESCO_CONNECTION_CHANGED
1679//
1680// Bluetooth low energy meta events:
1681// - BLE_EVT_CONN_COMPLETE_EVT
1682// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1683//
1684// Next tag: 10
1685message BluetoothLinkLayerConnectionEvent {
1686 // An identifier that can be used to match events for this device.
1687 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1688 // Salt: Randomly generated 256 bit value
1689 // Hash algorithm: HMAC-SHA256
1690 // Size: 32 byte
1691 // Default: null or empty if the device identifier is not known
1692 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1693 // Connection handle of this connection if available
1694 // Range: 0x0000 - 0x0EFF (12 bits)
1695 // Default: 0xFFFF if the handle is unknown
1696 optional int32 connection_handle = 2;
1697 // Direction of the link
1698 // Default: DIRECTION_UNKNOWN
1699 optional android.bluetooth.DirectionEnum direction = 3;
1700 // Type of this link
1701 // Default: LINK_TYPE_UNKNOWN
1702 optional android.bluetooth.LinkTypeEnum type = 4;
1703
1704 // Reason metadata for this link layer connection event, rules for interpretation:
1705 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1706 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1707 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1708 // set and valid, ignore hci_ble_event
1709
1710 // HCI command associated with this event
1711 // Default: CMD_UNKNOWN
1712 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1713 // HCI event associated with this event
1714 // Default: EVT_UNKNOWN
1715 optional android.bluetooth.hci.EventEnum hci_event = 6;
1716 // HCI BLE meta event associated with this event
1717 // Default: BLE_EVT_UNKNOWN
1718 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1719 // HCI command status code if this is triggerred by hci_cmd
1720 // Default: STATUS_UNKNOWN
1721 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1722 // HCI reason code associated with this event
1723 // Default: STATUS_UNKNOWN
1724 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1725}
1726
Howard Roe103fe22019-01-17 16:52:16 -08001727/**
1728 * Logs when a module is rolled back by Watchdog.
1729 *
1730 * Logged from: Rollback Manager
1731 */
1732message WatchdogRollbackOccurred {
1733 enum RollbackType {
1734 UNKNOWN = 0;
1735 ROLLBACK_INITIATE = 1;
1736 ROLLBACK_SUCCESS = 2;
1737 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001738 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001739 }
1740 optional RollbackType rollback_type = 1;
1741
1742 optional string package_name = 2;
1743
1744 optional int32 package_version_code = 3;
1745}
1746
Jack Hec27040a2019-01-09 20:54:41 -08001747/**
1748 * Logs when there is a change in Bluetooth A2DP playback state
1749 *
1750 * Logged from:
1751 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1752 */
1753message BluetoothA2dpPlaybackStateChanged {
1754 // An identifier that can be used to match events for this device.
1755 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1756 // Salt: Randomly generated 256 bit value
1757 // Hash algorithm: HMAC-SHA256
1758 // Size: 32 byte
1759 // Default: null or empty if the device identifier is not known
1760 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1761 // Current playback state
1762 // Default: PLAYBACK_STATE_UNKNOWN
1763 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1764 // Current audio coding mode
1765 // Default: AUDIO_CODING_MODE_UNKNOWN
1766 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1767}
1768
1769/**
1770 * Logs when there is a change in A2DP codec config for a particular remote device
1771 *
1772 * Logged from:
1773 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1774 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1775 */
1776message BluetoothA2dpCodecConfigChanged {
1777 // An identifier that can be used to match events for this device.
1778 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1779 // Salt: Randomly generated 256 bit value
1780 // Hash algorithm: HMAC-SHA256
1781 // Size: 32 byte
1782 // Default: null or empty if the device identifier is not known
1783 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1784 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1785 // Default SOURCE_CODEC_TYPE_INVALID
1786 optional int32 codec_type = 2;
1787 // Codec priroity, the higher the more preferred, -1 for disabled
1788 // Default: CODEC_PRIORITY_DEFAULT
1789 optional int32 codec_priority = 3;
1790 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1791 // Default: SAMPLE_RATE_NONE
1792 optional int32 sample_rate = 4;
1793 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1794 // Default: BITS_PER_SAMPLE_NONE
1795 optional int32 bits_per_sample = 5;
1796 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1797 // Default: CHANNEL_MODE_NONE
1798 optional int32 channel_mode = 6;
1799 // Codec specific values
1800 // Default 0
1801 optional int64 codec_specific_1 = 7;
1802 optional int64 codec_specific_2 = 8;
1803 optional int64 codec_specific_3 = 9;
1804 optional int64 codec_specific_4 = 10;
1805}
1806
1807/**
1808 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1809 * Each codec's capability is logged separately due to statsd restriction
1810 *
1811 * Logged from:
1812 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1813 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1814 */
1815message BluetoothA2dpCodecCapabilityChanged {
1816 // An identifier that can be used to match events for this device.
1817 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1818 // Salt: Randomly generated 256 bit value
1819 // Hash algorithm: HMAC-SHA256
1820 // Size: 32 byte
1821 // Default: null or empty if the device identifier is not known
1822 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1823 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1824 // Default SOURCE_CODEC_TYPE_INVALID
1825 optional int32 codec_type = 2;
1826 // Codec priroity, the higher the more preferred, -1 for disabled
1827 // Default: CODEC_PRIORITY_DEFAULT
1828 optional int32 codec_priority = 3;
1829 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1830 // in BluetoothCodecConfig
1831 // Default: empty and SAMPLE_RATE_NONE for individual item
1832 optional int32 sample_rate = 4;
1833 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1834 // in BluetoothCodecConfig
1835 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1836 optional int32 bits_per_sample = 5;
1837 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1838 // BluetoothCodecConfig
1839 // Default: empty and CHANNEL_MODE_NONE for individual item
1840 optional int32 channel_mode = 6;
1841 // Codec specific values
1842 // Default 0
1843 optional int64 codec_specific_1 = 7;
1844 optional int64 codec_specific_2 = 8;
1845 optional int64 codec_specific_3 = 9;
1846 optional int64 codec_specific_4 = 10;
1847}
1848
1849/**
1850 * Logs when A2DP failed to read from PCM source.
1851 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1852 *
1853 * Logged from:
1854 * system/bt
1855 */
1856message BluetoothA2dpAudioUnderrunReported {
1857 // An identifier that can be used to match events for this device.
1858 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1859 // Salt: Randomly generated 256 bit value
1860 // Hash algorithm: HMAC-SHA256
1861 // Size: 32 byte
1862 // Default: null or empty if the device identifier is not known
1863 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1864 // Encoding interval in nanoseconds
1865 // Default: 0
1866 optional int64 encoding_interval_nanos = 2;
1867 // Number of bytes of PCM data that could not be read from the source
1868 // Default: 0
1869 optional int32 num_missing_pcm_bytes = 3;
1870}
1871
1872/**
1873 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1874 * buffer queue is full and we have to drop data
1875 *
1876 * Logged from:
1877 * system/bt
1878 */
1879message BluetoothA2dpAudioOverrunReported {
1880 // An identifier that can be used to match events for this device.
1881 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1882 // Salt: Randomly generated 256 bit value
1883 // Hash algorithm: HMAC-SHA256
1884 // Size: 32 byte
1885 // Default: null or empty if the device identifier is not known
1886 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1887 // Encoding interval in nanoseconds
1888 // Default: 0
1889 optional int64 encoding_interval_nanos = 2;
1890 // Number of buffers dropped in this event
1891 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1892 // Default: 0
1893 optional int32 num_dropped_buffers = 3;
1894 // Number of encoded buffers dropped in this event
1895 // Default 0
1896 optional int32 num_dropped_encoded_frames = 4;
1897 // Number of encoded bytes dropped in this event
1898 // Default: 0
1899 optional int32 num_dropped_encoded_bytes = 5;
1900}
1901
1902/**
1903 * Logs when we receive reports regarding a device's RSSI value
1904 *
1905 * Logged from:
1906 * system/bt
1907 */
1908message BluetoothDeviceRssiReported {
1909 // An identifier that can be used to match events for this device.
1910 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1911 // Salt: Randomly generated 256 bit value
1912 // Hash algorithm: HMAC-SHA256
1913 // Size: 32 byte
1914 // Default: null or empty if the device identifier is not known
1915 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1916 // Connection handle of this connection if available
1917 // Range: 0x0000 - 0x0EFF (12 bits)
1918 // Default: 0xFFFF if the handle is unknown
1919 optional int32 connection_handle = 2;
1920 // HCI command status code if this is triggerred by hci_cmd
1921 // Default: STATUS_UNKNOWN
1922 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1923 // BR/EDR
1924 // Range: -128 ≤ N ≤ 127 (signed integer)
1925 // Units: dB
1926 // LE:
1927 // Range: -127 to 20, 127 (signed integer)
1928 // Units: dBm
1929 // Invalid when an out of range value is reported
1930 optional int32 rssi = 4;
1931}
1932
1933/**
1934 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1935 *
1936 * Logged from:
1937 * system/bt
1938 */
1939message BluetoothDeviceFailedContactCounterReported {
1940 // An identifier that can be used to match events for this device.
1941 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1942 // Salt: Randomly generated 256 bit value
1943 // Hash algorithm: HMAC-SHA256
1944 // Size: 32 byte
1945 // Default: null or empty if the device identifier is not known
1946 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1947 // Connection handle of this connection if available
1948 // Range: 0x0000 - 0x0EFF (12 bits)
1949 // Default: 0xFFFF if the handle is unknown
1950 optional int32 connection_handle = 2;
1951 // HCI command status code if this is triggerred by hci_cmd
1952 // Default: STATUS_UNKNOWN
1953 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1954 // Number of consecutive failed contacts for a connection corresponding to the Handle
1955 // Range: uint16_t, 0-0xFFFF
1956 // Default: 0xFFFFF
1957 optional int32 failed_contact_counter = 4;
1958}
1959
1960/**
1961 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1962 *
1963 * Logged from:
1964 * system/bt
1965 */
1966message BluetoothDeviceTxPowerLevelReported {
1967 // An identifier that can be used to match events for this device.
1968 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1969 // Salt: Randomly generated 256 bit value
1970 // Hash algorithm: HMAC-SHA256
1971 // Size: 32 byte
1972 // Default: null or empty if the device identifier is not known
1973 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1974 // Connection handle of this connection if available
1975 // Range: 0x0000 - 0x0EFF (12 bits)
1976 // Default: 0xFFFF if the handle is unknown
1977 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001978 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001979 // Default: STATUS_UNKNOWN
1980 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1981 // Range: -30 ≤ N ≤ 20
1982 // Units: dBm
1983 // Invalid when an out of range value is reported
1984 optional int32 transmit_power_level = 4;
1985}
Jack Heab86dbd22018-12-18 15:43:27 -08001986
Tej Singh5d991e12018-03-09 19:48:11 -08001987/**
Jack He1021a612019-01-20 21:22:46 -08001988 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1989 * receiving an HCI command from the host
1990 *
1991 * Logged from: system/bt
1992 */
1993message BluetoothHciTimeoutReported {
1994 // HCI command associated with this event
1995 // Default: CMD_UNKNOWN
1996 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1997}
1998
1999/**
2000 * Logs when we receive Bluetooth Link Quality Report event from the controller
2001 * See Android Bluetooth HCI specification for more details
2002 *
2003 * Note: all count and bytes field are counted since last event
2004 *
2005 * Logged from: system/bt
2006 */
2007message BluetoothQualityReportReported {
2008 // Quality report ID
2009 // Original type: uint8_t
2010 // Default: BQR_ID_UNKNOWN
2011 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2012 // Packet type of the connection
2013 // Original type: uint8_t
2014 // Default: BQR_PACKET_TYPE_UNKNOWN
2015 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2016 // Connection handle of the connection
2017 // Original type: uint16_t
2018 optional int32 connection_handle = 3;
2019 // Performing Role for the connection
2020 // Original type: uint8_t
2021 optional int32 connection_role = 4;
2022 // Current Transmit Power Level for the connection. This value is the same as the controller's
2023 // response to the HCI_Read_Transmit_Power_Level HCI command
2024 // Original type: uint8_t
2025 optional int32 tx_power_level = 5;
2026 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2027 // absolute receiver signal strength value
2028 // Original type: int8_t
2029 optional int32 rssi = 6;
2030 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2031 // channels used by the link currently
2032 // Original type: uint8_t
2033 optional int32 snr = 7;
2034 // Indicates the number of unused channels in AFH_channel_map
2035 // Original type: uint8_t
2036 optional int32 unused_afh_channel_count = 8;
2037 // Indicates the number of the channels which are interfered and quality is bad but are still
2038 // selected for AFH
2039 // Original type: uint8_t
2040 optional int32 afh_select_unideal_channel_count = 9;
2041 // Current Link Supervision Timeout Setting
2042 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2043 // Original type: uint16_t
2044 optional int32 lsto = 10;
2045 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2046 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2047 // 0x01 (Piconet Clock)
2048 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2049 // Original type: uint32_t
2050 optional int64 connection_piconet_clock = 11;
2051 // The count of retransmission
2052 // Original type: uint32_t
2053 optional int64 retransmission_count = 12;
2054 // The count of no RX
2055 // Original type: uint32_t
2056 optional int64 no_rx_count = 13;
2057 // The count of NAK (Negative Acknowledge)
2058 // Original type: uint32_t
2059 optional int64 nak_count = 14;
2060 // Controller timestamp of last TX ACK
2061 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2062 // Original type: uint32_t
2063 optional int64 last_tx_ack_timestamp = 15;
2064 // The count of Flow-off (STOP)
2065 // Original type: uint32_t
2066 optional int64 flow_off_count = 16;
2067 // Controller timestamp of last Flow-on (GO)
2068 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2069 // Original type: uint32_t
2070 optional int64 last_flow_on_timestamp = 17;
2071 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2072 // Original type: uint32_t
2073 optional int64 buffer_overflow_bytes = 18;
2074 // Buffer underflow count (in byte) since last event
2075 // Original type: uint32_t
2076 optional int64 buffer_underflow_bytes = 19;
2077}
2078
2079/**
2080 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2081 *
2082 * Notes:
2083 * - Each event can be partially filled as we might learn different pieces of device
2084 * information at different time
2085 * - Multiple device info events can be combined to give more complete picture
2086 * - When multiple device info events tries to describe the same information, the
2087 * later one wins
2088 *
2089 * Logged from:
2090 * packages/apps/Bluetooth
2091 */
Jack Heaea26982019-04-04 11:19:48 -07002092message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002093 // An identifier that can be used to match events for this device.
2094 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2095 // Salt: Randomly generated 256 bit value
2096 // Hash algorithm: HMAC-SHA256
2097 // Size: 32 byte
2098 // Default: null or empty if the device identifier is not known
2099 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2100 // Where is this device info obtained from
2101 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2102 // Name of the data source
2103 // For EXTERNAL: package name of the data source
2104 // For INTERNAL: null for general case, component name otherwise
2105 optional string source_name = 3;
2106 // Name of the manufacturer of this device
2107 optional string manufacturer = 4;
2108 // Model of this device
2109 optional string model = 5;
2110 // Hardware version of this device
2111 optional string hardware_version = 6;
2112 // Software version of this device
2113 optional string software_version = 7;
2114}
2115
2116/**
2117 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2118 * device, as documented by the Bluetooth Core HCI specification
2119 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2120 * Vol 2, Part E, Page 1118
2121 *
2122 * Logged from:
2123 * system/bt
2124 */
2125message BluetoothRemoteVersionInfoReported {
2126 // Connection handle of the connection
2127 // Original type: uint16_t
2128 optional int32 connection_handle = 1;
2129 // HCI command status code
2130 // Default: STATUS_UNKNOWN
2131 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2132 // 1 byte Version of current LMP in the remote controller
2133 optional int32 lmp_version = 3;
2134 // 2 bytes LMP manufacturer code of the remote controller
2135 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2136 optional int32 lmp_manufacturer_code = 4;
2137 // 4 bytes subversion of the LMP in the remote controller
2138 optional int32 lmp_subversion = 5;
2139}
2140
2141/**
2142 * Logs when certain Bluetooth SDP attributes are discovered
2143 * Constant definitions are from:
2144 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2145 *
2146 * Current logged attributes:
2147 * - BluetoothProfileDescriptorList
2148 * - Supported Features Bitmask
2149 *
2150 * Logged from:
2151 * system/bt
2152 */
2153message BluetoothSdpAttributeReported {
2154 // An identifier that can be used to match events for this device.
2155 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2156 // Salt: Randomly generated 256 bit value
2157 // Hash algorithm: HMAC-SHA256
2158 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2159 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2160 // Original type: uint16_t
2161 optional int32 protocol_uuid = 2;
2162 // Short form UUIDs used to identify Bluetooth SDP attribute types
2163 // Original type: uint16_t
2164 optional int32 attribute_id = 3;
2165 // Attribute value for the particular attribute
2166 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2167}
2168
2169/**
2170 * Logs when bond state of a Bluetooth device changes
2171 *
2172 * Logged from:
2173 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2174 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2175 */
2176message BluetoothBondStateChanged {
2177 // An identifier that can be used to match events for this device.
2178 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2179 // Salt: Randomly generated 256 bit value
2180 // Hash algorithm: HMAC-SHA256
2181 // Size: 32 byte
2182 // Default: null or empty if the device identifier is not known
2183 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2184 // Preferred transport type to remote dual mode device
2185 // Default: TRANSPORT_AUTO means no preference
2186 optional android.bluetooth.TransportTypeEnum transport = 2;
2187 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2188 // Default: UNKNOWN
2189 optional android.bluetooth.DeviceTypeEnum type = 3;
2190 // Current bond state (NONE, BONDING, BONDED)
2191 // Default: BOND_STATE_UNKNOWN
2192 optional android.bluetooth.BondStateEnum bond_state = 4;
2193 // Bonding sub state
2194 // Default: BOND_SUB_STATE_UNKNOWN
2195 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2196 // Unbond Reason
2197 // Default: UNBOND_REASON_UNKNOWN
2198 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2199}
2200
2201/**
2202 * Logs there is an event related Bluetooth classic pairing
2203 *
2204 * Logged from:
2205 * system/bt
2206 */
2207message BluetoothClassicPairingEventReported {
2208 // An identifier that can be used to match events for this device.
2209 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2210 // Salt: Randomly generated 256 bit value
2211 // Hash algorithm: HMAC-SHA256
2212 // Size: 32 byte
2213 // Default: null or empty if the device identifier is not known
2214 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2215 // Connection handle of this connection if available
2216 // Range: 0x0000 - 0x0EFF (12 bits)
2217 // Default: 0xFFFF if the handle is unknown
2218 optional int32 connection_handle = 2;
2219 // HCI command associated with this event
2220 // Default: CMD_UNKNOWN
2221 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2222 // HCI event associated with this event
2223 // Default: EVT_UNKNOWN
2224 optional android.bluetooth.hci.EventEnum hci_event = 4;
2225 // HCI command status code if this is triggerred by hci_cmd
2226 // Default: STATUS_UNKNOWN
2227 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2228 // HCI reason code associated with this event
2229 // Default: STATUS_UNKNOWN
2230 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002231 // A status value related to this specific event
2232 // Default: 0
2233 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002234}
2235
2236/**
2237 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2238 *
2239 * Logged from:
2240 * system/bt
2241 */
2242message BluetoothSmpPairingEventReported {
2243 // An identifier that can be used to match events for this device.
2244 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2245 // Salt: Randomly generated 256 bit value
2246 // Hash algorithm: HMAC-SHA256
2247 // Size: 32 byte
2248 // Default: null or empty if the device identifier is not known
2249 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2250 // SMP command sent or received over L2CAP
2251 // Default: CMD_UNKNOWN
2252 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2253 // Whether this command is sent or received
2254 // Default: DIRECTION_UNKNOWN
2255 optional android.bluetooth.DirectionEnum direction = 3;
2256 // SMP failure reason code
2257 // Default: PAIRING_FAIL_REASON_DEFAULT
2258 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2259}
2260
2261/**
Jack He815cdba2019-01-30 17:24:55 -08002262 * Logs when a Bluetooth socket’s connection state changed
2263 *
2264 * Logged from:
2265 * system/bt
2266 */
2267message BluetoothSocketConnectionStateChanged {
2268 // An identifier that can be used to match events for this device.
2269 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2270 // Salt: Randomly generated 256 bit value
2271 // Hash algorithm: HMAC-SHA256
2272 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002273 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002274 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002275 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002276 // Default 0 when unknown or don't care
2277 optional int32 port = 2;
2278 // Socket type as mentioned in
2279 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2280 // Default: SOCKET_TYPE_UNKNOWN
2281 optional android.bluetooth.SocketTypeEnum type = 3;
2282 // Socket connection state
2283 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2284 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2285 // Number of bytes sent to remote device during this connection
2286 optional int64 tx_bytes = 5;
2287 // Number of bytes received from remote device during this connection
2288 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002289 // Socket owner's UID
2290 optional int32 uid = 7 [(is_uid) = true];
2291 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2292 // |port| must be spawned by |server_port|
2293 // Default 0 when unknown or don't care
2294 optional int32 server_port = 8;
2295 // Whether this is a server listener socket
2296 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002297}
2298
2299/**
Jack He71426802019-04-02 13:32:52 -07002300 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2301 *
2302 * Logged from:
2303 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2304 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2305 *
2306 */
2307message BluetoothClassOfDeviceReported {
2308 // An identifier that can be used to match events for this device.
2309 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2310 // Salt: Randomly generated 256 bit value
2311 // Hash algorithm: HMAC-SHA256
2312 // Size: 32 byte
2313 // Default: null or empty if this is a server listener socket
2314 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2315 // Class of Device (CoD) value including both Major, Minor device class and service class
2316 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2317 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2318 // Default: 0
2319 optional int32 class_of_device = 2;
2320}
2321
2322/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002323 * Logs when something is plugged into or removed from the USB-C connector.
2324 *
2325 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002326 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002327 */
2328message UsbConnectorStateChanged {
2329 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002330 STATE_DISCONNECTED = 0;
2331 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002332 }
2333 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002334 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002335 // Last active session in ms.
2336 // 0 when the port is in connected state.
2337 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002338}
2339
2340/**
2341 * Logs the reported speaker impedance.
2342 *
2343 * Logged from:
2344 * Vendor audio implementation.
2345 */
2346message SpeakerImpedanceReported {
2347 optional int32 speaker_location = 1;
2348 optional int32 impedance = 2;
2349}
2350
2351/**
2352 * Logs the report of a failed hardware.
2353 *
2354 * Logged from:
2355 * Vendor HALs.
2356 *
2357 */
2358message HardwareFailed {
2359 enum HardwareType {
2360 HARDWARE_FAILED_UNKNOWN = 0;
2361 HARDWARE_FAILED_MICROPHONE = 1;
2362 HARDWARE_FAILED_CODEC = 2;
2363 HARDWARE_FAILED_SPEAKER = 3;
2364 HARDWARE_FAILED_FINGERPRINT = 4;
2365 }
2366 optional HardwareType hardware_type = 1;
2367
Maggie White6dcd8572019-01-31 14:11:50 -08002368 /**
2369 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002370 * the same hardware_type. The specific locations are vendor defined integers,
2371 * referring to board-specific numbering schemes.
2372 */
2373 optional int32 hardware_location = 2;
2374
Maggie White6dcd8572019-01-31 14:11:50 -08002375 /**
2376 * failure_code is specific to the HardwareType of the failed hardware.
2377 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002378 */
Maggie White6dcd8572019-01-31 14:11:50 -08002379 enum HardwareErrorCode {
2380 UNKNOWN = 0;
2381 COMPLETE = 1;
2382 SPEAKER_HIGH_Z = 2;
2383 SPEAKER_SHORT = 3;
2384 FINGERPRINT_SENSOR_BROKEN = 4;
2385 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002386 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002387 }
2388 optional int32 failure_code = 3;
2389}
2390
2391/**
2392 * Log an event when the device has been physically dropped.
2393 * Reported from the /vendor partition.
2394 */
2395message PhysicalDropDetected {
2396 // Confidence that the event was actually a drop, 0 -> 100
2397 optional int32 confidence_pctg = 1;
2398 // Peak acceleration of the drop, in 1/1000s of a g.
2399 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002400 // Duration of freefall in ms
2401 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002402}
2403
2404/**
2405 * Log bucketed battery charge cycles.
2406 *
2407 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002408 * a given charge point. For example, if 10 cycle buckets are
2409 * initialized, bucket 1 is the lowest 1/10th of the battery,
2410 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002411 *
2412 * Logged from:
2413 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2414 */
2415message ChargeCyclesReported {
2416 optional int32 cycle_bucket_1 = 1;
2417 optional int32 cycle_bucket_2 = 2;
2418 optional int32 cycle_bucket_3 = 3;
2419 optional int32 cycle_bucket_4 = 4;
2420 optional int32 cycle_bucket_5 = 5;
2421 optional int32 cycle_bucket_6 = 6;
2422 optional int32 cycle_bucket_7 = 7;
2423 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002424 optional int32 cycle_bucket_9 = 9;
2425 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002426}
2427
2428/**
Howard Roa46b6582018-09-18 16:45:02 -07002429 * Log battery health snapshot.
2430 *
2431 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2432 * are snapshotted periodically over 24hrs.
2433 */
2434message BatteryHealthSnapshot {
2435 enum BatterySnapshotType {
2436 UNKNOWN = 0;
2437 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2438 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2439 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2440 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2441 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2442 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2443 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2444 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2445 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2446 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2447 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2448 }
2449 optional BatterySnapshotType type = 1;
2450 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002451 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002452 // Voltage Battery Voltage, in microVolts.
2453 optional int32 voltage_micro_volt = 3;
2454 // Current Battery current, in microAmps.
2455 optional int32 current_micro_amps = 4;
2456 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2457 optional int32 open_circuit_micro_volt = 5;
2458 // Resistance Battery Resistance, in microOhms.
2459 optional int32 resistance_micro_ohm = 6;
2460 // Level Battery Level, as % of full.
2461 optional int32 level_percent = 7;
2462}
2463
2464/**
2465 * Log slow I/O operations on the primary storage.
2466 */
2467message SlowIo {
2468 // Classifications of IO Operations.
2469 enum IoOperation {
2470 UNKNOWN = 0;
2471 READ = 1;
2472 WRITE = 2;
2473 UNMAP = 3;
2474 SYNC = 4;
2475 }
2476 optional IoOperation operation = 1;
2477
2478 // The number of slow IO operations of this type over 24 hours.
2479 optional int32 count = 2;
2480}
2481
2482/**
2483 * Log battery caused shutdown with the last recorded voltage.
2484 */
2485message BatteryCausedShutdown {
2486 // The last recorded battery voltage prior to shutdown.
2487 optional int32 last_recorded_micro_volt = 1;
2488}
2489
2490/**
Tej Singha72344992019-04-17 18:55:08 -07002491 * Logs when ThermalService receives throttling events.
2492 *
2493 * Logged from:
2494 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2495 */
2496message ThermalThrottlingSeverityStateChanged {
2497 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2498 optional android.os.TemperatureTypeEnum sensor_type = 1;
2499
2500 // The name of the temperature source. Eg. CPU0
2501 optional string sensor_name = 2;
2502
2503 // Temperature in tenths of a degree C.
2504 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2505 optional int32 temperature_deci_celsius = 3;
2506
2507 // Relative severity of the throttling, see enum definition.
2508 optional android.os.ThrottlingSeverityEnum severity = 4;
2509}
2510
2511/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002512 * Logs the duration of a davey (jank of >=700ms) when it occurs
2513 *
2514 * Logged from:
2515 * frameworks/base/libs/hwui/JankTracker.cpp
2516 */
2517message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002518 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002519 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002520
Tej Singhbb8554a2018-01-26 11:59:14 -08002521 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002522 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002523}
2524
2525/**
Bookatze5885242017-10-24 20:10:31 -07002526 * Logs phone signal strength changes.
2527 *
2528 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002529 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002530 */
2531message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002532 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2533 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002534}
2535
Yangster4ccebea2018-10-09 17:09:02 -07002536
2537/**
2538 * Logs when the phone state, sim state or signal strength changes
2539 *
2540 * Logged from:
2541 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2542 */
2543message PhoneServiceStateChanged {
2544 optional android.telephony.ServiceStateEnum state = 1;
2545 optional android.telephony.SimStateEnum sim_state = 2;
2546 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2547}
2548
2549/**
2550 * Logs when the phone becomes on or off.
2551 *
2552 * Logged from:
2553 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2554 */
2555message PhoneStateChanged {
2556 enum State {
2557 OFF = 0;
2558 ON = 1;
2559 }
2560 optional State state = 1;
2561}
2562
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002563message BackGesture {
2564 enum BackType {
2565 DEFAULT_BACK_TYPE = 0;
2566 COMPLETED = 1;
2567 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2568 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2569 INCOMPLETE = 4;
2570 }
2571 optional BackType type = 1;
2572
2573 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2574 enum WindowHorizontalLocation {
2575 DEFAULT_LOCATION = 0;
2576 LEFT = 1;
2577 RIGHT = 2;
2578 }
2579 optional WindowHorizontalLocation x_location = 3;
2580}
2581
2582message ExclusionRectStateChanged {
2583 optional string component_name = 1; // if not available, simply packageName
2584 optional int32 requested_height = 2; // px
2585 optional int32 rejected_height = 3; // px
2586
2587 enum WindowHorizontalLocation {
2588 DEFAULT_LOCATION = 0;
2589 LEFT = 1;
2590 RIGHT = 2;
2591 }
2592 optional WindowHorizontalLocation x_location = 4;
2593 optional bool landscape = 5;
2594 optional bool splitscreen = 6;
2595 optional int32 duration_millis = 7;
2596}
2597
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002598message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002599 optional android.stats.launcher.LauncherAction action = 1;
2600 optional android.stats.launcher.LauncherState src_state = 2;
2601 optional android.stats.launcher.LauncherState dst_state = 3;
2602 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002603 optional bool is_swipe_up_enabled = 5;
2604}
2605
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002606message StyleUIChanged {
2607 optional android.stats.style.Action action = 1;
2608 optional int32 color_package_hash = 2;
2609 optional int32 font_package_hash = 3;
2610 optional int32 shape_package_hash = 4;
2611 optional int32 clock_package_hash = 5;
2612 optional int32 launcher_grid = 6;
2613 optional int32 wallpaper_category_hash = 7;
2614 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002615 optional int32 color_preference = 9;
2616 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002617}
2618
David Chenc28b2bb2017-10-24 12:52:52 -07002619/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002620 * Logs when Settings UI has changed.
2621 *
2622 * Logged from:
2623 * packages/apps/Settings
2624 */
2625message SettingsUIChanged {
2626 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002627 * Where this SettingsUIChange event comes from. For example, if
2628 * it's a PAGE_VISIBLE event, where the page is opened from.
2629 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002630 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002631
2632 /**
2633 * What the UI action is.
2634 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002635 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002636
2637 /**
2638 * Where the action is happening
2639 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002640 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002641
2642 /**
2643 * What preference changed in this event.
2644 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002645 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002646
2647 /**
2648 * The new value of the changed preference.
2649 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002650 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002651}
2652
2653/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002654 * Logs basic timing information about touch events.
2655 * Reported at most every 5 minutes while device is being interacted with.
2656 *
2657 * Logged from:
2658 * frameworks/native/services/inputflinger
2659 */
2660message TouchEventReported {
2661 /**
2662 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002663 * and the standard deviation of the time spent processing touchscreen events
2664 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002665 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002666 * On supported devices, the starting point is taken during the hard interrupt inside the
2667 * kernel touch driver. On all other devices, the starting point is taken inside
2668 * the kernel's input event subsystem upon receipt of the input event.
2669 * The ending point is taken inside InputDispatcher, just after the input event
2670 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002671 */
2672 // Minimum value
2673 optional float latency_min_micros = 1;
2674 // Maximum value
2675 optional float latency_max_micros = 2;
2676 // Average value
2677 optional float latency_mean_micros = 3;
2678 // Standard deviation
2679 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002680 // Number of touch events (input_event) in this report
2681 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002682}
2683
2684/**
Philip Quinn0eded622019-01-29 12:46:28 -08002685 * Logs gesture classification and timing information for touch events.
2686 *
2687 * Logged from:
2688 * frameworks/base/core/java/android/view/GestureDetector.java
2689 * frameworks/base/core/java/android/view/View.java
2690 */
2691message TouchGestureClassified {
2692 // The source of the classification (e.g. Java class name).
2693 optional string source = 1;
2694
2695 enum Classification {
2696 UNKNOWN_CLASSIFICATION = 0;
2697 SINGLE_TAP = 1;
2698 DOUBLE_TAP = 2;
2699 LONG_PRESS = 3;
2700 DEEP_PRESS = 4;
2701 SCROLL = 5;
2702 }
2703 // The classification of the gesture.
2704 optional Classification classification = 2;
2705
2706 // The interval from the start of a touch event stream until the
2707 // classification was made.
2708 optional int32 latency_millis = 3;
2709
2710 // The distance from the location of the first touch event to the
2711 // location of the touch event when the classification was made.
2712 optional float displacement_px = 4;
2713}
2714
2715/**
David Chenc28b2bb2017-10-24 12:52:52 -07002716 * Logs that a setting was updated.
2717 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002718 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002719 * The tag and is_default allow resetting of settings to default values based on the specified
2720 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2721 */
2722message SettingChanged {
2723 // The name of the setting.
2724 optional string setting = 1;
2725
2726 // The change being imposed on this setting. May represent a number, eg "3".
2727 optional string value = 2;
2728
2729 // The new value of this setting. For most settings, this is same as value. For some settings,
2730 // value is +X or -X where X represents an element in a set. For example, if the previous value
2731 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2732 // The +/- feature is currently only used for location_providers_allowed.
2733 optional string new_value = 3;
2734
2735 // The previous value of this setting.
2736 optional string prev_value = 4;
2737
2738 // The tag used with the is_default for resetting sets of settings. This is generally null.
2739 optional string tag = 5;
2740
Bookatz90867622018-01-31 15:05:57 -08002741 // True if this setting with tag should be resettable.
2742 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002743
David Chenbd789912018-03-16 17:19:55 -07002744 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002745 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002746
2747 enum ChangeReason {
2748 UPDATED = 1; // Updated can be an insertion or an update.
2749 DELETED = 2;
2750 }
2751 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002752}
Chenjie Yub3dda412017-10-24 13:41:59 -07002753
Chenjie Yu05013b32017-11-21 10:21:41 -08002754/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002755 * Logs activity going to foreground or background
2756 *
2757 * Logged from:
2758 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2759 */
2760message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002761 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002762 optional string pkg_name = 2;
2763 optional string class_name = 3;
2764
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002765 enum State {
2766 BACKGROUND = 0;
2767 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002768 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002769 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002770}
David Chenc8a43242017-10-17 16:23:28 -07002771
2772/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002773 * Logs when a volume entered low Storage state.
2774 * Logged from:
2775 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2776 */
2777message LowStorageStateChanged {
2778 // Volume that ran out of storage.
2779 optional string volume_description = 1;
2780
2781 enum State {
2782 UNKNOWN = 0;
2783 OFF = 1;
2784 ON = 2;
2785 }
2786 optional State state = 2;
2787}
2788
2789/**
2790 * Logs when an app is downgraded.
2791 * Logged from:
2792 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2793 */
2794message AppDowngraded {
2795 optional string package_name = 1;
2796 // Size of the package (all data) before being downgraded.
2797 optional int64 size_in_bytes_before = 2;
2798 // Size of the package (all data) after being downgraded.
2799 optional int64 size_in_bytes_after = 3;
2800
2801 optional bool aggressive = 4;
2802}
2803
2804/**
2805 * Logs when an app is optimized after being downgraded.
2806 * Logged from:
2807 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2808 */
2809message AppOptimizedAfterDowngraded {
2810 optional string package_name = 1;
2811}
2812
2813/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002814 * Logs whenever an app is installed on external storage.
2815 * Logged from:
2816 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2817 */
2818message AppInstallOnExternalStorageReported {
2819 // The type of external storage.
2820 optional android.stats.storage.ExternalStorageType storage_type = 1;
2821 // The name of the package that is installed on the sd card.
2822 optional string package_name = 2;
2823}
2824
2825/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002826 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002827 * Logged from:
2828 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2829 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002830message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002831 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002832
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002833 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002834
2835 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002836 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002837 optional string process_name = 3;
2838
2839 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002840 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002841
2842 optional string package_name = 5;
2843
2844 enum InstantApp {
2845 UNAVAILABLE = 0;
2846 FALSE = 1;
2847 TRUE = 2;
2848 }
2849 optional InstantApp is_instant_app = 6;
2850
2851 enum ForegroundState {
2852 UNKNOWN = 0;
2853 BACKGROUND = 1;
2854 FOREGROUND = 2;
2855 }
2856 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002857
2858 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002859}
David Chen9e3808c2017-11-20 17:25:34 -08002860
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002861/**
2862 * Logs when a WTF (What a Terrible Failure) happened.
2863 * Logged from:
2864 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2865 */
2866message WTFOccurred {
2867 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002868
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002869 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002870
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002871 // The name of the process.
2872 // system_server if it is not by an app
2873 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002874
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002875 // The pid if available. -1 means not available.
2876 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002877
2878 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002879}
2880
2881/**
2882 * Logs when system server reports low memory.
2883 * Logged from:
2884 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2885 */
2886message LowMemReported {
2887}
2888
2889/**
2890 * Logs when an app ANR (App Not Responding) occurs.
2891 * Logged from:
2892 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2893 */
2894message ANROccurred {
2895 optional int32 uid = 1 [(is_uid) = true];
2896
2897 optional string process_name = 2;
2898
2899 optional string short_component_name = 3;
2900
2901 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002902
2903 enum InstantApp {
2904 UNAVAILABLE = 0;
2905 FALSE = 1;
2906 TRUE = 2;
2907 }
2908 optional InstantApp is_instant_app = 5;
2909
2910 enum ForegroundState {
2911 UNKNOWN = 0;
2912 BACKGROUND = 1;
2913 FOREGROUND = 2;
2914 }
2915 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002916
2917 optional android.server.ErrorSource error_source = 7;
2918
2919 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002920}
2921
Bookatza7020bd2018-08-28 16:29:35 -07002922/**
2923 * Logs when the vibrator state changes.
2924 * Logged from:
2925 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2926 */
2927message VibratorStateChanged {
2928 repeated AttributionNode attribution_node = 1;
2929
2930 enum State {
2931 OFF = 0;
2932 ON = 1;
2933 }
2934 optional State state = 2;
2935
2936 // Duration (in milliseconds) requested to keep the vibrator on.
2937 // Only applicable for State == ON.
2938 optional int64 duration_millis = 3;
2939}
2940
David Chen0a368b22017-12-06 16:28:16 -08002941/*
2942 * Allows other apps to push events into statsd.
2943 * Logged from:
2944 * frameworks/base/core/java/android/util/StatsLog.java
2945 */
David Chen0b5c90c2018-01-25 16:51:49 -08002946message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002947 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002948 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002949
2950 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2951 optional int32 label = 2;
2952
2953 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2954 // predicates for the metrics).
2955 enum State {
2956 UNKNOWN = 0;
2957 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2958 STOP = 2;
2959 START = 3;
2960 }
2961 optional State state = 3;
2962}
2963
David Chen9e3808c2017-11-20 17:25:34 -08002964/**
Bookatz7948c872018-09-04 12:58:33 -07002965 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2966 * For example, this could be due to the user manually changing the time.
2967 *
2968 * Logged from:
2969 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2970 */
2971message WallClockTimeShifted {
2972 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2973 optional int64 wall_clock_timestamp_millis = 1;
2974}
2975
2976/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002977 * Logs when statsd detects an anomaly.
2978 *
2979 * Logged from:
2980 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2981 */
2982message AnomalyDetected {
2983 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002984 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002985
Yangster-mac94e197c2018-01-02 16:03:03 -08002986 // Id of the config whose anomaly detection alert fired.
2987 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002988
Yangster-mac94e197c2018-01-02 16:03:03 -08002989 // Id of the alert (i.e. name of the anomaly that was detected).
2990 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002991}
2992
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002993message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002994 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002995 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002996
2997 // The app package name.
2998 optional string pkg_name = 2;
2999
3000 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003001 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003002 WARM = 1;
3003 HOT = 2;
3004 COLD = 3;
3005 }
3006 // The transition type.
3007 optional TransitionType type = 3;
3008
3009 // The activity name.
3010 optional string activity_name = 4;
3011
3012 // The name of the calling app. Empty if not set.
3013 optional string calling_pkg_name = 5;
3014
3015 // Whether the app is an instant app.
3016 optional bool is_instant_app = 6;
3017
3018 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003019 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003020
Bookatz80d11a02018-01-16 10:46:35 -08003021 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003022
David Chen0b5c90c2018-01-25 16:51:49 -08003023 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003024 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003025 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003026 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003027 optional int32 bind_application_delay_millis = 11;
3028 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003029
3030 // Empty if not set.
3031 optional string launch_token = 13;
3032
Calin Juravle759fbda2018-02-20 19:52:30 +00003033 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003034 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003035
3036 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003037 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003038}
3039
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003040message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003041 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003042 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003043
3044 // The app package name.
3045 optional string pkg_name = 2;
3046
3047 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003048 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003049 WARM = 1;
3050 HOT = 2;
3051 COLD = 3;
3052 }
3053 // The transition type.
3054 optional TransitionType type = 3;
3055
3056 // The activity name.
3057 optional string activity_name = 4;
3058}
3059
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003060message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003061 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003062 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003063
3064 // The app package name.
3065 optional string pkg_name = 2;
3066
3067 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003068 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003069 WITH_BUNDLE = 1;
3070 WITHOUT_BUNDLE = 2;
3071 }
3072 // The transition type.
3073 optional TransitionType type = 3;
3074
3075 // The activity name.
3076 optional string activity_name = 4;
3077
3078 optional bool transition_process_running = 5;
3079
3080 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003081 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003082}
3083
Bookatz8fcd09a2017-12-18 13:01:10 -08003084/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003085 * Logs a picture-in-picture action
3086 * Logged from:
3087 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3088 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3089 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3090 */
3091message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003092 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003093 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003094
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003095 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003096
Chenjie Yu52cacc62017-12-08 18:11:45 -08003097 enum State {
3098 ENTERED = 1;
3099 EXPANDED_TO_FULL_SCREEN = 2;
3100 MINIMIZED = 3;
3101 DISMISSED = 4;
3102 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003103 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003104}
3105
3106/**
Chenjie Yue8904192017-12-08 19:12:57 -08003107 * Logs overlay action
3108 * Logged from:
3109 * services/core/java/com/android/server/wm/Session.java
3110 */
3111message OverlayStateChanged {
tsaichristine10978642019-09-10 14:12:49 -07003112 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003113
tsaichristine10978642019-09-10 14:12:49 -07003114 optional string package_name = 2 [(state_field_option).option = PRIMARY];
Chenjie Yue8904192017-12-08 19:12:57 -08003115
3116 optional bool using_alert_window = 3;
3117
3118 enum State {
3119 ENTERED = 1;
3120 EXITED = 2;
3121 }
tsaichristine10978642019-09-10 14:12:49 -07003122 optional State state = 4 [(state_field_option).option = EXCLUSIVE];
Chenjie Yue8904192017-12-08 19:12:57 -08003123}
3124
Chenjie Yuccfe6452018-01-30 11:33:21 -08003125/*
3126 * Logs foreground service starts and stops.
3127 * Note that this is not when a service starts or stops, but when it is
3128 * considered foreground.
3129 * Logged from
3130 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3131 */
3132message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003133 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003134 // package_name + "/" + class_name
3135 optional string short_name = 2;
3136
3137 enum State {
3138 ENTER = 1;
3139 EXIT = 2;
3140 }
3141 optional State state = 3;
3142}
3143
Chenjie Yue8904192017-12-08 19:12:57 -08003144/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003145 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3146 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3147 * attributed back to the parent (host) uid. One example is Chrome.
3148 *
3149 * Logged from:
3150 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3151 */
3152message IsolatedUidChanged {
3153 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003154 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003155 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003156 optional int32 parent_uid = 1;
3157
3158 optional int32 isolated_uid = 2;
3159
3160 // We expect an isolated uid to be removed before if it's used for another parent uid.
3161 enum Event {
3162 REMOVED = 0;
3163 CREATED = 1;
3164 }
3165 optional Event event = 3;
3166}
3167
3168/*
3169 * Logs the reception of an incoming network packet causing the main system to wake up for
3170 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3171 * and processed by WakeupController.cpp.
3172 */
3173message PacketWakeupOccurred {
3174 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3175 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003176 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003177 // The interface name on which the packet was received.
3178 optional string iface = 2;
3179 // The ethertype value of the packet.
3180 optional int32 ethertype = 3;
3181 // String representation of the destination MAC address of the packet.
3182 optional string destination_hardware_address = 4;
3183 // String representation of the source address of the packet if this was an IP packet.
3184 optional string source_ip = 5;
3185 // String representation of the destination address of the packet if this was an IP packet.
3186 optional string destination_ip = 6;
3187 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3188 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3189 // families.
3190 optional int32 ip_next_header = 7;
3191 // The source port if this was a TCP or UDP packet.
3192 optional int32 source_port = 8;
3193 // The destination port if this was a TCP or UDP packet.
3194 optional int32 destination_port = 9;
3195}
3196
3197/*
3198 * Logs the memory stats for an app on startup.
3199 * Logged from:
3200 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3201 */
3202message AppStartMemoryStateCaptured {
3203 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003204 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003205
3206 // The process name.
3207 optional string process_name = 2;
3208
3209 // The activity name.
3210 optional string activity_name = 3;
3211
3212 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003213 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003214
3215 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003216 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003217
3218 // RSS
3219 optional int64 rss_in_bytes = 6;
3220
3221 // CACHE
3222 optional int64 cache_in_bytes = 7;
3223
3224 // SWAP
3225 optional int64 swap_in_bytes = 8;
3226}
3227
3228/*
3229 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3230 * for LMK event.
3231 * Logged from:
3232 * system/core/lmkd/lmkd.c
3233 */
3234message LmkStateChanged {
3235 enum State {
3236 UNKNOWN = 0;
3237 START = 1;
3238 STOP = 2;
3239 }
3240 optional State state = 1;
3241}
3242
3243/*
3244 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3245 * Logged from:
3246 * system/core/lmkd/lmkd.c
3247 */
3248message LmkKillOccurred {
3249 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003250 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003251
3252 // The process name.
3253 optional string process_name = 2;
3254
3255 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003256 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003257
3258 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003259 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003260
3261 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003262 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003263
3264 // RSS
3265 optional int64 rss_in_bytes = 6;
3266
3267 // CACHE
3268 optional int64 cache_in_bytes = 7;
3269
3270 // SWAP
3271 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003272
3273 // The elapsed real time of start of the process.
3274 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003275
3276 // Min oom adj score considered by lmkd.
3277 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003278}
3279
Rajeev Kumar51b54602018-03-01 12:18:26 -08003280/*
3281 * Logs when the ActivityManagerService detects that an app died.
3282 *
3283 * Logged from:
3284 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3285 */
3286message AppDied {
3287 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003288 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003289}
3290
Howard Ro21a039c2018-08-06 14:55:47 -07003291/**
3292 * An atom for generic metrics logging. Available from Android Q.
3293 */
3294message GenericAtom {
3295 // The uid of the application that sent this custom atom.
3296 optional int32 uid = 1 [(is_uid) = true];
3297
3298 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003299 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003300}
3301
Tej Singhd6d6d772018-09-05 17:41:25 -07003302/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003303 * Atom for simple logging of user interaction and impression events, such as "the user touched
3304 * this button" or "this dialog was displayed".
3305 * Keep the UI event stream clean: don't use for system or background events.
3306 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
3307 */
3308message UiEventReported {
3309 // The event_id.
3310 optional int32 event_id = 1;
3311 // The event's source or target uid and package, if applicable.
3312 // For example, the package posting a notification, or the destination package of a share.
3313 optional int32 uid = 2 [(is_uid) = true];
3314 optional string package_name = 3;
3315}
3316
3317/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003318 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003319 *
3320 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003321 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003322 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003323message BiometricAcquired {
3324 // Biometric modality that was acquired.
3325 optional android.hardware.biometrics.ModalityEnum modality = 1;
3326 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3327 optional int32 user = 2;
3328 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3329 optional bool is_crypto = 3;
3330 // Action that the device is performing. Acquired messages are only expected for enroll and
3331 // authenticate. Other actions may indicate an error.
3332 optional android.hardware.biometrics.ActionEnum action = 4;
3333 // The client that this acquisition was received for.
3334 optional android.hardware.biometrics.ClientEnum client = 5;
3335 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3336 optional int32 acquire_info = 6;
3337 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3338 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003339 // Dictates if this message should trigger additional debugging.
3340 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003341}
3342
3343/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003344 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003345 *
3346 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003347 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003348 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003349message BiometricAuthenticated {
3350 // Biometric modality that was used.
3351 optional android.hardware.biometrics.ModalityEnum modality = 1;
3352 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3353 optional int32 user = 2;
3354 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3355 // storage.
3356 optional bool is_crypto = 3;
3357 // The client that this acquisition was received for.
3358 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003359 // If authentication requires user confirmation. See BiometricPrompt's
3360 // setRequireConfirmation(bool) method.
3361 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003362
Kevin Chyn1741a072019-01-17 11:54:40 -08003363 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003364 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003365 REJECTED = 1;
3366 PENDING_CONFIRMATION = 2;
3367 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003368 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003369
3370 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003371 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003372 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3373 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3374 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3375 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003376 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003377 // Dictates if this message should trigger additional debugging.
3378 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003379}
3380
3381/**
3382 * Logs when a biometric error occurs.
3383 *
3384 * Logged from:
3385 * frameworks/base/services/core/java/com/android/server/biometrics
3386 */
3387message BiometricErrorOccurred {
3388 // Biometric modality that was used.
3389 optional android.hardware.biometrics.ModalityEnum modality = 1;
3390 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3391 optional int32 user = 2;
3392 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3393 optional bool is_crypto = 3;
3394 // Action that the device is performing.
3395 optional android.hardware.biometrics.ActionEnum action = 4;
3396 // The client that this acquisition was received for.
3397 optional android.hardware.biometrics.ClientEnum client = 5;
3398 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3399 // are unique to modality.
3400 optional int32 error_info = 6;
3401 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3402 // by the vendor and not specified by the HIDL interface.
3403 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003404 // Dictates if this message should trigger additional debugging.
3405 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003406 // Time spent during the authentication attempt.
3407 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003408}
3409
3410/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003411 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003412 * Logged from:
3413 * frameworks/base/services/core/java/com/android/server/biometrics
3414 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003415message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003416 // Biometric modality.
3417 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003418 // Type of issue detected.
3419 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003420 // Dictates if this message should trigger additional debugging.
3421 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003422}
Howard Ro688ae182018-09-25 00:09:36 -07003423
joshmccloskey6f952b22019-03-25 20:59:35 -07003424/**
3425 * Logs when a biometric enrollment occurs.
3426 *
3427 * Logged from:
3428 * frameworks/base/services/core/java/com/android/server/biometrics
3429 */
3430message BiometricEnrolled {
3431 // Biometric modality that was used.
3432 optional android.hardware.biometrics.ModalityEnum modality = 1;
3433 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3434 optional int32 user = 2;
3435 // The amount of time the enrollment took in milliseconds.
3436 optional int64 latency_millis = 3;
3437 // Whether or not the enrollment was successful.
3438 optional bool success = 4;
3439}
3440
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003441/*
Tej Singh0d176952019-01-16 19:10:54 -08003442 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003443 */
Tej Singh0d176952019-01-16 19:10:54 -08003444message FlagFlipUpdateOccurred {
3445 // If the event is from a flag config package, specify the package name.
3446 optional string flag_flip_package_name = 1;
3447
3448 // The order id of the package
3449 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003450}
3451
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003452/**
3453 * Potential experiment ids that goes with a train install.
3454 */
3455message TrainExperimentIds {
3456 repeated int64 experiment_id = 1;
3457}
3458
Yangster-macb89807e2018-11-15 21:10:57 -08003459/*
3460 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003461 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003462 */
3463message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003464 // Name of the train.
3465 optional string train_name = 1;
3466 // Version code for a "train" of packages that need to be installed atomically
3467 optional int64 train_version_code = 2;
3468 // After installation of this package, device requires a restart.
3469 optional bool requires_staging = 3;
3470 // Rollback should be enabled for this install.
3471 optional bool rollback_enabled = 4;
3472 // Requires low latency monitoring if possible.
3473 optional bool requires_low_latency_monitor = 5;
3474
Yangster-macb89807e2018-11-15 21:10:57 -08003475 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003476 UNKNOWN = 0;
3477 INSTALL_REQUESTED = 1;
3478 INSTALL_STARTED = 2;
3479 INSTALL_STAGED_NOT_READY = 3;
3480 INSTALL_STAGED_READY = 4;
3481 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003482 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3483 // and INSTALL_FAILURE_COMMIT.
3484 INSTALL_FAILURE = 6 [deprecated = true];
3485 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003486 INSTALL_CANCELLED = 7;
3487 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003488 INSTALLER_ROLLBACK_INITIATED = 9;
3489 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3490 INSTALLER_ROLLBACK_STAGED = 11;
3491 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3492 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3493 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3494 INSTALLER_ROLLBACK_SUCCESS = 15;
3495 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003496 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3497 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3498 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3499 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3500 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3501 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003502 INSTALL_FAILURE_DOWNLOAD = 23;
3503 INSTALL_FAILURE_STATE_MISMATCH = 24;
3504 INSTALL_FAILURE_COMMIT = 25;
Yangster-macb89807e2018-11-15 21:10:57 -08003505 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003506 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003507 // Possible experiment ids for monitoring this push.
3508 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3509 // user id
3510 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003511}
3512
Tej Singhc9203082019-05-03 13:42:23 -07003513/* Test atom, is not logged anywhere */
3514message TestAtomReported {
3515 repeated AttributionNode attribution_node = 1;
3516 optional int32 int_field = 2;
3517 optional int64 long_field = 3;
3518 optional float float_field = 4;
3519 optional string string_field = 5;
3520 optional bool boolean_field = 6;
3521 enum State {
3522 UNKNOWN = 0;
3523 OFF = 1;
3524 ON = 2;
3525 }
3526 optional State state = 7;
3527 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3528}
3529
Maggie Whitefc1aa592018-11-28 21:55:23 -08003530/** Represents USB port overheat event. */
3531message UsbPortOverheatEvent {
3532 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3533 optional int32 plug_temperature_deci_c = 1;
3534
3535 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3536 optional int32 max_temperature_deci_c = 2;
3537
3538 /* Time between USB plug event and overheat threshold trip, in seconds. */
3539 optional int32 time_to_overheat_secs = 3;
3540
3541 /* Time between overheat threshold trip and hysteresis, in seconds. */
3542 optional int32 time_to_hysteresis_secs = 4;
3543
3544 /* Time between hysteresis and active mitigation ending, in seconds. */
3545 optional int32 time_to_inactive_secs = 5;
3546};
3547
Maggie White8735b852019-01-18 11:40:49 -08003548/**
3549 * Logs total effective full charge and discharge cycles on a battery.
3550 * Here are some examples of one effective cycle:
3551 * 1) the battery charges from 0% to 100% and drains back to 0%,
3552 * 2) charging from 50% to 100% and draining back to 50% twice.
3553 * Pulled from:
3554 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3555 */
3556message BatteryCycleCount {
3557 /* Number of total charge and discharge cycles on the system battery. */
3558 optional int32 cycle_count = 1;
3559}
3560
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003561/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003562 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3563 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003564 * Pulled from:
3565 * StatsCompanionService
3566 */
3567
Carmen Agimof12dec122019-03-06 16:14:38 +00003568message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003569
Carmen Agimof12dec122019-03-06 16:14:38 +00003570 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003571 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003572 PUBLIC = 1;
3573 PRIVATE = 2;
3574 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003575 }
3576
Carmen Agimof12dec122019-03-06 16:14:38 +00003577 // The type of external storage.
3578 optional android.stats.storage.ExternalStorageType storage_type = 1;
3579 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3580 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003581 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003582 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003583}
3584
Yangster-macb89807e2018-11-15 21:10:57 -08003585/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003586 * Logs when a connection becomes available and lost.
3587 * Logged in StatsCompanionService.java
3588 */
3589message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003590 // Id of the network.
3591 optional int32 net_id = 1;
3592
3593 enum State {
3594 UNKNOWN = 0;
3595 CONNECTED = 1;
3596 DISCONNECTED = 2;
3597 }
3598 // Connected state of a network.
3599 optional State state = 2;
3600}
3601
3602/**
3603 * Logs when a service starts and stops.
3604 * Logged from:
3605 * services/core/java/com/android/server/am/ActiveServices.java
3606 */
3607message ServiceStateChanged {
3608
3609 optional int32 uid = 1 [(is_uid) = true];
3610
3611 optional string package_name = 2;
3612
3613 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003614
3615 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003616 START = 1;
3617 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003618 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003619
3620 optional State state = 4;
3621}
3622
3623/**
3624 * Logs when a service is launched.
3625 * Logged from:
3626 * services/core/java/com/android/server/am/ActiveServices.java
3627 */
3628message ServiceLaunchReported {
3629
3630 optional int32 uid = 1 [(is_uid) = true];
3631
3632 optional string package_name = 2;
3633
3634 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003635}
Howard Ro688ae182018-09-25 00:09:36 -07003636
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003637/**
3638 * Logs when a hidden API is used.
3639 *
3640 * Logged from:
3641 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3642 */
3643message HiddenApiUsed {
3644 // The uid of the app making the hidden access.
3645 optional int32 uid = 1 [(is_uid) = true];
3646
3647 // Signature of the method or field accessed.
3648 optional string signature = 2;
3649
3650 enum AccessMethod {
3651 NONE = 0;
3652 REFLECTION = 1;
3653 JNI = 2;
3654 LINKING = 3;
3655 }
3656
3657 // Type of access.
3658 optional AccessMethod access_method = 3;
3659
3660 // Whether the access was prevented or not.
3661 optional bool access_denied = 4;
3662}
3663
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003664/**
3665 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3666 * - When user sees privacy chip
3667 * - When user clicks privacy chip
3668 * - How does the user exit the Privacy Dialog
3669 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003670 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3671 */
3672message PrivacyIndicatorsInteracted {
3673
3674 enum Type {
3675 UNKNOWN = 0;
3676 CHIP_VIEWED = 1;
3677 CHIP_CLICKED = 2;
3678 DIALOG_PRIVACY_SETTINGS = 3;
3679 DIALOG_DISMISS = 4;
3680 DIALOG_LINE_ITEM = 5;
3681 }
3682
3683 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3684
3685 // Used if the type is LINE_ITEM
3686 optional string package_name = 2;
3687}
3688
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003689/**
3690 * Logs information about a package that is moved from the internal to external storage and vice
3691 * versa.
3692 * It logs the package name, the type of the external storage where the package is installed
3693 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3694 * and the move type: if it's from internal to external or the other way around.
3695 *
3696 * Logged from:
3697 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3698 */
3699message AppMovedStorageReported {
3700 enum MoveType {
3701 UNKNOWN = 0;
3702 TO_EXTERNAL = 1;
3703 TO_INTERNAL = 2;
3704 }
3705 // The type of the external storage.
3706 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3707 // The type of move.
3708 optional MoveType move_type = 2;
3709 // The name of the package that was moved.
3710 optional string package_name = 3;
3711}
3712
jianjin8f2dee02019-03-29 14:03:08 -07003713/**
3714 * Logs when system server watchdog occurs.
3715 * Logged from:
3716 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3717 */
3718message SystemServerWatchdogOccurred {
3719 optional string subject = 1;
3720}
3721
3722/**
3723 * Logs when new file added to tombstones.
3724 * Logged from:
3725 * frameworks/base/core/java/com/android/server/BootReceiver.java
3726 */
3727message TombStoneOccurred {
3728}
3729
Hai Zhang5d3328d2019-04-13 21:25:06 +08003730/*
3731 * Information about a role request
3732 *
3733 * Logged from:
3734 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3735 */
3736message RoleRequestResultReported {
3737 // UID of application requesting the role
3738 optional int32 requesting_uid = 1;
3739
3740 // Package name of application requesting the role
3741 optional string requesting_package_name = 2;
3742
3743 // The role to be granted
3744 optional string role_name = 3;
3745
3746 // The count of applications qualifying for the role
3747 optional int32 qualifying_count = 4;
3748
3749 // UID of application current granted the role
3750 optional int32 current_uid = 5;
3751
3752 // Package name of application current granted the role
3753 optional string current_package_name = 6;
3754
3755 // UID of another application that user chose to grant the role to, instead of the requesting
3756 // application
3757 optional int32 granted_another_uid = 7;
3758
3759 // Package name of another application that user chose to grant the role to, instead of the
3760 // requesting application
3761 optional string granted_another_package_name = 8;
3762
3763 enum Result {
3764 UNDEFINED = 0;
3765 // role request was ignored
3766 IGNORED = 1;
3767 // role request was ignored because it's already granted
3768 IGNORED_ALREADY_GRANTED = 2;
3769 // role request was ignored because the application isn't qualified
3770 IGNORED_NOT_QUALIFIED = 3;
3771 // role request was ignored because user said it should be always denied
3772 IGNORED_USER_ALWAYS_DENIED = 4;
3773 // role was granted by user action
3774 USER_GRANTED = 5;
3775 // role was denied by user action
3776 USER_DENIED = 6;
3777 // role was denied by user granting another application the role
3778 USER_DENIED_GRANTED_ANOTHER = 7;
3779 // role was denied and set to be always denied by the user
3780 USER_DENIED_WITH_ALWAYS = 8;
3781 }
3782 // The result of the role request
3783 optional Result result = 9;
3784}
3785
Mark Tabrya824a642019-11-05 12:26:12 -08003786/**
3787 * Logs when a Vehicle Maps Service client's connection state has changed
3788 *
3789 * Logged from:
3790 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
3791 */
3792message VmsClientConnectionStateChanged {
3793 // The UID of the VMS client app
3794 optional int32 uid = 1 [(is_uid) = true];
3795
3796 enum State {
3797 UNKNOWN = 0;
3798 // Attempting to connect to the client
3799 CONNECTING = 1;
3800 // Client connection established
3801 CONNECTED = 2;
3802 // Client connection closed unexpectedly
3803 DISCONNECTED = 3;
3804 // Client connection closed by VMS
3805 TERMINATED = 4;
3806 // Error establishing the client connection
3807 CONNECTION_ERROR = 5;
3808 }
3809
3810 optional State state = 2;
3811}
3812
Jeff Sharkey6bd21572019-11-15 20:45:33 -07003813/**
3814 * Logs when MediaProvider has successfully finished scanning a storage volume.
3815 *
3816 * Logged from:
3817 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
3818 */
3819message MediaProviderScanEvent {
3820 enum Reason {
3821 // Scan triggered due to unknown reason
3822 UNKNOWN = 0;
3823 // Scan triggered due to storage volume being mounted
3824 MOUNTED = 1;
3825 // Scan triggered due to explicit user action or app request
3826 DEMAND = 2;
3827 // Scan triggered due to idle maintenance
3828 IDLE = 3;
3829 }
3830
3831 // Volume type that this event pertains to
3832 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3833 // Reason why this scan was triggered
3834 optional Reason reason = 2;
3835 // Total number of files scanned
3836 optional int64 item_count = 3;
3837 // Duration of scan, normalized per file
3838 optional float normalized_duration_millis = 4;
3839 // Number of database inserts, normalized per file
3840 optional float normalized_insert_count = 5;
3841 // Number of database updates, normalized per file
3842 optional float normalized_update_count = 6;
3843 // Number of database deletes, normalized per file
3844 optional float normalized_delete_count = 7;
3845}
3846
3847/**
3848 * Logs when an app has asked MediaProvider to delete media belonging to the user.
3849 *
3850 * Logged from:
3851 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
3852 */
3853message MediaProviderDeletionEvent {
3854 // Volume type that this event pertains to
3855 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3856 // Device timestamp when this deletion event occurred
3857 optional int64 timestamp_millis = 2;
3858 // App that requested deletion
3859 optional string package_name = 3;
3860 // Number of items that were deleted
3861 optional int32 item_count = 4;
3862}
3863
3864/**
3865 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
3866 *
3867 * Logged from:
3868 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
3869 */
3870message MediaProviderPermissionEvent {
3871 enum Result {
3872 UNKNOWN = 0;
3873 USER_GRANTED = 1;
3874 AUTO_GRANTED = 2;
3875 USER_DENIED = 3;
3876 USER_DENIED_WITH_PREJUDICE = 4;
3877 AUTO_DENIED = 5;
3878 }
3879
3880 // Volume type that this event pertains to
3881 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3882 // Device timestamp when this permission event occurred
3883 optional int64 timestamp_millis = 2;
3884 // App that requested permission
3885 optional string package_name = 3;
3886 // Number of items that were requested
3887 optional int32 item_count = 4;
3888 // Result of this request
3889 optional Result result = 5;
3890}
3891
3892/**
3893 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
3894 *
3895 * Logged from:
3896 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
3897 */
3898message MediaProviderSchemaChange {
3899 // Volume type that this event pertains to
3900 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3901 // Old database version code
3902 optional int32 version_from = 2;
3903 // New database version code
3904 optional int32 version_to = 3;
3905 // Total number of files in database
3906 optional int64 item_count = 4;
3907 // Duration of schema change, normalized per file
3908 optional float normalized_duration_millis = 5;
3909}
3910
3911/**
3912 * Logs when MediaProvider has finished an idle maintenance job.
3913 *
3914 * Logged from:
3915 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
3916 */
3917message MediaProviderIdleMaintenance {
3918 // Volume type that this event pertains to
3919 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3920
3921 // Total number of files in database
3922 optional int64 item_count = 2;
3923 // Duration of idle maintenance, normalized per file
3924 optional float normalized_duration_millis = 3;
3925 // Number of thumbnails found to be stale, normalized per file
3926 optional float normalized_stale_thumbnails = 4;
3927 // Number of items found to be expired, normalized per file
3928 optional float normalized_expired_media = 5;
3929}
3930
Chenjie Yubbcbc602018-02-05 16:51:52 -08003931//////////////////////////////////////////////////////////////////////
3932// Pulled atoms below this line //
3933//////////////////////////////////////////////////////////////////////
3934
3935/**
David Chenc8a43242017-10-17 16:23:28 -07003936 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3937 *
3938 * Pulled from:
3939 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3940 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003941message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003942 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003943
3944 optional int64 rx_bytes = 2;
3945
3946 optional int64 rx_packets = 3;
3947
3948 optional int64 tx_bytes = 4;
3949
3950 optional int64 tx_packets = 5;
3951}
3952
3953/**
3954 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3955 *
3956 * Pulled from:
3957 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3958 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003959message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003960 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003961
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003962 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3963 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003964
3965 optional int64 rx_bytes = 3;
3966
3967 optional int64 rx_packets = 4;
3968
3969 optional int64 tx_bytes = 5;
3970
3971 optional int64 tx_packets = 6;
3972}
3973
3974/**
3975 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3976 *
3977 * Pulled from:
3978 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3979 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003980message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003981 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003982
3983 optional int64 rx_bytes = 2;
3984
3985 optional int64 rx_packets = 3;
3986
3987 optional int64 tx_bytes = 4;
3988
3989 optional int64 tx_packets = 5;
3990}
3991
3992/**
3993 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3994 *
3995 * Pulled from:
3996 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3997 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003998message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003999 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004000
Yao Chenc40a19d2018-03-15 16:48:25 -07004001 // 1 denotes foreground and 0 denotes background. This is called Set in
4002 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004003 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004004
4005 optional int64 rx_bytes = 3;
4006
4007 optional int64 rx_packets = 4;
4008
4009 optional int64 tx_bytes = 5;
4010
4011 optional int64 tx_packets = 6;
4012}
4013
4014/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004015 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4016 *
4017 * Pulled from:
4018 * StatsCompanionService
4019 */
4020message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004021 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004022
4023 optional int64 rx_bytes = 2;
4024
4025 optional int64 tx_bytes = 3;
4026}
4027
4028/**
David Chenc8a43242017-10-17 16:23:28 -07004029 * Pulls the kernel wakelock durations. This atom is adapted from
4030 * android/internal/os/KernelWakelockStats.java
4031 *
4032 * Pulled from:
4033 * StatsCompanionService using KernelWakelockReader.
4034 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004035message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004036 optional string name = 1;
4037
4038 optional int32 count = 2;
4039
4040 optional int32 version = 3;
4041
Yangster-maca8a30442018-10-13 23:46:34 -07004042 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004043}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004044
Chenjie Yu05013b32017-11-21 10:21:41 -08004045/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004046 * Pulls low power state information. If power.stats HAL is not available, this
4047 * includes platform and subsystem sleep state information,
4048 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4049 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004050 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004051 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004052 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4053 * as defined in:
4054 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004055 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004056message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004057 // Subsystem name
4058 optional string subsystem_name = 1;
4059 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4060 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004061 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4062 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004063 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004064 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004065 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004066 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004067 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004068}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004069
Chenjie Yu05013b32017-11-21 10:21:41 -08004070/**
Bookatz92da2832018-11-01 18:10:03 -07004071 * Pulls on-device power measurement information.
4072 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4073 * Pulled from:
4074 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4075 */
4076message OnDevicePowerMeasurement {
4077 // Name of the subsystem (to which the rail belongs).
4078 optional string subsystem_name = 1;
4079
4080 // Rail name. The rail lies within the subsystem.
4081 optional string rail_name = 2;
4082
4083 // Time (in ms since boot) at which the rail energy value was measured.
4084 // This may differ slightly from the time that statsd logs this information.
4085 optional uint64 measurement_timestamp_millis = 3;
4086
4087 // Accumulated energy used via the rail since device boot in uWs.
4088 optional uint64 energy_microwatt_secs = 4;
4089}
4090
4091/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004092 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004093 * Pulls the time the cpu spend on the frequency index. Frequency index
4094 * starts from highest to lowest. The value should be monotonically
4095 * increasing since boot. However, if there is a cpu
4096 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004097 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004098message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004099 optional uint32 cluster = 1;
4100 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004101 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004102}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004103
Chenjie Yu05013b32017-11-21 10:21:41 -08004104/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004105 * Pulls Cpu Time Per Uid.
4106 * Note that isolated process uid time should be attributed to host uids.
4107 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004108message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004109 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004110 optional uint64 user_time_micros = 2;
4111 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004112}
4113
4114/**
4115 * Pulls Cpu Time Per Uid per frequency.
4116 * Note that isolated process uid time should be attributed to host uids.
4117 * For each uid, we order the time by descending frequencies.
4118 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004119message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004120 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004121 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004122 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004123}
Hugo Benichi884970e2017-11-14 22:42:46 +09004124
Chenjie Yu05013b32017-11-21 10:21:41 -08004125/**
4126 * Pulls Wifi Controller Activity Energy Info
4127 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004128message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004129 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004130 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004131 // stack reported state
4132 // TODO: replace this with proto enum
4133 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004134 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004135 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004136 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004137 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004138 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004139 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004140 // product of current(mA), voltage(V) and time(ms)
4141 optional uint64 controller_energy_used = 6;
4142}
4143
4144/**
4145 * Pulls Modem Activity Energy Info
4146 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004147message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004148 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004149 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004150 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004151 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004152 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004153 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004154 /**
4155 * Tx power index
4156 * index 0 = tx_power < 0dBm
4157 * index 1 = 0dBm < tx_power < 5dBm
4158 * index 2 = 5dBm < tx_power < 15dBm
4159 * index 3 = 15dBm < tx_power < 20dBm
4160 * index 4 = tx_power > 20dBm
4161 */
4162 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004163 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004164 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004165 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004166 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004167 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004168 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004169 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004170 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004171 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004172 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004173 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004174 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004175 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004176}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004177
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004178/**
4179 * Pulls Bluetooth Activity Energy Info
4180 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4181 */
4182message BluetoothActivityInfo {
4183 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004184 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004185 // bluetooth stack state
4186 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004187 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004188 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004189 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004190 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004191 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004192 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004193 // product of current(mA), voltage(V) and time(ms)
4194 optional uint64 energy_used = 6;
4195}
4196
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004197/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004198 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004199 *
4200 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004201 */
4202message ProcessMemoryState {
4203 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004204 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004205
4206 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004207 // Usually package name, "system" for system server.
4208 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004209 optional string process_name = 2;
4210
Rafal Slawikda51b932018-12-13 16:31:33 +00004211 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004212 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004213
4214 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004215 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004216
4217 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004218 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004219
Rajeev Kumar90235992018-01-29 11:06:48 -08004220 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004221 // Value is read from memory.stat, field total_rss if per-app memory
4222 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004223 optional int64 rss_in_bytes = 6;
4224
4225 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004226 // Value is read from memory.stat, field total_cache if per-app memory
4227 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004228 optional int64 cache_in_bytes = 7;
4229
4230 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004231 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004232 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004233 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004234
Rafal Slawik203c3db2019-09-25 19:53:01 +01004235 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004236 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004237
Rafal Slawik203c3db2019-09-25 19:53:01 +01004238 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4239 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004240
Rafal Slawik203c3db2019-09-25 19:53:01 +01004241 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4242 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004243}
4244
4245/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004246 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004247 *
4248 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4249 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004250 *
4251 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004252 */
4253message ProcessMemoryHighWaterMark {
4254 // The uid if available. -1 means not available.
4255 optional int32 uid = 1 [(is_uid) = true];
4256
Rafal Slawikda51b932018-12-13 16:31:33 +00004257 // The process name.
4258 // Usually package name or process cmdline.
4259 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004260 optional string process_name = 2;
4261
Rafal Slawik239b6802019-09-09 18:46:01 +01004262 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4263 // computed by converting kilobytes to bytes.
4264 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4265
Rafal Slawik3bea8952018-11-15 12:39:33 +00004266 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4267 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004268 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004269}
4270
4271/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004272 * Logs the memory stats for a process.
4273 *
4274 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4275 * and for selected native processes.
4276 */
4277message ProcessMemorySnapshot {
4278 // The uid if available. -1 means not available.
4279 optional int32 uid = 1 [(is_uid) = true];
4280
4281 // The process name.
4282 // Usually package name or process cmdline.
4283 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4284 optional string process_name = 2;
4285
4286 // The pid of the process.
4287 // Allows to disambiguate instances of the process.
4288 optional int32 pid = 3;
4289
4290 // The current OOM score adjustment value.
4291 // Read from ProcessRecord for managed processes.
4292 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4293 optional int32 oom_score_adj = 4;
4294
4295 // The current RSS of the process.
4296 // VmRSS from /proc/pid/status.
4297 optional int32 rss_in_kilobytes = 5;
4298
4299 // The current anon RSS of the process.
4300 // RssAnon from /proc/pid/status.
4301 optional int32 anon_rss_in_kilobytes = 6;
4302
4303 // The current swap size of the process.
4304 // VmSwap from /proc/pid/status.
4305 optional int32 swap_in_kilobytes = 7;
4306
4307 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4308 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4309}
4310
4311/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004312 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004313 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004314message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004315 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004316}
4317
4318/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004319 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004320 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004321message SystemUptime {
4322 // Milliseconds since the system was booted.
4323 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4324 // for external input).
4325 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004326 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004327}
4328
4329/*
4330 * Reads from /proc/uid_concurrent_active_time which has the format:
4331 * active: X (X is # cores)
4332 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4333 * [uid1]: [time-0] [time-1] [time-2] ... ...
4334 * ...
4335 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4336 * The file contains a monotonically increasing count of time for a single boot.
4337 */
4338message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004339 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004340 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004341}
4342
4343/**
4344 * Reads from /proc/uid_concurrent_policy_time which has the format:
4345 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4346 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4347 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4348 * ...
4349 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4350 * The file contains a monotonically increasing count of time for a single boot.
4351 */
4352message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004353 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004354 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004355 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004356}
4357
4358/*
4359 * Pulls free disk space, for data, system partition and temporary directory.
4360 */
4361message DiskSpace {
4362 // available bytes in data partition
4363 optional uint64 data_available_bytes = 1;
4364 // available bytes in system partition
4365 optional uint64 system_available_bytes = 2;
4366 // available bytes in download cache or temp directories
4367 optional uint64 temp_available_bytes = 3;
4368}
Tej Singhbf972d92018-01-10 20:51:13 -08004369
4370/**
4371 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004372 *
4373 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004374 */
4375message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004376 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004377}
4378
4379/**
4380 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004381 * Pulled from:
4382 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004383 */
4384message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004385 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004386}
4387
4388/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004389 * Pulls battery voltage.
4390 * Pulled from:
4391 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4392 */
4393message BatteryVoltage {
4394 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004395 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004396}
4397
4398/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004399 * Pulls battery level (percent full, from 0 to 100).
4400 *
4401 * Pulled from:
4402 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4403 */
4404message BatteryLevel {
4405 // Battery level. Should be in [0, 100].
4406 optional int32 battery_level = 1;
4407}
4408
4409/**
Tej Singhd89137e2018-03-26 14:51:40 -07004410 * Pulls the temperature of various parts of the device.
4411 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004412 *
Maggie White442b6312019-04-05 16:26:44 -07004413 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004414 */
4415message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004416 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004417 optional android.os.TemperatureTypeEnum sensor_location = 1;
4418
4419 // The name of the temperature source. Eg. CPU0
4420 optional string sensor_name = 2;
4421
Tej Singhd89137e2018-03-26 14:51:40 -07004422 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004423 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004424 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004425
4426 // Relative severity of the throttling, see enum definition.
4427 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004428}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004429
4430/**
4431 * Pulls the statistics of calls to Binder.
4432 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004433 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4434 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004435 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004436 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004437 */
4438message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004439 // UID of the process responsible for the binder transaction. It will be set if the process
4440 // executing the binder transaction attribute the transaction to another uid using
4441 // Binder.setThreadWorkSource().
4442 //
4443 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004444 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004445 // UID of the process executing the binder transaction.
4446 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004447 // Fully qualified class name of the API call.
4448 //
4449 // This is a system server class name.
4450 //
4451 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4452 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4453 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4454 // commonly used APIs.
4455 optional string service_class_name = 2;
4456 // Method name of the API call. It can also be a transaction code if we cannot
4457 // resolve it to a name. See Binder#getTransactionName.
4458 //
4459 // This is a system server method name.
4460 optional string service_method_name = 3;
4461 // Total number of API calls.
4462 optional int64 call_count = 4;
4463 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4464 optional bool screen_interactive = 13;
4465 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4466 // call_count will be equal to recorded_call_count.
4467 //
4468 // If recorded_call_count is different than call_count, it means data collection has been
4469 // sampled. All the fields below will be sampled in this case.
4470 optional int64 recorded_call_count = 12;
4471 // Number of exceptions thrown by the API.
4472 optional int64 recorded_exception_count = 5;
4473 // Total latency of all API calls.
4474 // Average can be computed using total_latency_micros / recorded_call_count.
4475 optional int64 recorded_total_latency_micros = 6;
4476 // Maximum latency of one API call.
4477 optional int64 recorded_max_latency_micros = 7;
4478 // Total CPU usage of all API calls.
4479 // Average can be computed using total_cpu_micros / recorded_call_count.
4480 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4481 optional int64 recorded_total_cpu_micros = 8;
4482 // Maximum CPU usage of one API call.
4483 optional int64 recorded_max_cpu_micros = 9;
4484 // Maximum parcel reply size of one API call.
4485 optional int64 recorded_max_reply_size_bytes = 10;
4486 // Maximum parcel request size of one API call.
4487 optional int64 recorded_max_request_size_bytes = 11;
4488}
4489
4490/**
4491 * Pulls the statistics of exceptions during calls to Binder.
4492 *
4493 * Binder stats are cumulative from boot unless somebody reset the data using
4494 * > adb shell dumpsys binder_calls_stats --reset
4495 */
4496message BinderCallsExceptions {
4497 // Exception class name, e.g. java.lang.IllegalArgumentException.
4498 //
4499 // This is an exception class name thrown by the system server.
4500 optional string exception_class_name = 1;
4501 // Total number of exceptions.
4502 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004503}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004504
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004505/**
4506 * Pulls the statistics of message dispatching on HandlerThreads.
4507 *
4508 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4509 * config on the device.
4510 *
4511 * Next tag: 11
4512 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004513message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004514 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004515 optional int32 uid = 1 [(is_uid) = true];
4516
4517 // Fully qualified class name of the handler target class.
4518 //
4519 // This field does not contain PII. This is a system server class name.
4520 optional string handler_class_name = 2;
4521
4522 // The name of the thread that runs the Looper.
4523 //
4524 // This field does not contain PII. This is a system server thread name.
4525 optional string looper_thread_name = 3;
4526
4527 // The name of the dispatched message.
4528 //
4529 // This field does not contain PII. This is a system server constant or class
4530 // name.
4531 optional string message_name = 4;
4532
4533 // Total number of successfully dispatched messages.
4534 optional int64 message_count = 5;
4535
4536 // Total number of messages that failed dispatching.
4537 optional int64 exception_count = 6;
4538
4539 // Total number of processed messages we have data recorded for. If we
4540 // collected data for all the messages, message_count will be equal to
4541 // recorded_message_count.
4542 //
4543 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004544 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004545 optional int64 recorded_message_count = 7;
4546
4547 // Total latency of all processed messages.
4548 // Average can be computed using recorded_total_latency_micros /
4549 // recorded_message_count.
4550 optional int64 recorded_total_latency_micros = 8;
4551
4552 // Total CPU usage of all processed message.
4553 // Average can be computed using recorded_total_cpu_micros /
4554 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004555 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004556 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004557
4558 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4559 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004560
4561 // Max recorded CPU usage of all processed messages.
4562 optional int64 recorded_max_cpu_micros = 11;
4563
4564 // Max recorded latency of all processed messages.
4565 optional int64 recorded_max_latency_micros = 12;
4566
4567 // Total number of messages we tracked the dispatching delay for. If we
4568 // collected data for all the messages, message_count will be equal to
4569 // recorded_delay_message_count.
4570 //
4571 // If recorded_delay_message_count is different than message_count, it means data
4572 // collection has been sampled or/and not all messages specified the target dispatch time.
4573 // The fields below will be sampled in this case.
4574 optional int64 recorded_delay_message_count = 13;
4575
4576 // Total dispatching delay of all processed messages.
4577 // Calculated as a difference between the target dispatching time (Message.when)
4578 // and the actual dispatching time.
4579 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4580 optional int64 recorded_total_delay_millis = 14;
4581
4582 // Max dispatching delay of all processed messages.
4583 // Calculated as a difference between the target dispatching time (Message.when)
4584 // and the actual dispatching time.
4585 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004586}
Tej Singh86dc9db2018-09-06 00:39:57 +00004587
4588/**
4589 * Pulls disk information, such as write speed and latency.
4590 */
4591message DiskStats {
4592 // Time taken to open, write 512B to, and close a file.
4593 // -1 if error performing the check.
4594 optional int64 data_write_latency_millis = 1;
4595
4596 optional bool file_based_encryption = 2;
4597
4598 // Recent disk write speed in kB/s.
4599 // -1 if error querying storageed.
4600 // 0 if data is unavailable.
4601 optional int32 recent_disk_write_speed = 3;
4602}
4603
4604
4605/**
4606 * Free and total bytes of the Data, Cache, and System partition.
4607 */
4608message DirectoryUsage {
4609 enum Directory {
4610 UNKNOWN = 0;
4611 DATA = 1;
4612 CACHE = 2;
4613 SYSTEM = 3;
4614 }
4615 optional Directory directory = 1;
4616 optional int64 free_bytes = 2;
4617 optional int64 total_bytes = 3;
4618}
4619
4620
4621/**
4622 * Size of an application: apk size, data size, and cache size.
4623 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4624 * Information is only reported for apps with the primary user (user 0).
4625 * Sizes are aggregated by package name.
4626 */
4627message AppSize {
4628 // Including uids will involve modifying diskstats logic.
4629 optional string package_name = 1;
4630 // App size in bytes. -1 if unavailable.
4631 optional int64 app_size_bytes = 2;
4632 // App data size in bytes. -1 if unavailable.
4633 optional int64 app_data_size_bytes = 3;
4634 // App cache size in bytes. -1 if unavailable.
4635 optional int64 app_cache_size_bytes = 4;
4636 // Time that the cache file was produced.
4637 // Uses System.currentTimeMillis(), which is wall clock time.
4638 optional int64 cache_time_millis = 5;
4639}
4640
4641
4642/**
4643 * Size of a particular category. Eg: photos, videos.
4644 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4645 */
4646message CategorySize {
4647 enum Category {
4648 UNKNOWN = 0;
4649 APP_SIZE = 1;
4650 APP_DATA_SIZE = 2;
4651 APP_CACHE_SIZE = 3;
4652 PHOTOS = 4;
4653 VIDEOS = 5;
4654 AUDIO = 6;
4655 DOWNLOADS = 7;
4656 SYSTEM = 8;
4657 OTHER = 9;
4658 }
4659 optional Category category = 1;
4660 // Category size in bytes.
4661 optional int64 size_bytes = 2;
4662 // Time that the cache file was produced.
4663 // Uses System.currentTimeMillis(), which is wall clock time.
4664 optional int64 cache_time_millis = 3;
4665}
Tej Singhd6d6d772018-09-05 17:41:25 -07004666
4667/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004668 * Pulls per uid I/O stats. The stats are cumulative since boot.
4669 *
4670 * Read/write bytes are I/O events from a storage device
4671 * Read/write chars are data requested by read/write syscalls, and can be
4672 * satisfied by caching.
4673 *
4674 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4675 */
4676message DiskIo {
4677 optional int32 uid = 1 [(is_uid) = true];
4678 optional int64 fg_chars_read = 2;
4679 optional int64 fg_chars_write = 3;
4680 optional int64 fg_bytes_read = 4;
4681 optional int64 fg_bytes_write = 5;
4682 optional int64 bg_chars_read = 6;
4683 optional int64 bg_chars_write = 7;
4684 optional int64 bg_bytes_read = 8;
4685 optional int64 bg_bytes_write = 9;
4686 optional int64 fg_fsync = 10;
4687 optional int64 bg_fsync= 11;
4688}
4689
4690
4691/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004692 * Pulls the number of fingerprints for each user.
4693 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004694 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004695 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004696message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004697 // The associated user. Eg: 0 for owners, 10+ for others.
4698 // Defined in android/os/UserHandle.java
4699 optional int32 user = 1;
4700 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004701 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004702}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004703
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004704/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004705 * Pulls the number of faces for each user.
4706 *
4707 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4708 */
4709message NumFacesEnrolled {
4710 // The associated user. Eg: 0 for owners, 10+ for others.
4711 // Defined in android/os/UserHandle.java
4712 optional int32 user = 1;
4713 // Number of faces registered to that user.
4714 optional int32 num_faces_enrolled = 2;
4715}
4716/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004717 * A mapping of role holder -> role
4718 */
4719message RoleHolder {
4720 // uid of the role holder
4721 optional int32 uid = 1 [(is_uid) = true];
4722
4723 // package name of the role holder
4724 optional string package_name = 2;
4725
4726 // the role held
4727 optional string role = 3;
4728}
4729
Yangsteraf9aee72018-10-12 09:26:16 -07004730message AggStats {
4731 optional int64 min = 1;
4732
4733 optional int64 average = 2;
4734
4735 optional int64 max = 3;
4736}
4737
4738message ProcessStatsStateProto {
4739 optional android.service.procstats.ScreenState screen_state = 1;
4740
4741 optional android.service.procstats.MemoryState memory_state = 2;
4742
4743 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4744 // and not frameworks/base/core/java/android/app/ActivityManager.java
4745 optional android.service.procstats.ProcessState process_state = 3;
4746
4747 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004748 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004749
4750 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004751 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004752
4753 // # of samples taken
4754 optional int32 sample_size = 5;
4755
4756 // PSS is memory reserved for this process
4757 optional AggStats pss = 6;
4758
4759 // USS is memory shared between processes, divided evenly for accounting
4760 optional AggStats uss = 7;
4761
4762 // RSS is memory resident for this process
4763 optional AggStats rss = 8;
4764}
4765
4766// Next Tag: 7
4767message ProcessStatsProto {
4768 // Name of process.
4769 optional string process = 1;
4770
4771 // Uid of the process.
4772 optional int32 uid = 2;
4773
4774 // Information about how often kills occurred
4775 message Kill {
4776 // Count of excessive CPU kills
4777 optional int32 cpu = 1;
4778
4779 // Count of kills when cached
4780 optional int32 cached = 2;
4781
4782 // PSS stats during cached kill
4783 optional AggStats cached_pss = 3;
4784 }
4785 optional Kill kill = 3;
4786
4787 // Time and memory spent in various states.
4788 repeated ProcessStatsStateProto states = 5;
4789
4790 // Total time process has been running... screen_state, memory_state, and process_state
4791 // will not be set.
4792 optional ProcessStatsStateProto total_running_state = 6;
4793}
4794
4795message PackageServiceOperationStatsProto {
4796 // Operate enum: Started, Foreground, Bound, Executing
4797 optional android.service.procstats.ServiceOperationState operation = 1;
4798
4799 // Number of times the service was in this operation.
4800 optional int32 count = 2;
4801
4802 // Information about a state the service can be in.
4803 message StateStats {
4804 // Screen state enum.
4805 optional android.service.procstats.ScreenState screen_state = 1;
4806 // Memory state enum.
4807 optional android.service.procstats.MemoryState memory_state = 2;
4808
4809 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004810 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004811 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004812 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004813 }
4814 repeated StateStats state_stats = 3;
4815}
4816
4817message PackageServiceStatsProto {
4818 // Name of service component.
4819 optional string service_name = 1;
4820
4821 // The operation stats.
4822 // The package_name, package_uid, package_version, service_name will not be set to save space.
4823 repeated PackageServiceOperationStatsProto operation_stats = 2;
4824}
4825
4826message PackageAssociationSourceProcessStatsProto {
4827 // Uid of the process.
4828 optional int32 process_uid = 1;
4829 // Process name.
4830 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004831 // Package name.
4832 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004833 // Total count of the times this association appeared.
4834 optional int32 total_count = 3;
4835
4836 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004837 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004838
4839 // Total count of the times this association became actively impacting its target process.
4840 optional int32 active_count = 5;
4841
4842 // Information on one source in this association.
4843 message StateStats {
4844 // Process state enum.
4845 optional android.service.procstats.ProcessState process_state = 1;
4846 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004847 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004848 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004849 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004850 }
4851 repeated StateStats active_state_stats = 6;
4852}
4853
4854message PackageAssociationProcessStatsProto {
4855 // Name of the target component.
4856 optional string component_name = 1;
4857 // Information on one source in this association.
4858 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4859}
4860
4861
4862message ProcessStatsPackageProto {
4863 // Name of package.
4864 optional string package = 1;
4865
4866 // Uid of the package.
4867 optional int32 uid = 2;
4868
4869 // Version of the package.
4870 optional int64 version = 3;
4871
4872 // Stats for each process running with the package loaded in to it.
4873 repeated ProcessStatsProto process_stats = 4;
4874
4875 // Stats for each of the package's services.
4876 repeated PackageServiceStatsProto service_stats = 5;
4877
4878 // Stats for each association with the package.
4879 repeated PackageAssociationProcessStatsProto association_stats = 6;
4880}
4881
4882message ProcessStatsSectionProto {
4883 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004884 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004885
4886 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004887 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004888
4889 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004890 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004891
4892 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004893 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004894
4895 // System runtime library. e.g. "libdvm.so", "libart.so".
4896 optional string runtime = 5;
4897
4898 // whether kernel reports swapped pss.
4899 optional bool has_swapped_pss = 6;
4900
4901 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4902 enum Status {
4903 STATUS_UNKNOWN = 0;
4904 STATUS_COMPLETE = 1;
4905 STATUS_PARTIAL = 2;
4906 STATUS_SHUTDOWN = 3;
4907 STATUS_SYSPROPS = 4;
4908 }
4909 repeated Status status = 7;
4910
Chenjie Yub2ecc792019-01-17 10:27:26 -08004911 // Number of pages available of various types and sizes, representation fragmentation.
4912 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4913
Yangsteraf9aee72018-10-12 09:26:16 -07004914 // Stats for each process.
4915 repeated ProcessStatsProto process_stats = 8;
4916
4917 // Stats for each package.
4918 repeated ProcessStatsPackageProto package_stats = 9;
4919}
4920
Chenjie Yub2ecc792019-01-17 10:27:26 -08004921message ProcessStatsAvailablePagesProto {
4922 // Node these pages are in (as per /proc/pagetypeinfo)
4923 optional int32 node = 1;
4924
4925 // Zone these pages are in (as per /proc/pagetypeinfo)
4926 optional string zone = 2;
4927
4928 // Label for the type of these pages (as per /proc/pagetypeinfo)
4929 optional string label = 3;
4930
4931 // Distribution of number of pages available by order size. First entry in array is
4932 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4933 repeated int32 pages_per_order = 4;
4934}
4935
Chenjie Yu12e5e672018-09-14 15:54:59 -07004936/**
4937 * Pulled from ProcessStatsService.java
4938 */
4939message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004940 optional ProcessStatsSectionProto proc_stats_section = 1;
4941}
4942
Chenjie Yuf910b7802019-01-11 16:08:20 -08004943/**
4944 * Pulled from ProcessStatsService.java
4945 */
4946message ProcStatsPkgProc {
4947 optional ProcessStatsSectionProto proc_stats_section = 1;
4948}
4949
Yangsteraf9aee72018-10-12 09:26:16 -07004950message PowerProfileProto {
4951 optional double cpu_suspend = 1;
4952
4953 optional double cpu_idle = 2;
4954
4955 optional double cpu_active = 3;
4956
4957 message CpuCluster {
4958 optional int32 id = 1;
4959 optional double cluster_power = 2;
4960 optional int32 cores = 3;
4961 repeated int64 speed = 4;
4962 repeated double core_power = 5;
4963 }
4964
4965 repeated CpuCluster cpu_cluster = 40;
4966
4967 optional double wifi_scan = 4;
4968
4969 optional double wifi_on = 5;
4970
4971 optional double wifi_active = 6;
4972
4973 optional double wifi_controller_idle = 7;
4974
4975 optional double wifi_controller_rx = 8;
4976
4977 optional double wifi_controller_tx = 9;
4978
4979 repeated double wifi_controller_tx_levels = 10;
4980
4981 optional double wifi_controller_operating_voltage = 11;
4982
4983 optional double bluetooth_controller_idle = 12;
4984
4985 optional double bluetooth_controller_rx = 13;
4986
4987 optional double bluetooth_controller_tx = 14;
4988
4989 optional double bluetooth_controller_operating_voltage = 15;
4990
4991 optional double modem_controller_sleep = 16;
4992
4993 optional double modem_controller_idle = 17;
4994
4995 optional double modem_controller_rx = 18;
4996
4997 repeated double modem_controller_tx = 19;
4998
4999 optional double modem_controller_operating_voltage = 20;
5000
5001 optional double gps_on = 21;
5002
5003 repeated double gps_signal_quality_based = 22;
5004
5005 optional double gps_operating_voltage = 23;
5006
5007 optional double bluetooth_on = 24;
5008
5009 optional double bluetooth_active = 25;
5010
5011 optional double bluetooth_at_cmd = 26;
5012
5013 optional double ambient_display = 27;
5014
5015 optional double screen_on = 28;
5016
5017 optional double radio_on = 29;
5018
5019 optional double radio_scanning = 30;
5020
5021 optional double radio_active = 31;
5022
5023 optional double screen_full = 32;
5024
5025 optional double audio = 33;
5026
5027 optional double video = 34;
5028
5029 optional double flashlight = 35;
5030
5031 optional double memory = 36;
5032
5033 optional double camera = 37;
5034
5035 optional double wifi_batched_scan = 38;
5036
5037 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005038}
Chenjie Yuab530202018-09-26 12:39:20 -07005039
5040/**
5041 * power_profile.xml and other constants for power model calculations.
5042 * Pulled from PowerProfile.java
5043 */
5044message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005045 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005046}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005047
5048/**
arangelovd5db50e2018-10-12 20:24:39 +01005049 * Logs when a user restriction was added or removed.
5050 *
5051 * Logged from:
5052 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5053 */
5054message UserRestrictionChanged {
5055 // The raw string of the user restriction as defined in UserManager.
5056 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5057 optional string restriction = 1;
5058 // Whether the restriction is enabled or disabled.
5059 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005060}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005061
5062/**
5063 * Pulls process user time and system time. Puller takes a snapshot of all pids
5064 * in the system and returns cpu stats for those that are working at the time.
5065 * Dead pids will be dropped. Kernel processes are excluded.
5066 * Min cool-down is 5 sec.
5067 */
5068message ProcessCpuTime {
5069 optional int32 uid = 1 [(is_uid) = true];
5070
5071 optional string process_name = 2;
5072 // Process cpu time in user space, cumulative from boot/process start
5073 optional int64 user_time_millis = 3;
5074 // Process cpu time in system space, cumulative from boot/process start
5075 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005076}
Misha Wagner5a51e002018-10-03 15:04:09 +01005077
5078/**
5079 * Pulls the CPU usage for each thread.
5080 *
5081 * Read from /proc/$PID/task/$TID/time_in_state files.
5082 *
5083 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5084 * time_in_state files not being present on some phones, have not been addressed. These should be
5085 * considered before a public release.
5086 */
5087message CpuTimePerThreadFreq {
5088 // UID that owns the process.
5089 optional int32 uid = 1 [(is_uid) = true];
5090 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005091 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005092 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005093 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005094 // Name of the process taken from `/proc/$PID/cmdline`.
5095 optional string process_name = 4;
5096 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5097 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005098
5099 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5100 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5101 // frequencies are given here as the alternative is sending eight separate atoms. This method
5102 // significantly reduces the amount of data created
5103 optional int32 frequency1_khz = 6;
5104 optional int32 time1_millis = 7;
5105 optional int32 frequency2_khz = 8;
5106 optional int32 time2_millis = 9;
5107 optional int32 frequency3_khz = 10;
5108 optional int32 time3_millis = 11;
5109 optional int32 frequency4_khz = 12;
5110 optional int32 time4_millis = 13;
5111 optional int32 frequency5_khz = 14;
5112 optional int32 time5_millis = 15;
5113 optional int32 frequency6_khz = 16;
5114 optional int32 time6_millis = 17;
5115 optional int32 frequency7_khz = 18;
5116 optional int32 time7_millis = 19;
5117 optional int32 frequency8_khz = 20;
5118 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005119}
Bookatz75ee60422018-11-09 12:27:37 -08005120
5121/**
Bookatz366a4432018-11-20 09:42:33 -08005122 * Pulls information about the device's build.
5123 */
5124message BuildInformation {
5125 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5126 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5127 optional string fingerprint = 1;
5128
5129 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5130 optional string brand = 2;
5131
5132 // Build.PRODUCT. The name of the overall product.
5133 optional string product = 3;
5134
5135 // Build.DEVICE. The name of the industrial design.
5136 optional string device = 4;
5137
5138 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5139 optional string version_release = 5;
5140
5141 // Build.ID. E.g. a label like "M4-rc20".
5142 optional string id = 6;
5143
5144 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5145 // represent this build.
5146 optional string version_incremental = 7;
5147
5148 // Build.TYPE. The type of build, like "user" or "eng".
5149 optional string type = 8;
5150
5151 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5152 optional string tags = 9;
5153}
5154
5155/**
Adam He420947c2019-01-23 15:59:09 -08005156 * Logs information about mismatched caller for content capture.
5157 *
5158 * Logged from:
5159 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5160 */
5161message ContentCaptureCallerMismatchReported {
5162 optional string intended_package = 1;
5163 optional string calling_package = 2;
5164}
5165
5166/**
5167 * Logs information about content capture service events.
5168 *
5169 * Logged from:
5170 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5171 */
5172message ContentCaptureServiceEvents {
5173 // The type of event.
5174 enum Event {
5175 UNKNOWN = 0;
5176 ON_CONNECTED = 1;
5177 ON_DISCONNECTED = 2;
5178 SET_WHITELIST = 3;
5179 SET_DISABLED = 4;
5180 ON_USER_DATA_REMOVED = 5;
5181 }
5182 optional Event event = 1;
5183 // component/package of content capture service.
5184 optional string service_info = 2;
5185 // component/package of target.
5186 // it's a concatenated list of component/package for SET_WHITELIST event
5187 // separated by " ".
5188 optional string target_info = 3;
5189}
5190
5191/**
5192 * Logs information about content capture session events.
5193 *
5194 * Logged from:
5195 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5196 */
5197message ContentCaptureSessionEvents {
5198 // The type of event.
5199 enum Event {
5200 UNKNOWN = 0;
5201 ON_SESSION_STARTED = 1;
5202 ON_SESSION_FINISHED = 2;
5203 SESSION_NOT_CREATED = 3;
5204 }
5205 optional int32 session_id = 1;
5206 optional Event event = 2;
5207 // (n/a on session finished)
5208 optional int32 state_flags = 3;
5209 // component/package of content capture service.
5210 optional string service_info = 4;
5211 // component/package of app.
5212 // (n/a on session finished)
5213 optional string app_info = 5;
5214 optional bool is_child_session = 6;
5215}
5216
5217/**
5218 * Logs information about session being flushed.
5219 *
5220 * Logged from:
5221 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5222 */
5223message ContentCaptureFlushed {
5224 optional int32 session_id = 1;
5225 // component/package of content capture service.
5226 optional string service_info = 2;
5227 // component/package of app.
5228 optional string app_info = 3;
5229 // session start/finish events
5230 optional int32 child_session_started = 4;
5231 optional int32 child_session_finished = 5;
5232 // count of view events.
5233 optional int32 view_appeared_count = 6;
5234 optional int32 view_disappeared_count = 7;
5235 optional int32 view_text_changed_count = 8;
5236
5237 // Flush stats.
5238 optional int32 max_events = 9;
5239 optional int32 idle_flush_freq = 10;
5240 optional int32 text_flush_freq = 11;
5241 optional int32 flush_reason = 12;
5242}
5243
5244/**
Bookatz75ee60422018-11-09 12:27:37 -08005245 * Pulls on-device BatteryStats power use calculations for the overall device.
5246 */
5247message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005248 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5249 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5250 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5251 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005252}
5253
5254/**
5255 * Pulls on-device BatteryStats power use calculations broken down by uid.
5256 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5257 * that is attributed to non-uid items. They must all be included to get the total power use.
5258 */
5259message DeviceCalculatedPowerBlameUid {
5260 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5261 optional int32 uid = 1 [(is_uid) = true];
5262
Bookatz3dbc13a2018-12-21 12:16:51 -08005263 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5264 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5265 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005266}
5267
5268/**
5269 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5270 * drain type.
5271 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5272 * is attributed uids. They must all be included to get the total power use.
5273 */
5274message DeviceCalculatedPowerBlameOther {
5275 // The type of item whose power use is being reported.
5276 enum DrainType {
5277 AMBIENT_DISPLAY = 0;
5278 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5279 BLUETOOTH = 2;
5280 CAMERA = 3;
5281 // Cell-standby
5282 CELL = 4;
5283 FLASHLIGHT = 5;
5284 IDLE = 6;
5285 MEMORY = 7;
5286 // Amount that total computed drain exceeded the drain estimated using the
5287 // battery level changes and capacity.
5288 OVERCOUNTED = 8;
5289 PHONE = 9;
5290 SCREEN = 10;
5291 // Amount that total computed drain was below the drain estimated using the
5292 // battery level changes and capacity.
5293 UNACCOUNTED = 11;
5294 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5295 WIFI = 13;
5296 }
5297 optional DrainType drain_type = 1;
5298
Bookatz3dbc13a2018-12-21 12:16:51 -08005299 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5300 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5301 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005302}
arangelov4e994062018-11-13 16:12:38 +00005303
5304/**
5305 * Logs device policy features.
5306 *
5307 * Logged from:
5308 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5309 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5310 */
5311message DevicePolicyEvent {
5312 // The event id - unique for each event.
5313 optional android.stats.devicepolicy.EventId event_id = 1;
5314 // The admin package name.
5315 optional string admin_package_name = 2;
5316 // A generic integer parameter.
5317 optional int32 integer_value = 3;
5318 // A generic boolean parameter.
5319 optional bool boolean_value = 4;
5320 // A parameter specifying a time period in milliseconds.
5321 optional uint64 time_period_millis = 5;
5322 // A parameter specifying a list of package names, bundle extras or string parameters.
5323 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5324}
shawnlinea5b66b2018-11-13 15:05:29 +08005325
5326/**
5327 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5328 *
5329 * Logged from:
5330 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5331 */
5332message DocsUILaunchReported {
5333 optional android.stats.docsui.LaunchAction launch_action = 1;
5334 optional bool has_initial_uri = 2;
5335 optional android.stats.docsui.MimeType mime_type = 3;
5336 optional android.stats.docsui.Root initial_root = 4;
5337}
5338
5339/**
5340 * Logs root/app visited event in file managers/picker. Call this when the user
5341 * taps on root/app in hamburger menu.
5342 *
5343 * Logged from:
5344 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5345 */
5346message DocsUIRootVisitedReported {
5347 optional android.stats.docsui.ContextScope scope = 1;
5348 optional android.stats.docsui.Root root = 2;
5349}
5350
5351/**
5352 * Logs file operation stats. Call this when a file operation has completed.
5353 *
5354 * Logged from:
5355 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5356 */
5357message DocsUIFileOperationReported {
5358 optional android.stats.docsui.Provider provider = 1;
5359 optional android.stats.docsui.FileOperation file_op = 2;
5360}
5361
5362/**
5363 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5364 * mode.
5365 *
5366 * Logged from:
5367 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5368 */
5369message DocsUIFileOperationCopyMoveModeReported {
5370 optional android.stats.docsui.FileOperation file_op = 1;
5371 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5372}
5373
5374
5375/**
5376 * Logs file sub operation stats. Call this when a file operation has failed.
5377 *
5378 * Logged from:
5379 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5380 */
5381message DocsUIFileOperationFailureReported {
5382 optional android.stats.docsui.Authority authority = 1;
5383 optional android.stats.docsui.SubFileOperation sub_op = 2;
5384}
5385
5386/**
5387* Logs the cancellation of a file operation. Call this when a job is canceled
5388*
5389* Logged from:
5390* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5391*/
5392message DocsUIFileOperationCanceledReported {
5393 optional android.stats.docsui.FileOperation file_op = 1;
5394}
5395
5396/**
5397 * Logs startup time in milliseconds.
5398 *
5399 * Logged from:
5400 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5401 */
5402message DocsUIStartupMsReported {
5403 optional int32 startup_millis = 1;
5404}
5405
5406/**
5407 * Logs the action that was started by user.
5408 *
5409 * Logged from:
5410 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5411 */
5412message DocsUIUserActionReported {
5413 optional android.stats.docsui.UserAction action = 1;
5414}
5415
5416/**
5417 * Logs the invalid type when invalid scoped access is requested.
5418 *
5419 * Logged from:
5420 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5421 */
5422message DocsUIInvalidScopedAccessRequestReported {
5423 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005424}
Ben Murdochbab399f62018-12-06 11:01:38 +00005425
5426/**
shawnlina75e82d2019-01-07 10:31:12 +08005427 * Logs the package name that launches docsui picker mode.
5428 *
5429 * Logged from:
5430 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5431 */
5432message DocsUIPickerLaunchedFromReported {
5433 optional string package_name = 1;
5434}
5435
5436/**
5437 * Logs the search type.
5438 *
5439 * Logged from:
5440 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5441 */
5442message DocsUISearchTypeReported {
5443 optional android.stats.docsui.SearchType search_type = 1;
5444}
5445
5446/**
5447 * Logs the search mode.
5448 *
5449 * Logged from:
5450 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5451 */
5452message DocsUISearchModeReported {
5453 optional android.stats.docsui.SearchMode search_mode = 1;
5454}
5455
5456/**
5457 * Logs the pick result information.
5458 *
5459 * Logged from:
5460 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5461 */
5462message DocsUIPickResultReported {
5463 optional int32 total_action_count = 1;
5464 optional int64 duration_millis = 2;
5465 optional int32 file_count= 3;
5466 optional bool is_searching = 4;
5467 optional android.stats.docsui.Root picked_from = 5;
5468 optional android.stats.docsui.MimeType mime_type = 6;
5469 optional int32 repeatedly_pick_times = 7;
5470}
5471
5472/**
Ben Murdochbab399f62018-12-06 11:01:38 +00005473 * Logs when an app's memory is compacted.
5474 *
5475 * Logged from:
5476 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5477 */
5478message AppCompacted {
5479 // The pid of the process being compacted.
5480 optional int32 pid = 1;
5481
5482 // The name of the process being compacted.
5483 optional string process_name = 2;
5484
5485 // The type of compaction.
5486 enum Action {
5487 UNKNOWN = 0;
5488 SOME = 1;
5489 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005490 PERSISTENT = 3;
5491 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00005492 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005493 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00005494
5495 // Total RSS in kilobytes consumed by the process prior to compaction.
5496 optional int64 before_rss_total_kilobytes = 4;
5497
5498 // File RSS in kilobytes consumed by the process prior to compaction.
5499 optional int64 before_rss_file_kilobytes = 5;
5500
5501 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5502 optional int64 before_rss_anon_kilobytes = 6;
5503
5504 // Swap in kilobytes consumed by the process prior to compaction.
5505 optional int64 before_swap_kilobytes = 7;
5506
5507 // Total RSS in kilobytes consumed by the process after compaction.
5508 optional int64 after_rss_total_kilobytes = 8;
5509
5510 // File RSS in kilobytes consumed by the process after compaction.
5511 optional int64 after_rss_file_kilobytes = 9;
5512
5513 // Anonymous RSS in kilobytes consumed by the process after compaction.
5514 optional int64 after_rss_anon_kilobytes = 10;
5515
5516 // Swap in kilobytes consumed by the process after compaction.
5517 optional int64 after_swap_kilobytes = 11;
5518
5519 // The time taken to perform compaction in milliseconds.
5520 optional int64 time_to_compact_millis = 12;
5521
5522 // The last compaction action performed for this app.
5523 optional Action last_action = 13;
5524
Ben Murdoch01720b82018-12-19 18:03:44 +00005525 // The last time that compaction was attempted on this process in milliseconds
5526 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5527 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00005528
Ben Murdoch885c21b2019-03-15 18:02:04 +00005529 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005530 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00005531
5532 // The process state at the time of compaction.
5533 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005534
5535 // Free ZRAM in kilobytes before compaction.
5536 optional int64 before_zram_free_kilobytes = 17;
5537
5538 // Free ZRAM in kilobytes after compaction.
5539 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00005540}
lifr157fc552018-12-12 16:38:04 +08005541
5542/**
lifrb6b90b62019-03-29 00:40:17 +08005543 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5544 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5545 *
lifr1f74b052019-04-16 22:16:30 +08005546 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5547 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5548 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5549 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005550 */
5551message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08005552 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005553
lifr1f74b052019-04-16 22:16:30 +08005554 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005555
5556 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005557 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005558
lifr1f74b052019-04-16 22:16:30 +08005559 // Only valid for event_type = EVENT_GETADDRINFO.
5560 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005561
lifr1f74b052019-04-16 22:16:30 +08005562 // Flags passed to android_res_nsend() defined in multinetwork.h
5563 // Only valid for event_type = EVENT_RESNSEND.
5564 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005565
lifrad9becc2019-05-20 11:04:41 +08005566 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005567
5568 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08005569 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005570
5571 // Additional pass-through fields opaque to statsd.
5572 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08005573 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08005574
5575 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
5576 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08005577}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005578
5579/**
5580 * Logs when a data stall event occurs.
5581 *
5582 * Log from:
5583 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5584 */
5585message DataStallEvent {
5586 // Data stall evaluation type.
5587 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5588 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5589 optional int32 evaluation_type = 1;
5590 // See definition in data_stall_event.proto.
5591 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5592 // See definition in data_stall_event.proto.
5593 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5594 // See definition in data_stall_event.proto.
5595 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5596 // See definition in data_stall_event.proto.
5597 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5598 // See definition in data_stall_event.proto.
5599 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5600}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005601
5602/*
5603 * Logs when RescueParty resets some set of experiment flags.
5604 *
5605 * Logged from:
5606 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5607 */
5608message RescuePartyResetReported {
5609 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5610 optional int32 rescue_level = 1;
5611}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005612
5613/**
5614 * Logs when signed config is received from an APK, and if that config was applied successfully.
5615 * Logged from:
5616 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5617 */
5618message SignedConfigReported {
5619 enum Type {
5620 UNKNOWN_TYPE = 0;
5621 GLOBAL_SETTINGS = 1;
5622 }
5623 optional Type type = 1;
5624
5625 // The final status of the signed config received.
5626 enum Status {
5627 UNKNOWN_STATUS = 0;
5628 APPLIED = 1;
5629 BASE64_FAILURE_CONFIG = 2;
5630 BASE64_FAILURE_SIGNATURE = 3;
5631 SECURITY_EXCEPTION = 4;
5632 INVALID_CONFIG = 5;
5633 OLD_CONFIG = 6;
5634 SIGNATURE_CHECK_FAILED = 7;
5635 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005636 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005637 }
5638 optional Status status = 2;
5639
5640 // The version of the signed config processed.
5641 optional int32 version = 3;
5642
5643 // The package name that the config was extracted from.
5644 optional string from_package = 4;
5645
5646 enum Key {
5647 NO_KEY = 0;
5648 DEBUG = 1;
5649 PRODUCTION = 2;
5650 }
5651 // Which key was used to verify the config.
5652 optional Key verified_with = 5;
5653}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005654
5655/*
5656 * Logs GNSS Network-Initiated (NI) location events.
5657 *
5658 * Logged from:
5659 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5660 */
5661message GnssNiEventReported {
5662 // The type of GnssNiEvent.
5663 enum EventType {
5664 UNKNOWN = 0;
5665 NI_REQUEST = 1;
5666 NI_RESPONSE = 2;
5667 }
5668 optional EventType event_type = 1;
5669
5670 // An ID generated by HAL to associate NI notifications and UI responses.
5671 optional int32 notification_id = 2;
5672
5673 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005674 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005675
5676 // NI requires notification.
5677 optional bool need_notify = 4;
5678
5679 // NI requires verification.
5680 optional bool need_verify = 5;
5681
5682 // NI requires privacy override, no notification/minimal trace.
5683 optional bool privacy_override = 6;
5684
5685 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5686 // seconds.
5687 optional int32 timeout = 7;
5688
5689 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005690 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005691
5692 // String representing the requester of the network inititated location request.
5693 optional string requestor_id = 9;
5694
5695 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5696 // network initiated location request.
5697 optional string text = 10;
5698
5699 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005700 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005701
5702 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005703 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005704
5705 // True if SUPL ES is enabled.
5706 optional bool is_supl_es_enabled = 13;
5707
5708 // True if GNSS location is enabled.
5709 optional bool is_location_enabled = 14;
5710
5711 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005712 optional android.server.location.GnssUserResponseType user_response = 15;
5713}
5714
5715/**
5716 * Logs GNSS non-framework (NFW) location notification.
5717 *
5718 * Logged from:
5719 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5720 */
5721message GnssNfwNotificationReported {
5722 // Package name of the Android proxy application representing the non-framework entity that
5723 // requested location. Set to empty string if unknown.
5724 optional string proxy_app_package_name = 1;
5725
5726 // Protocol stack that initiated the non-framework location request.
5727 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5728
5729 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5730 // set to empty string. This field is opaque to the framework and used for logging purposes.
5731 optional string other_protocol_stack_name = 3;
5732
5733 // Source initiating/receiving the location information.
5734 optional android.server.location.NfwRequestor requestor = 4;
5735
5736 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5737 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5738 // and used for logging purposes.
5739 optional string requestor_id = 5;
5740
5741 // Indicates whether location information was provided for this request.
5742 optional android.server.location.NfwResponseType response_type = 6;
5743
5744 // True if the device is in user initiated emergency session.
5745 optional bool in_emergency_mode = 7;
5746
5747 // True if cached location is provided.
5748 optional bool is_cached_location = 8;
5749
5750 // True if proxy app permission mismatch between framework and GNSS HAL.
5751 optional bool is_permission_mismatched = 9;
5752}
5753
5754/**
5755 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5756 *
5757 * Logged from:
5758 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5759 */
5760message GnssConfigurationReported {
5761 // SUPL host name.
5762 optional string supl_host = 1;
5763
5764 // SUPL port number.
5765 optional int32 supl_port = 2;
5766
5767 // C2K host name.
5768 optional string c2k_host = 3;
5769
5770 // C2K port number.
5771 optional int32 c2k_port = 4;
5772
5773 // The SUPL version requested by Carrier.
5774 optional int32 supl_ver = 5;
5775
5776 // The SUPL mode.
5777 optional android.server.location.SuplMode supl_mode = 6;
5778
5779 // True if NI emergency SUPL restrictions is enabled.
5780 optional bool supl_es = 7;
5781
5782 // LTE Positioning Profile settings
5783 optional android.server.location.LppProfile lpp_profile = 8;
5784
5785 // Positioning protocol on A-Glonass system.
5786 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5787
5788 // True if emergency PDN is used. Otherwise, regular PDN is used.
5789 optional bool use_emergency_pdn_for_emergency_supl= 10;
5790
5791 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5792 optional android.server.location.GpsLock gps_lock = 11;
5793
5794 // Number of seconds to extend the emergency session duration post emergency call.
5795 optional int32 es_extension_sec = 12;
5796
5797 // The full list of package names of proxy Android applications representing the non-framework
5798 // location access entities (on/off the device) for which the framework user has granted
5799 // non-framework location access permission. The package names are concatenated in one string
5800 // with spaces as separators.
5801 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005802}
Jack Yu95b64f32018-12-13 18:26:11 +08005803
5804/**
5805 * Logs when a NFC device's error occurred.
5806 * Logged from:
5807 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5808 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5809 */
5810message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005811 enum Type {
5812 UNKNOWN = 0;
5813 CMD_TIMEOUT = 1;
5814 ERROR_NOTIFICATION = 2;
5815 AID_OVERFLOW = 3;
5816 }
5817 optional Type type = 1;
5818 // If it's nci cmd timeout, log the timeout command.
5819 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005820
Alex Salod7c3eef2019-01-25 14:43:27 -08005821 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005822}
5823
5824/**
5825 * Logs when a NFC device's state changed event
5826 * Logged from:
5827 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5828 */
5829message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005830 enum State {
5831 UNKNOWN = 0;
5832 OFF = 1;
5833 ON = 2;
5834 ON_LOCKED = 3; // Secure Nfc enabled.
5835 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5836 }
5837 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005838}
5839
5840/**
5841 * Logs when a NFC Beam Transaction occurred.
5842 * Logged from:
5843 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5844 */
5845message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005846 enum Operation {
5847 UNKNOWN = 0;
5848 SEND = 1;
5849 RECEIVE = 2;
5850 }
5851 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005852}
5853
5854/**
5855 * Logs when a NFC Card Emulation Transaction occurred.
5856 * Logged from:
5857 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5858 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5859 */
5860message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005861 enum Category {
5862 UNKNOWN = 0;
5863 HCE_PAYMENT = 1;
5864 HCE_OTHER = 2;
5865 OFFHOST = 3;
5866 }
5867 // Transaction belongs to HCE payment or HCE other category, or offhost.
5868 optional Category category = 1;
5869 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5870 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005871}
5872
5873/**
5874 * Logs when a NFC Tag event occurred.
5875 * Logged from:
5876 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5877 */
5878message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005879 enum Type {
5880 UNKNOWN = 0;
5881 URL = 1;
5882 BT_PAIRING = 2;
5883 PROVISION = 3;
5884 WIFI_CONNECT = 4;
5885 APP_LAUNCH = 5;
5886 OTHERS = 6;
5887 }
5888 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005889}
5890
5891/**
5892 * Logs when Hce transaction triggered
5893 * Logged from:
5894 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5895 */
5896message NfcHceTransactionOccurred {
5897 // The latency period(in microseconds) it took for the first HCE data
5898 // exchange.
5899 optional uint32 latency_micros = 1;
5900}
5901
5902/**
5903 * Logs when SecureElement state event changed
5904 * Logged from:
5905 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5906 */
5907message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005908 enum State {
5909 UNKNOWN = 0;
5910 INITIALIZED = 1;
5911 DISCONNECTED = 2;
5912 CONNECTED = 3;
5913 HALCRASH = 4;
5914 }
5915 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005916
Alex Salod7c3eef2019-01-25 14:43:27 -08005917 optional string state_change_reason = 2;
5918 // SIMx or eSEx.
5919 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005920}
5921
5922/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005923 * Information about a permission grant request
5924 */
5925message PermissionGrantRequestResultReported {
5926 // unique value identifying an API call. A API call might result in multiple of these atoms
5927 optional int64 request_id = 1;
5928
5929 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00005930 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005931
5932 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00005933 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005934
5935 // The permission to be granted
5936 optional string permission_name = 4;
5937
5938 // If the permission was explicitly requested via the API or added by the system
5939 optional bool is_implicit = 5;
5940
5941 enum Result {
5942 UNDEFINED = 0;
5943 // permission request was ignored
5944 IGNORED = 1;
5945 // permission request was ignored because it was user fixed
5946 IGNORED_USER_FIXED = 2;
5947 // permission request was ignored because it was policy fixed
5948 IGNORED_POLICY_FIXED = 3;
5949 // permission was granted by user action
5950 USER_GRANTED = 4;
5951 // permission was automatically granted
5952 AUTO_GRANTED = 5;
5953 // permission was denied by user action
5954 USER_DENIED = 6;
5955 // permission was denied with prejudice by the user
5956 USER_DENIED_WITH_PREJUDICE = 7;
5957 // permission was automatically denied
5958 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07005959 // permission request was ignored because permission is restricted
5960 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01005961 // one time permission was granted by user action
5962 USER_GRANTED_ONE_TIME = 10;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005963 }
5964 // The result of the permission grant
5965 optional Result result = 6;
5966}
5967
5968/**
Jack Yu95b64f32018-12-13 18:26:11 +08005969 * Logs when Omapi API used
5970 * Logged from:
5971 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5972 */
5973message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005974 enum Operation {
5975 UNKNOWN = 0;
5976 OPEN_CHANNEL = 1;
5977 }
5978 optional Operation operation = 1;
5979 // SIMx or eSEx.
5980 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005981
Alex Salod7c3eef2019-01-25 14:43:27 -08005982 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005983}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005984
5985/**
Alex Saloa060aee2019-01-21 14:36:41 -08005986 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5987 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005988 * Logged from:
5989 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5990 */
5991message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005992 optional int64 dispatch_latency_millis = 1;
5993}
5994
5995/**
5996 * Logs AttentionManagerService attention check result.
5997 *
5998 * Logged from:
5999 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6000 */
6001message AttentionManagerServiceResultReported {
6002 // See core/java/android/service/attention/AttentionService.java
6003 enum AttentionCheckResult {
6004 UNKNOWN = 20;
6005 ATTENTION_SUCCESS_ABSENT = 0;
6006 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006007 ATTENTION_FAILURE_UNKNOWN = 2;
6008 ATTENTION_FAILURE_CANCELLED = 3;
6009 ATTENTION_FAILURE_PREEMPTED = 4;
6010 ATTENTION_FAILURE_TIMED_OUT = 5;
6011 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006012 }
6013 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006014}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006015
6016/**
6017 * Logs when an adb connection changes state.
6018 *
6019 * Logged from:
6020 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6021 */
6022message AdbConnectionChanged {
6023 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6024 // previously selected for this system.
6025 optional int64 last_connection_time_millis = 1;
6026
6027 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6028 // to reconnect via adb without user interaction.
6029 optional int64 auth_window_millis = 2;
6030
6031 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6032 optional android.debug.AdbConnectionStateEnum state = 3;
6033
6034 // True if the 'always allow' option was selected for this system.
6035 optional bool always_allow = 4;
6036}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006037
6038/*
6039 * Logs the reported speech DSP status.
6040 *
6041 * Logged from:
6042 * Vendor audio implementation.
6043 */
6044message SpeechDspStatReported {
6045 // The total Speech DSP uptime in milliseconds.
6046 optional int32 total_uptime_millis = 1;
6047 // The total Speech DSP downtime in milliseconds.
6048 optional int32 total_downtime_millis = 2;
6049 optional int32 total_crash_count = 3;
6050 optional int32 total_recover_count = 4;
6051}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006052
6053/**
6054 * Logs USB connector contaminant status.
6055 *
6056 * Logged from: USB Service.
6057 */
6058message UsbContaminantReported {
6059 optional string id = 1;
6060 optional android.service.usb.ContaminantPresenceStatus status = 2;
6061}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006062
6063/**
6064 * This atom is for debugging purpose.
6065 */
6066message DebugElapsedClock {
6067 // Monotically increasing value for each pull.
6068 optional int64 pull_count = 1;
6069 // Time from System.elapsedRealtime.
6070 optional int64 elapsed_clock_millis = 2;
6071 // Time from System.elapsedRealtime.
6072 optional int64 same_elapsed_clock_millis = 3;
6073 // Diff between current elapsed time and elapsed time from previous pull.
6074 optional int64 elapsed_clock_diff_millis = 4;
6075
6076 enum Type {
6077 TYPE_UNKNOWN = 0;
6078 ALWAYS_PRESENT = 1;
6079 PRESENT_ON_ODD_PULLS = 2;
6080 }
6081 // Type of behavior for the pulled data.
6082 optional Type type = 5;
6083}
6084
6085/**
6086 * This atom is for debugging purpose.
6087 */
6088message DebugFailingElapsedClock {
6089 // Monotically increasing value for each pull.
6090 optional int64 pull_count = 1;
6091 // Time from System.elapsedRealtime.
6092 optional int64 elapsed_clock_millis = 2;
6093 // Time from System.elapsedRealtime.
6094 optional int64 same_elapsed_clock_millis = 3;
6095 // Diff between current elapsed time and elapsed time from previous pull.
6096 optional int64 elapsed_clock_diff_millis = 4;
6097}
Steven Wuacef6bb2019-01-23 14:21:17 -05006098
6099/** Logs System UI bubbles event changed.
6100 *
6101 * Logged from:
6102 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6103 */
6104message BubbleUIChanged {
6105
6106 // The app package that is posting the bubble.
6107 optional string package_name = 1;
6108
6109 // The notification channel that is posting the bubble.
6110 optional string notification_channel = 2;
6111
6112 // The notification id associated with the posted bubble.
6113 optional int32 notification_id = 3;
6114
6115 // The position of the bubble within the bubble stack.
6116 optional int32 position = 4;
6117
6118 // The total number of bubbles within the bubble stack.
6119 optional int32 total_number = 5;
6120
6121 // User interactions with the bubble.
6122 enum Action {
6123 UNKNOWN = 0;
6124 POSTED = 1;
6125 UPDATED = 2;
6126 EXPANDED = 3;
6127 COLLAPSED = 4;
6128 DISMISSED = 5;
6129 STACK_DISMISSED = 6;
6130 STACK_MOVED = 7;
6131 HEADER_GO_TO_APP = 8;
6132 HEADER_GO_TO_SETTINGS = 9;
6133 PERMISSION_OPT_IN = 10;
6134 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006135 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006136 SWIPE_LEFT = 13;
6137 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006138 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04006139 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006140 }
6141 optional Action action = 6;
6142
6143 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6144 optional float normalized_x_position = 7;
6145 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006146
6147 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6148 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006149
6150 // Whether the bubble is an on-going one.
6151 optional bool is_ongoing = 10;
6152
6153 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006154 // This is deprecated and the value should be ignored.
6155 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006156}
Kweku Adams8845d012018-12-11 20:06:45 -08006157
6158/**
Steven Wu552f63f2019-02-05 13:41:36 -05006159 * Logs System UI bubbles developer errors.
6160 *
6161 * Logged from:
6162 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6163 */
6164message BubbleDeveloperErrorReported {
6165
6166 // The app package that is posting the bubble.
6167 optional string package_name = 1;
6168
6169 // Bubble developer error type enums.
6170 enum Error {
6171 UNKNOWN = 0;
6172 ACTIVITY_INFO_MISSING = 1;
6173 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6174 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6175 }
6176 optional Error error = 2 [default = UNKNOWN];
6177}
6178
6179/**
Kweku Adams8845d012018-12-11 20:06:45 -08006180 * Logs that a constraint for a scheduled job has changed.
6181 *
6182 * Logged from:
6183 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6184 */
6185message ScheduledJobConstraintChanged {
6186 repeated AttributionNode attribution_node = 1;
6187
6188 // Name of the job.
6189 optional string job_name = 2;
6190
6191 optional com.android.server.job.ConstraintEnum constraint = 3;
6192
6193 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006194 UNKNOWN = 0;
6195 UNSATISFIED = 1;
6196 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006197 }
6198 optional State state = 4;
6199}
Alex Salod7c3eef2019-01-25 14:43:27 -08006200
6201/**
6202 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6203 * returns true.
6204 *
6205 * Logged from:
6206 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6207 */
6208message ScreenTimeoutExtensionReported {
6209 // Describes how many times in a row did the power manager reset the screen off timeout.
6210 optional uint32 consecutive_timeout_extended_count = 1;
6211}
Hui Yu885aca12019-01-10 17:11:34 -08006212
6213/*
6214* Logs number of milliseconds it takes to start a process.
6215* The definition of app process start time is from the app launch time to
6216* the time that Zygote finished forking the app process and loaded the
6217* application package's java classes.
6218
6219* This metric is different from AppStartOccurred which is for foreground
6220* activity only.
6221
6222* ProcessStartTime can report all processes (both foreground and background)
6223* start time.
6224*
6225* Logged from:
6226* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6227*/
6228message ProcessStartTime {
6229 // The uid of the ProcessRecord.
6230 optional int32 uid = 1 [(is_uid) = true];
6231
6232 // The process pid.
6233 optional int32 pid = 2;
6234
6235 // The process name.
6236 // Usually package name, "system" for system server.
6237 // Provided by ActivityManagerService.
6238 optional string process_name = 3;
6239
6240 enum StartType {
6241 UNKNOWN = 0;
6242 WARM = 1;
6243 HOT = 2;
6244 COLD = 3;
6245 }
6246
6247 // The start type.
6248 optional StartType type = 4;
6249
6250 // The elapsed realtime at the start of the process.
6251 optional int64 process_start_time_millis = 5;
6252
6253 // Number of milliseconds it takes to reach bind application.
6254 optional int32 bind_application_delay_millis = 6;
6255
6256 // Number of milliseconds it takes to finish start of the process.
6257 optional int32 process_start_delay_millis = 7;
6258
6259 // hostingType field in ProcessRecord, the component type such as "activity",
6260 // "service", "content provider", "broadcast" or other strings.
6261 optional string hosting_type = 8;
6262
6263 // hostingNameStr field in ProcessRecord. The component class name that runs
6264 // in this process.
6265 optional string hosting_name = 9;
6266}
6267
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006268/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006269 * Track Media Codec usage
6270 * Logged from:
6271 * frameworks/av/media/libstagefright/MediaCodec.cpp
6272 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6273 */
6274message MediametricsCodecReported {
6275 optional int64 timestamp_nanos = 1;
6276 optional string package_name = 2;
6277 optional int64 package_version_code = 3;
6278 optional int64 media_apex_version = 4;
6279
6280 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6281}
6282
6283/**
6284 * Track Media Extractor (pulling video/audio streams out of containers) usage
6285 * Logged from:
6286 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6287 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6288 */
6289message MediametricsExtractorReported {
6290 optional int64 timestamp_nanos = 1;
6291 optional string package_name = 2;
6292 optional int64 package_version_code = 3;
6293 optional int64 media_apex_version = 4;
6294
6295 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6296}
6297
6298/**
6299 * Track how we arbitrate between microphone/input requests.
6300 * Logged from
6301 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6302 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6303 */
6304message MediametricsAudiopolicyReported {
6305 optional int64 timestamp_nanos = 1;
6306 optional string package_name = 2;
6307 optional int64 package_version_code = 3;
6308 optional int64 media_apex_version = 4;
6309
6310 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6311}
6312
6313/**
6314 * Track how we arbitrate between microphone requests.
6315 * Logged from
6316 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6317 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6318 */
6319message MediametricsAudiorecordReported {
6320 optional int64 timestamp_nanos = 1;
6321 optional string package_name = 2;
6322 optional int64 package_version_code = 3;
6323 optional int64 media_apex_version = 4;
6324
6325 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6326}
6327
6328/**
6329 * Track how we arbitrate between microphone/input requests.
6330 * Logged from
6331 * frameworks/av/media/libnblog/ReportPerformance.cpp
6332 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6333 */
6334message MediametricsAudiothreadReported {
6335 optional int64 timestamp_nanos = 1;
6336 optional string package_name = 2;
6337 optional int64 package_version_code = 3;
6338 optional int64 media_apex_version = 4;
6339
6340 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6341}
6342
6343/**
6344 * Track how we arbitrate between microphone/input requests.
6345 * Logged from
6346 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6347 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6348 */
6349message MediametricsAudiotrackReported {
6350 optional int64 timestamp_nanos = 1;
6351 optional string package_name = 2;
6352 optional int64 package_version_code = 3;
6353 optional int64 media_apex_version = 4;
6354
6355 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6356}
6357
6358/**
6359 * Track information about DRM framework performance
6360 * Logged from
6361 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6362 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6363 */
6364message MediametricsMediadrmReported {
6365 optional int64 timestamp_nanos = 1;
6366 optional string package_name = 2;
6367 optional int64 package_version_code = 3;
6368 optional int64 media_apex_version = 4;
6369
6370 // vendor+description tell about which DRM plugin is in use on this device
6371 optional string vendor = 5;
6372 optional string description = 6;
6373 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6374 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6375}
6376
6377/**
6378 * Track information about the widevine DRM plugin performance
6379 * Logged from
6380 * vendor/widevine/libwvdrmengine/cdm/metrics
6381 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6382 */
6383message MediametricsDrmWidevineReported {
6384 optional int64 timestamp_nanos = 1;
6385 optional string package_name = 2;
6386 optional int64 package_version_code = 3;
6387 optional int64 media_apex_version = 4;
6388
6389 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6390}
6391
6392/**
6393 * Track information about recordings (e.g. camcorder)
6394 * Logged from
6395 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6396 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6397 */
6398message MediametricsRecorderReported {
6399 optional int64 timestamp_nanos = 1;
6400 optional string package_name = 2;
6401 optional int64 package_version_code = 3;
6402 optional int64 media_apex_version = 4;
6403
6404 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6405}
6406
6407/**
6408 * Track Media Player usage
6409 * Logged from:
6410 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6411 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6412 */
6413message MediametricsNuPlayerReported {
6414 optional int64 timestamp_nanos = 1;
6415 optional string package_name = 2;
6416 optional int64 package_version_code = 3;
6417 optional int64 media_apex_version = 4;
6418
6419 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6420}
6421
6422/**
Robert Shiha4beed32019-08-19 14:15:23 -07006423 * Track Legacy DRM usage
6424 * Logged from
6425 * frameworks/av/drm/drmserver/DrmManager.cpp
6426 */
6427message MediametricsDrmManagerReported {
6428 optional int64 timestamp_nanos = 1;
6429 optional string package_name = 2;
6430 optional int64 package_version_code = 3;
6431 optional int64 media_apex_version = 4;
6432
6433 enum Method {
6434 METHOD_NOT_FOUND = -1;
6435 GET_CONSTRAINTS = 0;
6436 GET_METADATA = 1;
6437 CAN_HANDLE = 2;
6438 PROCESS_DRM_INFO = 3;
6439 ACQUIRE_DRM_INFO = 4;
6440 SAVE_RIGHTS = 5;
6441 GET_ORIGINAL_MIME_TYPE = 6;
6442 GET_DRM_OBJECT_TYPE = 7;
6443 CHECK_RIGHTS_STATUS = 8;
6444 REMOVE_RIGHTS = 9;
6445 REMOVE_ALL_RIGHTS = 10;
6446 OPEN_CONVERT_SESSION = 11;
6447 OPEN_DECRYPT_SESSION = 12;
6448 }
6449
6450 // plugin_id+description inform which Legacy DRM plugins are still in use on device
6451 optional string plugin_id = 5;
6452 optional string description = 6;
6453 optional Method method = 7;
6454 optional string mime_types = 8;
6455}
6456
6457/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006458 * State of a dangerous permission requested by a package
6459 */
6460message DangerousPermissionState {
6461 // Name of the permission
6462 optional string permission_name = 1;
6463
6464 // Uid of the package
6465 optional int32 uid = 2 [(is_uid) = true];
6466
6467 // Package requesting the permission
6468 optional string package_name = 3;
6469
6470 // If the permission is granted to the uid
6471 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01006472
6473 // Permission flags as per android.content.pm.PermissionFlags
6474 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006475}
6476
Michael Groover4a0ca942019-01-24 17:41:25 -08006477/**
6478 * Logs when a package is denied access to a device identifier based on the new access requirements.
6479 *
6480 * Logged from:
6481 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6482 */
6483message DeviceIdentifierAccessDenied {
6484 // The name of the package denied access to the requested device identifier.
6485 optional string package_name = 1;
6486
6487 // The name of the device identifier method the package attempted to invoke.
6488 optional string method_name = 2;
6489
6490 // True if the package is preinstalled.
6491 optional bool is_preinstalled = 3;
6492
6493 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08006494 // Starting from Android 11, this boolean is not set and will always be false.
6495 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08006496}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006497
6498/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006499 * Pulls the ongoing mainline install train version code.
6500 * Pulled from StatsCompanionService
6501 */
6502message TrainInfo {
6503 optional int64 train_version_code = 1;
6504
6505 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006506
6507 optional string train_name = 3;
6508
6509 enum Status {
6510 UNKNOWN = 0;
6511 INSTALL_REQUESTED = 1;
6512 INSTALL_STARTED = 2;
6513 INSTALL_STAGED_NOT_READY = 3;
6514 INSTALL_STAGED_READY = 4;
6515 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006516 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6517 // and INSTALL_FAILURE_COMMIT.
6518 INSTALL_FAILURE = 6 [deprecated = true];
6519 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006520 INSTALL_CANCELLED = 7;
6521 INSTALLER_ROLLBACK_REQUESTED = 8;
6522 INSTALLER_ROLLBACK_INITIATED = 9;
6523 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6524 INSTALLER_ROLLBACK_STAGED = 11;
6525 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6526 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6527 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6528 INSTALLER_ROLLBACK_SUCCESS = 15;
6529 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006530 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6531 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6532 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6533 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6534 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6535 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006536 INSTALL_FAILURE_DOWNLOAD = 23;
6537 INSTALL_FAILURE_STATE_MISMATCH = 24;
6538 INSTALL_FAILURE_COMMIT = 25;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006539 }
6540 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006541}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006542
6543/**
6544 * Logs the gesture stage changed event.
6545 *
6546 * Logged from:
6547 * frameworks/base/packages/SystemUI/
6548 */
6549message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006550 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006551}
6552
6553/**
6554 * Logs the feedback type.
6555 *
6556 * Logged from:
6557 * frameworks/base/packages/SystemUI/
6558 */
6559message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006560 // Whether or not the gesture was used.
6561 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006562}
6563
6564/**
6565 * Logs the progress.
6566 *
6567 * Logged from:
6568 * frameworks/base/packages/SystemUI/
6569 */
6570message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006571 // [0,100] progress for the assist gesture.
6572 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006573}
Neil Fullerdb14b482019-02-05 19:44:44 +00006574
6575/*
6576 * Information about the time zone data on a device.
6577 */
6578message TimeZoneDataInfo {
6579 // A version identifier for the data set on device. e.g. "2018i"
6580 optional string tzdb_version = 1;
6581}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006582
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006583/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006584 * Logs the GPU stats global health information.
6585 *
6586 * Logged from:
6587 * frameworks/native/services/gpuservice/gpustats/
6588 */
6589message GpuStatsGlobalInfo {
6590 // Package name of the gpu driver.
6591 optional string driver_package_name = 1;
6592
6593 // Version name of the gpu driver.
6594 optional string driver_version_name = 2;
6595
6596 // Version code of the gpu driver.
6597 optional int64 driver_version_code = 3;
6598
6599 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
6600 optional int64 driver_build_time = 4;
6601
6602 // Total count of the gl driver gets loaded.
6603 optional int64 gl_loading_count = 5;
6604
6605 // Total count of the gl driver fails to be loaded.
6606 optional int64 gl_loading_failure_count = 6;
6607
6608 // Total count of the Vulkan driver gets loaded.
6609 optional int64 vk_loading_count = 7;
6610
6611 // Total count of the Vulkan driver fails to be loaded.
6612 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07006613
6614 // Api version of the system Vulkan driver.
6615 optional int32 vulkan_version = 9;
6616
6617 // Api version of the system CPU Vulkan driver.
6618 optional int32 cpu_vulkan_version = 10;
6619
6620 // Api version of the system GLES driver.
6621 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006622
6623 // Total count of the angle driver gets loaded.
6624 optional int64 angle_loading_count = 12;
6625
6626 // Total count of the angle driver fails to be loaded.
6627 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006628}
6629
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006630/**
6631 * GPU driver loading time info.
6632 */
6633message GpuDriverLoadingTime {
6634 // List of all the driver loading times for this app. The list size is
6635 // capped at 50.
6636 repeated int64 driver_loading_time = 1;
6637}
6638
6639/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006640 * Logs the GPU stats per app health information.
6641 *
6642 * Logged from:
6643 * frameworks/native/services/gpuservice/gpustats/
6644 */
6645message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006646 // Package name of the application that loads the gpu driver. Total number
6647 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006648 optional string app_package_name = 1;
6649
6650 // Version code of the gpu driver this app loads.
6651 optional int64 driver_version_code = 2;
6652
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006653 // gl driver loading time info.
6654 optional GpuDriverLoadingTime gl_driver_loading_time = 3
6655 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006656
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006657 // Vulkan driver loading time info.
6658 optional GpuDriverLoadingTime vk_driver_loading_time = 4
6659 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006660
6661 // Angle driver loading time info.
6662 optional GpuDriverLoadingTime angle_driver_loading_time = 5
6663 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07006664
6665 // CPU Vulkan implementation is in use.
6666 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07006667
6668 // App is not doing pre-rotation correctly.
6669 optional bool false_prerotation = 7;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006670}
Rafal Slawikd4e87572019-03-12 13:08:38 +00006671
6672/*
6673 * Logs the size of the system ion heap.
6674 *
6675 * Pulled from StatsCompanionService.
6676 */
6677message SystemIonHeapSize {
6678 // Size of the system ion heap in bytes.
6679 optional int64 size_in_bytes = 1;
6680}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006681
Rafal Slawik77987ed2019-06-17 12:28:23 +01006682/*
6683 * Logs the per-process size of the system ion heap.
6684 *
6685 * Pulled from StatsCompanionService.
6686 */
6687message ProcessSystemIonHeapSize {
6688 // The uid if available. -1 means not available.
6689 optional int32 uid = 1 [(is_uid) = true];
6690
6691 // The process name (from /proc/PID/cmdline).
6692 optional string process_name = 2;
6693
6694 // Sum of sizes of all allocations.
6695 optional int32 total_size_in_kilobytes = 3;
6696
6697 // Number of allocations.
6698 optional int32 allocation_count = 4;
6699
6700 // Size of the largest allocation.
6701 optional int32 max_size_in_kilobytes = 5;
6702}
6703
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006704/**
6705 * Push network stack events.
6706 *
6707 * Log from:
6708 * frameworks/base/packages/NetworkStack/
6709 */
6710message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08006711 // The id that indicates the event reported from NetworkStack.
6712 optional int32 event_id = 1;
6713 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006714 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
6715}
Carmen Agimofa769c152019-03-04 14:39:14 +00006716
6717/**
6718 * Logs the apps that are installed on the external storage.
6719 * Pulled from:
6720 * StatsCompanionService
6721 */
6722message AppsOnExternalStorageInfo {
6723 // The type of the external storage.
6724 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
6725 // The name of the package that is installed on the external storage.
6726 optional string package_name = 2;
6727}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07006728
6729/**
6730 * Logs the settings related to Face.
6731 * Logged from:
6732 * frameworks/base/services/core/java/com/android/server/stats
6733 */
6734message FaceSettings {
6735 // Whether or not face unlock is allowed on Keyguard.
6736 optional bool unlock_keyguard_enabled = 1;
6737 // Whether or not face unlock dismisses the Keyguard.
6738 optional bool unlock_dismisses_keyguard = 2;
6739 // Whether or not face unlock requires attention.
6740 optional bool unlock_attention_required = 3;
6741 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
6742 optional bool unlock_app_enabled = 4;
6743 // Whether or not face unlock always requires user confirmation.
6744 optional bool unlock_always_require_confirmation = 5;
6745 // Whether or not a diverse set of poses are required during enrollment.
6746 optional bool unlock_diversity_required = 6;
6747}
Maggie White442b6312019-04-05 16:26:44 -07006748
6749/**
6750 * Logs cooling devices maintained by the kernel.
6751 *
6752 * Pulled from StatsCompanionService.java
6753 */
6754message CoolingDevice {
6755 // The type of cooling device being reported. Eg. CPU, GPU...
6756 optional android.os.CoolingTypeEnum device_location = 1;
6757 // The name of the cooling device source. Eg. CPU0
6758 optional string device_name = 2;
6759 // Current throttle state of the cooling device. The value can any unsigned
6760 // integer between 0 and max_state defined in its driver. 0 means device is
6761 // not in throttling, higher value means deeper throttling.
6762 optional int32 state = 3;
6763}
Ben Blount763a5d52019-04-10 11:48:58 -07006764
6765/**
6766 * Intelligence has several counter-type events that don't warrant a
6767 * full separate atom. These are primarily API call counters but also include
6768 * counters for feature usage and specific failure modes.
6769 *
6770 * Logged from the Intelligence mainline module.
6771 */
6772message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07006773 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07006774 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07006775 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07006776 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07006777 // How many times the event occured (to report a batch of high frequency events).
6778 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07006779 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07006780 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07006781}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07006782
6783/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07006784 * Logs when Car Power state changed.
6785 *
6786 * Logged from:
6787 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6788 */
6789message CarPowerStateChanged {
6790 // States come from CpmsState in CarPowerManagementService.java.
6791 enum State {
6792 WAIT_FOR_VHAL = 0;
6793 ON = 1;
6794 SHUTDOWN_PREPARE = 2;
6795 WAIT_FOR_FINISH = 3;
6796 SUSPEND = 4;
6797 SIMULATE_SLEEP = 5;
6798 }
6799 optional State state = 1;
6800}
6801
6802/**
6803 * Logs whether GarageMode is entered.
6804 *
6805 * Logged from:
6806 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6807 */
6808message GarageModeInfo {
6809 // Whether GarageMode is entered.
6810 optional bool is_garage_mode = 1;
6811}
Martijn Coenencd95d462019-04-25 17:09:45 +02006812
6813/**
6814 * Historical app ops data per package.
6815 */
6816message AppOps {
6817 // Uid of the package requesting the op
6818 optional int32 uid = 1 [(is_uid) = true];
6819
6820 // Nmae of the package performing the op
6821 optional string package_name = 2;
6822
6823 // operation id; maps to the OP_* constants in AppOpsManager.java
6824 optional int32 op_id = 3;
6825
6826 // The number of times the op was granted while the app was in the
6827 // foreground (only for trusted requests)
6828 optional int64 trusted_foreground_granted_count = 4;
6829
6830 // The number of times the op was granted while the app was in the
6831 // background (only for trusted requests)
6832 optional int64 trusted_background_granted_count = 5;
6833
6834 // The number of times the op was rejected while the app was in the
6835 // foreground (only for trusted requests)
6836 optional int64 trusted_foreground_rejected_count = 6;
6837
6838 // The number of times the op was rejected while the app was in the
6839 // background (only for trusted requests)
6840 optional int64 trusted_background_rejected_count = 7;
6841
6842 // For long-running operations, total duration of the operation
6843 // while the app was in the foreground (only for trusted requests)
6844 optional int64 trusted_foreground_duration_millis = 8;
6845
6846 // For long-running operations, total duration of the operation
6847 // while the app was in the background (only for trusted requests)
6848 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00006849
6850 // Whether AppOps is guarded by Runtime permission
6851 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02006852}
Hongyi Zhang700137e2019-05-23 21:19:36 -07006853
6854/**
6855 * Location Manager API Usage information(e.g. API under usage,
6856 * API call's parameters).
6857 * Logged from:
6858 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
6859 */
6860message LocationManagerApiUsageReported {
6861
6862 // Indicating if usage starts or usage ends.
6863 optional android.stats.location.UsageState state = 1;
6864
6865 // LocationManagerService's API in use.
6866 // We can identify which API from LocationManager is
6867 // invoking current LMS API by the combination of
6868 // API parameter(e.g. is_listener_null, is_intent_null,
6869 // is_location_request_null)
6870 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
6871
6872 // Name of the package calling the API.
6873 optional string calling_package_name = 3;
6874
6875 // Type of the location provider.
6876 optional android.stats.location.ProviderType provider = 4;
6877
6878 // Quality of the location request
6879 optional android.stats.location.LocationRequestQuality quality = 5;
6880
6881 // The desired interval for active location updates, in milliseconds.
6882 // Bucketized to reduce cardinality.
6883 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
6884
6885 // Minimum distance between location updates, in meters.
6886 // Bucketized to reduce cardinality.
6887 optional android.stats.location.SmallestDisplacementBucket
6888 bucketized_smallest_displacement = 7;
6889
6890 // The number of location updates.
6891 optional int64 num_updates = 8;
6892
6893 // The request expiration time, in millisecond since boot.
6894 // Bucketized to reduce cardinality.
6895 optional android.stats.location.ExpirationBucket
6896 bucketized_expire_in = 9;
6897
6898 // Type of Callback passed in for this API.
6899 optional android.stats.location.CallbackType callback_type = 10;
6900
6901 // The radius of the central point of the alert
6902 // region, in meters. Only for API REQUEST_GEOFENCE.
6903 // Bucketized to reduce cardinality.
6904 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
6905
6906 // Activity Importance of API caller.
6907 // Categorized to 3 types that are interesting from location's perspective.
6908 optional android.stats.location.ActivityImportance activiy_importance = 12;
6909}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01006910
6911/**
6912 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
6913 */
6914message ReviewPermissionsFragmentResultReported {
6915 // unique value identifying a permission group change. A permission group change might result
6916 // in multiple of these atoms
6917 optional int64 change_id = 1;
6918
6919 // UID of package the permission belongs to
6920 optional int32 uid = 2 [(is_uid) = true];
6921
6922 // Name of package the permission belongs to
6923 optional string package_name = 3;
6924
6925 // The permission to be granted
6926 optional string permission_name = 4;
6927
6928 // The result of the permission grant
6929 optional bool permission_granted = 5;
6930}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01006931
6932/**
6933* Information about results of permission upgrade by RuntimePermissionsUpgradeController
6934* Logged from: RuntimePermissionUpdgradeController
6935*/
6936message RuntimePermissionsUpgradeResult {
6937 // Permission granted as result of upgrade
6938 optional string permission_name = 1;
6939
6940 // UID of package granted permission
6941 optional int32 uid = 2 [(is_uid) = true];
6942
6943 // Name of package granted permission
6944 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01006945}
6946
6947/**
6948* Information about a buttons presented in GrantPermissionsActivty and choice made by user
6949*/
6950message GrantPermissionsActivityButtonActions {
6951 // Permission granted as result of upgrade
6952 optional string permission_group_name = 1;
6953
6954 // UID of package granted permission
6955 optional int32 uid = 2 [(is_uid) = true];
6956
6957 // Name of package requesting permission
6958 optional string package_name = 3;
6959
6960 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
6961 // LABEL_ constants in GrantPermissionActivity.java
6962 optional int32 buttons_presented = 4;
6963
6964 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
6965 optional int32 button_clicked = 5;
6966}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01006967
6968/**
6969 * Information about LocationAccessCheck notification presented to user
6970 */
6971message LocationAccessCheckNotificationAction {
6972
6973 // id which identifies single session of user interacting with permission controller
6974 optional int64 session_id = 1;
6975
6976 // Uid of package for which location access check is presented
6977 optional int32 package_uid = 2;
6978
6979 // Name of package for which location access check is presented
6980 optional string package_name = 3;
6981
6982 enum Result {
6983 UNDEFINED = 0;
6984 // notification was presented to the user
6985 NOTIFICATION_PRESENTED = 1;
6986 // notification was declined by the user
6987 NOTIFICATION_DECLINED = 2;
6988 // notification was clicked by the user
6989 NOTIFICATION_CLICKED = 3;
6990 }
6991
6992 // View / interaction recorded
6993 optional Result result = 4;
6994}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01006995
6996/**
6997 * Information about a permission grant or revoke made by user inside AppPermissionFragment
6998 */
6999message AppPermissionFragmentActionReported {
7000 // id which identifies single session of user interacting with permission controller
7001 optional int64 session_id = 1;
7002
7003 // unique value identifying a permission group change. A permission group change might result
7004 // in multiple of these atoms
7005 optional int64 change_id = 2;
7006
7007 // UID of package the permission belongs to
7008 optional int32 uid = 3 [(is_uid) = true];
7009
7010 // Name of package the permission belongs to
7011 optional string package_name = 4;
7012
7013 // The permission to be granted
7014 optional string permission_name = 5;
7015
7016 // The result of the permission grant
7017 optional bool permission_granted = 6;
7018}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007019
7020/**
7021* Information about a AppPermissionFragment viewed by user
7022*/
7023message AppPermissionFragmentViewed {
7024 // id which identifies single session of user interacting with permission controller
7025 optional int64 session_id = 1;
7026
7027 // UID of package for which permissions are viewed
7028 optional int32 uid = 2 [(is_uid) = true];
7029
7030 // Name of package for which permissions are viewed
7031 optional string package_name = 3;
7032
7033 // Permission group viewed
7034 optional string permission_group_name = 4;
7035}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007036
7037/**
7038* Information about a AppPermissionsFragment viewed by user
7039*/
7040message AppPermissionsFragmentViewed {
7041 // id which identifies single session of user interacting with permission controller
7042 optional int64 session_id = 1;
7043
7044 // id which identifies single view as every view might have several logging records
7045 // with different package information attached
7046 optional int64 view_id = 2;
7047
7048 // Permission group viewed
7049 optional string permission_group_name = 3;
7050
7051 // UID of package for which permissions are viewed
7052 optional int32 uid = 4 [(is_uid) = true];
7053
7054 // Name of package for which permissions are viewed
7055 optional string package_name = 5;
7056
7057 // Category in which permission is included
7058 enum Category {
7059 UNDEFINED = 0;
7060 ALLOWED = 1;
7061 ALLOWED_FOREGROUND = 2;
7062 DENIED = 3;
7063 }
7064 optional Category category = 6;
7065}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007066
7067/**
7068* Information about a PermissionAppsFragment viewed by user.
7069* Logged from ui/handheld/PermissionAppsFragment.java
7070*/
7071message PermissionAppsFragmentViewed {
7072 // id which identifies single session of user interacting with permission controller
7073 optional int64 session_id = 1;
7074
7075 // id which identifies single view as every view might have several logging records
7076 // with different package information attached
7077 optional int64 view_id = 2;
7078
7079 // Permission group viewed
7080 optional string permission_group_name = 3;
7081
7082 // UID of package for which permissions are viewed
7083 optional int32 uid = 4 [(is_uid) = true];
7084
7085 // Name of package for which permissions are viewed
7086 optional string package_name = 5;
7087
7088 // Category in which app is included
7089 enum Category {
7090 UNDEFINED = 0;
7091 ALLOWED = 1;
7092 ALLOWED_FOREGROUND = 2;
7093 DENIED = 3;
7094 }
7095 optional Category category = 6;
7096}
Tony Make2b1b672019-07-29 16:59:47 +01007097
7098/**
7099 * Logs when there is a smart selection related event.
7100 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7101 * Logged from: TextClassifierEventLogger.java
7102 */
7103message TextSelectionEvent {
7104 // A session ID.
7105 optional string session_id = 1;
7106
7107 // Event type of this event.
7108 optional android.stats.textclassifier.EventType event_type = 2;
7109
7110 // Name of the model that is involved in this event.
7111 optional string model_name = 3;
7112
7113 // Type of widget that was involved in triggering this event.
7114 optional android.stats.textclassifier.WidgetType widget_type = 4;
7115
7116 // Index of this event in a session.
7117 optional int32 event_index = 5;
7118
7119 // Entity type that is involved.
7120 optional string entity_type = 6;
7121
7122 // Relative word index of the start of the selection.
7123 optional int32 relative_word_start_index = 7;
7124
7125 // Relative word (exclusive) index of the end of the selection.
7126 optional int32 relative_word_end_index = 8;
7127
7128 // Relative word index of the start of the smart selection.
7129 optional int32 relative_suggested_word_start_index = 9;
7130
7131 // Relative word (exclusive) index of the end of the smart selection.
7132 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007133
7134 // Name of source package.
7135 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007136}
7137
7138/**
7139 * Logs when there is a smart linkify related event.
7140 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7141 * Logged from: TextClassifierEventLogger.java
7142 */
7143message TextLinkifyEvent {
7144 // A session ID.
7145 optional string session_id = 1;
7146
7147 // Event type of this event.
7148 optional android.stats.textclassifier.EventType event_type = 2;
7149
7150 // Name of the model that is involved in this event.
7151 optional string model_name = 3;
7152
7153 // Type of widget that was involved in triggering this event.
7154 optional android.stats.textclassifier.WidgetType widget_type = 4;
7155
7156 // Index of this event in a session.
7157 optional int32 event_index = 5;
7158
7159 // Entity type that is involved.
7160 optional string entity_type = 6;
7161
7162 // Number of links detected.
7163 optional int32 num_links = 7;
7164
7165 // The total length of all links.
7166 optional int32 linked_text_length = 8;
7167
7168 // Length of input text.
7169 optional int32 text_length = 9;
7170
7171 // Time spent on generating links in ms.
7172 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007173
7174 // Name of source package.
7175 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007176}
7177
7178/**
7179 * Logs when there is a conversation actions related event.
7180 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7181 * Logged from: TextClassifierEventLogger.java
7182 */
7183message ConversationActionsEvent {
7184 // A session ID.
7185 optional string session_id = 1;
7186
7187 // Event type of this event.
7188 optional android.stats.textclassifier.EventType event_type = 2;
7189
7190 // Name of the model that is involved in this event.
7191 optional string model_name = 3;
7192
7193 // Type of widget that was involved in triggering this event.
7194 optional android.stats.textclassifier.WidgetType widget_type = 4;
7195
7196 // The first entity type that is involved.
7197 optional string first_entity_type = 5;
7198
7199 // The second entity type that is involved.
7200 optional string second_entity_type = 6;
7201
7202 // The third entity type that is involved.
7203 optional string third_entity_type = 7;
7204
7205 // The score of the first entity type.
7206 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01007207
7208 // Name of source package.
7209 optional string package_name = 9;
Tony Make2b1b672019-07-29 16:59:47 +01007210}
7211
7212/**
7213 * Logs when there is a language detection related event.
7214 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7215 * Logged from: TextClassifierEventLogger.java
7216 */
7217message LanguageDetectionEvent {
7218 // A session ID.
7219 optional string session_id = 1;
7220
7221 // Event type of this event.
7222 optional android.stats.textclassifier.EventType event_type = 2;
7223
7224 // Name of the model that is involved in this event.
7225 optional string model_name = 3;
7226
7227 // Type of widget that was involved in triggering this event.
7228 optional android.stats.textclassifier.WidgetType widget_type = 4;
7229
7230 // Detected language.
7231 optional string language_tag = 5;
7232
7233 // Score of the detected language.
7234 optional float score = 6;
7235
7236 // Position of this action.
7237 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01007238
7239 // Name of source package.
7240 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01007241}
Tianjie Xu167c3db2019-07-22 14:25:14 -07007242
7243/**
7244 * Information about an OTA update attempt by update_engine.
7245 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7246 */
7247message UpdateEngineUpdateAttemptReported {
7248 // The number of attempts for the update engine to apply a given payload.
7249 optional int32 attempt_number = 1;
7250
7251 optional android.stats.otaupdate.PayloadType payload_type = 2;
7252
7253 // The total time in minutes for the update engine to apply a given payload.
7254 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
7255 // it's increased when the system is sleeping.
7256 optional int32 duration_boottime_in_minutes = 3;
7257
7258 // The total time in minutes for the update engine to apply a given payload.
7259 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
7260 // and it's not increased when the system is sleeping.
7261 optional int32 duration_monotonic_in_minutes = 4;
7262
7263 // The size of the payload in MiBs.
7264 optional int32 payload_size_mib = 5;
7265
7266 // The attempt result reported by the update engine for an OTA update.
7267 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
7268
7269 // The error code reported by the update engine after an OTA update attempt
7270 // on A/B devices.
7271 optional android.stats.otaupdate.ErrorCode error_code = 7;
7272
7273 // The build fingerprint of the source system. The value is read from a
7274 // system property when the device takes the update. e.g.
7275 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
7276 optional string source_fingerprint = 8;
7277}
7278
7279/**
7280 * Information about all the attempts the device make before finishing the
7281 * successful update.
7282 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7283 */
7284message UpdateEngineSuccessfulUpdateReported {
7285 // The number of attempts for the update engine to apply the payload for a
7286 // successful update.
7287 optional int32 attempt_count = 1;
7288
7289 optional android.stats.otaupdate.PayloadType payload_type = 2;
7290
7291 optional int32 payload_size_mib = 3;
7292
7293 // The total number of bytes downloaded by update_engine since the last
7294 // successful update.
7295 optional int32 total_bytes_downloaded_mib = 4;
7296
7297 // The ratio in percentage of the over-downloaded bytes compared to the
7298 // total bytes needed to successfully install the update. e.g. 200 if we
7299 // download 200MiB in total for a 100MiB package.
7300 optional int32 download_overhead_percentage = 5;
7301
7302 // The total time in minutes for the update engine to apply the payload for a
7303 // successful update.
7304 optional int32 total_duration_minutes = 6;
7305
7306 // The number of reboot of the device during a successful update.
7307 optional int32 reboot_count = 7;
7308}
Alec Mourie088e762019-07-02 13:10:55 -07007309
7310/**
7311 * Global display pipeline metrics reported by SurfaceFlinger.
7312 * Pulled from:
7313 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7314 */
7315message SurfaceflingerStatsGlobalInfo {
7316 // Total number of frames presented during the tracing period
7317 optional int64 total_frames = 1;
7318 // Total number of frames missed
7319 optional int64 missed_frames = 2;
7320 // Total number of frames that fell back to client composition
7321 optional int64 client_composition_frames = 3;
7322 // Total time the display was turned on
7323 optional int64 display_on_millis = 4;
7324 // Total time that was spent performing animations.
7325 // This is derived from the present-to-present layer histogram
7326 optional int64 animation_millis = 5;
7327}
7328
7329/**
7330 * Per-layer display pipeline metrics reported by SurfaceFlinger.
7331 * The number of layers uploaded will be restricted due to size limitations.
7332 * Pulled from:
7333 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7334 */
7335message SurfaceflingerStatsLayerInfo {
7336 // The layer for this set of metrics
7337 // For now we can infer that the package name is included in the layer
7338 // name.
7339 optional string layer_name = 1;
7340 // Total number of frames presented
7341 optional int64 total_frames = 2;
7342 // Total number of dropped frames while latching a buffer for this layer.
7343 optional int64 dropped_frames = 3;
7344 // Set of timings measured between successive presentation timestamps.
7345 optional FrameTimingHistogram present_to_present = 4
7346 [(android.os.statsd.log_mode) = MODE_BYTES];
7347 // Set of timings measured from when an app queued a buffer for
7348 // presentation, until the buffer was actually presented to the
7349 // display.
7350 optional FrameTimingHistogram post_to_present = 5
7351 [(android.os.statsd.log_mode) = MODE_BYTES];
7352 // Set of timings measured from when a buffer is ready to be presented,
7353 // until the buffer was actually presented to the display.
7354 optional FrameTimingHistogram acquire_to_present = 6
7355 [(android.os.statsd.log_mode) = MODE_BYTES];
7356 // Set of timings measured from when a buffer was latched by
7357 // SurfaceFlinger, until the buffer was presented to the display
7358 optional FrameTimingHistogram latch_to_present = 7
7359 [(android.os.statsd.log_mode) = MODE_BYTES];
7360 // Set of timings measured from the desired presentation to the actual
7361 // presentation time
7362 optional FrameTimingHistogram desired_to_present = 8
7363 [(android.os.statsd.log_mode) = MODE_BYTES];
7364 // Set of timings measured from when an app queued a buffer for
7365 // presentation, until the buffer was ready to be presented.
7366 optional FrameTimingHistogram post_to_acquire = 9
7367 [(android.os.statsd.log_mode) = MODE_BYTES];
7368}
7369
7370/**
7371 * Histogram of frame counts bucketed by time in milliseconds.
7372 * Because of size limitations, we hard-cap the number of buckets, with
7373 * buckets for corresponding to larger milliseconds being less precise.
7374 */
7375message FrameTimingHistogram {
7376 // Timings in milliseconds that describes a set of histogram buckets
7377 repeated int32 time_millis_buckets = 1;
7378 // Number of frames that match to each time_millis, i.e. the bucket
7379 // contents
7380 // It's required that len(time_millis) == len(frame_count)
7381 repeated int64 frame_counts = 2;
7382}
Emilian Peev6729f372019-08-29 09:14:09 -07007383
Emilian Peev6729f372019-08-29 09:14:09 -07007384/**
7385 * Information about camera facing and API level usage.
7386 * Logged from:
7387 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
7388 */
7389message CameraActionEvent {
7390 // Camera session duration
7391 optional int64 duration = 1;
7392
7393 // Camera API level used
7394 optional int32 api_level = 2;
7395
7396 // Name of client package
7397 optional string package_name = 3;
7398
7399 // Camera facing
7400 enum Facing {
7401 UNKNOWN = 0;
7402 BACK = 1;
7403 FRONT = 2;
7404 EXTERNAL = 3;
7405 }
7406 optional Facing facing = 4;
7407}
atrost01a20932019-08-28 15:40:37 +01007408
7409/**
7410 * Logs when a compatibility change is affecting an app.
7411 *
7412 * Logged from:
7413 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
7414 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
7415 */
7416message AppCompatibilityChangeReported {
7417 // The UID of the app being affected by the compatibilty change.
7418 optional int32 uid = 1 [(is_uid) = true];
7419
7420 // The ID of the change affecting the app.
7421 optional int64 change_id = 2;
7422
7423 enum State {
7424 UNKNOWN_STATE = 0;
7425 ENABLED = 1;
7426 DISABLED = 2;
7427 LOGGED = 3;
7428 }
7429
7430 // The state of the change - if logged from gating whether it was enabled or disabled, or just
7431 // logged otherwise.
7432 optional State state = 3;
7433
7434 enum Source {
7435 UNKNOWN_SOURCE = 0;
7436 APP_PROCESS = 1;
7437 SYSTEM_SERVER = 2;
7438 }
7439
7440 // Where it was logged from.
7441 optional Source source = 4;
7442
7443}
Hector Dearman40579f62019-11-01 13:19:30 +00007444
7445/**
7446 * Logged from
7447 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
7448 */
7449message PerfettoUploaded {
7450 enum Event {
7451 PERFETTO_UNDEFINED = 0;
7452 PERFETTO_TRACE_BEGIN = 1;
7453 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
7454 PERFETTO_ON_CONNECT = 3;
7455 PERFETTO_ON_TRACING_DISABLED = 4;
7456 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
7457 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
7458 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
7459 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
7460 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
7461 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
7462 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
7463 PERFETTO_TRIGGER_BEGIN = 12;
7464 PERFETTO_TRIGGER_SUCCESS = 13;
7465 PERFETTO_TRIGGER_FAILURE = 14;
7466 PERFETTO_HIT_GUARDRAILS = 15;
7467 PERFETTO_ON_TIMEOUT = 16;
7468 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
7469 }
7470
7471 // Which stage of the pipeline we are reporting from.
7472 optional Event event = 1;
7473
7474 // UUID matching the one set inside the SystemInfo trace packet.
7475 optional int64 trace_uuid_lsb = 2;
7476 optional int64 trace_uuid_msb = 3;
7477}
Mark Tabrya824a642019-11-05 12:26:12 -08007478
7479/**
7480 * Pulls client metrics on data transferred via Vehicle Maps Service.
7481 * Metrics are keyed by uid + layer.
7482 *
7483 * Pulled from:
7484 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
7485 */
7486message VmsClientStats {
7487 // UID of the VMS client app
7488 optional int32 uid = 1 [(is_uid) = true];
7489
7490 // VMS layer definition
7491 optional int32 layer_type = 2;
7492 optional int32 layer_channel = 3;
7493 optional int32 layer_version = 4;
7494
7495 // Bytes and packets sent by the client for the layer
7496 optional int64 tx_bytes = 5;
7497 optional int64 tx_packets = 6;
7498
7499 // Bytes and packets received by the client for the layer
7500 optional int64 rx_bytes = 7;
7501 optional int64 rx_packets = 8;
7502
7503 // Bytes and packets dropped due to client error
7504 optional int64 dropped_bytes = 9;
7505 optional int64 dropped_packets = 10;
7506}