blob: b0570fd83bbf88a31f5fbd88ea54657604138fe8 [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;
Howard Ro0db82032019-04-07 18:43:34 -0700167 // Atom number 90 is available for use.
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/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003269 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003270 *
3271 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003272 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003273 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003274message BiometricAcquired {
3275 // Biometric modality that was acquired.
3276 optional android.hardware.biometrics.ModalityEnum modality = 1;
3277 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3278 optional int32 user = 2;
3279 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3280 optional bool is_crypto = 3;
3281 // Action that the device is performing. Acquired messages are only expected for enroll and
3282 // authenticate. Other actions may indicate an error.
3283 optional android.hardware.biometrics.ActionEnum action = 4;
3284 // The client that this acquisition was received for.
3285 optional android.hardware.biometrics.ClientEnum client = 5;
3286 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3287 optional int32 acquire_info = 6;
3288 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3289 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003290 // Dictates if this message should trigger additional debugging.
3291 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003292}
3293
3294/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003295 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003296 *
3297 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003298 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003299 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003300message BiometricAuthenticated {
3301 // Biometric modality that was used.
3302 optional android.hardware.biometrics.ModalityEnum modality = 1;
3303 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3304 optional int32 user = 2;
3305 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3306 // storage.
3307 optional bool is_crypto = 3;
3308 // The client that this acquisition was received for.
3309 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003310 // If authentication requires user confirmation. See BiometricPrompt's
3311 // setRequireConfirmation(bool) method.
3312 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003313
Kevin Chyn1741a072019-01-17 11:54:40 -08003314 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003315 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003316 REJECTED = 1;
3317 PENDING_CONFIRMATION = 2;
3318 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003319 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003320
3321 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003322 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003323 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3324 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3325 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3326 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003327 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003328 // Dictates if this message should trigger additional debugging.
3329 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003330}
3331
3332/**
3333 * Logs when a biometric error occurs.
3334 *
3335 * Logged from:
3336 * frameworks/base/services/core/java/com/android/server/biometrics
3337 */
3338message BiometricErrorOccurred {
3339 // Biometric modality that was used.
3340 optional android.hardware.biometrics.ModalityEnum modality = 1;
3341 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3342 optional int32 user = 2;
3343 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3344 optional bool is_crypto = 3;
3345 // Action that the device is performing.
3346 optional android.hardware.biometrics.ActionEnum action = 4;
3347 // The client that this acquisition was received for.
3348 optional android.hardware.biometrics.ClientEnum client = 5;
3349 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3350 // are unique to modality.
3351 optional int32 error_info = 6;
3352 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3353 // by the vendor and not specified by the HIDL interface.
3354 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003355 // Dictates if this message should trigger additional debugging.
3356 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003357 // Time spent during the authentication attempt.
3358 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003359}
3360
3361/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003362 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003363 * Logged from:
3364 * frameworks/base/services/core/java/com/android/server/biometrics
3365 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003366message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003367 // Biometric modality.
3368 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003369 // Type of issue detected.
3370 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003371 // Dictates if this message should trigger additional debugging.
3372 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003373}
Howard Ro688ae182018-09-25 00:09:36 -07003374
joshmccloskey6f952b22019-03-25 20:59:35 -07003375/**
3376 * Logs when a biometric enrollment occurs.
3377 *
3378 * Logged from:
3379 * frameworks/base/services/core/java/com/android/server/biometrics
3380 */
3381message BiometricEnrolled {
3382 // Biometric modality that was used.
3383 optional android.hardware.biometrics.ModalityEnum modality = 1;
3384 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3385 optional int32 user = 2;
3386 // The amount of time the enrollment took in milliseconds.
3387 optional int64 latency_millis = 3;
3388 // Whether or not the enrollment was successful.
3389 optional bool success = 4;
3390}
3391
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003392/*
Tej Singh0d176952019-01-16 19:10:54 -08003393 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003394 */
Tej Singh0d176952019-01-16 19:10:54 -08003395message FlagFlipUpdateOccurred {
3396 // If the event is from a flag config package, specify the package name.
3397 optional string flag_flip_package_name = 1;
3398
3399 // The order id of the package
3400 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003401}
3402
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003403/**
3404 * Potential experiment ids that goes with a train install.
3405 */
3406message TrainExperimentIds {
3407 repeated int64 experiment_id = 1;
3408}
3409
Yangster-macb89807e2018-11-15 21:10:57 -08003410/*
3411 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003412 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003413 */
3414message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003415 // Name of the train.
3416 optional string train_name = 1;
3417 // Version code for a "train" of packages that need to be installed atomically
3418 optional int64 train_version_code = 2;
3419 // After installation of this package, device requires a restart.
3420 optional bool requires_staging = 3;
3421 // Rollback should be enabled for this install.
3422 optional bool rollback_enabled = 4;
3423 // Requires low latency monitoring if possible.
3424 optional bool requires_low_latency_monitor = 5;
3425
Yangster-macb89807e2018-11-15 21:10:57 -08003426 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003427 UNKNOWN = 0;
3428 INSTALL_REQUESTED = 1;
3429 INSTALL_STARTED = 2;
3430 INSTALL_STAGED_NOT_READY = 3;
3431 INSTALL_STAGED_READY = 4;
3432 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003433 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3434 // and INSTALL_FAILURE_COMMIT.
3435 INSTALL_FAILURE = 6 [deprecated = true];
3436 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003437 INSTALL_CANCELLED = 7;
3438 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003439 INSTALLER_ROLLBACK_INITIATED = 9;
3440 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3441 INSTALLER_ROLLBACK_STAGED = 11;
3442 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3443 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3444 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3445 INSTALLER_ROLLBACK_SUCCESS = 15;
3446 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003447 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3448 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3449 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3450 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3451 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3452 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003453 INSTALL_FAILURE_DOWNLOAD = 23;
3454 INSTALL_FAILURE_STATE_MISMATCH = 24;
3455 INSTALL_FAILURE_COMMIT = 25;
Yangster-macb89807e2018-11-15 21:10:57 -08003456 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003457 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003458 // Possible experiment ids for monitoring this push.
3459 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3460 // user id
3461 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003462}
3463
Tej Singhc9203082019-05-03 13:42:23 -07003464/* Test atom, is not logged anywhere */
3465message TestAtomReported {
3466 repeated AttributionNode attribution_node = 1;
3467 optional int32 int_field = 2;
3468 optional int64 long_field = 3;
3469 optional float float_field = 4;
3470 optional string string_field = 5;
3471 optional bool boolean_field = 6;
3472 enum State {
3473 UNKNOWN = 0;
3474 OFF = 1;
3475 ON = 2;
3476 }
3477 optional State state = 7;
3478 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3479}
3480
Maggie Whitefc1aa592018-11-28 21:55:23 -08003481/** Represents USB port overheat event. */
3482message UsbPortOverheatEvent {
3483 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3484 optional int32 plug_temperature_deci_c = 1;
3485
3486 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3487 optional int32 max_temperature_deci_c = 2;
3488
3489 /* Time between USB plug event and overheat threshold trip, in seconds. */
3490 optional int32 time_to_overheat_secs = 3;
3491
3492 /* Time between overheat threshold trip and hysteresis, in seconds. */
3493 optional int32 time_to_hysteresis_secs = 4;
3494
3495 /* Time between hysteresis and active mitigation ending, in seconds. */
3496 optional int32 time_to_inactive_secs = 5;
3497};
3498
Maggie White8735b852019-01-18 11:40:49 -08003499/**
3500 * Logs total effective full charge and discharge cycles on a battery.
3501 * Here are some examples of one effective cycle:
3502 * 1) the battery charges from 0% to 100% and drains back to 0%,
3503 * 2) charging from 50% to 100% and draining back to 50% twice.
3504 * Pulled from:
3505 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3506 */
3507message BatteryCycleCount {
3508 /* Number of total charge and discharge cycles on the system battery. */
3509 optional int32 cycle_count = 1;
3510}
3511
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003512/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003513 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3514 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003515 * Pulled from:
3516 * StatsCompanionService
3517 */
3518
Carmen Agimof12dec122019-03-06 16:14:38 +00003519message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003520
Carmen Agimof12dec122019-03-06 16:14:38 +00003521 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003522 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003523 PUBLIC = 1;
3524 PRIVATE = 2;
3525 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003526 }
3527
Carmen Agimof12dec122019-03-06 16:14:38 +00003528 // The type of external storage.
3529 optional android.stats.storage.ExternalStorageType storage_type = 1;
3530 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3531 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003532 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003533 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003534}
3535
Yangster-macb89807e2018-11-15 21:10:57 -08003536/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003537 * Logs when a connection becomes available and lost.
3538 * Logged in StatsCompanionService.java
3539 */
3540message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003541 // Id of the network.
3542 optional int32 net_id = 1;
3543
3544 enum State {
3545 UNKNOWN = 0;
3546 CONNECTED = 1;
3547 DISCONNECTED = 2;
3548 }
3549 // Connected state of a network.
3550 optional State state = 2;
3551}
3552
3553/**
3554 * Logs when a service starts and stops.
3555 * Logged from:
3556 * services/core/java/com/android/server/am/ActiveServices.java
3557 */
3558message ServiceStateChanged {
3559
3560 optional int32 uid = 1 [(is_uid) = true];
3561
3562 optional string package_name = 2;
3563
3564 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003565
3566 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003567 START = 1;
3568 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003569 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003570
3571 optional State state = 4;
3572}
3573
3574/**
3575 * Logs when a service is launched.
3576 * Logged from:
3577 * services/core/java/com/android/server/am/ActiveServices.java
3578 */
3579message ServiceLaunchReported {
3580
3581 optional int32 uid = 1 [(is_uid) = true];
3582
3583 optional string package_name = 2;
3584
3585 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003586}
Howard Ro688ae182018-09-25 00:09:36 -07003587
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003588/**
3589 * Logs when a hidden API is used.
3590 *
3591 * Logged from:
3592 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3593 */
3594message HiddenApiUsed {
3595 // The uid of the app making the hidden access.
3596 optional int32 uid = 1 [(is_uid) = true];
3597
3598 // Signature of the method or field accessed.
3599 optional string signature = 2;
3600
3601 enum AccessMethod {
3602 NONE = 0;
3603 REFLECTION = 1;
3604 JNI = 2;
3605 LINKING = 3;
3606 }
3607
3608 // Type of access.
3609 optional AccessMethod access_method = 3;
3610
3611 // Whether the access was prevented or not.
3612 optional bool access_denied = 4;
3613}
3614
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003615/**
3616 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3617 * - When user sees privacy chip
3618 * - When user clicks privacy chip
3619 * - How does the user exit the Privacy Dialog
3620 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003621 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3622 */
3623message PrivacyIndicatorsInteracted {
3624
3625 enum Type {
3626 UNKNOWN = 0;
3627 CHIP_VIEWED = 1;
3628 CHIP_CLICKED = 2;
3629 DIALOG_PRIVACY_SETTINGS = 3;
3630 DIALOG_DISMISS = 4;
3631 DIALOG_LINE_ITEM = 5;
3632 }
3633
3634 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3635
3636 // Used if the type is LINE_ITEM
3637 optional string package_name = 2;
3638}
3639
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003640/**
3641 * Logs information about a package that is moved from the internal to external storage and vice
3642 * versa.
3643 * It logs the package name, the type of the external storage where the package is installed
3644 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3645 * and the move type: if it's from internal to external or the other way around.
3646 *
3647 * Logged from:
3648 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3649 */
3650message AppMovedStorageReported {
3651 enum MoveType {
3652 UNKNOWN = 0;
3653 TO_EXTERNAL = 1;
3654 TO_INTERNAL = 2;
3655 }
3656 // The type of the external storage.
3657 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3658 // The type of move.
3659 optional MoveType move_type = 2;
3660 // The name of the package that was moved.
3661 optional string package_name = 3;
3662}
3663
jianjin8f2dee02019-03-29 14:03:08 -07003664/**
3665 * Logs when system server watchdog occurs.
3666 * Logged from:
3667 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3668 */
3669message SystemServerWatchdogOccurred {
3670 optional string subject = 1;
3671}
3672
3673/**
3674 * Logs when new file added to tombstones.
3675 * Logged from:
3676 * frameworks/base/core/java/com/android/server/BootReceiver.java
3677 */
3678message TombStoneOccurred {
3679}
3680
Hai Zhang5d3328d2019-04-13 21:25:06 +08003681/*
3682 * Information about a role request
3683 *
3684 * Logged from:
3685 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3686 */
3687message RoleRequestResultReported {
3688 // UID of application requesting the role
3689 optional int32 requesting_uid = 1;
3690
3691 // Package name of application requesting the role
3692 optional string requesting_package_name = 2;
3693
3694 // The role to be granted
3695 optional string role_name = 3;
3696
3697 // The count of applications qualifying for the role
3698 optional int32 qualifying_count = 4;
3699
3700 // UID of application current granted the role
3701 optional int32 current_uid = 5;
3702
3703 // Package name of application current granted the role
3704 optional string current_package_name = 6;
3705
3706 // UID of another application that user chose to grant the role to, instead of the requesting
3707 // application
3708 optional int32 granted_another_uid = 7;
3709
3710 // Package name of another application that user chose to grant the role to, instead of the
3711 // requesting application
3712 optional string granted_another_package_name = 8;
3713
3714 enum Result {
3715 UNDEFINED = 0;
3716 // role request was ignored
3717 IGNORED = 1;
3718 // role request was ignored because it's already granted
3719 IGNORED_ALREADY_GRANTED = 2;
3720 // role request was ignored because the application isn't qualified
3721 IGNORED_NOT_QUALIFIED = 3;
3722 // role request was ignored because user said it should be always denied
3723 IGNORED_USER_ALWAYS_DENIED = 4;
3724 // role was granted by user action
3725 USER_GRANTED = 5;
3726 // role was denied by user action
3727 USER_DENIED = 6;
3728 // role was denied by user granting another application the role
3729 USER_DENIED_GRANTED_ANOTHER = 7;
3730 // role was denied and set to be always denied by the user
3731 USER_DENIED_WITH_ALWAYS = 8;
3732 }
3733 // The result of the role request
3734 optional Result result = 9;
3735}
3736
Mark Tabrya824a642019-11-05 12:26:12 -08003737/**
3738 * Logs when a Vehicle Maps Service client's connection state has changed
3739 *
3740 * Logged from:
3741 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
3742 */
3743message VmsClientConnectionStateChanged {
3744 // The UID of the VMS client app
3745 optional int32 uid = 1 [(is_uid) = true];
3746
3747 enum State {
3748 UNKNOWN = 0;
3749 // Attempting to connect to the client
3750 CONNECTING = 1;
3751 // Client connection established
3752 CONNECTED = 2;
3753 // Client connection closed unexpectedly
3754 DISCONNECTED = 3;
3755 // Client connection closed by VMS
3756 TERMINATED = 4;
3757 // Error establishing the client connection
3758 CONNECTION_ERROR = 5;
3759 }
3760
3761 optional State state = 2;
3762}
3763
Chenjie Yubbcbc602018-02-05 16:51:52 -08003764//////////////////////////////////////////////////////////////////////
3765// Pulled atoms below this line //
3766//////////////////////////////////////////////////////////////////////
3767
3768/**
David Chenc8a43242017-10-17 16:23:28 -07003769 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3770 *
3771 * Pulled from:
3772 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3773 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003774message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003775 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003776
3777 optional int64 rx_bytes = 2;
3778
3779 optional int64 rx_packets = 3;
3780
3781 optional int64 tx_bytes = 4;
3782
3783 optional int64 tx_packets = 5;
3784}
3785
3786/**
3787 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3788 *
3789 * Pulled from:
3790 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3791 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003792message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003793 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003794
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003795 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3796 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003797
3798 optional int64 rx_bytes = 3;
3799
3800 optional int64 rx_packets = 4;
3801
3802 optional int64 tx_bytes = 5;
3803
3804 optional int64 tx_packets = 6;
3805}
3806
3807/**
3808 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3809 *
3810 * Pulled from:
3811 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3812 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003813message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003814 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003815
3816 optional int64 rx_bytes = 2;
3817
3818 optional int64 rx_packets = 3;
3819
3820 optional int64 tx_bytes = 4;
3821
3822 optional int64 tx_packets = 5;
3823}
3824
3825/**
3826 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3827 *
3828 * Pulled from:
3829 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3830 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003831message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003832 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003833
Yao Chenc40a19d2018-03-15 16:48:25 -07003834 // 1 denotes foreground and 0 denotes background. This is called Set in
3835 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003836 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003837
3838 optional int64 rx_bytes = 3;
3839
3840 optional int64 rx_packets = 4;
3841
3842 optional int64 tx_bytes = 5;
3843
3844 optional int64 tx_packets = 6;
3845}
3846
3847/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003848 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3849 *
3850 * Pulled from:
3851 * StatsCompanionService
3852 */
3853message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003854 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003855
3856 optional int64 rx_bytes = 2;
3857
3858 optional int64 tx_bytes = 3;
3859}
3860
3861/**
David Chenc8a43242017-10-17 16:23:28 -07003862 * Pulls the kernel wakelock durations. This atom is adapted from
3863 * android/internal/os/KernelWakelockStats.java
3864 *
3865 * Pulled from:
3866 * StatsCompanionService using KernelWakelockReader.
3867 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003868message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003869 optional string name = 1;
3870
3871 optional int32 count = 2;
3872
3873 optional int32 version = 3;
3874
Yangster-maca8a30442018-10-13 23:46:34 -07003875 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003876}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003877
Chenjie Yu05013b32017-11-21 10:21:41 -08003878/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003879 * Pulls low power state information. If power.stats HAL is not available, this
3880 * includes platform and subsystem sleep state information,
3881 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3882 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003883 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003884 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003885 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3886 * as defined in:
3887 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003888 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003889message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003890 // Subsystem name
3891 optional string subsystem_name = 1;
3892 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3893 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003894 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3895 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003896 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003897 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003898 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003899 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003900 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003901}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003902
Chenjie Yu05013b32017-11-21 10:21:41 -08003903/**
Bookatz92da2832018-11-01 18:10:03 -07003904 * Pulls on-device power measurement information.
3905 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3906 * Pulled from:
3907 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3908 */
3909message OnDevicePowerMeasurement {
3910 // Name of the subsystem (to which the rail belongs).
3911 optional string subsystem_name = 1;
3912
3913 // Rail name. The rail lies within the subsystem.
3914 optional string rail_name = 2;
3915
3916 // Time (in ms since boot) at which the rail energy value was measured.
3917 // This may differ slightly from the time that statsd logs this information.
3918 optional uint64 measurement_timestamp_millis = 3;
3919
3920 // Accumulated energy used via the rail since device boot in uWs.
3921 optional uint64 energy_microwatt_secs = 4;
3922}
3923
3924/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003925 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003926 * Pulls the time the cpu spend on the frequency index. Frequency index
3927 * starts from highest to lowest. The value should be monotonically
3928 * increasing since boot. However, if there is a cpu
3929 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003930 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003931message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003932 optional uint32 cluster = 1;
3933 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003934 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003935}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003936
Chenjie Yu05013b32017-11-21 10:21:41 -08003937/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003938 * Pulls Cpu Time Per Uid.
3939 * Note that isolated process uid time should be attributed to host uids.
3940 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003941message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003942 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003943 optional uint64 user_time_micros = 2;
3944 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003945}
3946
3947/**
3948 * Pulls Cpu Time Per Uid per frequency.
3949 * Note that isolated process uid time should be attributed to host uids.
3950 * For each uid, we order the time by descending frequencies.
3951 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003952message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003953 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003954 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003955 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003956}
Hugo Benichi884970e2017-11-14 22:42:46 +09003957
Chenjie Yu05013b32017-11-21 10:21:41 -08003958/**
3959 * Pulls Wifi Controller Activity Energy Info
3960 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003961message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003962 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003963 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003964 // stack reported state
3965 // TODO: replace this with proto enum
3966 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003967 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003968 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003969 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003970 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003971 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003972 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003973 // product of current(mA), voltage(V) and time(ms)
3974 optional uint64 controller_energy_used = 6;
3975}
3976
3977/**
3978 * Pulls Modem Activity Energy Info
3979 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003980message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003981 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003982 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003983 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003984 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003985 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003986 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003987 /**
3988 * Tx power index
3989 * index 0 = tx_power < 0dBm
3990 * index 1 = 0dBm < tx_power < 5dBm
3991 * index 2 = 5dBm < tx_power < 15dBm
3992 * index 3 = 15dBm < tx_power < 20dBm
3993 * index 4 = tx_power > 20dBm
3994 */
3995 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003996 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003997 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003998 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003999 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004000 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004001 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004002 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004003 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004004 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004005 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004006 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004007 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004008 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004009}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004010
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004011/**
4012 * Pulls Bluetooth Activity Energy Info
4013 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4014 */
4015message BluetoothActivityInfo {
4016 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004017 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004018 // bluetooth stack state
4019 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004020 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004021 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004022 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004023 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004024 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004025 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004026 // product of current(mA), voltage(V) and time(ms)
4027 optional uint64 energy_used = 6;
4028}
4029
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004030/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004031 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004032 *
4033 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004034 */
4035message ProcessMemoryState {
4036 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004037 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004038
4039 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004040 // Usually package name, "system" for system server.
4041 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004042 optional string process_name = 2;
4043
Rafal Slawikda51b932018-12-13 16:31:33 +00004044 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004045 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004046
4047 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004048 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004049
4050 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004051 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004052
Rajeev Kumar90235992018-01-29 11:06:48 -08004053 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004054 // Value is read from memory.stat, field total_rss if per-app memory
4055 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004056 optional int64 rss_in_bytes = 6;
4057
4058 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004059 // Value is read from memory.stat, field total_cache if per-app memory
4060 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004061 optional int64 cache_in_bytes = 7;
4062
4063 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004064 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004065 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004066 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004067
Rafal Slawik203c3db2019-09-25 19:53:01 +01004068 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004069 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004070
Rafal Slawik203c3db2019-09-25 19:53:01 +01004071 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4072 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004073
Rafal Slawik203c3db2019-09-25 19:53:01 +01004074 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4075 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004076}
4077
4078/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004079 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004080 *
4081 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4082 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004083 *
4084 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004085 */
4086message ProcessMemoryHighWaterMark {
4087 // The uid if available. -1 means not available.
4088 optional int32 uid = 1 [(is_uid) = true];
4089
Rafal Slawikda51b932018-12-13 16:31:33 +00004090 // The process name.
4091 // Usually package name or process cmdline.
4092 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004093 optional string process_name = 2;
4094
Rafal Slawik239b6802019-09-09 18:46:01 +01004095 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4096 // computed by converting kilobytes to bytes.
4097 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4098
Rafal Slawik3bea8952018-11-15 12:39:33 +00004099 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4100 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004101 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004102}
4103
4104/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004105 * Logs the memory stats for a process.
4106 *
4107 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4108 * and for selected native processes.
4109 */
4110message ProcessMemorySnapshot {
4111 // The uid if available. -1 means not available.
4112 optional int32 uid = 1 [(is_uid) = true];
4113
4114 // The process name.
4115 // Usually package name or process cmdline.
4116 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4117 optional string process_name = 2;
4118
4119 // The pid of the process.
4120 // Allows to disambiguate instances of the process.
4121 optional int32 pid = 3;
4122
4123 // The current OOM score adjustment value.
4124 // Read from ProcessRecord for managed processes.
4125 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4126 optional int32 oom_score_adj = 4;
4127
4128 // The current RSS of the process.
4129 // VmRSS from /proc/pid/status.
4130 optional int32 rss_in_kilobytes = 5;
4131
4132 // The current anon RSS of the process.
4133 // RssAnon from /proc/pid/status.
4134 optional int32 anon_rss_in_kilobytes = 6;
4135
4136 // The current swap size of the process.
4137 // VmSwap from /proc/pid/status.
4138 optional int32 swap_in_kilobytes = 7;
4139
4140 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4141 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4142}
4143
4144/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004145 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004146 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004147message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004148 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004149}
4150
4151/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004152 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004153 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004154message SystemUptime {
4155 // Milliseconds since the system was booted.
4156 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4157 // for external input).
4158 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004159 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004160}
4161
4162/*
4163 * Reads from /proc/uid_concurrent_active_time which has the format:
4164 * active: X (X is # cores)
4165 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4166 * [uid1]: [time-0] [time-1] [time-2] ... ...
4167 * ...
4168 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4169 * The file contains a monotonically increasing count of time for a single boot.
4170 */
4171message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004172 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004173 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004174}
4175
4176/**
4177 * Reads from /proc/uid_concurrent_policy_time which has the format:
4178 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4179 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4180 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4181 * ...
4182 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4183 * The file contains a monotonically increasing count of time for a single boot.
4184 */
4185message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004186 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004187 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004188 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004189}
4190
4191/*
4192 * Pulls free disk space, for data, system partition and temporary directory.
4193 */
4194message DiskSpace {
4195 // available bytes in data partition
4196 optional uint64 data_available_bytes = 1;
4197 // available bytes in system partition
4198 optional uint64 system_available_bytes = 2;
4199 // available bytes in download cache or temp directories
4200 optional uint64 temp_available_bytes = 3;
4201}
Tej Singhbf972d92018-01-10 20:51:13 -08004202
4203/**
4204 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004205 *
4206 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004207 */
4208message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004209 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004210}
4211
4212/**
4213 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004214 * Pulled from:
4215 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004216 */
4217message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004218 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004219}
4220
4221/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004222 * Pulls battery voltage.
4223 * Pulled from:
4224 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4225 */
4226message BatteryVoltage {
4227 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004228 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004229}
4230
4231/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004232 * Pulls battery level (percent full, from 0 to 100).
4233 *
4234 * Pulled from:
4235 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4236 */
4237message BatteryLevel {
4238 // Battery level. Should be in [0, 100].
4239 optional int32 battery_level = 1;
4240}
4241
4242/**
Tej Singhd89137e2018-03-26 14:51:40 -07004243 * Pulls the temperature of various parts of the device.
4244 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004245 *
Maggie White442b6312019-04-05 16:26:44 -07004246 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004247 */
4248message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004249 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004250 optional android.os.TemperatureTypeEnum sensor_location = 1;
4251
4252 // The name of the temperature source. Eg. CPU0
4253 optional string sensor_name = 2;
4254
Tej Singhd89137e2018-03-26 14:51:40 -07004255 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004256 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004257 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004258
4259 // Relative severity of the throttling, see enum definition.
4260 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004261}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004262
4263/**
4264 * Pulls the statistics of calls to Binder.
4265 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004266 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4267 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004268 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004269 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004270 */
4271message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004272 // UID of the process responsible for the binder transaction. It will be set if the process
4273 // executing the binder transaction attribute the transaction to another uid using
4274 // Binder.setThreadWorkSource().
4275 //
4276 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004277 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004278 // UID of the process executing the binder transaction.
4279 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004280 // Fully qualified class name of the API call.
4281 //
4282 // This is a system server class name.
4283 //
4284 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4285 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4286 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4287 // commonly used APIs.
4288 optional string service_class_name = 2;
4289 // Method name of the API call. It can also be a transaction code if we cannot
4290 // resolve it to a name. See Binder#getTransactionName.
4291 //
4292 // This is a system server method name.
4293 optional string service_method_name = 3;
4294 // Total number of API calls.
4295 optional int64 call_count = 4;
4296 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4297 optional bool screen_interactive = 13;
4298 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4299 // call_count will be equal to recorded_call_count.
4300 //
4301 // If recorded_call_count is different than call_count, it means data collection has been
4302 // sampled. All the fields below will be sampled in this case.
4303 optional int64 recorded_call_count = 12;
4304 // Number of exceptions thrown by the API.
4305 optional int64 recorded_exception_count = 5;
4306 // Total latency of all API calls.
4307 // Average can be computed using total_latency_micros / recorded_call_count.
4308 optional int64 recorded_total_latency_micros = 6;
4309 // Maximum latency of one API call.
4310 optional int64 recorded_max_latency_micros = 7;
4311 // Total CPU usage of all API calls.
4312 // Average can be computed using total_cpu_micros / recorded_call_count.
4313 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4314 optional int64 recorded_total_cpu_micros = 8;
4315 // Maximum CPU usage of one API call.
4316 optional int64 recorded_max_cpu_micros = 9;
4317 // Maximum parcel reply size of one API call.
4318 optional int64 recorded_max_reply_size_bytes = 10;
4319 // Maximum parcel request size of one API call.
4320 optional int64 recorded_max_request_size_bytes = 11;
4321}
4322
4323/**
4324 * Pulls the statistics of exceptions during calls to Binder.
4325 *
4326 * Binder stats are cumulative from boot unless somebody reset the data using
4327 * > adb shell dumpsys binder_calls_stats --reset
4328 */
4329message BinderCallsExceptions {
4330 // Exception class name, e.g. java.lang.IllegalArgumentException.
4331 //
4332 // This is an exception class name thrown by the system server.
4333 optional string exception_class_name = 1;
4334 // Total number of exceptions.
4335 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004336}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004337
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004338/**
4339 * Pulls the statistics of message dispatching on HandlerThreads.
4340 *
4341 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4342 * config on the device.
4343 *
4344 * Next tag: 11
4345 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004346message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004347 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004348 optional int32 uid = 1 [(is_uid) = true];
4349
4350 // Fully qualified class name of the handler target class.
4351 //
4352 // This field does not contain PII. This is a system server class name.
4353 optional string handler_class_name = 2;
4354
4355 // The name of the thread that runs the Looper.
4356 //
4357 // This field does not contain PII. This is a system server thread name.
4358 optional string looper_thread_name = 3;
4359
4360 // The name of the dispatched message.
4361 //
4362 // This field does not contain PII. This is a system server constant or class
4363 // name.
4364 optional string message_name = 4;
4365
4366 // Total number of successfully dispatched messages.
4367 optional int64 message_count = 5;
4368
4369 // Total number of messages that failed dispatching.
4370 optional int64 exception_count = 6;
4371
4372 // Total number of processed messages we have data recorded for. If we
4373 // collected data for all the messages, message_count will be equal to
4374 // recorded_message_count.
4375 //
4376 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004377 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004378 optional int64 recorded_message_count = 7;
4379
4380 // Total latency of all processed messages.
4381 // Average can be computed using recorded_total_latency_micros /
4382 // recorded_message_count.
4383 optional int64 recorded_total_latency_micros = 8;
4384
4385 // Total CPU usage of all processed message.
4386 // Average can be computed using recorded_total_cpu_micros /
4387 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004388 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004389 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004390
4391 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4392 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004393
4394 // Max recorded CPU usage of all processed messages.
4395 optional int64 recorded_max_cpu_micros = 11;
4396
4397 // Max recorded latency of all processed messages.
4398 optional int64 recorded_max_latency_micros = 12;
4399
4400 // Total number of messages we tracked the dispatching delay for. If we
4401 // collected data for all the messages, message_count will be equal to
4402 // recorded_delay_message_count.
4403 //
4404 // If recorded_delay_message_count is different than message_count, it means data
4405 // collection has been sampled or/and not all messages specified the target dispatch time.
4406 // The fields below will be sampled in this case.
4407 optional int64 recorded_delay_message_count = 13;
4408
4409 // Total dispatching delay of all processed messages.
4410 // Calculated as a difference between the target dispatching time (Message.when)
4411 // and the actual dispatching time.
4412 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4413 optional int64 recorded_total_delay_millis = 14;
4414
4415 // Max dispatching delay of all processed messages.
4416 // Calculated as a difference between the target dispatching time (Message.when)
4417 // and the actual dispatching time.
4418 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004419}
Tej Singh86dc9db2018-09-06 00:39:57 +00004420
4421/**
4422 * Pulls disk information, such as write speed and latency.
4423 */
4424message DiskStats {
4425 // Time taken to open, write 512B to, and close a file.
4426 // -1 if error performing the check.
4427 optional int64 data_write_latency_millis = 1;
4428
4429 optional bool file_based_encryption = 2;
4430
4431 // Recent disk write speed in kB/s.
4432 // -1 if error querying storageed.
4433 // 0 if data is unavailable.
4434 optional int32 recent_disk_write_speed = 3;
4435}
4436
4437
4438/**
4439 * Free and total bytes of the Data, Cache, and System partition.
4440 */
4441message DirectoryUsage {
4442 enum Directory {
4443 UNKNOWN = 0;
4444 DATA = 1;
4445 CACHE = 2;
4446 SYSTEM = 3;
4447 }
4448 optional Directory directory = 1;
4449 optional int64 free_bytes = 2;
4450 optional int64 total_bytes = 3;
4451}
4452
4453
4454/**
4455 * Size of an application: apk size, data size, and cache size.
4456 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4457 * Information is only reported for apps with the primary user (user 0).
4458 * Sizes are aggregated by package name.
4459 */
4460message AppSize {
4461 // Including uids will involve modifying diskstats logic.
4462 optional string package_name = 1;
4463 // App size in bytes. -1 if unavailable.
4464 optional int64 app_size_bytes = 2;
4465 // App data size in bytes. -1 if unavailable.
4466 optional int64 app_data_size_bytes = 3;
4467 // App cache size in bytes. -1 if unavailable.
4468 optional int64 app_cache_size_bytes = 4;
4469 // Time that the cache file was produced.
4470 // Uses System.currentTimeMillis(), which is wall clock time.
4471 optional int64 cache_time_millis = 5;
4472}
4473
4474
4475/**
4476 * Size of a particular category. Eg: photos, videos.
4477 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4478 */
4479message CategorySize {
4480 enum Category {
4481 UNKNOWN = 0;
4482 APP_SIZE = 1;
4483 APP_DATA_SIZE = 2;
4484 APP_CACHE_SIZE = 3;
4485 PHOTOS = 4;
4486 VIDEOS = 5;
4487 AUDIO = 6;
4488 DOWNLOADS = 7;
4489 SYSTEM = 8;
4490 OTHER = 9;
4491 }
4492 optional Category category = 1;
4493 // Category size in bytes.
4494 optional int64 size_bytes = 2;
4495 // Time that the cache file was produced.
4496 // Uses System.currentTimeMillis(), which is wall clock time.
4497 optional int64 cache_time_millis = 3;
4498}
Tej Singhd6d6d772018-09-05 17:41:25 -07004499
4500/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004501 * Pulls per uid I/O stats. The stats are cumulative since boot.
4502 *
4503 * Read/write bytes are I/O events from a storage device
4504 * Read/write chars are data requested by read/write syscalls, and can be
4505 * satisfied by caching.
4506 *
4507 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4508 */
4509message DiskIo {
4510 optional int32 uid = 1 [(is_uid) = true];
4511 optional int64 fg_chars_read = 2;
4512 optional int64 fg_chars_write = 3;
4513 optional int64 fg_bytes_read = 4;
4514 optional int64 fg_bytes_write = 5;
4515 optional int64 bg_chars_read = 6;
4516 optional int64 bg_chars_write = 7;
4517 optional int64 bg_bytes_read = 8;
4518 optional int64 bg_bytes_write = 9;
4519 optional int64 fg_fsync = 10;
4520 optional int64 bg_fsync= 11;
4521}
4522
4523
4524/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004525 * Pulls the number of fingerprints for each user.
4526 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004527 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004528 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004529message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004530 // The associated user. Eg: 0 for owners, 10+ for others.
4531 // Defined in android/os/UserHandle.java
4532 optional int32 user = 1;
4533 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004534 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004535}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004536
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004537/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004538 * Pulls the number of faces for each user.
4539 *
4540 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4541 */
4542message NumFacesEnrolled {
4543 // The associated user. Eg: 0 for owners, 10+ for others.
4544 // Defined in android/os/UserHandle.java
4545 optional int32 user = 1;
4546 // Number of faces registered to that user.
4547 optional int32 num_faces_enrolled = 2;
4548}
4549/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004550 * A mapping of role holder -> role
4551 */
4552message RoleHolder {
4553 // uid of the role holder
4554 optional int32 uid = 1 [(is_uid) = true];
4555
4556 // package name of the role holder
4557 optional string package_name = 2;
4558
4559 // the role held
4560 optional string role = 3;
4561}
4562
Yangsteraf9aee72018-10-12 09:26:16 -07004563message AggStats {
4564 optional int64 min = 1;
4565
4566 optional int64 average = 2;
4567
4568 optional int64 max = 3;
4569}
4570
4571message ProcessStatsStateProto {
4572 optional android.service.procstats.ScreenState screen_state = 1;
4573
4574 optional android.service.procstats.MemoryState memory_state = 2;
4575
4576 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4577 // and not frameworks/base/core/java/android/app/ActivityManager.java
4578 optional android.service.procstats.ProcessState process_state = 3;
4579
4580 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004581 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004582
4583 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004584 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004585
4586 // # of samples taken
4587 optional int32 sample_size = 5;
4588
4589 // PSS is memory reserved for this process
4590 optional AggStats pss = 6;
4591
4592 // USS is memory shared between processes, divided evenly for accounting
4593 optional AggStats uss = 7;
4594
4595 // RSS is memory resident for this process
4596 optional AggStats rss = 8;
4597}
4598
4599// Next Tag: 7
4600message ProcessStatsProto {
4601 // Name of process.
4602 optional string process = 1;
4603
4604 // Uid of the process.
4605 optional int32 uid = 2;
4606
4607 // Information about how often kills occurred
4608 message Kill {
4609 // Count of excessive CPU kills
4610 optional int32 cpu = 1;
4611
4612 // Count of kills when cached
4613 optional int32 cached = 2;
4614
4615 // PSS stats during cached kill
4616 optional AggStats cached_pss = 3;
4617 }
4618 optional Kill kill = 3;
4619
4620 // Time and memory spent in various states.
4621 repeated ProcessStatsStateProto states = 5;
4622
4623 // Total time process has been running... screen_state, memory_state, and process_state
4624 // will not be set.
4625 optional ProcessStatsStateProto total_running_state = 6;
4626}
4627
4628message PackageServiceOperationStatsProto {
4629 // Operate enum: Started, Foreground, Bound, Executing
4630 optional android.service.procstats.ServiceOperationState operation = 1;
4631
4632 // Number of times the service was in this operation.
4633 optional int32 count = 2;
4634
4635 // Information about a state the service can be in.
4636 message StateStats {
4637 // Screen state enum.
4638 optional android.service.procstats.ScreenState screen_state = 1;
4639 // Memory state enum.
4640 optional android.service.procstats.MemoryState memory_state = 2;
4641
4642 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004643 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004644 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004645 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004646 }
4647 repeated StateStats state_stats = 3;
4648}
4649
4650message PackageServiceStatsProto {
4651 // Name of service component.
4652 optional string service_name = 1;
4653
4654 // The operation stats.
4655 // The package_name, package_uid, package_version, service_name will not be set to save space.
4656 repeated PackageServiceOperationStatsProto operation_stats = 2;
4657}
4658
4659message PackageAssociationSourceProcessStatsProto {
4660 // Uid of the process.
4661 optional int32 process_uid = 1;
4662 // Process name.
4663 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004664 // Package name.
4665 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004666 // Total count of the times this association appeared.
4667 optional int32 total_count = 3;
4668
4669 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004670 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004671
4672 // Total count of the times this association became actively impacting its target process.
4673 optional int32 active_count = 5;
4674
4675 // Information on one source in this association.
4676 message StateStats {
4677 // Process state enum.
4678 optional android.service.procstats.ProcessState process_state = 1;
4679 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004680 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004681 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004682 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004683 }
4684 repeated StateStats active_state_stats = 6;
4685}
4686
4687message PackageAssociationProcessStatsProto {
4688 // Name of the target component.
4689 optional string component_name = 1;
4690 // Information on one source in this association.
4691 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4692}
4693
4694
4695message ProcessStatsPackageProto {
4696 // Name of package.
4697 optional string package = 1;
4698
4699 // Uid of the package.
4700 optional int32 uid = 2;
4701
4702 // Version of the package.
4703 optional int64 version = 3;
4704
4705 // Stats for each process running with the package loaded in to it.
4706 repeated ProcessStatsProto process_stats = 4;
4707
4708 // Stats for each of the package's services.
4709 repeated PackageServiceStatsProto service_stats = 5;
4710
4711 // Stats for each association with the package.
4712 repeated PackageAssociationProcessStatsProto association_stats = 6;
4713}
4714
4715message ProcessStatsSectionProto {
4716 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004717 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004718
4719 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004720 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004721
4722 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004723 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004724
4725 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004726 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004727
4728 // System runtime library. e.g. "libdvm.so", "libart.so".
4729 optional string runtime = 5;
4730
4731 // whether kernel reports swapped pss.
4732 optional bool has_swapped_pss = 6;
4733
4734 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4735 enum Status {
4736 STATUS_UNKNOWN = 0;
4737 STATUS_COMPLETE = 1;
4738 STATUS_PARTIAL = 2;
4739 STATUS_SHUTDOWN = 3;
4740 STATUS_SYSPROPS = 4;
4741 }
4742 repeated Status status = 7;
4743
Chenjie Yub2ecc792019-01-17 10:27:26 -08004744 // Number of pages available of various types and sizes, representation fragmentation.
4745 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4746
Yangsteraf9aee72018-10-12 09:26:16 -07004747 // Stats for each process.
4748 repeated ProcessStatsProto process_stats = 8;
4749
4750 // Stats for each package.
4751 repeated ProcessStatsPackageProto package_stats = 9;
4752}
4753
Chenjie Yub2ecc792019-01-17 10:27:26 -08004754message ProcessStatsAvailablePagesProto {
4755 // Node these pages are in (as per /proc/pagetypeinfo)
4756 optional int32 node = 1;
4757
4758 // Zone these pages are in (as per /proc/pagetypeinfo)
4759 optional string zone = 2;
4760
4761 // Label for the type of these pages (as per /proc/pagetypeinfo)
4762 optional string label = 3;
4763
4764 // Distribution of number of pages available by order size. First entry in array is
4765 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4766 repeated int32 pages_per_order = 4;
4767}
4768
Chenjie Yu12e5e672018-09-14 15:54:59 -07004769/**
4770 * Pulled from ProcessStatsService.java
4771 */
4772message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004773 optional ProcessStatsSectionProto proc_stats_section = 1;
4774}
4775
Chenjie Yuf910b7802019-01-11 16:08:20 -08004776/**
4777 * Pulled from ProcessStatsService.java
4778 */
4779message ProcStatsPkgProc {
4780 optional ProcessStatsSectionProto proc_stats_section = 1;
4781}
4782
Yangsteraf9aee72018-10-12 09:26:16 -07004783message PowerProfileProto {
4784 optional double cpu_suspend = 1;
4785
4786 optional double cpu_idle = 2;
4787
4788 optional double cpu_active = 3;
4789
4790 message CpuCluster {
4791 optional int32 id = 1;
4792 optional double cluster_power = 2;
4793 optional int32 cores = 3;
4794 repeated int64 speed = 4;
4795 repeated double core_power = 5;
4796 }
4797
4798 repeated CpuCluster cpu_cluster = 40;
4799
4800 optional double wifi_scan = 4;
4801
4802 optional double wifi_on = 5;
4803
4804 optional double wifi_active = 6;
4805
4806 optional double wifi_controller_idle = 7;
4807
4808 optional double wifi_controller_rx = 8;
4809
4810 optional double wifi_controller_tx = 9;
4811
4812 repeated double wifi_controller_tx_levels = 10;
4813
4814 optional double wifi_controller_operating_voltage = 11;
4815
4816 optional double bluetooth_controller_idle = 12;
4817
4818 optional double bluetooth_controller_rx = 13;
4819
4820 optional double bluetooth_controller_tx = 14;
4821
4822 optional double bluetooth_controller_operating_voltage = 15;
4823
4824 optional double modem_controller_sleep = 16;
4825
4826 optional double modem_controller_idle = 17;
4827
4828 optional double modem_controller_rx = 18;
4829
4830 repeated double modem_controller_tx = 19;
4831
4832 optional double modem_controller_operating_voltage = 20;
4833
4834 optional double gps_on = 21;
4835
4836 repeated double gps_signal_quality_based = 22;
4837
4838 optional double gps_operating_voltage = 23;
4839
4840 optional double bluetooth_on = 24;
4841
4842 optional double bluetooth_active = 25;
4843
4844 optional double bluetooth_at_cmd = 26;
4845
4846 optional double ambient_display = 27;
4847
4848 optional double screen_on = 28;
4849
4850 optional double radio_on = 29;
4851
4852 optional double radio_scanning = 30;
4853
4854 optional double radio_active = 31;
4855
4856 optional double screen_full = 32;
4857
4858 optional double audio = 33;
4859
4860 optional double video = 34;
4861
4862 optional double flashlight = 35;
4863
4864 optional double memory = 36;
4865
4866 optional double camera = 37;
4867
4868 optional double wifi_batched_scan = 38;
4869
4870 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004871}
Chenjie Yuab530202018-09-26 12:39:20 -07004872
4873/**
4874 * power_profile.xml and other constants for power model calculations.
4875 * Pulled from PowerProfile.java
4876 */
4877message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004878 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004879}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004880
4881/**
arangelovd5db50e2018-10-12 20:24:39 +01004882 * Logs when a user restriction was added or removed.
4883 *
4884 * Logged from:
4885 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4886 */
4887message UserRestrictionChanged {
4888 // The raw string of the user restriction as defined in UserManager.
4889 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4890 optional string restriction = 1;
4891 // Whether the restriction is enabled or disabled.
4892 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004893}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004894
4895/**
4896 * Pulls process user time and system time. Puller takes a snapshot of all pids
4897 * in the system and returns cpu stats for those that are working at the time.
4898 * Dead pids will be dropped. Kernel processes are excluded.
4899 * Min cool-down is 5 sec.
4900 */
4901message ProcessCpuTime {
4902 optional int32 uid = 1 [(is_uid) = true];
4903
4904 optional string process_name = 2;
4905 // Process cpu time in user space, cumulative from boot/process start
4906 optional int64 user_time_millis = 3;
4907 // Process cpu time in system space, cumulative from boot/process start
4908 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004909}
Misha Wagner5a51e002018-10-03 15:04:09 +01004910
4911/**
4912 * Pulls the CPU usage for each thread.
4913 *
4914 * Read from /proc/$PID/task/$TID/time_in_state files.
4915 *
4916 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4917 * time_in_state files not being present on some phones, have not been addressed. These should be
4918 * considered before a public release.
4919 */
4920message CpuTimePerThreadFreq {
4921 // UID that owns the process.
4922 optional int32 uid = 1 [(is_uid) = true];
4923 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004924 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004925 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004926 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004927 // Name of the process taken from `/proc/$PID/cmdline`.
4928 optional string process_name = 4;
4929 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4930 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004931
4932 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4933 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4934 // frequencies are given here as the alternative is sending eight separate atoms. This method
4935 // significantly reduces the amount of data created
4936 optional int32 frequency1_khz = 6;
4937 optional int32 time1_millis = 7;
4938 optional int32 frequency2_khz = 8;
4939 optional int32 time2_millis = 9;
4940 optional int32 frequency3_khz = 10;
4941 optional int32 time3_millis = 11;
4942 optional int32 frequency4_khz = 12;
4943 optional int32 time4_millis = 13;
4944 optional int32 frequency5_khz = 14;
4945 optional int32 time5_millis = 15;
4946 optional int32 frequency6_khz = 16;
4947 optional int32 time6_millis = 17;
4948 optional int32 frequency7_khz = 18;
4949 optional int32 time7_millis = 19;
4950 optional int32 frequency8_khz = 20;
4951 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004952}
Bookatz75ee6042018-11-09 12:27:37 -08004953
4954/**
Bookatz366a4432018-11-20 09:42:33 -08004955 * Pulls information about the device's build.
4956 */
4957message BuildInformation {
4958 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4959 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4960 optional string fingerprint = 1;
4961
4962 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4963 optional string brand = 2;
4964
4965 // Build.PRODUCT. The name of the overall product.
4966 optional string product = 3;
4967
4968 // Build.DEVICE. The name of the industrial design.
4969 optional string device = 4;
4970
4971 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4972 optional string version_release = 5;
4973
4974 // Build.ID. E.g. a label like "M4-rc20".
4975 optional string id = 6;
4976
4977 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4978 // represent this build.
4979 optional string version_incremental = 7;
4980
4981 // Build.TYPE. The type of build, like "user" or "eng".
4982 optional string type = 8;
4983
4984 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4985 optional string tags = 9;
4986}
4987
4988/**
Adam He420947c2019-01-23 15:59:09 -08004989 * Logs information about mismatched caller for content capture.
4990 *
4991 * Logged from:
4992 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
4993 */
4994message ContentCaptureCallerMismatchReported {
4995 optional string intended_package = 1;
4996 optional string calling_package = 2;
4997}
4998
4999/**
5000 * Logs information about content capture service events.
5001 *
5002 * Logged from:
5003 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5004 */
5005message ContentCaptureServiceEvents {
5006 // The type of event.
5007 enum Event {
5008 UNKNOWN = 0;
5009 ON_CONNECTED = 1;
5010 ON_DISCONNECTED = 2;
5011 SET_WHITELIST = 3;
5012 SET_DISABLED = 4;
5013 ON_USER_DATA_REMOVED = 5;
5014 }
5015 optional Event event = 1;
5016 // component/package of content capture service.
5017 optional string service_info = 2;
5018 // component/package of target.
5019 // it's a concatenated list of component/package for SET_WHITELIST event
5020 // separated by " ".
5021 optional string target_info = 3;
5022}
5023
5024/**
5025 * Logs information about content capture session events.
5026 *
5027 * Logged from:
5028 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5029 */
5030message ContentCaptureSessionEvents {
5031 // The type of event.
5032 enum Event {
5033 UNKNOWN = 0;
5034 ON_SESSION_STARTED = 1;
5035 ON_SESSION_FINISHED = 2;
5036 SESSION_NOT_CREATED = 3;
5037 }
5038 optional int32 session_id = 1;
5039 optional Event event = 2;
5040 // (n/a on session finished)
5041 optional int32 state_flags = 3;
5042 // component/package of content capture service.
5043 optional string service_info = 4;
5044 // component/package of app.
5045 // (n/a on session finished)
5046 optional string app_info = 5;
5047 optional bool is_child_session = 6;
5048}
5049
5050/**
5051 * Logs information about session being flushed.
5052 *
5053 * Logged from:
5054 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5055 */
5056message ContentCaptureFlushed {
5057 optional int32 session_id = 1;
5058 // component/package of content capture service.
5059 optional string service_info = 2;
5060 // component/package of app.
5061 optional string app_info = 3;
5062 // session start/finish events
5063 optional int32 child_session_started = 4;
5064 optional int32 child_session_finished = 5;
5065 // count of view events.
5066 optional int32 view_appeared_count = 6;
5067 optional int32 view_disappeared_count = 7;
5068 optional int32 view_text_changed_count = 8;
5069
5070 // Flush stats.
5071 optional int32 max_events = 9;
5072 optional int32 idle_flush_freq = 10;
5073 optional int32 text_flush_freq = 11;
5074 optional int32 flush_reason = 12;
5075}
5076
5077/**
Bookatz75ee6042018-11-09 12:27:37 -08005078 * Pulls on-device BatteryStats power use calculations for the overall device.
5079 */
5080message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005081 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5082 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5083 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5084 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08005085}
5086
5087/**
5088 * Pulls on-device BatteryStats power use calculations broken down by uid.
5089 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5090 * that is attributed to non-uid items. They must all be included to get the total power use.
5091 */
5092message DeviceCalculatedPowerBlameUid {
5093 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5094 optional int32 uid = 1 [(is_uid) = true];
5095
Bookatz3dbc13a2018-12-21 12:16:51 -08005096 // Power used by this uid 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 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08005099}
5100
5101/**
5102 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5103 * drain type.
5104 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5105 * is attributed uids. They must all be included to get the total power use.
5106 */
5107message DeviceCalculatedPowerBlameOther {
5108 // The type of item whose power use is being reported.
5109 enum DrainType {
5110 AMBIENT_DISPLAY = 0;
5111 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5112 BLUETOOTH = 2;
5113 CAMERA = 3;
5114 // Cell-standby
5115 CELL = 4;
5116 FLASHLIGHT = 5;
5117 IDLE = 6;
5118 MEMORY = 7;
5119 // Amount that total computed drain exceeded the drain estimated using the
5120 // battery level changes and capacity.
5121 OVERCOUNTED = 8;
5122 PHONE = 9;
5123 SCREEN = 10;
5124 // Amount that total computed drain was below the drain estimated using the
5125 // battery level changes and capacity.
5126 UNACCOUNTED = 11;
5127 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5128 WIFI = 13;
5129 }
5130 optional DrainType drain_type = 1;
5131
Bookatz3dbc13a2018-12-21 12:16:51 -08005132 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5133 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5134 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005135}
arangelov4e994062018-11-13 16:12:38 +00005136
5137/**
5138 * Logs device policy features.
5139 *
5140 * Logged from:
5141 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5142 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5143 */
5144message DevicePolicyEvent {
5145 // The event id - unique for each event.
5146 optional android.stats.devicepolicy.EventId event_id = 1;
5147 // The admin package name.
5148 optional string admin_package_name = 2;
5149 // A generic integer parameter.
5150 optional int32 integer_value = 3;
5151 // A generic boolean parameter.
5152 optional bool boolean_value = 4;
5153 // A parameter specifying a time period in milliseconds.
5154 optional uint64 time_period_millis = 5;
5155 // A parameter specifying a list of package names, bundle extras or string parameters.
5156 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5157}
shawnlinea5b66b2018-11-13 15:05:29 +08005158
5159/**
5160 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5161 *
5162 * Logged from:
5163 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5164 */
5165message DocsUILaunchReported {
5166 optional android.stats.docsui.LaunchAction launch_action = 1;
5167 optional bool has_initial_uri = 2;
5168 optional android.stats.docsui.MimeType mime_type = 3;
5169 optional android.stats.docsui.Root initial_root = 4;
5170}
5171
5172/**
5173 * Logs root/app visited event in file managers/picker. Call this when the user
5174 * taps on root/app in hamburger menu.
5175 *
5176 * Logged from:
5177 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5178 */
5179message DocsUIRootVisitedReported {
5180 optional android.stats.docsui.ContextScope scope = 1;
5181 optional android.stats.docsui.Root root = 2;
5182}
5183
5184/**
5185 * Logs file operation stats. Call this when a file operation has completed.
5186 *
5187 * Logged from:
5188 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5189 */
5190message DocsUIFileOperationReported {
5191 optional android.stats.docsui.Provider provider = 1;
5192 optional android.stats.docsui.FileOperation file_op = 2;
5193}
5194
5195/**
5196 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5197 * mode.
5198 *
5199 * Logged from:
5200 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5201 */
5202message DocsUIFileOperationCopyMoveModeReported {
5203 optional android.stats.docsui.FileOperation file_op = 1;
5204 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5205}
5206
5207
5208/**
5209 * Logs file sub operation stats. Call this when a file operation has failed.
5210 *
5211 * Logged from:
5212 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5213 */
5214message DocsUIFileOperationFailureReported {
5215 optional android.stats.docsui.Authority authority = 1;
5216 optional android.stats.docsui.SubFileOperation sub_op = 2;
5217}
5218
5219/**
5220* Logs the cancellation of a file operation. Call this when a job is canceled
5221*
5222* Logged from:
5223* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5224*/
5225message DocsUIFileOperationCanceledReported {
5226 optional android.stats.docsui.FileOperation file_op = 1;
5227}
5228
5229/**
5230 * Logs startup time in milliseconds.
5231 *
5232 * Logged from:
5233 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5234 */
5235message DocsUIStartupMsReported {
5236 optional int32 startup_millis = 1;
5237}
5238
5239/**
5240 * Logs the action that was started by user.
5241 *
5242 * Logged from:
5243 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5244 */
5245message DocsUIUserActionReported {
5246 optional android.stats.docsui.UserAction action = 1;
5247}
5248
5249/**
5250 * Logs the invalid type when invalid scoped access is requested.
5251 *
5252 * Logged from:
5253 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5254 */
5255message DocsUIInvalidScopedAccessRequestReported {
5256 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005257}
Ben Murdochbab399f2018-12-06 11:01:38 +00005258
5259/**
shawnlina75e82d2019-01-07 10:31:12 +08005260 * Logs the package name that launches docsui picker mode.
5261 *
5262 * Logged from:
5263 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5264 */
5265message DocsUIPickerLaunchedFromReported {
5266 optional string package_name = 1;
5267}
5268
5269/**
5270 * Logs the search type.
5271 *
5272 * Logged from:
5273 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5274 */
5275message DocsUISearchTypeReported {
5276 optional android.stats.docsui.SearchType search_type = 1;
5277}
5278
5279/**
5280 * Logs the search mode.
5281 *
5282 * Logged from:
5283 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5284 */
5285message DocsUISearchModeReported {
5286 optional android.stats.docsui.SearchMode search_mode = 1;
5287}
5288
5289/**
5290 * Logs the pick result information.
5291 *
5292 * Logged from:
5293 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5294 */
5295message DocsUIPickResultReported {
5296 optional int32 total_action_count = 1;
5297 optional int64 duration_millis = 2;
5298 optional int32 file_count= 3;
5299 optional bool is_searching = 4;
5300 optional android.stats.docsui.Root picked_from = 5;
5301 optional android.stats.docsui.MimeType mime_type = 6;
5302 optional int32 repeatedly_pick_times = 7;
5303}
5304
5305/**
Ben Murdochbab399f2018-12-06 11:01:38 +00005306 * Logs when an app's memory is compacted.
5307 *
5308 * Logged from:
5309 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5310 */
5311message AppCompacted {
5312 // The pid of the process being compacted.
5313 optional int32 pid = 1;
5314
5315 // The name of the process being compacted.
5316 optional string process_name = 2;
5317
5318 // The type of compaction.
5319 enum Action {
5320 UNKNOWN = 0;
5321 SOME = 1;
5322 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005323 PERSISTENT = 3;
5324 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00005325 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005326 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00005327
5328 // Total RSS in kilobytes consumed by the process prior to compaction.
5329 optional int64 before_rss_total_kilobytes = 4;
5330
5331 // File RSS in kilobytes consumed by the process prior to compaction.
5332 optional int64 before_rss_file_kilobytes = 5;
5333
5334 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5335 optional int64 before_rss_anon_kilobytes = 6;
5336
5337 // Swap in kilobytes consumed by the process prior to compaction.
5338 optional int64 before_swap_kilobytes = 7;
5339
5340 // Total RSS in kilobytes consumed by the process after compaction.
5341 optional int64 after_rss_total_kilobytes = 8;
5342
5343 // File RSS in kilobytes consumed by the process after compaction.
5344 optional int64 after_rss_file_kilobytes = 9;
5345
5346 // Anonymous RSS in kilobytes consumed by the process after compaction.
5347 optional int64 after_rss_anon_kilobytes = 10;
5348
5349 // Swap in kilobytes consumed by the process after compaction.
5350 optional int64 after_swap_kilobytes = 11;
5351
5352 // The time taken to perform compaction in milliseconds.
5353 optional int64 time_to_compact_millis = 12;
5354
5355 // The last compaction action performed for this app.
5356 optional Action last_action = 13;
5357
Ben Murdoch01720b82018-12-19 18:03:44 +00005358 // The last time that compaction was attempted on this process in milliseconds
5359 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5360 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00005361
Ben Murdoch885c21b2019-03-15 18:02:04 +00005362 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005363 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00005364
5365 // The process state at the time of compaction.
5366 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005367
5368 // Free ZRAM in kilobytes before compaction.
5369 optional int64 before_zram_free_kilobytes = 17;
5370
5371 // Free ZRAM in kilobytes after compaction.
5372 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00005373}
lifr157fc552018-12-12 16:38:04 +08005374
5375/**
lifrb6b90b62019-03-29 00:40:17 +08005376 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5377 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5378 *
lifr1f74b052019-04-16 22:16:30 +08005379 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5380 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5381 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5382 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005383 */
5384message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08005385 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005386
lifr1f74b052019-04-16 22:16:30 +08005387 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005388
5389 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005390 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005391
lifr1f74b052019-04-16 22:16:30 +08005392 // Only valid for event_type = EVENT_GETADDRINFO.
5393 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005394
lifr1f74b052019-04-16 22:16:30 +08005395 // Flags passed to android_res_nsend() defined in multinetwork.h
5396 // Only valid for event_type = EVENT_RESNSEND.
5397 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005398
lifrad9becc2019-05-20 11:04:41 +08005399 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005400
5401 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08005402 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005403
5404 // Additional pass-through fields opaque to statsd.
5405 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08005406 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08005407
5408 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
5409 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08005410}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005411
5412/**
5413 * Logs when a data stall event occurs.
5414 *
5415 * Log from:
5416 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5417 */
5418message DataStallEvent {
5419 // Data stall evaluation type.
5420 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5421 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5422 optional int32 evaluation_type = 1;
5423 // See definition in data_stall_event.proto.
5424 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5425 // See definition in data_stall_event.proto.
5426 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5427 // See definition in data_stall_event.proto.
5428 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5429 // See definition in data_stall_event.proto.
5430 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5431 // See definition in data_stall_event.proto.
5432 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5433}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005434
5435/*
5436 * Logs when RescueParty resets some set of experiment flags.
5437 *
5438 * Logged from:
5439 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5440 */
5441message RescuePartyResetReported {
5442 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5443 optional int32 rescue_level = 1;
5444}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005445
5446/**
5447 * Logs when signed config is received from an APK, and if that config was applied successfully.
5448 * Logged from:
5449 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5450 */
5451message SignedConfigReported {
5452 enum Type {
5453 UNKNOWN_TYPE = 0;
5454 GLOBAL_SETTINGS = 1;
5455 }
5456 optional Type type = 1;
5457
5458 // The final status of the signed config received.
5459 enum Status {
5460 UNKNOWN_STATUS = 0;
5461 APPLIED = 1;
5462 BASE64_FAILURE_CONFIG = 2;
5463 BASE64_FAILURE_SIGNATURE = 3;
5464 SECURITY_EXCEPTION = 4;
5465 INVALID_CONFIG = 5;
5466 OLD_CONFIG = 6;
5467 SIGNATURE_CHECK_FAILED = 7;
5468 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005469 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005470 }
5471 optional Status status = 2;
5472
5473 // The version of the signed config processed.
5474 optional int32 version = 3;
5475
5476 // The package name that the config was extracted from.
5477 optional string from_package = 4;
5478
5479 enum Key {
5480 NO_KEY = 0;
5481 DEBUG = 1;
5482 PRODUCTION = 2;
5483 }
5484 // Which key was used to verify the config.
5485 optional Key verified_with = 5;
5486}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005487
5488/*
5489 * Logs GNSS Network-Initiated (NI) location events.
5490 *
5491 * Logged from:
5492 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5493 */
5494message GnssNiEventReported {
5495 // The type of GnssNiEvent.
5496 enum EventType {
5497 UNKNOWN = 0;
5498 NI_REQUEST = 1;
5499 NI_RESPONSE = 2;
5500 }
5501 optional EventType event_type = 1;
5502
5503 // An ID generated by HAL to associate NI notifications and UI responses.
5504 optional int32 notification_id = 2;
5505
5506 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005507 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005508
5509 // NI requires notification.
5510 optional bool need_notify = 4;
5511
5512 // NI requires verification.
5513 optional bool need_verify = 5;
5514
5515 // NI requires privacy override, no notification/minimal trace.
5516 optional bool privacy_override = 6;
5517
5518 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5519 // seconds.
5520 optional int32 timeout = 7;
5521
5522 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005523 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005524
5525 // String representing the requester of the network inititated location request.
5526 optional string requestor_id = 9;
5527
5528 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5529 // network initiated location request.
5530 optional string text = 10;
5531
5532 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005533 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005534
5535 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005536 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005537
5538 // True if SUPL ES is enabled.
5539 optional bool is_supl_es_enabled = 13;
5540
5541 // True if GNSS location is enabled.
5542 optional bool is_location_enabled = 14;
5543
5544 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005545 optional android.server.location.GnssUserResponseType user_response = 15;
5546}
5547
5548/**
5549 * Logs GNSS non-framework (NFW) location notification.
5550 *
5551 * Logged from:
5552 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5553 */
5554message GnssNfwNotificationReported {
5555 // Package name of the Android proxy application representing the non-framework entity that
5556 // requested location. Set to empty string if unknown.
5557 optional string proxy_app_package_name = 1;
5558
5559 // Protocol stack that initiated the non-framework location request.
5560 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5561
5562 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5563 // set to empty string. This field is opaque to the framework and used for logging purposes.
5564 optional string other_protocol_stack_name = 3;
5565
5566 // Source initiating/receiving the location information.
5567 optional android.server.location.NfwRequestor requestor = 4;
5568
5569 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5570 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5571 // and used for logging purposes.
5572 optional string requestor_id = 5;
5573
5574 // Indicates whether location information was provided for this request.
5575 optional android.server.location.NfwResponseType response_type = 6;
5576
5577 // True if the device is in user initiated emergency session.
5578 optional bool in_emergency_mode = 7;
5579
5580 // True if cached location is provided.
5581 optional bool is_cached_location = 8;
5582
5583 // True if proxy app permission mismatch between framework and GNSS HAL.
5584 optional bool is_permission_mismatched = 9;
5585}
5586
5587/**
5588 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5589 *
5590 * Logged from:
5591 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5592 */
5593message GnssConfigurationReported {
5594 // SUPL host name.
5595 optional string supl_host = 1;
5596
5597 // SUPL port number.
5598 optional int32 supl_port = 2;
5599
5600 // C2K host name.
5601 optional string c2k_host = 3;
5602
5603 // C2K port number.
5604 optional int32 c2k_port = 4;
5605
5606 // The SUPL version requested by Carrier.
5607 optional int32 supl_ver = 5;
5608
5609 // The SUPL mode.
5610 optional android.server.location.SuplMode supl_mode = 6;
5611
5612 // True if NI emergency SUPL restrictions is enabled.
5613 optional bool supl_es = 7;
5614
5615 // LTE Positioning Profile settings
5616 optional android.server.location.LppProfile lpp_profile = 8;
5617
5618 // Positioning protocol on A-Glonass system.
5619 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5620
5621 // True if emergency PDN is used. Otherwise, regular PDN is used.
5622 optional bool use_emergency_pdn_for_emergency_supl= 10;
5623
5624 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5625 optional android.server.location.GpsLock gps_lock = 11;
5626
5627 // Number of seconds to extend the emergency session duration post emergency call.
5628 optional int32 es_extension_sec = 12;
5629
5630 // The full list of package names of proxy Android applications representing the non-framework
5631 // location access entities (on/off the device) for which the framework user has granted
5632 // non-framework location access permission. The package names are concatenated in one string
5633 // with spaces as separators.
5634 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005635}
Jack Yu95b64f32018-12-13 18:26:11 +08005636
5637/**
5638 * Logs when a NFC device's error occurred.
5639 * Logged from:
5640 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5641 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5642 */
5643message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005644 enum Type {
5645 UNKNOWN = 0;
5646 CMD_TIMEOUT = 1;
5647 ERROR_NOTIFICATION = 2;
5648 AID_OVERFLOW = 3;
5649 }
5650 optional Type type = 1;
5651 // If it's nci cmd timeout, log the timeout command.
5652 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005653
Alex Salod7c3eef2019-01-25 14:43:27 -08005654 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005655}
5656
5657/**
5658 * Logs when a NFC device's state changed event
5659 * Logged from:
5660 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5661 */
5662message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005663 enum State {
5664 UNKNOWN = 0;
5665 OFF = 1;
5666 ON = 2;
5667 ON_LOCKED = 3; // Secure Nfc enabled.
5668 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5669 }
5670 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005671}
5672
5673/**
5674 * Logs when a NFC Beam Transaction occurred.
5675 * Logged from:
5676 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5677 */
5678message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005679 enum Operation {
5680 UNKNOWN = 0;
5681 SEND = 1;
5682 RECEIVE = 2;
5683 }
5684 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005685}
5686
5687/**
5688 * Logs when a NFC Card Emulation Transaction occurred.
5689 * Logged from:
5690 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5691 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5692 */
5693message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005694 enum Category {
5695 UNKNOWN = 0;
5696 HCE_PAYMENT = 1;
5697 HCE_OTHER = 2;
5698 OFFHOST = 3;
5699 }
5700 // Transaction belongs to HCE payment or HCE other category, or offhost.
5701 optional Category category = 1;
5702 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5703 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005704}
5705
5706/**
5707 * Logs when a NFC Tag event occurred.
5708 * Logged from:
5709 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5710 */
5711message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005712 enum Type {
5713 UNKNOWN = 0;
5714 URL = 1;
5715 BT_PAIRING = 2;
5716 PROVISION = 3;
5717 WIFI_CONNECT = 4;
5718 APP_LAUNCH = 5;
5719 OTHERS = 6;
5720 }
5721 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005722}
5723
5724/**
5725 * Logs when Hce transaction triggered
5726 * Logged from:
5727 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5728 */
5729message NfcHceTransactionOccurred {
5730 // The latency period(in microseconds) it took for the first HCE data
5731 // exchange.
5732 optional uint32 latency_micros = 1;
5733}
5734
5735/**
5736 * Logs when SecureElement state event changed
5737 * Logged from:
5738 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5739 */
5740message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005741 enum State {
5742 UNKNOWN = 0;
5743 INITIALIZED = 1;
5744 DISCONNECTED = 2;
5745 CONNECTED = 3;
5746 HALCRASH = 4;
5747 }
5748 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005749
Alex Salod7c3eef2019-01-25 14:43:27 -08005750 optional string state_change_reason = 2;
5751 // SIMx or eSEx.
5752 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005753}
5754
5755/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005756 * Information about a permission grant request
5757 */
5758message PermissionGrantRequestResultReported {
5759 // unique value identifying an API call. A API call might result in multiple of these atoms
5760 optional int64 request_id = 1;
5761
5762 // UID of package requesting the permission grant
5763 optional int32 requesting_uid = 2 [(is_uid) = true];
5764
5765 // Name of package requesting the permission grant
5766 optional string requesting_package_name = 3;
5767
5768 // The permission to be granted
5769 optional string permission_name = 4;
5770
5771 // If the permission was explicitly requested via the API or added by the system
5772 optional bool is_implicit = 5;
5773
5774 enum Result {
5775 UNDEFINED = 0;
5776 // permission request was ignored
5777 IGNORED = 1;
5778 // permission request was ignored because it was user fixed
5779 IGNORED_USER_FIXED = 2;
5780 // permission request was ignored because it was policy fixed
5781 IGNORED_POLICY_FIXED = 3;
5782 // permission was granted by user action
5783 USER_GRANTED = 4;
5784 // permission was automatically granted
5785 AUTO_GRANTED = 5;
5786 // permission was denied by user action
5787 USER_DENIED = 6;
5788 // permission was denied with prejudice by the user
5789 USER_DENIED_WITH_PREJUDICE = 7;
5790 // permission was automatically denied
5791 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07005792 // permission request was ignored because permission is restricted
5793 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01005794 // one time permission was granted by user action
5795 USER_GRANTED_ONE_TIME = 10;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005796 }
5797 // The result of the permission grant
5798 optional Result result = 6;
5799}
5800
5801/**
Jack Yu95b64f32018-12-13 18:26:11 +08005802 * Logs when Omapi API used
5803 * Logged from:
5804 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5805 */
5806message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005807 enum Operation {
5808 UNKNOWN = 0;
5809 OPEN_CHANNEL = 1;
5810 }
5811 optional Operation operation = 1;
5812 // SIMx or eSEx.
5813 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005814
Alex Salod7c3eef2019-01-25 14:43:27 -08005815 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005816}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005817
5818/**
Alex Saloa060aee2019-01-21 14:36:41 -08005819 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5820 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005821 * Logged from:
5822 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5823 */
5824message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005825 optional int64 dispatch_latency_millis = 1;
5826}
5827
5828/**
5829 * Logs AttentionManagerService attention check result.
5830 *
5831 * Logged from:
5832 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5833 */
5834message AttentionManagerServiceResultReported {
5835 // See core/java/android/service/attention/AttentionService.java
5836 enum AttentionCheckResult {
5837 UNKNOWN = 20;
5838 ATTENTION_SUCCESS_ABSENT = 0;
5839 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07005840 ATTENTION_FAILURE_UNKNOWN = 2;
5841 ATTENTION_FAILURE_CANCELLED = 3;
5842 ATTENTION_FAILURE_PREEMPTED = 4;
5843 ATTENTION_FAILURE_TIMED_OUT = 5;
5844 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08005845 }
5846 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005847}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005848
5849/**
5850 * Logs when an adb connection changes state.
5851 *
5852 * Logged from:
5853 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5854 */
5855message AdbConnectionChanged {
5856 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5857 // previously selected for this system.
5858 optional int64 last_connection_time_millis = 1;
5859
5860 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5861 // to reconnect via adb without user interaction.
5862 optional int64 auth_window_millis = 2;
5863
5864 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5865 optional android.debug.AdbConnectionStateEnum state = 3;
5866
5867 // True if the 'always allow' option was selected for this system.
5868 optional bool always_allow = 4;
5869}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005870
5871/*
5872 * Logs the reported speech DSP status.
5873 *
5874 * Logged from:
5875 * Vendor audio implementation.
5876 */
5877message SpeechDspStatReported {
5878 // The total Speech DSP uptime in milliseconds.
5879 optional int32 total_uptime_millis = 1;
5880 // The total Speech DSP downtime in milliseconds.
5881 optional int32 total_downtime_millis = 2;
5882 optional int32 total_crash_count = 3;
5883 optional int32 total_recover_count = 4;
5884}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005885
5886/**
5887 * Logs USB connector contaminant status.
5888 *
5889 * Logged from: USB Service.
5890 */
5891message UsbContaminantReported {
5892 optional string id = 1;
5893 optional android.service.usb.ContaminantPresenceStatus status = 2;
5894}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005895
5896/**
5897 * This atom is for debugging purpose.
5898 */
5899message DebugElapsedClock {
5900 // Monotically increasing value for each pull.
5901 optional int64 pull_count = 1;
5902 // Time from System.elapsedRealtime.
5903 optional int64 elapsed_clock_millis = 2;
5904 // Time from System.elapsedRealtime.
5905 optional int64 same_elapsed_clock_millis = 3;
5906 // Diff between current elapsed time and elapsed time from previous pull.
5907 optional int64 elapsed_clock_diff_millis = 4;
5908
5909 enum Type {
5910 TYPE_UNKNOWN = 0;
5911 ALWAYS_PRESENT = 1;
5912 PRESENT_ON_ODD_PULLS = 2;
5913 }
5914 // Type of behavior for the pulled data.
5915 optional Type type = 5;
5916}
5917
5918/**
5919 * This atom is for debugging purpose.
5920 */
5921message DebugFailingElapsedClock {
5922 // Monotically increasing value for each pull.
5923 optional int64 pull_count = 1;
5924 // Time from System.elapsedRealtime.
5925 optional int64 elapsed_clock_millis = 2;
5926 // Time from System.elapsedRealtime.
5927 optional int64 same_elapsed_clock_millis = 3;
5928 // Diff between current elapsed time and elapsed time from previous pull.
5929 optional int64 elapsed_clock_diff_millis = 4;
5930}
Steven Wuacef6bb2019-01-23 14:21:17 -05005931
5932/** Logs System UI bubbles event changed.
5933 *
5934 * Logged from:
5935 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5936 */
5937message BubbleUIChanged {
5938
5939 // The app package that is posting the bubble.
5940 optional string package_name = 1;
5941
5942 // The notification channel that is posting the bubble.
5943 optional string notification_channel = 2;
5944
5945 // The notification id associated with the posted bubble.
5946 optional int32 notification_id = 3;
5947
5948 // The position of the bubble within the bubble stack.
5949 optional int32 position = 4;
5950
5951 // The total number of bubbles within the bubble stack.
5952 optional int32 total_number = 5;
5953
5954 // User interactions with the bubble.
5955 enum Action {
5956 UNKNOWN = 0;
5957 POSTED = 1;
5958 UPDATED = 2;
5959 EXPANDED = 3;
5960 COLLAPSED = 4;
5961 DISMISSED = 5;
5962 STACK_DISMISSED = 6;
5963 STACK_MOVED = 7;
5964 HEADER_GO_TO_APP = 8;
5965 HEADER_GO_TO_SETTINGS = 9;
5966 PERMISSION_OPT_IN = 10;
5967 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005968 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005969 SWIPE_LEFT = 13;
5970 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005971 STACK_EXPANDED = 15;
Steven Wu1684f2d2019-04-11 14:10:42 -04005972 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05005973 }
5974 optional Action action = 6;
5975
5976 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5977 optional float normalized_x_position = 7;
5978 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04005979
5980 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
5981 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04005982
5983 // Whether the bubble is an on-going one.
5984 optional bool is_ongoing = 10;
5985
5986 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07005987 // This is deprecated and the value should be ignored.
5988 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05005989}
Kweku Adams8845d012018-12-11 20:06:45 -08005990
5991/**
Steven Wu552f63f2019-02-05 13:41:36 -05005992 * Logs System UI bubbles developer errors.
5993 *
5994 * Logged from:
5995 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5996 */
5997message BubbleDeveloperErrorReported {
5998
5999 // The app package that is posting the bubble.
6000 optional string package_name = 1;
6001
6002 // Bubble developer error type enums.
6003 enum Error {
6004 UNKNOWN = 0;
6005 ACTIVITY_INFO_MISSING = 1;
6006 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6007 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6008 }
6009 optional Error error = 2 [default = UNKNOWN];
6010}
6011
6012/**
Kweku Adams8845d012018-12-11 20:06:45 -08006013 * Logs that a constraint for a scheduled job has changed.
6014 *
6015 * Logged from:
6016 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6017 */
6018message ScheduledJobConstraintChanged {
6019 repeated AttributionNode attribution_node = 1;
6020
6021 // Name of the job.
6022 optional string job_name = 2;
6023
6024 optional com.android.server.job.ConstraintEnum constraint = 3;
6025
6026 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006027 UNKNOWN = 0;
6028 UNSATISFIED = 1;
6029 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006030 }
6031 optional State state = 4;
6032}
Alex Salod7c3eef2019-01-25 14:43:27 -08006033
6034/**
6035 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6036 * returns true.
6037 *
6038 * Logged from:
6039 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6040 */
6041message ScreenTimeoutExtensionReported {
6042 // Describes how many times in a row did the power manager reset the screen off timeout.
6043 optional uint32 consecutive_timeout_extended_count = 1;
6044}
Hui Yu885aca12019-01-10 17:11:34 -08006045
6046/*
6047* Logs number of milliseconds it takes to start a process.
6048* The definition of app process start time is from the app launch time to
6049* the time that Zygote finished forking the app process and loaded the
6050* application package's java classes.
6051
6052* This metric is different from AppStartOccurred which is for foreground
6053* activity only.
6054
6055* ProcessStartTime can report all processes (both foreground and background)
6056* start time.
6057*
6058* Logged from:
6059* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6060*/
6061message ProcessStartTime {
6062 // The uid of the ProcessRecord.
6063 optional int32 uid = 1 [(is_uid) = true];
6064
6065 // The process pid.
6066 optional int32 pid = 2;
6067
6068 // The process name.
6069 // Usually package name, "system" for system server.
6070 // Provided by ActivityManagerService.
6071 optional string process_name = 3;
6072
6073 enum StartType {
6074 UNKNOWN = 0;
6075 WARM = 1;
6076 HOT = 2;
6077 COLD = 3;
6078 }
6079
6080 // The start type.
6081 optional StartType type = 4;
6082
6083 // The elapsed realtime at the start of the process.
6084 optional int64 process_start_time_millis = 5;
6085
6086 // Number of milliseconds it takes to reach bind application.
6087 optional int32 bind_application_delay_millis = 6;
6088
6089 // Number of milliseconds it takes to finish start of the process.
6090 optional int32 process_start_delay_millis = 7;
6091
6092 // hostingType field in ProcessRecord, the component type such as "activity",
6093 // "service", "content provider", "broadcast" or other strings.
6094 optional string hosting_type = 8;
6095
6096 // hostingNameStr field in ProcessRecord. The component class name that runs
6097 // in this process.
6098 optional string hosting_name = 9;
6099}
6100
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006101/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006102 * Track Media Codec usage
6103 * Logged from:
6104 * frameworks/av/media/libstagefright/MediaCodec.cpp
6105 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6106 */
6107message MediametricsCodecReported {
6108 optional int64 timestamp_nanos = 1;
6109 optional string package_name = 2;
6110 optional int64 package_version_code = 3;
6111 optional int64 media_apex_version = 4;
6112
6113 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6114}
6115
6116/**
6117 * Track Media Extractor (pulling video/audio streams out of containers) usage
6118 * Logged from:
6119 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6120 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6121 */
6122message MediametricsExtractorReported {
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.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6129}
6130
6131/**
6132 * Track how we arbitrate between microphone/input requests.
6133 * Logged from
6134 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6135 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6136 */
6137message MediametricsAudiopolicyReported {
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.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6144}
6145
6146/**
6147 * Track how we arbitrate between microphone requests.
6148 * Logged from
6149 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6150 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6151 */
6152message MediametricsAudiorecordReported {
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.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6159}
6160
6161/**
6162 * Track how we arbitrate between microphone/input requests.
6163 * Logged from
6164 * frameworks/av/media/libnblog/ReportPerformance.cpp
6165 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6166 */
6167message MediametricsAudiothreadReported {
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.AudioThreadData audiothread_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/libaudioclient/AudioTrack.cpp
6180 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6181 */
6182message MediametricsAudiotrackReported {
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.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6189}
6190
6191/**
6192 * Track information about DRM framework performance
6193 * Logged from
6194 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6195 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6196 */
6197message MediametricsMediadrmReported {
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 // vendor+description tell about which DRM plugin is in use on this device
6204 optional string vendor = 5;
6205 optional string description = 6;
6206 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6207 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6208}
6209
6210/**
6211 * Track information about the widevine DRM plugin performance
6212 * Logged from
6213 * vendor/widevine/libwvdrmengine/cdm/metrics
6214 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6215 */
6216message MediametricsDrmWidevineReported {
6217 optional int64 timestamp_nanos = 1;
6218 optional string package_name = 2;
6219 optional int64 package_version_code = 3;
6220 optional int64 media_apex_version = 4;
6221
6222 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6223}
6224
6225/**
6226 * Track information about recordings (e.g. camcorder)
6227 * Logged from
6228 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6229 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6230 */
6231message MediametricsRecorderReported {
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 android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6238}
6239
6240/**
6241 * Track Media Player usage
6242 * Logged from:
6243 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6244 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6245 */
6246message MediametricsNuPlayerReported {
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.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6253}
6254
6255/**
Robert Shiha4beed32019-08-19 14:15:23 -07006256 * Track Legacy DRM usage
6257 * Logged from
6258 * frameworks/av/drm/drmserver/DrmManager.cpp
6259 */
6260message MediametricsDrmManagerReported {
6261 optional int64 timestamp_nanos = 1;
6262 optional string package_name = 2;
6263 optional int64 package_version_code = 3;
6264 optional int64 media_apex_version = 4;
6265
6266 enum Method {
6267 METHOD_NOT_FOUND = -1;
6268 GET_CONSTRAINTS = 0;
6269 GET_METADATA = 1;
6270 CAN_HANDLE = 2;
6271 PROCESS_DRM_INFO = 3;
6272 ACQUIRE_DRM_INFO = 4;
6273 SAVE_RIGHTS = 5;
6274 GET_ORIGINAL_MIME_TYPE = 6;
6275 GET_DRM_OBJECT_TYPE = 7;
6276 CHECK_RIGHTS_STATUS = 8;
6277 REMOVE_RIGHTS = 9;
6278 REMOVE_ALL_RIGHTS = 10;
6279 OPEN_CONVERT_SESSION = 11;
6280 OPEN_DECRYPT_SESSION = 12;
6281 }
6282
6283 // plugin_id+description inform which Legacy DRM plugins are still in use on device
6284 optional string plugin_id = 5;
6285 optional string description = 6;
6286 optional Method method = 7;
6287 optional string mime_types = 8;
6288}
6289
6290/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006291 * State of a dangerous permission requested by a package
6292 */
6293message DangerousPermissionState {
6294 // Name of the permission
6295 optional string permission_name = 1;
6296
6297 // Uid of the package
6298 optional int32 uid = 2 [(is_uid) = true];
6299
6300 // Package requesting the permission
6301 optional string package_name = 3;
6302
6303 // If the permission is granted to the uid
6304 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01006305
6306 // Permission flags as per android.content.pm.PermissionFlags
6307 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006308}
6309
Michael Groover4a0ca942019-01-24 17:41:25 -08006310/**
6311 * Logs when a package is denied access to a device identifier based on the new access requirements.
6312 *
6313 * Logged from:
6314 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6315 */
6316message DeviceIdentifierAccessDenied {
6317 // The name of the package denied access to the requested device identifier.
6318 optional string package_name = 1;
6319
6320 // The name of the device identifier method the package attempted to invoke.
6321 optional string method_name = 2;
6322
6323 // True if the package is preinstalled.
6324 optional bool is_preinstalled = 3;
6325
6326 // True if the package is privileged.
6327 optional bool is_priv_app = 4;
6328}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006329
6330/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006331 * Pulls the ongoing mainline install train version code.
6332 * Pulled from StatsCompanionService
6333 */
6334message TrainInfo {
6335 optional int64 train_version_code = 1;
6336
6337 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006338
6339 optional string train_name = 3;
6340
6341 enum Status {
6342 UNKNOWN = 0;
6343 INSTALL_REQUESTED = 1;
6344 INSTALL_STARTED = 2;
6345 INSTALL_STAGED_NOT_READY = 3;
6346 INSTALL_STAGED_READY = 4;
6347 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006348 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6349 // and INSTALL_FAILURE_COMMIT.
6350 INSTALL_FAILURE = 6 [deprecated = true];
6351 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006352 INSTALL_CANCELLED = 7;
6353 INSTALLER_ROLLBACK_REQUESTED = 8;
6354 INSTALLER_ROLLBACK_INITIATED = 9;
6355 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6356 INSTALLER_ROLLBACK_STAGED = 11;
6357 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6358 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6359 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6360 INSTALLER_ROLLBACK_SUCCESS = 15;
6361 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006362 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6363 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6364 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6365 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6366 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6367 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006368 INSTALL_FAILURE_DOWNLOAD = 23;
6369 INSTALL_FAILURE_STATE_MISMATCH = 24;
6370 INSTALL_FAILURE_COMMIT = 25;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006371 }
6372 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006373}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006374
6375/**
6376 * Logs the gesture stage changed event.
6377 *
6378 * Logged from:
6379 * frameworks/base/packages/SystemUI/
6380 */
6381message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006382 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006383}
6384
6385/**
6386 * Logs the feedback type.
6387 *
6388 * Logged from:
6389 * frameworks/base/packages/SystemUI/
6390 */
6391message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006392 // Whether or not the gesture was used.
6393 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006394}
6395
6396/**
6397 * Logs the progress.
6398 *
6399 * Logged from:
6400 * frameworks/base/packages/SystemUI/
6401 */
6402message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006403 // [0,100] progress for the assist gesture.
6404 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006405}
Neil Fullerdb14b482019-02-05 19:44:44 +00006406
6407/*
6408 * Information about the time zone data on a device.
6409 */
6410message TimeZoneDataInfo {
6411 // A version identifier for the data set on device. e.g. "2018i"
6412 optional string tzdb_version = 1;
6413}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006414
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006415/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006416 * Logs the GPU stats global health information.
6417 *
6418 * Logged from:
6419 * frameworks/native/services/gpuservice/gpustats/
6420 */
6421message GpuStatsGlobalInfo {
6422 // Package name of the gpu driver.
6423 optional string driver_package_name = 1;
6424
6425 // Version name of the gpu driver.
6426 optional string driver_version_name = 2;
6427
6428 // Version code of the gpu driver.
6429 optional int64 driver_version_code = 3;
6430
6431 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
6432 optional int64 driver_build_time = 4;
6433
6434 // Total count of the gl driver gets loaded.
6435 optional int64 gl_loading_count = 5;
6436
6437 // Total count of the gl driver fails to be loaded.
6438 optional int64 gl_loading_failure_count = 6;
6439
6440 // Total count of the Vulkan driver gets loaded.
6441 optional int64 vk_loading_count = 7;
6442
6443 // Total count of the Vulkan driver fails to be loaded.
6444 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07006445
6446 // Api version of the system Vulkan driver.
6447 optional int32 vulkan_version = 9;
6448
6449 // Api version of the system CPU Vulkan driver.
6450 optional int32 cpu_vulkan_version = 10;
6451
6452 // Api version of the system GLES driver.
6453 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006454
6455 // Total count of the angle driver gets loaded.
6456 optional int64 angle_loading_count = 12;
6457
6458 // Total count of the angle driver fails to be loaded.
6459 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006460}
6461
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006462/**
6463 * GPU driver loading time info.
6464 */
6465message GpuDriverLoadingTime {
6466 // List of all the driver loading times for this app. The list size is
6467 // capped at 50.
6468 repeated int64 driver_loading_time = 1;
6469}
6470
6471/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006472 * Logs the GPU stats per app health information.
6473 *
6474 * Logged from:
6475 * frameworks/native/services/gpuservice/gpustats/
6476 */
6477message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006478 // Package name of the application that loads the gpu driver. Total number
6479 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006480 optional string app_package_name = 1;
6481
6482 // Version code of the gpu driver this app loads.
6483 optional int64 driver_version_code = 2;
6484
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006485 // gl driver loading time info.
6486 optional GpuDriverLoadingTime gl_driver_loading_time = 3
6487 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006488
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006489 // Vulkan driver loading time info.
6490 optional GpuDriverLoadingTime vk_driver_loading_time = 4
6491 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006492
6493 // Angle driver loading time info.
6494 optional GpuDriverLoadingTime angle_driver_loading_time = 5
6495 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07006496
6497 // CPU Vulkan implementation is in use.
6498 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07006499
6500 // App is not doing pre-rotation correctly.
6501 optional bool false_prerotation = 7;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006502}
Rafal Slawikd4e87572019-03-12 13:08:38 +00006503
6504/*
6505 * Logs the size of the system ion heap.
6506 *
6507 * Pulled from StatsCompanionService.
6508 */
6509message SystemIonHeapSize {
6510 // Size of the system ion heap in bytes.
6511 optional int64 size_in_bytes = 1;
6512}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006513
Rafal Slawik77987ed2019-06-17 12:28:23 +01006514/*
6515 * Logs the per-process size of the system ion heap.
6516 *
6517 * Pulled from StatsCompanionService.
6518 */
6519message ProcessSystemIonHeapSize {
6520 // The uid if available. -1 means not available.
6521 optional int32 uid = 1 [(is_uid) = true];
6522
6523 // The process name (from /proc/PID/cmdline).
6524 optional string process_name = 2;
6525
6526 // Sum of sizes of all allocations.
6527 optional int32 total_size_in_kilobytes = 3;
6528
6529 // Number of allocations.
6530 optional int32 allocation_count = 4;
6531
6532 // Size of the largest allocation.
6533 optional int32 max_size_in_kilobytes = 5;
6534}
6535
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006536/**
6537 * Push network stack events.
6538 *
6539 * Log from:
6540 * frameworks/base/packages/NetworkStack/
6541 */
6542message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08006543 // The id that indicates the event reported from NetworkStack.
6544 optional int32 event_id = 1;
6545 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006546 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
6547}
Carmen Agimofa769c152019-03-04 14:39:14 +00006548
6549/**
6550 * Logs the apps that are installed on the external storage.
6551 * Pulled from:
6552 * StatsCompanionService
6553 */
6554message AppsOnExternalStorageInfo {
6555 // The type of the external storage.
6556 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
6557 // The name of the package that is installed on the external storage.
6558 optional string package_name = 2;
6559}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07006560
6561/**
6562 * Logs the settings related to Face.
6563 * Logged from:
6564 * frameworks/base/services/core/java/com/android/server/stats
6565 */
6566message FaceSettings {
6567 // Whether or not face unlock is allowed on Keyguard.
6568 optional bool unlock_keyguard_enabled = 1;
6569 // Whether or not face unlock dismisses the Keyguard.
6570 optional bool unlock_dismisses_keyguard = 2;
6571 // Whether or not face unlock requires attention.
6572 optional bool unlock_attention_required = 3;
6573 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
6574 optional bool unlock_app_enabled = 4;
6575 // Whether or not face unlock always requires user confirmation.
6576 optional bool unlock_always_require_confirmation = 5;
6577 // Whether or not a diverse set of poses are required during enrollment.
6578 optional bool unlock_diversity_required = 6;
6579}
Maggie White442b6312019-04-05 16:26:44 -07006580
6581/**
6582 * Logs cooling devices maintained by the kernel.
6583 *
6584 * Pulled from StatsCompanionService.java
6585 */
6586message CoolingDevice {
6587 // The type of cooling device being reported. Eg. CPU, GPU...
6588 optional android.os.CoolingTypeEnum device_location = 1;
6589 // The name of the cooling device source. Eg. CPU0
6590 optional string device_name = 2;
6591 // Current throttle state of the cooling device. The value can any unsigned
6592 // integer between 0 and max_state defined in its driver. 0 means device is
6593 // not in throttling, higher value means deeper throttling.
6594 optional int32 state = 3;
6595}
Ben Blount763a5d52019-04-10 11:48:58 -07006596
6597/**
6598 * Intelligence has several counter-type events that don't warrant a
6599 * full separate atom. These are primarily API call counters but also include
6600 * counters for feature usage and specific failure modes.
6601 *
6602 * Logged from the Intelligence mainline module.
6603 */
6604message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07006605 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07006606 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07006607 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07006608 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07006609 // How many times the event occured (to report a batch of high frequency events).
6610 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07006611 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07006612 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07006613}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07006614
6615/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07006616 * Logs when Car Power state changed.
6617 *
6618 * Logged from:
6619 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6620 */
6621message CarPowerStateChanged {
6622 // States come from CpmsState in CarPowerManagementService.java.
6623 enum State {
6624 WAIT_FOR_VHAL = 0;
6625 ON = 1;
6626 SHUTDOWN_PREPARE = 2;
6627 WAIT_FOR_FINISH = 3;
6628 SUSPEND = 4;
6629 SIMULATE_SLEEP = 5;
6630 }
6631 optional State state = 1;
6632}
6633
6634/**
6635 * Logs whether GarageMode is entered.
6636 *
6637 * Logged from:
6638 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6639 */
6640message GarageModeInfo {
6641 // Whether GarageMode is entered.
6642 optional bool is_garage_mode = 1;
6643}
Martijn Coenencd95d462019-04-25 17:09:45 +02006644
6645/**
6646 * Historical app ops data per package.
6647 */
6648message AppOps {
6649 // Uid of the package requesting the op
6650 optional int32 uid = 1 [(is_uid) = true];
6651
6652 // Nmae of the package performing the op
6653 optional string package_name = 2;
6654
6655 // operation id; maps to the OP_* constants in AppOpsManager.java
6656 optional int32 op_id = 3;
6657
6658 // The number of times the op was granted while the app was in the
6659 // foreground (only for trusted requests)
6660 optional int64 trusted_foreground_granted_count = 4;
6661
6662 // The number of times the op was granted while the app was in the
6663 // background (only for trusted requests)
6664 optional int64 trusted_background_granted_count = 5;
6665
6666 // The number of times the op was rejected while the app was in the
6667 // foreground (only for trusted requests)
6668 optional int64 trusted_foreground_rejected_count = 6;
6669
6670 // The number of times the op was rejected while the app was in the
6671 // background (only for trusted requests)
6672 optional int64 trusted_background_rejected_count = 7;
6673
6674 // For long-running operations, total duration of the operation
6675 // while the app was in the foreground (only for trusted requests)
6676 optional int64 trusted_foreground_duration_millis = 8;
6677
6678 // For long-running operations, total duration of the operation
6679 // while the app was in the background (only for trusted requests)
6680 optional int64 trusted_background_duration_millis = 9;
6681}
Hongyi Zhang700137e2019-05-23 21:19:36 -07006682
6683/**
6684 * Location Manager API Usage information(e.g. API under usage,
6685 * API call's parameters).
6686 * Logged from:
6687 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
6688 */
6689message LocationManagerApiUsageReported {
6690
6691 // Indicating if usage starts or usage ends.
6692 optional android.stats.location.UsageState state = 1;
6693
6694 // LocationManagerService's API in use.
6695 // We can identify which API from LocationManager is
6696 // invoking current LMS API by the combination of
6697 // API parameter(e.g. is_listener_null, is_intent_null,
6698 // is_location_request_null)
6699 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
6700
6701 // Name of the package calling the API.
6702 optional string calling_package_name = 3;
6703
6704 // Type of the location provider.
6705 optional android.stats.location.ProviderType provider = 4;
6706
6707 // Quality of the location request
6708 optional android.stats.location.LocationRequestQuality quality = 5;
6709
6710 // The desired interval for active location updates, in milliseconds.
6711 // Bucketized to reduce cardinality.
6712 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
6713
6714 // Minimum distance between location updates, in meters.
6715 // Bucketized to reduce cardinality.
6716 optional android.stats.location.SmallestDisplacementBucket
6717 bucketized_smallest_displacement = 7;
6718
6719 // The number of location updates.
6720 optional int64 num_updates = 8;
6721
6722 // The request expiration time, in millisecond since boot.
6723 // Bucketized to reduce cardinality.
6724 optional android.stats.location.ExpirationBucket
6725 bucketized_expire_in = 9;
6726
6727 // Type of Callback passed in for this API.
6728 optional android.stats.location.CallbackType callback_type = 10;
6729
6730 // The radius of the central point of the alert
6731 // region, in meters. Only for API REQUEST_GEOFENCE.
6732 // Bucketized to reduce cardinality.
6733 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
6734
6735 // Activity Importance of API caller.
6736 // Categorized to 3 types that are interesting from location's perspective.
6737 optional android.stats.location.ActivityImportance activiy_importance = 12;
6738}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01006739
6740/**
6741 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
6742 */
6743message ReviewPermissionsFragmentResultReported {
6744 // unique value identifying a permission group change. A permission group change might result
6745 // in multiple of these atoms
6746 optional int64 change_id = 1;
6747
6748 // UID of package the permission belongs to
6749 optional int32 uid = 2 [(is_uid) = true];
6750
6751 // Name of package the permission belongs to
6752 optional string package_name = 3;
6753
6754 // The permission to be granted
6755 optional string permission_name = 4;
6756
6757 // The result of the permission grant
6758 optional bool permission_granted = 5;
6759}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01006760
6761/**
6762* Information about results of permission upgrade by RuntimePermissionsUpgradeController
6763* Logged from: RuntimePermissionUpdgradeController
6764*/
6765message RuntimePermissionsUpgradeResult {
6766 // Permission granted as result of upgrade
6767 optional string permission_name = 1;
6768
6769 // UID of package granted permission
6770 optional int32 uid = 2 [(is_uid) = true];
6771
6772 // Name of package granted permission
6773 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01006774}
6775
6776/**
6777* Information about a buttons presented in GrantPermissionsActivty and choice made by user
6778*/
6779message GrantPermissionsActivityButtonActions {
6780 // Permission granted as result of upgrade
6781 optional string permission_group_name = 1;
6782
6783 // UID of package granted permission
6784 optional int32 uid = 2 [(is_uid) = true];
6785
6786 // Name of package requesting permission
6787 optional string package_name = 3;
6788
6789 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
6790 // LABEL_ constants in GrantPermissionActivity.java
6791 optional int32 buttons_presented = 4;
6792
6793 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
6794 optional int32 button_clicked = 5;
6795}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01006796
6797/**
6798 * Information about LocationAccessCheck notification presented to user
6799 */
6800message LocationAccessCheckNotificationAction {
6801
6802 // id which identifies single session of user interacting with permission controller
6803 optional int64 session_id = 1;
6804
6805 // Uid of package for which location access check is presented
6806 optional int32 package_uid = 2;
6807
6808 // Name of package for which location access check is presented
6809 optional string package_name = 3;
6810
6811 enum Result {
6812 UNDEFINED = 0;
6813 // notification was presented to the user
6814 NOTIFICATION_PRESENTED = 1;
6815 // notification was declined by the user
6816 NOTIFICATION_DECLINED = 2;
6817 // notification was clicked by the user
6818 NOTIFICATION_CLICKED = 3;
6819 }
6820
6821 // View / interaction recorded
6822 optional Result result = 4;
6823}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01006824
6825/**
6826 * Information about a permission grant or revoke made by user inside AppPermissionFragment
6827 */
6828message AppPermissionFragmentActionReported {
6829 // id which identifies single session of user interacting with permission controller
6830 optional int64 session_id = 1;
6831
6832 // unique value identifying a permission group change. A permission group change might result
6833 // in multiple of these atoms
6834 optional int64 change_id = 2;
6835
6836 // UID of package the permission belongs to
6837 optional int32 uid = 3 [(is_uid) = true];
6838
6839 // Name of package the permission belongs to
6840 optional string package_name = 4;
6841
6842 // The permission to be granted
6843 optional string permission_name = 5;
6844
6845 // The result of the permission grant
6846 optional bool permission_granted = 6;
6847}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01006848
6849/**
6850* Information about a AppPermissionFragment viewed by user
6851*/
6852message AppPermissionFragmentViewed {
6853 // id which identifies single session of user interacting with permission controller
6854 optional int64 session_id = 1;
6855
6856 // UID of package for which permissions are viewed
6857 optional int32 uid = 2 [(is_uid) = true];
6858
6859 // Name of package for which permissions are viewed
6860 optional string package_name = 3;
6861
6862 // Permission group viewed
6863 optional string permission_group_name = 4;
6864}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01006865
6866/**
6867* Information about a AppPermissionsFragment viewed by user
6868*/
6869message AppPermissionsFragmentViewed {
6870 // id which identifies single session of user interacting with permission controller
6871 optional int64 session_id = 1;
6872
6873 // id which identifies single view as every view might have several logging records
6874 // with different package information attached
6875 optional int64 view_id = 2;
6876
6877 // Permission group viewed
6878 optional string permission_group_name = 3;
6879
6880 // UID of package for which permissions are viewed
6881 optional int32 uid = 4 [(is_uid) = true];
6882
6883 // Name of package for which permissions are viewed
6884 optional string package_name = 5;
6885
6886 // Category in which permission is included
6887 enum Category {
6888 UNDEFINED = 0;
6889 ALLOWED = 1;
6890 ALLOWED_FOREGROUND = 2;
6891 DENIED = 3;
6892 }
6893 optional Category category = 6;
6894}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01006895
6896/**
6897* Information about a PermissionAppsFragment viewed by user.
6898* Logged from ui/handheld/PermissionAppsFragment.java
6899*/
6900message PermissionAppsFragmentViewed {
6901 // id which identifies single session of user interacting with permission controller
6902 optional int64 session_id = 1;
6903
6904 // id which identifies single view as every view might have several logging records
6905 // with different package information attached
6906 optional int64 view_id = 2;
6907
6908 // Permission group viewed
6909 optional string permission_group_name = 3;
6910
6911 // UID of package for which permissions are viewed
6912 optional int32 uid = 4 [(is_uid) = true];
6913
6914 // Name of package for which permissions are viewed
6915 optional string package_name = 5;
6916
6917 // Category in which app is included
6918 enum Category {
6919 UNDEFINED = 0;
6920 ALLOWED = 1;
6921 ALLOWED_FOREGROUND = 2;
6922 DENIED = 3;
6923 }
6924 optional Category category = 6;
6925}
Tony Make2b1b672019-07-29 16:59:47 +01006926
6927/**
6928 * Logs when there is a smart selection related event.
6929 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
6930 * Logged from: TextClassifierEventLogger.java
6931 */
6932message TextSelectionEvent {
6933 // A session ID.
6934 optional string session_id = 1;
6935
6936 // Event type of this event.
6937 optional android.stats.textclassifier.EventType event_type = 2;
6938
6939 // Name of the model that is involved in this event.
6940 optional string model_name = 3;
6941
6942 // Type of widget that was involved in triggering this event.
6943 optional android.stats.textclassifier.WidgetType widget_type = 4;
6944
6945 // Index of this event in a session.
6946 optional int32 event_index = 5;
6947
6948 // Entity type that is involved.
6949 optional string entity_type = 6;
6950
6951 // Relative word index of the start of the selection.
6952 optional int32 relative_word_start_index = 7;
6953
6954 // Relative word (exclusive) index of the end of the selection.
6955 optional int32 relative_word_end_index = 8;
6956
6957 // Relative word index of the start of the smart selection.
6958 optional int32 relative_suggested_word_start_index = 9;
6959
6960 // Relative word (exclusive) index of the end of the smart selection.
6961 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01006962
6963 // Name of source package.
6964 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01006965}
6966
6967/**
6968 * Logs when there is a smart linkify related event.
6969 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
6970 * Logged from: TextClassifierEventLogger.java
6971 */
6972message TextLinkifyEvent {
6973 // A session ID.
6974 optional string session_id = 1;
6975
6976 // Event type of this event.
6977 optional android.stats.textclassifier.EventType event_type = 2;
6978
6979 // Name of the model that is involved in this event.
6980 optional string model_name = 3;
6981
6982 // Type of widget that was involved in triggering this event.
6983 optional android.stats.textclassifier.WidgetType widget_type = 4;
6984
6985 // Index of this event in a session.
6986 optional int32 event_index = 5;
6987
6988 // Entity type that is involved.
6989 optional string entity_type = 6;
6990
6991 // Number of links detected.
6992 optional int32 num_links = 7;
6993
6994 // The total length of all links.
6995 optional int32 linked_text_length = 8;
6996
6997 // Length of input text.
6998 optional int32 text_length = 9;
6999
7000 // Time spent on generating links in ms.
7001 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007002
7003 // Name of source package.
7004 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007005}
7006
7007/**
7008 * Logs when there is a conversation actions related event.
7009 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7010 * Logged from: TextClassifierEventLogger.java
7011 */
7012message ConversationActionsEvent {
7013 // A session ID.
7014 optional string session_id = 1;
7015
7016 // Event type of this event.
7017 optional android.stats.textclassifier.EventType event_type = 2;
7018
7019 // Name of the model that is involved in this event.
7020 optional string model_name = 3;
7021
7022 // Type of widget that was involved in triggering this event.
7023 optional android.stats.textclassifier.WidgetType widget_type = 4;
7024
7025 // The first entity type that is involved.
7026 optional string first_entity_type = 5;
7027
7028 // The second entity type that is involved.
7029 optional string second_entity_type = 6;
7030
7031 // The third entity type that is involved.
7032 optional string third_entity_type = 7;
7033
7034 // The score of the first entity type.
7035 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01007036
7037 // Name of source package.
7038 optional string package_name = 9;
Tony Make2b1b672019-07-29 16:59:47 +01007039}
7040
7041/**
7042 * Logs when there is a language detection related event.
7043 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7044 * Logged from: TextClassifierEventLogger.java
7045 */
7046message LanguageDetectionEvent {
7047 // A session ID.
7048 optional string session_id = 1;
7049
7050 // Event type of this event.
7051 optional android.stats.textclassifier.EventType event_type = 2;
7052
7053 // Name of the model that is involved in this event.
7054 optional string model_name = 3;
7055
7056 // Type of widget that was involved in triggering this event.
7057 optional android.stats.textclassifier.WidgetType widget_type = 4;
7058
7059 // Detected language.
7060 optional string language_tag = 5;
7061
7062 // Score of the detected language.
7063 optional float score = 6;
7064
7065 // Position of this action.
7066 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01007067
7068 // Name of source package.
7069 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01007070}
Tianjie Xu167c3db2019-07-22 14:25:14 -07007071
7072/**
7073 * Information about an OTA update attempt by update_engine.
7074 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7075 */
7076message UpdateEngineUpdateAttemptReported {
7077 // The number of attempts for the update engine to apply a given payload.
7078 optional int32 attempt_number = 1;
7079
7080 optional android.stats.otaupdate.PayloadType payload_type = 2;
7081
7082 // The total time in minutes for the update engine to apply a given payload.
7083 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
7084 // it's increased when the system is sleeping.
7085 optional int32 duration_boottime_in_minutes = 3;
7086
7087 // The total time in minutes for the update engine to apply a given payload.
7088 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
7089 // and it's not increased when the system is sleeping.
7090 optional int32 duration_monotonic_in_minutes = 4;
7091
7092 // The size of the payload in MiBs.
7093 optional int32 payload_size_mib = 5;
7094
7095 // The attempt result reported by the update engine for an OTA update.
7096 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
7097
7098 // The error code reported by the update engine after an OTA update attempt
7099 // on A/B devices.
7100 optional android.stats.otaupdate.ErrorCode error_code = 7;
7101
7102 // The build fingerprint of the source system. The value is read from a
7103 // system property when the device takes the update. e.g.
7104 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
7105 optional string source_fingerprint = 8;
7106}
7107
7108/**
7109 * Information about all the attempts the device make before finishing the
7110 * successful update.
7111 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7112 */
7113message UpdateEngineSuccessfulUpdateReported {
7114 // The number of attempts for the update engine to apply the payload for a
7115 // successful update.
7116 optional int32 attempt_count = 1;
7117
7118 optional android.stats.otaupdate.PayloadType payload_type = 2;
7119
7120 optional int32 payload_size_mib = 3;
7121
7122 // The total number of bytes downloaded by update_engine since the last
7123 // successful update.
7124 optional int32 total_bytes_downloaded_mib = 4;
7125
7126 // The ratio in percentage of the over-downloaded bytes compared to the
7127 // total bytes needed to successfully install the update. e.g. 200 if we
7128 // download 200MiB in total for a 100MiB package.
7129 optional int32 download_overhead_percentage = 5;
7130
7131 // The total time in minutes for the update engine to apply the payload for a
7132 // successful update.
7133 optional int32 total_duration_minutes = 6;
7134
7135 // The number of reboot of the device during a successful update.
7136 optional int32 reboot_count = 7;
7137}
Alec Mourie088e762019-07-02 13:10:55 -07007138
7139/**
7140 * Global display pipeline metrics reported by SurfaceFlinger.
7141 * Pulled from:
7142 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7143 */
7144message SurfaceflingerStatsGlobalInfo {
7145 // Total number of frames presented during the tracing period
7146 optional int64 total_frames = 1;
7147 // Total number of frames missed
7148 optional int64 missed_frames = 2;
7149 // Total number of frames that fell back to client composition
7150 optional int64 client_composition_frames = 3;
7151 // Total time the display was turned on
7152 optional int64 display_on_millis = 4;
7153 // Total time that was spent performing animations.
7154 // This is derived from the present-to-present layer histogram
7155 optional int64 animation_millis = 5;
7156}
7157
7158/**
7159 * Per-layer display pipeline metrics reported by SurfaceFlinger.
7160 * The number of layers uploaded will be restricted due to size limitations.
7161 * Pulled from:
7162 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7163 */
7164message SurfaceflingerStatsLayerInfo {
7165 // The layer for this set of metrics
7166 // For now we can infer that the package name is included in the layer
7167 // name.
7168 optional string layer_name = 1;
7169 // Total number of frames presented
7170 optional int64 total_frames = 2;
7171 // Total number of dropped frames while latching a buffer for this layer.
7172 optional int64 dropped_frames = 3;
7173 // Set of timings measured between successive presentation timestamps.
7174 optional FrameTimingHistogram present_to_present = 4
7175 [(android.os.statsd.log_mode) = MODE_BYTES];
7176 // Set of timings measured from when an app queued a buffer for
7177 // presentation, until the buffer was actually presented to the
7178 // display.
7179 optional FrameTimingHistogram post_to_present = 5
7180 [(android.os.statsd.log_mode) = MODE_BYTES];
7181 // Set of timings measured from when a buffer is ready to be presented,
7182 // until the buffer was actually presented to the display.
7183 optional FrameTimingHistogram acquire_to_present = 6
7184 [(android.os.statsd.log_mode) = MODE_BYTES];
7185 // Set of timings measured from when a buffer was latched by
7186 // SurfaceFlinger, until the buffer was presented to the display
7187 optional FrameTimingHistogram latch_to_present = 7
7188 [(android.os.statsd.log_mode) = MODE_BYTES];
7189 // Set of timings measured from the desired presentation to the actual
7190 // presentation time
7191 optional FrameTimingHistogram desired_to_present = 8
7192 [(android.os.statsd.log_mode) = MODE_BYTES];
7193 // Set of timings measured from when an app queued a buffer for
7194 // presentation, until the buffer was ready to be presented.
7195 optional FrameTimingHistogram post_to_acquire = 9
7196 [(android.os.statsd.log_mode) = MODE_BYTES];
7197}
7198
7199/**
7200 * Histogram of frame counts bucketed by time in milliseconds.
7201 * Because of size limitations, we hard-cap the number of buckets, with
7202 * buckets for corresponding to larger milliseconds being less precise.
7203 */
7204message FrameTimingHistogram {
7205 // Timings in milliseconds that describes a set of histogram buckets
7206 repeated int32 time_millis_buckets = 1;
7207 // Number of frames that match to each time_millis, i.e. the bucket
7208 // contents
7209 // It's required that len(time_millis) == len(frame_count)
7210 repeated int64 frame_counts = 2;
7211}
Emilian Peev6729f372019-08-29 09:14:09 -07007212
Emilian Peev6729f372019-08-29 09:14:09 -07007213/**
7214 * Information about camera facing and API level usage.
7215 * Logged from:
7216 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
7217 */
7218message CameraActionEvent {
7219 // Camera session duration
7220 optional int64 duration = 1;
7221
7222 // Camera API level used
7223 optional int32 api_level = 2;
7224
7225 // Name of client package
7226 optional string package_name = 3;
7227
7228 // Camera facing
7229 enum Facing {
7230 UNKNOWN = 0;
7231 BACK = 1;
7232 FRONT = 2;
7233 EXTERNAL = 3;
7234 }
7235 optional Facing facing = 4;
7236}
atrost01a20932019-08-28 15:40:37 +01007237
7238/**
7239 * Logs when a compatibility change is affecting an app.
7240 *
7241 * Logged from:
7242 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
7243 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
7244 */
7245message AppCompatibilityChangeReported {
7246 // The UID of the app being affected by the compatibilty change.
7247 optional int32 uid = 1 [(is_uid) = true];
7248
7249 // The ID of the change affecting the app.
7250 optional int64 change_id = 2;
7251
7252 enum State {
7253 UNKNOWN_STATE = 0;
7254 ENABLED = 1;
7255 DISABLED = 2;
7256 LOGGED = 3;
7257 }
7258
7259 // The state of the change - if logged from gating whether it was enabled or disabled, or just
7260 // logged otherwise.
7261 optional State state = 3;
7262
7263 enum Source {
7264 UNKNOWN_SOURCE = 0;
7265 APP_PROCESS = 1;
7266 SYSTEM_SERVER = 2;
7267 }
7268
7269 // Where it was logged from.
7270 optional Source source = 4;
7271
7272}
Hector Dearman40579f62019-11-01 13:19:30 +00007273
7274/**
7275 * Logged from
7276 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
7277 */
7278message PerfettoUploaded {
7279 enum Event {
7280 PERFETTO_UNDEFINED = 0;
7281 PERFETTO_TRACE_BEGIN = 1;
7282 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
7283 PERFETTO_ON_CONNECT = 3;
7284 PERFETTO_ON_TRACING_DISABLED = 4;
7285 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
7286 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
7287 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
7288 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
7289 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
7290 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
7291 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
7292 PERFETTO_TRIGGER_BEGIN = 12;
7293 PERFETTO_TRIGGER_SUCCESS = 13;
7294 PERFETTO_TRIGGER_FAILURE = 14;
7295 PERFETTO_HIT_GUARDRAILS = 15;
7296 PERFETTO_ON_TIMEOUT = 16;
7297 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
7298 }
7299
7300 // Which stage of the pipeline we are reporting from.
7301 optional Event event = 1;
7302
7303 // UUID matching the one set inside the SystemInfo trace packet.
7304 optional int64 trace_uuid_lsb = 2;
7305 optional int64 trace_uuid_msb = 3;
7306}
Mark Tabrya824a642019-11-05 12:26:12 -08007307
7308/**
7309 * Pulls client metrics on data transferred via Vehicle Maps Service.
7310 * Metrics are keyed by uid + layer.
7311 *
7312 * Pulled from:
7313 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
7314 */
7315message VmsClientStats {
7316 // UID of the VMS client app
7317 optional int32 uid = 1 [(is_uid) = true];
7318
7319 // VMS layer definition
7320 optional int32 layer_type = 2;
7321 optional int32 layer_channel = 3;
7322 optional int32 layer_version = 4;
7323
7324 // Bytes and packets sent by the client for the layer
7325 optional int64 tx_bytes = 5;
7326 optional int64 tx_packets = 6;
7327
7328 // Bytes and packets received by the client for the layer
7329 optional int64 rx_bytes = 7;
7330 optional int64 rx_packets = 8;
7331
7332 // Bytes and packets dropped due to client error
7333 optional int64 dropped_bytes = 9;
7334 optional int64 dropped_packets = 10;
7335}