blob: b9051daab6aede06f27234efad3ea645a3b2f62b [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";
Carmen Agimof6688a352019-01-30 19:36:04 +000053import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080054import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080055import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080056import "frameworks/base/core/proto/android/telephony/enums.proto";
57import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080058import "frameworks/base/core/proto/android/wifi/enums.proto";
Tony Make2b1b672019-07-29 16:59:47 +010059import "frameworks/base/core/proto/android/stats/textclassifier/textclassifier_enums.proto";
Tianjie Xu167c3db2019-07-22 14:25:14 -070060import "frameworks/base/core/proto/android/stats/otaupdate/updateengine_enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080061
Yao Chend54f9dd2017-10-17 17:37:48 +000062/**
Stefan Lafonae2df012017-11-14 09:17:21 -080063 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000064 * raw stats log events from the Android system, also known as "atoms."
65 *
66 * This field contains a single oneof with all of the available messages.
67 * The stats-log-api-gen tool runs as part of the Android build and
68 * generates the android.util.StatsLog class, which contains the constants
69 * and methods that Android uses to log.
70 *
Stefan Lafonae2df012017-11-14 09:17:21 -080071 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000072 * Instead, statsd on Android constructs these messages synthetically,
73 * in the format defined here and in stats_log.proto.
74 */
Stefan Lafonae2df012017-11-14 09:17:21 -080075message Atom {
76 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070077 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070078 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
79 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070080 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070081 BleScanResultReceived ble_scan_result_received = 4;
82 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080083 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070084 SyncStateChanged sync_state_changed = 7;
85 ScheduledJobStateChanged scheduled_job_state_changed = 8;
86 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070087 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080088 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
89 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
90 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070091 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
92 MemoryFactorStateChanged memory_factor_state_changed = 15;
93 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
94 CachedKillReported cached_kill_reported = 17;
95 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070096 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080097 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
98 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
99 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -0700100 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800101 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -0700102 CameraStateChanged camera_state_changed = 25;
103 FlashlightStateChanged flashlight_state_changed = 26;
104 UidProcessStateChanged uid_process_state_changed = 27;
105 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
106 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -0700107 BatteryLevelChanged battery_level_changed = 30;
108 ChargingStateChanged charging_state_changed = 31;
109 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -0700110 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800111 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -0700112 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
113 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -0700114 WifiLockStateChanged wifi_lock_state_changed = 37;
115 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
116 WifiScanStateChanged wifi_scan_state_changed = 39;
117 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700118 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700119 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700120 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900121 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700122 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800123 AnomalyDetected anomaly_detected = 46;
Andrei Oneada01ea52019-01-30 15:28:36 +0000124 AppBreadcrumbReported app_breadcrumb_reported = 47 [(allow_from_any_uid) = true];
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800125 AppStartOccurred app_start_occurred = 48;
126 AppStartCanceled app_start_canceled = 49;
127 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800128 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800129 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800130 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800131 LmkStateChanged lmk_state_changed = 54;
132 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800133 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800134 BootSequenceReported boot_sequence_reported = 57;
Andrei Oneada01ea52019-01-30 15:28:36 +0000135 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -0800136 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800137 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800138 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800139 KeyguardStateChanged keyguard_state_changed = 62;
140 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
141 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800142 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800143 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800144 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
145 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800146 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700147 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800148 SpeakerImpedanceReported speaker_impedance_reported = 71;
149 HardwareFailed hardware_failed = 72;
150 PhysicalDropDetected physical_drop_detected = 73;
151 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800152 MobileConnectionStateChanged mobile_connection_state_changed = 75;
153 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700154 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800155 AppCrashOccurred app_crash_occurred = 78;
156 ANROccurred anr_occurred = 79;
157 WTFOccurred wtf_occurred = 80;
158 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700159 GenericAtom generic_atom = 82;
jianjin6eada302019-02-28 11:25:57 -0800160 KeyValuePairsAtom key_value_pairs_atom = 83 [(allow_from_any_uid) = true];
Bookatza7020bd2018-08-28 16:29:35 -0700161 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700162 DeferredJobStatsReported deferred_job_stats_reported = 85;
Tej Singha72344992019-04-17 18:55:08 -0700163 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Kevin Chyn1741a072019-01-17 11:54:40 -0800164 BiometricAcquired biometric_acquired = 87;
165 BiometricAuthenticated biometric_authenticated = 88;
166 BiometricErrorOccurred biometric_error_occurred = 89;
Will Brockmanfbaa7912019-10-24 15:15:09 -0400167 UiEventReported ui_event_reported = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700168 BatteryHealthSnapshot battery_health_snapshot = 91;
169 SlowIo slow_io = 92;
170 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700171 PhoneServiceStateChanged phone_service_state_changed = 94;
172 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100173 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700174 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700175 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700176 // TODO: service state change is very noisy shortly after boot, as well
177 // as at other transitions - coming out of doze, device plugged in, etc.
178 // Consider removing this if it becomes a problem
179 ServiceStateChanged service_state_changed = 99;
180 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800181 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800182 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000183 DevicePolicyEvent device_policy_event = 103;
shawnlin9a1392a2019-04-09 16:21:17 +0800184 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled =
185 104 [(log_from_module) = "docsui"];
186 DocsUIFileOperationCopyMoveModeReported
187 docs_ui_file_op_copy_move_mode_reported =
188 105 [(log_from_module) = "docsui"];
189 DocsUIFileOperationFailureReported docs_ui_file_op_failure =
190 106 [(log_from_module) = "docsui"];
191 DocsUIFileOperationReported docs_ui_provider_file_op =
192 107 [(log_from_module) = "docsui"];
193 DocsUIInvalidScopedAccessRequestReported
194 docs_ui_invalid_scoped_access_request =
195 108 [(log_from_module) = "docsui"];
196 DocsUILaunchReported docs_ui_launch_reported =
197 109 [(log_from_module) = "docsui"];
198 DocsUIRootVisitedReported docs_ui_root_visited =
199 110 [(log_from_module) = "docsui"];
200 DocsUIStartupMsReported docs_ui_startup_ms =
201 111 [(log_from_module) = "docsui"];
202 DocsUIUserActionReported docs_ui_user_action_reported =
203 112 [(log_from_module) = "docsui"];
Bookatzda1798c2018-12-13 14:16:00 -0800204 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
205 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f62018-12-06 11:01:38 +0000206 AppCompacted app_compacted = 115;
lifre82d8f62019-03-25 20:33:21 +0800207 NetworkDnsEventReported network_dns_event_reported = 116 [(log_from_module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800208 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
209 117 [(log_from_module) = "docsui"];
210 DocsUIPickResultReported docs_ui_pick_result_reported =
211 118 [(log_from_module) = "docsui"];
212 DocsUISearchModeReported docs_ui_search_mode_reported =
213 119 [(log_from_module) = "docsui"];
214 DocsUISearchTypeReported docs_ui_search_type_reported =
215 120 [(log_from_module) = "docsui"];
Chiachang Wange512b262019-04-11 21:24:28 +0800216 DataStallEvent data_stall_event = 121 [(log_from_module) = "network_stack"];
Christian Brunschenf86039e2018-12-21 12:26:14 +0000217 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000218 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800219 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800220 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800221 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
222 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000223 AppDowngraded app_downgraded = 128;
224 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
225 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800226 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
227 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800228 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800229 NfcErrorOccurred nfc_error_occurred = 134;
230 NfcStateChanged nfc_state_changed = 135;
231 NfcBeamOccurred nfc_beam_occurred = 136;
232 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
233 NfcTagOccurred nfc_tag_occurred = 138;
234 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
235 SeStateChanged se_state_changed = 140;
236 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800237 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800238 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800239 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800240 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800241 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800242 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyne5a37fb2019-02-08 13:10:36 -0800243 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500244 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800245 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Jack Hec27040a2019-01-09 20:54:41 -0800246 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
247 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
248 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
249 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
250 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
251 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
252 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
253 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
254 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He1021a612019-01-20 21:22:46 -0800255 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
256 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
Jack Heaea26982019-04-04 11:19:48 -0700257 BluetoothDeviceInfoReported bluetooth_device_info_reported = 162;
Jack He1021a612019-01-20 21:22:46 -0800258 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
259 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
260 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
261 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
262 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Alex Salod7c3eef2019-01-25 14:43:27 -0800263 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800264 ProcessStartTime process_start_time = 169;
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700265 PermissionGrantRequestResultReported permission_grant_request_result_reported =
266 170 [(log_from_module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800267 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Michael Groover4a0ca942019-01-24 17:41:25 -0800268 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Steven Wu552f63f2019-02-05 13:41:36 -0500269 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
joshmccloskey8c3322e2019-01-09 18:25:57 -0800270 AssistGestureStageReported assist_gesture_stage_reported = 174;
271 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
272 AssistGestureProgressReported assist_gesture_progress_reported = 176;
Philip Quinn0eded622019-01-29 12:46:28 -0800273 TouchGestureClassified touch_gesture_classified = 177;
Andrei Onea4ad6d0c2019-02-08 13:54:12 +0000274 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true];
Kunhung Li286c52f2019-05-21 20:10:43 +0800275 StyleUIChanged style_ui_changed = 179 [(log_from_module) = "style"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700276 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Tej Singha72344992019-04-17 18:55:08 -0700277 180 [(log_from_module) = "permissioncontroller"];
Carmen Agimof6688a352019-01-30 19:36:04 +0000278 AppInstallOnExternalStorageReported app_install_on_external_storage_reported = 181;
Chiachang Wange512b262019-04-11 21:24:28 +0800279 NetworkStackReported network_stack_reported = 182 [(log_from_module) = "network_stack"];
Carmen Agimof6dcc5032019-03-01 16:20:09 +0000280 AppMovedStorageReported app_moved_storage_reported = 183;
joshmccloskey6f952b22019-03-25 20:59:35 -0700281 BiometricEnrolled biometric_enrolled = 184;
jianjin8f2dee02019-03-29 14:03:08 -0700282 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185;
283 TombStoneOccurred tomb_stone_occurred = 186;
Jack He71426802019-04-02 13:32:52 -0700284 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported = 187;
Ben Blount763a5d52019-04-10 11:48:58 -0700285 IntelligenceEventReported intelligence_event_reported =
286 188 [(log_from_module) = "intelligence"];
Tej Singha72344992019-04-17 18:55:08 -0700287 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed = 189;
Hai Zhang5d3328d2019-04-13 21:25:06 +0800288 RoleRequestResultReported role_request_result_reported =
289 190 [(log_from_module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800290 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
291 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
292 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
293 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
294 MediametricsCodecReported mediametrics_codec_reported = 195;
295 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
296 MediametricsExtractorReported mediametrics_extractor_reported = 197;
297 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
298 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
299 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700300 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Yuncheol Heod1a85d22019-05-08 17:13:42 -0700301 CarPowerStateChanged car_power_state_changed = 203;
302 GarageModeInfo garage_mode_info = 204;
Tej Singhc9203082019-05-03 13:42:23 -0700303 TestAtomReported test_atom_reported = 205 [(log_from_module) = "cts"];
Adam He420947c2019-01-23 15:59:09 -0800304 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported = 206;
305 ContentCaptureServiceEvents content_capture_service_events = 207;
306 ContentCaptureSessionEvents content_capture_session_events = 208;
307 ContentCaptureFlushed content_capture_flushed = 209;
Hongyi Zhang700137e2019-05-23 21:19:36 -0700308 LocationManagerApiUsageReported location_manager_api_usage_reported = 210;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100309 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
310 211 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100311 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
312 212 [(log_from_module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100313 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
314 213 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100315 LocationAccessCheckNotificationAction location_access_check_notification_action =
316 214 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100317 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
318 215 [(log_from_module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100319 AppPermissionFragmentViewed app_permission_fragment_viewed =
320 216 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100321 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
322 217 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100323 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
324 218 [(log_from_module) = "permissioncontroller"];
Tony Make2b1b672019-07-29 16:59:47 +0100325 TextSelectionEvent text_selection_event =
326 219 [(log_from_module) = "textclassifier"];
327 TextLinkifyEvent text_linkify_event =
328 220 [(log_from_module) = "textclassifier"];
329 ConversationActionsEvent conversation_actions_event =
330 221 [(log_from_module) = "textclassifier"];
331 LanguageDetectionEvent language_detection_event =
332 222 [(log_from_module) = "textclassifier"];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -0700333 ExclusionRectStateChanged exclusion_rect_state_changed = 223;
334 BackGesture back_gesture_reported_reported = 224;
Tianjie Xu167c3db2019-07-22 14:25:14 -0700335 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
336 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Emilian Peev6729f372019-08-29 09:14:09 -0700337 CameraActionEvent camera_action_event = 227;
atrost01a20932019-08-28 15:40:37 +0100338 AppCompatibilityChangeReported app_compatibility_change_reported =
339 228 [(allow_from_any_uid) = true];
Hector Dearman40579f62019-11-01 13:19:30 +0000340 PerfettoUploaded perfetto_uploaded =
341 229 [(log_from_module) = "perfetto"];
Mark Tabrya824a642019-11-05 12:26:12 -0800342 VmsClientConnectionStateChanged vms_client_connection_state_changed = 230;
Blake Kragten212edc72019-10-15 13:26:50 -0700343 GpsLocationStatusReported gps_location_status_reported = 231;
344 GpsTimeToFirstFixReported gps_time_to_first_fix_reported = 232;
Yao Chend54f9dd2017-10-17 17:37:48 +0000345 }
David Chenc8a43242017-10-17 16:23:28 -0700346
David Chen6e3e6cb2018-01-03 16:14:06 -0800347 // Pulled events will start at field 10000.
Rafal Slawik7efcefb2019-09-20 11:16:20 +0100348 // Next: 10065
David Chenc8a43242017-10-17 16:23:28 -0700349 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800350 WifiBytesTransfer wifi_bytes_transfer = 10000;
351 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
352 MobileBytesTransfer mobile_bytes_transfer = 10002;
353 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800354 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800355 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800356 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800357 CpuTimePerFreq cpu_time_per_freq = 10008;
358 CpuTimePerUid cpu_time_per_uid = 10009;
359 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800360 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800361 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800362 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800363 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800364 SystemElapsedRealtime system_elapsed_realtime = 10014;
365 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800366 CpuActiveTime cpu_active_time = 10016;
367 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000368 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800369 RemainingBatteryCapacity remaining_battery_capacity = 10019;
370 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800371 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100372 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100373 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100374 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000375 DiskStats disk_stats = 10025;
376 DirectoryUsage directory_usage = 10026;
377 AppSize app_size = 10027;
378 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700379 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700380 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800381 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700382 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700383 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800384 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700385 ProcessCpuTime process_cpu_time = 10035;
Misha Wagner5a51e002018-10-03 15:04:09 +0100386 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700387 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee60422018-11-09 12:27:37 -0800388 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
389 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
390 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000391 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800392 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800393 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800394 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000395 DebugElapsedClock debug_elapsed_clock = 10046;
396 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800397 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800398 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800399 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800400 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000401 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000402 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800403 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
404 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000405 SystemIonHeapSize system_ion_heap_size = 10056;
Carmen Agimofa769c152019-03-04 14:39:14 +0000406 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700407 FaceSettings face_settings = 10058;
Maggie White442b6312019-04-05 16:26:44 -0700408 CoolingDevice cooling_device = 10059;
Martijn Coenencd95d462019-04-25 17:09:45 +0200409 AppOps app_ops = 10060;
Rafal Slawik77987ed2019-06-17 12:28:23 +0100410 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061;
Alec Mourie088e762019-07-02 13:10:55 -0700411 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
412 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Rafal Slawik7efcefb2019-09-20 11:16:20 +0100413 ProcessMemorySnapshot process_memory_snapshot = 10064;
Mark Tabrya824a642019-11-05 12:26:12 -0800414 VmsClientStats vms_client_stats = 10065;
David Chenc8a43242017-10-17 16:23:28 -0700415 }
yroa1fe77c2018-02-26 14:22:54 -0800416
Bookatz76aafcf2018-09-17 16:17:10 -0700417 // DO NOT USE field numbers above 100,000 in AOSP.
418 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
419 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100420
421 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700422}
423
Yao Chend54f9dd2017-10-17 17:37:48 +0000424/**
Yangster-mac20877162017-12-22 17:19:39 -0800425 * This proto represents a node of an attribution chain.
426 * Note: All attribution chains are represented as a repeated field of type
427 * AttributionNode. It is understood that in such arrays, the order is that
428 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000429 */
Yangster-mac20877162017-12-22 17:19:39 -0800430message AttributionNode {
431 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800432 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800433
Yangster-mac20877162017-12-22 17:19:39 -0800434 // The (optional) string tag for an element in the attribution chain. If the
435 // element has no tag, it is encoded as an empty string.
436 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700437}
438
Yangster-mac48b3d622018-08-18 12:38:11 -0700439message KeyValuePair {
440 optional int32 key = 1;
441 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700442 int32 value_int = 2;
443 int64 value_long = 3;
444 string value_str = 4;
445 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700446 }
447}
448
449message KeyValuePairsAtom {
450 optional int32 uid = 1;
451 repeated KeyValuePair pairs = 2;
452}
453
Yao Chend54f9dd2017-10-17 17:37:48 +0000454/*
455 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800456 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000457 *
458 * RULES:
459 * - The field ids for each atom must start at 1, and count upwards by 1.
460 * Skipping field ids is not allowed.
461 * - These form an API, so renaming, renumbering or removing fields is
462 * not allowed between android releases. (This is not currently enforced,
463 * but there will be a tool to enforce this restriction).
464 * - The types must be built-in protocol buffer types, namely, no sub-messages
465 * are allowed (yet). The bytes type is also not allowed.
466 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800467 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000468 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800469 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000470 * - A field that is a uid should be a string field, tagged with the [xxx]
471 * annotation. The generated code on android will be represented by UIDs,
472 * and those UIDs will be translated in xxx to those strings.
473 *
474 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700475 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000476 * - If there is a UID, it goes first. Think in an object-oriented fashion.
477 * *****************************************************************************
478 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700479
Yao Chend54f9dd2017-10-17 17:37:48 +0000480/**
Tej Singha72344992019-04-17 18:55:08 -0700481 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700482 * Logs when the Thermal service HAL notifies the throttling start/stop events.
483 *
484 * Logged from:
485 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
486 */
487message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700488 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700489 optional android.os.TemperatureTypeEnum sensor_type = 1;
490
Maggie White442b6312019-04-05 16:26:44 -0700491 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700492 enum State {
493 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700494 START = 1; // START indicated that throttling was triggered.
495 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700496 }
Yangster-mace16189a2018-08-26 12:20:16 -0700497 optional State state = 2;
498
499 optional float temperature = 3;
500}
501
502/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000503 * Logs when the screen state changes.
504 *
505 * Logged from:
506 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
507 */
508message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800509 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700510 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700511}
Yao Chend54f9dd2017-10-17 17:37:48 +0000512
513/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700514 * Logs that the process state of the uid, as determined by ActivityManager
515 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000516 *
517 * Logged from:
518 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
519 */
Bookatzc1a050a2017-10-10 15:49:28 -0700520message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700521 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000522
Bookatzdb026a22018-01-10 19:01:56 -0800523 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700524 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000525}
526
527/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700528 * Logs process state change of a process, as per the activity manager.
529 *
530 * Logged from:
531 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
532 */
533message ProcessStateChanged {
534 optional int32 uid = 1;
535 optional string process_name = 2;
536 optional string package_name = 3;
537 // TODO: remove this when validation is done
538 optional int64 version = 5;
539 // The state, from frameworks/base/core/proto/android/app/enums.proto.
540 optional android.app.ProcessStateEnum state = 4;
541}
542
543/**
544 * Logs when ActivityManagerService sleep state is changed.
545 *
546 * Logged from:
547 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
548 */
549message ActivityManagerSleepStateChanged {
550 // TODO: import frameworks proto
551 enum State {
552 UNKNOWN = 0;
553 ASLEEP = 1;
554 AWAKE = 2;
555 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700556 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700557}
558
559/**
560 * Logs when system memory state changes.
561 *
562 * Logged from:
563 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
564 */
565message MemoryFactorStateChanged {
566 // TODO: import frameworks proto
567 enum State {
568 MEMORY_UNKNOWN = 0;
569 NORMAL = 1; // normal.
570 MODERATE = 2; // moderate memory pressure.
571 LOW = 3; // low memory.
572 CRITICAL = 4; // critical memory.
573
574 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700575 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700576}
577
578/**
579 * Logs when app is using too much cpu, according to ActivityManagerService.
580 *
581 * Logged from:
582 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
583 */
584message ExcessiveCpuUsageReported {
585 optional int32 uid = 1;
586 optional string process_name = 2;
587 optional string package_name = 3;
588 // package version. TODO: remove this when validation is done
589 optional int64 version = 4;
590}
591
592/**
593 * Logs when a cached process is killed, along with its pss.
594 *
595 * Logged from:
596 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
597 */
598message CachedKillReported {
599 optional int32 uid = 1;
600 optional string process_name = 2;
601 optional string package_name = 3;
602 // TODO: remove this when validation is done
603 optional int64 version = 5;
604 optional int64 pss = 4;
605}
606
607/**
608 * Logs when memory stats of a process is reported.
609 *
610 * Logged from:
611 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
612 */
613message ProcessMemoryStatReported {
614 optional int32 uid = 1;
615 optional string process_name = 2;
616 optional string package_name = 3;
617 //TODO: remove this when validation is done
618 optional int64 version = 9;
619 optional int64 pss = 4;
620 optional int64 uss = 5;
621 optional int64 rss = 6;
622 enum Type {
623 ADD_PSS_INTERNAL_SINGLE = 0;
624 ADD_PSS_INTERNAL_ALL_MEM = 1;
625 ADD_PSS_INTERNAL_ALL_POLL = 2;
626 ADD_PSS_EXTERNAL = 3;
627 ADD_PSS_EXTERNAL_SLOW = 4;
628 }
629 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800630 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700631}
632
633/**
Bookatzc1a050a2017-10-10 15:49:28 -0700634 * Logs that a process started, finished, crashed, or ANRed.
635 *
636 * Logged from:
637 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
638 */
639message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700640 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700641
David Chen0b5c90c2018-01-25 16:51:49 -0800642 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800643 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700644
Bookatzddccf0a2017-11-28 16:48:14 -0800645 // What lifecycle state the process changed to.
646 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800647 enum State {
648 FINISHED = 0;
649 STARTED = 1;
650 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800651 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800652 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700653}
654
Bookatzc1a050a2017-10-10 15:49:28 -0700655/**
656 * Logs when the ble scan state changes.
657 *
658 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700659 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700660 */
661message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800662 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700663
664 enum State {
665 OFF = 0;
666 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700667 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
668 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700669 }
670 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700671
Bookatze5ec0b42018-03-26 13:34:56 -0700672 // Does the scan have a filter.
673 optional bool is_filtered = 3;
674 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
675 optional bool is_first_match = 4;
676 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
677 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700678}
679
680/**
681 * Logs reporting of a ble scan finding results.
682 *
683 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700684 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700685 */
Bookatzae6738e2018-09-13 11:38:56 -0700686// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700687message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800688 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700689
690 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800691 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700692}
693
694/**
695 * Logs when a sensor state changes.
696 *
697 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700698 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700699 */
700message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800701 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700702
Bookatzc1a050a2017-10-10 15:49:28 -0700703 // The id (int) of the sensor.
704 optional int32 sensor_id = 2;
705
706 enum State {
707 OFF = 0;
708 ON = 1;
709 }
710 optional State state = 3;
711}
712
Bookatzc1a050a2017-10-10 15:49:28 -0700713/**
714 * Logs when GPS state changes.
715 *
716 * Logged from:
717 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
718 */
719message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800720 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700721
722 enum State {
723 OFF = 0;
724 ON = 1;
725 }
726 optional State state = 2;
727}
728
Bookatz48d362e2018-11-06 15:49:08 -0800729/**
730 * Logs when GPS signal quality.
731 *
732 * Logged from:
733 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
734 */
735message GpsSignalQualityChanged {
736 optional android.server.location.GpsSignalQualityEnum level = 1;
737}
738
Blake Kragten212edc72019-10-15 13:26:50 -0700739/**
740 * Gps location status report
741 *
742 * Logged from:
743 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
744 */
745message GpsLocationStatusReported {
746 // Boolean stating if location was acquired
747 optional bool location_success = 1;
748}
749
750/**
751 * Gps log time to first fix report
752 *
753 * Logged from:
754 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
755 */
756message GpsTimeToFirstFixReported {
757 // int32 reporting the time to first fix in milliseconds
758 optional int32 time_to_first_fix_millis = 1;
759}
Bookatzc1a050a2017-10-10 15:49:28 -0700760
761/**
762 * Logs when a sync manager sync state changes.
763 *
764 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700765 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700766 */
767message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800768 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700769
David Chen0b5c90c2018-01-25 16:51:49 -0800770 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800771 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700772
773 enum State {
774 OFF = 0;
775 ON = 1;
776 }
777 optional State state = 3;
778}
779
Yangster-mac96353002018-09-05 11:18:55 -0700780/*
781 * Deferred job stats.
782 *
783 * Logged from:
784 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
785*/
786message DeferredJobStatsReported {
787 repeated AttributionNode attribution_node = 1;
788
789 // Number of jobs deferred.
790 optional int32 num_jobs_deferred = 2;
791
792 // Time since the last job runs.
793 optional int64 time_since_last_job_millis = 3;
794}
795
Bookatzc1a050a2017-10-10 15:49:28 -0700796/**
797 * Logs when a job scheduler job state changes.
798 *
799 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700800 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700801 */
802message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800803 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700804
805 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800806 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700807
808 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800809 FINISHED = 0;
810 STARTED = 1;
811 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700812 }
813 optional State state = 3;
814
Tej Singh33a412b2018-03-16 18:43:59 -0700815 // The reason a job has stopped.
816 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700817 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700818 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100819
820 // The standby bucket of the app that scheduled the job. These match the framework constants
821 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
822 // already assigned 0.
823 enum Bucket {
824 UNKNOWN = -1;
825 ACTIVE = 0;
826 WORKING_SET = 1;
827 FREQUENT = 2;
828 RARE = 3;
829 NEVER = 4;
830 }
831 optional Bucket standby_bucket = 5 [default = UNKNOWN];
832
833 // The job id (as assigned by the app).
834 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700835}
836
837/**
838 * Logs when the audio state changes.
839 *
840 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700841 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700842 */
843message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800844 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700845
846 enum State {
847 OFF = 0;
848 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700849 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
850 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700851 }
852 optional State state = 2;
853}
854
855/**
856 * Logs when the video codec state changes.
857 *
858 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700859 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700860 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800861message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800862 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700863
864 enum State {
865 OFF = 0;
866 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700867 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
868 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700869 }
870 optional State state = 2;
871}
872
873/**
874 * Logs when the flashlight state changes.
875 *
876 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700877 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700878 */
879message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800880 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700881
882 enum State {
883 OFF = 0;
884 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700885 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
886 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700887 }
888 optional State state = 2;
889}
890
891/**
892 * Logs when the camera state changes.
893 *
894 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700895 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700896 */
897message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800898 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700899
900 enum State {
901 OFF = 0;
902 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700903 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
904 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700905 }
906 optional State state = 2;
907}
908
909/**
910 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000911 *
912 * Logged from:
913 * TODO
914 */
Bookatzd6746242017-10-24 18:39:35 -0700915message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800916 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000917
Bookatz1a1b0462018-01-12 11:47:03 -0800918 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
919 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700920 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700921
922 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
923 optional string tag = 3;
924
925 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800926 RELEASE = 0;
927 ACQUIRE = 1;
928 CHANGE_RELEASE = 2;
929 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700930 }
931 optional State state = 4;
932}
933
934/**
Bookatzc1a050a2017-10-10 15:49:28 -0700935 * Logs when a partial wakelock is considered 'long' (over 1 min).
936 *
937 * Logged from:
938 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
939 */
940message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800941 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700942
Yao Chend54f9dd2017-10-17 17:37:48 +0000943 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
944 optional string tag = 2;
945
Bookatzc1a050a2017-10-10 15:49:28 -0700946 // TODO: I have no idea what this is.
947 optional string history_tag = 3;
948
949 enum State {
950 OFF = 0;
951 ON = 1;
952 }
953 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000954}
955
Bookatzc1a050a2017-10-10 15:49:28 -0700956/**
Bookatza66083f2018-09-20 17:24:00 -0700957 * Logs when the device is interactive, according to the PowerManager Notifier.
958 *
959 * Logged from:
960 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
961 */
962message InteractiveStateChanged {
963 enum State {
964 OFF = 0;
965 ON = 1;
966 }
967 optional State state = 1;
968}
969
970/**
Bookatzc1a050a2017-10-10 15:49:28 -0700971 * Logs Battery Saver state change.
972 *
973 * Logged from:
974 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
975 */
976message BatterySaverModeStateChanged {
977 enum State {
978 OFF = 0;
979 ON = 1;
980 }
981 optional State state = 1;
982}
983
984/**
985 * Logs Doze mode state change.
986 *
987 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800988 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700989 */
990message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800991 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800992}
993
994
995/**
996 * Logs state change of Doze mode including maintenance windows.
997 *
998 * Logged from:
999 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
1000 */
1001message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -08001002 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -07001003}
1004
1005/**
1006 * Logs screen brightness level.
1007 *
1008 * Logged from:
1009 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1010 */
1011message ScreenBrightnessChanged {
1012 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1013 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001014}
1015
1016/**
1017 * Logs battery level (percent full, from 0 to 100).
1018 *
1019 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001020 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001021 */
1022message BatteryLevelChanged {
1023 // Battery level. Should be in [0, 100].
1024 optional int32 battery_level = 1;
1025}
1026
1027/**
1028 * Logs change in charging status of the device.
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 ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001034 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1035 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001036}
1037
1038/**
1039 * Logs whether the device is plugged in, and what power source it is using.
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 PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001045 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1046 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001047}
1048
Bookatz8c6571b2017-10-24 15:04:41 -07001049/**
1050 * Logs when an app's wakeup alarm fires.
1051 *
1052 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001053 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001054 */
1055message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001056 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001057
1058 // Name of the wakeup alarm.
1059 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001060
1061 // Name of source package (for historical reasons, since BatteryStats tracked it).
1062 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001063
1064 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1065 enum Bucket {
1066 UNKNOWN = 0;
1067 EXEMPTED = 5;
1068 ACTIVE = 10;
1069 WORKING_SET = 20;
1070 FREQUENT = 30;
1071 RARE = 40;
1072 NEVER = 50;
1073 }
1074 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1075 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001076}
1077
1078/**
1079 * Logs when an an app causes the mobile radio to change state.
1080 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1081 *
1082 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001083 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001084 */
1085message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001086 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001087
Bookatz1a1b0462018-01-12 11:47:03 -08001088 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1089 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001090}
1091
1092/**
1093 * Logs when an an app causes the wifi radio to change state.
1094 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1095 *
1096 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001097 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001098 */
1099message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001100 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001101
Bookatz1a1b0462018-01-12 11:47:03 -08001102 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1103 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001104}
1105
1106/**
1107 * Logs kernel wakeup reasons and aborts.
1108 *
1109 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001110 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001111 */
1112message KernelWakeupReported {
1113 // Name of the kernel wakeup reason (or abort).
1114 optional string wakeup_reason_name = 1;
1115
1116 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001117 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001118}
1119
1120/**
Bookatzda1798c2018-12-13 14:16:00 -08001121 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001122 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001123 *
1124 * Logged from:
1125 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1126 */
1127message WifiEnabledStateChanged {
1128 enum State {
1129 OFF = 0;
1130 ON = 1;
1131 }
1132 optional State state = 1;
1133}
1134
1135/**
1136 * 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 -08001137 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1138 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001139 *
1140 * Logged from:
1141 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1142 */
1143message WifiRunningStateChanged {
1144 repeated AttributionNode attribution_node = 1;
1145
1146 enum State {
1147 OFF = 0;
1148 ON = 1;
1149 }
1150 optional State state = 2;
1151}
1152
1153/**
Bookatze5885242017-10-24 20:10:31 -07001154 * Logs wifi locks held by an app.
1155 *
1156 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001157 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001158 */
1159message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001160 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001161
1162 enum State {
1163 OFF = 0;
1164 ON = 1;
1165 }
1166 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001167
1168 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1169 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001170}
1171
1172/**
1173 * Logs wifi signal strength changes.
1174 *
1175 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001176 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001177 */
1178message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001179 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1180 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001181}
1182
1183/**
1184 * Logs wifi scans performed by an app.
1185 *
1186 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001187 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001188 */
1189message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001190 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001191
1192 enum State {
1193 OFF = 0;
1194 ON = 1;
1195 }
1196 optional State state = 2;
1197}
1198
1199/**
Tej Singh4503e102018-01-04 14:35:01 -08001200 * Logs wifi multicast locks held by an app
1201 *
1202 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001203 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001204 */
1205message WifiMulticastLockStateChanged {
1206 repeated AttributionNode attribution_node = 1;
1207
1208 enum State {
1209 OFF = 0;
1210 ON = 1;
1211 }
1212 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001213
1214 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001215}
1216
1217/**
Tej Singh1ea42892018-01-19 09:27:00 -08001218 * Logs shutdown reason and duration on next boot.
1219 *
1220 * Logged from:
1221 * frameworks/base/core/java/com/android/server/BootReceiver.java
1222 */
1223message ShutdownSequenceReported {
1224 // True if shutdown is for a reboot. Default: false if we do not know.
1225 optional bool reboot = 1;
1226
1227 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1228 optional string reason = 2;
1229
1230 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1231 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001232 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001233
1234 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001235 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001236}
1237
Tej Singh6483ea42018-01-25 17:45:49 -08001238
1239/**
1240 * Logs boot reason and duration.
1241 *
1242 * Logged from:
1243 * system/core/bootstat/bootstat.cpp
1244 */
1245message BootSequenceReported {
1246 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1247 // Default: "<EMPTY>" if not available.
1248 optional string bootloader_reason = 1;
1249
1250 // Reason for system boot. Eg. bootloader, reboot,userrequested
1251 // Default: "<EMPTY>" if not available.
1252 optional string system_reason = 2;
1253
1254 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001255 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001256
1257 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001258 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001259
1260 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001261 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001262
1263 // Time since last boot in ms. Default: 0 if not available.
1264 optional int64 time_since_last_boot = 6;
1265}
1266
Tej Singhc477d9c2018-02-05 18:31:39 -08001267
1268/**
1269 * Logs call state and disconnect cause (if applicable).
1270 *
1271 * Logged from:
1272 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1273 */
1274message CallStateChanged {
1275 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1276 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1277 optional android.telecom.CallStateEnum call_state = 1;
1278
1279 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1280 // This value is only applicable when the call_state is DISCONNECTED, and
1281 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1282 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1283 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1284
1285 // True if the call is self-managed, which are apps that use the
1286 // telecom infrastructure to make their own calls.
1287 optional bool self_managed = 3;
1288
1289 // True if call is external. External calls are calls on connected Wear
1290 // devices but show up in Telecom so the user can pull them onto the device.
1291 optional bool external_call = 4;
1292}
1293
Tej Singh1ea42892018-01-19 09:27:00 -08001294/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001295 * Logs keyguard state. The keyguard is the lock screen.
1296 *
1297 * Logged from:
1298 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1299 */
1300message KeyguardStateChanged {
1301 enum State {
1302 UNKNOWN = 0;
1303 // The keyguard is hidden when the phone is unlocked.
1304 HIDDEN = 1;
1305 // The keyguard is shown when the phone is locked (screen turns off).
1306 SHOWN= 2;
1307 // The keyguard is occluded when something is overlaying the keyguard.
1308 // Eg. Opening the camera while on the lock screen.
1309 OCCLUDED = 3;
1310 }
1311 optional State state = 1;
1312}
1313
1314/**
1315 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1316 * prompts the user to enter a password (pattern, pin, etc).
1317 *
1318 * Logged from:
1319 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1320 */
1321
1322message KeyguardBouncerStateChanged {
1323 enum State {
1324 UNKNOWN = 0;
1325 // Bouncer is hidden, either as a result of successfully entering the
1326 // password, screen timing out, or user going back to lock screen.
1327 HIDDEN = 1;
1328 // This is when the user is being prompted to enter the password.
1329 SHOWN = 2;
1330 }
1331 optional State state = 1;
1332}
1333
1334/**
1335 * Logs the result of entering a password into the keyguard bouncer.
1336 *
1337 * Logged from:
1338 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1339 */
1340message KeyguardBouncerPasswordEntered {
1341 enum BouncerResult {
1342 UNKNOWN = 0;
1343 // The password entered was incorrect.
1344 FAILURE = 1;
1345 // The password entered was correct.
1346 SUCCESS = 2;
1347 }
1348 optional BouncerResult result = 1;
1349}
1350
Tej Singha883b372018-02-15 11:30:01 -08001351/*
1352 * Logs changes to the configuration of the device. The configuration is defined
1353 * in frameworks/base/core/java/android/content/res/Configuration.java
1354 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1355 * Please go there to interpret the possible values each field can be.
1356 *
1357 * Logged from:
1358 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1359 */
1360message ResourceConfigurationChanged {
1361 // Bit mask of color capabilities of the screen.
1362 // Contains information about the color gamut and hdr mode of the screen.
1363 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001364 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001365
1366 // The target screen density being rendered to.
1367 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001368 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001369
1370 // Current user preference for the scaling factor for fonts,
1371 // relative to the base density scaling.
1372 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001373 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001374
1375 // Flag indicating whether the hard keyboard is hidden.
1376 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001377 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001378
1379 // The type of keyboard attached to the device.
1380 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1381 optional int32 keyboard = 5;
1382
1383 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1384 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001385 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001386
1387 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1388 // 0 if undefined.
1389 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1390 optional int32 mcc = 7;
1391
1392 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1393 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1394 // MNC_ZERO symbol defined in Configuration.java.
1395 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1396 optional int32 mnc = 8;
1397
1398 // The kind of navigation available on the device.
1399 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1400 optional int32 navigation = 9;
1401
1402 // Flag indicating whether the navigation is available.
1403 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001404 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001405
1406 // Overall orientation of the screen.
1407 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1408 optional int32 orientation = 11;
1409
1410 // The current height of the available screen space, in dp units.
1411 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001412 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001413
1414 // Bit mask of overall layout of the screen.
1415 // Contains information about screen size, whether the screen is wider/taller
1416 // than normal, whether the screen layout is right-tl-left or left-to-right,
1417 // and whether the screen has a rounded shape.
1418 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001419 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001420
1421 // Current width of the available screen space, in dp units.
1422 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001423 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001424
1425 // The smallest screen size an application will see in normal operation.
1426 // This is the smallest value of both screenWidthDp and screenHeightDp
1427 // in portrait and landscape.
1428 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001429 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001430
1431 // The type of touch screen attached to the device.
1432 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1433 optional int32 touchscreen = 16;
1434
1435 // Bit mask of the ui mode.
1436 // Contains information about the overall ui mode of the device.
1437 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1438 // Also contains information about whether the device is in night mode.
1439 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001440 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001441}
1442
Tej Singheee317b2018-03-07 19:28:05 -08001443
1444/**
1445 * Logs changes in the connection state of the mobile radio.
1446 *
1447 * Logged from:
1448 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1449 */
1450message MobileConnectionStateChanged {
1451 // States are from the state machine DataConnection.java.
1452 enum State {
1453 UNKNOWN = 0;
1454 // The connection is inactive, or disconnected.
1455 INACTIVE = 1;
1456 // The connection is being activated, or connecting.
1457 ACTIVATING = 2;
1458 // The connection is active, or connected.
1459 ACTIVE = 3;
1460 // The connection is disconnecting.
1461 DISCONNECTING = 4;
1462 // The connection is disconnecting after creating a connection.
1463 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1464 }
1465 optional State state = 1;
1466 // For multi-sim phones, this distinguishes between the sim cards.
1467 optional int32 sim_slot_index = 2;
1468 // Used to identify the connection. Starts at 0 and increments by 1 for
1469 // every new network created. Resets whenever the device reboots.
1470 optional int32 data_connection_id = 3;
1471 // A bitmask for the capabilities of this connection.
1472 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1473 // Default value (if we have no information): 0
1474 optional int64 capabilities = 4;
1475 // If this connection has internet.
1476 // This just checks if the DEFAULT bit of capabilities is set.
1477 optional bool has_internet = 5;
1478}
1479
1480/**
1481 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1482 *
1483 * Logged from:
1484 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1485 */
1486message MobileRadioTechnologyChanged {
1487 optional android.telephony.NetworkTypeEnum state = 1;
1488 // For multi-sim phones, this distinguishes between the sim cards.
1489 optional int32 sim_slot_index = 2;
1490}
1491
Andrew Chantb56388b2018-03-22 21:07:33 -07001492/**
1493 * Logs the VID and PID of any connected USB devices.
1494 *
1495 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1496 *
1497 * Logged by Vendor.
1498 */
1499message UsbDeviceAttached {
1500 optional int32 vid = 1;
1501 optional int32 pid = 2;
1502 optional bool has_audio = 3;
1503 optional bool has_hid = 4;
1504 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001505 enum State {
1506 STATE_DISCONNECTED = 0;
1507 STATE_CONNECTED = 1;
1508 }
1509 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001510 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001511}
1512
Tej Singheee317b2018-03-07 19:28:05 -08001513
Tej Singhdd7bd352018-02-09 19:33:15 -08001514/**
Tej Singh5d991e12018-03-09 19:48:11 -08001515 * Logs when Bluetooth is enabled and disabled.
1516 *
1517 * Logged from:
1518 * services/core/java/com/android/server/BluetoothManagerService.java
1519 */
1520message BluetoothEnabledStateChanged {
1521 repeated AttributionNode attribution_node = 1;
1522 // Whether or not bluetooth is enabled on the device.
1523 enum State {
1524 UNKNOWN = 0;
1525 ENABLED = 1;
1526 DISABLED = 2;
1527 }
1528 optional State state = 2;
1529 // The reason for being enabled/disabled.
1530 // Eg. Airplane mode, crash, application request.
1531 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1532 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001533 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001534}
1535
1536/**
Jack Hed9837c82019-01-09 01:19:13 -08001537 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001538 *
1539 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001540 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1541 *
1542 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001543 */
1544message BluetoothConnectionStateChanged {
1545 // The state of the connection.
1546 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1547 optional android.bluetooth.ConnectionStateEnum state = 1;
1548 // An identifier that can be used to match connect and disconnect events.
1549 // Currently is last two bytes of a hash of a device level ID and
1550 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001551 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001552 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001553 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1554 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001555 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001556 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001557 // An identifier that can be used to match events for this device.
1558 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1559 // Salt: Randomly generated 256 bit value
1560 // Hash algorithm: HMAC-SHA256
1561 // Size: 32 byte
1562 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001563 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001564}
1565
1566/**
1567 * Logs when a Bluetooth device connects and disconnects over ACL
1568 *
1569 * Logged from:
1570 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1571 *
1572 * Next Tag: 3
1573 */
1574message BluetoothAclConnectionStateChanged {
1575 // An identifier that can be used to match events for this device.
1576 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1577 // Salt: Randomly generated 256 bit value
1578 // Hash algorithm: HMAC-SHA256
1579 // Size: 32 byte
1580 // Default: null or empty if the device identifier is not known
1581 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1582 // The state of the connection.
1583 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1584 optional android.bluetooth.ConnectionStateEnum state = 2;
1585}
1586
1587/**
1588 * Logs when a Bluetooth device connects and disconnects over SCO
1589 *
1590 * Logged from:
1591 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1592 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1593 *
1594 * Next Tag: 4
1595 */
1596message BluetoothScoConnectionStateChanged {
1597 // An identifier that can be used to match events for this device.
1598 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1599 // Salt: Randomly generated 256 bit value
1600 // Hash algorithm: HMAC-SHA256
1601 // Size: 32 byte
1602 // Default: null or empty if the device identifier is not known
1603 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1604 // The state of the connection.
1605 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1606 optional android.bluetooth.ConnectionStateEnum state = 2;
1607 // Codec used for this SCO connection
1608 // Default: UNKNOWN
1609 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001610}
1611
Jack Hec27040a2019-01-09 20:54:41 -08001612/**
1613 * Logged when active device of a profile changes
1614 *
1615 * Logged from:
1616 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1617 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1618 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1619 */
1620message BluetoothActiveDeviceChanged {
1621 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1622 // From android.bluetooth.BluetoothProfile
1623 optional int32 bt_profile = 1;
1624 // An identifier that can be used to match events for this new active device.
1625 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1626 // Salt: Randomly generated 256 bit value
1627 // Hash algorithm: HMAC-SHA256
1628 // Size: 32 byte
1629 // Default: null or empty if there is no active device for this profile
1630 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1631}
1632
Jack Heab86dbd22018-12-18 15:43:27 -08001633// Logs when there is an event affecting Bluetooth device's link layer connection.
1634// - This event is triggered when there is a related HCI command or event
1635// - Users of this metrics can deduce Bluetooth device's connection state from these events
1636// - HCI commands are logged before the command is sent, after receiving command status, and after
1637// receiving command complete
1638// - HCI events are logged when they arrive
1639//
1640// Low level log from system/bt
1641//
1642// Bluetooth classic commands:
1643// - CMD_CREATE_CONNECTION
1644// - CMD_DISCONNECT
1645// - CMD_CREATE_CONNECTION_CANCEL
1646// - CMD_ACCEPT_CONNECTION_REQUEST
1647// - CMD_REJECT_CONNECTION_REQUEST
1648// - CMD_SETUP_ESCO_CONNECTION
1649// - CMD_ACCEPT_ESCO_CONNECTION
1650// - CMD_REJECT_ESCO_CONNECTION
1651// - CMD_ENH_SETUP_ESCO_CONNECTION
1652// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1653//
1654// Bluetooth low energy commands:
1655// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1656// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1657// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1658// - CMD_BLE_CLEAR_WHITE_LIST
1659// - CMD_BLE_ADD_WHITE_LIST
1660// - CMD_BLE_REMOVE_WHITE_LIST
1661//
1662// Bluetooth classic events:
1663// - EVT_CONNECTION_COMP
1664// - EVT_CONNECTION_REQUEST
1665// - EVT_DISCONNECTION_COMP
1666// - EVT_ESCO_CONNECTION_COMP
1667// - EVT_ESCO_CONNECTION_CHANGED
1668//
1669// Bluetooth low energy meta events:
1670// - BLE_EVT_CONN_COMPLETE_EVT
1671// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1672//
1673// Next tag: 10
1674message BluetoothLinkLayerConnectionEvent {
1675 // An identifier that can be used to match events for this device.
1676 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1677 // Salt: Randomly generated 256 bit value
1678 // Hash algorithm: HMAC-SHA256
1679 // Size: 32 byte
1680 // Default: null or empty if the device identifier is not known
1681 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1682 // Connection handle of this connection if available
1683 // Range: 0x0000 - 0x0EFF (12 bits)
1684 // Default: 0xFFFF if the handle is unknown
1685 optional int32 connection_handle = 2;
1686 // Direction of the link
1687 // Default: DIRECTION_UNKNOWN
1688 optional android.bluetooth.DirectionEnum direction = 3;
1689 // Type of this link
1690 // Default: LINK_TYPE_UNKNOWN
1691 optional android.bluetooth.LinkTypeEnum type = 4;
1692
1693 // Reason metadata for this link layer connection event, rules for interpretation:
1694 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1695 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1696 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1697 // set and valid, ignore hci_ble_event
1698
1699 // HCI command associated with this event
1700 // Default: CMD_UNKNOWN
1701 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1702 // HCI event associated with this event
1703 // Default: EVT_UNKNOWN
1704 optional android.bluetooth.hci.EventEnum hci_event = 6;
1705 // HCI BLE meta event associated with this event
1706 // Default: BLE_EVT_UNKNOWN
1707 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1708 // HCI command status code if this is triggerred by hci_cmd
1709 // Default: STATUS_UNKNOWN
1710 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1711 // HCI reason code associated with this event
1712 // Default: STATUS_UNKNOWN
1713 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1714}
1715
Howard Roe103fe22019-01-17 16:52:16 -08001716/**
1717 * Logs when a module is rolled back by Watchdog.
1718 *
1719 * Logged from: Rollback Manager
1720 */
1721message WatchdogRollbackOccurred {
1722 enum RollbackType {
1723 UNKNOWN = 0;
1724 ROLLBACK_INITIATE = 1;
1725 ROLLBACK_SUCCESS = 2;
1726 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001727 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001728 }
1729 optional RollbackType rollback_type = 1;
1730
1731 optional string package_name = 2;
1732
1733 optional int32 package_version_code = 3;
1734}
1735
Jack Hec27040a2019-01-09 20:54:41 -08001736/**
1737 * Logs when there is a change in Bluetooth A2DP playback state
1738 *
1739 * Logged from:
1740 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1741 */
1742message BluetoothA2dpPlaybackStateChanged {
1743 // An identifier that can be used to match events for this device.
1744 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1745 // Salt: Randomly generated 256 bit value
1746 // Hash algorithm: HMAC-SHA256
1747 // Size: 32 byte
1748 // Default: null or empty if the device identifier is not known
1749 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1750 // Current playback state
1751 // Default: PLAYBACK_STATE_UNKNOWN
1752 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1753 // Current audio coding mode
1754 // Default: AUDIO_CODING_MODE_UNKNOWN
1755 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1756}
1757
1758/**
1759 * Logs when there is a change in A2DP codec config for a particular remote device
1760 *
1761 * Logged from:
1762 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1763 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1764 */
1765message BluetoothA2dpCodecConfigChanged {
1766 // An identifier that can be used to match events for this device.
1767 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1768 // Salt: Randomly generated 256 bit value
1769 // Hash algorithm: HMAC-SHA256
1770 // Size: 32 byte
1771 // Default: null or empty if the device identifier is not known
1772 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1773 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1774 // Default SOURCE_CODEC_TYPE_INVALID
1775 optional int32 codec_type = 2;
1776 // Codec priroity, the higher the more preferred, -1 for disabled
1777 // Default: CODEC_PRIORITY_DEFAULT
1778 optional int32 codec_priority = 3;
1779 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1780 // Default: SAMPLE_RATE_NONE
1781 optional int32 sample_rate = 4;
1782 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1783 // Default: BITS_PER_SAMPLE_NONE
1784 optional int32 bits_per_sample = 5;
1785 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1786 // Default: CHANNEL_MODE_NONE
1787 optional int32 channel_mode = 6;
1788 // Codec specific values
1789 // Default 0
1790 optional int64 codec_specific_1 = 7;
1791 optional int64 codec_specific_2 = 8;
1792 optional int64 codec_specific_3 = 9;
1793 optional int64 codec_specific_4 = 10;
1794}
1795
1796/**
1797 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1798 * Each codec's capability is logged separately due to statsd restriction
1799 *
1800 * Logged from:
1801 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1802 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1803 */
1804message BluetoothA2dpCodecCapabilityChanged {
1805 // An identifier that can be used to match events for this device.
1806 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1807 // Salt: Randomly generated 256 bit value
1808 // Hash algorithm: HMAC-SHA256
1809 // Size: 32 byte
1810 // Default: null or empty if the device identifier is not known
1811 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1812 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1813 // Default SOURCE_CODEC_TYPE_INVALID
1814 optional int32 codec_type = 2;
1815 // Codec priroity, the higher the more preferred, -1 for disabled
1816 // Default: CODEC_PRIORITY_DEFAULT
1817 optional int32 codec_priority = 3;
1818 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1819 // in BluetoothCodecConfig
1820 // Default: empty and SAMPLE_RATE_NONE for individual item
1821 optional int32 sample_rate = 4;
1822 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1823 // in BluetoothCodecConfig
1824 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1825 optional int32 bits_per_sample = 5;
1826 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1827 // BluetoothCodecConfig
1828 // Default: empty and CHANNEL_MODE_NONE for individual item
1829 optional int32 channel_mode = 6;
1830 // Codec specific values
1831 // Default 0
1832 optional int64 codec_specific_1 = 7;
1833 optional int64 codec_specific_2 = 8;
1834 optional int64 codec_specific_3 = 9;
1835 optional int64 codec_specific_4 = 10;
1836}
1837
1838/**
1839 * Logs when A2DP failed to read from PCM source.
1840 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1841 *
1842 * Logged from:
1843 * system/bt
1844 */
1845message BluetoothA2dpAudioUnderrunReported {
1846 // An identifier that can be used to match events for this device.
1847 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1848 // Salt: Randomly generated 256 bit value
1849 // Hash algorithm: HMAC-SHA256
1850 // Size: 32 byte
1851 // Default: null or empty if the device identifier is not known
1852 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1853 // Encoding interval in nanoseconds
1854 // Default: 0
1855 optional int64 encoding_interval_nanos = 2;
1856 // Number of bytes of PCM data that could not be read from the source
1857 // Default: 0
1858 optional int32 num_missing_pcm_bytes = 3;
1859}
1860
1861/**
1862 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1863 * buffer queue is full and we have to drop data
1864 *
1865 * Logged from:
1866 * system/bt
1867 */
1868message BluetoothA2dpAudioOverrunReported {
1869 // An identifier that can be used to match events for this device.
1870 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1871 // Salt: Randomly generated 256 bit value
1872 // Hash algorithm: HMAC-SHA256
1873 // Size: 32 byte
1874 // Default: null or empty if the device identifier is not known
1875 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1876 // Encoding interval in nanoseconds
1877 // Default: 0
1878 optional int64 encoding_interval_nanos = 2;
1879 // Number of buffers dropped in this event
1880 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1881 // Default: 0
1882 optional int32 num_dropped_buffers = 3;
1883 // Number of encoded buffers dropped in this event
1884 // Default 0
1885 optional int32 num_dropped_encoded_frames = 4;
1886 // Number of encoded bytes dropped in this event
1887 // Default: 0
1888 optional int32 num_dropped_encoded_bytes = 5;
1889}
1890
1891/**
1892 * Logs when we receive reports regarding a device's RSSI value
1893 *
1894 * Logged from:
1895 * system/bt
1896 */
1897message BluetoothDeviceRssiReported {
1898 // An identifier that can be used to match events for this device.
1899 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1900 // Salt: Randomly generated 256 bit value
1901 // Hash algorithm: HMAC-SHA256
1902 // Size: 32 byte
1903 // Default: null or empty if the device identifier is not known
1904 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1905 // Connection handle of this connection if available
1906 // Range: 0x0000 - 0x0EFF (12 bits)
1907 // Default: 0xFFFF if the handle is unknown
1908 optional int32 connection_handle = 2;
1909 // HCI command status code if this is triggerred by hci_cmd
1910 // Default: STATUS_UNKNOWN
1911 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1912 // BR/EDR
1913 // Range: -128 ≤ N ≤ 127 (signed integer)
1914 // Units: dB
1915 // LE:
1916 // Range: -127 to 20, 127 (signed integer)
1917 // Units: dBm
1918 // Invalid when an out of range value is reported
1919 optional int32 rssi = 4;
1920}
1921
1922/**
1923 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1924 *
1925 * Logged from:
1926 * system/bt
1927 */
1928message BluetoothDeviceFailedContactCounterReported {
1929 // An identifier that can be used to match events for this device.
1930 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1931 // Salt: Randomly generated 256 bit value
1932 // Hash algorithm: HMAC-SHA256
1933 // Size: 32 byte
1934 // Default: null or empty if the device identifier is not known
1935 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1936 // Connection handle of this connection if available
1937 // Range: 0x0000 - 0x0EFF (12 bits)
1938 // Default: 0xFFFF if the handle is unknown
1939 optional int32 connection_handle = 2;
1940 // HCI command status code if this is triggerred by hci_cmd
1941 // Default: STATUS_UNKNOWN
1942 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1943 // Number of consecutive failed contacts for a connection corresponding to the Handle
1944 // Range: uint16_t, 0-0xFFFF
1945 // Default: 0xFFFFF
1946 optional int32 failed_contact_counter = 4;
1947}
1948
1949/**
1950 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1951 *
1952 * Logged from:
1953 * system/bt
1954 */
1955message BluetoothDeviceTxPowerLevelReported {
1956 // An identifier that can be used to match events for this device.
1957 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1958 // Salt: Randomly generated 256 bit value
1959 // Hash algorithm: HMAC-SHA256
1960 // Size: 32 byte
1961 // Default: null or empty if the device identifier is not known
1962 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1963 // Connection handle of this connection if available
1964 // Range: 0x0000 - 0x0EFF (12 bits)
1965 // Default: 0xFFFF if the handle is unknown
1966 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001967 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001968 // Default: STATUS_UNKNOWN
1969 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1970 // Range: -30 ≤ N ≤ 20
1971 // Units: dBm
1972 // Invalid when an out of range value is reported
1973 optional int32 transmit_power_level = 4;
1974}
Jack Heab86dbd22018-12-18 15:43:27 -08001975
Tej Singh5d991e12018-03-09 19:48:11 -08001976/**
Jack He1021a612019-01-20 21:22:46 -08001977 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1978 * receiving an HCI command from the host
1979 *
1980 * Logged from: system/bt
1981 */
1982message BluetoothHciTimeoutReported {
1983 // HCI command associated with this event
1984 // Default: CMD_UNKNOWN
1985 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1986}
1987
1988/**
1989 * Logs when we receive Bluetooth Link Quality Report event from the controller
1990 * See Android Bluetooth HCI specification for more details
1991 *
1992 * Note: all count and bytes field are counted since last event
1993 *
1994 * Logged from: system/bt
1995 */
1996message BluetoothQualityReportReported {
1997 // Quality report ID
1998 // Original type: uint8_t
1999 // Default: BQR_ID_UNKNOWN
2000 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2001 // Packet type of the connection
2002 // Original type: uint8_t
2003 // Default: BQR_PACKET_TYPE_UNKNOWN
2004 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2005 // Connection handle of the connection
2006 // Original type: uint16_t
2007 optional int32 connection_handle = 3;
2008 // Performing Role for the connection
2009 // Original type: uint8_t
2010 optional int32 connection_role = 4;
2011 // Current Transmit Power Level for the connection. This value is the same as the controller's
2012 // response to the HCI_Read_Transmit_Power_Level HCI command
2013 // Original type: uint8_t
2014 optional int32 tx_power_level = 5;
2015 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2016 // absolute receiver signal strength value
2017 // Original type: int8_t
2018 optional int32 rssi = 6;
2019 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2020 // channels used by the link currently
2021 // Original type: uint8_t
2022 optional int32 snr = 7;
2023 // Indicates the number of unused channels in AFH_channel_map
2024 // Original type: uint8_t
2025 optional int32 unused_afh_channel_count = 8;
2026 // Indicates the number of the channels which are interfered and quality is bad but are still
2027 // selected for AFH
2028 // Original type: uint8_t
2029 optional int32 afh_select_unideal_channel_count = 9;
2030 // Current Link Supervision Timeout Setting
2031 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2032 // Original type: uint16_t
2033 optional int32 lsto = 10;
2034 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2035 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2036 // 0x01 (Piconet Clock)
2037 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2038 // Original type: uint32_t
2039 optional int64 connection_piconet_clock = 11;
2040 // The count of retransmission
2041 // Original type: uint32_t
2042 optional int64 retransmission_count = 12;
2043 // The count of no RX
2044 // Original type: uint32_t
2045 optional int64 no_rx_count = 13;
2046 // The count of NAK (Negative Acknowledge)
2047 // Original type: uint32_t
2048 optional int64 nak_count = 14;
2049 // Controller timestamp of last TX ACK
2050 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2051 // Original type: uint32_t
2052 optional int64 last_tx_ack_timestamp = 15;
2053 // The count of Flow-off (STOP)
2054 // Original type: uint32_t
2055 optional int64 flow_off_count = 16;
2056 // Controller timestamp of last Flow-on (GO)
2057 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2058 // Original type: uint32_t
2059 optional int64 last_flow_on_timestamp = 17;
2060 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2061 // Original type: uint32_t
2062 optional int64 buffer_overflow_bytes = 18;
2063 // Buffer underflow count (in byte) since last event
2064 // Original type: uint32_t
2065 optional int64 buffer_underflow_bytes = 19;
2066}
2067
2068/**
2069 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2070 *
2071 * Notes:
2072 * - Each event can be partially filled as we might learn different pieces of device
2073 * information at different time
2074 * - Multiple device info events can be combined to give more complete picture
2075 * - When multiple device info events tries to describe the same information, the
2076 * later one wins
2077 *
2078 * Logged from:
2079 * packages/apps/Bluetooth
2080 */
Jack Heaea26982019-04-04 11:19:48 -07002081message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002082 // An identifier that can be used to match events for this device.
2083 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2084 // Salt: Randomly generated 256 bit value
2085 // Hash algorithm: HMAC-SHA256
2086 // Size: 32 byte
2087 // Default: null or empty if the device identifier is not known
2088 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2089 // Where is this device info obtained from
2090 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2091 // Name of the data source
2092 // For EXTERNAL: package name of the data source
2093 // For INTERNAL: null for general case, component name otherwise
2094 optional string source_name = 3;
2095 // Name of the manufacturer of this device
2096 optional string manufacturer = 4;
2097 // Model of this device
2098 optional string model = 5;
2099 // Hardware version of this device
2100 optional string hardware_version = 6;
2101 // Software version of this device
2102 optional string software_version = 7;
2103}
2104
2105/**
2106 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2107 * device, as documented by the Bluetooth Core HCI specification
2108 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2109 * Vol 2, Part E, Page 1118
2110 *
2111 * Logged from:
2112 * system/bt
2113 */
2114message BluetoothRemoteVersionInfoReported {
2115 // Connection handle of the connection
2116 // Original type: uint16_t
2117 optional int32 connection_handle = 1;
2118 // HCI command status code
2119 // Default: STATUS_UNKNOWN
2120 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2121 // 1 byte Version of current LMP in the remote controller
2122 optional int32 lmp_version = 3;
2123 // 2 bytes LMP manufacturer code of the remote controller
2124 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2125 optional int32 lmp_manufacturer_code = 4;
2126 // 4 bytes subversion of the LMP in the remote controller
2127 optional int32 lmp_subversion = 5;
2128}
2129
2130/**
2131 * Logs when certain Bluetooth SDP attributes are discovered
2132 * Constant definitions are from:
2133 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2134 *
2135 * Current logged attributes:
2136 * - BluetoothProfileDescriptorList
2137 * - Supported Features Bitmask
2138 *
2139 * Logged from:
2140 * system/bt
2141 */
2142message BluetoothSdpAttributeReported {
2143 // An identifier that can be used to match events for this device.
2144 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2145 // Salt: Randomly generated 256 bit value
2146 // Hash algorithm: HMAC-SHA256
2147 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2148 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2149 // Original type: uint16_t
2150 optional int32 protocol_uuid = 2;
2151 // Short form UUIDs used to identify Bluetooth SDP attribute types
2152 // Original type: uint16_t
2153 optional int32 attribute_id = 3;
2154 // Attribute value for the particular attribute
2155 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2156}
2157
2158/**
2159 * Logs when bond state of a Bluetooth device changes
2160 *
2161 * Logged from:
2162 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2163 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2164 */
2165message BluetoothBondStateChanged {
2166 // An identifier that can be used to match events for this device.
2167 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2168 // Salt: Randomly generated 256 bit value
2169 // Hash algorithm: HMAC-SHA256
2170 // Size: 32 byte
2171 // Default: null or empty if the device identifier is not known
2172 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2173 // Preferred transport type to remote dual mode device
2174 // Default: TRANSPORT_AUTO means no preference
2175 optional android.bluetooth.TransportTypeEnum transport = 2;
2176 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2177 // Default: UNKNOWN
2178 optional android.bluetooth.DeviceTypeEnum type = 3;
2179 // Current bond state (NONE, BONDING, BONDED)
2180 // Default: BOND_STATE_UNKNOWN
2181 optional android.bluetooth.BondStateEnum bond_state = 4;
2182 // Bonding sub state
2183 // Default: BOND_SUB_STATE_UNKNOWN
2184 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2185 // Unbond Reason
2186 // Default: UNBOND_REASON_UNKNOWN
2187 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2188}
2189
2190/**
2191 * Logs there is an event related Bluetooth classic pairing
2192 *
2193 * Logged from:
2194 * system/bt
2195 */
2196message BluetoothClassicPairingEventReported {
2197 // An identifier that can be used to match events for this device.
2198 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2199 // Salt: Randomly generated 256 bit value
2200 // Hash algorithm: HMAC-SHA256
2201 // Size: 32 byte
2202 // Default: null or empty if the device identifier is not known
2203 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2204 // Connection handle of this connection if available
2205 // Range: 0x0000 - 0x0EFF (12 bits)
2206 // Default: 0xFFFF if the handle is unknown
2207 optional int32 connection_handle = 2;
2208 // HCI command associated with this event
2209 // Default: CMD_UNKNOWN
2210 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2211 // HCI event associated with this event
2212 // Default: EVT_UNKNOWN
2213 optional android.bluetooth.hci.EventEnum hci_event = 4;
2214 // HCI command status code if this is triggerred by hci_cmd
2215 // Default: STATUS_UNKNOWN
2216 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2217 // HCI reason code associated with this event
2218 // Default: STATUS_UNKNOWN
2219 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002220 // A status value related to this specific event
2221 // Default: 0
2222 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002223}
2224
2225/**
2226 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2227 *
2228 * Logged from:
2229 * system/bt
2230 */
2231message BluetoothSmpPairingEventReported {
2232 // An identifier that can be used to match events for this device.
2233 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2234 // Salt: Randomly generated 256 bit value
2235 // Hash algorithm: HMAC-SHA256
2236 // Size: 32 byte
2237 // Default: null or empty if the device identifier is not known
2238 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2239 // SMP command sent or received over L2CAP
2240 // Default: CMD_UNKNOWN
2241 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2242 // Whether this command is sent or received
2243 // Default: DIRECTION_UNKNOWN
2244 optional android.bluetooth.DirectionEnum direction = 3;
2245 // SMP failure reason code
2246 // Default: PAIRING_FAIL_REASON_DEFAULT
2247 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2248}
2249
2250/**
Jack He815cdba2019-01-30 17:24:55 -08002251 * Logs when a Bluetooth socket’s connection state changed
2252 *
2253 * Logged from:
2254 * system/bt
2255 */
2256message BluetoothSocketConnectionStateChanged {
2257 // An identifier that can be used to match events for this device.
2258 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2259 // Salt: Randomly generated 256 bit value
2260 // Hash algorithm: HMAC-SHA256
2261 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002262 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002263 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002264 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002265 // Default 0 when unknown or don't care
2266 optional int32 port = 2;
2267 // Socket type as mentioned in
2268 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2269 // Default: SOCKET_TYPE_UNKNOWN
2270 optional android.bluetooth.SocketTypeEnum type = 3;
2271 // Socket connection state
2272 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2273 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2274 // Number of bytes sent to remote device during this connection
2275 optional int64 tx_bytes = 5;
2276 // Number of bytes received from remote device during this connection
2277 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002278 // Socket owner's UID
2279 optional int32 uid = 7 [(is_uid) = true];
2280 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2281 // |port| must be spawned by |server_port|
2282 // Default 0 when unknown or don't care
2283 optional int32 server_port = 8;
2284 // Whether this is a server listener socket
2285 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002286}
2287
2288/**
Jack He71426802019-04-02 13:32:52 -07002289 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2290 *
2291 * Logged from:
2292 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2293 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2294 *
2295 */
2296message BluetoothClassOfDeviceReported {
2297 // An identifier that can be used to match events for this device.
2298 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2299 // Salt: Randomly generated 256 bit value
2300 // Hash algorithm: HMAC-SHA256
2301 // Size: 32 byte
2302 // Default: null or empty if this is a server listener socket
2303 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2304 // Class of Device (CoD) value including both Major, Minor device class and service class
2305 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2306 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2307 // Default: 0
2308 optional int32 class_of_device = 2;
2309}
2310
2311/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002312 * Logs when something is plugged into or removed from the USB-C connector.
2313 *
2314 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002315 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002316 */
2317message UsbConnectorStateChanged {
2318 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002319 STATE_DISCONNECTED = 0;
2320 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002321 }
2322 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002323 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002324 // Last active session in ms.
2325 // 0 when the port is in connected state.
2326 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002327}
2328
2329/**
2330 * Logs the reported speaker impedance.
2331 *
2332 * Logged from:
2333 * Vendor audio implementation.
2334 */
2335message SpeakerImpedanceReported {
2336 optional int32 speaker_location = 1;
2337 optional int32 impedance = 2;
2338}
2339
2340/**
2341 * Logs the report of a failed hardware.
2342 *
2343 * Logged from:
2344 * Vendor HALs.
2345 *
2346 */
2347message HardwareFailed {
2348 enum HardwareType {
2349 HARDWARE_FAILED_UNKNOWN = 0;
2350 HARDWARE_FAILED_MICROPHONE = 1;
2351 HARDWARE_FAILED_CODEC = 2;
2352 HARDWARE_FAILED_SPEAKER = 3;
2353 HARDWARE_FAILED_FINGERPRINT = 4;
2354 }
2355 optional HardwareType hardware_type = 1;
2356
Maggie White6dcd8572019-01-31 14:11:50 -08002357 /**
2358 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002359 * the same hardware_type. The specific locations are vendor defined integers,
2360 * referring to board-specific numbering schemes.
2361 */
2362 optional int32 hardware_location = 2;
2363
Maggie White6dcd8572019-01-31 14:11:50 -08002364 /**
2365 * failure_code is specific to the HardwareType of the failed hardware.
2366 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002367 */
Maggie White6dcd8572019-01-31 14:11:50 -08002368 enum HardwareErrorCode {
2369 UNKNOWN = 0;
2370 COMPLETE = 1;
2371 SPEAKER_HIGH_Z = 2;
2372 SPEAKER_SHORT = 3;
2373 FINGERPRINT_SENSOR_BROKEN = 4;
2374 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002375 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002376 }
2377 optional int32 failure_code = 3;
2378}
2379
2380/**
2381 * Log an event when the device has been physically dropped.
2382 * Reported from the /vendor partition.
2383 */
2384message PhysicalDropDetected {
2385 // Confidence that the event was actually a drop, 0 -> 100
2386 optional int32 confidence_pctg = 1;
2387 // Peak acceleration of the drop, in 1/1000s of a g.
2388 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002389 // Duration of freefall in ms
2390 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002391}
2392
2393/**
2394 * Log bucketed battery charge cycles.
2395 *
2396 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002397 * a given charge point. For example, if 10 cycle buckets are
2398 * initialized, bucket 1 is the lowest 1/10th of the battery,
2399 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002400 *
2401 * Logged from:
2402 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2403 */
2404message ChargeCyclesReported {
2405 optional int32 cycle_bucket_1 = 1;
2406 optional int32 cycle_bucket_2 = 2;
2407 optional int32 cycle_bucket_3 = 3;
2408 optional int32 cycle_bucket_4 = 4;
2409 optional int32 cycle_bucket_5 = 5;
2410 optional int32 cycle_bucket_6 = 6;
2411 optional int32 cycle_bucket_7 = 7;
2412 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002413 optional int32 cycle_bucket_9 = 9;
2414 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002415}
2416
2417/**
Howard Roa46b6582018-09-18 16:45:02 -07002418 * Log battery health snapshot.
2419 *
2420 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2421 * are snapshotted periodically over 24hrs.
2422 */
2423message BatteryHealthSnapshot {
2424 enum BatterySnapshotType {
2425 UNKNOWN = 0;
2426 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2427 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2428 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2429 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2430 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2431 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2432 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2433 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2434 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2435 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2436 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2437 }
2438 optional BatterySnapshotType type = 1;
2439 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002440 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002441 // Voltage Battery Voltage, in microVolts.
2442 optional int32 voltage_micro_volt = 3;
2443 // Current Battery current, in microAmps.
2444 optional int32 current_micro_amps = 4;
2445 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2446 optional int32 open_circuit_micro_volt = 5;
2447 // Resistance Battery Resistance, in microOhms.
2448 optional int32 resistance_micro_ohm = 6;
2449 // Level Battery Level, as % of full.
2450 optional int32 level_percent = 7;
2451}
2452
2453/**
2454 * Log slow I/O operations on the primary storage.
2455 */
2456message SlowIo {
2457 // Classifications of IO Operations.
2458 enum IoOperation {
2459 UNKNOWN = 0;
2460 READ = 1;
2461 WRITE = 2;
2462 UNMAP = 3;
2463 SYNC = 4;
2464 }
2465 optional IoOperation operation = 1;
2466
2467 // The number of slow IO operations of this type over 24 hours.
2468 optional int32 count = 2;
2469}
2470
2471/**
2472 * Log battery caused shutdown with the last recorded voltage.
2473 */
2474message BatteryCausedShutdown {
2475 // The last recorded battery voltage prior to shutdown.
2476 optional int32 last_recorded_micro_volt = 1;
2477}
2478
2479/**
Tej Singha72344992019-04-17 18:55:08 -07002480 * Logs when ThermalService receives throttling events.
2481 *
2482 * Logged from:
2483 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2484 */
2485message ThermalThrottlingSeverityStateChanged {
2486 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2487 optional android.os.TemperatureTypeEnum sensor_type = 1;
2488
2489 // The name of the temperature source. Eg. CPU0
2490 optional string sensor_name = 2;
2491
2492 // Temperature in tenths of a degree C.
2493 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2494 optional int32 temperature_deci_celsius = 3;
2495
2496 // Relative severity of the throttling, see enum definition.
2497 optional android.os.ThrottlingSeverityEnum severity = 4;
2498}
2499
2500/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002501 * Logs the duration of a davey (jank of >=700ms) when it occurs
2502 *
2503 * Logged from:
2504 * frameworks/base/libs/hwui/JankTracker.cpp
2505 */
2506message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002507 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002508 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002509
Tej Singhbb8554a2018-01-26 11:59:14 -08002510 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002511 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002512}
2513
2514/**
Bookatze5885242017-10-24 20:10:31 -07002515 * Logs phone signal strength changes.
2516 *
2517 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002518 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002519 */
2520message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002521 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2522 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002523}
2524
Yangster4ccebea2018-10-09 17:09:02 -07002525
2526/**
2527 * Logs when the phone state, sim state or signal strength changes
2528 *
2529 * Logged from:
2530 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2531 */
2532message PhoneServiceStateChanged {
2533 optional android.telephony.ServiceStateEnum state = 1;
2534 optional android.telephony.SimStateEnum sim_state = 2;
2535 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2536}
2537
2538/**
2539 * Logs when the phone becomes on or off.
2540 *
2541 * Logged from:
2542 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2543 */
2544message PhoneStateChanged {
2545 enum State {
2546 OFF = 0;
2547 ON = 1;
2548 }
2549 optional State state = 1;
2550}
2551
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002552message BackGesture {
2553 enum BackType {
2554 DEFAULT_BACK_TYPE = 0;
2555 COMPLETED = 1;
2556 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2557 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2558 INCOMPLETE = 4;
2559 }
2560 optional BackType type = 1;
2561
2562 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2563 enum WindowHorizontalLocation {
2564 DEFAULT_LOCATION = 0;
2565 LEFT = 1;
2566 RIGHT = 2;
2567 }
2568 optional WindowHorizontalLocation x_location = 3;
2569}
2570
2571message ExclusionRectStateChanged {
2572 optional string component_name = 1; // if not available, simply packageName
2573 optional int32 requested_height = 2; // px
2574 optional int32 rejected_height = 3; // px
2575
2576 enum WindowHorizontalLocation {
2577 DEFAULT_LOCATION = 0;
2578 LEFT = 1;
2579 RIGHT = 2;
2580 }
2581 optional WindowHorizontalLocation x_location = 4;
2582 optional bool landscape = 5;
2583 optional bool splitscreen = 6;
2584 optional int32 duration_millis = 7;
2585}
2586
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002587message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002588 optional android.stats.launcher.LauncherAction action = 1;
2589 optional android.stats.launcher.LauncherState src_state = 2;
2590 optional android.stats.launcher.LauncherState dst_state = 3;
2591 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002592 optional bool is_swipe_up_enabled = 5;
2593}
2594
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002595message StyleUIChanged {
2596 optional android.stats.style.Action action = 1;
2597 optional int32 color_package_hash = 2;
2598 optional int32 font_package_hash = 3;
2599 optional int32 shape_package_hash = 4;
2600 optional int32 clock_package_hash = 5;
2601 optional int32 launcher_grid = 6;
2602 optional int32 wallpaper_category_hash = 7;
2603 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002604 optional int32 color_preference = 9;
2605 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002606}
2607
David Chenc28b2bb2017-10-24 12:52:52 -07002608/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002609 * Logs when Settings UI has changed.
2610 *
2611 * Logged from:
2612 * packages/apps/Settings
2613 */
2614message SettingsUIChanged {
2615 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002616 * Where this SettingsUIChange event comes from. For example, if
2617 * it's a PAGE_VISIBLE event, where the page is opened from.
2618 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002619 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002620
2621 /**
2622 * What the UI action is.
2623 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002624 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002625
2626 /**
2627 * Where the action is happening
2628 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002629 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002630
2631 /**
2632 * What preference changed in this event.
2633 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002634 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002635
2636 /**
2637 * The new value of the changed preference.
2638 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002639 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002640}
2641
2642/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002643 * Logs basic timing information about touch events.
2644 * Reported at most every 5 minutes while device is being interacted with.
2645 *
2646 * Logged from:
2647 * frameworks/native/services/inputflinger
2648 */
2649message TouchEventReported {
2650 /**
2651 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002652 * and the standard deviation of the time spent processing touchscreen events
2653 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002654 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002655 * On supported devices, the starting point is taken during the hard interrupt inside the
2656 * kernel touch driver. On all other devices, the starting point is taken inside
2657 * the kernel's input event subsystem upon receipt of the input event.
2658 * The ending point is taken inside InputDispatcher, just after the input event
2659 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002660 */
2661 // Minimum value
2662 optional float latency_min_micros = 1;
2663 // Maximum value
2664 optional float latency_max_micros = 2;
2665 // Average value
2666 optional float latency_mean_micros = 3;
2667 // Standard deviation
2668 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002669 // Number of touch events (input_event) in this report
2670 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002671}
2672
2673/**
Philip Quinn0eded622019-01-29 12:46:28 -08002674 * Logs gesture classification and timing information for touch events.
2675 *
2676 * Logged from:
2677 * frameworks/base/core/java/android/view/GestureDetector.java
2678 * frameworks/base/core/java/android/view/View.java
2679 */
2680message TouchGestureClassified {
2681 // The source of the classification (e.g. Java class name).
2682 optional string source = 1;
2683
2684 enum Classification {
2685 UNKNOWN_CLASSIFICATION = 0;
2686 SINGLE_TAP = 1;
2687 DOUBLE_TAP = 2;
2688 LONG_PRESS = 3;
2689 DEEP_PRESS = 4;
2690 SCROLL = 5;
2691 }
2692 // The classification of the gesture.
2693 optional Classification classification = 2;
2694
2695 // The interval from the start of a touch event stream until the
2696 // classification was made.
2697 optional int32 latency_millis = 3;
2698
2699 // The distance from the location of the first touch event to the
2700 // location of the touch event when the classification was made.
2701 optional float displacement_px = 4;
2702}
2703
2704/**
David Chenc28b2bb2017-10-24 12:52:52 -07002705 * Logs that a setting was updated.
2706 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002707 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002708 * The tag and is_default allow resetting of settings to default values based on the specified
2709 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2710 */
2711message SettingChanged {
2712 // The name of the setting.
2713 optional string setting = 1;
2714
2715 // The change being imposed on this setting. May represent a number, eg "3".
2716 optional string value = 2;
2717
2718 // The new value of this setting. For most settings, this is same as value. For some settings,
2719 // value is +X or -X where X represents an element in a set. For example, if the previous value
2720 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2721 // The +/- feature is currently only used for location_providers_allowed.
2722 optional string new_value = 3;
2723
2724 // The previous value of this setting.
2725 optional string prev_value = 4;
2726
2727 // The tag used with the is_default for resetting sets of settings. This is generally null.
2728 optional string tag = 5;
2729
Bookatz90867622018-01-31 15:05:57 -08002730 // True if this setting with tag should be resettable.
2731 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002732
David Chenbd789912018-03-16 17:19:55 -07002733 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002734 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002735
2736 enum ChangeReason {
2737 UPDATED = 1; // Updated can be an insertion or an update.
2738 DELETED = 2;
2739 }
2740 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002741}
Chenjie Yub3dda412017-10-24 13:41:59 -07002742
Chenjie Yu05013b32017-11-21 10:21:41 -08002743/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002744 * Logs activity going to foreground or background
2745 *
2746 * Logged from:
2747 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2748 */
2749message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002750 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002751 optional string pkg_name = 2;
2752 optional string class_name = 3;
2753
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002754 enum State {
2755 BACKGROUND = 0;
2756 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002757 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002758 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002759}
David Chenc8a43242017-10-17 16:23:28 -07002760
2761/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002762 * Logs when a volume entered low Storage state.
2763 * Logged from:
2764 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2765 */
2766message LowStorageStateChanged {
2767 // Volume that ran out of storage.
2768 optional string volume_description = 1;
2769
2770 enum State {
2771 UNKNOWN = 0;
2772 OFF = 1;
2773 ON = 2;
2774 }
2775 optional State state = 2;
2776}
2777
2778/**
2779 * Logs when an app is downgraded.
2780 * Logged from:
2781 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2782 */
2783message AppDowngraded {
2784 optional string package_name = 1;
2785 // Size of the package (all data) before being downgraded.
2786 optional int64 size_in_bytes_before = 2;
2787 // Size of the package (all data) after being downgraded.
2788 optional int64 size_in_bytes_after = 3;
2789
2790 optional bool aggressive = 4;
2791}
2792
2793/**
2794 * Logs when an app is optimized after being downgraded.
2795 * Logged from:
2796 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2797 */
2798message AppOptimizedAfterDowngraded {
2799 optional string package_name = 1;
2800}
2801
2802/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002803 * Logs whenever an app is installed on external storage.
2804 * Logged from:
2805 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2806 */
2807message AppInstallOnExternalStorageReported {
2808 // The type of external storage.
2809 optional android.stats.storage.ExternalStorageType storage_type = 1;
2810 // The name of the package that is installed on the sd card.
2811 optional string package_name = 2;
2812}
2813
2814/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002815 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002816 * Logged from:
2817 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2818 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002819message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002820 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002821
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002822 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002823
2824 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002825 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002826 optional string process_name = 3;
2827
2828 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002829 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002830
2831 optional string package_name = 5;
2832
2833 enum InstantApp {
2834 UNAVAILABLE = 0;
2835 FALSE = 1;
2836 TRUE = 2;
2837 }
2838 optional InstantApp is_instant_app = 6;
2839
2840 enum ForegroundState {
2841 UNKNOWN = 0;
2842 BACKGROUND = 1;
2843 FOREGROUND = 2;
2844 }
2845 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002846
2847 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002848}
David Chen9e3808c2017-11-20 17:25:34 -08002849
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002850/**
2851 * Logs when a WTF (What a Terrible Failure) happened.
2852 * Logged from:
2853 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2854 */
2855message WTFOccurred {
2856 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002857
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002858 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002859
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002860 // The name of the process.
2861 // system_server if it is not by an app
2862 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002863
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002864 // The pid if available. -1 means not available.
2865 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002866
2867 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002868}
2869
2870/**
2871 * Logs when system server reports low memory.
2872 * Logged from:
2873 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2874 */
2875message LowMemReported {
2876}
2877
2878/**
2879 * Logs when an app ANR (App Not Responding) occurs.
2880 * Logged from:
2881 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2882 */
2883message ANROccurred {
2884 optional int32 uid = 1 [(is_uid) = true];
2885
2886 optional string process_name = 2;
2887
2888 optional string short_component_name = 3;
2889
2890 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002891
2892 enum InstantApp {
2893 UNAVAILABLE = 0;
2894 FALSE = 1;
2895 TRUE = 2;
2896 }
2897 optional InstantApp is_instant_app = 5;
2898
2899 enum ForegroundState {
2900 UNKNOWN = 0;
2901 BACKGROUND = 1;
2902 FOREGROUND = 2;
2903 }
2904 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002905
2906 optional android.server.ErrorSource error_source = 7;
2907
2908 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002909}
2910
Bookatza7020bd2018-08-28 16:29:35 -07002911/**
2912 * Logs when the vibrator state changes.
2913 * Logged from:
2914 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2915 */
2916message VibratorStateChanged {
2917 repeated AttributionNode attribution_node = 1;
2918
2919 enum State {
2920 OFF = 0;
2921 ON = 1;
2922 }
2923 optional State state = 2;
2924
2925 // Duration (in milliseconds) requested to keep the vibrator on.
2926 // Only applicable for State == ON.
2927 optional int64 duration_millis = 3;
2928}
2929
David Chen0a368b22017-12-06 16:28:16 -08002930/*
2931 * Allows other apps to push events into statsd.
2932 * Logged from:
2933 * frameworks/base/core/java/android/util/StatsLog.java
2934 */
David Chen0b5c90c2018-01-25 16:51:49 -08002935message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002936 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002937 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002938
2939 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2940 optional int32 label = 2;
2941
2942 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2943 // predicates for the metrics).
2944 enum State {
2945 UNKNOWN = 0;
2946 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2947 STOP = 2;
2948 START = 3;
2949 }
2950 optional State state = 3;
2951}
2952
David Chen9e3808c2017-11-20 17:25:34 -08002953/**
Bookatz7948c872018-09-04 12:58:33 -07002954 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2955 * For example, this could be due to the user manually changing the time.
2956 *
2957 * Logged from:
2958 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2959 */
2960message WallClockTimeShifted {
2961 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2962 optional int64 wall_clock_timestamp_millis = 1;
2963}
2964
2965/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002966 * Logs when statsd detects an anomaly.
2967 *
2968 * Logged from:
2969 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2970 */
2971message AnomalyDetected {
2972 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002973 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002974
Yangster-mac94e197c2018-01-02 16:03:03 -08002975 // Id of the config whose anomaly detection alert fired.
2976 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002977
Yangster-mac94e197c2018-01-02 16:03:03 -08002978 // Id of the alert (i.e. name of the anomaly that was detected).
2979 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002980}
2981
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002982message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002983 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002984 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002985
2986 // The app package name.
2987 optional string pkg_name = 2;
2988
2989 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002990 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002991 WARM = 1;
2992 HOT = 2;
2993 COLD = 3;
2994 }
2995 // The transition type.
2996 optional TransitionType type = 3;
2997
2998 // The activity name.
2999 optional string activity_name = 4;
3000
3001 // The name of the calling app. Empty if not set.
3002 optional string calling_pkg_name = 5;
3003
3004 // Whether the app is an instant app.
3005 optional bool is_instant_app = 6;
3006
3007 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003008 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003009
Bookatz80d11a02018-01-16 10:46:35 -08003010 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003011
David Chen0b5c90c2018-01-25 16:51:49 -08003012 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003013 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003014 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003015 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003016 optional int32 bind_application_delay_millis = 11;
3017 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003018
3019 // Empty if not set.
3020 optional string launch_token = 13;
3021
Calin Juravle759fbda2018-02-20 19:52:30 +00003022 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003023 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003024
3025 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003026 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003027}
3028
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003029message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003030 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003031 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003032
3033 // The app package name.
3034 optional string pkg_name = 2;
3035
3036 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003037 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003038 WARM = 1;
3039 HOT = 2;
3040 COLD = 3;
3041 }
3042 // The transition type.
3043 optional TransitionType type = 3;
3044
3045 // The activity name.
3046 optional string activity_name = 4;
3047}
3048
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003049message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003050 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003051 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003052
3053 // The app package name.
3054 optional string pkg_name = 2;
3055
3056 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003057 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003058 WITH_BUNDLE = 1;
3059 WITHOUT_BUNDLE = 2;
3060 }
3061 // The transition type.
3062 optional TransitionType type = 3;
3063
3064 // The activity name.
3065 optional string activity_name = 4;
3066
3067 optional bool transition_process_running = 5;
3068
3069 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003070 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003071}
3072
Bookatz8fcd09a2017-12-18 13:01:10 -08003073/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003074 * Logs a picture-in-picture action
3075 * Logged from:
3076 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3077 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3078 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3079 */
3080message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003081 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003082 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003083
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003084 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003085
Chenjie Yu52cacc62017-12-08 18:11:45 -08003086 enum State {
3087 ENTERED = 1;
3088 EXPANDED_TO_FULL_SCREEN = 2;
3089 MINIMIZED = 3;
3090 DISMISSED = 4;
3091 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003092 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003093}
3094
3095/**
Chenjie Yue8904192017-12-08 19:12:57 -08003096 * Logs overlay action
3097 * Logged from:
3098 * services/core/java/com/android/server/wm/Session.java
3099 */
3100message OverlayStateChanged {
tsaichristine10978642019-09-10 14:12:49 -07003101 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003102
tsaichristine10978642019-09-10 14:12:49 -07003103 optional string package_name = 2 [(state_field_option).option = PRIMARY];
Chenjie Yue8904192017-12-08 19:12:57 -08003104
3105 optional bool using_alert_window = 3;
3106
3107 enum State {
3108 ENTERED = 1;
3109 EXITED = 2;
3110 }
tsaichristine10978642019-09-10 14:12:49 -07003111 optional State state = 4 [(state_field_option).option = EXCLUSIVE];
Chenjie Yue8904192017-12-08 19:12:57 -08003112}
3113
Chenjie Yuccfe6452018-01-30 11:33:21 -08003114/*
3115 * Logs foreground service starts and stops.
3116 * Note that this is not when a service starts or stops, but when it is
3117 * considered foreground.
3118 * Logged from
3119 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3120 */
3121message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003122 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003123 // package_name + "/" + class_name
3124 optional string short_name = 2;
3125
3126 enum State {
3127 ENTER = 1;
3128 EXIT = 2;
3129 }
3130 optional State state = 3;
3131}
3132
Chenjie Yue8904192017-12-08 19:12:57 -08003133/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003134 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3135 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3136 * attributed back to the parent (host) uid. One example is Chrome.
3137 *
3138 * Logged from:
3139 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3140 */
3141message IsolatedUidChanged {
3142 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003143 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003144 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003145 optional int32 parent_uid = 1;
3146
3147 optional int32 isolated_uid = 2;
3148
3149 // We expect an isolated uid to be removed before if it's used for another parent uid.
3150 enum Event {
3151 REMOVED = 0;
3152 CREATED = 1;
3153 }
3154 optional Event event = 3;
3155}
3156
3157/*
3158 * Logs the reception of an incoming network packet causing the main system to wake up for
3159 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3160 * and processed by WakeupController.cpp.
3161 */
3162message PacketWakeupOccurred {
3163 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3164 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003165 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003166 // The interface name on which the packet was received.
3167 optional string iface = 2;
3168 // The ethertype value of the packet.
3169 optional int32 ethertype = 3;
3170 // String representation of the destination MAC address of the packet.
3171 optional string destination_hardware_address = 4;
3172 // String representation of the source address of the packet if this was an IP packet.
3173 optional string source_ip = 5;
3174 // String representation of the destination address of the packet if this was an IP packet.
3175 optional string destination_ip = 6;
3176 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3177 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3178 // families.
3179 optional int32 ip_next_header = 7;
3180 // The source port if this was a TCP or UDP packet.
3181 optional int32 source_port = 8;
3182 // The destination port if this was a TCP or UDP packet.
3183 optional int32 destination_port = 9;
3184}
3185
3186/*
3187 * Logs the memory stats for an app on startup.
3188 * Logged from:
3189 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3190 */
3191message AppStartMemoryStateCaptured {
3192 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003193 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003194
3195 // The process name.
3196 optional string process_name = 2;
3197
3198 // The activity name.
3199 optional string activity_name = 3;
3200
3201 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003202 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003203
3204 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003205 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003206
3207 // RSS
3208 optional int64 rss_in_bytes = 6;
3209
3210 // CACHE
3211 optional int64 cache_in_bytes = 7;
3212
3213 // SWAP
3214 optional int64 swap_in_bytes = 8;
3215}
3216
3217/*
3218 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3219 * for LMK event.
3220 * Logged from:
3221 * system/core/lmkd/lmkd.c
3222 */
3223message LmkStateChanged {
3224 enum State {
3225 UNKNOWN = 0;
3226 START = 1;
3227 STOP = 2;
3228 }
3229 optional State state = 1;
3230}
3231
3232/*
3233 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3234 * Logged from:
3235 * system/core/lmkd/lmkd.c
3236 */
3237message LmkKillOccurred {
3238 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003239 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003240
3241 // The process name.
3242 optional string process_name = 2;
3243
3244 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003245 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003246
3247 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003248 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003249
3250 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003251 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003252
3253 // RSS
3254 optional int64 rss_in_bytes = 6;
3255
3256 // CACHE
3257 optional int64 cache_in_bytes = 7;
3258
3259 // SWAP
3260 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003261
3262 // The elapsed real time of start of the process.
3263 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003264
3265 // Min oom adj score considered by lmkd.
3266 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003267}
3268
Rajeev Kumar51b54602018-03-01 12:18:26 -08003269/*
3270 * Logs when the ActivityManagerService detects that an app died.
3271 *
3272 * Logged from:
3273 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3274 */
3275message AppDied {
3276 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003277 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003278}
3279
Howard Ro21a039c2018-08-06 14:55:47 -07003280/**
3281 * An atom for generic metrics logging. Available from Android Q.
3282 */
3283message GenericAtom {
3284 // The uid of the application that sent this custom atom.
3285 optional int32 uid = 1 [(is_uid) = true];
3286
3287 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003288 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003289}
3290
Tej Singhd6d6d772018-09-05 17:41:25 -07003291/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003292 * Atom for simple logging of user interaction and impression events, such as "the user touched
3293 * this button" or "this dialog was displayed".
3294 * Keep the UI event stream clean: don't use for system or background events.
3295 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
3296 */
3297message UiEventReported {
3298 // The event_id.
3299 optional int32 event_id = 1;
3300 // The event's source or target uid and package, if applicable.
3301 // For example, the package posting a notification, or the destination package of a share.
3302 optional int32 uid = 2 [(is_uid) = true];
3303 optional string package_name = 3;
3304}
3305
3306/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003307 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003308 *
3309 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003310 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003311 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003312message BiometricAcquired {
3313 // Biometric modality that was acquired.
3314 optional android.hardware.biometrics.ModalityEnum modality = 1;
3315 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3316 optional int32 user = 2;
3317 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3318 optional bool is_crypto = 3;
3319 // Action that the device is performing. Acquired messages are only expected for enroll and
3320 // authenticate. Other actions may indicate an error.
3321 optional android.hardware.biometrics.ActionEnum action = 4;
3322 // The client that this acquisition was received for.
3323 optional android.hardware.biometrics.ClientEnum client = 5;
3324 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3325 optional int32 acquire_info = 6;
3326 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3327 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003328 // Dictates if this message should trigger additional debugging.
3329 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003330}
3331
3332/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003333 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003334 *
3335 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003336 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003337 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003338message BiometricAuthenticated {
3339 // Biometric modality that was used.
3340 optional android.hardware.biometrics.ModalityEnum modality = 1;
3341 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3342 optional int32 user = 2;
3343 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3344 // storage.
3345 optional bool is_crypto = 3;
3346 // The client that this acquisition was received for.
3347 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003348 // If authentication requires user confirmation. See BiometricPrompt's
3349 // setRequireConfirmation(bool) method.
3350 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003351
Kevin Chyn1741a072019-01-17 11:54:40 -08003352 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003353 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003354 REJECTED = 1;
3355 PENDING_CONFIRMATION = 2;
3356 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003357 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003358
3359 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003360 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003361 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3362 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3363 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3364 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003365 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003366 // Dictates if this message should trigger additional debugging.
3367 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003368}
3369
3370/**
3371 * Logs when a biometric error occurs.
3372 *
3373 * Logged from:
3374 * frameworks/base/services/core/java/com/android/server/biometrics
3375 */
3376message BiometricErrorOccurred {
3377 // Biometric modality that was used.
3378 optional android.hardware.biometrics.ModalityEnum modality = 1;
3379 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3380 optional int32 user = 2;
3381 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3382 optional bool is_crypto = 3;
3383 // Action that the device is performing.
3384 optional android.hardware.biometrics.ActionEnum action = 4;
3385 // The client that this acquisition was received for.
3386 optional android.hardware.biometrics.ClientEnum client = 5;
3387 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3388 // are unique to modality.
3389 optional int32 error_info = 6;
3390 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3391 // by the vendor and not specified by the HIDL interface.
3392 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003393 // Dictates if this message should trigger additional debugging.
3394 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003395 // Time spent during the authentication attempt.
3396 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003397}
3398
3399/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003400 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003401 * Logged from:
3402 * frameworks/base/services/core/java/com/android/server/biometrics
3403 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003404message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003405 // Biometric modality.
3406 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003407 // Type of issue detected.
3408 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003409 // Dictates if this message should trigger additional debugging.
3410 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003411}
Howard Ro688ae182018-09-25 00:09:36 -07003412
joshmccloskey6f952b22019-03-25 20:59:35 -07003413/**
3414 * Logs when a biometric enrollment occurs.
3415 *
3416 * Logged from:
3417 * frameworks/base/services/core/java/com/android/server/biometrics
3418 */
3419message BiometricEnrolled {
3420 // Biometric modality that was used.
3421 optional android.hardware.biometrics.ModalityEnum modality = 1;
3422 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3423 optional int32 user = 2;
3424 // The amount of time the enrollment took in milliseconds.
3425 optional int64 latency_millis = 3;
3426 // Whether or not the enrollment was successful.
3427 optional bool success = 4;
3428}
3429
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003430/*
Tej Singh0d176952019-01-16 19:10:54 -08003431 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003432 */
Tej Singh0d176952019-01-16 19:10:54 -08003433message FlagFlipUpdateOccurred {
3434 // If the event is from a flag config package, specify the package name.
3435 optional string flag_flip_package_name = 1;
3436
3437 // The order id of the package
3438 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003439}
3440
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003441/**
3442 * Potential experiment ids that goes with a train install.
3443 */
3444message TrainExperimentIds {
3445 repeated int64 experiment_id = 1;
3446}
3447
Yangster-macb89807e2018-11-15 21:10:57 -08003448/*
3449 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003450 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003451 */
3452message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003453 // Name of the train.
3454 optional string train_name = 1;
3455 // Version code for a "train" of packages that need to be installed atomically
3456 optional int64 train_version_code = 2;
3457 // After installation of this package, device requires a restart.
3458 optional bool requires_staging = 3;
3459 // Rollback should be enabled for this install.
3460 optional bool rollback_enabled = 4;
3461 // Requires low latency monitoring if possible.
3462 optional bool requires_low_latency_monitor = 5;
3463
Yangster-macb89807e2018-11-15 21:10:57 -08003464 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003465 UNKNOWN = 0;
3466 INSTALL_REQUESTED = 1;
3467 INSTALL_STARTED = 2;
3468 INSTALL_STAGED_NOT_READY = 3;
3469 INSTALL_STAGED_READY = 4;
3470 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003471 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3472 // and INSTALL_FAILURE_COMMIT.
3473 INSTALL_FAILURE = 6 [deprecated = true];
3474 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003475 INSTALL_CANCELLED = 7;
3476 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003477 INSTALLER_ROLLBACK_INITIATED = 9;
3478 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3479 INSTALLER_ROLLBACK_STAGED = 11;
3480 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3481 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3482 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3483 INSTALLER_ROLLBACK_SUCCESS = 15;
3484 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003485 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3486 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3487 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3488 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3489 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3490 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003491 INSTALL_FAILURE_DOWNLOAD = 23;
3492 INSTALL_FAILURE_STATE_MISMATCH = 24;
3493 INSTALL_FAILURE_COMMIT = 25;
Yangster-macb89807e2018-11-15 21:10:57 -08003494 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003495 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003496 // Possible experiment ids for monitoring this push.
3497 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3498 // user id
3499 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003500}
3501
Tej Singhc9203082019-05-03 13:42:23 -07003502/* Test atom, is not logged anywhere */
3503message TestAtomReported {
3504 repeated AttributionNode attribution_node = 1;
3505 optional int32 int_field = 2;
3506 optional int64 long_field = 3;
3507 optional float float_field = 4;
3508 optional string string_field = 5;
3509 optional bool boolean_field = 6;
3510 enum State {
3511 UNKNOWN = 0;
3512 OFF = 1;
3513 ON = 2;
3514 }
3515 optional State state = 7;
3516 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3517}
3518
Maggie Whitefc1aa592018-11-28 21:55:23 -08003519/** Represents USB port overheat event. */
3520message UsbPortOverheatEvent {
3521 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3522 optional int32 plug_temperature_deci_c = 1;
3523
3524 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3525 optional int32 max_temperature_deci_c = 2;
3526
3527 /* Time between USB plug event and overheat threshold trip, in seconds. */
3528 optional int32 time_to_overheat_secs = 3;
3529
3530 /* Time between overheat threshold trip and hysteresis, in seconds. */
3531 optional int32 time_to_hysteresis_secs = 4;
3532
3533 /* Time between hysteresis and active mitigation ending, in seconds. */
3534 optional int32 time_to_inactive_secs = 5;
3535};
3536
Maggie White8735b852019-01-18 11:40:49 -08003537/**
3538 * Logs total effective full charge and discharge cycles on a battery.
3539 * Here are some examples of one effective cycle:
3540 * 1) the battery charges from 0% to 100% and drains back to 0%,
3541 * 2) charging from 50% to 100% and draining back to 50% twice.
3542 * Pulled from:
3543 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3544 */
3545message BatteryCycleCount {
3546 /* Number of total charge and discharge cycles on the system battery. */
3547 optional int32 cycle_count = 1;
3548}
3549
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003550/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003551 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3552 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003553 * Pulled from:
3554 * StatsCompanionService
3555 */
3556
Carmen Agimof12dec122019-03-06 16:14:38 +00003557message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003558
Carmen Agimof12dec122019-03-06 16:14:38 +00003559 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003560 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003561 PUBLIC = 1;
3562 PRIVATE = 2;
3563 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003564 }
3565
Carmen Agimof12dec122019-03-06 16:14:38 +00003566 // The type of external storage.
3567 optional android.stats.storage.ExternalStorageType storage_type = 1;
3568 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3569 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003570 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003571 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003572}
3573
Yangster-macb89807e2018-11-15 21:10:57 -08003574/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003575 * Logs when a connection becomes available and lost.
3576 * Logged in StatsCompanionService.java
3577 */
3578message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003579 // Id of the network.
3580 optional int32 net_id = 1;
3581
3582 enum State {
3583 UNKNOWN = 0;
3584 CONNECTED = 1;
3585 DISCONNECTED = 2;
3586 }
3587 // Connected state of a network.
3588 optional State state = 2;
3589}
3590
3591/**
3592 * Logs when a service starts and stops.
3593 * Logged from:
3594 * services/core/java/com/android/server/am/ActiveServices.java
3595 */
3596message ServiceStateChanged {
3597
3598 optional int32 uid = 1 [(is_uid) = true];
3599
3600 optional string package_name = 2;
3601
3602 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003603
3604 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003605 START = 1;
3606 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003607 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003608
3609 optional State state = 4;
3610}
3611
3612/**
3613 * Logs when a service is launched.
3614 * Logged from:
3615 * services/core/java/com/android/server/am/ActiveServices.java
3616 */
3617message ServiceLaunchReported {
3618
3619 optional int32 uid = 1 [(is_uid) = true];
3620
3621 optional string package_name = 2;
3622
3623 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003624}
Howard Ro688ae182018-09-25 00:09:36 -07003625
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003626/**
3627 * Logs when a hidden API is used.
3628 *
3629 * Logged from:
3630 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3631 */
3632message HiddenApiUsed {
3633 // The uid of the app making the hidden access.
3634 optional int32 uid = 1 [(is_uid) = true];
3635
3636 // Signature of the method or field accessed.
3637 optional string signature = 2;
3638
3639 enum AccessMethod {
3640 NONE = 0;
3641 REFLECTION = 1;
3642 JNI = 2;
3643 LINKING = 3;
3644 }
3645
3646 // Type of access.
3647 optional AccessMethod access_method = 3;
3648
3649 // Whether the access was prevented or not.
3650 optional bool access_denied = 4;
3651}
3652
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003653/**
3654 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3655 * - When user sees privacy chip
3656 * - When user clicks privacy chip
3657 * - How does the user exit the Privacy Dialog
3658 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003659 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3660 */
3661message PrivacyIndicatorsInteracted {
3662
3663 enum Type {
3664 UNKNOWN = 0;
3665 CHIP_VIEWED = 1;
3666 CHIP_CLICKED = 2;
3667 DIALOG_PRIVACY_SETTINGS = 3;
3668 DIALOG_DISMISS = 4;
3669 DIALOG_LINE_ITEM = 5;
3670 }
3671
3672 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3673
3674 // Used if the type is LINE_ITEM
3675 optional string package_name = 2;
3676}
3677
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003678/**
3679 * Logs information about a package that is moved from the internal to external storage and vice
3680 * versa.
3681 * It logs the package name, the type of the external storage where the package is installed
3682 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3683 * and the move type: if it's from internal to external or the other way around.
3684 *
3685 * Logged from:
3686 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3687 */
3688message AppMovedStorageReported {
3689 enum MoveType {
3690 UNKNOWN = 0;
3691 TO_EXTERNAL = 1;
3692 TO_INTERNAL = 2;
3693 }
3694 // The type of the external storage.
3695 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3696 // The type of move.
3697 optional MoveType move_type = 2;
3698 // The name of the package that was moved.
3699 optional string package_name = 3;
3700}
3701
jianjin8f2dee02019-03-29 14:03:08 -07003702/**
3703 * Logs when system server watchdog occurs.
3704 * Logged from:
3705 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3706 */
3707message SystemServerWatchdogOccurred {
3708 optional string subject = 1;
3709}
3710
3711/**
3712 * Logs when new file added to tombstones.
3713 * Logged from:
3714 * frameworks/base/core/java/com/android/server/BootReceiver.java
3715 */
3716message TombStoneOccurred {
3717}
3718
Hai Zhang5d3328d2019-04-13 21:25:06 +08003719/*
3720 * Information about a role request
3721 *
3722 * Logged from:
3723 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3724 */
3725message RoleRequestResultReported {
3726 // UID of application requesting the role
3727 optional int32 requesting_uid = 1;
3728
3729 // Package name of application requesting the role
3730 optional string requesting_package_name = 2;
3731
3732 // The role to be granted
3733 optional string role_name = 3;
3734
3735 // The count of applications qualifying for the role
3736 optional int32 qualifying_count = 4;
3737
3738 // UID of application current granted the role
3739 optional int32 current_uid = 5;
3740
3741 // Package name of application current granted the role
3742 optional string current_package_name = 6;
3743
3744 // UID of another application that user chose to grant the role to, instead of the requesting
3745 // application
3746 optional int32 granted_another_uid = 7;
3747
3748 // Package name of another application that user chose to grant the role to, instead of the
3749 // requesting application
3750 optional string granted_another_package_name = 8;
3751
3752 enum Result {
3753 UNDEFINED = 0;
3754 // role request was ignored
3755 IGNORED = 1;
3756 // role request was ignored because it's already granted
3757 IGNORED_ALREADY_GRANTED = 2;
3758 // role request was ignored because the application isn't qualified
3759 IGNORED_NOT_QUALIFIED = 3;
3760 // role request was ignored because user said it should be always denied
3761 IGNORED_USER_ALWAYS_DENIED = 4;
3762 // role was granted by user action
3763 USER_GRANTED = 5;
3764 // role was denied by user action
3765 USER_DENIED = 6;
3766 // role was denied by user granting another application the role
3767 USER_DENIED_GRANTED_ANOTHER = 7;
3768 // role was denied and set to be always denied by the user
3769 USER_DENIED_WITH_ALWAYS = 8;
3770 }
3771 // The result of the role request
3772 optional Result result = 9;
3773}
3774
Mark Tabrya824a642019-11-05 12:26:12 -08003775/**
3776 * Logs when a Vehicle Maps Service client's connection state has changed
3777 *
3778 * Logged from:
3779 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
3780 */
3781message VmsClientConnectionStateChanged {
3782 // The UID of the VMS client app
3783 optional int32 uid = 1 [(is_uid) = true];
3784
3785 enum State {
3786 UNKNOWN = 0;
3787 // Attempting to connect to the client
3788 CONNECTING = 1;
3789 // Client connection established
3790 CONNECTED = 2;
3791 // Client connection closed unexpectedly
3792 DISCONNECTED = 3;
3793 // Client connection closed by VMS
3794 TERMINATED = 4;
3795 // Error establishing the client connection
3796 CONNECTION_ERROR = 5;
3797 }
3798
3799 optional State state = 2;
3800}
3801
Chenjie Yubbcbc602018-02-05 16:51:52 -08003802//////////////////////////////////////////////////////////////////////
3803// Pulled atoms below this line //
3804//////////////////////////////////////////////////////////////////////
3805
3806/**
David Chenc8a43242017-10-17 16:23:28 -07003807 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3808 *
3809 * Pulled from:
3810 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3811 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003812message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003813 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003814
3815 optional int64 rx_bytes = 2;
3816
3817 optional int64 rx_packets = 3;
3818
3819 optional int64 tx_bytes = 4;
3820
3821 optional int64 tx_packets = 5;
3822}
3823
3824/**
3825 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3826 *
3827 * Pulled from:
3828 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3829 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003830message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003831 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003832
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003833 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3834 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003835
3836 optional int64 rx_bytes = 3;
3837
3838 optional int64 rx_packets = 4;
3839
3840 optional int64 tx_bytes = 5;
3841
3842 optional int64 tx_packets = 6;
3843}
3844
3845/**
3846 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3847 *
3848 * Pulled from:
3849 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3850 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003851message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003852 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003853
3854 optional int64 rx_bytes = 2;
3855
3856 optional int64 rx_packets = 3;
3857
3858 optional int64 tx_bytes = 4;
3859
3860 optional int64 tx_packets = 5;
3861}
3862
3863/**
3864 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3865 *
3866 * Pulled from:
3867 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3868 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003869message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003870 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003871
Yao Chenc40a19d2018-03-15 16:48:25 -07003872 // 1 denotes foreground and 0 denotes background. This is called Set in
3873 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003874 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003875
3876 optional int64 rx_bytes = 3;
3877
3878 optional int64 rx_packets = 4;
3879
3880 optional int64 tx_bytes = 5;
3881
3882 optional int64 tx_packets = 6;
3883}
3884
3885/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003886 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3887 *
3888 * Pulled from:
3889 * StatsCompanionService
3890 */
3891message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003892 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003893
3894 optional int64 rx_bytes = 2;
3895
3896 optional int64 tx_bytes = 3;
3897}
3898
3899/**
David Chenc8a43242017-10-17 16:23:28 -07003900 * Pulls the kernel wakelock durations. This atom is adapted from
3901 * android/internal/os/KernelWakelockStats.java
3902 *
3903 * Pulled from:
3904 * StatsCompanionService using KernelWakelockReader.
3905 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003906message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003907 optional string name = 1;
3908
3909 optional int32 count = 2;
3910
3911 optional int32 version = 3;
3912
Yangster-maca8a30442018-10-13 23:46:34 -07003913 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003914}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003915
Chenjie Yu05013b32017-11-21 10:21:41 -08003916/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003917 * Pulls low power state information. If power.stats HAL is not available, this
3918 * includes platform and subsystem sleep state information,
3919 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3920 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003921 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003922 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003923 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3924 * as defined in:
3925 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003926 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003927message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003928 // Subsystem name
3929 optional string subsystem_name = 1;
3930 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3931 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003932 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3933 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003934 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003935 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003936 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003937 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003938 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003939}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003940
Chenjie Yu05013b32017-11-21 10:21:41 -08003941/**
Bookatz92da2832018-11-01 18:10:03 -07003942 * Pulls on-device power measurement information.
3943 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3944 * Pulled from:
3945 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3946 */
3947message OnDevicePowerMeasurement {
3948 // Name of the subsystem (to which the rail belongs).
3949 optional string subsystem_name = 1;
3950
3951 // Rail name. The rail lies within the subsystem.
3952 optional string rail_name = 2;
3953
3954 // Time (in ms since boot) at which the rail energy value was measured.
3955 // This may differ slightly from the time that statsd logs this information.
3956 optional uint64 measurement_timestamp_millis = 3;
3957
3958 // Accumulated energy used via the rail since device boot in uWs.
3959 optional uint64 energy_microwatt_secs = 4;
3960}
3961
3962/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003963 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003964 * Pulls the time the cpu spend on the frequency index. Frequency index
3965 * starts from highest to lowest. The value should be monotonically
3966 * increasing since boot. However, if there is a cpu
3967 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003968 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003969message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003970 optional uint32 cluster = 1;
3971 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003972 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003973}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003974
Chenjie Yu05013b32017-11-21 10:21:41 -08003975/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003976 * Pulls Cpu Time Per Uid.
3977 * Note that isolated process uid time should be attributed to host uids.
3978 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003979message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003980 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003981 optional uint64 user_time_micros = 2;
3982 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003983}
3984
3985/**
3986 * Pulls Cpu Time Per Uid per frequency.
3987 * Note that isolated process uid time should be attributed to host uids.
3988 * For each uid, we order the time by descending frequencies.
3989 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003990message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003991 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003992 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003993 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003994}
Hugo Benichi884970e2017-11-14 22:42:46 +09003995
Chenjie Yu05013b32017-11-21 10:21:41 -08003996/**
3997 * Pulls Wifi Controller Activity Energy Info
3998 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003999message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004000 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004001 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004002 // stack reported state
4003 // TODO: replace this with proto enum
4004 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004005 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004006 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004007 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004008 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004009 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004010 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004011 // product of current(mA), voltage(V) and time(ms)
4012 optional uint64 controller_energy_used = 6;
4013}
4014
4015/**
4016 * Pulls Modem Activity Energy Info
4017 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004018message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004019 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004020 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004021 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004022 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004023 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004024 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004025 /**
4026 * Tx power index
4027 * index 0 = tx_power < 0dBm
4028 * index 1 = 0dBm < tx_power < 5dBm
4029 * index 2 = 5dBm < tx_power < 15dBm
4030 * index 3 = 15dBm < tx_power < 20dBm
4031 * index 4 = tx_power > 20dBm
4032 */
4033 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004034 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004035 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004036 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004037 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004038 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004039 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004040 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004041 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004042 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004043 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004044 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004045 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004046 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004047}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004048
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004049/**
4050 * Pulls Bluetooth Activity Energy Info
4051 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4052 */
4053message BluetoothActivityInfo {
4054 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004055 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004056 // bluetooth stack state
4057 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004058 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004059 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004060 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004061 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004062 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004063 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004064 // product of current(mA), voltage(V) and time(ms)
4065 optional uint64 energy_used = 6;
4066}
4067
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004068/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004069 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004070 *
4071 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004072 */
4073message ProcessMemoryState {
4074 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004075 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004076
4077 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004078 // Usually package name, "system" for system server.
4079 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004080 optional string process_name = 2;
4081
Rafal Slawikda51b932018-12-13 16:31:33 +00004082 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004083 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004084
4085 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004086 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004087
4088 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004089 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004090
Rajeev Kumar90235992018-01-29 11:06:48 -08004091 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004092 // Value is read from memory.stat, field total_rss if per-app memory
4093 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004094 optional int64 rss_in_bytes = 6;
4095
4096 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004097 // Value is read from memory.stat, field total_cache if per-app memory
4098 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004099 optional int64 cache_in_bytes = 7;
4100
4101 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004102 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004103 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004104 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004105
Rafal Slawik203c3db2019-09-25 19:53:01 +01004106 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004107 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004108
Rafal Slawik203c3db2019-09-25 19:53:01 +01004109 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4110 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004111
Rafal Slawik203c3db2019-09-25 19:53:01 +01004112 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4113 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004114}
4115
4116/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004117 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004118 *
4119 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4120 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004121 *
4122 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004123 */
4124message ProcessMemoryHighWaterMark {
4125 // The uid if available. -1 means not available.
4126 optional int32 uid = 1 [(is_uid) = true];
4127
Rafal Slawikda51b932018-12-13 16:31:33 +00004128 // The process name.
4129 // Usually package name or process cmdline.
4130 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004131 optional string process_name = 2;
4132
Rafal Slawik239b6802019-09-09 18:46:01 +01004133 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4134 // computed by converting kilobytes to bytes.
4135 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4136
Rafal Slawik3bea8952018-11-15 12:39:33 +00004137 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4138 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004139 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004140}
4141
4142/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004143 * Logs the memory stats for a process.
4144 *
4145 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4146 * and for selected native processes.
4147 */
4148message ProcessMemorySnapshot {
4149 // The uid if available. -1 means not available.
4150 optional int32 uid = 1 [(is_uid) = true];
4151
4152 // The process name.
4153 // Usually package name or process cmdline.
4154 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4155 optional string process_name = 2;
4156
4157 // The pid of the process.
4158 // Allows to disambiguate instances of the process.
4159 optional int32 pid = 3;
4160
4161 // The current OOM score adjustment value.
4162 // Read from ProcessRecord for managed processes.
4163 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4164 optional int32 oom_score_adj = 4;
4165
4166 // The current RSS of the process.
4167 // VmRSS from /proc/pid/status.
4168 optional int32 rss_in_kilobytes = 5;
4169
4170 // The current anon RSS of the process.
4171 // RssAnon from /proc/pid/status.
4172 optional int32 anon_rss_in_kilobytes = 6;
4173
4174 // The current swap size of the process.
4175 // VmSwap from /proc/pid/status.
4176 optional int32 swap_in_kilobytes = 7;
4177
4178 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4179 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4180}
4181
4182/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004183 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004184 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004185message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004186 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004187}
4188
4189/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004190 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004191 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004192message SystemUptime {
4193 // Milliseconds since the system was booted.
4194 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4195 // for external input).
4196 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004197 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004198}
4199
4200/*
4201 * Reads from /proc/uid_concurrent_active_time which has the format:
4202 * active: X (X is # cores)
4203 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4204 * [uid1]: [time-0] [time-1] [time-2] ... ...
4205 * ...
4206 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4207 * The file contains a monotonically increasing count of time for a single boot.
4208 */
4209message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004210 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004211 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004212}
4213
4214/**
4215 * Reads from /proc/uid_concurrent_policy_time which has the format:
4216 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4217 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4218 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4219 * ...
4220 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4221 * The file contains a monotonically increasing count of time for a single boot.
4222 */
4223message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004224 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004225 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004226 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004227}
4228
4229/*
4230 * Pulls free disk space, for data, system partition and temporary directory.
4231 */
4232message DiskSpace {
4233 // available bytes in data partition
4234 optional uint64 data_available_bytes = 1;
4235 // available bytes in system partition
4236 optional uint64 system_available_bytes = 2;
4237 // available bytes in download cache or temp directories
4238 optional uint64 temp_available_bytes = 3;
4239}
Tej Singhbf972d92018-01-10 20:51:13 -08004240
4241/**
4242 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004243 *
4244 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004245 */
4246message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004247 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004248}
4249
4250/**
4251 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004252 * Pulled from:
4253 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004254 */
4255message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004256 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004257}
4258
4259/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004260 * Pulls battery voltage.
4261 * Pulled from:
4262 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4263 */
4264message BatteryVoltage {
4265 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004266 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004267}
4268
4269/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004270 * Pulls battery level (percent full, from 0 to 100).
4271 *
4272 * Pulled from:
4273 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4274 */
4275message BatteryLevel {
4276 // Battery level. Should be in [0, 100].
4277 optional int32 battery_level = 1;
4278}
4279
4280/**
Tej Singhd89137e2018-03-26 14:51:40 -07004281 * Pulls the temperature of various parts of the device.
4282 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004283 *
Maggie White442b6312019-04-05 16:26:44 -07004284 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004285 */
4286message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004287 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004288 optional android.os.TemperatureTypeEnum sensor_location = 1;
4289
4290 // The name of the temperature source. Eg. CPU0
4291 optional string sensor_name = 2;
4292
Tej Singhd89137e2018-03-26 14:51:40 -07004293 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004294 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004295 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004296
4297 // Relative severity of the throttling, see enum definition.
4298 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004299}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004300
4301/**
4302 * Pulls the statistics of calls to Binder.
4303 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004304 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4305 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004306 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004307 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004308 */
4309message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004310 // UID of the process responsible for the binder transaction. It will be set if the process
4311 // executing the binder transaction attribute the transaction to another uid using
4312 // Binder.setThreadWorkSource().
4313 //
4314 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004315 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004316 // UID of the process executing the binder transaction.
4317 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004318 // Fully qualified class name of the API call.
4319 //
4320 // This is a system server class name.
4321 //
4322 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4323 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4324 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4325 // commonly used APIs.
4326 optional string service_class_name = 2;
4327 // Method name of the API call. It can also be a transaction code if we cannot
4328 // resolve it to a name. See Binder#getTransactionName.
4329 //
4330 // This is a system server method name.
4331 optional string service_method_name = 3;
4332 // Total number of API calls.
4333 optional int64 call_count = 4;
4334 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4335 optional bool screen_interactive = 13;
4336 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4337 // call_count will be equal to recorded_call_count.
4338 //
4339 // If recorded_call_count is different than call_count, it means data collection has been
4340 // sampled. All the fields below will be sampled in this case.
4341 optional int64 recorded_call_count = 12;
4342 // Number of exceptions thrown by the API.
4343 optional int64 recorded_exception_count = 5;
4344 // Total latency of all API calls.
4345 // Average can be computed using total_latency_micros / recorded_call_count.
4346 optional int64 recorded_total_latency_micros = 6;
4347 // Maximum latency of one API call.
4348 optional int64 recorded_max_latency_micros = 7;
4349 // Total CPU usage of all API calls.
4350 // Average can be computed using total_cpu_micros / recorded_call_count.
4351 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4352 optional int64 recorded_total_cpu_micros = 8;
4353 // Maximum CPU usage of one API call.
4354 optional int64 recorded_max_cpu_micros = 9;
4355 // Maximum parcel reply size of one API call.
4356 optional int64 recorded_max_reply_size_bytes = 10;
4357 // Maximum parcel request size of one API call.
4358 optional int64 recorded_max_request_size_bytes = 11;
4359}
4360
4361/**
4362 * Pulls the statistics of exceptions during calls to Binder.
4363 *
4364 * Binder stats are cumulative from boot unless somebody reset the data using
4365 * > adb shell dumpsys binder_calls_stats --reset
4366 */
4367message BinderCallsExceptions {
4368 // Exception class name, e.g. java.lang.IllegalArgumentException.
4369 //
4370 // This is an exception class name thrown by the system server.
4371 optional string exception_class_name = 1;
4372 // Total number of exceptions.
4373 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004374}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004375
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004376/**
4377 * Pulls the statistics of message dispatching on HandlerThreads.
4378 *
4379 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4380 * config on the device.
4381 *
4382 * Next tag: 11
4383 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004384message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004385 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004386 optional int32 uid = 1 [(is_uid) = true];
4387
4388 // Fully qualified class name of the handler target class.
4389 //
4390 // This field does not contain PII. This is a system server class name.
4391 optional string handler_class_name = 2;
4392
4393 // The name of the thread that runs the Looper.
4394 //
4395 // This field does not contain PII. This is a system server thread name.
4396 optional string looper_thread_name = 3;
4397
4398 // The name of the dispatched message.
4399 //
4400 // This field does not contain PII. This is a system server constant or class
4401 // name.
4402 optional string message_name = 4;
4403
4404 // Total number of successfully dispatched messages.
4405 optional int64 message_count = 5;
4406
4407 // Total number of messages that failed dispatching.
4408 optional int64 exception_count = 6;
4409
4410 // Total number of processed messages we have data recorded for. If we
4411 // collected data for all the messages, message_count will be equal to
4412 // recorded_message_count.
4413 //
4414 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004415 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004416 optional int64 recorded_message_count = 7;
4417
4418 // Total latency of all processed messages.
4419 // Average can be computed using recorded_total_latency_micros /
4420 // recorded_message_count.
4421 optional int64 recorded_total_latency_micros = 8;
4422
4423 // Total CPU usage of all processed message.
4424 // Average can be computed using recorded_total_cpu_micros /
4425 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004426 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004427 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004428
4429 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4430 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004431
4432 // Max recorded CPU usage of all processed messages.
4433 optional int64 recorded_max_cpu_micros = 11;
4434
4435 // Max recorded latency of all processed messages.
4436 optional int64 recorded_max_latency_micros = 12;
4437
4438 // Total number of messages we tracked the dispatching delay for. If we
4439 // collected data for all the messages, message_count will be equal to
4440 // recorded_delay_message_count.
4441 //
4442 // If recorded_delay_message_count is different than message_count, it means data
4443 // collection has been sampled or/and not all messages specified the target dispatch time.
4444 // The fields below will be sampled in this case.
4445 optional int64 recorded_delay_message_count = 13;
4446
4447 // Total dispatching delay of all processed messages.
4448 // Calculated as a difference between the target dispatching time (Message.when)
4449 // and the actual dispatching time.
4450 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4451 optional int64 recorded_total_delay_millis = 14;
4452
4453 // Max dispatching delay of all processed messages.
4454 // Calculated as a difference between the target dispatching time (Message.when)
4455 // and the actual dispatching time.
4456 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004457}
Tej Singh86dc9db2018-09-06 00:39:57 +00004458
4459/**
4460 * Pulls disk information, such as write speed and latency.
4461 */
4462message DiskStats {
4463 // Time taken to open, write 512B to, and close a file.
4464 // -1 if error performing the check.
4465 optional int64 data_write_latency_millis = 1;
4466
4467 optional bool file_based_encryption = 2;
4468
4469 // Recent disk write speed in kB/s.
4470 // -1 if error querying storageed.
4471 // 0 if data is unavailable.
4472 optional int32 recent_disk_write_speed = 3;
4473}
4474
4475
4476/**
4477 * Free and total bytes of the Data, Cache, and System partition.
4478 */
4479message DirectoryUsage {
4480 enum Directory {
4481 UNKNOWN = 0;
4482 DATA = 1;
4483 CACHE = 2;
4484 SYSTEM = 3;
4485 }
4486 optional Directory directory = 1;
4487 optional int64 free_bytes = 2;
4488 optional int64 total_bytes = 3;
4489}
4490
4491
4492/**
4493 * Size of an application: apk size, data size, and cache size.
4494 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4495 * Information is only reported for apps with the primary user (user 0).
4496 * Sizes are aggregated by package name.
4497 */
4498message AppSize {
4499 // Including uids will involve modifying diskstats logic.
4500 optional string package_name = 1;
4501 // App size in bytes. -1 if unavailable.
4502 optional int64 app_size_bytes = 2;
4503 // App data size in bytes. -1 if unavailable.
4504 optional int64 app_data_size_bytes = 3;
4505 // App cache size in bytes. -1 if unavailable.
4506 optional int64 app_cache_size_bytes = 4;
4507 // Time that the cache file was produced.
4508 // Uses System.currentTimeMillis(), which is wall clock time.
4509 optional int64 cache_time_millis = 5;
4510}
4511
4512
4513/**
4514 * Size of a particular category. Eg: photos, videos.
4515 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4516 */
4517message CategorySize {
4518 enum Category {
4519 UNKNOWN = 0;
4520 APP_SIZE = 1;
4521 APP_DATA_SIZE = 2;
4522 APP_CACHE_SIZE = 3;
4523 PHOTOS = 4;
4524 VIDEOS = 5;
4525 AUDIO = 6;
4526 DOWNLOADS = 7;
4527 SYSTEM = 8;
4528 OTHER = 9;
4529 }
4530 optional Category category = 1;
4531 // Category size in bytes.
4532 optional int64 size_bytes = 2;
4533 // Time that the cache file was produced.
4534 // Uses System.currentTimeMillis(), which is wall clock time.
4535 optional int64 cache_time_millis = 3;
4536}
Tej Singhd6d6d772018-09-05 17:41:25 -07004537
4538/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004539 * Pulls per uid I/O stats. The stats are cumulative since boot.
4540 *
4541 * Read/write bytes are I/O events from a storage device
4542 * Read/write chars are data requested by read/write syscalls, and can be
4543 * satisfied by caching.
4544 *
4545 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4546 */
4547message DiskIo {
4548 optional int32 uid = 1 [(is_uid) = true];
4549 optional int64 fg_chars_read = 2;
4550 optional int64 fg_chars_write = 3;
4551 optional int64 fg_bytes_read = 4;
4552 optional int64 fg_bytes_write = 5;
4553 optional int64 bg_chars_read = 6;
4554 optional int64 bg_chars_write = 7;
4555 optional int64 bg_bytes_read = 8;
4556 optional int64 bg_bytes_write = 9;
4557 optional int64 fg_fsync = 10;
4558 optional int64 bg_fsync= 11;
4559}
4560
4561
4562/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004563 * Pulls the number of fingerprints for each user.
4564 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004565 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004566 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004567message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004568 // The associated user. Eg: 0 for owners, 10+ for others.
4569 // Defined in android/os/UserHandle.java
4570 optional int32 user = 1;
4571 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004572 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004573}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004574
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004575/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004576 * Pulls the number of faces for each user.
4577 *
4578 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4579 */
4580message NumFacesEnrolled {
4581 // The associated user. Eg: 0 for owners, 10+ for others.
4582 // Defined in android/os/UserHandle.java
4583 optional int32 user = 1;
4584 // Number of faces registered to that user.
4585 optional int32 num_faces_enrolled = 2;
4586}
4587/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004588 * A mapping of role holder -> role
4589 */
4590message RoleHolder {
4591 // uid of the role holder
4592 optional int32 uid = 1 [(is_uid) = true];
4593
4594 // package name of the role holder
4595 optional string package_name = 2;
4596
4597 // the role held
4598 optional string role = 3;
4599}
4600
Yangsteraf9aee72018-10-12 09:26:16 -07004601message AggStats {
4602 optional int64 min = 1;
4603
4604 optional int64 average = 2;
4605
4606 optional int64 max = 3;
4607}
4608
4609message ProcessStatsStateProto {
4610 optional android.service.procstats.ScreenState screen_state = 1;
4611
4612 optional android.service.procstats.MemoryState memory_state = 2;
4613
4614 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4615 // and not frameworks/base/core/java/android/app/ActivityManager.java
4616 optional android.service.procstats.ProcessState process_state = 3;
4617
4618 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004619 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004620
4621 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004622 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004623
4624 // # of samples taken
4625 optional int32 sample_size = 5;
4626
4627 // PSS is memory reserved for this process
4628 optional AggStats pss = 6;
4629
4630 // USS is memory shared between processes, divided evenly for accounting
4631 optional AggStats uss = 7;
4632
4633 // RSS is memory resident for this process
4634 optional AggStats rss = 8;
4635}
4636
4637// Next Tag: 7
4638message ProcessStatsProto {
4639 // Name of process.
4640 optional string process = 1;
4641
4642 // Uid of the process.
4643 optional int32 uid = 2;
4644
4645 // Information about how often kills occurred
4646 message Kill {
4647 // Count of excessive CPU kills
4648 optional int32 cpu = 1;
4649
4650 // Count of kills when cached
4651 optional int32 cached = 2;
4652
4653 // PSS stats during cached kill
4654 optional AggStats cached_pss = 3;
4655 }
4656 optional Kill kill = 3;
4657
4658 // Time and memory spent in various states.
4659 repeated ProcessStatsStateProto states = 5;
4660
4661 // Total time process has been running... screen_state, memory_state, and process_state
4662 // will not be set.
4663 optional ProcessStatsStateProto total_running_state = 6;
4664}
4665
4666message PackageServiceOperationStatsProto {
4667 // Operate enum: Started, Foreground, Bound, Executing
4668 optional android.service.procstats.ServiceOperationState operation = 1;
4669
4670 // Number of times the service was in this operation.
4671 optional int32 count = 2;
4672
4673 // Information about a state the service can be in.
4674 message StateStats {
4675 // Screen state enum.
4676 optional android.service.procstats.ScreenState screen_state = 1;
4677 // Memory state enum.
4678 optional android.service.procstats.MemoryState memory_state = 2;
4679
4680 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004681 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004682 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004683 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004684 }
4685 repeated StateStats state_stats = 3;
4686}
4687
4688message PackageServiceStatsProto {
4689 // Name of service component.
4690 optional string service_name = 1;
4691
4692 // The operation stats.
4693 // The package_name, package_uid, package_version, service_name will not be set to save space.
4694 repeated PackageServiceOperationStatsProto operation_stats = 2;
4695}
4696
4697message PackageAssociationSourceProcessStatsProto {
4698 // Uid of the process.
4699 optional int32 process_uid = 1;
4700 // Process name.
4701 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004702 // Package name.
4703 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004704 // Total count of the times this association appeared.
4705 optional int32 total_count = 3;
4706
4707 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004708 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004709
4710 // Total count of the times this association became actively impacting its target process.
4711 optional int32 active_count = 5;
4712
4713 // Information on one source in this association.
4714 message StateStats {
4715 // Process state enum.
4716 optional android.service.procstats.ProcessState process_state = 1;
4717 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004718 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004719 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004720 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004721 }
4722 repeated StateStats active_state_stats = 6;
4723}
4724
4725message PackageAssociationProcessStatsProto {
4726 // Name of the target component.
4727 optional string component_name = 1;
4728 // Information on one source in this association.
4729 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4730}
4731
4732
4733message ProcessStatsPackageProto {
4734 // Name of package.
4735 optional string package = 1;
4736
4737 // Uid of the package.
4738 optional int32 uid = 2;
4739
4740 // Version of the package.
4741 optional int64 version = 3;
4742
4743 // Stats for each process running with the package loaded in to it.
4744 repeated ProcessStatsProto process_stats = 4;
4745
4746 // Stats for each of the package's services.
4747 repeated PackageServiceStatsProto service_stats = 5;
4748
4749 // Stats for each association with the package.
4750 repeated PackageAssociationProcessStatsProto association_stats = 6;
4751}
4752
4753message ProcessStatsSectionProto {
4754 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004755 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004756
4757 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004758 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004759
4760 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004761 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004762
4763 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004764 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004765
4766 // System runtime library. e.g. "libdvm.so", "libart.so".
4767 optional string runtime = 5;
4768
4769 // whether kernel reports swapped pss.
4770 optional bool has_swapped_pss = 6;
4771
4772 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4773 enum Status {
4774 STATUS_UNKNOWN = 0;
4775 STATUS_COMPLETE = 1;
4776 STATUS_PARTIAL = 2;
4777 STATUS_SHUTDOWN = 3;
4778 STATUS_SYSPROPS = 4;
4779 }
4780 repeated Status status = 7;
4781
Chenjie Yub2ecc792019-01-17 10:27:26 -08004782 // Number of pages available of various types and sizes, representation fragmentation.
4783 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4784
Yangsteraf9aee72018-10-12 09:26:16 -07004785 // Stats for each process.
4786 repeated ProcessStatsProto process_stats = 8;
4787
4788 // Stats for each package.
4789 repeated ProcessStatsPackageProto package_stats = 9;
4790}
4791
Chenjie Yub2ecc792019-01-17 10:27:26 -08004792message ProcessStatsAvailablePagesProto {
4793 // Node these pages are in (as per /proc/pagetypeinfo)
4794 optional int32 node = 1;
4795
4796 // Zone these pages are in (as per /proc/pagetypeinfo)
4797 optional string zone = 2;
4798
4799 // Label for the type of these pages (as per /proc/pagetypeinfo)
4800 optional string label = 3;
4801
4802 // Distribution of number of pages available by order size. First entry in array is
4803 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4804 repeated int32 pages_per_order = 4;
4805}
4806
Chenjie Yu12e5e672018-09-14 15:54:59 -07004807/**
4808 * Pulled from ProcessStatsService.java
4809 */
4810message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004811 optional ProcessStatsSectionProto proc_stats_section = 1;
4812}
4813
Chenjie Yuf910b7802019-01-11 16:08:20 -08004814/**
4815 * Pulled from ProcessStatsService.java
4816 */
4817message ProcStatsPkgProc {
4818 optional ProcessStatsSectionProto proc_stats_section = 1;
4819}
4820
Yangsteraf9aee72018-10-12 09:26:16 -07004821message PowerProfileProto {
4822 optional double cpu_suspend = 1;
4823
4824 optional double cpu_idle = 2;
4825
4826 optional double cpu_active = 3;
4827
4828 message CpuCluster {
4829 optional int32 id = 1;
4830 optional double cluster_power = 2;
4831 optional int32 cores = 3;
4832 repeated int64 speed = 4;
4833 repeated double core_power = 5;
4834 }
4835
4836 repeated CpuCluster cpu_cluster = 40;
4837
4838 optional double wifi_scan = 4;
4839
4840 optional double wifi_on = 5;
4841
4842 optional double wifi_active = 6;
4843
4844 optional double wifi_controller_idle = 7;
4845
4846 optional double wifi_controller_rx = 8;
4847
4848 optional double wifi_controller_tx = 9;
4849
4850 repeated double wifi_controller_tx_levels = 10;
4851
4852 optional double wifi_controller_operating_voltage = 11;
4853
4854 optional double bluetooth_controller_idle = 12;
4855
4856 optional double bluetooth_controller_rx = 13;
4857
4858 optional double bluetooth_controller_tx = 14;
4859
4860 optional double bluetooth_controller_operating_voltage = 15;
4861
4862 optional double modem_controller_sleep = 16;
4863
4864 optional double modem_controller_idle = 17;
4865
4866 optional double modem_controller_rx = 18;
4867
4868 repeated double modem_controller_tx = 19;
4869
4870 optional double modem_controller_operating_voltage = 20;
4871
4872 optional double gps_on = 21;
4873
4874 repeated double gps_signal_quality_based = 22;
4875
4876 optional double gps_operating_voltage = 23;
4877
4878 optional double bluetooth_on = 24;
4879
4880 optional double bluetooth_active = 25;
4881
4882 optional double bluetooth_at_cmd = 26;
4883
4884 optional double ambient_display = 27;
4885
4886 optional double screen_on = 28;
4887
4888 optional double radio_on = 29;
4889
4890 optional double radio_scanning = 30;
4891
4892 optional double radio_active = 31;
4893
4894 optional double screen_full = 32;
4895
4896 optional double audio = 33;
4897
4898 optional double video = 34;
4899
4900 optional double flashlight = 35;
4901
4902 optional double memory = 36;
4903
4904 optional double camera = 37;
4905
4906 optional double wifi_batched_scan = 38;
4907
4908 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004909}
Chenjie Yuab530202018-09-26 12:39:20 -07004910
4911/**
4912 * power_profile.xml and other constants for power model calculations.
4913 * Pulled from PowerProfile.java
4914 */
4915message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004916 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004917}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004918
4919/**
arangelovd5db50e2018-10-12 20:24:39 +01004920 * Logs when a user restriction was added or removed.
4921 *
4922 * Logged from:
4923 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4924 */
4925message UserRestrictionChanged {
4926 // The raw string of the user restriction as defined in UserManager.
4927 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4928 optional string restriction = 1;
4929 // Whether the restriction is enabled or disabled.
4930 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004931}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004932
4933/**
4934 * Pulls process user time and system time. Puller takes a snapshot of all pids
4935 * in the system and returns cpu stats for those that are working at the time.
4936 * Dead pids will be dropped. Kernel processes are excluded.
4937 * Min cool-down is 5 sec.
4938 */
4939message ProcessCpuTime {
4940 optional int32 uid = 1 [(is_uid) = true];
4941
4942 optional string process_name = 2;
4943 // Process cpu time in user space, cumulative from boot/process start
4944 optional int64 user_time_millis = 3;
4945 // Process cpu time in system space, cumulative from boot/process start
4946 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004947}
Misha Wagner5a51e002018-10-03 15:04:09 +01004948
4949/**
4950 * Pulls the CPU usage for each thread.
4951 *
4952 * Read from /proc/$PID/task/$TID/time_in_state files.
4953 *
4954 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4955 * time_in_state files not being present on some phones, have not been addressed. These should be
4956 * considered before a public release.
4957 */
4958message CpuTimePerThreadFreq {
4959 // UID that owns the process.
4960 optional int32 uid = 1 [(is_uid) = true];
4961 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004962 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004963 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004964 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004965 // Name of the process taken from `/proc/$PID/cmdline`.
4966 optional string process_name = 4;
4967 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4968 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004969
4970 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4971 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4972 // frequencies are given here as the alternative is sending eight separate atoms. This method
4973 // significantly reduces the amount of data created
4974 optional int32 frequency1_khz = 6;
4975 optional int32 time1_millis = 7;
4976 optional int32 frequency2_khz = 8;
4977 optional int32 time2_millis = 9;
4978 optional int32 frequency3_khz = 10;
4979 optional int32 time3_millis = 11;
4980 optional int32 frequency4_khz = 12;
4981 optional int32 time4_millis = 13;
4982 optional int32 frequency5_khz = 14;
4983 optional int32 time5_millis = 15;
4984 optional int32 frequency6_khz = 16;
4985 optional int32 time6_millis = 17;
4986 optional int32 frequency7_khz = 18;
4987 optional int32 time7_millis = 19;
4988 optional int32 frequency8_khz = 20;
4989 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004990}
Bookatz75ee60422018-11-09 12:27:37 -08004991
4992/**
Bookatz366a4432018-11-20 09:42:33 -08004993 * Pulls information about the device's build.
4994 */
4995message BuildInformation {
4996 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4997 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4998 optional string fingerprint = 1;
4999
5000 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5001 optional string brand = 2;
5002
5003 // Build.PRODUCT. The name of the overall product.
5004 optional string product = 3;
5005
5006 // Build.DEVICE. The name of the industrial design.
5007 optional string device = 4;
5008
5009 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5010 optional string version_release = 5;
5011
5012 // Build.ID. E.g. a label like "M4-rc20".
5013 optional string id = 6;
5014
5015 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5016 // represent this build.
5017 optional string version_incremental = 7;
5018
5019 // Build.TYPE. The type of build, like "user" or "eng".
5020 optional string type = 8;
5021
5022 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5023 optional string tags = 9;
5024}
5025
5026/**
Adam He420947c2019-01-23 15:59:09 -08005027 * Logs information about mismatched caller for content capture.
5028 *
5029 * Logged from:
5030 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5031 */
5032message ContentCaptureCallerMismatchReported {
5033 optional string intended_package = 1;
5034 optional string calling_package = 2;
5035}
5036
5037/**
5038 * Logs information about content capture service events.
5039 *
5040 * Logged from:
5041 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5042 */
5043message ContentCaptureServiceEvents {
5044 // The type of event.
5045 enum Event {
5046 UNKNOWN = 0;
5047 ON_CONNECTED = 1;
5048 ON_DISCONNECTED = 2;
5049 SET_WHITELIST = 3;
5050 SET_DISABLED = 4;
5051 ON_USER_DATA_REMOVED = 5;
5052 }
5053 optional Event event = 1;
5054 // component/package of content capture service.
5055 optional string service_info = 2;
5056 // component/package of target.
5057 // it's a concatenated list of component/package for SET_WHITELIST event
5058 // separated by " ".
5059 optional string target_info = 3;
5060}
5061
5062/**
5063 * Logs information about content capture session events.
5064 *
5065 * Logged from:
5066 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5067 */
5068message ContentCaptureSessionEvents {
5069 // The type of event.
5070 enum Event {
5071 UNKNOWN = 0;
5072 ON_SESSION_STARTED = 1;
5073 ON_SESSION_FINISHED = 2;
5074 SESSION_NOT_CREATED = 3;
5075 }
5076 optional int32 session_id = 1;
5077 optional Event event = 2;
5078 // (n/a on session finished)
5079 optional int32 state_flags = 3;
5080 // component/package of content capture service.
5081 optional string service_info = 4;
5082 // component/package of app.
5083 // (n/a on session finished)
5084 optional string app_info = 5;
5085 optional bool is_child_session = 6;
5086}
5087
5088/**
5089 * Logs information about session being flushed.
5090 *
5091 * Logged from:
5092 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5093 */
5094message ContentCaptureFlushed {
5095 optional int32 session_id = 1;
5096 // component/package of content capture service.
5097 optional string service_info = 2;
5098 // component/package of app.
5099 optional string app_info = 3;
5100 // session start/finish events
5101 optional int32 child_session_started = 4;
5102 optional int32 child_session_finished = 5;
5103 // count of view events.
5104 optional int32 view_appeared_count = 6;
5105 optional int32 view_disappeared_count = 7;
5106 optional int32 view_text_changed_count = 8;
5107
5108 // Flush stats.
5109 optional int32 max_events = 9;
5110 optional int32 idle_flush_freq = 10;
5111 optional int32 text_flush_freq = 11;
5112 optional int32 flush_reason = 12;
5113}
5114
5115/**
Bookatz75ee60422018-11-09 12:27:37 -08005116 * Pulls on-device BatteryStats power use calculations for the overall device.
5117 */
5118message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005119 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5120 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5121 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5122 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005123}
5124
5125/**
5126 * Pulls on-device BatteryStats power use calculations broken down by uid.
5127 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5128 * that is attributed to non-uid items. They must all be included to get the total power use.
5129 */
5130message DeviceCalculatedPowerBlameUid {
5131 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5132 optional int32 uid = 1 [(is_uid) = true];
5133
Bookatz3dbc13a2018-12-21 12:16:51 -08005134 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5135 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5136 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005137}
5138
5139/**
5140 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5141 * drain type.
5142 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5143 * is attributed uids. They must all be included to get the total power use.
5144 */
5145message DeviceCalculatedPowerBlameOther {
5146 // The type of item whose power use is being reported.
5147 enum DrainType {
5148 AMBIENT_DISPLAY = 0;
5149 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5150 BLUETOOTH = 2;
5151 CAMERA = 3;
5152 // Cell-standby
5153 CELL = 4;
5154 FLASHLIGHT = 5;
5155 IDLE = 6;
5156 MEMORY = 7;
5157 // Amount that total computed drain exceeded the drain estimated using the
5158 // battery level changes and capacity.
5159 OVERCOUNTED = 8;
5160 PHONE = 9;
5161 SCREEN = 10;
5162 // Amount that total computed drain was below the drain estimated using the
5163 // battery level changes and capacity.
5164 UNACCOUNTED = 11;
5165 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5166 WIFI = 13;
5167 }
5168 optional DrainType drain_type = 1;
5169
Bookatz3dbc13a2018-12-21 12:16:51 -08005170 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5171 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5172 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005173}
arangelov4e994062018-11-13 16:12:38 +00005174
5175/**
5176 * Logs device policy features.
5177 *
5178 * Logged from:
5179 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5180 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5181 */
5182message DevicePolicyEvent {
5183 // The event id - unique for each event.
5184 optional android.stats.devicepolicy.EventId event_id = 1;
5185 // The admin package name.
5186 optional string admin_package_name = 2;
5187 // A generic integer parameter.
5188 optional int32 integer_value = 3;
5189 // A generic boolean parameter.
5190 optional bool boolean_value = 4;
5191 // A parameter specifying a time period in milliseconds.
5192 optional uint64 time_period_millis = 5;
5193 // A parameter specifying a list of package names, bundle extras or string parameters.
5194 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5195}
shawnlinea5b66b2018-11-13 15:05:29 +08005196
5197/**
5198 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5199 *
5200 * Logged from:
5201 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5202 */
5203message DocsUILaunchReported {
5204 optional android.stats.docsui.LaunchAction launch_action = 1;
5205 optional bool has_initial_uri = 2;
5206 optional android.stats.docsui.MimeType mime_type = 3;
5207 optional android.stats.docsui.Root initial_root = 4;
5208}
5209
5210/**
5211 * Logs root/app visited event in file managers/picker. Call this when the user
5212 * taps on root/app in hamburger menu.
5213 *
5214 * Logged from:
5215 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5216 */
5217message DocsUIRootVisitedReported {
5218 optional android.stats.docsui.ContextScope scope = 1;
5219 optional android.stats.docsui.Root root = 2;
5220}
5221
5222/**
5223 * Logs file operation stats. Call this when a file operation has completed.
5224 *
5225 * Logged from:
5226 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5227 */
5228message DocsUIFileOperationReported {
5229 optional android.stats.docsui.Provider provider = 1;
5230 optional android.stats.docsui.FileOperation file_op = 2;
5231}
5232
5233/**
5234 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5235 * mode.
5236 *
5237 * Logged from:
5238 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5239 */
5240message DocsUIFileOperationCopyMoveModeReported {
5241 optional android.stats.docsui.FileOperation file_op = 1;
5242 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5243}
5244
5245
5246/**
5247 * Logs file sub operation stats. Call this when a file operation has failed.
5248 *
5249 * Logged from:
5250 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5251 */
5252message DocsUIFileOperationFailureReported {
5253 optional android.stats.docsui.Authority authority = 1;
5254 optional android.stats.docsui.SubFileOperation sub_op = 2;
5255}
5256
5257/**
5258* Logs the cancellation of a file operation. Call this when a job is canceled
5259*
5260* Logged from:
5261* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5262*/
5263message DocsUIFileOperationCanceledReported {
5264 optional android.stats.docsui.FileOperation file_op = 1;
5265}
5266
5267/**
5268 * Logs startup time in milliseconds.
5269 *
5270 * Logged from:
5271 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5272 */
5273message DocsUIStartupMsReported {
5274 optional int32 startup_millis = 1;
5275}
5276
5277/**
5278 * Logs the action that was started by user.
5279 *
5280 * Logged from:
5281 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5282 */
5283message DocsUIUserActionReported {
5284 optional android.stats.docsui.UserAction action = 1;
5285}
5286
5287/**
5288 * Logs the invalid type when invalid scoped access is requested.
5289 *
5290 * Logged from:
5291 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5292 */
5293message DocsUIInvalidScopedAccessRequestReported {
5294 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005295}
Ben Murdochbab399f62018-12-06 11:01:38 +00005296
5297/**
shawnlina75e82d2019-01-07 10:31:12 +08005298 * Logs the package name that launches docsui picker mode.
5299 *
5300 * Logged from:
5301 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5302 */
5303message DocsUIPickerLaunchedFromReported {
5304 optional string package_name = 1;
5305}
5306
5307/**
5308 * Logs the search type.
5309 *
5310 * Logged from:
5311 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5312 */
5313message DocsUISearchTypeReported {
5314 optional android.stats.docsui.SearchType search_type = 1;
5315}
5316
5317/**
5318 * Logs the search mode.
5319 *
5320 * Logged from:
5321 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5322 */
5323message DocsUISearchModeReported {
5324 optional android.stats.docsui.SearchMode search_mode = 1;
5325}
5326
5327/**
5328 * Logs the pick result information.
5329 *
5330 * Logged from:
5331 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5332 */
5333message DocsUIPickResultReported {
5334 optional int32 total_action_count = 1;
5335 optional int64 duration_millis = 2;
5336 optional int32 file_count= 3;
5337 optional bool is_searching = 4;
5338 optional android.stats.docsui.Root picked_from = 5;
5339 optional android.stats.docsui.MimeType mime_type = 6;
5340 optional int32 repeatedly_pick_times = 7;
5341}
5342
5343/**
Ben Murdochbab399f62018-12-06 11:01:38 +00005344 * Logs when an app's memory is compacted.
5345 *
5346 * Logged from:
5347 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5348 */
5349message AppCompacted {
5350 // The pid of the process being compacted.
5351 optional int32 pid = 1;
5352
5353 // The name of the process being compacted.
5354 optional string process_name = 2;
5355
5356 // The type of compaction.
5357 enum Action {
5358 UNKNOWN = 0;
5359 SOME = 1;
5360 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005361 PERSISTENT = 3;
5362 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00005363 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005364 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00005365
5366 // Total RSS in kilobytes consumed by the process prior to compaction.
5367 optional int64 before_rss_total_kilobytes = 4;
5368
5369 // File RSS in kilobytes consumed by the process prior to compaction.
5370 optional int64 before_rss_file_kilobytes = 5;
5371
5372 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5373 optional int64 before_rss_anon_kilobytes = 6;
5374
5375 // Swap in kilobytes consumed by the process prior to compaction.
5376 optional int64 before_swap_kilobytes = 7;
5377
5378 // Total RSS in kilobytes consumed by the process after compaction.
5379 optional int64 after_rss_total_kilobytes = 8;
5380
5381 // File RSS in kilobytes consumed by the process after compaction.
5382 optional int64 after_rss_file_kilobytes = 9;
5383
5384 // Anonymous RSS in kilobytes consumed by the process after compaction.
5385 optional int64 after_rss_anon_kilobytes = 10;
5386
5387 // Swap in kilobytes consumed by the process after compaction.
5388 optional int64 after_swap_kilobytes = 11;
5389
5390 // The time taken to perform compaction in milliseconds.
5391 optional int64 time_to_compact_millis = 12;
5392
5393 // The last compaction action performed for this app.
5394 optional Action last_action = 13;
5395
Ben Murdoch01720b82018-12-19 18:03:44 +00005396 // The last time that compaction was attempted on this process in milliseconds
5397 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5398 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00005399
Ben Murdoch885c21b2019-03-15 18:02:04 +00005400 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005401 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00005402
5403 // The process state at the time of compaction.
5404 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005405
5406 // Free ZRAM in kilobytes before compaction.
5407 optional int64 before_zram_free_kilobytes = 17;
5408
5409 // Free ZRAM in kilobytes after compaction.
5410 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00005411}
lifr157fc552018-12-12 16:38:04 +08005412
5413/**
lifrb6b90b62019-03-29 00:40:17 +08005414 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5415 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5416 *
lifr1f74b052019-04-16 22:16:30 +08005417 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5418 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5419 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5420 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005421 */
5422message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08005423 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005424
lifr1f74b052019-04-16 22:16:30 +08005425 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005426
5427 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005428 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005429
lifr1f74b052019-04-16 22:16:30 +08005430 // Only valid for event_type = EVENT_GETADDRINFO.
5431 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005432
lifr1f74b052019-04-16 22:16:30 +08005433 // Flags passed to android_res_nsend() defined in multinetwork.h
5434 // Only valid for event_type = EVENT_RESNSEND.
5435 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005436
lifrad9becc2019-05-20 11:04:41 +08005437 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005438
5439 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08005440 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005441
5442 // Additional pass-through fields opaque to statsd.
5443 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08005444 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08005445
5446 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
5447 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08005448}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005449
5450/**
5451 * Logs when a data stall event occurs.
5452 *
5453 * Log from:
5454 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5455 */
5456message DataStallEvent {
5457 // Data stall evaluation type.
5458 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5459 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5460 optional int32 evaluation_type = 1;
5461 // See definition in data_stall_event.proto.
5462 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5463 // See definition in data_stall_event.proto.
5464 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5465 // See definition in data_stall_event.proto.
5466 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5467 // See definition in data_stall_event.proto.
5468 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5469 // See definition in data_stall_event.proto.
5470 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5471}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005472
5473/*
5474 * Logs when RescueParty resets some set of experiment flags.
5475 *
5476 * Logged from:
5477 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5478 */
5479message RescuePartyResetReported {
5480 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5481 optional int32 rescue_level = 1;
5482}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005483
5484/**
5485 * Logs when signed config is received from an APK, and if that config was applied successfully.
5486 * Logged from:
5487 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5488 */
5489message SignedConfigReported {
5490 enum Type {
5491 UNKNOWN_TYPE = 0;
5492 GLOBAL_SETTINGS = 1;
5493 }
5494 optional Type type = 1;
5495
5496 // The final status of the signed config received.
5497 enum Status {
5498 UNKNOWN_STATUS = 0;
5499 APPLIED = 1;
5500 BASE64_FAILURE_CONFIG = 2;
5501 BASE64_FAILURE_SIGNATURE = 3;
5502 SECURITY_EXCEPTION = 4;
5503 INVALID_CONFIG = 5;
5504 OLD_CONFIG = 6;
5505 SIGNATURE_CHECK_FAILED = 7;
5506 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005507 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005508 }
5509 optional Status status = 2;
5510
5511 // The version of the signed config processed.
5512 optional int32 version = 3;
5513
5514 // The package name that the config was extracted from.
5515 optional string from_package = 4;
5516
5517 enum Key {
5518 NO_KEY = 0;
5519 DEBUG = 1;
5520 PRODUCTION = 2;
5521 }
5522 // Which key was used to verify the config.
5523 optional Key verified_with = 5;
5524}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005525
5526/*
5527 * Logs GNSS Network-Initiated (NI) location events.
5528 *
5529 * Logged from:
5530 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5531 */
5532message GnssNiEventReported {
5533 // The type of GnssNiEvent.
5534 enum EventType {
5535 UNKNOWN = 0;
5536 NI_REQUEST = 1;
5537 NI_RESPONSE = 2;
5538 }
5539 optional EventType event_type = 1;
5540
5541 // An ID generated by HAL to associate NI notifications and UI responses.
5542 optional int32 notification_id = 2;
5543
5544 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005545 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005546
5547 // NI requires notification.
5548 optional bool need_notify = 4;
5549
5550 // NI requires verification.
5551 optional bool need_verify = 5;
5552
5553 // NI requires privacy override, no notification/minimal trace.
5554 optional bool privacy_override = 6;
5555
5556 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5557 // seconds.
5558 optional int32 timeout = 7;
5559
5560 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005561 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005562
5563 // String representing the requester of the network inititated location request.
5564 optional string requestor_id = 9;
5565
5566 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5567 // network initiated location request.
5568 optional string text = 10;
5569
5570 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005571 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005572
5573 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005574 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005575
5576 // True if SUPL ES is enabled.
5577 optional bool is_supl_es_enabled = 13;
5578
5579 // True if GNSS location is enabled.
5580 optional bool is_location_enabled = 14;
5581
5582 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005583 optional android.server.location.GnssUserResponseType user_response = 15;
5584}
5585
5586/**
5587 * Logs GNSS non-framework (NFW) location notification.
5588 *
5589 * Logged from:
5590 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5591 */
5592message GnssNfwNotificationReported {
5593 // Package name of the Android proxy application representing the non-framework entity that
5594 // requested location. Set to empty string if unknown.
5595 optional string proxy_app_package_name = 1;
5596
5597 // Protocol stack that initiated the non-framework location request.
5598 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5599
5600 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5601 // set to empty string. This field is opaque to the framework and used for logging purposes.
5602 optional string other_protocol_stack_name = 3;
5603
5604 // Source initiating/receiving the location information.
5605 optional android.server.location.NfwRequestor requestor = 4;
5606
5607 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5608 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5609 // and used for logging purposes.
5610 optional string requestor_id = 5;
5611
5612 // Indicates whether location information was provided for this request.
5613 optional android.server.location.NfwResponseType response_type = 6;
5614
5615 // True if the device is in user initiated emergency session.
5616 optional bool in_emergency_mode = 7;
5617
5618 // True if cached location is provided.
5619 optional bool is_cached_location = 8;
5620
5621 // True if proxy app permission mismatch between framework and GNSS HAL.
5622 optional bool is_permission_mismatched = 9;
5623}
5624
5625/**
5626 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5627 *
5628 * Logged from:
5629 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5630 */
5631message GnssConfigurationReported {
5632 // SUPL host name.
5633 optional string supl_host = 1;
5634
5635 // SUPL port number.
5636 optional int32 supl_port = 2;
5637
5638 // C2K host name.
5639 optional string c2k_host = 3;
5640
5641 // C2K port number.
5642 optional int32 c2k_port = 4;
5643
5644 // The SUPL version requested by Carrier.
5645 optional int32 supl_ver = 5;
5646
5647 // The SUPL mode.
5648 optional android.server.location.SuplMode supl_mode = 6;
5649
5650 // True if NI emergency SUPL restrictions is enabled.
5651 optional bool supl_es = 7;
5652
5653 // LTE Positioning Profile settings
5654 optional android.server.location.LppProfile lpp_profile = 8;
5655
5656 // Positioning protocol on A-Glonass system.
5657 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5658
5659 // True if emergency PDN is used. Otherwise, regular PDN is used.
5660 optional bool use_emergency_pdn_for_emergency_supl= 10;
5661
5662 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5663 optional android.server.location.GpsLock gps_lock = 11;
5664
5665 // Number of seconds to extend the emergency session duration post emergency call.
5666 optional int32 es_extension_sec = 12;
5667
5668 // The full list of package names of proxy Android applications representing the non-framework
5669 // location access entities (on/off the device) for which the framework user has granted
5670 // non-framework location access permission. The package names are concatenated in one string
5671 // with spaces as separators.
5672 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005673}
Jack Yu95b64f32018-12-13 18:26:11 +08005674
5675/**
5676 * Logs when a NFC device's error occurred.
5677 * Logged from:
5678 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5679 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5680 */
5681message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005682 enum Type {
5683 UNKNOWN = 0;
5684 CMD_TIMEOUT = 1;
5685 ERROR_NOTIFICATION = 2;
5686 AID_OVERFLOW = 3;
5687 }
5688 optional Type type = 1;
5689 // If it's nci cmd timeout, log the timeout command.
5690 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005691
Alex Salod7c3eef2019-01-25 14:43:27 -08005692 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005693}
5694
5695/**
5696 * Logs when a NFC device's state changed event
5697 * Logged from:
5698 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5699 */
5700message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005701 enum State {
5702 UNKNOWN = 0;
5703 OFF = 1;
5704 ON = 2;
5705 ON_LOCKED = 3; // Secure Nfc enabled.
5706 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5707 }
5708 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005709}
5710
5711/**
5712 * Logs when a NFC Beam Transaction occurred.
5713 * Logged from:
5714 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5715 */
5716message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005717 enum Operation {
5718 UNKNOWN = 0;
5719 SEND = 1;
5720 RECEIVE = 2;
5721 }
5722 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005723}
5724
5725/**
5726 * Logs when a NFC Card Emulation Transaction occurred.
5727 * Logged from:
5728 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5729 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5730 */
5731message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005732 enum Category {
5733 UNKNOWN = 0;
5734 HCE_PAYMENT = 1;
5735 HCE_OTHER = 2;
5736 OFFHOST = 3;
5737 }
5738 // Transaction belongs to HCE payment or HCE other category, or offhost.
5739 optional Category category = 1;
5740 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5741 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005742}
5743
5744/**
5745 * Logs when a NFC Tag event occurred.
5746 * Logged from:
5747 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5748 */
5749message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005750 enum Type {
5751 UNKNOWN = 0;
5752 URL = 1;
5753 BT_PAIRING = 2;
5754 PROVISION = 3;
5755 WIFI_CONNECT = 4;
5756 APP_LAUNCH = 5;
5757 OTHERS = 6;
5758 }
5759 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005760}
5761
5762/**
5763 * Logs when Hce transaction triggered
5764 * Logged from:
5765 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5766 */
5767message NfcHceTransactionOccurred {
5768 // The latency period(in microseconds) it took for the first HCE data
5769 // exchange.
5770 optional uint32 latency_micros = 1;
5771}
5772
5773/**
5774 * Logs when SecureElement state event changed
5775 * Logged from:
5776 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5777 */
5778message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005779 enum State {
5780 UNKNOWN = 0;
5781 INITIALIZED = 1;
5782 DISCONNECTED = 2;
5783 CONNECTED = 3;
5784 HALCRASH = 4;
5785 }
5786 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005787
Alex Salod7c3eef2019-01-25 14:43:27 -08005788 optional string state_change_reason = 2;
5789 // SIMx or eSEx.
5790 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005791}
5792
5793/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005794 * Information about a permission grant request
5795 */
5796message PermissionGrantRequestResultReported {
5797 // unique value identifying an API call. A API call might result in multiple of these atoms
5798 optional int64 request_id = 1;
5799
5800 // UID of package requesting the permission grant
5801 optional int32 requesting_uid = 2 [(is_uid) = true];
5802
5803 // Name of package requesting the permission grant
5804 optional string requesting_package_name = 3;
5805
5806 // The permission to be granted
5807 optional string permission_name = 4;
5808
5809 // If the permission was explicitly requested via the API or added by the system
5810 optional bool is_implicit = 5;
5811
5812 enum Result {
5813 UNDEFINED = 0;
5814 // permission request was ignored
5815 IGNORED = 1;
5816 // permission request was ignored because it was user fixed
5817 IGNORED_USER_FIXED = 2;
5818 // permission request was ignored because it was policy fixed
5819 IGNORED_POLICY_FIXED = 3;
5820 // permission was granted by user action
5821 USER_GRANTED = 4;
5822 // permission was automatically granted
5823 AUTO_GRANTED = 5;
5824 // permission was denied by user action
5825 USER_DENIED = 6;
5826 // permission was denied with prejudice by the user
5827 USER_DENIED_WITH_PREJUDICE = 7;
5828 // permission was automatically denied
5829 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07005830 // permission request was ignored because permission is restricted
5831 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01005832 // one time permission was granted by user action
5833 USER_GRANTED_ONE_TIME = 10;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005834 }
5835 // The result of the permission grant
5836 optional Result result = 6;
5837}
5838
5839/**
Jack Yu95b64f32018-12-13 18:26:11 +08005840 * Logs when Omapi API used
5841 * Logged from:
5842 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5843 */
5844message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005845 enum Operation {
5846 UNKNOWN = 0;
5847 OPEN_CHANNEL = 1;
5848 }
5849 optional Operation operation = 1;
5850 // SIMx or eSEx.
5851 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005852
Alex Salod7c3eef2019-01-25 14:43:27 -08005853 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005854}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005855
5856/**
Alex Saloa060aee2019-01-21 14:36:41 -08005857 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5858 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005859 * Logged from:
5860 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5861 */
5862message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005863 optional int64 dispatch_latency_millis = 1;
5864}
5865
5866/**
5867 * Logs AttentionManagerService attention check result.
5868 *
5869 * Logged from:
5870 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5871 */
5872message AttentionManagerServiceResultReported {
5873 // See core/java/android/service/attention/AttentionService.java
5874 enum AttentionCheckResult {
5875 UNKNOWN = 20;
5876 ATTENTION_SUCCESS_ABSENT = 0;
5877 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07005878 ATTENTION_FAILURE_UNKNOWN = 2;
5879 ATTENTION_FAILURE_CANCELLED = 3;
5880 ATTENTION_FAILURE_PREEMPTED = 4;
5881 ATTENTION_FAILURE_TIMED_OUT = 5;
5882 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08005883 }
5884 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005885}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005886
5887/**
5888 * Logs when an adb connection changes state.
5889 *
5890 * Logged from:
5891 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5892 */
5893message AdbConnectionChanged {
5894 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5895 // previously selected for this system.
5896 optional int64 last_connection_time_millis = 1;
5897
5898 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5899 // to reconnect via adb without user interaction.
5900 optional int64 auth_window_millis = 2;
5901
5902 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5903 optional android.debug.AdbConnectionStateEnum state = 3;
5904
5905 // True if the 'always allow' option was selected for this system.
5906 optional bool always_allow = 4;
5907}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005908
5909/*
5910 * Logs the reported speech DSP status.
5911 *
5912 * Logged from:
5913 * Vendor audio implementation.
5914 */
5915message SpeechDspStatReported {
5916 // The total Speech DSP uptime in milliseconds.
5917 optional int32 total_uptime_millis = 1;
5918 // The total Speech DSP downtime in milliseconds.
5919 optional int32 total_downtime_millis = 2;
5920 optional int32 total_crash_count = 3;
5921 optional int32 total_recover_count = 4;
5922}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005923
5924/**
5925 * Logs USB connector contaminant status.
5926 *
5927 * Logged from: USB Service.
5928 */
5929message UsbContaminantReported {
5930 optional string id = 1;
5931 optional android.service.usb.ContaminantPresenceStatus status = 2;
5932}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005933
5934/**
5935 * This atom is for debugging purpose.
5936 */
5937message DebugElapsedClock {
5938 // Monotically increasing value for each pull.
5939 optional int64 pull_count = 1;
5940 // Time from System.elapsedRealtime.
5941 optional int64 elapsed_clock_millis = 2;
5942 // Time from System.elapsedRealtime.
5943 optional int64 same_elapsed_clock_millis = 3;
5944 // Diff between current elapsed time and elapsed time from previous pull.
5945 optional int64 elapsed_clock_diff_millis = 4;
5946
5947 enum Type {
5948 TYPE_UNKNOWN = 0;
5949 ALWAYS_PRESENT = 1;
5950 PRESENT_ON_ODD_PULLS = 2;
5951 }
5952 // Type of behavior for the pulled data.
5953 optional Type type = 5;
5954}
5955
5956/**
5957 * This atom is for debugging purpose.
5958 */
5959message DebugFailingElapsedClock {
5960 // Monotically increasing value for each pull.
5961 optional int64 pull_count = 1;
5962 // Time from System.elapsedRealtime.
5963 optional int64 elapsed_clock_millis = 2;
5964 // Time from System.elapsedRealtime.
5965 optional int64 same_elapsed_clock_millis = 3;
5966 // Diff between current elapsed time and elapsed time from previous pull.
5967 optional int64 elapsed_clock_diff_millis = 4;
5968}
Steven Wuacef6bb2019-01-23 14:21:17 -05005969
5970/** Logs System UI bubbles event changed.
5971 *
5972 * Logged from:
5973 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5974 */
5975message BubbleUIChanged {
5976
5977 // The app package that is posting the bubble.
5978 optional string package_name = 1;
5979
5980 // The notification channel that is posting the bubble.
5981 optional string notification_channel = 2;
5982
5983 // The notification id associated with the posted bubble.
5984 optional int32 notification_id = 3;
5985
5986 // The position of the bubble within the bubble stack.
5987 optional int32 position = 4;
5988
5989 // The total number of bubbles within the bubble stack.
5990 optional int32 total_number = 5;
5991
5992 // User interactions with the bubble.
5993 enum Action {
5994 UNKNOWN = 0;
5995 POSTED = 1;
5996 UPDATED = 2;
5997 EXPANDED = 3;
5998 COLLAPSED = 4;
5999 DISMISSED = 5;
6000 STACK_DISMISSED = 6;
6001 STACK_MOVED = 7;
6002 HEADER_GO_TO_APP = 8;
6003 HEADER_GO_TO_SETTINGS = 9;
6004 PERMISSION_OPT_IN = 10;
6005 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006006 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006007 SWIPE_LEFT = 13;
6008 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006009 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04006010 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006011 }
6012 optional Action action = 6;
6013
6014 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6015 optional float normalized_x_position = 7;
6016 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006017
6018 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6019 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006020
6021 // Whether the bubble is an on-going one.
6022 optional bool is_ongoing = 10;
6023
6024 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006025 // This is deprecated and the value should be ignored.
6026 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006027}
Kweku Adams8845d012018-12-11 20:06:45 -08006028
6029/**
Steven Wu552f63f2019-02-05 13:41:36 -05006030 * Logs System UI bubbles developer errors.
6031 *
6032 * Logged from:
6033 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6034 */
6035message BubbleDeveloperErrorReported {
6036
6037 // The app package that is posting the bubble.
6038 optional string package_name = 1;
6039
6040 // Bubble developer error type enums.
6041 enum Error {
6042 UNKNOWN = 0;
6043 ACTIVITY_INFO_MISSING = 1;
6044 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6045 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6046 }
6047 optional Error error = 2 [default = UNKNOWN];
6048}
6049
6050/**
Kweku Adams8845d012018-12-11 20:06:45 -08006051 * Logs that a constraint for a scheduled job has changed.
6052 *
6053 * Logged from:
6054 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6055 */
6056message ScheduledJobConstraintChanged {
6057 repeated AttributionNode attribution_node = 1;
6058
6059 // Name of the job.
6060 optional string job_name = 2;
6061
6062 optional com.android.server.job.ConstraintEnum constraint = 3;
6063
6064 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006065 UNKNOWN = 0;
6066 UNSATISFIED = 1;
6067 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006068 }
6069 optional State state = 4;
6070}
Alex Salod7c3eef2019-01-25 14:43:27 -08006071
6072/**
6073 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6074 * returns true.
6075 *
6076 * Logged from:
6077 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6078 */
6079message ScreenTimeoutExtensionReported {
6080 // Describes how many times in a row did the power manager reset the screen off timeout.
6081 optional uint32 consecutive_timeout_extended_count = 1;
6082}
Hui Yu885aca12019-01-10 17:11:34 -08006083
6084/*
6085* Logs number of milliseconds it takes to start a process.
6086* The definition of app process start time is from the app launch time to
6087* the time that Zygote finished forking the app process and loaded the
6088* application package's java classes.
6089
6090* This metric is different from AppStartOccurred which is for foreground
6091* activity only.
6092
6093* ProcessStartTime can report all processes (both foreground and background)
6094* start time.
6095*
6096* Logged from:
6097* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6098*/
6099message ProcessStartTime {
6100 // The uid of the ProcessRecord.
6101 optional int32 uid = 1 [(is_uid) = true];
6102
6103 // The process pid.
6104 optional int32 pid = 2;
6105
6106 // The process name.
6107 // Usually package name, "system" for system server.
6108 // Provided by ActivityManagerService.
6109 optional string process_name = 3;
6110
6111 enum StartType {
6112 UNKNOWN = 0;
6113 WARM = 1;
6114 HOT = 2;
6115 COLD = 3;
6116 }
6117
6118 // The start type.
6119 optional StartType type = 4;
6120
6121 // The elapsed realtime at the start of the process.
6122 optional int64 process_start_time_millis = 5;
6123
6124 // Number of milliseconds it takes to reach bind application.
6125 optional int32 bind_application_delay_millis = 6;
6126
6127 // Number of milliseconds it takes to finish start of the process.
6128 optional int32 process_start_delay_millis = 7;
6129
6130 // hostingType field in ProcessRecord, the component type such as "activity",
6131 // "service", "content provider", "broadcast" or other strings.
6132 optional string hosting_type = 8;
6133
6134 // hostingNameStr field in ProcessRecord. The component class name that runs
6135 // in this process.
6136 optional string hosting_name = 9;
6137}
6138
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006139/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006140 * Track Media Codec usage
6141 * Logged from:
6142 * frameworks/av/media/libstagefright/MediaCodec.cpp
6143 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6144 */
6145message MediametricsCodecReported {
6146 optional int64 timestamp_nanos = 1;
6147 optional string package_name = 2;
6148 optional int64 package_version_code = 3;
6149 optional int64 media_apex_version = 4;
6150
6151 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6152}
6153
6154/**
6155 * Track Media Extractor (pulling video/audio streams out of containers) usage
6156 * Logged from:
6157 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6158 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6159 */
6160message MediametricsExtractorReported {
6161 optional int64 timestamp_nanos = 1;
6162 optional string package_name = 2;
6163 optional int64 package_version_code = 3;
6164 optional int64 media_apex_version = 4;
6165
6166 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6167}
6168
6169/**
6170 * Track how we arbitrate between microphone/input requests.
6171 * Logged from
6172 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6173 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6174 */
6175message MediametricsAudiopolicyReported {
6176 optional int64 timestamp_nanos = 1;
6177 optional string package_name = 2;
6178 optional int64 package_version_code = 3;
6179 optional int64 media_apex_version = 4;
6180
6181 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6182}
6183
6184/**
6185 * Track how we arbitrate between microphone requests.
6186 * Logged from
6187 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6188 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6189 */
6190message MediametricsAudiorecordReported {
6191 optional int64 timestamp_nanos = 1;
6192 optional string package_name = 2;
6193 optional int64 package_version_code = 3;
6194 optional int64 media_apex_version = 4;
6195
6196 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6197}
6198
6199/**
6200 * Track how we arbitrate between microphone/input requests.
6201 * Logged from
6202 * frameworks/av/media/libnblog/ReportPerformance.cpp
6203 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6204 */
6205message MediametricsAudiothreadReported {
6206 optional int64 timestamp_nanos = 1;
6207 optional string package_name = 2;
6208 optional int64 package_version_code = 3;
6209 optional int64 media_apex_version = 4;
6210
6211 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6212}
6213
6214/**
6215 * Track how we arbitrate between microphone/input requests.
6216 * Logged from
6217 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6218 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6219 */
6220message MediametricsAudiotrackReported {
6221 optional int64 timestamp_nanos = 1;
6222 optional string package_name = 2;
6223 optional int64 package_version_code = 3;
6224 optional int64 media_apex_version = 4;
6225
6226 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6227}
6228
6229/**
6230 * Track information about DRM framework performance
6231 * Logged from
6232 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6233 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6234 */
6235message MediametricsMediadrmReported {
6236 optional int64 timestamp_nanos = 1;
6237 optional string package_name = 2;
6238 optional int64 package_version_code = 3;
6239 optional int64 media_apex_version = 4;
6240
6241 // vendor+description tell about which DRM plugin is in use on this device
6242 optional string vendor = 5;
6243 optional string description = 6;
6244 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6245 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6246}
6247
6248/**
6249 * Track information about the widevine DRM plugin performance
6250 * Logged from
6251 * vendor/widevine/libwvdrmengine/cdm/metrics
6252 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6253 */
6254message MediametricsDrmWidevineReported {
6255 optional int64 timestamp_nanos = 1;
6256 optional string package_name = 2;
6257 optional int64 package_version_code = 3;
6258 optional int64 media_apex_version = 4;
6259
6260 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6261}
6262
6263/**
6264 * Track information about recordings (e.g. camcorder)
6265 * Logged from
6266 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6267 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6268 */
6269message MediametricsRecorderReported {
6270 optional int64 timestamp_nanos = 1;
6271 optional string package_name = 2;
6272 optional int64 package_version_code = 3;
6273 optional int64 media_apex_version = 4;
6274
6275 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6276}
6277
6278/**
6279 * Track Media Player usage
6280 * Logged from:
6281 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6282 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6283 */
6284message MediametricsNuPlayerReported {
6285 optional int64 timestamp_nanos = 1;
6286 optional string package_name = 2;
6287 optional int64 package_version_code = 3;
6288 optional int64 media_apex_version = 4;
6289
6290 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6291}
6292
6293/**
Robert Shiha4beed32019-08-19 14:15:23 -07006294 * Track Legacy DRM usage
6295 * Logged from
6296 * frameworks/av/drm/drmserver/DrmManager.cpp
6297 */
6298message MediametricsDrmManagerReported {
6299 optional int64 timestamp_nanos = 1;
6300 optional string package_name = 2;
6301 optional int64 package_version_code = 3;
6302 optional int64 media_apex_version = 4;
6303
6304 enum Method {
6305 METHOD_NOT_FOUND = -1;
6306 GET_CONSTRAINTS = 0;
6307 GET_METADATA = 1;
6308 CAN_HANDLE = 2;
6309 PROCESS_DRM_INFO = 3;
6310 ACQUIRE_DRM_INFO = 4;
6311 SAVE_RIGHTS = 5;
6312 GET_ORIGINAL_MIME_TYPE = 6;
6313 GET_DRM_OBJECT_TYPE = 7;
6314 CHECK_RIGHTS_STATUS = 8;
6315 REMOVE_RIGHTS = 9;
6316 REMOVE_ALL_RIGHTS = 10;
6317 OPEN_CONVERT_SESSION = 11;
6318 OPEN_DECRYPT_SESSION = 12;
6319 }
6320
6321 // plugin_id+description inform which Legacy DRM plugins are still in use on device
6322 optional string plugin_id = 5;
6323 optional string description = 6;
6324 optional Method method = 7;
6325 optional string mime_types = 8;
6326}
6327
6328/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006329 * State of a dangerous permission requested by a package
6330 */
6331message DangerousPermissionState {
6332 // Name of the permission
6333 optional string permission_name = 1;
6334
6335 // Uid of the package
6336 optional int32 uid = 2 [(is_uid) = true];
6337
6338 // Package requesting the permission
6339 optional string package_name = 3;
6340
6341 // If the permission is granted to the uid
6342 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01006343
6344 // Permission flags as per android.content.pm.PermissionFlags
6345 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006346}
6347
Michael Groover4a0ca942019-01-24 17:41:25 -08006348/**
6349 * Logs when a package is denied access to a device identifier based on the new access requirements.
6350 *
6351 * Logged from:
6352 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6353 */
6354message DeviceIdentifierAccessDenied {
6355 // The name of the package denied access to the requested device identifier.
6356 optional string package_name = 1;
6357
6358 // The name of the device identifier method the package attempted to invoke.
6359 optional string method_name = 2;
6360
6361 // True if the package is preinstalled.
6362 optional bool is_preinstalled = 3;
6363
6364 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08006365 // Starting from Android 11, this boolean is not set and will always be false.
6366 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08006367}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006368
6369/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006370 * Pulls the ongoing mainline install train version code.
6371 * Pulled from StatsCompanionService
6372 */
6373message TrainInfo {
6374 optional int64 train_version_code = 1;
6375
6376 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006377
6378 optional string train_name = 3;
6379
6380 enum Status {
6381 UNKNOWN = 0;
6382 INSTALL_REQUESTED = 1;
6383 INSTALL_STARTED = 2;
6384 INSTALL_STAGED_NOT_READY = 3;
6385 INSTALL_STAGED_READY = 4;
6386 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006387 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6388 // and INSTALL_FAILURE_COMMIT.
6389 INSTALL_FAILURE = 6 [deprecated = true];
6390 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006391 INSTALL_CANCELLED = 7;
6392 INSTALLER_ROLLBACK_REQUESTED = 8;
6393 INSTALLER_ROLLBACK_INITIATED = 9;
6394 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6395 INSTALLER_ROLLBACK_STAGED = 11;
6396 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6397 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6398 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6399 INSTALLER_ROLLBACK_SUCCESS = 15;
6400 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006401 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6402 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6403 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6404 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6405 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6406 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006407 INSTALL_FAILURE_DOWNLOAD = 23;
6408 INSTALL_FAILURE_STATE_MISMATCH = 24;
6409 INSTALL_FAILURE_COMMIT = 25;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006410 }
6411 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006412}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006413
6414/**
6415 * Logs the gesture stage changed event.
6416 *
6417 * Logged from:
6418 * frameworks/base/packages/SystemUI/
6419 */
6420message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006421 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006422}
6423
6424/**
6425 * Logs the feedback type.
6426 *
6427 * Logged from:
6428 * frameworks/base/packages/SystemUI/
6429 */
6430message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006431 // Whether or not the gesture was used.
6432 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006433}
6434
6435/**
6436 * Logs the progress.
6437 *
6438 * Logged from:
6439 * frameworks/base/packages/SystemUI/
6440 */
6441message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006442 // [0,100] progress for the assist gesture.
6443 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006444}
Neil Fullerdb14b482019-02-05 19:44:44 +00006445
6446/*
6447 * Information about the time zone data on a device.
6448 */
6449message TimeZoneDataInfo {
6450 // A version identifier for the data set on device. e.g. "2018i"
6451 optional string tzdb_version = 1;
6452}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006453
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006454/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006455 * Logs the GPU stats global health information.
6456 *
6457 * Logged from:
6458 * frameworks/native/services/gpuservice/gpustats/
6459 */
6460message GpuStatsGlobalInfo {
6461 // Package name of the gpu driver.
6462 optional string driver_package_name = 1;
6463
6464 // Version name of the gpu driver.
6465 optional string driver_version_name = 2;
6466
6467 // Version code of the gpu driver.
6468 optional int64 driver_version_code = 3;
6469
6470 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
6471 optional int64 driver_build_time = 4;
6472
6473 // Total count of the gl driver gets loaded.
6474 optional int64 gl_loading_count = 5;
6475
6476 // Total count of the gl driver fails to be loaded.
6477 optional int64 gl_loading_failure_count = 6;
6478
6479 // Total count of the Vulkan driver gets loaded.
6480 optional int64 vk_loading_count = 7;
6481
6482 // Total count of the Vulkan driver fails to be loaded.
6483 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07006484
6485 // Api version of the system Vulkan driver.
6486 optional int32 vulkan_version = 9;
6487
6488 // Api version of the system CPU Vulkan driver.
6489 optional int32 cpu_vulkan_version = 10;
6490
6491 // Api version of the system GLES driver.
6492 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006493
6494 // Total count of the angle driver gets loaded.
6495 optional int64 angle_loading_count = 12;
6496
6497 // Total count of the angle driver fails to be loaded.
6498 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006499}
6500
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006501/**
6502 * GPU driver loading time info.
6503 */
6504message GpuDriverLoadingTime {
6505 // List of all the driver loading times for this app. The list size is
6506 // capped at 50.
6507 repeated int64 driver_loading_time = 1;
6508}
6509
6510/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006511 * Logs the GPU stats per app health information.
6512 *
6513 * Logged from:
6514 * frameworks/native/services/gpuservice/gpustats/
6515 */
6516message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006517 // Package name of the application that loads the gpu driver. Total number
6518 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006519 optional string app_package_name = 1;
6520
6521 // Version code of the gpu driver this app loads.
6522 optional int64 driver_version_code = 2;
6523
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006524 // gl driver loading time info.
6525 optional GpuDriverLoadingTime gl_driver_loading_time = 3
6526 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006527
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006528 // Vulkan driver loading time info.
6529 optional GpuDriverLoadingTime vk_driver_loading_time = 4
6530 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006531
6532 // Angle driver loading time info.
6533 optional GpuDriverLoadingTime angle_driver_loading_time = 5
6534 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07006535
6536 // CPU Vulkan implementation is in use.
6537 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07006538
6539 // App is not doing pre-rotation correctly.
6540 optional bool false_prerotation = 7;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006541}
Rafal Slawikd4e87572019-03-12 13:08:38 +00006542
6543/*
6544 * Logs the size of the system ion heap.
6545 *
6546 * Pulled from StatsCompanionService.
6547 */
6548message SystemIonHeapSize {
6549 // Size of the system ion heap in bytes.
6550 optional int64 size_in_bytes = 1;
6551}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006552
Rafal Slawik77987ed2019-06-17 12:28:23 +01006553/*
6554 * Logs the per-process size of the system ion heap.
6555 *
6556 * Pulled from StatsCompanionService.
6557 */
6558message ProcessSystemIonHeapSize {
6559 // The uid if available. -1 means not available.
6560 optional int32 uid = 1 [(is_uid) = true];
6561
6562 // The process name (from /proc/PID/cmdline).
6563 optional string process_name = 2;
6564
6565 // Sum of sizes of all allocations.
6566 optional int32 total_size_in_kilobytes = 3;
6567
6568 // Number of allocations.
6569 optional int32 allocation_count = 4;
6570
6571 // Size of the largest allocation.
6572 optional int32 max_size_in_kilobytes = 5;
6573}
6574
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006575/**
6576 * Push network stack events.
6577 *
6578 * Log from:
6579 * frameworks/base/packages/NetworkStack/
6580 */
6581message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08006582 // The id that indicates the event reported from NetworkStack.
6583 optional int32 event_id = 1;
6584 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006585 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
6586}
Carmen Agimofa769c152019-03-04 14:39:14 +00006587
6588/**
6589 * Logs the apps that are installed on the external storage.
6590 * Pulled from:
6591 * StatsCompanionService
6592 */
6593message AppsOnExternalStorageInfo {
6594 // The type of the external storage.
6595 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
6596 // The name of the package that is installed on the external storage.
6597 optional string package_name = 2;
6598}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07006599
6600/**
6601 * Logs the settings related to Face.
6602 * Logged from:
6603 * frameworks/base/services/core/java/com/android/server/stats
6604 */
6605message FaceSettings {
6606 // Whether or not face unlock is allowed on Keyguard.
6607 optional bool unlock_keyguard_enabled = 1;
6608 // Whether or not face unlock dismisses the Keyguard.
6609 optional bool unlock_dismisses_keyguard = 2;
6610 // Whether or not face unlock requires attention.
6611 optional bool unlock_attention_required = 3;
6612 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
6613 optional bool unlock_app_enabled = 4;
6614 // Whether or not face unlock always requires user confirmation.
6615 optional bool unlock_always_require_confirmation = 5;
6616 // Whether or not a diverse set of poses are required during enrollment.
6617 optional bool unlock_diversity_required = 6;
6618}
Maggie White442b6312019-04-05 16:26:44 -07006619
6620/**
6621 * Logs cooling devices maintained by the kernel.
6622 *
6623 * Pulled from StatsCompanionService.java
6624 */
6625message CoolingDevice {
6626 // The type of cooling device being reported. Eg. CPU, GPU...
6627 optional android.os.CoolingTypeEnum device_location = 1;
6628 // The name of the cooling device source. Eg. CPU0
6629 optional string device_name = 2;
6630 // Current throttle state of the cooling device. The value can any unsigned
6631 // integer between 0 and max_state defined in its driver. 0 means device is
6632 // not in throttling, higher value means deeper throttling.
6633 optional int32 state = 3;
6634}
Ben Blount763a5d52019-04-10 11:48:58 -07006635
6636/**
6637 * Intelligence has several counter-type events that don't warrant a
6638 * full separate atom. These are primarily API call counters but also include
6639 * counters for feature usage and specific failure modes.
6640 *
6641 * Logged from the Intelligence mainline module.
6642 */
6643message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07006644 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07006645 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07006646 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07006647 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07006648 // How many times the event occured (to report a batch of high frequency events).
6649 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07006650 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07006651 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07006652}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07006653
6654/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07006655 * Logs when Car Power state changed.
6656 *
6657 * Logged from:
6658 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6659 */
6660message CarPowerStateChanged {
6661 // States come from CpmsState in CarPowerManagementService.java.
6662 enum State {
6663 WAIT_FOR_VHAL = 0;
6664 ON = 1;
6665 SHUTDOWN_PREPARE = 2;
6666 WAIT_FOR_FINISH = 3;
6667 SUSPEND = 4;
6668 SIMULATE_SLEEP = 5;
6669 }
6670 optional State state = 1;
6671}
6672
6673/**
6674 * Logs whether GarageMode is entered.
6675 *
6676 * Logged from:
6677 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6678 */
6679message GarageModeInfo {
6680 // Whether GarageMode is entered.
6681 optional bool is_garage_mode = 1;
6682}
Martijn Coenencd95d462019-04-25 17:09:45 +02006683
6684/**
6685 * Historical app ops data per package.
6686 */
6687message AppOps {
6688 // Uid of the package requesting the op
6689 optional int32 uid = 1 [(is_uid) = true];
6690
6691 // Nmae of the package performing the op
6692 optional string package_name = 2;
6693
6694 // operation id; maps to the OP_* constants in AppOpsManager.java
6695 optional int32 op_id = 3;
6696
6697 // The number of times the op was granted while the app was in the
6698 // foreground (only for trusted requests)
6699 optional int64 trusted_foreground_granted_count = 4;
6700
6701 // The number of times the op was granted while the app was in the
6702 // background (only for trusted requests)
6703 optional int64 trusted_background_granted_count = 5;
6704
6705 // The number of times the op was rejected while the app was in the
6706 // foreground (only for trusted requests)
6707 optional int64 trusted_foreground_rejected_count = 6;
6708
6709 // The number of times the op was rejected while the app was in the
6710 // background (only for trusted requests)
6711 optional int64 trusted_background_rejected_count = 7;
6712
6713 // For long-running operations, total duration of the operation
6714 // while the app was in the foreground (only for trusted requests)
6715 optional int64 trusted_foreground_duration_millis = 8;
6716
6717 // For long-running operations, total duration of the operation
6718 // while the app was in the background (only for trusted requests)
6719 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00006720
6721 // Whether AppOps is guarded by Runtime permission
6722 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02006723}
Hongyi Zhang700137e2019-05-23 21:19:36 -07006724
6725/**
6726 * Location Manager API Usage information(e.g. API under usage,
6727 * API call's parameters).
6728 * Logged from:
6729 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
6730 */
6731message LocationManagerApiUsageReported {
6732
6733 // Indicating if usage starts or usage ends.
6734 optional android.stats.location.UsageState state = 1;
6735
6736 // LocationManagerService's API in use.
6737 // We can identify which API from LocationManager is
6738 // invoking current LMS API by the combination of
6739 // API parameter(e.g. is_listener_null, is_intent_null,
6740 // is_location_request_null)
6741 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
6742
6743 // Name of the package calling the API.
6744 optional string calling_package_name = 3;
6745
6746 // Type of the location provider.
6747 optional android.stats.location.ProviderType provider = 4;
6748
6749 // Quality of the location request
6750 optional android.stats.location.LocationRequestQuality quality = 5;
6751
6752 // The desired interval for active location updates, in milliseconds.
6753 // Bucketized to reduce cardinality.
6754 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
6755
6756 // Minimum distance between location updates, in meters.
6757 // Bucketized to reduce cardinality.
6758 optional android.stats.location.SmallestDisplacementBucket
6759 bucketized_smallest_displacement = 7;
6760
6761 // The number of location updates.
6762 optional int64 num_updates = 8;
6763
6764 // The request expiration time, in millisecond since boot.
6765 // Bucketized to reduce cardinality.
6766 optional android.stats.location.ExpirationBucket
6767 bucketized_expire_in = 9;
6768
6769 // Type of Callback passed in for this API.
6770 optional android.stats.location.CallbackType callback_type = 10;
6771
6772 // The radius of the central point of the alert
6773 // region, in meters. Only for API REQUEST_GEOFENCE.
6774 // Bucketized to reduce cardinality.
6775 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
6776
6777 // Activity Importance of API caller.
6778 // Categorized to 3 types that are interesting from location's perspective.
6779 optional android.stats.location.ActivityImportance activiy_importance = 12;
6780}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01006781
6782/**
6783 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
6784 */
6785message ReviewPermissionsFragmentResultReported {
6786 // unique value identifying a permission group change. A permission group change might result
6787 // in multiple of these atoms
6788 optional int64 change_id = 1;
6789
6790 // UID of package the permission belongs to
6791 optional int32 uid = 2 [(is_uid) = true];
6792
6793 // Name of package the permission belongs to
6794 optional string package_name = 3;
6795
6796 // The permission to be granted
6797 optional string permission_name = 4;
6798
6799 // The result of the permission grant
6800 optional bool permission_granted = 5;
6801}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01006802
6803/**
6804* Information about results of permission upgrade by RuntimePermissionsUpgradeController
6805* Logged from: RuntimePermissionUpdgradeController
6806*/
6807message RuntimePermissionsUpgradeResult {
6808 // Permission granted as result of upgrade
6809 optional string permission_name = 1;
6810
6811 // UID of package granted permission
6812 optional int32 uid = 2 [(is_uid) = true];
6813
6814 // Name of package granted permission
6815 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01006816}
6817
6818/**
6819* Information about a buttons presented in GrantPermissionsActivty and choice made by user
6820*/
6821message GrantPermissionsActivityButtonActions {
6822 // Permission granted as result of upgrade
6823 optional string permission_group_name = 1;
6824
6825 // UID of package granted permission
6826 optional int32 uid = 2 [(is_uid) = true];
6827
6828 // Name of package requesting permission
6829 optional string package_name = 3;
6830
6831 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
6832 // LABEL_ constants in GrantPermissionActivity.java
6833 optional int32 buttons_presented = 4;
6834
6835 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
6836 optional int32 button_clicked = 5;
6837}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01006838
6839/**
6840 * Information about LocationAccessCheck notification presented to user
6841 */
6842message LocationAccessCheckNotificationAction {
6843
6844 // id which identifies single session of user interacting with permission controller
6845 optional int64 session_id = 1;
6846
6847 // Uid of package for which location access check is presented
6848 optional int32 package_uid = 2;
6849
6850 // Name of package for which location access check is presented
6851 optional string package_name = 3;
6852
6853 enum Result {
6854 UNDEFINED = 0;
6855 // notification was presented to the user
6856 NOTIFICATION_PRESENTED = 1;
6857 // notification was declined by the user
6858 NOTIFICATION_DECLINED = 2;
6859 // notification was clicked by the user
6860 NOTIFICATION_CLICKED = 3;
6861 }
6862
6863 // View / interaction recorded
6864 optional Result result = 4;
6865}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01006866
6867/**
6868 * Information about a permission grant or revoke made by user inside AppPermissionFragment
6869 */
6870message AppPermissionFragmentActionReported {
6871 // id which identifies single session of user interacting with permission controller
6872 optional int64 session_id = 1;
6873
6874 // unique value identifying a permission group change. A permission group change might result
6875 // in multiple of these atoms
6876 optional int64 change_id = 2;
6877
6878 // UID of package the permission belongs to
6879 optional int32 uid = 3 [(is_uid) = true];
6880
6881 // Name of package the permission belongs to
6882 optional string package_name = 4;
6883
6884 // The permission to be granted
6885 optional string permission_name = 5;
6886
6887 // The result of the permission grant
6888 optional bool permission_granted = 6;
6889}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01006890
6891/**
6892* Information about a AppPermissionFragment viewed by user
6893*/
6894message AppPermissionFragmentViewed {
6895 // id which identifies single session of user interacting with permission controller
6896 optional int64 session_id = 1;
6897
6898 // UID of package for which permissions are viewed
6899 optional int32 uid = 2 [(is_uid) = true];
6900
6901 // Name of package for which permissions are viewed
6902 optional string package_name = 3;
6903
6904 // Permission group viewed
6905 optional string permission_group_name = 4;
6906}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01006907
6908/**
6909* Information about a AppPermissionsFragment viewed by user
6910*/
6911message AppPermissionsFragmentViewed {
6912 // id which identifies single session of user interacting with permission controller
6913 optional int64 session_id = 1;
6914
6915 // id which identifies single view as every view might have several logging records
6916 // with different package information attached
6917 optional int64 view_id = 2;
6918
6919 // Permission group viewed
6920 optional string permission_group_name = 3;
6921
6922 // UID of package for which permissions are viewed
6923 optional int32 uid = 4 [(is_uid) = true];
6924
6925 // Name of package for which permissions are viewed
6926 optional string package_name = 5;
6927
6928 // Category in which permission is included
6929 enum Category {
6930 UNDEFINED = 0;
6931 ALLOWED = 1;
6932 ALLOWED_FOREGROUND = 2;
6933 DENIED = 3;
6934 }
6935 optional Category category = 6;
6936}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01006937
6938/**
6939* Information about a PermissionAppsFragment viewed by user.
6940* Logged from ui/handheld/PermissionAppsFragment.java
6941*/
6942message PermissionAppsFragmentViewed {
6943 // id which identifies single session of user interacting with permission controller
6944 optional int64 session_id = 1;
6945
6946 // id which identifies single view as every view might have several logging records
6947 // with different package information attached
6948 optional int64 view_id = 2;
6949
6950 // Permission group viewed
6951 optional string permission_group_name = 3;
6952
6953 // UID of package for which permissions are viewed
6954 optional int32 uid = 4 [(is_uid) = true];
6955
6956 // Name of package for which permissions are viewed
6957 optional string package_name = 5;
6958
6959 // Category in which app is included
6960 enum Category {
6961 UNDEFINED = 0;
6962 ALLOWED = 1;
6963 ALLOWED_FOREGROUND = 2;
6964 DENIED = 3;
6965 }
6966 optional Category category = 6;
6967}
Tony Make2b1b672019-07-29 16:59:47 +01006968
6969/**
6970 * Logs when there is a smart selection related event.
6971 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
6972 * Logged from: TextClassifierEventLogger.java
6973 */
6974message TextSelectionEvent {
6975 // A session ID.
6976 optional string session_id = 1;
6977
6978 // Event type of this event.
6979 optional android.stats.textclassifier.EventType event_type = 2;
6980
6981 // Name of the model that is involved in this event.
6982 optional string model_name = 3;
6983
6984 // Type of widget that was involved in triggering this event.
6985 optional android.stats.textclassifier.WidgetType widget_type = 4;
6986
6987 // Index of this event in a session.
6988 optional int32 event_index = 5;
6989
6990 // Entity type that is involved.
6991 optional string entity_type = 6;
6992
6993 // Relative word index of the start of the selection.
6994 optional int32 relative_word_start_index = 7;
6995
6996 // Relative word (exclusive) index of the end of the selection.
6997 optional int32 relative_word_end_index = 8;
6998
6999 // Relative word index of the start of the smart selection.
7000 optional int32 relative_suggested_word_start_index = 9;
7001
7002 // Relative word (exclusive) index of the end of the smart selection.
7003 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007004
7005 // Name of source package.
7006 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007007}
7008
7009/**
7010 * Logs when there is a smart linkify related event.
7011 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7012 * Logged from: TextClassifierEventLogger.java
7013 */
7014message TextLinkifyEvent {
7015 // A session ID.
7016 optional string session_id = 1;
7017
7018 // Event type of this event.
7019 optional android.stats.textclassifier.EventType event_type = 2;
7020
7021 // Name of the model that is involved in this event.
7022 optional string model_name = 3;
7023
7024 // Type of widget that was involved in triggering this event.
7025 optional android.stats.textclassifier.WidgetType widget_type = 4;
7026
7027 // Index of this event in a session.
7028 optional int32 event_index = 5;
7029
7030 // Entity type that is involved.
7031 optional string entity_type = 6;
7032
7033 // Number of links detected.
7034 optional int32 num_links = 7;
7035
7036 // The total length of all links.
7037 optional int32 linked_text_length = 8;
7038
7039 // Length of input text.
7040 optional int32 text_length = 9;
7041
7042 // Time spent on generating links in ms.
7043 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007044
7045 // Name of source package.
7046 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007047}
7048
7049/**
7050 * Logs when there is a conversation actions related event.
7051 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7052 * Logged from: TextClassifierEventLogger.java
7053 */
7054message ConversationActionsEvent {
7055 // A session ID.
7056 optional string session_id = 1;
7057
7058 // Event type of this event.
7059 optional android.stats.textclassifier.EventType event_type = 2;
7060
7061 // Name of the model that is involved in this event.
7062 optional string model_name = 3;
7063
7064 // Type of widget that was involved in triggering this event.
7065 optional android.stats.textclassifier.WidgetType widget_type = 4;
7066
7067 // The first entity type that is involved.
7068 optional string first_entity_type = 5;
7069
7070 // The second entity type that is involved.
7071 optional string second_entity_type = 6;
7072
7073 // The third entity type that is involved.
7074 optional string third_entity_type = 7;
7075
7076 // The score of the first entity type.
7077 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01007078
7079 // Name of source package.
7080 optional string package_name = 9;
Tony Make2b1b672019-07-29 16:59:47 +01007081}
7082
7083/**
7084 * Logs when there is a language detection related event.
7085 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7086 * Logged from: TextClassifierEventLogger.java
7087 */
7088message LanguageDetectionEvent {
7089 // A session ID.
7090 optional string session_id = 1;
7091
7092 // Event type of this event.
7093 optional android.stats.textclassifier.EventType event_type = 2;
7094
7095 // Name of the model that is involved in this event.
7096 optional string model_name = 3;
7097
7098 // Type of widget that was involved in triggering this event.
7099 optional android.stats.textclassifier.WidgetType widget_type = 4;
7100
7101 // Detected language.
7102 optional string language_tag = 5;
7103
7104 // Score of the detected language.
7105 optional float score = 6;
7106
7107 // Position of this action.
7108 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01007109
7110 // Name of source package.
7111 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01007112}
Tianjie Xu167c3db2019-07-22 14:25:14 -07007113
7114/**
7115 * Information about an OTA update attempt by update_engine.
7116 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7117 */
7118message UpdateEngineUpdateAttemptReported {
7119 // The number of attempts for the update engine to apply a given payload.
7120 optional int32 attempt_number = 1;
7121
7122 optional android.stats.otaupdate.PayloadType payload_type = 2;
7123
7124 // The total time in minutes for the update engine to apply a given payload.
7125 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
7126 // it's increased when the system is sleeping.
7127 optional int32 duration_boottime_in_minutes = 3;
7128
7129 // The total time in minutes for the update engine to apply a given payload.
7130 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
7131 // and it's not increased when the system is sleeping.
7132 optional int32 duration_monotonic_in_minutes = 4;
7133
7134 // The size of the payload in MiBs.
7135 optional int32 payload_size_mib = 5;
7136
7137 // The attempt result reported by the update engine for an OTA update.
7138 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
7139
7140 // The error code reported by the update engine after an OTA update attempt
7141 // on A/B devices.
7142 optional android.stats.otaupdate.ErrorCode error_code = 7;
7143
7144 // The build fingerprint of the source system. The value is read from a
7145 // system property when the device takes the update. e.g.
7146 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
7147 optional string source_fingerprint = 8;
7148}
7149
7150/**
7151 * Information about all the attempts the device make before finishing the
7152 * successful update.
7153 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7154 */
7155message UpdateEngineSuccessfulUpdateReported {
7156 // The number of attempts for the update engine to apply the payload for a
7157 // successful update.
7158 optional int32 attempt_count = 1;
7159
7160 optional android.stats.otaupdate.PayloadType payload_type = 2;
7161
7162 optional int32 payload_size_mib = 3;
7163
7164 // The total number of bytes downloaded by update_engine since the last
7165 // successful update.
7166 optional int32 total_bytes_downloaded_mib = 4;
7167
7168 // The ratio in percentage of the over-downloaded bytes compared to the
7169 // total bytes needed to successfully install the update. e.g. 200 if we
7170 // download 200MiB in total for a 100MiB package.
7171 optional int32 download_overhead_percentage = 5;
7172
7173 // The total time in minutes for the update engine to apply the payload for a
7174 // successful update.
7175 optional int32 total_duration_minutes = 6;
7176
7177 // The number of reboot of the device during a successful update.
7178 optional int32 reboot_count = 7;
7179}
Alec Mourie088e762019-07-02 13:10:55 -07007180
7181/**
7182 * Global display pipeline metrics reported by SurfaceFlinger.
7183 * Pulled from:
7184 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7185 */
7186message SurfaceflingerStatsGlobalInfo {
7187 // Total number of frames presented during the tracing period
7188 optional int64 total_frames = 1;
7189 // Total number of frames missed
7190 optional int64 missed_frames = 2;
7191 // Total number of frames that fell back to client composition
7192 optional int64 client_composition_frames = 3;
7193 // Total time the display was turned on
7194 optional int64 display_on_millis = 4;
7195 // Total time that was spent performing animations.
7196 // This is derived from the present-to-present layer histogram
7197 optional int64 animation_millis = 5;
7198}
7199
7200/**
7201 * Per-layer display pipeline metrics reported by SurfaceFlinger.
7202 * The number of layers uploaded will be restricted due to size limitations.
7203 * Pulled from:
7204 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7205 */
7206message SurfaceflingerStatsLayerInfo {
7207 // The layer for this set of metrics
7208 // For now we can infer that the package name is included in the layer
7209 // name.
7210 optional string layer_name = 1;
7211 // Total number of frames presented
7212 optional int64 total_frames = 2;
7213 // Total number of dropped frames while latching a buffer for this layer.
7214 optional int64 dropped_frames = 3;
7215 // Set of timings measured between successive presentation timestamps.
7216 optional FrameTimingHistogram present_to_present = 4
7217 [(android.os.statsd.log_mode) = MODE_BYTES];
7218 // Set of timings measured from when an app queued a buffer for
7219 // presentation, until the buffer was actually presented to the
7220 // display.
7221 optional FrameTimingHistogram post_to_present = 5
7222 [(android.os.statsd.log_mode) = MODE_BYTES];
7223 // Set of timings measured from when a buffer is ready to be presented,
7224 // until the buffer was actually presented to the display.
7225 optional FrameTimingHistogram acquire_to_present = 6
7226 [(android.os.statsd.log_mode) = MODE_BYTES];
7227 // Set of timings measured from when a buffer was latched by
7228 // SurfaceFlinger, until the buffer was presented to the display
7229 optional FrameTimingHistogram latch_to_present = 7
7230 [(android.os.statsd.log_mode) = MODE_BYTES];
7231 // Set of timings measured from the desired presentation to the actual
7232 // presentation time
7233 optional FrameTimingHistogram desired_to_present = 8
7234 [(android.os.statsd.log_mode) = MODE_BYTES];
7235 // Set of timings measured from when an app queued a buffer for
7236 // presentation, until the buffer was ready to be presented.
7237 optional FrameTimingHistogram post_to_acquire = 9
7238 [(android.os.statsd.log_mode) = MODE_BYTES];
7239}
7240
7241/**
7242 * Histogram of frame counts bucketed by time in milliseconds.
7243 * Because of size limitations, we hard-cap the number of buckets, with
7244 * buckets for corresponding to larger milliseconds being less precise.
7245 */
7246message FrameTimingHistogram {
7247 // Timings in milliseconds that describes a set of histogram buckets
7248 repeated int32 time_millis_buckets = 1;
7249 // Number of frames that match to each time_millis, i.e. the bucket
7250 // contents
7251 // It's required that len(time_millis) == len(frame_count)
7252 repeated int64 frame_counts = 2;
7253}
Emilian Peev6729f372019-08-29 09:14:09 -07007254
Emilian Peev6729f372019-08-29 09:14:09 -07007255/**
7256 * Information about camera facing and API level usage.
7257 * Logged from:
7258 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
7259 */
7260message CameraActionEvent {
7261 // Camera session duration
7262 optional int64 duration = 1;
7263
7264 // Camera API level used
7265 optional int32 api_level = 2;
7266
7267 // Name of client package
7268 optional string package_name = 3;
7269
7270 // Camera facing
7271 enum Facing {
7272 UNKNOWN = 0;
7273 BACK = 1;
7274 FRONT = 2;
7275 EXTERNAL = 3;
7276 }
7277 optional Facing facing = 4;
7278}
atrost01a20932019-08-28 15:40:37 +01007279
7280/**
7281 * Logs when a compatibility change is affecting an app.
7282 *
7283 * Logged from:
7284 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
7285 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
7286 */
7287message AppCompatibilityChangeReported {
7288 // The UID of the app being affected by the compatibilty change.
7289 optional int32 uid = 1 [(is_uid) = true];
7290
7291 // The ID of the change affecting the app.
7292 optional int64 change_id = 2;
7293
7294 enum State {
7295 UNKNOWN_STATE = 0;
7296 ENABLED = 1;
7297 DISABLED = 2;
7298 LOGGED = 3;
7299 }
7300
7301 // The state of the change - if logged from gating whether it was enabled or disabled, or just
7302 // logged otherwise.
7303 optional State state = 3;
7304
7305 enum Source {
7306 UNKNOWN_SOURCE = 0;
7307 APP_PROCESS = 1;
7308 SYSTEM_SERVER = 2;
7309 }
7310
7311 // Where it was logged from.
7312 optional Source source = 4;
7313
7314}
Hector Dearman40579f62019-11-01 13:19:30 +00007315
7316/**
7317 * Logged from
7318 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
7319 */
7320message PerfettoUploaded {
7321 enum Event {
7322 PERFETTO_UNDEFINED = 0;
7323 PERFETTO_TRACE_BEGIN = 1;
7324 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
7325 PERFETTO_ON_CONNECT = 3;
7326 PERFETTO_ON_TRACING_DISABLED = 4;
7327 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
7328 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
7329 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
7330 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
7331 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
7332 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
7333 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
7334 PERFETTO_TRIGGER_BEGIN = 12;
7335 PERFETTO_TRIGGER_SUCCESS = 13;
7336 PERFETTO_TRIGGER_FAILURE = 14;
7337 PERFETTO_HIT_GUARDRAILS = 15;
7338 PERFETTO_ON_TIMEOUT = 16;
7339 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
7340 }
7341
7342 // Which stage of the pipeline we are reporting from.
7343 optional Event event = 1;
7344
7345 // UUID matching the one set inside the SystemInfo trace packet.
7346 optional int64 trace_uuid_lsb = 2;
7347 optional int64 trace_uuid_msb = 3;
7348}
Mark Tabrya824a642019-11-05 12:26:12 -08007349
7350/**
7351 * Pulls client metrics on data transferred via Vehicle Maps Service.
7352 * Metrics are keyed by uid + layer.
7353 *
7354 * Pulled from:
7355 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
7356 */
7357message VmsClientStats {
7358 // UID of the VMS client app
7359 optional int32 uid = 1 [(is_uid) = true];
7360
7361 // VMS layer definition
7362 optional int32 layer_type = 2;
7363 optional int32 layer_channel = 3;
7364 optional int32 layer_version = 4;
7365
7366 // Bytes and packets sent by the client for the layer
7367 optional int64 tx_bytes = 5;
7368 optional int64 tx_packets = 6;
7369
7370 // Bytes and packets received by the client for the layer
7371 optional int64 rx_bytes = 7;
7372 optional int64 rx_packets = 8;
7373
7374 // Bytes and packets dropped due to client error
7375 optional int64 dropped_bytes = 9;
7376 optional int64 dropped_packets = 10;
7377}