blob: d78de75a60bdc0040a3ff8a7256bac8c4693a32d [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 Murdochbab399f2018-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;
Yao Chend54f9dd2017-10-17 17:37:48 +0000343 }
David Chenc8a43242017-10-17 16:23:28 -0700344
David Chen6e3e6cb2018-01-03 16:14:06 -0800345 // Pulled events will start at field 10000.
Rafal Slawik7efcefb2019-09-20 11:16:20 +0100346 // Next: 10065
David Chenc8a43242017-10-17 16:23:28 -0700347 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800348 WifiBytesTransfer wifi_bytes_transfer = 10000;
349 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
350 MobileBytesTransfer mobile_bytes_transfer = 10002;
351 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800352 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800353 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800354 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800355 CpuTimePerFreq cpu_time_per_freq = 10008;
356 CpuTimePerUid cpu_time_per_uid = 10009;
357 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800358 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800359 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800360 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800361 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800362 SystemElapsedRealtime system_elapsed_realtime = 10014;
363 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800364 CpuActiveTime cpu_active_time = 10016;
365 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000366 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800367 RemainingBatteryCapacity remaining_battery_capacity = 10019;
368 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800369 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100370 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100371 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100372 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000373 DiskStats disk_stats = 10025;
374 DirectoryUsage directory_usage = 10026;
375 AppSize app_size = 10027;
376 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700377 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700378 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800379 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700380 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700381 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800382 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700383 ProcessCpuTime process_cpu_time = 10035;
Misha Wagner5a51e002018-10-03 15:04:09 +0100384 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700385 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800386 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
387 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
388 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000389 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800390 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800391 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800392 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000393 DebugElapsedClock debug_elapsed_clock = 10046;
394 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800395 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800396 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800397 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800398 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000399 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000400 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800401 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
402 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000403 SystemIonHeapSize system_ion_heap_size = 10056;
Carmen Agimofa769c152019-03-04 14:39:14 +0000404 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700405 FaceSettings face_settings = 10058;
Maggie White442b6312019-04-05 16:26:44 -0700406 CoolingDevice cooling_device = 10059;
Martijn Coenencd95d462019-04-25 17:09:45 +0200407 AppOps app_ops = 10060;
Rafal Slawik77987ed2019-06-17 12:28:23 +0100408 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061;
Alec Mourie088e762019-07-02 13:10:55 -0700409 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
410 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Rafal Slawik7efcefb2019-09-20 11:16:20 +0100411 ProcessMemorySnapshot process_memory_snapshot = 10064;
Mark Tabrya824a642019-11-05 12:26:12 -0800412 VmsClientStats vms_client_stats = 10065;
David Chenc8a43242017-10-17 16:23:28 -0700413 }
yroa1fe77c2018-02-26 14:22:54 -0800414
Bookatz76aafcf2018-09-17 16:17:10 -0700415 // DO NOT USE field numbers above 100,000 in AOSP.
416 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
417 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100418
419 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700420}
421
Yao Chend54f9dd2017-10-17 17:37:48 +0000422/**
Yangster-mac20877162017-12-22 17:19:39 -0800423 * This proto represents a node of an attribution chain.
424 * Note: All attribution chains are represented as a repeated field of type
425 * AttributionNode. It is understood that in such arrays, the order is that
426 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000427 */
Yangster-mac20877162017-12-22 17:19:39 -0800428message AttributionNode {
429 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800430 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800431
Yangster-mac20877162017-12-22 17:19:39 -0800432 // The (optional) string tag for an element in the attribution chain. If the
433 // element has no tag, it is encoded as an empty string.
434 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700435}
436
Yangster-mac48b3d622018-08-18 12:38:11 -0700437message KeyValuePair {
438 optional int32 key = 1;
439 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700440 int32 value_int = 2;
441 int64 value_long = 3;
442 string value_str = 4;
443 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700444 }
445}
446
447message KeyValuePairsAtom {
448 optional int32 uid = 1;
449 repeated KeyValuePair pairs = 2;
450}
451
Yao Chend54f9dd2017-10-17 17:37:48 +0000452/*
453 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800454 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000455 *
456 * RULES:
457 * - The field ids for each atom must start at 1, and count upwards by 1.
458 * Skipping field ids is not allowed.
459 * - These form an API, so renaming, renumbering or removing fields is
460 * not allowed between android releases. (This is not currently enforced,
461 * but there will be a tool to enforce this restriction).
462 * - The types must be built-in protocol buffer types, namely, no sub-messages
463 * are allowed (yet). The bytes type is also not allowed.
464 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800465 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000466 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800467 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000468 * - A field that is a uid should be a string field, tagged with the [xxx]
469 * annotation. The generated code on android will be represented by UIDs,
470 * and those UIDs will be translated in xxx to those strings.
471 *
472 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700473 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000474 * - If there is a UID, it goes first. Think in an object-oriented fashion.
475 * *****************************************************************************
476 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700477
Yao Chend54f9dd2017-10-17 17:37:48 +0000478/**
Tej Singha72344992019-04-17 18:55:08 -0700479 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700480 * Logs when the Thermal service HAL notifies the throttling start/stop events.
481 *
482 * Logged from:
483 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
484 */
485message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700486 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700487 optional android.os.TemperatureTypeEnum sensor_type = 1;
488
Maggie White442b6312019-04-05 16:26:44 -0700489 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700490 enum State {
491 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700492 START = 1; // START indicated that throttling was triggered.
493 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700494 }
Yangster-mace16189a2018-08-26 12:20:16 -0700495 optional State state = 2;
496
497 optional float temperature = 3;
498}
499
500/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000501 * Logs when the screen state changes.
502 *
503 * Logged from:
504 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
505 */
506message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800507 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700508 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700509}
Yao Chend54f9dd2017-10-17 17:37:48 +0000510
511/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700512 * Logs that the process state of the uid, as determined by ActivityManager
513 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000514 *
515 * Logged from:
516 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
517 */
Bookatzc1a050a2017-10-10 15:49:28 -0700518message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700519 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000520
Bookatzdb026a22018-01-10 19:01:56 -0800521 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700522 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000523}
524
525/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700526 * Logs process state change of a process, as per the activity manager.
527 *
528 * Logged from:
529 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
530 */
531message ProcessStateChanged {
532 optional int32 uid = 1;
533 optional string process_name = 2;
534 optional string package_name = 3;
535 // TODO: remove this when validation is done
536 optional int64 version = 5;
537 // The state, from frameworks/base/core/proto/android/app/enums.proto.
538 optional android.app.ProcessStateEnum state = 4;
539}
540
541/**
542 * Logs when ActivityManagerService sleep state is changed.
543 *
544 * Logged from:
545 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
546 */
547message ActivityManagerSleepStateChanged {
548 // TODO: import frameworks proto
549 enum State {
550 UNKNOWN = 0;
551 ASLEEP = 1;
552 AWAKE = 2;
553 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700554 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700555}
556
557/**
558 * Logs when system memory state changes.
559 *
560 * Logged from:
561 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
562 */
563message MemoryFactorStateChanged {
564 // TODO: import frameworks proto
565 enum State {
566 MEMORY_UNKNOWN = 0;
567 NORMAL = 1; // normal.
568 MODERATE = 2; // moderate memory pressure.
569 LOW = 3; // low memory.
570 CRITICAL = 4; // critical memory.
571
572 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700573 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700574}
575
576/**
577 * Logs when app is using too much cpu, according to ActivityManagerService.
578 *
579 * Logged from:
580 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
581 */
582message ExcessiveCpuUsageReported {
583 optional int32 uid = 1;
584 optional string process_name = 2;
585 optional string package_name = 3;
586 // package version. TODO: remove this when validation is done
587 optional int64 version = 4;
588}
589
590/**
591 * Logs when a cached process is killed, along with its pss.
592 *
593 * Logged from:
594 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
595 */
596message CachedKillReported {
597 optional int32 uid = 1;
598 optional string process_name = 2;
599 optional string package_name = 3;
600 // TODO: remove this when validation is done
601 optional int64 version = 5;
602 optional int64 pss = 4;
603}
604
605/**
606 * Logs when memory stats of a process is reported.
607 *
608 * Logged from:
609 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
610 */
611message ProcessMemoryStatReported {
612 optional int32 uid = 1;
613 optional string process_name = 2;
614 optional string package_name = 3;
615 //TODO: remove this when validation is done
616 optional int64 version = 9;
617 optional int64 pss = 4;
618 optional int64 uss = 5;
619 optional int64 rss = 6;
620 enum Type {
621 ADD_PSS_INTERNAL_SINGLE = 0;
622 ADD_PSS_INTERNAL_ALL_MEM = 1;
623 ADD_PSS_INTERNAL_ALL_POLL = 2;
624 ADD_PSS_EXTERNAL = 3;
625 ADD_PSS_EXTERNAL_SLOW = 4;
626 }
627 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800628 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700629}
630
631/**
Bookatzc1a050a2017-10-10 15:49:28 -0700632 * Logs that a process started, finished, crashed, or ANRed.
633 *
634 * Logged from:
635 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
636 */
637message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700638 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700639
David Chen0b5c90c2018-01-25 16:51:49 -0800640 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800641 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700642
Bookatzddccf0a2017-11-28 16:48:14 -0800643 // What lifecycle state the process changed to.
644 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800645 enum State {
646 FINISHED = 0;
647 STARTED = 1;
648 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800649 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800650 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700651}
652
Bookatzc1a050a2017-10-10 15:49:28 -0700653/**
654 * Logs when the ble scan state changes.
655 *
656 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700657 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700658 */
659message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800660 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700661
662 enum State {
663 OFF = 0;
664 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700665 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
666 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700667 }
668 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700669
Bookatze5ec0b42018-03-26 13:34:56 -0700670 // Does the scan have a filter.
671 optional bool is_filtered = 3;
672 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
673 optional bool is_first_match = 4;
674 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
675 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700676}
677
678/**
679 * Logs reporting of a ble scan finding results.
680 *
681 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700682 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700683 */
Bookatzae6738e2018-09-13 11:38:56 -0700684// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700685message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800686 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700687
688 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800689 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700690}
691
692/**
693 * Logs when a sensor state changes.
694 *
695 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700696 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700697 */
698message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800699 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700700
Bookatzc1a050a2017-10-10 15:49:28 -0700701 // The id (int) of the sensor.
702 optional int32 sensor_id = 2;
703
704 enum State {
705 OFF = 0;
706 ON = 1;
707 }
708 optional State state = 3;
709}
710
Bookatzc1a050a2017-10-10 15:49:28 -0700711/**
712 * Logs when GPS state changes.
713 *
714 * Logged from:
715 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
716 */
717message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800718 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700719
720 enum State {
721 OFF = 0;
722 ON = 1;
723 }
724 optional State state = 2;
725}
726
Bookatz48d362e2018-11-06 15:49:08 -0800727/**
728 * Logs when GPS signal quality.
729 *
730 * Logged from:
731 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
732 */
733message GpsSignalQualityChanged {
734 optional android.server.location.GpsSignalQualityEnum level = 1;
735}
736
Bookatzc1a050a2017-10-10 15:49:28 -0700737
738/**
739 * Logs when a sync manager sync state changes.
740 *
741 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700742 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700743 */
744message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800745 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700746
David Chen0b5c90c2018-01-25 16:51:49 -0800747 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800748 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700749
750 enum State {
751 OFF = 0;
752 ON = 1;
753 }
754 optional State state = 3;
755}
756
Yangster-mac96353002018-09-05 11:18:55 -0700757/*
758 * Deferred job stats.
759 *
760 * Logged from:
761 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
762*/
763message DeferredJobStatsReported {
764 repeated AttributionNode attribution_node = 1;
765
766 // Number of jobs deferred.
767 optional int32 num_jobs_deferred = 2;
768
769 // Time since the last job runs.
770 optional int64 time_since_last_job_millis = 3;
771}
772
Bookatzc1a050a2017-10-10 15:49:28 -0700773/**
774 * Logs when a job scheduler job state changes.
775 *
776 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700777 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700778 */
779message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800780 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700781
782 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800783 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700784
785 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800786 FINISHED = 0;
787 STARTED = 1;
788 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700789 }
790 optional State state = 3;
791
Tej Singh33a412b2018-03-16 18:43:59 -0700792 // The reason a job has stopped.
793 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700794 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700795 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100796
797 // The standby bucket of the app that scheduled the job. These match the framework constants
798 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
799 // already assigned 0.
800 enum Bucket {
801 UNKNOWN = -1;
802 ACTIVE = 0;
803 WORKING_SET = 1;
804 FREQUENT = 2;
805 RARE = 3;
806 NEVER = 4;
807 }
808 optional Bucket standby_bucket = 5 [default = UNKNOWN];
809
810 // The job id (as assigned by the app).
811 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700812}
813
814/**
815 * Logs when the audio state changes.
816 *
817 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700818 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700819 */
820message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800821 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700822
823 enum State {
824 OFF = 0;
825 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700826 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
827 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700828 }
829 optional State state = 2;
830}
831
832/**
833 * Logs when the video codec state changes.
834 *
835 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700836 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700837 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800838message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800839 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700840
841 enum State {
842 OFF = 0;
843 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700844 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
845 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700846 }
847 optional State state = 2;
848}
849
850/**
851 * Logs when the flashlight state changes.
852 *
853 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700854 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700855 */
856message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800857 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700858
859 enum State {
860 OFF = 0;
861 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700862 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
863 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700864 }
865 optional State state = 2;
866}
867
868/**
869 * Logs when the camera state changes.
870 *
871 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700872 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700873 */
874message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800875 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700876
877 enum State {
878 OFF = 0;
879 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700880 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
881 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700882 }
883 optional State state = 2;
884}
885
886/**
887 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000888 *
889 * Logged from:
890 * TODO
891 */
Bookatzd6746242017-10-24 18:39:35 -0700892message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800893 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000894
Bookatz1a1b0462018-01-12 11:47:03 -0800895 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
896 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700897 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700898
899 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
900 optional string tag = 3;
901
902 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800903 RELEASE = 0;
904 ACQUIRE = 1;
905 CHANGE_RELEASE = 2;
906 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700907 }
908 optional State state = 4;
909}
910
911/**
Bookatzc1a050a2017-10-10 15:49:28 -0700912 * Logs when a partial wakelock is considered 'long' (over 1 min).
913 *
914 * Logged from:
915 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
916 */
917message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800918 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700919
Yao Chend54f9dd2017-10-17 17:37:48 +0000920 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
921 optional string tag = 2;
922
Bookatzc1a050a2017-10-10 15:49:28 -0700923 // TODO: I have no idea what this is.
924 optional string history_tag = 3;
925
926 enum State {
927 OFF = 0;
928 ON = 1;
929 }
930 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000931}
932
Bookatzc1a050a2017-10-10 15:49:28 -0700933/**
Bookatza66083f2018-09-20 17:24:00 -0700934 * Logs when the device is interactive, according to the PowerManager Notifier.
935 *
936 * Logged from:
937 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
938 */
939message InteractiveStateChanged {
940 enum State {
941 OFF = 0;
942 ON = 1;
943 }
944 optional State state = 1;
945}
946
947/**
Bookatzc1a050a2017-10-10 15:49:28 -0700948 * Logs Battery Saver state change.
949 *
950 * Logged from:
951 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
952 */
953message BatterySaverModeStateChanged {
954 enum State {
955 OFF = 0;
956 ON = 1;
957 }
958 optional State state = 1;
959}
960
961/**
962 * Logs Doze mode state change.
963 *
964 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800965 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700966 */
967message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800968 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800969}
970
971
972/**
973 * Logs state change of Doze mode including maintenance windows.
974 *
975 * Logged from:
976 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
977 */
978message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800979 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700980}
981
982/**
983 * Logs screen brightness level.
984 *
985 * Logged from:
986 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
987 */
988message ScreenBrightnessChanged {
989 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
990 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700991}
992
993/**
994 * Logs battery level (percent full, from 0 to 100).
995 *
996 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700997 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700998 */
999message BatteryLevelChanged {
1000 // Battery level. Should be in [0, 100].
1001 optional int32 battery_level = 1;
1002}
1003
1004/**
1005 * Logs change in charging status of the device.
1006 *
1007 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001008 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001009 */
1010message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001011 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1012 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001013}
1014
1015/**
1016 * Logs whether the device is plugged in, and what power source it is using.
1017 *
1018 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001019 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001020 */
1021message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001022 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1023 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001024}
1025
Bookatz8c6571b2017-10-24 15:04:41 -07001026/**
1027 * Logs when an app's wakeup alarm fires.
1028 *
1029 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001030 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001031 */
1032message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001033 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001034
1035 // Name of the wakeup alarm.
1036 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001037
1038 // Name of source package (for historical reasons, since BatteryStats tracked it).
1039 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001040
1041 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1042 enum Bucket {
1043 UNKNOWN = 0;
1044 EXEMPTED = 5;
1045 ACTIVE = 10;
1046 WORKING_SET = 20;
1047 FREQUENT = 30;
1048 RARE = 40;
1049 NEVER = 50;
1050 }
1051 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1052 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001053}
1054
1055/**
1056 * Logs when an an app causes the mobile radio to change state.
1057 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1058 *
1059 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001060 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001061 */
1062message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001063 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001064
Bookatz1a1b0462018-01-12 11:47:03 -08001065 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1066 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001067}
1068
1069/**
1070 * Logs when an an app causes the wifi radio to change state.
1071 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1072 *
1073 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001074 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001075 */
1076message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001077 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001078
Bookatz1a1b0462018-01-12 11:47:03 -08001079 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1080 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001081}
1082
1083/**
1084 * Logs kernel wakeup reasons and aborts.
1085 *
1086 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001087 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001088 */
1089message KernelWakeupReported {
1090 // Name of the kernel wakeup reason (or abort).
1091 optional string wakeup_reason_name = 1;
1092
1093 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001094 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001095}
1096
1097/**
Bookatzda1798c2018-12-13 14:16:00 -08001098 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001099 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001100 *
1101 * Logged from:
1102 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1103 */
1104message WifiEnabledStateChanged {
1105 enum State {
1106 OFF = 0;
1107 ON = 1;
1108 }
1109 optional State state = 1;
1110}
1111
1112/**
1113 * 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 -08001114 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1115 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001116 *
1117 * Logged from:
1118 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1119 */
1120message WifiRunningStateChanged {
1121 repeated AttributionNode attribution_node = 1;
1122
1123 enum State {
1124 OFF = 0;
1125 ON = 1;
1126 }
1127 optional State state = 2;
1128}
1129
1130/**
Bookatze5885242017-10-24 20:10:31 -07001131 * Logs wifi locks held by an app.
1132 *
1133 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001134 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001135 */
1136message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001137 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001138
1139 enum State {
1140 OFF = 0;
1141 ON = 1;
1142 }
1143 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001144
1145 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1146 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001147}
1148
1149/**
1150 * Logs wifi signal strength changes.
1151 *
1152 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001153 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001154 */
1155message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001156 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1157 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001158}
1159
1160/**
1161 * Logs wifi scans performed by an app.
1162 *
1163 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001164 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001165 */
1166message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001167 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001168
1169 enum State {
1170 OFF = 0;
1171 ON = 1;
1172 }
1173 optional State state = 2;
1174}
1175
1176/**
Tej Singh4503e102018-01-04 14:35:01 -08001177 * Logs wifi multicast locks held by an app
1178 *
1179 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001180 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001181 */
1182message WifiMulticastLockStateChanged {
1183 repeated AttributionNode attribution_node = 1;
1184
1185 enum State {
1186 OFF = 0;
1187 ON = 1;
1188 }
1189 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001190
1191 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001192}
1193
1194/**
Tej Singh1ea42892018-01-19 09:27:00 -08001195 * Logs shutdown reason and duration on next boot.
1196 *
1197 * Logged from:
1198 * frameworks/base/core/java/com/android/server/BootReceiver.java
1199 */
1200message ShutdownSequenceReported {
1201 // True if shutdown is for a reboot. Default: false if we do not know.
1202 optional bool reboot = 1;
1203
1204 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1205 optional string reason = 2;
1206
1207 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1208 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001209 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001210
1211 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001212 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001213}
1214
Tej Singh6483ea42018-01-25 17:45:49 -08001215
1216/**
1217 * Logs boot reason and duration.
1218 *
1219 * Logged from:
1220 * system/core/bootstat/bootstat.cpp
1221 */
1222message BootSequenceReported {
1223 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1224 // Default: "<EMPTY>" if not available.
1225 optional string bootloader_reason = 1;
1226
1227 // Reason for system boot. Eg. bootloader, reboot,userrequested
1228 // Default: "<EMPTY>" if not available.
1229 optional string system_reason = 2;
1230
1231 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001232 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001233
1234 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001235 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001236
1237 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001238 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001239
1240 // Time since last boot in ms. Default: 0 if not available.
1241 optional int64 time_since_last_boot = 6;
1242}
1243
Tej Singhc477d9c2018-02-05 18:31:39 -08001244
1245/**
1246 * Logs call state and disconnect cause (if applicable).
1247 *
1248 * Logged from:
1249 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1250 */
1251message CallStateChanged {
1252 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1253 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1254 optional android.telecom.CallStateEnum call_state = 1;
1255
1256 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1257 // This value is only applicable when the call_state is DISCONNECTED, and
1258 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1259 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1260 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1261
1262 // True if the call is self-managed, which are apps that use the
1263 // telecom infrastructure to make their own calls.
1264 optional bool self_managed = 3;
1265
1266 // True if call is external. External calls are calls on connected Wear
1267 // devices but show up in Telecom so the user can pull them onto the device.
1268 optional bool external_call = 4;
1269}
1270
Tej Singh1ea42892018-01-19 09:27:00 -08001271/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001272 * Logs keyguard state. The keyguard is the lock screen.
1273 *
1274 * Logged from:
1275 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1276 */
1277message KeyguardStateChanged {
1278 enum State {
1279 UNKNOWN = 0;
1280 // The keyguard is hidden when the phone is unlocked.
1281 HIDDEN = 1;
1282 // The keyguard is shown when the phone is locked (screen turns off).
1283 SHOWN= 2;
1284 // The keyguard is occluded when something is overlaying the keyguard.
1285 // Eg. Opening the camera while on the lock screen.
1286 OCCLUDED = 3;
1287 }
1288 optional State state = 1;
1289}
1290
1291/**
1292 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1293 * prompts the user to enter a password (pattern, pin, etc).
1294 *
1295 * Logged from:
1296 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1297 */
1298
1299message KeyguardBouncerStateChanged {
1300 enum State {
1301 UNKNOWN = 0;
1302 // Bouncer is hidden, either as a result of successfully entering the
1303 // password, screen timing out, or user going back to lock screen.
1304 HIDDEN = 1;
1305 // This is when the user is being prompted to enter the password.
1306 SHOWN = 2;
1307 }
1308 optional State state = 1;
1309}
1310
1311/**
1312 * Logs the result of entering a password into the keyguard bouncer.
1313 *
1314 * Logged from:
1315 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1316 */
1317message KeyguardBouncerPasswordEntered {
1318 enum BouncerResult {
1319 UNKNOWN = 0;
1320 // The password entered was incorrect.
1321 FAILURE = 1;
1322 // The password entered was correct.
1323 SUCCESS = 2;
1324 }
1325 optional BouncerResult result = 1;
1326}
1327
Tej Singha883b372018-02-15 11:30:01 -08001328/*
1329 * Logs changes to the configuration of the device. The configuration is defined
1330 * in frameworks/base/core/java/android/content/res/Configuration.java
1331 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1332 * Please go there to interpret the possible values each field can be.
1333 *
1334 * Logged from:
1335 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1336 */
1337message ResourceConfigurationChanged {
1338 // Bit mask of color capabilities of the screen.
1339 // Contains information about the color gamut and hdr mode of the screen.
1340 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001341 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001342
1343 // The target screen density being rendered to.
1344 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001345 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001346
1347 // Current user preference for the scaling factor for fonts,
1348 // relative to the base density scaling.
1349 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001350 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001351
1352 // Flag indicating whether the hard keyboard is hidden.
1353 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001354 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001355
1356 // The type of keyboard attached to the device.
1357 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1358 optional int32 keyboard = 5;
1359
1360 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1361 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001362 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001363
1364 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1365 // 0 if undefined.
1366 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1367 optional int32 mcc = 7;
1368
1369 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1370 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1371 // MNC_ZERO symbol defined in Configuration.java.
1372 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1373 optional int32 mnc = 8;
1374
1375 // The kind of navigation available on the device.
1376 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1377 optional int32 navigation = 9;
1378
1379 // Flag indicating whether the navigation is available.
1380 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001381 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001382
1383 // Overall orientation of the screen.
1384 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1385 optional int32 orientation = 11;
1386
1387 // The current height of the available screen space, in dp units.
1388 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001389 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001390
1391 // Bit mask of overall layout of the screen.
1392 // Contains information about screen size, whether the screen is wider/taller
1393 // than normal, whether the screen layout is right-tl-left or left-to-right,
1394 // and whether the screen has a rounded shape.
1395 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001396 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001397
1398 // Current width of the available screen space, in dp units.
1399 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001400 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001401
1402 // The smallest screen size an application will see in normal operation.
1403 // This is the smallest value of both screenWidthDp and screenHeightDp
1404 // in portrait and landscape.
1405 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001406 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001407
1408 // The type of touch screen attached to the device.
1409 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1410 optional int32 touchscreen = 16;
1411
1412 // Bit mask of the ui mode.
1413 // Contains information about the overall ui mode of the device.
1414 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1415 // Also contains information about whether the device is in night mode.
1416 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001417 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001418}
1419
Tej Singheee317b2018-03-07 19:28:05 -08001420
1421/**
1422 * Logs changes in the connection state of the mobile radio.
1423 *
1424 * Logged from:
1425 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1426 */
1427message MobileConnectionStateChanged {
1428 // States are from the state machine DataConnection.java.
1429 enum State {
1430 UNKNOWN = 0;
1431 // The connection is inactive, or disconnected.
1432 INACTIVE = 1;
1433 // The connection is being activated, or connecting.
1434 ACTIVATING = 2;
1435 // The connection is active, or connected.
1436 ACTIVE = 3;
1437 // The connection is disconnecting.
1438 DISCONNECTING = 4;
1439 // The connection is disconnecting after creating a connection.
1440 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1441 }
1442 optional State state = 1;
1443 // For multi-sim phones, this distinguishes between the sim cards.
1444 optional int32 sim_slot_index = 2;
1445 // Used to identify the connection. Starts at 0 and increments by 1 for
1446 // every new network created. Resets whenever the device reboots.
1447 optional int32 data_connection_id = 3;
1448 // A bitmask for the capabilities of this connection.
1449 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1450 // Default value (if we have no information): 0
1451 optional int64 capabilities = 4;
1452 // If this connection has internet.
1453 // This just checks if the DEFAULT bit of capabilities is set.
1454 optional bool has_internet = 5;
1455}
1456
1457/**
1458 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1459 *
1460 * Logged from:
1461 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1462 */
1463message MobileRadioTechnologyChanged {
1464 optional android.telephony.NetworkTypeEnum state = 1;
1465 // For multi-sim phones, this distinguishes between the sim cards.
1466 optional int32 sim_slot_index = 2;
1467}
1468
Andrew Chantb56388b2018-03-22 21:07:33 -07001469/**
1470 * Logs the VID and PID of any connected USB devices.
1471 *
1472 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1473 *
1474 * Logged by Vendor.
1475 */
1476message UsbDeviceAttached {
1477 optional int32 vid = 1;
1478 optional int32 pid = 2;
1479 optional bool has_audio = 3;
1480 optional bool has_hid = 4;
1481 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001482 enum State {
1483 STATE_DISCONNECTED = 0;
1484 STATE_CONNECTED = 1;
1485 }
1486 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001487 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001488}
1489
Tej Singheee317b2018-03-07 19:28:05 -08001490
Tej Singhdd7bd352018-02-09 19:33:15 -08001491/**
Tej Singh5d991e12018-03-09 19:48:11 -08001492 * Logs when Bluetooth is enabled and disabled.
1493 *
1494 * Logged from:
1495 * services/core/java/com/android/server/BluetoothManagerService.java
1496 */
1497message BluetoothEnabledStateChanged {
1498 repeated AttributionNode attribution_node = 1;
1499 // Whether or not bluetooth is enabled on the device.
1500 enum State {
1501 UNKNOWN = 0;
1502 ENABLED = 1;
1503 DISABLED = 2;
1504 }
1505 optional State state = 2;
1506 // The reason for being enabled/disabled.
1507 // Eg. Airplane mode, crash, application request.
1508 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1509 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001510 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001511}
1512
1513/**
Jack Hed9837c82019-01-09 01:19:13 -08001514 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001515 *
1516 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001517 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1518 *
1519 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001520 */
1521message BluetoothConnectionStateChanged {
1522 // The state of the connection.
1523 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1524 optional android.bluetooth.ConnectionStateEnum state = 1;
1525 // An identifier that can be used to match connect and disconnect events.
1526 // Currently is last two bytes of a hash of a device level ID and
1527 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001528 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001529 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001530 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1531 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001532 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001533 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001534 // An identifier that can be used to match events for this device.
1535 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1536 // Salt: Randomly generated 256 bit value
1537 // Hash algorithm: HMAC-SHA256
1538 // Size: 32 byte
1539 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001540 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001541}
1542
1543/**
1544 * Logs when a Bluetooth device connects and disconnects over ACL
1545 *
1546 * Logged from:
1547 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1548 *
1549 * Next Tag: 3
1550 */
1551message BluetoothAclConnectionStateChanged {
1552 // An identifier that can be used to match events for this device.
1553 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1554 // Salt: Randomly generated 256 bit value
1555 // Hash algorithm: HMAC-SHA256
1556 // Size: 32 byte
1557 // Default: null or empty if the device identifier is not known
1558 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1559 // The state of the connection.
1560 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1561 optional android.bluetooth.ConnectionStateEnum state = 2;
1562}
1563
1564/**
1565 * Logs when a Bluetooth device connects and disconnects over SCO
1566 *
1567 * Logged from:
1568 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1569 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1570 *
1571 * Next Tag: 4
1572 */
1573message BluetoothScoConnectionStateChanged {
1574 // An identifier that can be used to match events for this device.
1575 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1576 // Salt: Randomly generated 256 bit value
1577 // Hash algorithm: HMAC-SHA256
1578 // Size: 32 byte
1579 // Default: null or empty if the device identifier is not known
1580 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1581 // The state of the connection.
1582 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1583 optional android.bluetooth.ConnectionStateEnum state = 2;
1584 // Codec used for this SCO connection
1585 // Default: UNKNOWN
1586 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001587}
1588
Jack Hec27040a2019-01-09 20:54:41 -08001589/**
1590 * Logged when active device of a profile changes
1591 *
1592 * Logged from:
1593 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1594 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1595 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1596 */
1597message BluetoothActiveDeviceChanged {
1598 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1599 // From android.bluetooth.BluetoothProfile
1600 optional int32 bt_profile = 1;
1601 // An identifier that can be used to match events for this new active device.
1602 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1603 // Salt: Randomly generated 256 bit value
1604 // Hash algorithm: HMAC-SHA256
1605 // Size: 32 byte
1606 // Default: null or empty if there is no active device for this profile
1607 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1608}
1609
Jack Heab86dbd22018-12-18 15:43:27 -08001610// Logs when there is an event affecting Bluetooth device's link layer connection.
1611// - This event is triggered when there is a related HCI command or event
1612// - Users of this metrics can deduce Bluetooth device's connection state from these events
1613// - HCI commands are logged before the command is sent, after receiving command status, and after
1614// receiving command complete
1615// - HCI events are logged when they arrive
1616//
1617// Low level log from system/bt
1618//
1619// Bluetooth classic commands:
1620// - CMD_CREATE_CONNECTION
1621// - CMD_DISCONNECT
1622// - CMD_CREATE_CONNECTION_CANCEL
1623// - CMD_ACCEPT_CONNECTION_REQUEST
1624// - CMD_REJECT_CONNECTION_REQUEST
1625// - CMD_SETUP_ESCO_CONNECTION
1626// - CMD_ACCEPT_ESCO_CONNECTION
1627// - CMD_REJECT_ESCO_CONNECTION
1628// - CMD_ENH_SETUP_ESCO_CONNECTION
1629// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1630//
1631// Bluetooth low energy commands:
1632// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1633// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1634// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1635// - CMD_BLE_CLEAR_WHITE_LIST
1636// - CMD_BLE_ADD_WHITE_LIST
1637// - CMD_BLE_REMOVE_WHITE_LIST
1638//
1639// Bluetooth classic events:
1640// - EVT_CONNECTION_COMP
1641// - EVT_CONNECTION_REQUEST
1642// - EVT_DISCONNECTION_COMP
1643// - EVT_ESCO_CONNECTION_COMP
1644// - EVT_ESCO_CONNECTION_CHANGED
1645//
1646// Bluetooth low energy meta events:
1647// - BLE_EVT_CONN_COMPLETE_EVT
1648// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1649//
1650// Next tag: 10
1651message BluetoothLinkLayerConnectionEvent {
1652 // An identifier that can be used to match events for this device.
1653 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1654 // Salt: Randomly generated 256 bit value
1655 // Hash algorithm: HMAC-SHA256
1656 // Size: 32 byte
1657 // Default: null or empty if the device identifier is not known
1658 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1659 // Connection handle of this connection if available
1660 // Range: 0x0000 - 0x0EFF (12 bits)
1661 // Default: 0xFFFF if the handle is unknown
1662 optional int32 connection_handle = 2;
1663 // Direction of the link
1664 // Default: DIRECTION_UNKNOWN
1665 optional android.bluetooth.DirectionEnum direction = 3;
1666 // Type of this link
1667 // Default: LINK_TYPE_UNKNOWN
1668 optional android.bluetooth.LinkTypeEnum type = 4;
1669
1670 // Reason metadata for this link layer connection event, rules for interpretation:
1671 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1672 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1673 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1674 // set and valid, ignore hci_ble_event
1675
1676 // HCI command associated with this event
1677 // Default: CMD_UNKNOWN
1678 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1679 // HCI event associated with this event
1680 // Default: EVT_UNKNOWN
1681 optional android.bluetooth.hci.EventEnum hci_event = 6;
1682 // HCI BLE meta event associated with this event
1683 // Default: BLE_EVT_UNKNOWN
1684 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1685 // HCI command status code if this is triggerred by hci_cmd
1686 // Default: STATUS_UNKNOWN
1687 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1688 // HCI reason code associated with this event
1689 // Default: STATUS_UNKNOWN
1690 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1691}
1692
Howard Roe103fe22019-01-17 16:52:16 -08001693/**
1694 * Logs when a module is rolled back by Watchdog.
1695 *
1696 * Logged from: Rollback Manager
1697 */
1698message WatchdogRollbackOccurred {
1699 enum RollbackType {
1700 UNKNOWN = 0;
1701 ROLLBACK_INITIATE = 1;
1702 ROLLBACK_SUCCESS = 2;
1703 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001704 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001705 }
1706 optional RollbackType rollback_type = 1;
1707
1708 optional string package_name = 2;
1709
1710 optional int32 package_version_code = 3;
1711}
1712
Jack Hec27040a2019-01-09 20:54:41 -08001713/**
1714 * Logs when there is a change in Bluetooth A2DP playback state
1715 *
1716 * Logged from:
1717 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1718 */
1719message BluetoothA2dpPlaybackStateChanged {
1720 // An identifier that can be used to match events for this device.
1721 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1722 // Salt: Randomly generated 256 bit value
1723 // Hash algorithm: HMAC-SHA256
1724 // Size: 32 byte
1725 // Default: null or empty if the device identifier is not known
1726 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1727 // Current playback state
1728 // Default: PLAYBACK_STATE_UNKNOWN
1729 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1730 // Current audio coding mode
1731 // Default: AUDIO_CODING_MODE_UNKNOWN
1732 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1733}
1734
1735/**
1736 * Logs when there is a change in A2DP codec config for a particular remote device
1737 *
1738 * Logged from:
1739 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1740 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1741 */
1742message BluetoothA2dpCodecConfigChanged {
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 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1751 // Default SOURCE_CODEC_TYPE_INVALID
1752 optional int32 codec_type = 2;
1753 // Codec priroity, the higher the more preferred, -1 for disabled
1754 // Default: CODEC_PRIORITY_DEFAULT
1755 optional int32 codec_priority = 3;
1756 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1757 // Default: SAMPLE_RATE_NONE
1758 optional int32 sample_rate = 4;
1759 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1760 // Default: BITS_PER_SAMPLE_NONE
1761 optional int32 bits_per_sample = 5;
1762 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1763 // Default: CHANNEL_MODE_NONE
1764 optional int32 channel_mode = 6;
1765 // Codec specific values
1766 // Default 0
1767 optional int64 codec_specific_1 = 7;
1768 optional int64 codec_specific_2 = 8;
1769 optional int64 codec_specific_3 = 9;
1770 optional int64 codec_specific_4 = 10;
1771}
1772
1773/**
1774 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1775 * Each codec's capability is logged separately due to statsd restriction
1776 *
1777 * Logged from:
1778 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1779 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1780 */
1781message BluetoothA2dpCodecCapabilityChanged {
1782 // An identifier that can be used to match events for this device.
1783 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1784 // Salt: Randomly generated 256 bit value
1785 // Hash algorithm: HMAC-SHA256
1786 // Size: 32 byte
1787 // Default: null or empty if the device identifier is not known
1788 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1789 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1790 // Default SOURCE_CODEC_TYPE_INVALID
1791 optional int32 codec_type = 2;
1792 // Codec priroity, the higher the more preferred, -1 for disabled
1793 // Default: CODEC_PRIORITY_DEFAULT
1794 optional int32 codec_priority = 3;
1795 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1796 // in BluetoothCodecConfig
1797 // Default: empty and SAMPLE_RATE_NONE for individual item
1798 optional int32 sample_rate = 4;
1799 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1800 // in BluetoothCodecConfig
1801 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1802 optional int32 bits_per_sample = 5;
1803 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1804 // BluetoothCodecConfig
1805 // Default: empty and CHANNEL_MODE_NONE for individual item
1806 optional int32 channel_mode = 6;
1807 // Codec specific values
1808 // Default 0
1809 optional int64 codec_specific_1 = 7;
1810 optional int64 codec_specific_2 = 8;
1811 optional int64 codec_specific_3 = 9;
1812 optional int64 codec_specific_4 = 10;
1813}
1814
1815/**
1816 * Logs when A2DP failed to read from PCM source.
1817 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1818 *
1819 * Logged from:
1820 * system/bt
1821 */
1822message BluetoothA2dpAudioUnderrunReported {
1823 // An identifier that can be used to match events for this device.
1824 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1825 // Salt: Randomly generated 256 bit value
1826 // Hash algorithm: HMAC-SHA256
1827 // Size: 32 byte
1828 // Default: null or empty if the device identifier is not known
1829 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1830 // Encoding interval in nanoseconds
1831 // Default: 0
1832 optional int64 encoding_interval_nanos = 2;
1833 // Number of bytes of PCM data that could not be read from the source
1834 // Default: 0
1835 optional int32 num_missing_pcm_bytes = 3;
1836}
1837
1838/**
1839 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1840 * buffer queue is full and we have to drop data
1841 *
1842 * Logged from:
1843 * system/bt
1844 */
1845message BluetoothA2dpAudioOverrunReported {
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 buffers dropped in this event
1857 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1858 // Default: 0
1859 optional int32 num_dropped_buffers = 3;
1860 // Number of encoded buffers dropped in this event
1861 // Default 0
1862 optional int32 num_dropped_encoded_frames = 4;
1863 // Number of encoded bytes dropped in this event
1864 // Default: 0
1865 optional int32 num_dropped_encoded_bytes = 5;
1866}
1867
1868/**
1869 * Logs when we receive reports regarding a device's RSSI value
1870 *
1871 * Logged from:
1872 * system/bt
1873 */
1874message BluetoothDeviceRssiReported {
1875 // An identifier that can be used to match events for this device.
1876 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1877 // Salt: Randomly generated 256 bit value
1878 // Hash algorithm: HMAC-SHA256
1879 // Size: 32 byte
1880 // Default: null or empty if the device identifier is not known
1881 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1882 // Connection handle of this connection if available
1883 // Range: 0x0000 - 0x0EFF (12 bits)
1884 // Default: 0xFFFF if the handle is unknown
1885 optional int32 connection_handle = 2;
1886 // HCI command status code if this is triggerred by hci_cmd
1887 // Default: STATUS_UNKNOWN
1888 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1889 // BR/EDR
1890 // Range: -128 ≤ N ≤ 127 (signed integer)
1891 // Units: dB
1892 // LE:
1893 // Range: -127 to 20, 127 (signed integer)
1894 // Units: dBm
1895 // Invalid when an out of range value is reported
1896 optional int32 rssi = 4;
1897}
1898
1899/**
1900 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1901 *
1902 * Logged from:
1903 * system/bt
1904 */
1905message BluetoothDeviceFailedContactCounterReported {
1906 // An identifier that can be used to match events for this device.
1907 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1908 // Salt: Randomly generated 256 bit value
1909 // Hash algorithm: HMAC-SHA256
1910 // Size: 32 byte
1911 // Default: null or empty if the device identifier is not known
1912 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1913 // Connection handle of this connection if available
1914 // Range: 0x0000 - 0x0EFF (12 bits)
1915 // Default: 0xFFFF if the handle is unknown
1916 optional int32 connection_handle = 2;
1917 // HCI command status code if this is triggerred by hci_cmd
1918 // Default: STATUS_UNKNOWN
1919 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1920 // Number of consecutive failed contacts for a connection corresponding to the Handle
1921 // Range: uint16_t, 0-0xFFFF
1922 // Default: 0xFFFFF
1923 optional int32 failed_contact_counter = 4;
1924}
1925
1926/**
1927 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1928 *
1929 * Logged from:
1930 * system/bt
1931 */
1932message BluetoothDeviceTxPowerLevelReported {
1933 // An identifier that can be used to match events for this device.
1934 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1935 // Salt: Randomly generated 256 bit value
1936 // Hash algorithm: HMAC-SHA256
1937 // Size: 32 byte
1938 // Default: null or empty if the device identifier is not known
1939 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1940 // Connection handle of this connection if available
1941 // Range: 0x0000 - 0x0EFF (12 bits)
1942 // Default: 0xFFFF if the handle is unknown
1943 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001944 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001945 // Default: STATUS_UNKNOWN
1946 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1947 // Range: -30 ≤ N ≤ 20
1948 // Units: dBm
1949 // Invalid when an out of range value is reported
1950 optional int32 transmit_power_level = 4;
1951}
Jack Heab86dbd22018-12-18 15:43:27 -08001952
Tej Singh5d991e12018-03-09 19:48:11 -08001953/**
Jack He1021a612019-01-20 21:22:46 -08001954 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1955 * receiving an HCI command from the host
1956 *
1957 * Logged from: system/bt
1958 */
1959message BluetoothHciTimeoutReported {
1960 // HCI command associated with this event
1961 // Default: CMD_UNKNOWN
1962 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1963}
1964
1965/**
1966 * Logs when we receive Bluetooth Link Quality Report event from the controller
1967 * See Android Bluetooth HCI specification for more details
1968 *
1969 * Note: all count and bytes field are counted since last event
1970 *
1971 * Logged from: system/bt
1972 */
1973message BluetoothQualityReportReported {
1974 // Quality report ID
1975 // Original type: uint8_t
1976 // Default: BQR_ID_UNKNOWN
1977 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1978 // Packet type of the connection
1979 // Original type: uint8_t
1980 // Default: BQR_PACKET_TYPE_UNKNOWN
1981 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1982 // Connection handle of the connection
1983 // Original type: uint16_t
1984 optional int32 connection_handle = 3;
1985 // Performing Role for the connection
1986 // Original type: uint8_t
1987 optional int32 connection_role = 4;
1988 // Current Transmit Power Level for the connection. This value is the same as the controller's
1989 // response to the HCI_Read_Transmit_Power_Level HCI command
1990 // Original type: uint8_t
1991 optional int32 tx_power_level = 5;
1992 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1993 // absolute receiver signal strength value
1994 // Original type: int8_t
1995 optional int32 rssi = 6;
1996 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1997 // channels used by the link currently
1998 // Original type: uint8_t
1999 optional int32 snr = 7;
2000 // Indicates the number of unused channels in AFH_channel_map
2001 // Original type: uint8_t
2002 optional int32 unused_afh_channel_count = 8;
2003 // Indicates the number of the channels which are interfered and quality is bad but are still
2004 // selected for AFH
2005 // Original type: uint8_t
2006 optional int32 afh_select_unideal_channel_count = 9;
2007 // Current Link Supervision Timeout Setting
2008 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2009 // Original type: uint16_t
2010 optional int32 lsto = 10;
2011 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2012 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2013 // 0x01 (Piconet Clock)
2014 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2015 // Original type: uint32_t
2016 optional int64 connection_piconet_clock = 11;
2017 // The count of retransmission
2018 // Original type: uint32_t
2019 optional int64 retransmission_count = 12;
2020 // The count of no RX
2021 // Original type: uint32_t
2022 optional int64 no_rx_count = 13;
2023 // The count of NAK (Negative Acknowledge)
2024 // Original type: uint32_t
2025 optional int64 nak_count = 14;
2026 // Controller timestamp of last TX ACK
2027 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2028 // Original type: uint32_t
2029 optional int64 last_tx_ack_timestamp = 15;
2030 // The count of Flow-off (STOP)
2031 // Original type: uint32_t
2032 optional int64 flow_off_count = 16;
2033 // Controller timestamp of last Flow-on (GO)
2034 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2035 // Original type: uint32_t
2036 optional int64 last_flow_on_timestamp = 17;
2037 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2038 // Original type: uint32_t
2039 optional int64 buffer_overflow_bytes = 18;
2040 // Buffer underflow count (in byte) since last event
2041 // Original type: uint32_t
2042 optional int64 buffer_underflow_bytes = 19;
2043}
2044
2045/**
2046 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2047 *
2048 * Notes:
2049 * - Each event can be partially filled as we might learn different pieces of device
2050 * information at different time
2051 * - Multiple device info events can be combined to give more complete picture
2052 * - When multiple device info events tries to describe the same information, the
2053 * later one wins
2054 *
2055 * Logged from:
2056 * packages/apps/Bluetooth
2057 */
Jack Heaea26982019-04-04 11:19:48 -07002058message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002059 // An identifier that can be used to match events for this device.
2060 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2061 // Salt: Randomly generated 256 bit value
2062 // Hash algorithm: HMAC-SHA256
2063 // Size: 32 byte
2064 // Default: null or empty if the device identifier is not known
2065 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2066 // Where is this device info obtained from
2067 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2068 // Name of the data source
2069 // For EXTERNAL: package name of the data source
2070 // For INTERNAL: null for general case, component name otherwise
2071 optional string source_name = 3;
2072 // Name of the manufacturer of this device
2073 optional string manufacturer = 4;
2074 // Model of this device
2075 optional string model = 5;
2076 // Hardware version of this device
2077 optional string hardware_version = 6;
2078 // Software version of this device
2079 optional string software_version = 7;
2080}
2081
2082/**
2083 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2084 * device, as documented by the Bluetooth Core HCI specification
2085 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2086 * Vol 2, Part E, Page 1118
2087 *
2088 * Logged from:
2089 * system/bt
2090 */
2091message BluetoothRemoteVersionInfoReported {
2092 // Connection handle of the connection
2093 // Original type: uint16_t
2094 optional int32 connection_handle = 1;
2095 // HCI command status code
2096 // Default: STATUS_UNKNOWN
2097 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2098 // 1 byte Version of current LMP in the remote controller
2099 optional int32 lmp_version = 3;
2100 // 2 bytes LMP manufacturer code of the remote controller
2101 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2102 optional int32 lmp_manufacturer_code = 4;
2103 // 4 bytes subversion of the LMP in the remote controller
2104 optional int32 lmp_subversion = 5;
2105}
2106
2107/**
2108 * Logs when certain Bluetooth SDP attributes are discovered
2109 * Constant definitions are from:
2110 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2111 *
2112 * Current logged attributes:
2113 * - BluetoothProfileDescriptorList
2114 * - Supported Features Bitmask
2115 *
2116 * Logged from:
2117 * system/bt
2118 */
2119message BluetoothSdpAttributeReported {
2120 // An identifier that can be used to match events for this device.
2121 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2122 // Salt: Randomly generated 256 bit value
2123 // Hash algorithm: HMAC-SHA256
2124 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2125 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2126 // Original type: uint16_t
2127 optional int32 protocol_uuid = 2;
2128 // Short form UUIDs used to identify Bluetooth SDP attribute types
2129 // Original type: uint16_t
2130 optional int32 attribute_id = 3;
2131 // Attribute value for the particular attribute
2132 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2133}
2134
2135/**
2136 * Logs when bond state of a Bluetooth device changes
2137 *
2138 * Logged from:
2139 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2140 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2141 */
2142message BluetoothBondStateChanged {
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 // Size: 32 byte
2148 // Default: null or empty if the device identifier is not known
2149 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2150 // Preferred transport type to remote dual mode device
2151 // Default: TRANSPORT_AUTO means no preference
2152 optional android.bluetooth.TransportTypeEnum transport = 2;
2153 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2154 // Default: UNKNOWN
2155 optional android.bluetooth.DeviceTypeEnum type = 3;
2156 // Current bond state (NONE, BONDING, BONDED)
2157 // Default: BOND_STATE_UNKNOWN
2158 optional android.bluetooth.BondStateEnum bond_state = 4;
2159 // Bonding sub state
2160 // Default: BOND_SUB_STATE_UNKNOWN
2161 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2162 // Unbond Reason
2163 // Default: UNBOND_REASON_UNKNOWN
2164 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2165}
2166
2167/**
2168 * Logs there is an event related Bluetooth classic pairing
2169 *
2170 * Logged from:
2171 * system/bt
2172 */
2173message BluetoothClassicPairingEventReported {
2174 // An identifier that can be used to match events for this device.
2175 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2176 // Salt: Randomly generated 256 bit value
2177 // Hash algorithm: HMAC-SHA256
2178 // Size: 32 byte
2179 // Default: null or empty if the device identifier is not known
2180 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2181 // Connection handle of this connection if available
2182 // Range: 0x0000 - 0x0EFF (12 bits)
2183 // Default: 0xFFFF if the handle is unknown
2184 optional int32 connection_handle = 2;
2185 // HCI command associated with this event
2186 // Default: CMD_UNKNOWN
2187 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2188 // HCI event associated with this event
2189 // Default: EVT_UNKNOWN
2190 optional android.bluetooth.hci.EventEnum hci_event = 4;
2191 // HCI command status code if this is triggerred by hci_cmd
2192 // Default: STATUS_UNKNOWN
2193 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2194 // HCI reason code associated with this event
2195 // Default: STATUS_UNKNOWN
2196 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002197 // A status value related to this specific event
2198 // Default: 0
2199 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002200}
2201
2202/**
2203 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2204 *
2205 * Logged from:
2206 * system/bt
2207 */
2208message BluetoothSmpPairingEventReported {
2209 // An identifier that can be used to match events for this device.
2210 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2211 // Salt: Randomly generated 256 bit value
2212 // Hash algorithm: HMAC-SHA256
2213 // Size: 32 byte
2214 // Default: null or empty if the device identifier is not known
2215 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2216 // SMP command sent or received over L2CAP
2217 // Default: CMD_UNKNOWN
2218 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2219 // Whether this command is sent or received
2220 // Default: DIRECTION_UNKNOWN
2221 optional android.bluetooth.DirectionEnum direction = 3;
2222 // SMP failure reason code
2223 // Default: PAIRING_FAIL_REASON_DEFAULT
2224 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2225}
2226
2227/**
Jack He815cdba2019-01-30 17:24:55 -08002228 * Logs when a Bluetooth socket’s connection state changed
2229 *
2230 * Logged from:
2231 * system/bt
2232 */
2233message BluetoothSocketConnectionStateChanged {
2234 // An identifier that can be used to match events for this device.
2235 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2236 // Salt: Randomly generated 256 bit value
2237 // Hash algorithm: HMAC-SHA256
2238 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002239 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002240 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002241 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002242 // Default 0 when unknown or don't care
2243 optional int32 port = 2;
2244 // Socket type as mentioned in
2245 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2246 // Default: SOCKET_TYPE_UNKNOWN
2247 optional android.bluetooth.SocketTypeEnum type = 3;
2248 // Socket connection state
2249 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2250 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2251 // Number of bytes sent to remote device during this connection
2252 optional int64 tx_bytes = 5;
2253 // Number of bytes received from remote device during this connection
2254 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002255 // Socket owner's UID
2256 optional int32 uid = 7 [(is_uid) = true];
2257 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2258 // |port| must be spawned by |server_port|
2259 // Default 0 when unknown or don't care
2260 optional int32 server_port = 8;
2261 // Whether this is a server listener socket
2262 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002263}
2264
2265/**
Jack He71426802019-04-02 13:32:52 -07002266 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2267 *
2268 * Logged from:
2269 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2270 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2271 *
2272 */
2273message BluetoothClassOfDeviceReported {
2274 // An identifier that can be used to match events for this device.
2275 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2276 // Salt: Randomly generated 256 bit value
2277 // Hash algorithm: HMAC-SHA256
2278 // Size: 32 byte
2279 // Default: null or empty if this is a server listener socket
2280 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2281 // Class of Device (CoD) value including both Major, Minor device class and service class
2282 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2283 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2284 // Default: 0
2285 optional int32 class_of_device = 2;
2286}
2287
2288/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002289 * Logs when something is plugged into or removed from the USB-C connector.
2290 *
2291 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002292 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002293 */
2294message UsbConnectorStateChanged {
2295 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002296 STATE_DISCONNECTED = 0;
2297 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002298 }
2299 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002300 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002301 // Last active session in ms.
2302 // 0 when the port is in connected state.
2303 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002304}
2305
2306/**
2307 * Logs the reported speaker impedance.
2308 *
2309 * Logged from:
2310 * Vendor audio implementation.
2311 */
2312message SpeakerImpedanceReported {
2313 optional int32 speaker_location = 1;
2314 optional int32 impedance = 2;
2315}
2316
2317/**
2318 * Logs the report of a failed hardware.
2319 *
2320 * Logged from:
2321 * Vendor HALs.
2322 *
2323 */
2324message HardwareFailed {
2325 enum HardwareType {
2326 HARDWARE_FAILED_UNKNOWN = 0;
2327 HARDWARE_FAILED_MICROPHONE = 1;
2328 HARDWARE_FAILED_CODEC = 2;
2329 HARDWARE_FAILED_SPEAKER = 3;
2330 HARDWARE_FAILED_FINGERPRINT = 4;
2331 }
2332 optional HardwareType hardware_type = 1;
2333
Maggie White6dcd8572019-01-31 14:11:50 -08002334 /**
2335 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002336 * the same hardware_type. The specific locations are vendor defined integers,
2337 * referring to board-specific numbering schemes.
2338 */
2339 optional int32 hardware_location = 2;
2340
Maggie White6dcd8572019-01-31 14:11:50 -08002341 /**
2342 * failure_code is specific to the HardwareType of the failed hardware.
2343 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002344 */
Maggie White6dcd8572019-01-31 14:11:50 -08002345 enum HardwareErrorCode {
2346 UNKNOWN = 0;
2347 COMPLETE = 1;
2348 SPEAKER_HIGH_Z = 2;
2349 SPEAKER_SHORT = 3;
2350 FINGERPRINT_SENSOR_BROKEN = 4;
2351 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002352 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002353 }
2354 optional int32 failure_code = 3;
2355}
2356
2357/**
2358 * Log an event when the device has been physically dropped.
2359 * Reported from the /vendor partition.
2360 */
2361message PhysicalDropDetected {
2362 // Confidence that the event was actually a drop, 0 -> 100
2363 optional int32 confidence_pctg = 1;
2364 // Peak acceleration of the drop, in 1/1000s of a g.
2365 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002366 // Duration of freefall in ms
2367 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002368}
2369
2370/**
2371 * Log bucketed battery charge cycles.
2372 *
2373 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002374 * a given charge point. For example, if 10 cycle buckets are
2375 * initialized, bucket 1 is the lowest 1/10th of the battery,
2376 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002377 *
2378 * Logged from:
2379 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2380 */
2381message ChargeCyclesReported {
2382 optional int32 cycle_bucket_1 = 1;
2383 optional int32 cycle_bucket_2 = 2;
2384 optional int32 cycle_bucket_3 = 3;
2385 optional int32 cycle_bucket_4 = 4;
2386 optional int32 cycle_bucket_5 = 5;
2387 optional int32 cycle_bucket_6 = 6;
2388 optional int32 cycle_bucket_7 = 7;
2389 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002390 optional int32 cycle_bucket_9 = 9;
2391 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002392}
2393
2394/**
Howard Roa46b6582018-09-18 16:45:02 -07002395 * Log battery health snapshot.
2396 *
2397 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2398 * are snapshotted periodically over 24hrs.
2399 */
2400message BatteryHealthSnapshot {
2401 enum BatterySnapshotType {
2402 UNKNOWN = 0;
2403 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2404 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2405 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2406 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2407 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2408 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2409 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2410 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2411 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2412 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2413 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2414 }
2415 optional BatterySnapshotType type = 1;
2416 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002417 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002418 // Voltage Battery Voltage, in microVolts.
2419 optional int32 voltage_micro_volt = 3;
2420 // Current Battery current, in microAmps.
2421 optional int32 current_micro_amps = 4;
2422 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2423 optional int32 open_circuit_micro_volt = 5;
2424 // Resistance Battery Resistance, in microOhms.
2425 optional int32 resistance_micro_ohm = 6;
2426 // Level Battery Level, as % of full.
2427 optional int32 level_percent = 7;
2428}
2429
2430/**
2431 * Log slow I/O operations on the primary storage.
2432 */
2433message SlowIo {
2434 // Classifications of IO Operations.
2435 enum IoOperation {
2436 UNKNOWN = 0;
2437 READ = 1;
2438 WRITE = 2;
2439 UNMAP = 3;
2440 SYNC = 4;
2441 }
2442 optional IoOperation operation = 1;
2443
2444 // The number of slow IO operations of this type over 24 hours.
2445 optional int32 count = 2;
2446}
2447
2448/**
2449 * Log battery caused shutdown with the last recorded voltage.
2450 */
2451message BatteryCausedShutdown {
2452 // The last recorded battery voltage prior to shutdown.
2453 optional int32 last_recorded_micro_volt = 1;
2454}
2455
2456/**
Tej Singha72344992019-04-17 18:55:08 -07002457 * Logs when ThermalService receives throttling events.
2458 *
2459 * Logged from:
2460 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2461 */
2462message ThermalThrottlingSeverityStateChanged {
2463 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2464 optional android.os.TemperatureTypeEnum sensor_type = 1;
2465
2466 // The name of the temperature source. Eg. CPU0
2467 optional string sensor_name = 2;
2468
2469 // Temperature in tenths of a degree C.
2470 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2471 optional int32 temperature_deci_celsius = 3;
2472
2473 // Relative severity of the throttling, see enum definition.
2474 optional android.os.ThrottlingSeverityEnum severity = 4;
2475}
2476
2477/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002478 * Logs the duration of a davey (jank of >=700ms) when it occurs
2479 *
2480 * Logged from:
2481 * frameworks/base/libs/hwui/JankTracker.cpp
2482 */
2483message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002484 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002485 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002486
Tej Singhbb8554a2018-01-26 11:59:14 -08002487 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002488 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002489}
2490
2491/**
Bookatze5885242017-10-24 20:10:31 -07002492 * Logs phone signal strength changes.
2493 *
2494 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002495 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002496 */
2497message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002498 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2499 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002500}
2501
Yangster4ccebea2018-10-09 17:09:02 -07002502
2503/**
2504 * Logs when the phone state, sim state or signal strength changes
2505 *
2506 * Logged from:
2507 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2508 */
2509message PhoneServiceStateChanged {
2510 optional android.telephony.ServiceStateEnum state = 1;
2511 optional android.telephony.SimStateEnum sim_state = 2;
2512 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2513}
2514
2515/**
2516 * Logs when the phone becomes on or off.
2517 *
2518 * Logged from:
2519 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2520 */
2521message PhoneStateChanged {
2522 enum State {
2523 OFF = 0;
2524 ON = 1;
2525 }
2526 optional State state = 1;
2527}
2528
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002529message BackGesture {
2530 enum BackType {
2531 DEFAULT_BACK_TYPE = 0;
2532 COMPLETED = 1;
2533 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2534 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2535 INCOMPLETE = 4;
2536 }
2537 optional BackType type = 1;
2538
2539 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2540 enum WindowHorizontalLocation {
2541 DEFAULT_LOCATION = 0;
2542 LEFT = 1;
2543 RIGHT = 2;
2544 }
2545 optional WindowHorizontalLocation x_location = 3;
2546}
2547
2548message ExclusionRectStateChanged {
2549 optional string component_name = 1; // if not available, simply packageName
2550 optional int32 requested_height = 2; // px
2551 optional int32 rejected_height = 3; // px
2552
2553 enum WindowHorizontalLocation {
2554 DEFAULT_LOCATION = 0;
2555 LEFT = 1;
2556 RIGHT = 2;
2557 }
2558 optional WindowHorizontalLocation x_location = 4;
2559 optional bool landscape = 5;
2560 optional bool splitscreen = 6;
2561 optional int32 duration_millis = 7;
2562}
2563
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002564message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002565 optional android.stats.launcher.LauncherAction action = 1;
2566 optional android.stats.launcher.LauncherState src_state = 2;
2567 optional android.stats.launcher.LauncherState dst_state = 3;
2568 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002569 optional bool is_swipe_up_enabled = 5;
2570}
2571
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002572message StyleUIChanged {
2573 optional android.stats.style.Action action = 1;
2574 optional int32 color_package_hash = 2;
2575 optional int32 font_package_hash = 3;
2576 optional int32 shape_package_hash = 4;
2577 optional int32 clock_package_hash = 5;
2578 optional int32 launcher_grid = 6;
2579 optional int32 wallpaper_category_hash = 7;
2580 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002581 optional int32 color_preference = 9;
2582 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002583}
2584
David Chenc28b2bb2017-10-24 12:52:52 -07002585/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002586 * Logs when Settings UI has changed.
2587 *
2588 * Logged from:
2589 * packages/apps/Settings
2590 */
2591message SettingsUIChanged {
2592 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002593 * Where this SettingsUIChange event comes from. For example, if
2594 * it's a PAGE_VISIBLE event, where the page is opened from.
2595 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002596 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002597
2598 /**
2599 * What the UI action is.
2600 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002601 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002602
2603 /**
2604 * Where the action is happening
2605 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002606 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002607
2608 /**
2609 * What preference changed in this event.
2610 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002611 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002612
2613 /**
2614 * The new value of the changed preference.
2615 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002616 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002617}
2618
2619/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002620 * Logs basic timing information about touch events.
2621 * Reported at most every 5 minutes while device is being interacted with.
2622 *
2623 * Logged from:
2624 * frameworks/native/services/inputflinger
2625 */
2626message TouchEventReported {
2627 /**
2628 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002629 * and the standard deviation of the time spent processing touchscreen events
2630 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002631 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002632 * On supported devices, the starting point is taken during the hard interrupt inside the
2633 * kernel touch driver. On all other devices, the starting point is taken inside
2634 * the kernel's input event subsystem upon receipt of the input event.
2635 * The ending point is taken inside InputDispatcher, just after the input event
2636 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002637 */
2638 // Minimum value
2639 optional float latency_min_micros = 1;
2640 // Maximum value
2641 optional float latency_max_micros = 2;
2642 // Average value
2643 optional float latency_mean_micros = 3;
2644 // Standard deviation
2645 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002646 // Number of touch events (input_event) in this report
2647 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002648}
2649
2650/**
Philip Quinn0eded622019-01-29 12:46:28 -08002651 * Logs gesture classification and timing information for touch events.
2652 *
2653 * Logged from:
2654 * frameworks/base/core/java/android/view/GestureDetector.java
2655 * frameworks/base/core/java/android/view/View.java
2656 */
2657message TouchGestureClassified {
2658 // The source of the classification (e.g. Java class name).
2659 optional string source = 1;
2660
2661 enum Classification {
2662 UNKNOWN_CLASSIFICATION = 0;
2663 SINGLE_TAP = 1;
2664 DOUBLE_TAP = 2;
2665 LONG_PRESS = 3;
2666 DEEP_PRESS = 4;
2667 SCROLL = 5;
2668 }
2669 // The classification of the gesture.
2670 optional Classification classification = 2;
2671
2672 // The interval from the start of a touch event stream until the
2673 // classification was made.
2674 optional int32 latency_millis = 3;
2675
2676 // The distance from the location of the first touch event to the
2677 // location of the touch event when the classification was made.
2678 optional float displacement_px = 4;
2679}
2680
2681/**
David Chenc28b2bb2017-10-24 12:52:52 -07002682 * Logs that a setting was updated.
2683 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002684 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002685 * The tag and is_default allow resetting of settings to default values based on the specified
2686 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2687 */
2688message SettingChanged {
2689 // The name of the setting.
2690 optional string setting = 1;
2691
2692 // The change being imposed on this setting. May represent a number, eg "3".
2693 optional string value = 2;
2694
2695 // The new value of this setting. For most settings, this is same as value. For some settings,
2696 // value is +X or -X where X represents an element in a set. For example, if the previous value
2697 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2698 // The +/- feature is currently only used for location_providers_allowed.
2699 optional string new_value = 3;
2700
2701 // The previous value of this setting.
2702 optional string prev_value = 4;
2703
2704 // The tag used with the is_default for resetting sets of settings. This is generally null.
2705 optional string tag = 5;
2706
Bookatz90867622018-01-31 15:05:57 -08002707 // True if this setting with tag should be resettable.
2708 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002709
David Chenbd789912018-03-16 17:19:55 -07002710 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002711 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002712
2713 enum ChangeReason {
2714 UPDATED = 1; // Updated can be an insertion or an update.
2715 DELETED = 2;
2716 }
2717 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002718}
Chenjie Yub3dda412017-10-24 13:41:59 -07002719
Chenjie Yu05013b32017-11-21 10:21:41 -08002720/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002721 * Logs activity going to foreground or background
2722 *
2723 * Logged from:
2724 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2725 */
2726message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002727 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002728 optional string pkg_name = 2;
2729 optional string class_name = 3;
2730
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002731 enum State {
2732 BACKGROUND = 0;
2733 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002734 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002735 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002736}
David Chenc8a43242017-10-17 16:23:28 -07002737
2738/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002739 * Logs when a volume entered low Storage state.
2740 * Logged from:
2741 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2742 */
2743message LowStorageStateChanged {
2744 // Volume that ran out of storage.
2745 optional string volume_description = 1;
2746
2747 enum State {
2748 UNKNOWN = 0;
2749 OFF = 1;
2750 ON = 2;
2751 }
2752 optional State state = 2;
2753}
2754
2755/**
2756 * Logs when an app is downgraded.
2757 * Logged from:
2758 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2759 */
2760message AppDowngraded {
2761 optional string package_name = 1;
2762 // Size of the package (all data) before being downgraded.
2763 optional int64 size_in_bytes_before = 2;
2764 // Size of the package (all data) after being downgraded.
2765 optional int64 size_in_bytes_after = 3;
2766
2767 optional bool aggressive = 4;
2768}
2769
2770/**
2771 * Logs when an app is optimized after being downgraded.
2772 * Logged from:
2773 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2774 */
2775message AppOptimizedAfterDowngraded {
2776 optional string package_name = 1;
2777}
2778
2779/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002780 * Logs whenever an app is installed on external storage.
2781 * Logged from:
2782 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2783 */
2784message AppInstallOnExternalStorageReported {
2785 // The type of external storage.
2786 optional android.stats.storage.ExternalStorageType storage_type = 1;
2787 // The name of the package that is installed on the sd card.
2788 optional string package_name = 2;
2789}
2790
2791/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002792 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002793 * Logged from:
2794 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2795 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002796message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002797 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002798
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002799 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002800
2801 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002802 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002803 optional string process_name = 3;
2804
2805 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002806 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002807
2808 optional string package_name = 5;
2809
2810 enum InstantApp {
2811 UNAVAILABLE = 0;
2812 FALSE = 1;
2813 TRUE = 2;
2814 }
2815 optional InstantApp is_instant_app = 6;
2816
2817 enum ForegroundState {
2818 UNKNOWN = 0;
2819 BACKGROUND = 1;
2820 FOREGROUND = 2;
2821 }
2822 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002823
2824 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002825}
David Chen9e3808c2017-11-20 17:25:34 -08002826
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002827/**
2828 * Logs when a WTF (What a Terrible Failure) happened.
2829 * Logged from:
2830 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2831 */
2832message WTFOccurred {
2833 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002834
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002835 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002836
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002837 // The name of the process.
2838 // system_server if it is not by an app
2839 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002840
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002841 // The pid if available. -1 means not available.
2842 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002843
2844 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002845}
2846
2847/**
2848 * Logs when system server reports low memory.
2849 * Logged from:
2850 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2851 */
2852message LowMemReported {
2853}
2854
2855/**
2856 * Logs when an app ANR (App Not Responding) occurs.
2857 * Logged from:
2858 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2859 */
2860message ANROccurred {
2861 optional int32 uid = 1 [(is_uid) = true];
2862
2863 optional string process_name = 2;
2864
2865 optional string short_component_name = 3;
2866
2867 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002868
2869 enum InstantApp {
2870 UNAVAILABLE = 0;
2871 FALSE = 1;
2872 TRUE = 2;
2873 }
2874 optional InstantApp is_instant_app = 5;
2875
2876 enum ForegroundState {
2877 UNKNOWN = 0;
2878 BACKGROUND = 1;
2879 FOREGROUND = 2;
2880 }
2881 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002882
2883 optional android.server.ErrorSource error_source = 7;
2884
2885 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002886}
2887
Bookatza7020bd2018-08-28 16:29:35 -07002888/**
2889 * Logs when the vibrator state changes.
2890 * Logged from:
2891 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2892 */
2893message VibratorStateChanged {
2894 repeated AttributionNode attribution_node = 1;
2895
2896 enum State {
2897 OFF = 0;
2898 ON = 1;
2899 }
2900 optional State state = 2;
2901
2902 // Duration (in milliseconds) requested to keep the vibrator on.
2903 // Only applicable for State == ON.
2904 optional int64 duration_millis = 3;
2905}
2906
David Chen0a368b22017-12-06 16:28:16 -08002907/*
2908 * Allows other apps to push events into statsd.
2909 * Logged from:
2910 * frameworks/base/core/java/android/util/StatsLog.java
2911 */
David Chen0b5c90c2018-01-25 16:51:49 -08002912message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002913 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002914 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002915
2916 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2917 optional int32 label = 2;
2918
2919 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2920 // predicates for the metrics).
2921 enum State {
2922 UNKNOWN = 0;
2923 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2924 STOP = 2;
2925 START = 3;
2926 }
2927 optional State state = 3;
2928}
2929
David Chen9e3808c2017-11-20 17:25:34 -08002930/**
Bookatz7948c872018-09-04 12:58:33 -07002931 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2932 * For example, this could be due to the user manually changing the time.
2933 *
2934 * Logged from:
2935 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2936 */
2937message WallClockTimeShifted {
2938 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2939 optional int64 wall_clock_timestamp_millis = 1;
2940}
2941
2942/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002943 * Logs when statsd detects an anomaly.
2944 *
2945 * Logged from:
2946 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2947 */
2948message AnomalyDetected {
2949 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002950 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002951
Yangster-mac94e197c2018-01-02 16:03:03 -08002952 // Id of the config whose anomaly detection alert fired.
2953 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002954
Yangster-mac94e197c2018-01-02 16:03:03 -08002955 // Id of the alert (i.e. name of the anomaly that was detected).
2956 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002957}
2958
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002959message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002960 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002961 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002962
2963 // The app package name.
2964 optional string pkg_name = 2;
2965
2966 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002967 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002968 WARM = 1;
2969 HOT = 2;
2970 COLD = 3;
2971 }
2972 // The transition type.
2973 optional TransitionType type = 3;
2974
2975 // The activity name.
2976 optional string activity_name = 4;
2977
2978 // The name of the calling app. Empty if not set.
2979 optional string calling_pkg_name = 5;
2980
2981 // Whether the app is an instant app.
2982 optional bool is_instant_app = 6;
2983
2984 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002985 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002986
Bookatz80d11a02018-01-16 10:46:35 -08002987 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002988
David Chen0b5c90c2018-01-25 16:51:49 -08002989 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002990 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002991 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002992 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002993 optional int32 bind_application_delay_millis = 11;
2994 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002995
2996 // Empty if not set.
2997 optional string launch_token = 13;
2998
Calin Juravle759fbda2018-02-20 19:52:30 +00002999 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003000 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003001
3002 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003003 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003004}
3005
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003006message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003007 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003008 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003009
3010 // The app package name.
3011 optional string pkg_name = 2;
3012
3013 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003014 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003015 WARM = 1;
3016 HOT = 2;
3017 COLD = 3;
3018 }
3019 // The transition type.
3020 optional TransitionType type = 3;
3021
3022 // The activity name.
3023 optional string activity_name = 4;
3024}
3025
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003026message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003027 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003028 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003029
3030 // The app package name.
3031 optional string pkg_name = 2;
3032
3033 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003034 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003035 WITH_BUNDLE = 1;
3036 WITHOUT_BUNDLE = 2;
3037 }
3038 // The transition type.
3039 optional TransitionType type = 3;
3040
3041 // The activity name.
3042 optional string activity_name = 4;
3043
3044 optional bool transition_process_running = 5;
3045
3046 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003047 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003048}
3049
Bookatz8fcd09a2017-12-18 13:01:10 -08003050/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003051 * Logs a picture-in-picture action
3052 * Logged from:
3053 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3054 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3055 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3056 */
3057message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003058 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003059 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003060
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003061 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003062
Chenjie Yu52cacc62017-12-08 18:11:45 -08003063 enum State {
3064 ENTERED = 1;
3065 EXPANDED_TO_FULL_SCREEN = 2;
3066 MINIMIZED = 3;
3067 DISMISSED = 4;
3068 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003069 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003070}
3071
3072/**
Chenjie Yue8904192017-12-08 19:12:57 -08003073 * Logs overlay action
3074 * Logged from:
3075 * services/core/java/com/android/server/wm/Session.java
3076 */
3077message OverlayStateChanged {
tsaichristine10978642019-09-10 14:12:49 -07003078 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003079
tsaichristine10978642019-09-10 14:12:49 -07003080 optional string package_name = 2 [(state_field_option).option = PRIMARY];
Chenjie Yue8904192017-12-08 19:12:57 -08003081
3082 optional bool using_alert_window = 3;
3083
3084 enum State {
3085 ENTERED = 1;
3086 EXITED = 2;
3087 }
tsaichristine10978642019-09-10 14:12:49 -07003088 optional State state = 4 [(state_field_option).option = EXCLUSIVE];
Chenjie Yue8904192017-12-08 19:12:57 -08003089}
3090
Chenjie Yuccfe6452018-01-30 11:33:21 -08003091/*
3092 * Logs foreground service starts and stops.
3093 * Note that this is not when a service starts or stops, but when it is
3094 * considered foreground.
3095 * Logged from
3096 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3097 */
3098message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003099 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003100 // package_name + "/" + class_name
3101 optional string short_name = 2;
3102
3103 enum State {
3104 ENTER = 1;
3105 EXIT = 2;
3106 }
3107 optional State state = 3;
3108}
3109
Chenjie Yue8904192017-12-08 19:12:57 -08003110/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003111 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3112 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3113 * attributed back to the parent (host) uid. One example is Chrome.
3114 *
3115 * Logged from:
3116 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3117 */
3118message IsolatedUidChanged {
3119 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003120 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003121 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003122 optional int32 parent_uid = 1;
3123
3124 optional int32 isolated_uid = 2;
3125
3126 // We expect an isolated uid to be removed before if it's used for another parent uid.
3127 enum Event {
3128 REMOVED = 0;
3129 CREATED = 1;
3130 }
3131 optional Event event = 3;
3132}
3133
3134/*
3135 * Logs the reception of an incoming network packet causing the main system to wake up for
3136 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3137 * and processed by WakeupController.cpp.
3138 */
3139message PacketWakeupOccurred {
3140 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3141 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003142 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003143 // The interface name on which the packet was received.
3144 optional string iface = 2;
3145 // The ethertype value of the packet.
3146 optional int32 ethertype = 3;
3147 // String representation of the destination MAC address of the packet.
3148 optional string destination_hardware_address = 4;
3149 // String representation of the source address of the packet if this was an IP packet.
3150 optional string source_ip = 5;
3151 // String representation of the destination address of the packet if this was an IP packet.
3152 optional string destination_ip = 6;
3153 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3154 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3155 // families.
3156 optional int32 ip_next_header = 7;
3157 // The source port if this was a TCP or UDP packet.
3158 optional int32 source_port = 8;
3159 // The destination port if this was a TCP or UDP packet.
3160 optional int32 destination_port = 9;
3161}
3162
3163/*
3164 * Logs the memory stats for an app on startup.
3165 * Logged from:
3166 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3167 */
3168message AppStartMemoryStateCaptured {
3169 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003170 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003171
3172 // The process name.
3173 optional string process_name = 2;
3174
3175 // The activity name.
3176 optional string activity_name = 3;
3177
3178 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003179 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003180
3181 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003182 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003183
3184 // RSS
3185 optional int64 rss_in_bytes = 6;
3186
3187 // CACHE
3188 optional int64 cache_in_bytes = 7;
3189
3190 // SWAP
3191 optional int64 swap_in_bytes = 8;
3192}
3193
3194/*
3195 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3196 * for LMK event.
3197 * Logged from:
3198 * system/core/lmkd/lmkd.c
3199 */
3200message LmkStateChanged {
3201 enum State {
3202 UNKNOWN = 0;
3203 START = 1;
3204 STOP = 2;
3205 }
3206 optional State state = 1;
3207}
3208
3209/*
3210 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3211 * Logged from:
3212 * system/core/lmkd/lmkd.c
3213 */
3214message LmkKillOccurred {
3215 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003216 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003217
3218 // The process name.
3219 optional string process_name = 2;
3220
3221 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003222 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003223
3224 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003225 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003226
3227 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003228 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003229
3230 // RSS
3231 optional int64 rss_in_bytes = 6;
3232
3233 // CACHE
3234 optional int64 cache_in_bytes = 7;
3235
3236 // SWAP
3237 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003238
3239 // The elapsed real time of start of the process.
3240 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003241
3242 // Min oom adj score considered by lmkd.
3243 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003244}
3245
Rajeev Kumar51b54602018-03-01 12:18:26 -08003246/*
3247 * Logs when the ActivityManagerService detects that an app died.
3248 *
3249 * Logged from:
3250 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3251 */
3252message AppDied {
3253 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003254 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003255}
3256
Howard Ro21a039c2018-08-06 14:55:47 -07003257/**
3258 * An atom for generic metrics logging. Available from Android Q.
3259 */
3260message GenericAtom {
3261 // The uid of the application that sent this custom atom.
3262 optional int32 uid = 1 [(is_uid) = true];
3263
3264 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003265 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003266}
3267
Tej Singhd6d6d772018-09-05 17:41:25 -07003268/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003269 * Atom for simple logging of user interaction and impression events, such as "the user touched
3270 * this button" or "this dialog was displayed".
3271 * Keep the UI event stream clean: don't use for system or background events.
3272 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
3273 */
3274message UiEventReported {
3275 // The event_id.
3276 optional int32 event_id = 1;
3277 // The event's source or target uid and package, if applicable.
3278 // For example, the package posting a notification, or the destination package of a share.
3279 optional int32 uid = 2 [(is_uid) = true];
3280 optional string package_name = 3;
3281}
3282
3283/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003284 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003285 *
3286 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003287 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003288 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003289message BiometricAcquired {
3290 // Biometric modality that was acquired.
3291 optional android.hardware.biometrics.ModalityEnum modality = 1;
3292 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3293 optional int32 user = 2;
3294 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3295 optional bool is_crypto = 3;
3296 // Action that the device is performing. Acquired messages are only expected for enroll and
3297 // authenticate. Other actions may indicate an error.
3298 optional android.hardware.biometrics.ActionEnum action = 4;
3299 // The client that this acquisition was received for.
3300 optional android.hardware.biometrics.ClientEnum client = 5;
3301 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3302 optional int32 acquire_info = 6;
3303 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3304 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003305 // Dictates if this message should trigger additional debugging.
3306 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003307}
3308
3309/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003310 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003311 *
3312 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003313 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003314 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003315message BiometricAuthenticated {
3316 // Biometric modality that was used.
3317 optional android.hardware.biometrics.ModalityEnum modality = 1;
3318 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3319 optional int32 user = 2;
3320 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3321 // storage.
3322 optional bool is_crypto = 3;
3323 // The client that this acquisition was received for.
3324 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003325 // If authentication requires user confirmation. See BiometricPrompt's
3326 // setRequireConfirmation(bool) method.
3327 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003328
Kevin Chyn1741a072019-01-17 11:54:40 -08003329 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003330 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003331 REJECTED = 1;
3332 PENDING_CONFIRMATION = 2;
3333 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003334 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003335
3336 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003337 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003338 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3339 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3340 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3341 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003342 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003343 // Dictates if this message should trigger additional debugging.
3344 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003345}
3346
3347/**
3348 * Logs when a biometric error occurs.
3349 *
3350 * Logged from:
3351 * frameworks/base/services/core/java/com/android/server/biometrics
3352 */
3353message BiometricErrorOccurred {
3354 // Biometric modality that was used.
3355 optional android.hardware.biometrics.ModalityEnum modality = 1;
3356 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3357 optional int32 user = 2;
3358 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3359 optional bool is_crypto = 3;
3360 // Action that the device is performing.
3361 optional android.hardware.biometrics.ActionEnum action = 4;
3362 // The client that this acquisition was received for.
3363 optional android.hardware.biometrics.ClientEnum client = 5;
3364 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3365 // are unique to modality.
3366 optional int32 error_info = 6;
3367 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3368 // by the vendor and not specified by the HIDL interface.
3369 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003370 // Dictates if this message should trigger additional debugging.
3371 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003372 // Time spent during the authentication attempt.
3373 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003374}
3375
3376/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003377 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003378 * Logged from:
3379 * frameworks/base/services/core/java/com/android/server/biometrics
3380 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003381message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003382 // Biometric modality.
3383 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003384 // Type of issue detected.
3385 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003386 // Dictates if this message should trigger additional debugging.
3387 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003388}
Howard Ro688ae182018-09-25 00:09:36 -07003389
joshmccloskey6f952b22019-03-25 20:59:35 -07003390/**
3391 * Logs when a biometric enrollment occurs.
3392 *
3393 * Logged from:
3394 * frameworks/base/services/core/java/com/android/server/biometrics
3395 */
3396message BiometricEnrolled {
3397 // Biometric modality that was used.
3398 optional android.hardware.biometrics.ModalityEnum modality = 1;
3399 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3400 optional int32 user = 2;
3401 // The amount of time the enrollment took in milliseconds.
3402 optional int64 latency_millis = 3;
3403 // Whether or not the enrollment was successful.
3404 optional bool success = 4;
3405}
3406
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003407/*
Tej Singh0d176952019-01-16 19:10:54 -08003408 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003409 */
Tej Singh0d176952019-01-16 19:10:54 -08003410message FlagFlipUpdateOccurred {
3411 // If the event is from a flag config package, specify the package name.
3412 optional string flag_flip_package_name = 1;
3413
3414 // The order id of the package
3415 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003416}
3417
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003418/**
3419 * Potential experiment ids that goes with a train install.
3420 */
3421message TrainExperimentIds {
3422 repeated int64 experiment_id = 1;
3423}
3424
Yangster-macb89807e2018-11-15 21:10:57 -08003425/*
3426 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003427 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003428 */
3429message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003430 // Name of the train.
3431 optional string train_name = 1;
3432 // Version code for a "train" of packages that need to be installed atomically
3433 optional int64 train_version_code = 2;
3434 // After installation of this package, device requires a restart.
3435 optional bool requires_staging = 3;
3436 // Rollback should be enabled for this install.
3437 optional bool rollback_enabled = 4;
3438 // Requires low latency monitoring if possible.
3439 optional bool requires_low_latency_monitor = 5;
3440
Yangster-macb89807e2018-11-15 21:10:57 -08003441 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003442 UNKNOWN = 0;
3443 INSTALL_REQUESTED = 1;
3444 INSTALL_STARTED = 2;
3445 INSTALL_STAGED_NOT_READY = 3;
3446 INSTALL_STAGED_READY = 4;
3447 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003448 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3449 // and INSTALL_FAILURE_COMMIT.
3450 INSTALL_FAILURE = 6 [deprecated = true];
3451 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003452 INSTALL_CANCELLED = 7;
3453 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003454 INSTALLER_ROLLBACK_INITIATED = 9;
3455 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3456 INSTALLER_ROLLBACK_STAGED = 11;
3457 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3458 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3459 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3460 INSTALLER_ROLLBACK_SUCCESS = 15;
3461 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003462 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3463 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3464 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3465 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3466 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3467 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003468 INSTALL_FAILURE_DOWNLOAD = 23;
3469 INSTALL_FAILURE_STATE_MISMATCH = 24;
3470 INSTALL_FAILURE_COMMIT = 25;
Yangster-macb89807e2018-11-15 21:10:57 -08003471 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003472 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003473 // Possible experiment ids for monitoring this push.
3474 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3475 // user id
3476 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003477}
3478
Tej Singhc9203082019-05-03 13:42:23 -07003479/* Test atom, is not logged anywhere */
3480message TestAtomReported {
3481 repeated AttributionNode attribution_node = 1;
3482 optional int32 int_field = 2;
3483 optional int64 long_field = 3;
3484 optional float float_field = 4;
3485 optional string string_field = 5;
3486 optional bool boolean_field = 6;
3487 enum State {
3488 UNKNOWN = 0;
3489 OFF = 1;
3490 ON = 2;
3491 }
3492 optional State state = 7;
3493 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3494}
3495
Maggie Whitefc1aa592018-11-28 21:55:23 -08003496/** Represents USB port overheat event. */
3497message UsbPortOverheatEvent {
3498 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3499 optional int32 plug_temperature_deci_c = 1;
3500
3501 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3502 optional int32 max_temperature_deci_c = 2;
3503
3504 /* Time between USB plug event and overheat threshold trip, in seconds. */
3505 optional int32 time_to_overheat_secs = 3;
3506
3507 /* Time between overheat threshold trip and hysteresis, in seconds. */
3508 optional int32 time_to_hysteresis_secs = 4;
3509
3510 /* Time between hysteresis and active mitigation ending, in seconds. */
3511 optional int32 time_to_inactive_secs = 5;
3512};
3513
Maggie White8735b852019-01-18 11:40:49 -08003514/**
3515 * Logs total effective full charge and discharge cycles on a battery.
3516 * Here are some examples of one effective cycle:
3517 * 1) the battery charges from 0% to 100% and drains back to 0%,
3518 * 2) charging from 50% to 100% and draining back to 50% twice.
3519 * Pulled from:
3520 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3521 */
3522message BatteryCycleCount {
3523 /* Number of total charge and discharge cycles on the system battery. */
3524 optional int32 cycle_count = 1;
3525}
3526
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003527/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003528 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3529 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003530 * Pulled from:
3531 * StatsCompanionService
3532 */
3533
Carmen Agimof12dec122019-03-06 16:14:38 +00003534message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003535
Carmen Agimof12dec122019-03-06 16:14:38 +00003536 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003537 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003538 PUBLIC = 1;
3539 PRIVATE = 2;
3540 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003541 }
3542
Carmen Agimof12dec122019-03-06 16:14:38 +00003543 // The type of external storage.
3544 optional android.stats.storage.ExternalStorageType storage_type = 1;
3545 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3546 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003547 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003548 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003549}
3550
Yangster-macb89807e2018-11-15 21:10:57 -08003551/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003552 * Logs when a connection becomes available and lost.
3553 * Logged in StatsCompanionService.java
3554 */
3555message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003556 // Id of the network.
3557 optional int32 net_id = 1;
3558
3559 enum State {
3560 UNKNOWN = 0;
3561 CONNECTED = 1;
3562 DISCONNECTED = 2;
3563 }
3564 // Connected state of a network.
3565 optional State state = 2;
3566}
3567
3568/**
3569 * Logs when a service starts and stops.
3570 * Logged from:
3571 * services/core/java/com/android/server/am/ActiveServices.java
3572 */
3573message ServiceStateChanged {
3574
3575 optional int32 uid = 1 [(is_uid) = true];
3576
3577 optional string package_name = 2;
3578
3579 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003580
3581 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003582 START = 1;
3583 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003584 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003585
3586 optional State state = 4;
3587}
3588
3589/**
3590 * Logs when a service is launched.
3591 * Logged from:
3592 * services/core/java/com/android/server/am/ActiveServices.java
3593 */
3594message ServiceLaunchReported {
3595
3596 optional int32 uid = 1 [(is_uid) = true];
3597
3598 optional string package_name = 2;
3599
3600 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003601}
Howard Ro688ae182018-09-25 00:09:36 -07003602
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003603/**
3604 * Logs when a hidden API is used.
3605 *
3606 * Logged from:
3607 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3608 */
3609message HiddenApiUsed {
3610 // The uid of the app making the hidden access.
3611 optional int32 uid = 1 [(is_uid) = true];
3612
3613 // Signature of the method or field accessed.
3614 optional string signature = 2;
3615
3616 enum AccessMethod {
3617 NONE = 0;
3618 REFLECTION = 1;
3619 JNI = 2;
3620 LINKING = 3;
3621 }
3622
3623 // Type of access.
3624 optional AccessMethod access_method = 3;
3625
3626 // Whether the access was prevented or not.
3627 optional bool access_denied = 4;
3628}
3629
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003630/**
3631 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3632 * - When user sees privacy chip
3633 * - When user clicks privacy chip
3634 * - How does the user exit the Privacy Dialog
3635 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003636 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3637 */
3638message PrivacyIndicatorsInteracted {
3639
3640 enum Type {
3641 UNKNOWN = 0;
3642 CHIP_VIEWED = 1;
3643 CHIP_CLICKED = 2;
3644 DIALOG_PRIVACY_SETTINGS = 3;
3645 DIALOG_DISMISS = 4;
3646 DIALOG_LINE_ITEM = 5;
3647 }
3648
3649 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3650
3651 // Used if the type is LINE_ITEM
3652 optional string package_name = 2;
3653}
3654
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003655/**
3656 * Logs information about a package that is moved from the internal to external storage and vice
3657 * versa.
3658 * It logs the package name, the type of the external storage where the package is installed
3659 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3660 * and the move type: if it's from internal to external or the other way around.
3661 *
3662 * Logged from:
3663 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3664 */
3665message AppMovedStorageReported {
3666 enum MoveType {
3667 UNKNOWN = 0;
3668 TO_EXTERNAL = 1;
3669 TO_INTERNAL = 2;
3670 }
3671 // The type of the external storage.
3672 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3673 // The type of move.
3674 optional MoveType move_type = 2;
3675 // The name of the package that was moved.
3676 optional string package_name = 3;
3677}
3678
jianjin8f2dee02019-03-29 14:03:08 -07003679/**
3680 * Logs when system server watchdog occurs.
3681 * Logged from:
3682 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3683 */
3684message SystemServerWatchdogOccurred {
3685 optional string subject = 1;
3686}
3687
3688/**
3689 * Logs when new file added to tombstones.
3690 * Logged from:
3691 * frameworks/base/core/java/com/android/server/BootReceiver.java
3692 */
3693message TombStoneOccurred {
3694}
3695
Hai Zhang5d3328d2019-04-13 21:25:06 +08003696/*
3697 * Information about a role request
3698 *
3699 * Logged from:
3700 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3701 */
3702message RoleRequestResultReported {
3703 // UID of application requesting the role
3704 optional int32 requesting_uid = 1;
3705
3706 // Package name of application requesting the role
3707 optional string requesting_package_name = 2;
3708
3709 // The role to be granted
3710 optional string role_name = 3;
3711
3712 // The count of applications qualifying for the role
3713 optional int32 qualifying_count = 4;
3714
3715 // UID of application current granted the role
3716 optional int32 current_uid = 5;
3717
3718 // Package name of application current granted the role
3719 optional string current_package_name = 6;
3720
3721 // UID of another application that user chose to grant the role to, instead of the requesting
3722 // application
3723 optional int32 granted_another_uid = 7;
3724
3725 // Package name of another application that user chose to grant the role to, instead of the
3726 // requesting application
3727 optional string granted_another_package_name = 8;
3728
3729 enum Result {
3730 UNDEFINED = 0;
3731 // role request was ignored
3732 IGNORED = 1;
3733 // role request was ignored because it's already granted
3734 IGNORED_ALREADY_GRANTED = 2;
3735 // role request was ignored because the application isn't qualified
3736 IGNORED_NOT_QUALIFIED = 3;
3737 // role request was ignored because user said it should be always denied
3738 IGNORED_USER_ALWAYS_DENIED = 4;
3739 // role was granted by user action
3740 USER_GRANTED = 5;
3741 // role was denied by user action
3742 USER_DENIED = 6;
3743 // role was denied by user granting another application the role
3744 USER_DENIED_GRANTED_ANOTHER = 7;
3745 // role was denied and set to be always denied by the user
3746 USER_DENIED_WITH_ALWAYS = 8;
3747 }
3748 // The result of the role request
3749 optional Result result = 9;
3750}
3751
Mark Tabrya824a642019-11-05 12:26:12 -08003752/**
3753 * Logs when a Vehicle Maps Service client's connection state has changed
3754 *
3755 * Logged from:
3756 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
3757 */
3758message VmsClientConnectionStateChanged {
3759 // The UID of the VMS client app
3760 optional int32 uid = 1 [(is_uid) = true];
3761
3762 enum State {
3763 UNKNOWN = 0;
3764 // Attempting to connect to the client
3765 CONNECTING = 1;
3766 // Client connection established
3767 CONNECTED = 2;
3768 // Client connection closed unexpectedly
3769 DISCONNECTED = 3;
3770 // Client connection closed by VMS
3771 TERMINATED = 4;
3772 // Error establishing the client connection
3773 CONNECTION_ERROR = 5;
3774 }
3775
3776 optional State state = 2;
3777}
3778
Chenjie Yubbcbc602018-02-05 16:51:52 -08003779//////////////////////////////////////////////////////////////////////
3780// Pulled atoms below this line //
3781//////////////////////////////////////////////////////////////////////
3782
3783/**
David Chenc8a43242017-10-17 16:23:28 -07003784 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3785 *
3786 * Pulled from:
3787 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3788 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003789message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003790 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003791
3792 optional int64 rx_bytes = 2;
3793
3794 optional int64 rx_packets = 3;
3795
3796 optional int64 tx_bytes = 4;
3797
3798 optional int64 tx_packets = 5;
3799}
3800
3801/**
3802 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3803 *
3804 * Pulled from:
3805 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3806 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003807message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003808 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003809
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003810 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3811 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003812
3813 optional int64 rx_bytes = 3;
3814
3815 optional int64 rx_packets = 4;
3816
3817 optional int64 tx_bytes = 5;
3818
3819 optional int64 tx_packets = 6;
3820}
3821
3822/**
3823 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3824 *
3825 * Pulled from:
3826 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3827 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003828message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003829 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003830
3831 optional int64 rx_bytes = 2;
3832
3833 optional int64 rx_packets = 3;
3834
3835 optional int64 tx_bytes = 4;
3836
3837 optional int64 tx_packets = 5;
3838}
3839
3840/**
3841 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3842 *
3843 * Pulled from:
3844 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3845 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003846message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003847 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003848
Yao Chenc40a19d2018-03-15 16:48:25 -07003849 // 1 denotes foreground and 0 denotes background. This is called Set in
3850 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003851 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003852
3853 optional int64 rx_bytes = 3;
3854
3855 optional int64 rx_packets = 4;
3856
3857 optional int64 tx_bytes = 5;
3858
3859 optional int64 tx_packets = 6;
3860}
3861
3862/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003863 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3864 *
3865 * Pulled from:
3866 * StatsCompanionService
3867 */
3868message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003869 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003870
3871 optional int64 rx_bytes = 2;
3872
3873 optional int64 tx_bytes = 3;
3874}
3875
3876/**
David Chenc8a43242017-10-17 16:23:28 -07003877 * Pulls the kernel wakelock durations. This atom is adapted from
3878 * android/internal/os/KernelWakelockStats.java
3879 *
3880 * Pulled from:
3881 * StatsCompanionService using KernelWakelockReader.
3882 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003883message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003884 optional string name = 1;
3885
3886 optional int32 count = 2;
3887
3888 optional int32 version = 3;
3889
Yangster-maca8a30442018-10-13 23:46:34 -07003890 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003891}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003892
Chenjie Yu05013b32017-11-21 10:21:41 -08003893/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003894 * Pulls low power state information. If power.stats HAL is not available, this
3895 * includes platform and subsystem sleep state information,
3896 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3897 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003898 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003899 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003900 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3901 * as defined in:
3902 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003903 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003904message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003905 // Subsystem name
3906 optional string subsystem_name = 1;
3907 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3908 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003909 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3910 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003911 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003912 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003913 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003914 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003915 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003916}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003917
Chenjie Yu05013b32017-11-21 10:21:41 -08003918/**
Bookatz92da2832018-11-01 18:10:03 -07003919 * Pulls on-device power measurement information.
3920 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3921 * Pulled from:
3922 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3923 */
3924message OnDevicePowerMeasurement {
3925 // Name of the subsystem (to which the rail belongs).
3926 optional string subsystem_name = 1;
3927
3928 // Rail name. The rail lies within the subsystem.
3929 optional string rail_name = 2;
3930
3931 // Time (in ms since boot) at which the rail energy value was measured.
3932 // This may differ slightly from the time that statsd logs this information.
3933 optional uint64 measurement_timestamp_millis = 3;
3934
3935 // Accumulated energy used via the rail since device boot in uWs.
3936 optional uint64 energy_microwatt_secs = 4;
3937}
3938
3939/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003940 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003941 * Pulls the time the cpu spend on the frequency index. Frequency index
3942 * starts from highest to lowest. The value should be monotonically
3943 * increasing since boot. However, if there is a cpu
3944 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003945 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003946message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003947 optional uint32 cluster = 1;
3948 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003949 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003950}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003951
Chenjie Yu05013b32017-11-21 10:21:41 -08003952/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003953 * Pulls Cpu Time Per Uid.
3954 * Note that isolated process uid time should be attributed to host uids.
3955 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003956message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003957 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003958 optional uint64 user_time_micros = 2;
3959 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003960}
3961
3962/**
3963 * Pulls Cpu Time Per Uid per frequency.
3964 * Note that isolated process uid time should be attributed to host uids.
3965 * For each uid, we order the time by descending frequencies.
3966 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003967message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003968 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003969 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003970 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003971}
Hugo Benichi884970e2017-11-14 22:42:46 +09003972
Chenjie Yu05013b32017-11-21 10:21:41 -08003973/**
3974 * Pulls Wifi Controller Activity Energy Info
3975 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003976message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003977 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003978 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003979 // stack reported state
3980 // TODO: replace this with proto enum
3981 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003982 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003983 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003984 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003985 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003986 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003987 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003988 // product of current(mA), voltage(V) and time(ms)
3989 optional uint64 controller_energy_used = 6;
3990}
3991
3992/**
3993 * Pulls Modem Activity Energy Info
3994 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003995message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003996 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003997 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003998 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003999 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004000 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004001 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004002 /**
4003 * Tx power index
4004 * index 0 = tx_power < 0dBm
4005 * index 1 = 0dBm < tx_power < 5dBm
4006 * index 2 = 5dBm < tx_power < 15dBm
4007 * index 3 = 15dBm < tx_power < 20dBm
4008 * index 4 = tx_power > 20dBm
4009 */
4010 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004011 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004012 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004013 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004014 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004015 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004016 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004017 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004018 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004019 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004020 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004021 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004022 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004023 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004024}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004025
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004026/**
4027 * Pulls Bluetooth Activity Energy Info
4028 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4029 */
4030message BluetoothActivityInfo {
4031 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004032 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004033 // bluetooth stack state
4034 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004035 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004036 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004037 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004038 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004039 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004040 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004041 // product of current(mA), voltage(V) and time(ms)
4042 optional uint64 energy_used = 6;
4043}
4044
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004045/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004046 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004047 *
4048 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004049 */
4050message ProcessMemoryState {
4051 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004052 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004053
4054 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004055 // Usually package name, "system" for system server.
4056 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004057 optional string process_name = 2;
4058
Rafal Slawikda51b932018-12-13 16:31:33 +00004059 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004060 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004061
4062 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004063 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004064
4065 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004066 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004067
Rajeev Kumar90235992018-01-29 11:06:48 -08004068 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004069 // Value is read from memory.stat, field total_rss if per-app memory
4070 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004071 optional int64 rss_in_bytes = 6;
4072
4073 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004074 // Value is read from memory.stat, field total_cache if per-app memory
4075 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004076 optional int64 cache_in_bytes = 7;
4077
4078 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004079 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004080 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004081 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004082
Rafal Slawik203c3db2019-09-25 19:53:01 +01004083 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004084 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004085
Rafal Slawik203c3db2019-09-25 19:53:01 +01004086 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4087 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004088
Rafal Slawik203c3db2019-09-25 19:53:01 +01004089 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4090 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004091}
4092
4093/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004094 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004095 *
4096 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4097 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004098 *
4099 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004100 */
4101message ProcessMemoryHighWaterMark {
4102 // The uid if available. -1 means not available.
4103 optional int32 uid = 1 [(is_uid) = true];
4104
Rafal Slawikda51b932018-12-13 16:31:33 +00004105 // The process name.
4106 // Usually package name or process cmdline.
4107 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004108 optional string process_name = 2;
4109
Rafal Slawik239b6802019-09-09 18:46:01 +01004110 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4111 // computed by converting kilobytes to bytes.
4112 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4113
Rafal Slawik3bea8952018-11-15 12:39:33 +00004114 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4115 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004116 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004117}
4118
4119/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004120 * Logs the memory stats for a process.
4121 *
4122 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4123 * and for selected native processes.
4124 */
4125message ProcessMemorySnapshot {
4126 // The uid if available. -1 means not available.
4127 optional int32 uid = 1 [(is_uid) = true];
4128
4129 // The process name.
4130 // Usually package name or process cmdline.
4131 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4132 optional string process_name = 2;
4133
4134 // The pid of the process.
4135 // Allows to disambiguate instances of the process.
4136 optional int32 pid = 3;
4137
4138 // The current OOM score adjustment value.
4139 // Read from ProcessRecord for managed processes.
4140 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4141 optional int32 oom_score_adj = 4;
4142
4143 // The current RSS of the process.
4144 // VmRSS from /proc/pid/status.
4145 optional int32 rss_in_kilobytes = 5;
4146
4147 // The current anon RSS of the process.
4148 // RssAnon from /proc/pid/status.
4149 optional int32 anon_rss_in_kilobytes = 6;
4150
4151 // The current swap size of the process.
4152 // VmSwap from /proc/pid/status.
4153 optional int32 swap_in_kilobytes = 7;
4154
4155 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4156 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4157}
4158
4159/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004160 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004161 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004162message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004163 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004164}
4165
4166/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004167 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004168 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004169message SystemUptime {
4170 // Milliseconds since the system was booted.
4171 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4172 // for external input).
4173 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004174 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004175}
4176
4177/*
4178 * Reads from /proc/uid_concurrent_active_time which has the format:
4179 * active: X (X is # cores)
4180 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4181 * [uid1]: [time-0] [time-1] [time-2] ... ...
4182 * ...
4183 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4184 * The file contains a monotonically increasing count of time for a single boot.
4185 */
4186message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004187 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004188 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004189}
4190
4191/**
4192 * Reads from /proc/uid_concurrent_policy_time which has the format:
4193 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4194 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4195 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4196 * ...
4197 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4198 * The file contains a monotonically increasing count of time for a single boot.
4199 */
4200message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004201 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004202 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004203 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004204}
4205
4206/*
4207 * Pulls free disk space, for data, system partition and temporary directory.
4208 */
4209message DiskSpace {
4210 // available bytes in data partition
4211 optional uint64 data_available_bytes = 1;
4212 // available bytes in system partition
4213 optional uint64 system_available_bytes = 2;
4214 // available bytes in download cache or temp directories
4215 optional uint64 temp_available_bytes = 3;
4216}
Tej Singhbf972d92018-01-10 20:51:13 -08004217
4218/**
4219 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004220 *
4221 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004222 */
4223message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004224 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004225}
4226
4227/**
4228 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004229 * Pulled from:
4230 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004231 */
4232message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004233 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004234}
4235
4236/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004237 * Pulls battery voltage.
4238 * Pulled from:
4239 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4240 */
4241message BatteryVoltage {
4242 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004243 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004244}
4245
4246/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004247 * Pulls battery level (percent full, from 0 to 100).
4248 *
4249 * Pulled from:
4250 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4251 */
4252message BatteryLevel {
4253 // Battery level. Should be in [0, 100].
4254 optional int32 battery_level = 1;
4255}
4256
4257/**
Tej Singhd89137e2018-03-26 14:51:40 -07004258 * Pulls the temperature of various parts of the device.
4259 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004260 *
Maggie White442b6312019-04-05 16:26:44 -07004261 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004262 */
4263message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004264 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004265 optional android.os.TemperatureTypeEnum sensor_location = 1;
4266
4267 // The name of the temperature source. Eg. CPU0
4268 optional string sensor_name = 2;
4269
Tej Singhd89137e2018-03-26 14:51:40 -07004270 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004271 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004272 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004273
4274 // Relative severity of the throttling, see enum definition.
4275 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004276}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004277
4278/**
4279 * Pulls the statistics of calls to Binder.
4280 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004281 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4282 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004283 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004284 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004285 */
4286message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004287 // UID of the process responsible for the binder transaction. It will be set if the process
4288 // executing the binder transaction attribute the transaction to another uid using
4289 // Binder.setThreadWorkSource().
4290 //
4291 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004292 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004293 // UID of the process executing the binder transaction.
4294 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004295 // Fully qualified class name of the API call.
4296 //
4297 // This is a system server class name.
4298 //
4299 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4300 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4301 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4302 // commonly used APIs.
4303 optional string service_class_name = 2;
4304 // Method name of the API call. It can also be a transaction code if we cannot
4305 // resolve it to a name. See Binder#getTransactionName.
4306 //
4307 // This is a system server method name.
4308 optional string service_method_name = 3;
4309 // Total number of API calls.
4310 optional int64 call_count = 4;
4311 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4312 optional bool screen_interactive = 13;
4313 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4314 // call_count will be equal to recorded_call_count.
4315 //
4316 // If recorded_call_count is different than call_count, it means data collection has been
4317 // sampled. All the fields below will be sampled in this case.
4318 optional int64 recorded_call_count = 12;
4319 // Number of exceptions thrown by the API.
4320 optional int64 recorded_exception_count = 5;
4321 // Total latency of all API calls.
4322 // Average can be computed using total_latency_micros / recorded_call_count.
4323 optional int64 recorded_total_latency_micros = 6;
4324 // Maximum latency of one API call.
4325 optional int64 recorded_max_latency_micros = 7;
4326 // Total CPU usage of all API calls.
4327 // Average can be computed using total_cpu_micros / recorded_call_count.
4328 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4329 optional int64 recorded_total_cpu_micros = 8;
4330 // Maximum CPU usage of one API call.
4331 optional int64 recorded_max_cpu_micros = 9;
4332 // Maximum parcel reply size of one API call.
4333 optional int64 recorded_max_reply_size_bytes = 10;
4334 // Maximum parcel request size of one API call.
4335 optional int64 recorded_max_request_size_bytes = 11;
4336}
4337
4338/**
4339 * Pulls the statistics of exceptions during calls to Binder.
4340 *
4341 * Binder stats are cumulative from boot unless somebody reset the data using
4342 * > adb shell dumpsys binder_calls_stats --reset
4343 */
4344message BinderCallsExceptions {
4345 // Exception class name, e.g. java.lang.IllegalArgumentException.
4346 //
4347 // This is an exception class name thrown by the system server.
4348 optional string exception_class_name = 1;
4349 // Total number of exceptions.
4350 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004351}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004352
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004353/**
4354 * Pulls the statistics of message dispatching on HandlerThreads.
4355 *
4356 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4357 * config on the device.
4358 *
4359 * Next tag: 11
4360 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004361message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004362 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004363 optional int32 uid = 1 [(is_uid) = true];
4364
4365 // Fully qualified class name of the handler target class.
4366 //
4367 // This field does not contain PII. This is a system server class name.
4368 optional string handler_class_name = 2;
4369
4370 // The name of the thread that runs the Looper.
4371 //
4372 // This field does not contain PII. This is a system server thread name.
4373 optional string looper_thread_name = 3;
4374
4375 // The name of the dispatched message.
4376 //
4377 // This field does not contain PII. This is a system server constant or class
4378 // name.
4379 optional string message_name = 4;
4380
4381 // Total number of successfully dispatched messages.
4382 optional int64 message_count = 5;
4383
4384 // Total number of messages that failed dispatching.
4385 optional int64 exception_count = 6;
4386
4387 // Total number of processed messages we have data recorded for. If we
4388 // collected data for all the messages, message_count will be equal to
4389 // recorded_message_count.
4390 //
4391 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004392 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004393 optional int64 recorded_message_count = 7;
4394
4395 // Total latency of all processed messages.
4396 // Average can be computed using recorded_total_latency_micros /
4397 // recorded_message_count.
4398 optional int64 recorded_total_latency_micros = 8;
4399
4400 // Total CPU usage of all processed message.
4401 // Average can be computed using recorded_total_cpu_micros /
4402 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004403 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004404 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004405
4406 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4407 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004408
4409 // Max recorded CPU usage of all processed messages.
4410 optional int64 recorded_max_cpu_micros = 11;
4411
4412 // Max recorded latency of all processed messages.
4413 optional int64 recorded_max_latency_micros = 12;
4414
4415 // Total number of messages we tracked the dispatching delay for. If we
4416 // collected data for all the messages, message_count will be equal to
4417 // recorded_delay_message_count.
4418 //
4419 // If recorded_delay_message_count is different than message_count, it means data
4420 // collection has been sampled or/and not all messages specified the target dispatch time.
4421 // The fields below will be sampled in this case.
4422 optional int64 recorded_delay_message_count = 13;
4423
4424 // Total dispatching delay of all processed messages.
4425 // Calculated as a difference between the target dispatching time (Message.when)
4426 // and the actual dispatching time.
4427 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4428 optional int64 recorded_total_delay_millis = 14;
4429
4430 // Max dispatching delay of all processed messages.
4431 // Calculated as a difference between the target dispatching time (Message.when)
4432 // and the actual dispatching time.
4433 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004434}
Tej Singh86dc9db2018-09-06 00:39:57 +00004435
4436/**
4437 * Pulls disk information, such as write speed and latency.
4438 */
4439message DiskStats {
4440 // Time taken to open, write 512B to, and close a file.
4441 // -1 if error performing the check.
4442 optional int64 data_write_latency_millis = 1;
4443
4444 optional bool file_based_encryption = 2;
4445
4446 // Recent disk write speed in kB/s.
4447 // -1 if error querying storageed.
4448 // 0 if data is unavailable.
4449 optional int32 recent_disk_write_speed = 3;
4450}
4451
4452
4453/**
4454 * Free and total bytes of the Data, Cache, and System partition.
4455 */
4456message DirectoryUsage {
4457 enum Directory {
4458 UNKNOWN = 0;
4459 DATA = 1;
4460 CACHE = 2;
4461 SYSTEM = 3;
4462 }
4463 optional Directory directory = 1;
4464 optional int64 free_bytes = 2;
4465 optional int64 total_bytes = 3;
4466}
4467
4468
4469/**
4470 * Size of an application: apk size, data size, and cache size.
4471 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4472 * Information is only reported for apps with the primary user (user 0).
4473 * Sizes are aggregated by package name.
4474 */
4475message AppSize {
4476 // Including uids will involve modifying diskstats logic.
4477 optional string package_name = 1;
4478 // App size in bytes. -1 if unavailable.
4479 optional int64 app_size_bytes = 2;
4480 // App data size in bytes. -1 if unavailable.
4481 optional int64 app_data_size_bytes = 3;
4482 // App cache size in bytes. -1 if unavailable.
4483 optional int64 app_cache_size_bytes = 4;
4484 // Time that the cache file was produced.
4485 // Uses System.currentTimeMillis(), which is wall clock time.
4486 optional int64 cache_time_millis = 5;
4487}
4488
4489
4490/**
4491 * Size of a particular category. Eg: photos, videos.
4492 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4493 */
4494message CategorySize {
4495 enum Category {
4496 UNKNOWN = 0;
4497 APP_SIZE = 1;
4498 APP_DATA_SIZE = 2;
4499 APP_CACHE_SIZE = 3;
4500 PHOTOS = 4;
4501 VIDEOS = 5;
4502 AUDIO = 6;
4503 DOWNLOADS = 7;
4504 SYSTEM = 8;
4505 OTHER = 9;
4506 }
4507 optional Category category = 1;
4508 // Category size in bytes.
4509 optional int64 size_bytes = 2;
4510 // Time that the cache file was produced.
4511 // Uses System.currentTimeMillis(), which is wall clock time.
4512 optional int64 cache_time_millis = 3;
4513}
Tej Singhd6d6d772018-09-05 17:41:25 -07004514
4515/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004516 * Pulls per uid I/O stats. The stats are cumulative since boot.
4517 *
4518 * Read/write bytes are I/O events from a storage device
4519 * Read/write chars are data requested by read/write syscalls, and can be
4520 * satisfied by caching.
4521 *
4522 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4523 */
4524message DiskIo {
4525 optional int32 uid = 1 [(is_uid) = true];
4526 optional int64 fg_chars_read = 2;
4527 optional int64 fg_chars_write = 3;
4528 optional int64 fg_bytes_read = 4;
4529 optional int64 fg_bytes_write = 5;
4530 optional int64 bg_chars_read = 6;
4531 optional int64 bg_chars_write = 7;
4532 optional int64 bg_bytes_read = 8;
4533 optional int64 bg_bytes_write = 9;
4534 optional int64 fg_fsync = 10;
4535 optional int64 bg_fsync= 11;
4536}
4537
4538
4539/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004540 * Pulls the number of fingerprints for each user.
4541 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004542 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004543 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004544message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004545 // The associated user. Eg: 0 for owners, 10+ for others.
4546 // Defined in android/os/UserHandle.java
4547 optional int32 user = 1;
4548 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004549 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004550}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004551
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004552/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004553 * Pulls the number of faces for each user.
4554 *
4555 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4556 */
4557message NumFacesEnrolled {
4558 // The associated user. Eg: 0 for owners, 10+ for others.
4559 // Defined in android/os/UserHandle.java
4560 optional int32 user = 1;
4561 // Number of faces registered to that user.
4562 optional int32 num_faces_enrolled = 2;
4563}
4564/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004565 * A mapping of role holder -> role
4566 */
4567message RoleHolder {
4568 // uid of the role holder
4569 optional int32 uid = 1 [(is_uid) = true];
4570
4571 // package name of the role holder
4572 optional string package_name = 2;
4573
4574 // the role held
4575 optional string role = 3;
4576}
4577
Yangsteraf9aee72018-10-12 09:26:16 -07004578message AggStats {
4579 optional int64 min = 1;
4580
4581 optional int64 average = 2;
4582
4583 optional int64 max = 3;
4584}
4585
4586message ProcessStatsStateProto {
4587 optional android.service.procstats.ScreenState screen_state = 1;
4588
4589 optional android.service.procstats.MemoryState memory_state = 2;
4590
4591 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4592 // and not frameworks/base/core/java/android/app/ActivityManager.java
4593 optional android.service.procstats.ProcessState process_state = 3;
4594
4595 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004596 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004597
4598 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004599 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004600
4601 // # of samples taken
4602 optional int32 sample_size = 5;
4603
4604 // PSS is memory reserved for this process
4605 optional AggStats pss = 6;
4606
4607 // USS is memory shared between processes, divided evenly for accounting
4608 optional AggStats uss = 7;
4609
4610 // RSS is memory resident for this process
4611 optional AggStats rss = 8;
4612}
4613
4614// Next Tag: 7
4615message ProcessStatsProto {
4616 // Name of process.
4617 optional string process = 1;
4618
4619 // Uid of the process.
4620 optional int32 uid = 2;
4621
4622 // Information about how often kills occurred
4623 message Kill {
4624 // Count of excessive CPU kills
4625 optional int32 cpu = 1;
4626
4627 // Count of kills when cached
4628 optional int32 cached = 2;
4629
4630 // PSS stats during cached kill
4631 optional AggStats cached_pss = 3;
4632 }
4633 optional Kill kill = 3;
4634
4635 // Time and memory spent in various states.
4636 repeated ProcessStatsStateProto states = 5;
4637
4638 // Total time process has been running... screen_state, memory_state, and process_state
4639 // will not be set.
4640 optional ProcessStatsStateProto total_running_state = 6;
4641}
4642
4643message PackageServiceOperationStatsProto {
4644 // Operate enum: Started, Foreground, Bound, Executing
4645 optional android.service.procstats.ServiceOperationState operation = 1;
4646
4647 // Number of times the service was in this operation.
4648 optional int32 count = 2;
4649
4650 // Information about a state the service can be in.
4651 message StateStats {
4652 // Screen state enum.
4653 optional android.service.procstats.ScreenState screen_state = 1;
4654 // Memory state enum.
4655 optional android.service.procstats.MemoryState memory_state = 2;
4656
4657 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004658 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004659 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004660 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004661 }
4662 repeated StateStats state_stats = 3;
4663}
4664
4665message PackageServiceStatsProto {
4666 // Name of service component.
4667 optional string service_name = 1;
4668
4669 // The operation stats.
4670 // The package_name, package_uid, package_version, service_name will not be set to save space.
4671 repeated PackageServiceOperationStatsProto operation_stats = 2;
4672}
4673
4674message PackageAssociationSourceProcessStatsProto {
4675 // Uid of the process.
4676 optional int32 process_uid = 1;
4677 // Process name.
4678 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004679 // Package name.
4680 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004681 // Total count of the times this association appeared.
4682 optional int32 total_count = 3;
4683
4684 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004685 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004686
4687 // Total count of the times this association became actively impacting its target process.
4688 optional int32 active_count = 5;
4689
4690 // Information on one source in this association.
4691 message StateStats {
4692 // Process state enum.
4693 optional android.service.procstats.ProcessState process_state = 1;
4694 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004695 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004696 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004697 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004698 }
4699 repeated StateStats active_state_stats = 6;
4700}
4701
4702message PackageAssociationProcessStatsProto {
4703 // Name of the target component.
4704 optional string component_name = 1;
4705 // Information on one source in this association.
4706 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4707}
4708
4709
4710message ProcessStatsPackageProto {
4711 // Name of package.
4712 optional string package = 1;
4713
4714 // Uid of the package.
4715 optional int32 uid = 2;
4716
4717 // Version of the package.
4718 optional int64 version = 3;
4719
4720 // Stats for each process running with the package loaded in to it.
4721 repeated ProcessStatsProto process_stats = 4;
4722
4723 // Stats for each of the package's services.
4724 repeated PackageServiceStatsProto service_stats = 5;
4725
4726 // Stats for each association with the package.
4727 repeated PackageAssociationProcessStatsProto association_stats = 6;
4728}
4729
4730message ProcessStatsSectionProto {
4731 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004732 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004733
4734 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004735 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004736
4737 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004738 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004739
4740 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004741 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004742
4743 // System runtime library. e.g. "libdvm.so", "libart.so".
4744 optional string runtime = 5;
4745
4746 // whether kernel reports swapped pss.
4747 optional bool has_swapped_pss = 6;
4748
4749 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4750 enum Status {
4751 STATUS_UNKNOWN = 0;
4752 STATUS_COMPLETE = 1;
4753 STATUS_PARTIAL = 2;
4754 STATUS_SHUTDOWN = 3;
4755 STATUS_SYSPROPS = 4;
4756 }
4757 repeated Status status = 7;
4758
Chenjie Yub2ecc792019-01-17 10:27:26 -08004759 // Number of pages available of various types and sizes, representation fragmentation.
4760 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4761
Yangsteraf9aee72018-10-12 09:26:16 -07004762 // Stats for each process.
4763 repeated ProcessStatsProto process_stats = 8;
4764
4765 // Stats for each package.
4766 repeated ProcessStatsPackageProto package_stats = 9;
4767}
4768
Chenjie Yub2ecc792019-01-17 10:27:26 -08004769message ProcessStatsAvailablePagesProto {
4770 // Node these pages are in (as per /proc/pagetypeinfo)
4771 optional int32 node = 1;
4772
4773 // Zone these pages are in (as per /proc/pagetypeinfo)
4774 optional string zone = 2;
4775
4776 // Label for the type of these pages (as per /proc/pagetypeinfo)
4777 optional string label = 3;
4778
4779 // Distribution of number of pages available by order size. First entry in array is
4780 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4781 repeated int32 pages_per_order = 4;
4782}
4783
Chenjie Yu12e5e672018-09-14 15:54:59 -07004784/**
4785 * Pulled from ProcessStatsService.java
4786 */
4787message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004788 optional ProcessStatsSectionProto proc_stats_section = 1;
4789}
4790
Chenjie Yuf910b7802019-01-11 16:08:20 -08004791/**
4792 * Pulled from ProcessStatsService.java
4793 */
4794message ProcStatsPkgProc {
4795 optional ProcessStatsSectionProto proc_stats_section = 1;
4796}
4797
Yangsteraf9aee72018-10-12 09:26:16 -07004798message PowerProfileProto {
4799 optional double cpu_suspend = 1;
4800
4801 optional double cpu_idle = 2;
4802
4803 optional double cpu_active = 3;
4804
4805 message CpuCluster {
4806 optional int32 id = 1;
4807 optional double cluster_power = 2;
4808 optional int32 cores = 3;
4809 repeated int64 speed = 4;
4810 repeated double core_power = 5;
4811 }
4812
4813 repeated CpuCluster cpu_cluster = 40;
4814
4815 optional double wifi_scan = 4;
4816
4817 optional double wifi_on = 5;
4818
4819 optional double wifi_active = 6;
4820
4821 optional double wifi_controller_idle = 7;
4822
4823 optional double wifi_controller_rx = 8;
4824
4825 optional double wifi_controller_tx = 9;
4826
4827 repeated double wifi_controller_tx_levels = 10;
4828
4829 optional double wifi_controller_operating_voltage = 11;
4830
4831 optional double bluetooth_controller_idle = 12;
4832
4833 optional double bluetooth_controller_rx = 13;
4834
4835 optional double bluetooth_controller_tx = 14;
4836
4837 optional double bluetooth_controller_operating_voltage = 15;
4838
4839 optional double modem_controller_sleep = 16;
4840
4841 optional double modem_controller_idle = 17;
4842
4843 optional double modem_controller_rx = 18;
4844
4845 repeated double modem_controller_tx = 19;
4846
4847 optional double modem_controller_operating_voltage = 20;
4848
4849 optional double gps_on = 21;
4850
4851 repeated double gps_signal_quality_based = 22;
4852
4853 optional double gps_operating_voltage = 23;
4854
4855 optional double bluetooth_on = 24;
4856
4857 optional double bluetooth_active = 25;
4858
4859 optional double bluetooth_at_cmd = 26;
4860
4861 optional double ambient_display = 27;
4862
4863 optional double screen_on = 28;
4864
4865 optional double radio_on = 29;
4866
4867 optional double radio_scanning = 30;
4868
4869 optional double radio_active = 31;
4870
4871 optional double screen_full = 32;
4872
4873 optional double audio = 33;
4874
4875 optional double video = 34;
4876
4877 optional double flashlight = 35;
4878
4879 optional double memory = 36;
4880
4881 optional double camera = 37;
4882
4883 optional double wifi_batched_scan = 38;
4884
4885 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004886}
Chenjie Yuab530202018-09-26 12:39:20 -07004887
4888/**
4889 * power_profile.xml and other constants for power model calculations.
4890 * Pulled from PowerProfile.java
4891 */
4892message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004893 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004894}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004895
4896/**
arangelovd5db50e2018-10-12 20:24:39 +01004897 * Logs when a user restriction was added or removed.
4898 *
4899 * Logged from:
4900 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4901 */
4902message UserRestrictionChanged {
4903 // The raw string of the user restriction as defined in UserManager.
4904 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4905 optional string restriction = 1;
4906 // Whether the restriction is enabled or disabled.
4907 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004908}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004909
4910/**
4911 * Pulls process user time and system time. Puller takes a snapshot of all pids
4912 * in the system and returns cpu stats for those that are working at the time.
4913 * Dead pids will be dropped. Kernel processes are excluded.
4914 * Min cool-down is 5 sec.
4915 */
4916message ProcessCpuTime {
4917 optional int32 uid = 1 [(is_uid) = true];
4918
4919 optional string process_name = 2;
4920 // Process cpu time in user space, cumulative from boot/process start
4921 optional int64 user_time_millis = 3;
4922 // Process cpu time in system space, cumulative from boot/process start
4923 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004924}
Misha Wagner5a51e002018-10-03 15:04:09 +01004925
4926/**
4927 * Pulls the CPU usage for each thread.
4928 *
4929 * Read from /proc/$PID/task/$TID/time_in_state files.
4930 *
4931 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4932 * time_in_state files not being present on some phones, have not been addressed. These should be
4933 * considered before a public release.
4934 */
4935message CpuTimePerThreadFreq {
4936 // UID that owns the process.
4937 optional int32 uid = 1 [(is_uid) = true];
4938 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004939 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004940 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004941 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004942 // Name of the process taken from `/proc/$PID/cmdline`.
4943 optional string process_name = 4;
4944 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4945 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004946
4947 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4948 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4949 // frequencies are given here as the alternative is sending eight separate atoms. This method
4950 // significantly reduces the amount of data created
4951 optional int32 frequency1_khz = 6;
4952 optional int32 time1_millis = 7;
4953 optional int32 frequency2_khz = 8;
4954 optional int32 time2_millis = 9;
4955 optional int32 frequency3_khz = 10;
4956 optional int32 time3_millis = 11;
4957 optional int32 frequency4_khz = 12;
4958 optional int32 time4_millis = 13;
4959 optional int32 frequency5_khz = 14;
4960 optional int32 time5_millis = 15;
4961 optional int32 frequency6_khz = 16;
4962 optional int32 time6_millis = 17;
4963 optional int32 frequency7_khz = 18;
4964 optional int32 time7_millis = 19;
4965 optional int32 frequency8_khz = 20;
4966 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004967}
Bookatz75ee6042018-11-09 12:27:37 -08004968
4969/**
Bookatz366a4432018-11-20 09:42:33 -08004970 * Pulls information about the device's build.
4971 */
4972message BuildInformation {
4973 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4974 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4975 optional string fingerprint = 1;
4976
4977 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4978 optional string brand = 2;
4979
4980 // Build.PRODUCT. The name of the overall product.
4981 optional string product = 3;
4982
4983 // Build.DEVICE. The name of the industrial design.
4984 optional string device = 4;
4985
4986 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4987 optional string version_release = 5;
4988
4989 // Build.ID. E.g. a label like "M4-rc20".
4990 optional string id = 6;
4991
4992 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4993 // represent this build.
4994 optional string version_incremental = 7;
4995
4996 // Build.TYPE. The type of build, like "user" or "eng".
4997 optional string type = 8;
4998
4999 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5000 optional string tags = 9;
5001}
5002
5003/**
Adam He420947c2019-01-23 15:59:09 -08005004 * Logs information about mismatched caller for content capture.
5005 *
5006 * Logged from:
5007 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5008 */
5009message ContentCaptureCallerMismatchReported {
5010 optional string intended_package = 1;
5011 optional string calling_package = 2;
5012}
5013
5014/**
5015 * Logs information about content capture service events.
5016 *
5017 * Logged from:
5018 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5019 */
5020message ContentCaptureServiceEvents {
5021 // The type of event.
5022 enum Event {
5023 UNKNOWN = 0;
5024 ON_CONNECTED = 1;
5025 ON_DISCONNECTED = 2;
5026 SET_WHITELIST = 3;
5027 SET_DISABLED = 4;
5028 ON_USER_DATA_REMOVED = 5;
5029 }
5030 optional Event event = 1;
5031 // component/package of content capture service.
5032 optional string service_info = 2;
5033 // component/package of target.
5034 // it's a concatenated list of component/package for SET_WHITELIST event
5035 // separated by " ".
5036 optional string target_info = 3;
5037}
5038
5039/**
5040 * Logs information about content capture session events.
5041 *
5042 * Logged from:
5043 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5044 */
5045message ContentCaptureSessionEvents {
5046 // The type of event.
5047 enum Event {
5048 UNKNOWN = 0;
5049 ON_SESSION_STARTED = 1;
5050 ON_SESSION_FINISHED = 2;
5051 SESSION_NOT_CREATED = 3;
5052 }
5053 optional int32 session_id = 1;
5054 optional Event event = 2;
5055 // (n/a on session finished)
5056 optional int32 state_flags = 3;
5057 // component/package of content capture service.
5058 optional string service_info = 4;
5059 // component/package of app.
5060 // (n/a on session finished)
5061 optional string app_info = 5;
5062 optional bool is_child_session = 6;
5063}
5064
5065/**
5066 * Logs information about session being flushed.
5067 *
5068 * Logged from:
5069 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5070 */
5071message ContentCaptureFlushed {
5072 optional int32 session_id = 1;
5073 // component/package of content capture service.
5074 optional string service_info = 2;
5075 // component/package of app.
5076 optional string app_info = 3;
5077 // session start/finish events
5078 optional int32 child_session_started = 4;
5079 optional int32 child_session_finished = 5;
5080 // count of view events.
5081 optional int32 view_appeared_count = 6;
5082 optional int32 view_disappeared_count = 7;
5083 optional int32 view_text_changed_count = 8;
5084
5085 // Flush stats.
5086 optional int32 max_events = 9;
5087 optional int32 idle_flush_freq = 10;
5088 optional int32 text_flush_freq = 11;
5089 optional int32 flush_reason = 12;
5090}
5091
5092/**
Bookatz75ee6042018-11-09 12:27:37 -08005093 * Pulls on-device BatteryStats power use calculations for the overall device.
5094 */
5095message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005096 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5097 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5098 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5099 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08005100}
5101
5102/**
5103 * Pulls on-device BatteryStats power use calculations broken down by uid.
5104 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5105 * that is attributed to non-uid items. They must all be included to get the total power use.
5106 */
5107message DeviceCalculatedPowerBlameUid {
5108 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5109 optional int32 uid = 1 [(is_uid) = true];
5110
Bookatz3dbc13a2018-12-21 12:16:51 -08005111 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5112 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5113 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08005114}
5115
5116/**
5117 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5118 * drain type.
5119 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5120 * is attributed uids. They must all be included to get the total power use.
5121 */
5122message DeviceCalculatedPowerBlameOther {
5123 // The type of item whose power use is being reported.
5124 enum DrainType {
5125 AMBIENT_DISPLAY = 0;
5126 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5127 BLUETOOTH = 2;
5128 CAMERA = 3;
5129 // Cell-standby
5130 CELL = 4;
5131 FLASHLIGHT = 5;
5132 IDLE = 6;
5133 MEMORY = 7;
5134 // Amount that total computed drain exceeded the drain estimated using the
5135 // battery level changes and capacity.
5136 OVERCOUNTED = 8;
5137 PHONE = 9;
5138 SCREEN = 10;
5139 // Amount that total computed drain was below the drain estimated using the
5140 // battery level changes and capacity.
5141 UNACCOUNTED = 11;
5142 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5143 WIFI = 13;
5144 }
5145 optional DrainType drain_type = 1;
5146
Bookatz3dbc13a2018-12-21 12:16:51 -08005147 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5148 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5149 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005150}
arangelov4e994062018-11-13 16:12:38 +00005151
5152/**
5153 * Logs device policy features.
5154 *
5155 * Logged from:
5156 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5157 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5158 */
5159message DevicePolicyEvent {
5160 // The event id - unique for each event.
5161 optional android.stats.devicepolicy.EventId event_id = 1;
5162 // The admin package name.
5163 optional string admin_package_name = 2;
5164 // A generic integer parameter.
5165 optional int32 integer_value = 3;
5166 // A generic boolean parameter.
5167 optional bool boolean_value = 4;
5168 // A parameter specifying a time period in milliseconds.
5169 optional uint64 time_period_millis = 5;
5170 // A parameter specifying a list of package names, bundle extras or string parameters.
5171 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5172}
shawnlinea5b66b2018-11-13 15:05:29 +08005173
5174/**
5175 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5176 *
5177 * Logged from:
5178 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5179 */
5180message DocsUILaunchReported {
5181 optional android.stats.docsui.LaunchAction launch_action = 1;
5182 optional bool has_initial_uri = 2;
5183 optional android.stats.docsui.MimeType mime_type = 3;
5184 optional android.stats.docsui.Root initial_root = 4;
5185}
5186
5187/**
5188 * Logs root/app visited event in file managers/picker. Call this when the user
5189 * taps on root/app in hamburger menu.
5190 *
5191 * Logged from:
5192 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5193 */
5194message DocsUIRootVisitedReported {
5195 optional android.stats.docsui.ContextScope scope = 1;
5196 optional android.stats.docsui.Root root = 2;
5197}
5198
5199/**
5200 * Logs file operation stats. Call this when a file operation has completed.
5201 *
5202 * Logged from:
5203 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5204 */
5205message DocsUIFileOperationReported {
5206 optional android.stats.docsui.Provider provider = 1;
5207 optional android.stats.docsui.FileOperation file_op = 2;
5208}
5209
5210/**
5211 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5212 * mode.
5213 *
5214 * Logged from:
5215 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5216 */
5217message DocsUIFileOperationCopyMoveModeReported {
5218 optional android.stats.docsui.FileOperation file_op = 1;
5219 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5220}
5221
5222
5223/**
5224 * Logs file sub operation stats. Call this when a file operation has failed.
5225 *
5226 * Logged from:
5227 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5228 */
5229message DocsUIFileOperationFailureReported {
5230 optional android.stats.docsui.Authority authority = 1;
5231 optional android.stats.docsui.SubFileOperation sub_op = 2;
5232}
5233
5234/**
5235* Logs the cancellation of a file operation. Call this when a job is canceled
5236*
5237* Logged from:
5238* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5239*/
5240message DocsUIFileOperationCanceledReported {
5241 optional android.stats.docsui.FileOperation file_op = 1;
5242}
5243
5244/**
5245 * Logs startup time in milliseconds.
5246 *
5247 * Logged from:
5248 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5249 */
5250message DocsUIStartupMsReported {
5251 optional int32 startup_millis = 1;
5252}
5253
5254/**
5255 * Logs the action that was started by user.
5256 *
5257 * Logged from:
5258 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5259 */
5260message DocsUIUserActionReported {
5261 optional android.stats.docsui.UserAction action = 1;
5262}
5263
5264/**
5265 * Logs the invalid type when invalid scoped access is requested.
5266 *
5267 * Logged from:
5268 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5269 */
5270message DocsUIInvalidScopedAccessRequestReported {
5271 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005272}
Ben Murdochbab399f2018-12-06 11:01:38 +00005273
5274/**
shawnlina75e82d2019-01-07 10:31:12 +08005275 * Logs the package name that launches docsui picker mode.
5276 *
5277 * Logged from:
5278 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5279 */
5280message DocsUIPickerLaunchedFromReported {
5281 optional string package_name = 1;
5282}
5283
5284/**
5285 * Logs the search type.
5286 *
5287 * Logged from:
5288 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5289 */
5290message DocsUISearchTypeReported {
5291 optional android.stats.docsui.SearchType search_type = 1;
5292}
5293
5294/**
5295 * Logs the search mode.
5296 *
5297 * Logged from:
5298 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5299 */
5300message DocsUISearchModeReported {
5301 optional android.stats.docsui.SearchMode search_mode = 1;
5302}
5303
5304/**
5305 * Logs the pick result information.
5306 *
5307 * Logged from:
5308 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5309 */
5310message DocsUIPickResultReported {
5311 optional int32 total_action_count = 1;
5312 optional int64 duration_millis = 2;
5313 optional int32 file_count= 3;
5314 optional bool is_searching = 4;
5315 optional android.stats.docsui.Root picked_from = 5;
5316 optional android.stats.docsui.MimeType mime_type = 6;
5317 optional int32 repeatedly_pick_times = 7;
5318}
5319
5320/**
Ben Murdochbab399f2018-12-06 11:01:38 +00005321 * Logs when an app's memory is compacted.
5322 *
5323 * Logged from:
5324 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5325 */
5326message AppCompacted {
5327 // The pid of the process being compacted.
5328 optional int32 pid = 1;
5329
5330 // The name of the process being compacted.
5331 optional string process_name = 2;
5332
5333 // The type of compaction.
5334 enum Action {
5335 UNKNOWN = 0;
5336 SOME = 1;
5337 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005338 PERSISTENT = 3;
5339 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00005340 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005341 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00005342
5343 // Total RSS in kilobytes consumed by the process prior to compaction.
5344 optional int64 before_rss_total_kilobytes = 4;
5345
5346 // File RSS in kilobytes consumed by the process prior to compaction.
5347 optional int64 before_rss_file_kilobytes = 5;
5348
5349 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5350 optional int64 before_rss_anon_kilobytes = 6;
5351
5352 // Swap in kilobytes consumed by the process prior to compaction.
5353 optional int64 before_swap_kilobytes = 7;
5354
5355 // Total RSS in kilobytes consumed by the process after compaction.
5356 optional int64 after_rss_total_kilobytes = 8;
5357
5358 // File RSS in kilobytes consumed by the process after compaction.
5359 optional int64 after_rss_file_kilobytes = 9;
5360
5361 // Anonymous RSS in kilobytes consumed by the process after compaction.
5362 optional int64 after_rss_anon_kilobytes = 10;
5363
5364 // Swap in kilobytes consumed by the process after compaction.
5365 optional int64 after_swap_kilobytes = 11;
5366
5367 // The time taken to perform compaction in milliseconds.
5368 optional int64 time_to_compact_millis = 12;
5369
5370 // The last compaction action performed for this app.
5371 optional Action last_action = 13;
5372
Ben Murdoch01720b82018-12-19 18:03:44 +00005373 // The last time that compaction was attempted on this process in milliseconds
5374 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5375 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00005376
Ben Murdoch885c21b2019-03-15 18:02:04 +00005377 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005378 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00005379
5380 // The process state at the time of compaction.
5381 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005382
5383 // Free ZRAM in kilobytes before compaction.
5384 optional int64 before_zram_free_kilobytes = 17;
5385
5386 // Free ZRAM in kilobytes after compaction.
5387 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00005388}
lifr157fc552018-12-12 16:38:04 +08005389
5390/**
lifrb6b90b62019-03-29 00:40:17 +08005391 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5392 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5393 *
lifr1f74b052019-04-16 22:16:30 +08005394 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5395 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5396 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5397 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005398 */
5399message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08005400 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005401
lifr1f74b052019-04-16 22:16:30 +08005402 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005403
5404 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005405 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005406
lifr1f74b052019-04-16 22:16:30 +08005407 // Only valid for event_type = EVENT_GETADDRINFO.
5408 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005409
lifr1f74b052019-04-16 22:16:30 +08005410 // Flags passed to android_res_nsend() defined in multinetwork.h
5411 // Only valid for event_type = EVENT_RESNSEND.
5412 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005413
lifrad9becc2019-05-20 11:04:41 +08005414 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005415
5416 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08005417 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005418
5419 // Additional pass-through fields opaque to statsd.
5420 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08005421 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08005422
5423 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
5424 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08005425}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005426
5427/**
5428 * Logs when a data stall event occurs.
5429 *
5430 * Log from:
5431 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5432 */
5433message DataStallEvent {
5434 // Data stall evaluation type.
5435 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5436 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5437 optional int32 evaluation_type = 1;
5438 // See definition in data_stall_event.proto.
5439 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5440 // See definition in data_stall_event.proto.
5441 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5442 // See definition in data_stall_event.proto.
5443 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5444 // See definition in data_stall_event.proto.
5445 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5446 // See definition in data_stall_event.proto.
5447 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5448}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005449
5450/*
5451 * Logs when RescueParty resets some set of experiment flags.
5452 *
5453 * Logged from:
5454 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5455 */
5456message RescuePartyResetReported {
5457 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5458 optional int32 rescue_level = 1;
5459}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005460
5461/**
5462 * Logs when signed config is received from an APK, and if that config was applied successfully.
5463 * Logged from:
5464 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5465 */
5466message SignedConfigReported {
5467 enum Type {
5468 UNKNOWN_TYPE = 0;
5469 GLOBAL_SETTINGS = 1;
5470 }
5471 optional Type type = 1;
5472
5473 // The final status of the signed config received.
5474 enum Status {
5475 UNKNOWN_STATUS = 0;
5476 APPLIED = 1;
5477 BASE64_FAILURE_CONFIG = 2;
5478 BASE64_FAILURE_SIGNATURE = 3;
5479 SECURITY_EXCEPTION = 4;
5480 INVALID_CONFIG = 5;
5481 OLD_CONFIG = 6;
5482 SIGNATURE_CHECK_FAILED = 7;
5483 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005484 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005485 }
5486 optional Status status = 2;
5487
5488 // The version of the signed config processed.
5489 optional int32 version = 3;
5490
5491 // The package name that the config was extracted from.
5492 optional string from_package = 4;
5493
5494 enum Key {
5495 NO_KEY = 0;
5496 DEBUG = 1;
5497 PRODUCTION = 2;
5498 }
5499 // Which key was used to verify the config.
5500 optional Key verified_with = 5;
5501}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005502
5503/*
5504 * Logs GNSS Network-Initiated (NI) location events.
5505 *
5506 * Logged from:
5507 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5508 */
5509message GnssNiEventReported {
5510 // The type of GnssNiEvent.
5511 enum EventType {
5512 UNKNOWN = 0;
5513 NI_REQUEST = 1;
5514 NI_RESPONSE = 2;
5515 }
5516 optional EventType event_type = 1;
5517
5518 // An ID generated by HAL to associate NI notifications and UI responses.
5519 optional int32 notification_id = 2;
5520
5521 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005522 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005523
5524 // NI requires notification.
5525 optional bool need_notify = 4;
5526
5527 // NI requires verification.
5528 optional bool need_verify = 5;
5529
5530 // NI requires privacy override, no notification/minimal trace.
5531 optional bool privacy_override = 6;
5532
5533 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5534 // seconds.
5535 optional int32 timeout = 7;
5536
5537 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005538 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005539
5540 // String representing the requester of the network inititated location request.
5541 optional string requestor_id = 9;
5542
5543 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5544 // network initiated location request.
5545 optional string text = 10;
5546
5547 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005548 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005549
5550 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005551 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005552
5553 // True if SUPL ES is enabled.
5554 optional bool is_supl_es_enabled = 13;
5555
5556 // True if GNSS location is enabled.
5557 optional bool is_location_enabled = 14;
5558
5559 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005560 optional android.server.location.GnssUserResponseType user_response = 15;
5561}
5562
5563/**
5564 * Logs GNSS non-framework (NFW) location notification.
5565 *
5566 * Logged from:
5567 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5568 */
5569message GnssNfwNotificationReported {
5570 // Package name of the Android proxy application representing the non-framework entity that
5571 // requested location. Set to empty string if unknown.
5572 optional string proxy_app_package_name = 1;
5573
5574 // Protocol stack that initiated the non-framework location request.
5575 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5576
5577 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5578 // set to empty string. This field is opaque to the framework and used for logging purposes.
5579 optional string other_protocol_stack_name = 3;
5580
5581 // Source initiating/receiving the location information.
5582 optional android.server.location.NfwRequestor requestor = 4;
5583
5584 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5585 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5586 // and used for logging purposes.
5587 optional string requestor_id = 5;
5588
5589 // Indicates whether location information was provided for this request.
5590 optional android.server.location.NfwResponseType response_type = 6;
5591
5592 // True if the device is in user initiated emergency session.
5593 optional bool in_emergency_mode = 7;
5594
5595 // True if cached location is provided.
5596 optional bool is_cached_location = 8;
5597
5598 // True if proxy app permission mismatch between framework and GNSS HAL.
5599 optional bool is_permission_mismatched = 9;
5600}
5601
5602/**
5603 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5604 *
5605 * Logged from:
5606 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5607 */
5608message GnssConfigurationReported {
5609 // SUPL host name.
5610 optional string supl_host = 1;
5611
5612 // SUPL port number.
5613 optional int32 supl_port = 2;
5614
5615 // C2K host name.
5616 optional string c2k_host = 3;
5617
5618 // C2K port number.
5619 optional int32 c2k_port = 4;
5620
5621 // The SUPL version requested by Carrier.
5622 optional int32 supl_ver = 5;
5623
5624 // The SUPL mode.
5625 optional android.server.location.SuplMode supl_mode = 6;
5626
5627 // True if NI emergency SUPL restrictions is enabled.
5628 optional bool supl_es = 7;
5629
5630 // LTE Positioning Profile settings
5631 optional android.server.location.LppProfile lpp_profile = 8;
5632
5633 // Positioning protocol on A-Glonass system.
5634 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5635
5636 // True if emergency PDN is used. Otherwise, regular PDN is used.
5637 optional bool use_emergency_pdn_for_emergency_supl= 10;
5638
5639 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5640 optional android.server.location.GpsLock gps_lock = 11;
5641
5642 // Number of seconds to extend the emergency session duration post emergency call.
5643 optional int32 es_extension_sec = 12;
5644
5645 // The full list of package names of proxy Android applications representing the non-framework
5646 // location access entities (on/off the device) for which the framework user has granted
5647 // non-framework location access permission. The package names are concatenated in one string
5648 // with spaces as separators.
5649 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005650}
Jack Yu95b64f32018-12-13 18:26:11 +08005651
5652/**
5653 * Logs when a NFC device's error occurred.
5654 * Logged from:
5655 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5656 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5657 */
5658message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005659 enum Type {
5660 UNKNOWN = 0;
5661 CMD_TIMEOUT = 1;
5662 ERROR_NOTIFICATION = 2;
5663 AID_OVERFLOW = 3;
5664 }
5665 optional Type type = 1;
5666 // If it's nci cmd timeout, log the timeout command.
5667 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005668
Alex Salod7c3eef2019-01-25 14:43:27 -08005669 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005670}
5671
5672/**
5673 * Logs when a NFC device's state changed event
5674 * Logged from:
5675 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5676 */
5677message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005678 enum State {
5679 UNKNOWN = 0;
5680 OFF = 1;
5681 ON = 2;
5682 ON_LOCKED = 3; // Secure Nfc enabled.
5683 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5684 }
5685 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005686}
5687
5688/**
5689 * Logs when a NFC Beam Transaction occurred.
5690 * Logged from:
5691 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5692 */
5693message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005694 enum Operation {
5695 UNKNOWN = 0;
5696 SEND = 1;
5697 RECEIVE = 2;
5698 }
5699 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005700}
5701
5702/**
5703 * Logs when a NFC Card Emulation Transaction occurred.
5704 * Logged from:
5705 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5706 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5707 */
5708message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005709 enum Category {
5710 UNKNOWN = 0;
5711 HCE_PAYMENT = 1;
5712 HCE_OTHER = 2;
5713 OFFHOST = 3;
5714 }
5715 // Transaction belongs to HCE payment or HCE other category, or offhost.
5716 optional Category category = 1;
5717 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5718 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005719}
5720
5721/**
5722 * Logs when a NFC Tag event occurred.
5723 * Logged from:
5724 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5725 */
5726message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005727 enum Type {
5728 UNKNOWN = 0;
5729 URL = 1;
5730 BT_PAIRING = 2;
5731 PROVISION = 3;
5732 WIFI_CONNECT = 4;
5733 APP_LAUNCH = 5;
5734 OTHERS = 6;
5735 }
5736 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005737}
5738
5739/**
5740 * Logs when Hce transaction triggered
5741 * Logged from:
5742 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5743 */
5744message NfcHceTransactionOccurred {
5745 // The latency period(in microseconds) it took for the first HCE data
5746 // exchange.
5747 optional uint32 latency_micros = 1;
5748}
5749
5750/**
5751 * Logs when SecureElement state event changed
5752 * Logged from:
5753 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5754 */
5755message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005756 enum State {
5757 UNKNOWN = 0;
5758 INITIALIZED = 1;
5759 DISCONNECTED = 2;
5760 CONNECTED = 3;
5761 HALCRASH = 4;
5762 }
5763 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005764
Alex Salod7c3eef2019-01-25 14:43:27 -08005765 optional string state_change_reason = 2;
5766 // SIMx or eSEx.
5767 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005768}
5769
5770/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005771 * Information about a permission grant request
5772 */
5773message PermissionGrantRequestResultReported {
5774 // unique value identifying an API call. A API call might result in multiple of these atoms
5775 optional int64 request_id = 1;
5776
5777 // UID of package requesting the permission grant
5778 optional int32 requesting_uid = 2 [(is_uid) = true];
5779
5780 // Name of package requesting the permission grant
5781 optional string requesting_package_name = 3;
5782
5783 // The permission to be granted
5784 optional string permission_name = 4;
5785
5786 // If the permission was explicitly requested via the API or added by the system
5787 optional bool is_implicit = 5;
5788
5789 enum Result {
5790 UNDEFINED = 0;
5791 // permission request was ignored
5792 IGNORED = 1;
5793 // permission request was ignored because it was user fixed
5794 IGNORED_USER_FIXED = 2;
5795 // permission request was ignored because it was policy fixed
5796 IGNORED_POLICY_FIXED = 3;
5797 // permission was granted by user action
5798 USER_GRANTED = 4;
5799 // permission was automatically granted
5800 AUTO_GRANTED = 5;
5801 // permission was denied by user action
5802 USER_DENIED = 6;
5803 // permission was denied with prejudice by the user
5804 USER_DENIED_WITH_PREJUDICE = 7;
5805 // permission was automatically denied
5806 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07005807 // permission request was ignored because permission is restricted
5808 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01005809 // one time permission was granted by user action
5810 USER_GRANTED_ONE_TIME = 10;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005811 }
5812 // The result of the permission grant
5813 optional Result result = 6;
5814}
5815
5816/**
Jack Yu95b64f32018-12-13 18:26:11 +08005817 * Logs when Omapi API used
5818 * Logged from:
5819 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5820 */
5821message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005822 enum Operation {
5823 UNKNOWN = 0;
5824 OPEN_CHANNEL = 1;
5825 }
5826 optional Operation operation = 1;
5827 // SIMx or eSEx.
5828 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005829
Alex Salod7c3eef2019-01-25 14:43:27 -08005830 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005831}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005832
5833/**
Alex Saloa060aee2019-01-21 14:36:41 -08005834 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5835 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005836 * Logged from:
5837 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5838 */
5839message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005840 optional int64 dispatch_latency_millis = 1;
5841}
5842
5843/**
5844 * Logs AttentionManagerService attention check result.
5845 *
5846 * Logged from:
5847 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5848 */
5849message AttentionManagerServiceResultReported {
5850 // See core/java/android/service/attention/AttentionService.java
5851 enum AttentionCheckResult {
5852 UNKNOWN = 20;
5853 ATTENTION_SUCCESS_ABSENT = 0;
5854 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07005855 ATTENTION_FAILURE_UNKNOWN = 2;
5856 ATTENTION_FAILURE_CANCELLED = 3;
5857 ATTENTION_FAILURE_PREEMPTED = 4;
5858 ATTENTION_FAILURE_TIMED_OUT = 5;
5859 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08005860 }
5861 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005862}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005863
5864/**
5865 * Logs when an adb connection changes state.
5866 *
5867 * Logged from:
5868 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5869 */
5870message AdbConnectionChanged {
5871 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5872 // previously selected for this system.
5873 optional int64 last_connection_time_millis = 1;
5874
5875 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5876 // to reconnect via adb without user interaction.
5877 optional int64 auth_window_millis = 2;
5878
5879 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5880 optional android.debug.AdbConnectionStateEnum state = 3;
5881
5882 // True if the 'always allow' option was selected for this system.
5883 optional bool always_allow = 4;
5884}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005885
5886/*
5887 * Logs the reported speech DSP status.
5888 *
5889 * Logged from:
5890 * Vendor audio implementation.
5891 */
5892message SpeechDspStatReported {
5893 // The total Speech DSP uptime in milliseconds.
5894 optional int32 total_uptime_millis = 1;
5895 // The total Speech DSP downtime in milliseconds.
5896 optional int32 total_downtime_millis = 2;
5897 optional int32 total_crash_count = 3;
5898 optional int32 total_recover_count = 4;
5899}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005900
5901/**
5902 * Logs USB connector contaminant status.
5903 *
5904 * Logged from: USB Service.
5905 */
5906message UsbContaminantReported {
5907 optional string id = 1;
5908 optional android.service.usb.ContaminantPresenceStatus status = 2;
5909}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005910
5911/**
5912 * This atom is for debugging purpose.
5913 */
5914message DebugElapsedClock {
5915 // Monotically increasing value for each pull.
5916 optional int64 pull_count = 1;
5917 // Time from System.elapsedRealtime.
5918 optional int64 elapsed_clock_millis = 2;
5919 // Time from System.elapsedRealtime.
5920 optional int64 same_elapsed_clock_millis = 3;
5921 // Diff between current elapsed time and elapsed time from previous pull.
5922 optional int64 elapsed_clock_diff_millis = 4;
5923
5924 enum Type {
5925 TYPE_UNKNOWN = 0;
5926 ALWAYS_PRESENT = 1;
5927 PRESENT_ON_ODD_PULLS = 2;
5928 }
5929 // Type of behavior for the pulled data.
5930 optional Type type = 5;
5931}
5932
5933/**
5934 * This atom is for debugging purpose.
5935 */
5936message DebugFailingElapsedClock {
5937 // Monotically increasing value for each pull.
5938 optional int64 pull_count = 1;
5939 // Time from System.elapsedRealtime.
5940 optional int64 elapsed_clock_millis = 2;
5941 // Time from System.elapsedRealtime.
5942 optional int64 same_elapsed_clock_millis = 3;
5943 // Diff between current elapsed time and elapsed time from previous pull.
5944 optional int64 elapsed_clock_diff_millis = 4;
5945}
Steven Wuacef6bb2019-01-23 14:21:17 -05005946
5947/** Logs System UI bubbles event changed.
5948 *
5949 * Logged from:
5950 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5951 */
5952message BubbleUIChanged {
5953
5954 // The app package that is posting the bubble.
5955 optional string package_name = 1;
5956
5957 // The notification channel that is posting the bubble.
5958 optional string notification_channel = 2;
5959
5960 // The notification id associated with the posted bubble.
5961 optional int32 notification_id = 3;
5962
5963 // The position of the bubble within the bubble stack.
5964 optional int32 position = 4;
5965
5966 // The total number of bubbles within the bubble stack.
5967 optional int32 total_number = 5;
5968
5969 // User interactions with the bubble.
5970 enum Action {
5971 UNKNOWN = 0;
5972 POSTED = 1;
5973 UPDATED = 2;
5974 EXPANDED = 3;
5975 COLLAPSED = 4;
5976 DISMISSED = 5;
5977 STACK_DISMISSED = 6;
5978 STACK_MOVED = 7;
5979 HEADER_GO_TO_APP = 8;
5980 HEADER_GO_TO_SETTINGS = 9;
5981 PERMISSION_OPT_IN = 10;
5982 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005983 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005984 SWIPE_LEFT = 13;
5985 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005986 STACK_EXPANDED = 15;
Steven Wu1684f2d2019-04-11 14:10:42 -04005987 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05005988 }
5989 optional Action action = 6;
5990
5991 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5992 optional float normalized_x_position = 7;
5993 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04005994
5995 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
5996 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04005997
5998 // Whether the bubble is an on-going one.
5999 optional bool is_ongoing = 10;
6000
6001 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006002 // This is deprecated and the value should be ignored.
6003 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006004}
Kweku Adams8845d012018-12-11 20:06:45 -08006005
6006/**
Steven Wu552f63f2019-02-05 13:41:36 -05006007 * Logs System UI bubbles developer errors.
6008 *
6009 * Logged from:
6010 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6011 */
6012message BubbleDeveloperErrorReported {
6013
6014 // The app package that is posting the bubble.
6015 optional string package_name = 1;
6016
6017 // Bubble developer error type enums.
6018 enum Error {
6019 UNKNOWN = 0;
6020 ACTIVITY_INFO_MISSING = 1;
6021 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6022 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6023 }
6024 optional Error error = 2 [default = UNKNOWN];
6025}
6026
6027/**
Kweku Adams8845d012018-12-11 20:06:45 -08006028 * Logs that a constraint for a scheduled job has changed.
6029 *
6030 * Logged from:
6031 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6032 */
6033message ScheduledJobConstraintChanged {
6034 repeated AttributionNode attribution_node = 1;
6035
6036 // Name of the job.
6037 optional string job_name = 2;
6038
6039 optional com.android.server.job.ConstraintEnum constraint = 3;
6040
6041 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006042 UNKNOWN = 0;
6043 UNSATISFIED = 1;
6044 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006045 }
6046 optional State state = 4;
6047}
Alex Salod7c3eef2019-01-25 14:43:27 -08006048
6049/**
6050 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6051 * returns true.
6052 *
6053 * Logged from:
6054 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6055 */
6056message ScreenTimeoutExtensionReported {
6057 // Describes how many times in a row did the power manager reset the screen off timeout.
6058 optional uint32 consecutive_timeout_extended_count = 1;
6059}
Hui Yu885aca12019-01-10 17:11:34 -08006060
6061/*
6062* Logs number of milliseconds it takes to start a process.
6063* The definition of app process start time is from the app launch time to
6064* the time that Zygote finished forking the app process and loaded the
6065* application package's java classes.
6066
6067* This metric is different from AppStartOccurred which is for foreground
6068* activity only.
6069
6070* ProcessStartTime can report all processes (both foreground and background)
6071* start time.
6072*
6073* Logged from:
6074* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6075*/
6076message ProcessStartTime {
6077 // The uid of the ProcessRecord.
6078 optional int32 uid = 1 [(is_uid) = true];
6079
6080 // The process pid.
6081 optional int32 pid = 2;
6082
6083 // The process name.
6084 // Usually package name, "system" for system server.
6085 // Provided by ActivityManagerService.
6086 optional string process_name = 3;
6087
6088 enum StartType {
6089 UNKNOWN = 0;
6090 WARM = 1;
6091 HOT = 2;
6092 COLD = 3;
6093 }
6094
6095 // The start type.
6096 optional StartType type = 4;
6097
6098 // The elapsed realtime at the start of the process.
6099 optional int64 process_start_time_millis = 5;
6100
6101 // Number of milliseconds it takes to reach bind application.
6102 optional int32 bind_application_delay_millis = 6;
6103
6104 // Number of milliseconds it takes to finish start of the process.
6105 optional int32 process_start_delay_millis = 7;
6106
6107 // hostingType field in ProcessRecord, the component type such as "activity",
6108 // "service", "content provider", "broadcast" or other strings.
6109 optional string hosting_type = 8;
6110
6111 // hostingNameStr field in ProcessRecord. The component class name that runs
6112 // in this process.
6113 optional string hosting_name = 9;
6114}
6115
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006116/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006117 * Track Media Codec usage
6118 * Logged from:
6119 * frameworks/av/media/libstagefright/MediaCodec.cpp
6120 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6121 */
6122message MediametricsCodecReported {
6123 optional int64 timestamp_nanos = 1;
6124 optional string package_name = 2;
6125 optional int64 package_version_code = 3;
6126 optional int64 media_apex_version = 4;
6127
6128 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6129}
6130
6131/**
6132 * Track Media Extractor (pulling video/audio streams out of containers) usage
6133 * Logged from:
6134 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6135 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6136 */
6137message MediametricsExtractorReported {
6138 optional int64 timestamp_nanos = 1;
6139 optional string package_name = 2;
6140 optional int64 package_version_code = 3;
6141 optional int64 media_apex_version = 4;
6142
6143 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6144}
6145
6146/**
6147 * Track how we arbitrate between microphone/input requests.
6148 * Logged from
6149 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6150 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6151 */
6152message MediametricsAudiopolicyReported {
6153 optional int64 timestamp_nanos = 1;
6154 optional string package_name = 2;
6155 optional int64 package_version_code = 3;
6156 optional int64 media_apex_version = 4;
6157
6158 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6159}
6160
6161/**
6162 * Track how we arbitrate between microphone requests.
6163 * Logged from
6164 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6165 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6166 */
6167message MediametricsAudiorecordReported {
6168 optional int64 timestamp_nanos = 1;
6169 optional string package_name = 2;
6170 optional int64 package_version_code = 3;
6171 optional int64 media_apex_version = 4;
6172
6173 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6174}
6175
6176/**
6177 * Track how we arbitrate between microphone/input requests.
6178 * Logged from
6179 * frameworks/av/media/libnblog/ReportPerformance.cpp
6180 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6181 */
6182message MediametricsAudiothreadReported {
6183 optional int64 timestamp_nanos = 1;
6184 optional string package_name = 2;
6185 optional int64 package_version_code = 3;
6186 optional int64 media_apex_version = 4;
6187
6188 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6189}
6190
6191/**
6192 * Track how we arbitrate between microphone/input requests.
6193 * Logged from
6194 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6195 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6196 */
6197message MediametricsAudiotrackReported {
6198 optional int64 timestamp_nanos = 1;
6199 optional string package_name = 2;
6200 optional int64 package_version_code = 3;
6201 optional int64 media_apex_version = 4;
6202
6203 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6204}
6205
6206/**
6207 * Track information about DRM framework performance
6208 * Logged from
6209 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6210 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6211 */
6212message MediametricsMediadrmReported {
6213 optional int64 timestamp_nanos = 1;
6214 optional string package_name = 2;
6215 optional int64 package_version_code = 3;
6216 optional int64 media_apex_version = 4;
6217
6218 // vendor+description tell about which DRM plugin is in use on this device
6219 optional string vendor = 5;
6220 optional string description = 6;
6221 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6222 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6223}
6224
6225/**
6226 * Track information about the widevine DRM plugin performance
6227 * Logged from
6228 * vendor/widevine/libwvdrmengine/cdm/metrics
6229 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6230 */
6231message MediametricsDrmWidevineReported {
6232 optional int64 timestamp_nanos = 1;
6233 optional string package_name = 2;
6234 optional int64 package_version_code = 3;
6235 optional int64 media_apex_version = 4;
6236
6237 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6238}
6239
6240/**
6241 * Track information about recordings (e.g. camcorder)
6242 * Logged from
6243 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6244 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6245 */
6246message MediametricsRecorderReported {
6247 optional int64 timestamp_nanos = 1;
6248 optional string package_name = 2;
6249 optional int64 package_version_code = 3;
6250 optional int64 media_apex_version = 4;
6251
6252 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6253}
6254
6255/**
6256 * Track Media Player usage
6257 * Logged from:
6258 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6259 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6260 */
6261message MediametricsNuPlayerReported {
6262 optional int64 timestamp_nanos = 1;
6263 optional string package_name = 2;
6264 optional int64 package_version_code = 3;
6265 optional int64 media_apex_version = 4;
6266
6267 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6268}
6269
6270/**
Robert Shiha4beed32019-08-19 14:15:23 -07006271 * Track Legacy DRM usage
6272 * Logged from
6273 * frameworks/av/drm/drmserver/DrmManager.cpp
6274 */
6275message MediametricsDrmManagerReported {
6276 optional int64 timestamp_nanos = 1;
6277 optional string package_name = 2;
6278 optional int64 package_version_code = 3;
6279 optional int64 media_apex_version = 4;
6280
6281 enum Method {
6282 METHOD_NOT_FOUND = -1;
6283 GET_CONSTRAINTS = 0;
6284 GET_METADATA = 1;
6285 CAN_HANDLE = 2;
6286 PROCESS_DRM_INFO = 3;
6287 ACQUIRE_DRM_INFO = 4;
6288 SAVE_RIGHTS = 5;
6289 GET_ORIGINAL_MIME_TYPE = 6;
6290 GET_DRM_OBJECT_TYPE = 7;
6291 CHECK_RIGHTS_STATUS = 8;
6292 REMOVE_RIGHTS = 9;
6293 REMOVE_ALL_RIGHTS = 10;
6294 OPEN_CONVERT_SESSION = 11;
6295 OPEN_DECRYPT_SESSION = 12;
6296 }
6297
6298 // plugin_id+description inform which Legacy DRM plugins are still in use on device
6299 optional string plugin_id = 5;
6300 optional string description = 6;
6301 optional Method method = 7;
6302 optional string mime_types = 8;
6303}
6304
6305/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006306 * State of a dangerous permission requested by a package
6307 */
6308message DangerousPermissionState {
6309 // Name of the permission
6310 optional string permission_name = 1;
6311
6312 // Uid of the package
6313 optional int32 uid = 2 [(is_uid) = true];
6314
6315 // Package requesting the permission
6316 optional string package_name = 3;
6317
6318 // If the permission is granted to the uid
6319 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01006320
6321 // Permission flags as per android.content.pm.PermissionFlags
6322 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006323}
6324
Michael Groover4a0ca942019-01-24 17:41:25 -08006325/**
6326 * Logs when a package is denied access to a device identifier based on the new access requirements.
6327 *
6328 * Logged from:
6329 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6330 */
6331message DeviceIdentifierAccessDenied {
6332 // The name of the package denied access to the requested device identifier.
6333 optional string package_name = 1;
6334
6335 // The name of the device identifier method the package attempted to invoke.
6336 optional string method_name = 2;
6337
6338 // True if the package is preinstalled.
6339 optional bool is_preinstalled = 3;
6340
6341 // True if the package is privileged.
6342 optional bool is_priv_app = 4;
6343}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006344
6345/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006346 * Pulls the ongoing mainline install train version code.
6347 * Pulled from StatsCompanionService
6348 */
6349message TrainInfo {
6350 optional int64 train_version_code = 1;
6351
6352 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006353
6354 optional string train_name = 3;
6355
6356 enum Status {
6357 UNKNOWN = 0;
6358 INSTALL_REQUESTED = 1;
6359 INSTALL_STARTED = 2;
6360 INSTALL_STAGED_NOT_READY = 3;
6361 INSTALL_STAGED_READY = 4;
6362 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006363 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6364 // and INSTALL_FAILURE_COMMIT.
6365 INSTALL_FAILURE = 6 [deprecated = true];
6366 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006367 INSTALL_CANCELLED = 7;
6368 INSTALLER_ROLLBACK_REQUESTED = 8;
6369 INSTALLER_ROLLBACK_INITIATED = 9;
6370 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6371 INSTALLER_ROLLBACK_STAGED = 11;
6372 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6373 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6374 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6375 INSTALLER_ROLLBACK_SUCCESS = 15;
6376 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006377 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6378 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6379 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6380 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6381 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6382 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006383 INSTALL_FAILURE_DOWNLOAD = 23;
6384 INSTALL_FAILURE_STATE_MISMATCH = 24;
6385 INSTALL_FAILURE_COMMIT = 25;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006386 }
6387 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006388}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006389
6390/**
6391 * Logs the gesture stage changed event.
6392 *
6393 * Logged from:
6394 * frameworks/base/packages/SystemUI/
6395 */
6396message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006397 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006398}
6399
6400/**
6401 * Logs the feedback type.
6402 *
6403 * Logged from:
6404 * frameworks/base/packages/SystemUI/
6405 */
6406message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006407 // Whether or not the gesture was used.
6408 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006409}
6410
6411/**
6412 * Logs the progress.
6413 *
6414 * Logged from:
6415 * frameworks/base/packages/SystemUI/
6416 */
6417message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006418 // [0,100] progress for the assist gesture.
6419 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006420}
Neil Fullerdb14b482019-02-05 19:44:44 +00006421
6422/*
6423 * Information about the time zone data on a device.
6424 */
6425message TimeZoneDataInfo {
6426 // A version identifier for the data set on device. e.g. "2018i"
6427 optional string tzdb_version = 1;
6428}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006429
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006430/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006431 * Logs the GPU stats global health information.
6432 *
6433 * Logged from:
6434 * frameworks/native/services/gpuservice/gpustats/
6435 */
6436message GpuStatsGlobalInfo {
6437 // Package name of the gpu driver.
6438 optional string driver_package_name = 1;
6439
6440 // Version name of the gpu driver.
6441 optional string driver_version_name = 2;
6442
6443 // Version code of the gpu driver.
6444 optional int64 driver_version_code = 3;
6445
6446 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
6447 optional int64 driver_build_time = 4;
6448
6449 // Total count of the gl driver gets loaded.
6450 optional int64 gl_loading_count = 5;
6451
6452 // Total count of the gl driver fails to be loaded.
6453 optional int64 gl_loading_failure_count = 6;
6454
6455 // Total count of the Vulkan driver gets loaded.
6456 optional int64 vk_loading_count = 7;
6457
6458 // Total count of the Vulkan driver fails to be loaded.
6459 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07006460
6461 // Api version of the system Vulkan driver.
6462 optional int32 vulkan_version = 9;
6463
6464 // Api version of the system CPU Vulkan driver.
6465 optional int32 cpu_vulkan_version = 10;
6466
6467 // Api version of the system GLES driver.
6468 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006469
6470 // Total count of the angle driver gets loaded.
6471 optional int64 angle_loading_count = 12;
6472
6473 // Total count of the angle driver fails to be loaded.
6474 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006475}
6476
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006477/**
6478 * GPU driver loading time info.
6479 */
6480message GpuDriverLoadingTime {
6481 // List of all the driver loading times for this app. The list size is
6482 // capped at 50.
6483 repeated int64 driver_loading_time = 1;
6484}
6485
6486/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006487 * Logs the GPU stats per app health information.
6488 *
6489 * Logged from:
6490 * frameworks/native/services/gpuservice/gpustats/
6491 */
6492message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006493 // Package name of the application that loads the gpu driver. Total number
6494 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006495 optional string app_package_name = 1;
6496
6497 // Version code of the gpu driver this app loads.
6498 optional int64 driver_version_code = 2;
6499
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006500 // gl driver loading time info.
6501 optional GpuDriverLoadingTime gl_driver_loading_time = 3
6502 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006503
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006504 // Vulkan driver loading time info.
6505 optional GpuDriverLoadingTime vk_driver_loading_time = 4
6506 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006507
6508 // Angle driver loading time info.
6509 optional GpuDriverLoadingTime angle_driver_loading_time = 5
6510 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07006511
6512 // CPU Vulkan implementation is in use.
6513 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07006514
6515 // App is not doing pre-rotation correctly.
6516 optional bool false_prerotation = 7;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006517}
Rafal Slawikd4e87572019-03-12 13:08:38 +00006518
6519/*
6520 * Logs the size of the system ion heap.
6521 *
6522 * Pulled from StatsCompanionService.
6523 */
6524message SystemIonHeapSize {
6525 // Size of the system ion heap in bytes.
6526 optional int64 size_in_bytes = 1;
6527}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006528
Rafal Slawik77987ed2019-06-17 12:28:23 +01006529/*
6530 * Logs the per-process size of the system ion heap.
6531 *
6532 * Pulled from StatsCompanionService.
6533 */
6534message ProcessSystemIonHeapSize {
6535 // The uid if available. -1 means not available.
6536 optional int32 uid = 1 [(is_uid) = true];
6537
6538 // The process name (from /proc/PID/cmdline).
6539 optional string process_name = 2;
6540
6541 // Sum of sizes of all allocations.
6542 optional int32 total_size_in_kilobytes = 3;
6543
6544 // Number of allocations.
6545 optional int32 allocation_count = 4;
6546
6547 // Size of the largest allocation.
6548 optional int32 max_size_in_kilobytes = 5;
6549}
6550
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006551/**
6552 * Push network stack events.
6553 *
6554 * Log from:
6555 * frameworks/base/packages/NetworkStack/
6556 */
6557message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08006558 // The id that indicates the event reported from NetworkStack.
6559 optional int32 event_id = 1;
6560 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006561 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
6562}
Carmen Agimofa769c152019-03-04 14:39:14 +00006563
6564/**
6565 * Logs the apps that are installed on the external storage.
6566 * Pulled from:
6567 * StatsCompanionService
6568 */
6569message AppsOnExternalStorageInfo {
6570 // The type of the external storage.
6571 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
6572 // The name of the package that is installed on the external storage.
6573 optional string package_name = 2;
6574}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07006575
6576/**
6577 * Logs the settings related to Face.
6578 * Logged from:
6579 * frameworks/base/services/core/java/com/android/server/stats
6580 */
6581message FaceSettings {
6582 // Whether or not face unlock is allowed on Keyguard.
6583 optional bool unlock_keyguard_enabled = 1;
6584 // Whether or not face unlock dismisses the Keyguard.
6585 optional bool unlock_dismisses_keyguard = 2;
6586 // Whether or not face unlock requires attention.
6587 optional bool unlock_attention_required = 3;
6588 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
6589 optional bool unlock_app_enabled = 4;
6590 // Whether or not face unlock always requires user confirmation.
6591 optional bool unlock_always_require_confirmation = 5;
6592 // Whether or not a diverse set of poses are required during enrollment.
6593 optional bool unlock_diversity_required = 6;
6594}
Maggie White442b6312019-04-05 16:26:44 -07006595
6596/**
6597 * Logs cooling devices maintained by the kernel.
6598 *
6599 * Pulled from StatsCompanionService.java
6600 */
6601message CoolingDevice {
6602 // The type of cooling device being reported. Eg. CPU, GPU...
6603 optional android.os.CoolingTypeEnum device_location = 1;
6604 // The name of the cooling device source. Eg. CPU0
6605 optional string device_name = 2;
6606 // Current throttle state of the cooling device. The value can any unsigned
6607 // integer between 0 and max_state defined in its driver. 0 means device is
6608 // not in throttling, higher value means deeper throttling.
6609 optional int32 state = 3;
6610}
Ben Blount763a5d52019-04-10 11:48:58 -07006611
6612/**
6613 * Intelligence has several counter-type events that don't warrant a
6614 * full separate atom. These are primarily API call counters but also include
6615 * counters for feature usage and specific failure modes.
6616 *
6617 * Logged from the Intelligence mainline module.
6618 */
6619message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07006620 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07006621 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07006622 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07006623 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07006624 // How many times the event occured (to report a batch of high frequency events).
6625 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07006626 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07006627 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07006628}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07006629
6630/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07006631 * Logs when Car Power state changed.
6632 *
6633 * Logged from:
6634 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6635 */
6636message CarPowerStateChanged {
6637 // States come from CpmsState in CarPowerManagementService.java.
6638 enum State {
6639 WAIT_FOR_VHAL = 0;
6640 ON = 1;
6641 SHUTDOWN_PREPARE = 2;
6642 WAIT_FOR_FINISH = 3;
6643 SUSPEND = 4;
6644 SIMULATE_SLEEP = 5;
6645 }
6646 optional State state = 1;
6647}
6648
6649/**
6650 * Logs whether GarageMode is entered.
6651 *
6652 * Logged from:
6653 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6654 */
6655message GarageModeInfo {
6656 // Whether GarageMode is entered.
6657 optional bool is_garage_mode = 1;
6658}
Martijn Coenencd95d462019-04-25 17:09:45 +02006659
6660/**
6661 * Historical app ops data per package.
6662 */
6663message AppOps {
6664 // Uid of the package requesting the op
6665 optional int32 uid = 1 [(is_uid) = true];
6666
6667 // Nmae of the package performing the op
6668 optional string package_name = 2;
6669
6670 // operation id; maps to the OP_* constants in AppOpsManager.java
6671 optional int32 op_id = 3;
6672
6673 // The number of times the op was granted while the app was in the
6674 // foreground (only for trusted requests)
6675 optional int64 trusted_foreground_granted_count = 4;
6676
6677 // The number of times the op was granted while the app was in the
6678 // background (only for trusted requests)
6679 optional int64 trusted_background_granted_count = 5;
6680
6681 // The number of times the op was rejected while the app was in the
6682 // foreground (only for trusted requests)
6683 optional int64 trusted_foreground_rejected_count = 6;
6684
6685 // The number of times the op was rejected while the app was in the
6686 // background (only for trusted requests)
6687 optional int64 trusted_background_rejected_count = 7;
6688
6689 // For long-running operations, total duration of the operation
6690 // while the app was in the foreground (only for trusted requests)
6691 optional int64 trusted_foreground_duration_millis = 8;
6692
6693 // For long-running operations, total duration of the operation
6694 // while the app was in the background (only for trusted requests)
6695 optional int64 trusted_background_duration_millis = 9;
6696}
Hongyi Zhang700137e2019-05-23 21:19:36 -07006697
6698/**
6699 * Location Manager API Usage information(e.g. API under usage,
6700 * API call's parameters).
6701 * Logged from:
6702 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
6703 */
6704message LocationManagerApiUsageReported {
6705
6706 // Indicating if usage starts or usage ends.
6707 optional android.stats.location.UsageState state = 1;
6708
6709 // LocationManagerService's API in use.
6710 // We can identify which API from LocationManager is
6711 // invoking current LMS API by the combination of
6712 // API parameter(e.g. is_listener_null, is_intent_null,
6713 // is_location_request_null)
6714 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
6715
6716 // Name of the package calling the API.
6717 optional string calling_package_name = 3;
6718
6719 // Type of the location provider.
6720 optional android.stats.location.ProviderType provider = 4;
6721
6722 // Quality of the location request
6723 optional android.stats.location.LocationRequestQuality quality = 5;
6724
6725 // The desired interval for active location updates, in milliseconds.
6726 // Bucketized to reduce cardinality.
6727 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
6728
6729 // Minimum distance between location updates, in meters.
6730 // Bucketized to reduce cardinality.
6731 optional android.stats.location.SmallestDisplacementBucket
6732 bucketized_smallest_displacement = 7;
6733
6734 // The number of location updates.
6735 optional int64 num_updates = 8;
6736
6737 // The request expiration time, in millisecond since boot.
6738 // Bucketized to reduce cardinality.
6739 optional android.stats.location.ExpirationBucket
6740 bucketized_expire_in = 9;
6741
6742 // Type of Callback passed in for this API.
6743 optional android.stats.location.CallbackType callback_type = 10;
6744
6745 // The radius of the central point of the alert
6746 // region, in meters. Only for API REQUEST_GEOFENCE.
6747 // Bucketized to reduce cardinality.
6748 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
6749
6750 // Activity Importance of API caller.
6751 // Categorized to 3 types that are interesting from location's perspective.
6752 optional android.stats.location.ActivityImportance activiy_importance = 12;
6753}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01006754
6755/**
6756 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
6757 */
6758message ReviewPermissionsFragmentResultReported {
6759 // unique value identifying a permission group change. A permission group change might result
6760 // in multiple of these atoms
6761 optional int64 change_id = 1;
6762
6763 // UID of package the permission belongs to
6764 optional int32 uid = 2 [(is_uid) = true];
6765
6766 // Name of package the permission belongs to
6767 optional string package_name = 3;
6768
6769 // The permission to be granted
6770 optional string permission_name = 4;
6771
6772 // The result of the permission grant
6773 optional bool permission_granted = 5;
6774}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01006775
6776/**
6777* Information about results of permission upgrade by RuntimePermissionsUpgradeController
6778* Logged from: RuntimePermissionUpdgradeController
6779*/
6780message RuntimePermissionsUpgradeResult {
6781 // Permission granted as result of upgrade
6782 optional string permission_name = 1;
6783
6784 // UID of package granted permission
6785 optional int32 uid = 2 [(is_uid) = true];
6786
6787 // Name of package granted permission
6788 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01006789}
6790
6791/**
6792* Information about a buttons presented in GrantPermissionsActivty and choice made by user
6793*/
6794message GrantPermissionsActivityButtonActions {
6795 // Permission granted as result of upgrade
6796 optional string permission_group_name = 1;
6797
6798 // UID of package granted permission
6799 optional int32 uid = 2 [(is_uid) = true];
6800
6801 // Name of package requesting permission
6802 optional string package_name = 3;
6803
6804 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
6805 // LABEL_ constants in GrantPermissionActivity.java
6806 optional int32 buttons_presented = 4;
6807
6808 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
6809 optional int32 button_clicked = 5;
6810}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01006811
6812/**
6813 * Information about LocationAccessCheck notification presented to user
6814 */
6815message LocationAccessCheckNotificationAction {
6816
6817 // id which identifies single session of user interacting with permission controller
6818 optional int64 session_id = 1;
6819
6820 // Uid of package for which location access check is presented
6821 optional int32 package_uid = 2;
6822
6823 // Name of package for which location access check is presented
6824 optional string package_name = 3;
6825
6826 enum Result {
6827 UNDEFINED = 0;
6828 // notification was presented to the user
6829 NOTIFICATION_PRESENTED = 1;
6830 // notification was declined by the user
6831 NOTIFICATION_DECLINED = 2;
6832 // notification was clicked by the user
6833 NOTIFICATION_CLICKED = 3;
6834 }
6835
6836 // View / interaction recorded
6837 optional Result result = 4;
6838}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01006839
6840/**
6841 * Information about a permission grant or revoke made by user inside AppPermissionFragment
6842 */
6843message AppPermissionFragmentActionReported {
6844 // id which identifies single session of user interacting with permission controller
6845 optional int64 session_id = 1;
6846
6847 // unique value identifying a permission group change. A permission group change might result
6848 // in multiple of these atoms
6849 optional int64 change_id = 2;
6850
6851 // UID of package the permission belongs to
6852 optional int32 uid = 3 [(is_uid) = true];
6853
6854 // Name of package the permission belongs to
6855 optional string package_name = 4;
6856
6857 // The permission to be granted
6858 optional string permission_name = 5;
6859
6860 // The result of the permission grant
6861 optional bool permission_granted = 6;
6862}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01006863
6864/**
6865* Information about a AppPermissionFragment viewed by user
6866*/
6867message AppPermissionFragmentViewed {
6868 // id which identifies single session of user interacting with permission controller
6869 optional int64 session_id = 1;
6870
6871 // UID of package for which permissions are viewed
6872 optional int32 uid = 2 [(is_uid) = true];
6873
6874 // Name of package for which permissions are viewed
6875 optional string package_name = 3;
6876
6877 // Permission group viewed
6878 optional string permission_group_name = 4;
6879}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01006880
6881/**
6882* Information about a AppPermissionsFragment viewed by user
6883*/
6884message AppPermissionsFragmentViewed {
6885 // id which identifies single session of user interacting with permission controller
6886 optional int64 session_id = 1;
6887
6888 // id which identifies single view as every view might have several logging records
6889 // with different package information attached
6890 optional int64 view_id = 2;
6891
6892 // Permission group viewed
6893 optional string permission_group_name = 3;
6894
6895 // UID of package for which permissions are viewed
6896 optional int32 uid = 4 [(is_uid) = true];
6897
6898 // Name of package for which permissions are viewed
6899 optional string package_name = 5;
6900
6901 // Category in which permission is included
6902 enum Category {
6903 UNDEFINED = 0;
6904 ALLOWED = 1;
6905 ALLOWED_FOREGROUND = 2;
6906 DENIED = 3;
6907 }
6908 optional Category category = 6;
6909}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01006910
6911/**
6912* Information about a PermissionAppsFragment viewed by user.
6913* Logged from ui/handheld/PermissionAppsFragment.java
6914*/
6915message PermissionAppsFragmentViewed {
6916 // id which identifies single session of user interacting with permission controller
6917 optional int64 session_id = 1;
6918
6919 // id which identifies single view as every view might have several logging records
6920 // with different package information attached
6921 optional int64 view_id = 2;
6922
6923 // Permission group viewed
6924 optional string permission_group_name = 3;
6925
6926 // UID of package for which permissions are viewed
6927 optional int32 uid = 4 [(is_uid) = true];
6928
6929 // Name of package for which permissions are viewed
6930 optional string package_name = 5;
6931
6932 // Category in which app is included
6933 enum Category {
6934 UNDEFINED = 0;
6935 ALLOWED = 1;
6936 ALLOWED_FOREGROUND = 2;
6937 DENIED = 3;
6938 }
6939 optional Category category = 6;
6940}
Tony Make2b1b672019-07-29 16:59:47 +01006941
6942/**
6943 * Logs when there is a smart selection related event.
6944 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
6945 * Logged from: TextClassifierEventLogger.java
6946 */
6947message TextSelectionEvent {
6948 // A session ID.
6949 optional string session_id = 1;
6950
6951 // Event type of this event.
6952 optional android.stats.textclassifier.EventType event_type = 2;
6953
6954 // Name of the model that is involved in this event.
6955 optional string model_name = 3;
6956
6957 // Type of widget that was involved in triggering this event.
6958 optional android.stats.textclassifier.WidgetType widget_type = 4;
6959
6960 // Index of this event in a session.
6961 optional int32 event_index = 5;
6962
6963 // Entity type that is involved.
6964 optional string entity_type = 6;
6965
6966 // Relative word index of the start of the selection.
6967 optional int32 relative_word_start_index = 7;
6968
6969 // Relative word (exclusive) index of the end of the selection.
6970 optional int32 relative_word_end_index = 8;
6971
6972 // Relative word index of the start of the smart selection.
6973 optional int32 relative_suggested_word_start_index = 9;
6974
6975 // Relative word (exclusive) index of the end of the smart selection.
6976 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01006977
6978 // Name of source package.
6979 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01006980}
6981
6982/**
6983 * Logs when there is a smart linkify related event.
6984 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
6985 * Logged from: TextClassifierEventLogger.java
6986 */
6987message TextLinkifyEvent {
6988 // A session ID.
6989 optional string session_id = 1;
6990
6991 // Event type of this event.
6992 optional android.stats.textclassifier.EventType event_type = 2;
6993
6994 // Name of the model that is involved in this event.
6995 optional string model_name = 3;
6996
6997 // Type of widget that was involved in triggering this event.
6998 optional android.stats.textclassifier.WidgetType widget_type = 4;
6999
7000 // Index of this event in a session.
7001 optional int32 event_index = 5;
7002
7003 // Entity type that is involved.
7004 optional string entity_type = 6;
7005
7006 // Number of links detected.
7007 optional int32 num_links = 7;
7008
7009 // The total length of all links.
7010 optional int32 linked_text_length = 8;
7011
7012 // Length of input text.
7013 optional int32 text_length = 9;
7014
7015 // Time spent on generating links in ms.
7016 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007017
7018 // Name of source package.
7019 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007020}
7021
7022/**
7023 * Logs when there is a conversation actions related event.
7024 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7025 * Logged from: TextClassifierEventLogger.java
7026 */
7027message ConversationActionsEvent {
7028 // A session ID.
7029 optional string session_id = 1;
7030
7031 // Event type of this event.
7032 optional android.stats.textclassifier.EventType event_type = 2;
7033
7034 // Name of the model that is involved in this event.
7035 optional string model_name = 3;
7036
7037 // Type of widget that was involved in triggering this event.
7038 optional android.stats.textclassifier.WidgetType widget_type = 4;
7039
7040 // The first entity type that is involved.
7041 optional string first_entity_type = 5;
7042
7043 // The second entity type that is involved.
7044 optional string second_entity_type = 6;
7045
7046 // The third entity type that is involved.
7047 optional string third_entity_type = 7;
7048
7049 // The score of the first entity type.
7050 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01007051
7052 // Name of source package.
7053 optional string package_name = 9;
Tony Make2b1b672019-07-29 16:59:47 +01007054}
7055
7056/**
7057 * Logs when there is a language detection related event.
7058 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7059 * Logged from: TextClassifierEventLogger.java
7060 */
7061message LanguageDetectionEvent {
7062 // A session ID.
7063 optional string session_id = 1;
7064
7065 // Event type of this event.
7066 optional android.stats.textclassifier.EventType event_type = 2;
7067
7068 // Name of the model that is involved in this event.
7069 optional string model_name = 3;
7070
7071 // Type of widget that was involved in triggering this event.
7072 optional android.stats.textclassifier.WidgetType widget_type = 4;
7073
7074 // Detected language.
7075 optional string language_tag = 5;
7076
7077 // Score of the detected language.
7078 optional float score = 6;
7079
7080 // Position of this action.
7081 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01007082
7083 // Name of source package.
7084 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01007085}
Tianjie Xu167c3db2019-07-22 14:25:14 -07007086
7087/**
7088 * Information about an OTA update attempt by update_engine.
7089 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7090 */
7091message UpdateEngineUpdateAttemptReported {
7092 // The number of attempts for the update engine to apply a given payload.
7093 optional int32 attempt_number = 1;
7094
7095 optional android.stats.otaupdate.PayloadType payload_type = 2;
7096
7097 // The total time in minutes for the update engine to apply a given payload.
7098 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
7099 // it's increased when the system is sleeping.
7100 optional int32 duration_boottime_in_minutes = 3;
7101
7102 // The total time in minutes for the update engine to apply a given payload.
7103 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
7104 // and it's not increased when the system is sleeping.
7105 optional int32 duration_monotonic_in_minutes = 4;
7106
7107 // The size of the payload in MiBs.
7108 optional int32 payload_size_mib = 5;
7109
7110 // The attempt result reported by the update engine for an OTA update.
7111 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
7112
7113 // The error code reported by the update engine after an OTA update attempt
7114 // on A/B devices.
7115 optional android.stats.otaupdate.ErrorCode error_code = 7;
7116
7117 // The build fingerprint of the source system. The value is read from a
7118 // system property when the device takes the update. e.g.
7119 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
7120 optional string source_fingerprint = 8;
7121}
7122
7123/**
7124 * Information about all the attempts the device make before finishing the
7125 * successful update.
7126 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7127 */
7128message UpdateEngineSuccessfulUpdateReported {
7129 // The number of attempts for the update engine to apply the payload for a
7130 // successful update.
7131 optional int32 attempt_count = 1;
7132
7133 optional android.stats.otaupdate.PayloadType payload_type = 2;
7134
7135 optional int32 payload_size_mib = 3;
7136
7137 // The total number of bytes downloaded by update_engine since the last
7138 // successful update.
7139 optional int32 total_bytes_downloaded_mib = 4;
7140
7141 // The ratio in percentage of the over-downloaded bytes compared to the
7142 // total bytes needed to successfully install the update. e.g. 200 if we
7143 // download 200MiB in total for a 100MiB package.
7144 optional int32 download_overhead_percentage = 5;
7145
7146 // The total time in minutes for the update engine to apply the payload for a
7147 // successful update.
7148 optional int32 total_duration_minutes = 6;
7149
7150 // The number of reboot of the device during a successful update.
7151 optional int32 reboot_count = 7;
7152}
Alec Mourie088e762019-07-02 13:10:55 -07007153
7154/**
7155 * Global display pipeline metrics reported by SurfaceFlinger.
7156 * Pulled from:
7157 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7158 */
7159message SurfaceflingerStatsGlobalInfo {
7160 // Total number of frames presented during the tracing period
7161 optional int64 total_frames = 1;
7162 // Total number of frames missed
7163 optional int64 missed_frames = 2;
7164 // Total number of frames that fell back to client composition
7165 optional int64 client_composition_frames = 3;
7166 // Total time the display was turned on
7167 optional int64 display_on_millis = 4;
7168 // Total time that was spent performing animations.
7169 // This is derived from the present-to-present layer histogram
7170 optional int64 animation_millis = 5;
7171}
7172
7173/**
7174 * Per-layer display pipeline metrics reported by SurfaceFlinger.
7175 * The number of layers uploaded will be restricted due to size limitations.
7176 * Pulled from:
7177 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7178 */
7179message SurfaceflingerStatsLayerInfo {
7180 // The layer for this set of metrics
7181 // For now we can infer that the package name is included in the layer
7182 // name.
7183 optional string layer_name = 1;
7184 // Total number of frames presented
7185 optional int64 total_frames = 2;
7186 // Total number of dropped frames while latching a buffer for this layer.
7187 optional int64 dropped_frames = 3;
7188 // Set of timings measured between successive presentation timestamps.
7189 optional FrameTimingHistogram present_to_present = 4
7190 [(android.os.statsd.log_mode) = MODE_BYTES];
7191 // Set of timings measured from when an app queued a buffer for
7192 // presentation, until the buffer was actually presented to the
7193 // display.
7194 optional FrameTimingHistogram post_to_present = 5
7195 [(android.os.statsd.log_mode) = MODE_BYTES];
7196 // Set of timings measured from when a buffer is ready to be presented,
7197 // until the buffer was actually presented to the display.
7198 optional FrameTimingHistogram acquire_to_present = 6
7199 [(android.os.statsd.log_mode) = MODE_BYTES];
7200 // Set of timings measured from when a buffer was latched by
7201 // SurfaceFlinger, until the buffer was presented to the display
7202 optional FrameTimingHistogram latch_to_present = 7
7203 [(android.os.statsd.log_mode) = MODE_BYTES];
7204 // Set of timings measured from the desired presentation to the actual
7205 // presentation time
7206 optional FrameTimingHistogram desired_to_present = 8
7207 [(android.os.statsd.log_mode) = MODE_BYTES];
7208 // Set of timings measured from when an app queued a buffer for
7209 // presentation, until the buffer was ready to be presented.
7210 optional FrameTimingHistogram post_to_acquire = 9
7211 [(android.os.statsd.log_mode) = MODE_BYTES];
7212}
7213
7214/**
7215 * Histogram of frame counts bucketed by time in milliseconds.
7216 * Because of size limitations, we hard-cap the number of buckets, with
7217 * buckets for corresponding to larger milliseconds being less precise.
7218 */
7219message FrameTimingHistogram {
7220 // Timings in milliseconds that describes a set of histogram buckets
7221 repeated int32 time_millis_buckets = 1;
7222 // Number of frames that match to each time_millis, i.e. the bucket
7223 // contents
7224 // It's required that len(time_millis) == len(frame_count)
7225 repeated int64 frame_counts = 2;
7226}
Emilian Peev6729f372019-08-29 09:14:09 -07007227
Emilian Peev6729f372019-08-29 09:14:09 -07007228/**
7229 * Information about camera facing and API level usage.
7230 * Logged from:
7231 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
7232 */
7233message CameraActionEvent {
7234 // Camera session duration
7235 optional int64 duration = 1;
7236
7237 // Camera API level used
7238 optional int32 api_level = 2;
7239
7240 // Name of client package
7241 optional string package_name = 3;
7242
7243 // Camera facing
7244 enum Facing {
7245 UNKNOWN = 0;
7246 BACK = 1;
7247 FRONT = 2;
7248 EXTERNAL = 3;
7249 }
7250 optional Facing facing = 4;
7251}
atrost01a20932019-08-28 15:40:37 +01007252
7253/**
7254 * Logs when a compatibility change is affecting an app.
7255 *
7256 * Logged from:
7257 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
7258 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
7259 */
7260message AppCompatibilityChangeReported {
7261 // The UID of the app being affected by the compatibilty change.
7262 optional int32 uid = 1 [(is_uid) = true];
7263
7264 // The ID of the change affecting the app.
7265 optional int64 change_id = 2;
7266
7267 enum State {
7268 UNKNOWN_STATE = 0;
7269 ENABLED = 1;
7270 DISABLED = 2;
7271 LOGGED = 3;
7272 }
7273
7274 // The state of the change - if logged from gating whether it was enabled or disabled, or just
7275 // logged otherwise.
7276 optional State state = 3;
7277
7278 enum Source {
7279 UNKNOWN_SOURCE = 0;
7280 APP_PROCESS = 1;
7281 SYSTEM_SERVER = 2;
7282 }
7283
7284 // Where it was logged from.
7285 optional Source source = 4;
7286
7287}
Hector Dearman40579f62019-11-01 13:19:30 +00007288
7289/**
7290 * Logged from
7291 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
7292 */
7293message PerfettoUploaded {
7294 enum Event {
7295 PERFETTO_UNDEFINED = 0;
7296 PERFETTO_TRACE_BEGIN = 1;
7297 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
7298 PERFETTO_ON_CONNECT = 3;
7299 PERFETTO_ON_TRACING_DISABLED = 4;
7300 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
7301 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
7302 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
7303 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
7304 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
7305 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
7306 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
7307 PERFETTO_TRIGGER_BEGIN = 12;
7308 PERFETTO_TRIGGER_SUCCESS = 13;
7309 PERFETTO_TRIGGER_FAILURE = 14;
7310 PERFETTO_HIT_GUARDRAILS = 15;
7311 PERFETTO_ON_TIMEOUT = 16;
7312 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
7313 }
7314
7315 // Which stage of the pipeline we are reporting from.
7316 optional Event event = 1;
7317
7318 // UUID matching the one set inside the SystemInfo trace packet.
7319 optional int64 trace_uuid_lsb = 2;
7320 optional int64 trace_uuid_msb = 3;
7321}
Mark Tabrya824a642019-11-05 12:26:12 -08007322
7323/**
7324 * Pulls client metrics on data transferred via Vehicle Maps Service.
7325 * Metrics are keyed by uid + layer.
7326 *
7327 * Pulled from:
7328 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
7329 */
7330message VmsClientStats {
7331 // UID of the VMS client app
7332 optional int32 uid = 1 [(is_uid) = true];
7333
7334 // VMS layer definition
7335 optional int32 layer_type = 2;
7336 optional int32 layer_channel = 3;
7337 optional int32 layer_version = 4;
7338
7339 // Bytes and packets sent by the client for the layer
7340 optional int64 tx_bytes = 5;
7341 optional int64 tx_packets = 6;
7342
7343 // Bytes and packets received by the client for the layer
7344 optional int64 rx_bytes = 7;
7345 optional int64 rx_packets = 8;
7346
7347 // Bytes and packets dropped due to client error
7348 optional int64 dropped_bytes = 9;
7349 optional int64 dropped_packets = 10;
7350}