blob: bfbf66743f37839a2154cf647f9dcfcf62fff9a9 [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";
Joe Onorato62c220b2017-11-18 20:32:56 -080060
Yao Chend54f9dd2017-10-17 17:37:48 +000061/**
Stefan Lafonae2df012017-11-14 09:17:21 -080062 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000063 * raw stats log events from the Android system, also known as "atoms."
64 *
65 * This field contains a single oneof with all of the available messages.
66 * The stats-log-api-gen tool runs as part of the Android build and
67 * generates the android.util.StatsLog class, which contains the constants
68 * and methods that Android uses to log.
69 *
Stefan Lafonae2df012017-11-14 09:17:21 -080070 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000071 * Instead, statsd on Android constructs these messages synthetically,
72 * in the format defined here and in stats_log.proto.
73 */
Stefan Lafonae2df012017-11-14 09:17:21 -080074message Atom {
75 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070076 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070077 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
78 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070079 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070080 BleScanResultReceived ble_scan_result_received = 4;
81 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080082 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070083 SyncStateChanged sync_state_changed = 7;
84 ScheduledJobStateChanged scheduled_job_state_changed = 8;
85 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070086 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080087 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
88 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
89 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070090 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
91 MemoryFactorStateChanged memory_factor_state_changed = 15;
92 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
93 CachedKillReported cached_kill_reported = 17;
94 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070095 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080096 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
97 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
98 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070099 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800100 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -0700101 CameraStateChanged camera_state_changed = 25;
102 FlashlightStateChanged flashlight_state_changed = 26;
103 UidProcessStateChanged uid_process_state_changed = 27;
104 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
105 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -0700106 BatteryLevelChanged battery_level_changed = 30;
107 ChargingStateChanged charging_state_changed = 31;
108 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -0700109 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800110 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -0700111 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
112 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -0700113 WifiLockStateChanged wifi_lock_state_changed = 37;
114 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
115 WifiScanStateChanged wifi_scan_state_changed = 39;
116 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700117 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700118 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700119 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900120 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700121 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800122 AnomalyDetected anomaly_detected = 46;
Andrei Oneada01ea52019-01-30 15:28:36 +0000123 AppBreadcrumbReported app_breadcrumb_reported = 47 [(allow_from_any_uid) = true];
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800124 AppStartOccurred app_start_occurred = 48;
125 AppStartCanceled app_start_canceled = 49;
126 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800127 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800128 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800129 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800130 LmkStateChanged lmk_state_changed = 54;
131 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800132 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800133 BootSequenceReported boot_sequence_reported = 57;
Andrei Oneada01ea52019-01-30 15:28:36 +0000134 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -0800135 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800136 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800137 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800138 KeyguardStateChanged keyguard_state_changed = 62;
139 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
140 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800141 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800142 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800143 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
144 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800145 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700146 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800147 SpeakerImpedanceReported speaker_impedance_reported = 71;
148 HardwareFailed hardware_failed = 72;
149 PhysicalDropDetected physical_drop_detected = 73;
150 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800151 MobileConnectionStateChanged mobile_connection_state_changed = 75;
152 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700153 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800154 AppCrashOccurred app_crash_occurred = 78;
155 ANROccurred anr_occurred = 79;
156 WTFOccurred wtf_occurred = 80;
157 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700158 GenericAtom generic_atom = 82;
jianjin6eada302019-02-28 11:25:57 -0800159 KeyValuePairsAtom key_value_pairs_atom = 83 [(allow_from_any_uid) = true];
Bookatza7020bd2018-08-28 16:29:35 -0700160 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700161 DeferredJobStatsReported deferred_job_stats_reported = 85;
Tej Singha72344992019-04-17 18:55:08 -0700162 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Kevin Chyn1741a072019-01-17 11:54:40 -0800163 BiometricAcquired biometric_acquired = 87;
164 BiometricAuthenticated biometric_authenticated = 88;
165 BiometricErrorOccurred biometric_error_occurred = 89;
Howard Ro0db82032019-04-07 18:43:34 -0700166 // Atom number 90 is available for use.
Howard Roa46b6582018-09-18 16:45:02 -0700167 BatteryHealthSnapshot battery_health_snapshot = 91;
168 SlowIo slow_io = 92;
169 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700170 PhoneServiceStateChanged phone_service_state_changed = 94;
171 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100172 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700173 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700174 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700175 // TODO: service state change is very noisy shortly after boot, as well
176 // as at other transitions - coming out of doze, device plugged in, etc.
177 // Consider removing this if it becomes a problem
178 ServiceStateChanged service_state_changed = 99;
179 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800180 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800181 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000182 DevicePolicyEvent device_policy_event = 103;
shawnlin9a1392a2019-04-09 16:21:17 +0800183 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled =
184 104 [(log_from_module) = "docsui"];
185 DocsUIFileOperationCopyMoveModeReported
186 docs_ui_file_op_copy_move_mode_reported =
187 105 [(log_from_module) = "docsui"];
188 DocsUIFileOperationFailureReported docs_ui_file_op_failure =
189 106 [(log_from_module) = "docsui"];
190 DocsUIFileOperationReported docs_ui_provider_file_op =
191 107 [(log_from_module) = "docsui"];
192 DocsUIInvalidScopedAccessRequestReported
193 docs_ui_invalid_scoped_access_request =
194 108 [(log_from_module) = "docsui"];
195 DocsUILaunchReported docs_ui_launch_reported =
196 109 [(log_from_module) = "docsui"];
197 DocsUIRootVisitedReported docs_ui_root_visited =
198 110 [(log_from_module) = "docsui"];
199 DocsUIStartupMsReported docs_ui_startup_ms =
200 111 [(log_from_module) = "docsui"];
201 DocsUIUserActionReported docs_ui_user_action_reported =
202 112 [(log_from_module) = "docsui"];
Bookatzda1798c2018-12-13 14:16:00 -0800203 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
204 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f62018-12-06 11:01:38 +0000205 AppCompacted app_compacted = 115;
lifre82d8f62019-03-25 20:33:21 +0800206 NetworkDnsEventReported network_dns_event_reported = 116 [(log_from_module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800207 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
208 117 [(log_from_module) = "docsui"];
209 DocsUIPickResultReported docs_ui_pick_result_reported =
210 118 [(log_from_module) = "docsui"];
211 DocsUISearchModeReported docs_ui_search_mode_reported =
212 119 [(log_from_module) = "docsui"];
213 DocsUISearchTypeReported docs_ui_search_type_reported =
214 120 [(log_from_module) = "docsui"];
Chiachang Wange512b262019-04-11 21:24:28 +0800215 DataStallEvent data_stall_event = 121 [(log_from_module) = "network_stack"];
Christian Brunschenf86039e2018-12-21 12:26:14 +0000216 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000217 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800218 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800219 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800220 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
221 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000222 AppDowngraded app_downgraded = 128;
223 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
224 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800225 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
226 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800227 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800228 NfcErrorOccurred nfc_error_occurred = 134;
229 NfcStateChanged nfc_state_changed = 135;
230 NfcBeamOccurred nfc_beam_occurred = 136;
231 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
232 NfcTagOccurred nfc_tag_occurred = 138;
233 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
234 SeStateChanged se_state_changed = 140;
235 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800236 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800237 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800238 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800239 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800240 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800241 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyne5a37fb2019-02-08 13:10:36 -0800242 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500243 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800244 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Jack Hec27040a2019-01-09 20:54:41 -0800245 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
246 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
247 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
248 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
249 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
250 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
251 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
252 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
253 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He1021a612019-01-20 21:22:46 -0800254 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
255 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
Jack Heaea26982019-04-04 11:19:48 -0700256 BluetoothDeviceInfoReported bluetooth_device_info_reported = 162;
Jack He1021a612019-01-20 21:22:46 -0800257 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
258 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
259 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
260 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
261 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Alex Salod7c3eef2019-01-25 14:43:27 -0800262 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800263 ProcessStartTime process_start_time = 169;
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700264 PermissionGrantRequestResultReported permission_grant_request_result_reported =
265 170 [(log_from_module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800266 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Michael Groover4a0ca942019-01-24 17:41:25 -0800267 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Steven Wu552f63f2019-02-05 13:41:36 -0500268 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
joshmccloskey8c3322e2019-01-09 18:25:57 -0800269 AssistGestureStageReported assist_gesture_stage_reported = 174;
270 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
271 AssistGestureProgressReported assist_gesture_progress_reported = 176;
Philip Quinn0eded622019-01-29 12:46:28 -0800272 TouchGestureClassified touch_gesture_classified = 177;
Andrei Onea4ad6d0c2019-02-08 13:54:12 +0000273 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true];
Kunhung Li286c52f2019-05-21 20:10:43 +0800274 StyleUIChanged style_ui_changed = 179 [(log_from_module) = "style"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700275 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Tej Singha72344992019-04-17 18:55:08 -0700276 180 [(log_from_module) = "permissioncontroller"];
Carmen Agimof6688a352019-01-30 19:36:04 +0000277 AppInstallOnExternalStorageReported app_install_on_external_storage_reported = 181;
Chiachang Wange512b262019-04-11 21:24:28 +0800278 NetworkStackReported network_stack_reported = 182 [(log_from_module) = "network_stack"];
Carmen Agimof6dcc5032019-03-01 16:20:09 +0000279 AppMovedStorageReported app_moved_storage_reported = 183;
joshmccloskey6f952b22019-03-25 20:59:35 -0700280 BiometricEnrolled biometric_enrolled = 184;
jianjin8f2dee02019-03-29 14:03:08 -0700281 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185;
282 TombStoneOccurred tomb_stone_occurred = 186;
Jack He71426802019-04-02 13:32:52 -0700283 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported = 187;
Ben Blount763a5d52019-04-10 11:48:58 -0700284 IntelligenceEventReported intelligence_event_reported =
285 188 [(log_from_module) = "intelligence"];
Tej Singha72344992019-04-17 18:55:08 -0700286 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed = 189;
Hai Zhang5d3328d2019-04-13 21:25:06 +0800287 RoleRequestResultReported role_request_result_reported =
288 190 [(log_from_module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800289 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
290 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
291 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
292 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
293 MediametricsCodecReported mediametrics_codec_reported = 195;
294 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
295 MediametricsExtractorReported mediametrics_extractor_reported = 197;
296 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
297 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
298 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Yuncheol Heod1a85d22019-05-08 17:13:42 -0700299 CarPowerStateChanged car_power_state_changed = 203;
300 GarageModeInfo garage_mode_info = 204;
Tej Singhc9203082019-05-03 13:42:23 -0700301 TestAtomReported test_atom_reported = 205 [(log_from_module) = "cts"];
Adam He420947c2019-01-23 15:59:09 -0800302 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported = 206;
303 ContentCaptureServiceEvents content_capture_service_events = 207;
304 ContentCaptureSessionEvents content_capture_session_events = 208;
305 ContentCaptureFlushed content_capture_flushed = 209;
Hongyi Zhang700137e2019-05-23 21:19:36 -0700306 LocationManagerApiUsageReported location_manager_api_usage_reported = 210;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100307 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
308 211 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100309 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
310 212 [(log_from_module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100311 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
312 213 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100313 LocationAccessCheckNotificationAction location_access_check_notification_action =
314 214 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100315 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
316 215 [(log_from_module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100317 AppPermissionFragmentViewed app_permission_fragment_viewed =
318 216 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100319 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
320 217 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100321 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
322 218 [(log_from_module) = "permissioncontroller"];
Tony Make2b1b672019-07-29 16:59:47 +0100323 TextSelectionEvent text_selection_event =
324 219 [(log_from_module) = "textclassifier"];
325 TextLinkifyEvent text_linkify_event =
326 220 [(log_from_module) = "textclassifier"];
327 ConversationActionsEvent conversation_actions_event =
328 221 [(log_from_module) = "textclassifier"];
329 LanguageDetectionEvent language_detection_event =
330 222 [(log_from_module) = "textclassifier"];
331
Yao Chend54f9dd2017-10-17 17:37:48 +0000332 }
David Chenc8a43242017-10-17 16:23:28 -0700333
David Chen6e3e6cb2018-01-03 16:14:06 -0800334 // Pulled events will start at field 10000.
Rafal Slawik77987ed2019-06-17 12:28:23 +0100335 // Next: 10062
David Chenc8a43242017-10-17 16:23:28 -0700336 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800337 WifiBytesTransfer wifi_bytes_transfer = 10000;
338 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
339 MobileBytesTransfer mobile_bytes_transfer = 10002;
340 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800341 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800342 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800343 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800344 CpuTimePerFreq cpu_time_per_freq = 10008;
345 CpuTimePerUid cpu_time_per_uid = 10009;
346 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800347 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800348 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800349 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800350 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800351 SystemElapsedRealtime system_elapsed_realtime = 10014;
352 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800353 CpuActiveTime cpu_active_time = 10016;
354 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000355 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800356 RemainingBatteryCapacity remaining_battery_capacity = 10019;
357 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800358 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100359 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100360 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100361 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000362 DiskStats disk_stats = 10025;
363 DirectoryUsage directory_usage = 10026;
364 AppSize app_size = 10027;
365 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700366 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700367 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800368 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700369 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700370 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800371 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700372 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100373 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100374 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700375 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee60422018-11-09 12:27:37 -0800376 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
377 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
378 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000379 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800380 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800381 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800382 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000383 DebugElapsedClock debug_elapsed_clock = 10046;
384 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800385 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800386 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800387 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800388 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000389 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000390 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800391 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
392 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000393 SystemIonHeapSize system_ion_heap_size = 10056;
Carmen Agimofa769c152019-03-04 14:39:14 +0000394 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700395 FaceSettings face_settings = 10058;
Maggie White442b6312019-04-05 16:26:44 -0700396 CoolingDevice cooling_device = 10059;
Martijn Coenencd95d462019-04-25 17:09:45 +0200397 AppOps app_ops = 10060;
Rafal Slawik77987ed2019-06-17 12:28:23 +0100398 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061;
David Chenc8a43242017-10-17 16:23:28 -0700399 }
yroa1fe77c2018-02-26 14:22:54 -0800400
Bookatz76aafcf2018-09-17 16:17:10 -0700401 // DO NOT USE field numbers above 100,000 in AOSP.
402 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
403 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700404}
405
Yao Chend54f9dd2017-10-17 17:37:48 +0000406/**
Yangster-mac20877162017-12-22 17:19:39 -0800407 * This proto represents a node of an attribution chain.
408 * Note: All attribution chains are represented as a repeated field of type
409 * AttributionNode. It is understood that in such arrays, the order is that
410 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000411 */
Yangster-mac20877162017-12-22 17:19:39 -0800412message AttributionNode {
413 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800414 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800415
Yangster-mac20877162017-12-22 17:19:39 -0800416 // The (optional) string tag for an element in the attribution chain. If the
417 // element has no tag, it is encoded as an empty string.
418 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700419}
420
Yangster-mac48b3d622018-08-18 12:38:11 -0700421message KeyValuePair {
422 optional int32 key = 1;
423 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700424 int32 value_int = 2;
425 int64 value_long = 3;
426 string value_str = 4;
427 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700428 }
429}
430
431message KeyValuePairsAtom {
432 optional int32 uid = 1;
433 repeated KeyValuePair pairs = 2;
434}
435
Yao Chend54f9dd2017-10-17 17:37:48 +0000436/*
437 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800438 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000439 *
440 * RULES:
441 * - The field ids for each atom must start at 1, and count upwards by 1.
442 * Skipping field ids is not allowed.
443 * - These form an API, so renaming, renumbering or removing fields is
444 * not allowed between android releases. (This is not currently enforced,
445 * but there will be a tool to enforce this restriction).
446 * - The types must be built-in protocol buffer types, namely, no sub-messages
447 * are allowed (yet). The bytes type is also not allowed.
448 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800449 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000450 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800451 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000452 * - A field that is a uid should be a string field, tagged with the [xxx]
453 * annotation. The generated code on android will be represented by UIDs,
454 * and those UIDs will be translated in xxx to those strings.
455 *
456 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700457 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000458 * - If there is a UID, it goes first. Think in an object-oriented fashion.
459 * *****************************************************************************
460 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700461
Yao Chend54f9dd2017-10-17 17:37:48 +0000462/**
Tej Singha72344992019-04-17 18:55:08 -0700463 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700464 * Logs when the Thermal service HAL notifies the throttling start/stop events.
465 *
466 * Logged from:
467 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
468 */
469message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700470 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700471 optional android.os.TemperatureTypeEnum sensor_type = 1;
472
Maggie White442b6312019-04-05 16:26:44 -0700473 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700474 enum State {
475 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700476 START = 1; // START indicated that throttling was triggered.
477 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700478 }
Yangster-mace16189a2018-08-26 12:20:16 -0700479 optional State state = 2;
480
481 optional float temperature = 3;
482}
483
484/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000485 * Logs when the screen state changes.
486 *
487 * Logged from:
488 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
489 */
490message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800491 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700492 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700493}
Yao Chend54f9dd2017-10-17 17:37:48 +0000494
495/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700496 * Logs that the process state of the uid, as determined by ActivityManager
497 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000498 *
499 * Logged from:
500 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
501 */
Bookatzc1a050a2017-10-10 15:49:28 -0700502message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700503 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000504
Bookatzdb026a22018-01-10 19:01:56 -0800505 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700506 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000507}
508
509/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700510 * Logs process state change of a process, as per the activity manager.
511 *
512 * Logged from:
513 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
514 */
515message ProcessStateChanged {
516 optional int32 uid = 1;
517 optional string process_name = 2;
518 optional string package_name = 3;
519 // TODO: remove this when validation is done
520 optional int64 version = 5;
521 // The state, from frameworks/base/core/proto/android/app/enums.proto.
522 optional android.app.ProcessStateEnum state = 4;
523}
524
525/**
526 * Logs when ActivityManagerService sleep state is changed.
527 *
528 * Logged from:
529 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
530 */
531message ActivityManagerSleepStateChanged {
532 // TODO: import frameworks proto
533 enum State {
534 UNKNOWN = 0;
535 ASLEEP = 1;
536 AWAKE = 2;
537 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700538 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700539}
540
541/**
542 * Logs when system memory state changes.
543 *
544 * Logged from:
545 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
546 */
547message MemoryFactorStateChanged {
548 // TODO: import frameworks proto
549 enum State {
550 MEMORY_UNKNOWN = 0;
551 NORMAL = 1; // normal.
552 MODERATE = 2; // moderate memory pressure.
553 LOW = 3; // low memory.
554 CRITICAL = 4; // critical memory.
555
556 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700557 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700558}
559
560/**
561 * Logs when app is using too much cpu, according to ActivityManagerService.
562 *
563 * Logged from:
564 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
565 */
566message ExcessiveCpuUsageReported {
567 optional int32 uid = 1;
568 optional string process_name = 2;
569 optional string package_name = 3;
570 // package version. TODO: remove this when validation is done
571 optional int64 version = 4;
572}
573
574/**
575 * Logs when a cached process is killed, along with its pss.
576 *
577 * Logged from:
578 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
579 */
580message CachedKillReported {
581 optional int32 uid = 1;
582 optional string process_name = 2;
583 optional string package_name = 3;
584 // TODO: remove this when validation is done
585 optional int64 version = 5;
586 optional int64 pss = 4;
587}
588
589/**
590 * Logs when memory stats of a process is reported.
591 *
592 * Logged from:
593 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
594 */
595message ProcessMemoryStatReported {
596 optional int32 uid = 1;
597 optional string process_name = 2;
598 optional string package_name = 3;
599 //TODO: remove this when validation is done
600 optional int64 version = 9;
601 optional int64 pss = 4;
602 optional int64 uss = 5;
603 optional int64 rss = 6;
604 enum Type {
605 ADD_PSS_INTERNAL_SINGLE = 0;
606 ADD_PSS_INTERNAL_ALL_MEM = 1;
607 ADD_PSS_INTERNAL_ALL_POLL = 2;
608 ADD_PSS_EXTERNAL = 3;
609 ADD_PSS_EXTERNAL_SLOW = 4;
610 }
611 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800612 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700613}
614
615/**
Bookatzc1a050a2017-10-10 15:49:28 -0700616 * Logs that a process started, finished, crashed, or ANRed.
617 *
618 * Logged from:
619 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
620 */
621message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700622 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700623
David Chen0b5c90c2018-01-25 16:51:49 -0800624 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800625 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700626
Bookatzddccf0a2017-11-28 16:48:14 -0800627 // What lifecycle state the process changed to.
628 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800629 enum State {
630 FINISHED = 0;
631 STARTED = 1;
632 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800633 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800634 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700635}
636
Bookatzc1a050a2017-10-10 15:49:28 -0700637/**
638 * Logs when the ble scan state changes.
639 *
640 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700641 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700642 */
643message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800644 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700645
646 enum State {
647 OFF = 0;
648 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700649 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
650 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700651 }
652 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700653
Bookatze5ec0b42018-03-26 13:34:56 -0700654 // Does the scan have a filter.
655 optional bool is_filtered = 3;
656 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
657 optional bool is_first_match = 4;
658 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
659 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700660}
661
662/**
663 * Logs reporting of a ble scan finding results.
664 *
665 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700666 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700667 */
Bookatzae6738e2018-09-13 11:38:56 -0700668// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700669message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800670 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700671
672 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800673 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700674}
675
676/**
677 * Logs when a sensor state changes.
678 *
679 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700680 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700681 */
682message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800683 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700684
Bookatzc1a050a2017-10-10 15:49:28 -0700685 // The id (int) of the sensor.
686 optional int32 sensor_id = 2;
687
688 enum State {
689 OFF = 0;
690 ON = 1;
691 }
692 optional State state = 3;
693}
694
Bookatzc1a050a2017-10-10 15:49:28 -0700695/**
696 * Logs when GPS state changes.
697 *
698 * Logged from:
699 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
700 */
701message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800702 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700703
704 enum State {
705 OFF = 0;
706 ON = 1;
707 }
708 optional State state = 2;
709}
710
Bookatz48d362e2018-11-06 15:49:08 -0800711/**
712 * Logs when GPS signal quality.
713 *
714 * Logged from:
715 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
716 */
717message GpsSignalQualityChanged {
718 optional android.server.location.GpsSignalQualityEnum level = 1;
719}
720
Bookatzc1a050a2017-10-10 15:49:28 -0700721
722/**
723 * Logs when a sync manager sync state changes.
724 *
725 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700726 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700727 */
728message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800729 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700730
David Chen0b5c90c2018-01-25 16:51:49 -0800731 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800732 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700733
734 enum State {
735 OFF = 0;
736 ON = 1;
737 }
738 optional State state = 3;
739}
740
Yangster-mac96353002018-09-05 11:18:55 -0700741/*
742 * Deferred job stats.
743 *
744 * Logged from:
745 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
746*/
747message DeferredJobStatsReported {
748 repeated AttributionNode attribution_node = 1;
749
750 // Number of jobs deferred.
751 optional int32 num_jobs_deferred = 2;
752
753 // Time since the last job runs.
754 optional int64 time_since_last_job_millis = 3;
755}
756
Bookatzc1a050a2017-10-10 15:49:28 -0700757/**
758 * Logs when a job scheduler job state changes.
759 *
760 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700761 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700762 */
763message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800764 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700765
766 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800767 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700768
769 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800770 FINISHED = 0;
771 STARTED = 1;
772 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700773 }
774 optional State state = 3;
775
Tej Singh33a412b2018-03-16 18:43:59 -0700776 // The reason a job has stopped.
777 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700778 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700779 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100780
781 // The standby bucket of the app that scheduled the job. These match the framework constants
782 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
783 // already assigned 0.
784 enum Bucket {
785 UNKNOWN = -1;
786 ACTIVE = 0;
787 WORKING_SET = 1;
788 FREQUENT = 2;
789 RARE = 3;
790 NEVER = 4;
791 }
792 optional Bucket standby_bucket = 5 [default = UNKNOWN];
793
794 // The job id (as assigned by the app).
795 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700796}
797
798/**
799 * Logs when the audio state changes.
800 *
801 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700802 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700803 */
804message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800805 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700806
807 enum State {
808 OFF = 0;
809 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700810 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
811 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700812 }
813 optional State state = 2;
814}
815
816/**
817 * Logs when the video codec state changes.
818 *
819 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700820 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700821 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800822message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800823 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700824
825 enum State {
826 OFF = 0;
827 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700828 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
829 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700830 }
831 optional State state = 2;
832}
833
834/**
835 * Logs when the flashlight state changes.
836 *
837 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700838 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700839 */
840message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800841 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700842
843 enum State {
844 OFF = 0;
845 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700846 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
847 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700848 }
849 optional State state = 2;
850}
851
852/**
853 * Logs when the camera state changes.
854 *
855 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700856 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700857 */
858message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800859 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700860
861 enum State {
862 OFF = 0;
863 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700864 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
865 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700866 }
867 optional State state = 2;
868}
869
870/**
871 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000872 *
873 * Logged from:
874 * TODO
875 */
Bookatzd6746242017-10-24 18:39:35 -0700876message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800877 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000878
Bookatz1a1b0462018-01-12 11:47:03 -0800879 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
880 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700881 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700882
883 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
884 optional string tag = 3;
885
886 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800887 RELEASE = 0;
888 ACQUIRE = 1;
889 CHANGE_RELEASE = 2;
890 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700891 }
892 optional State state = 4;
893}
894
895/**
Bookatzc1a050a2017-10-10 15:49:28 -0700896 * Logs when a partial wakelock is considered 'long' (over 1 min).
897 *
898 * Logged from:
899 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
900 */
901message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800902 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700903
Yao Chend54f9dd2017-10-17 17:37:48 +0000904 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
905 optional string tag = 2;
906
Bookatzc1a050a2017-10-10 15:49:28 -0700907 // TODO: I have no idea what this is.
908 optional string history_tag = 3;
909
910 enum State {
911 OFF = 0;
912 ON = 1;
913 }
914 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000915}
916
Bookatzc1a050a2017-10-10 15:49:28 -0700917/**
Bookatza66083f2018-09-20 17:24:00 -0700918 * Logs when the device is interactive, according to the PowerManager Notifier.
919 *
920 * Logged from:
921 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
922 */
923message InteractiveStateChanged {
924 enum State {
925 OFF = 0;
926 ON = 1;
927 }
928 optional State state = 1;
929}
930
931/**
Bookatzc1a050a2017-10-10 15:49:28 -0700932 * Logs Battery Saver state change.
933 *
934 * Logged from:
935 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
936 */
937message BatterySaverModeStateChanged {
938 enum State {
939 OFF = 0;
940 ON = 1;
941 }
942 optional State state = 1;
943}
944
945/**
946 * Logs Doze mode state change.
947 *
948 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800949 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700950 */
951message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800952 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800953}
954
955
956/**
957 * Logs state change of Doze mode including maintenance windows.
958 *
959 * Logged from:
960 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
961 */
962message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800963 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700964}
965
966/**
967 * Logs screen brightness level.
968 *
969 * Logged from:
970 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
971 */
972message ScreenBrightnessChanged {
973 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
974 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700975}
976
977/**
978 * Logs battery level (percent full, from 0 to 100).
979 *
980 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700981 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700982 */
983message BatteryLevelChanged {
984 // Battery level. Should be in [0, 100].
985 optional int32 battery_level = 1;
986}
987
988/**
989 * Logs change in charging status of the device.
990 *
991 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700992 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700993 */
994message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800995 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
996 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700997}
998
999/**
1000 * Logs whether the device is plugged in, and what power source it is using.
1001 *
1002 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001003 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001004 */
1005message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001006 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1007 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001008}
1009
Bookatz8c6571b2017-10-24 15:04:41 -07001010/**
1011 * Logs when an app's wakeup alarm fires.
1012 *
1013 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001014 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001015 */
1016message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001017 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001018
1019 // Name of the wakeup alarm.
1020 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001021
1022 // Name of source package (for historical reasons, since BatteryStats tracked it).
1023 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001024
1025 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1026 enum Bucket {
1027 UNKNOWN = 0;
1028 EXEMPTED = 5;
1029 ACTIVE = 10;
1030 WORKING_SET = 20;
1031 FREQUENT = 30;
1032 RARE = 40;
1033 NEVER = 50;
1034 }
1035 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1036 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001037}
1038
1039/**
1040 * Logs when an an app causes the mobile radio to change state.
1041 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1042 *
1043 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001044 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001045 */
1046message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001047 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001048
Bookatz1a1b0462018-01-12 11:47:03 -08001049 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1050 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001051}
1052
1053/**
1054 * Logs when an an app causes the wifi radio to change state.
1055 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1056 *
1057 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001058 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001059 */
1060message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001061 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001062
Bookatz1a1b0462018-01-12 11:47:03 -08001063 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1064 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001065}
1066
1067/**
1068 * Logs kernel wakeup reasons and aborts.
1069 *
1070 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001071 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001072 */
1073message KernelWakeupReported {
1074 // Name of the kernel wakeup reason (or abort).
1075 optional string wakeup_reason_name = 1;
1076
1077 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001078 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001079}
1080
1081/**
Bookatzda1798c2018-12-13 14:16:00 -08001082 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001083 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001084 *
1085 * Logged from:
1086 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1087 */
1088message WifiEnabledStateChanged {
1089 enum State {
1090 OFF = 0;
1091 ON = 1;
1092 }
1093 optional State state = 1;
1094}
1095
1096/**
1097 * 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 -08001098 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1099 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001100 *
1101 * Logged from:
1102 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1103 */
1104message WifiRunningStateChanged {
1105 repeated AttributionNode attribution_node = 1;
1106
1107 enum State {
1108 OFF = 0;
1109 ON = 1;
1110 }
1111 optional State state = 2;
1112}
1113
1114/**
Bookatze5885242017-10-24 20:10:31 -07001115 * Logs wifi locks held by an app.
1116 *
1117 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001118 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001119 */
1120message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001121 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001122
1123 enum State {
1124 OFF = 0;
1125 ON = 1;
1126 }
1127 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001128
1129 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1130 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001131}
1132
1133/**
1134 * Logs wifi signal strength changes.
1135 *
1136 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001137 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001138 */
1139message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001140 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1141 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001142}
1143
1144/**
1145 * Logs wifi scans performed by an app.
1146 *
1147 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001148 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001149 */
1150message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001151 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001152
1153 enum State {
1154 OFF = 0;
1155 ON = 1;
1156 }
1157 optional State state = 2;
1158}
1159
1160/**
Tej Singh4503e102018-01-04 14:35:01 -08001161 * Logs wifi multicast locks held by an app
1162 *
1163 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001164 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001165 */
1166message WifiMulticastLockStateChanged {
1167 repeated AttributionNode attribution_node = 1;
1168
1169 enum State {
1170 OFF = 0;
1171 ON = 1;
1172 }
1173 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001174
1175 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001176}
1177
1178/**
Tej Singh1ea42892018-01-19 09:27:00 -08001179 * Logs shutdown reason and duration on next boot.
1180 *
1181 * Logged from:
1182 * frameworks/base/core/java/com/android/server/BootReceiver.java
1183 */
1184message ShutdownSequenceReported {
1185 // True if shutdown is for a reboot. Default: false if we do not know.
1186 optional bool reboot = 1;
1187
1188 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1189 optional string reason = 2;
1190
1191 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1192 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001193 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001194
1195 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001196 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001197}
1198
Tej Singh6483ea42018-01-25 17:45:49 -08001199
1200/**
1201 * Logs boot reason and duration.
1202 *
1203 * Logged from:
1204 * system/core/bootstat/bootstat.cpp
1205 */
1206message BootSequenceReported {
1207 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1208 // Default: "<EMPTY>" if not available.
1209 optional string bootloader_reason = 1;
1210
1211 // Reason for system boot. Eg. bootloader, reboot,userrequested
1212 // Default: "<EMPTY>" if not available.
1213 optional string system_reason = 2;
1214
1215 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001216 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001217
1218 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001219 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001220
1221 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001222 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001223
1224 // Time since last boot in ms. Default: 0 if not available.
1225 optional int64 time_since_last_boot = 6;
1226}
1227
Tej Singhc477d9c2018-02-05 18:31:39 -08001228
1229/**
1230 * Logs call state and disconnect cause (if applicable).
1231 *
1232 * Logged from:
1233 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1234 */
1235message CallStateChanged {
1236 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1237 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1238 optional android.telecom.CallStateEnum call_state = 1;
1239
1240 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1241 // This value is only applicable when the call_state is DISCONNECTED, and
1242 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1243 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1244 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1245
1246 // True if the call is self-managed, which are apps that use the
1247 // telecom infrastructure to make their own calls.
1248 optional bool self_managed = 3;
1249
1250 // True if call is external. External calls are calls on connected Wear
1251 // devices but show up in Telecom so the user can pull them onto the device.
1252 optional bool external_call = 4;
1253}
1254
Tej Singh1ea42892018-01-19 09:27:00 -08001255/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001256 * Logs keyguard state. The keyguard is the lock screen.
1257 *
1258 * Logged from:
1259 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1260 */
1261message KeyguardStateChanged {
1262 enum State {
1263 UNKNOWN = 0;
1264 // The keyguard is hidden when the phone is unlocked.
1265 HIDDEN = 1;
1266 // The keyguard is shown when the phone is locked (screen turns off).
1267 SHOWN= 2;
1268 // The keyguard is occluded when something is overlaying the keyguard.
1269 // Eg. Opening the camera while on the lock screen.
1270 OCCLUDED = 3;
1271 }
1272 optional State state = 1;
1273}
1274
1275/**
1276 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1277 * prompts the user to enter a password (pattern, pin, etc).
1278 *
1279 * Logged from:
1280 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1281 */
1282
1283message KeyguardBouncerStateChanged {
1284 enum State {
1285 UNKNOWN = 0;
1286 // Bouncer is hidden, either as a result of successfully entering the
1287 // password, screen timing out, or user going back to lock screen.
1288 HIDDEN = 1;
1289 // This is when the user is being prompted to enter the password.
1290 SHOWN = 2;
1291 }
1292 optional State state = 1;
1293}
1294
1295/**
1296 * Logs the result of entering a password into the keyguard bouncer.
1297 *
1298 * Logged from:
1299 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1300 */
1301message KeyguardBouncerPasswordEntered {
1302 enum BouncerResult {
1303 UNKNOWN = 0;
1304 // The password entered was incorrect.
1305 FAILURE = 1;
1306 // The password entered was correct.
1307 SUCCESS = 2;
1308 }
1309 optional BouncerResult result = 1;
1310}
1311
Tej Singha883b372018-02-15 11:30:01 -08001312/*
1313 * Logs changes to the configuration of the device. The configuration is defined
1314 * in frameworks/base/core/java/android/content/res/Configuration.java
1315 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1316 * Please go there to interpret the possible values each field can be.
1317 *
1318 * Logged from:
1319 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1320 */
1321message ResourceConfigurationChanged {
1322 // Bit mask of color capabilities of the screen.
1323 // Contains information about the color gamut and hdr mode of the screen.
1324 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001325 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001326
1327 // The target screen density being rendered to.
1328 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001329 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001330
1331 // Current user preference for the scaling factor for fonts,
1332 // relative to the base density scaling.
1333 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001334 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001335
1336 // Flag indicating whether the hard keyboard is hidden.
1337 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001338 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001339
1340 // The type of keyboard attached to the device.
1341 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1342 optional int32 keyboard = 5;
1343
1344 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1345 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001346 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001347
1348 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1349 // 0 if undefined.
1350 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1351 optional int32 mcc = 7;
1352
1353 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1354 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1355 // MNC_ZERO symbol defined in Configuration.java.
1356 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1357 optional int32 mnc = 8;
1358
1359 // The kind of navigation available on the device.
1360 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1361 optional int32 navigation = 9;
1362
1363 // Flag indicating whether the navigation is available.
1364 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001365 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001366
1367 // Overall orientation of the screen.
1368 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1369 optional int32 orientation = 11;
1370
1371 // The current height of the available screen space, in dp units.
1372 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001373 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001374
1375 // Bit mask of overall layout of the screen.
1376 // Contains information about screen size, whether the screen is wider/taller
1377 // than normal, whether the screen layout is right-tl-left or left-to-right,
1378 // and whether the screen has a rounded shape.
1379 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001380 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001381
1382 // Current width of the available screen space, in dp units.
1383 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001384 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001385
1386 // The smallest screen size an application will see in normal operation.
1387 // This is the smallest value of both screenWidthDp and screenHeightDp
1388 // in portrait and landscape.
1389 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001390 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001391
1392 // The type of touch screen attached to the device.
1393 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1394 optional int32 touchscreen = 16;
1395
1396 // Bit mask of the ui mode.
1397 // Contains information about the overall ui mode of the device.
1398 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1399 // Also contains information about whether the device is in night mode.
1400 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001401 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001402}
1403
Tej Singheee317b2018-03-07 19:28:05 -08001404
1405/**
1406 * Logs changes in the connection state of the mobile radio.
1407 *
1408 * Logged from:
1409 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1410 */
1411message MobileConnectionStateChanged {
1412 // States are from the state machine DataConnection.java.
1413 enum State {
1414 UNKNOWN = 0;
1415 // The connection is inactive, or disconnected.
1416 INACTIVE = 1;
1417 // The connection is being activated, or connecting.
1418 ACTIVATING = 2;
1419 // The connection is active, or connected.
1420 ACTIVE = 3;
1421 // The connection is disconnecting.
1422 DISCONNECTING = 4;
1423 // The connection is disconnecting after creating a connection.
1424 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1425 }
1426 optional State state = 1;
1427 // For multi-sim phones, this distinguishes between the sim cards.
1428 optional int32 sim_slot_index = 2;
1429 // Used to identify the connection. Starts at 0 and increments by 1 for
1430 // every new network created. Resets whenever the device reboots.
1431 optional int32 data_connection_id = 3;
1432 // A bitmask for the capabilities of this connection.
1433 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1434 // Default value (if we have no information): 0
1435 optional int64 capabilities = 4;
1436 // If this connection has internet.
1437 // This just checks if the DEFAULT bit of capabilities is set.
1438 optional bool has_internet = 5;
1439}
1440
1441/**
1442 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1443 *
1444 * Logged from:
1445 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1446 */
1447message MobileRadioTechnologyChanged {
1448 optional android.telephony.NetworkTypeEnum state = 1;
1449 // For multi-sim phones, this distinguishes between the sim cards.
1450 optional int32 sim_slot_index = 2;
1451}
1452
Andrew Chantb56388b2018-03-22 21:07:33 -07001453/**
1454 * Logs the VID and PID of any connected USB devices.
1455 *
1456 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1457 *
1458 * Logged by Vendor.
1459 */
1460message UsbDeviceAttached {
1461 optional int32 vid = 1;
1462 optional int32 pid = 2;
1463 optional bool has_audio = 3;
1464 optional bool has_hid = 4;
1465 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001466 enum State {
1467 STATE_DISCONNECTED = 0;
1468 STATE_CONNECTED = 1;
1469 }
1470 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001471 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001472}
1473
Tej Singheee317b2018-03-07 19:28:05 -08001474
Tej Singhdd7bd352018-02-09 19:33:15 -08001475/**
Tej Singh5d991e12018-03-09 19:48:11 -08001476 * Logs when Bluetooth is enabled and disabled.
1477 *
1478 * Logged from:
1479 * services/core/java/com/android/server/BluetoothManagerService.java
1480 */
1481message BluetoothEnabledStateChanged {
1482 repeated AttributionNode attribution_node = 1;
1483 // Whether or not bluetooth is enabled on the device.
1484 enum State {
1485 UNKNOWN = 0;
1486 ENABLED = 1;
1487 DISABLED = 2;
1488 }
1489 optional State state = 2;
1490 // The reason for being enabled/disabled.
1491 // Eg. Airplane mode, crash, application request.
1492 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1493 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001494 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001495}
1496
1497/**
Jack Hed9837c82019-01-09 01:19:13 -08001498 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001499 *
1500 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001501 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1502 *
1503 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001504 */
1505message BluetoothConnectionStateChanged {
1506 // The state of the connection.
1507 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1508 optional android.bluetooth.ConnectionStateEnum state = 1;
1509 // An identifier that can be used to match connect and disconnect events.
1510 // Currently is last two bytes of a hash of a device level ID and
1511 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001512 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001513 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001514 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1515 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001516 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001517 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001518 // An identifier that can be used to match events for this device.
1519 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1520 // Salt: Randomly generated 256 bit value
1521 // Hash algorithm: HMAC-SHA256
1522 // Size: 32 byte
1523 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001524 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001525}
1526
1527/**
1528 * Logs when a Bluetooth device connects and disconnects over ACL
1529 *
1530 * Logged from:
1531 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1532 *
1533 * Next Tag: 3
1534 */
1535message BluetoothAclConnectionStateChanged {
1536 // An identifier that can be used to match events for this device.
1537 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1538 // Salt: Randomly generated 256 bit value
1539 // Hash algorithm: HMAC-SHA256
1540 // Size: 32 byte
1541 // Default: null or empty if the device identifier is not known
1542 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1543 // The state of the connection.
1544 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1545 optional android.bluetooth.ConnectionStateEnum state = 2;
1546}
1547
1548/**
1549 * Logs when a Bluetooth device connects and disconnects over SCO
1550 *
1551 * Logged from:
1552 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1553 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1554 *
1555 * Next Tag: 4
1556 */
1557message BluetoothScoConnectionStateChanged {
1558 // An identifier that can be used to match events for this device.
1559 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1560 // Salt: Randomly generated 256 bit value
1561 // Hash algorithm: HMAC-SHA256
1562 // Size: 32 byte
1563 // Default: null or empty if the device identifier is not known
1564 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1565 // The state of the connection.
1566 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1567 optional android.bluetooth.ConnectionStateEnum state = 2;
1568 // Codec used for this SCO connection
1569 // Default: UNKNOWN
1570 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001571}
1572
Jack Hec27040a2019-01-09 20:54:41 -08001573/**
1574 * Logged when active device of a profile changes
1575 *
1576 * Logged from:
1577 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1578 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1579 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1580 */
1581message BluetoothActiveDeviceChanged {
1582 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1583 // From android.bluetooth.BluetoothProfile
1584 optional int32 bt_profile = 1;
1585 // An identifier that can be used to match events for this new active device.
1586 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1587 // Salt: Randomly generated 256 bit value
1588 // Hash algorithm: HMAC-SHA256
1589 // Size: 32 byte
1590 // Default: null or empty if there is no active device for this profile
1591 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1592}
1593
Jack Heab86dbd22018-12-18 15:43:27 -08001594// Logs when there is an event affecting Bluetooth device's link layer connection.
1595// - This event is triggered when there is a related HCI command or event
1596// - Users of this metrics can deduce Bluetooth device's connection state from these events
1597// - HCI commands are logged before the command is sent, after receiving command status, and after
1598// receiving command complete
1599// - HCI events are logged when they arrive
1600//
1601// Low level log from system/bt
1602//
1603// Bluetooth classic commands:
1604// - CMD_CREATE_CONNECTION
1605// - CMD_DISCONNECT
1606// - CMD_CREATE_CONNECTION_CANCEL
1607// - CMD_ACCEPT_CONNECTION_REQUEST
1608// - CMD_REJECT_CONNECTION_REQUEST
1609// - CMD_SETUP_ESCO_CONNECTION
1610// - CMD_ACCEPT_ESCO_CONNECTION
1611// - CMD_REJECT_ESCO_CONNECTION
1612// - CMD_ENH_SETUP_ESCO_CONNECTION
1613// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1614//
1615// Bluetooth low energy commands:
1616// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1617// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1618// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1619// - CMD_BLE_CLEAR_WHITE_LIST
1620// - CMD_BLE_ADD_WHITE_LIST
1621// - CMD_BLE_REMOVE_WHITE_LIST
1622//
1623// Bluetooth classic events:
1624// - EVT_CONNECTION_COMP
1625// - EVT_CONNECTION_REQUEST
1626// - EVT_DISCONNECTION_COMP
1627// - EVT_ESCO_CONNECTION_COMP
1628// - EVT_ESCO_CONNECTION_CHANGED
1629//
1630// Bluetooth low energy meta events:
1631// - BLE_EVT_CONN_COMPLETE_EVT
1632// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1633//
1634// Next tag: 10
1635message BluetoothLinkLayerConnectionEvent {
1636 // An identifier that can be used to match events for this device.
1637 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1638 // Salt: Randomly generated 256 bit value
1639 // Hash algorithm: HMAC-SHA256
1640 // Size: 32 byte
1641 // Default: null or empty if the device identifier is not known
1642 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1643 // Connection handle of this connection if available
1644 // Range: 0x0000 - 0x0EFF (12 bits)
1645 // Default: 0xFFFF if the handle is unknown
1646 optional int32 connection_handle = 2;
1647 // Direction of the link
1648 // Default: DIRECTION_UNKNOWN
1649 optional android.bluetooth.DirectionEnum direction = 3;
1650 // Type of this link
1651 // Default: LINK_TYPE_UNKNOWN
1652 optional android.bluetooth.LinkTypeEnum type = 4;
1653
1654 // Reason metadata for this link layer connection event, rules for interpretation:
1655 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1656 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1657 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1658 // set and valid, ignore hci_ble_event
1659
1660 // HCI command associated with this event
1661 // Default: CMD_UNKNOWN
1662 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1663 // HCI event associated with this event
1664 // Default: EVT_UNKNOWN
1665 optional android.bluetooth.hci.EventEnum hci_event = 6;
1666 // HCI BLE meta event associated with this event
1667 // Default: BLE_EVT_UNKNOWN
1668 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1669 // HCI command status code if this is triggerred by hci_cmd
1670 // Default: STATUS_UNKNOWN
1671 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1672 // HCI reason code associated with this event
1673 // Default: STATUS_UNKNOWN
1674 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1675}
1676
Howard Roe103fe22019-01-17 16:52:16 -08001677/**
1678 * Logs when a module is rolled back by Watchdog.
1679 *
1680 * Logged from: Rollback Manager
1681 */
1682message WatchdogRollbackOccurred {
1683 enum RollbackType {
1684 UNKNOWN = 0;
1685 ROLLBACK_INITIATE = 1;
1686 ROLLBACK_SUCCESS = 2;
1687 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001688 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001689 }
1690 optional RollbackType rollback_type = 1;
1691
1692 optional string package_name = 2;
1693
1694 optional int32 package_version_code = 3;
1695}
1696
Jack Hec27040a2019-01-09 20:54:41 -08001697/**
1698 * Logs when there is a change in Bluetooth A2DP playback state
1699 *
1700 * Logged from:
1701 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1702 */
1703message BluetoothA2dpPlaybackStateChanged {
1704 // An identifier that can be used to match events for this device.
1705 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1706 // Salt: Randomly generated 256 bit value
1707 // Hash algorithm: HMAC-SHA256
1708 // Size: 32 byte
1709 // Default: null or empty if the device identifier is not known
1710 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1711 // Current playback state
1712 // Default: PLAYBACK_STATE_UNKNOWN
1713 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1714 // Current audio coding mode
1715 // Default: AUDIO_CODING_MODE_UNKNOWN
1716 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1717}
1718
1719/**
1720 * Logs when there is a change in A2DP codec config for a particular remote device
1721 *
1722 * Logged from:
1723 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1724 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1725 */
1726message BluetoothA2dpCodecConfigChanged {
1727 // An identifier that can be used to match events for this device.
1728 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1729 // Salt: Randomly generated 256 bit value
1730 // Hash algorithm: HMAC-SHA256
1731 // Size: 32 byte
1732 // Default: null or empty if the device identifier is not known
1733 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1734 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1735 // Default SOURCE_CODEC_TYPE_INVALID
1736 optional int32 codec_type = 2;
1737 // Codec priroity, the higher the more preferred, -1 for disabled
1738 // Default: CODEC_PRIORITY_DEFAULT
1739 optional int32 codec_priority = 3;
1740 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1741 // Default: SAMPLE_RATE_NONE
1742 optional int32 sample_rate = 4;
1743 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1744 // Default: BITS_PER_SAMPLE_NONE
1745 optional int32 bits_per_sample = 5;
1746 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1747 // Default: CHANNEL_MODE_NONE
1748 optional int32 channel_mode = 6;
1749 // Codec specific values
1750 // Default 0
1751 optional int64 codec_specific_1 = 7;
1752 optional int64 codec_specific_2 = 8;
1753 optional int64 codec_specific_3 = 9;
1754 optional int64 codec_specific_4 = 10;
1755}
1756
1757/**
1758 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1759 * Each codec's capability is logged separately due to statsd restriction
1760 *
1761 * Logged from:
1762 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1763 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1764 */
1765message BluetoothA2dpCodecCapabilityChanged {
1766 // An identifier that can be used to match events for this device.
1767 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1768 // Salt: Randomly generated 256 bit value
1769 // Hash algorithm: HMAC-SHA256
1770 // Size: 32 byte
1771 // Default: null or empty if the device identifier is not known
1772 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1773 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1774 // Default SOURCE_CODEC_TYPE_INVALID
1775 optional int32 codec_type = 2;
1776 // Codec priroity, the higher the more preferred, -1 for disabled
1777 // Default: CODEC_PRIORITY_DEFAULT
1778 optional int32 codec_priority = 3;
1779 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1780 // in BluetoothCodecConfig
1781 // Default: empty and SAMPLE_RATE_NONE for individual item
1782 optional int32 sample_rate = 4;
1783 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1784 // in BluetoothCodecConfig
1785 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1786 optional int32 bits_per_sample = 5;
1787 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1788 // BluetoothCodecConfig
1789 // Default: empty and CHANNEL_MODE_NONE for individual item
1790 optional int32 channel_mode = 6;
1791 // Codec specific values
1792 // Default 0
1793 optional int64 codec_specific_1 = 7;
1794 optional int64 codec_specific_2 = 8;
1795 optional int64 codec_specific_3 = 9;
1796 optional int64 codec_specific_4 = 10;
1797}
1798
1799/**
1800 * Logs when A2DP failed to read from PCM source.
1801 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1802 *
1803 * Logged from:
1804 * system/bt
1805 */
1806message BluetoothA2dpAudioUnderrunReported {
1807 // An identifier that can be used to match events for this device.
1808 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1809 // Salt: Randomly generated 256 bit value
1810 // Hash algorithm: HMAC-SHA256
1811 // Size: 32 byte
1812 // Default: null or empty if the device identifier is not known
1813 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1814 // Encoding interval in nanoseconds
1815 // Default: 0
1816 optional int64 encoding_interval_nanos = 2;
1817 // Number of bytes of PCM data that could not be read from the source
1818 // Default: 0
1819 optional int32 num_missing_pcm_bytes = 3;
1820}
1821
1822/**
1823 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1824 * buffer queue is full and we have to drop data
1825 *
1826 * Logged from:
1827 * system/bt
1828 */
1829message BluetoothA2dpAudioOverrunReported {
1830 // An identifier that can be used to match events for this device.
1831 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1832 // Salt: Randomly generated 256 bit value
1833 // Hash algorithm: HMAC-SHA256
1834 // Size: 32 byte
1835 // Default: null or empty if the device identifier is not known
1836 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1837 // Encoding interval in nanoseconds
1838 // Default: 0
1839 optional int64 encoding_interval_nanos = 2;
1840 // Number of buffers dropped in this event
1841 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1842 // Default: 0
1843 optional int32 num_dropped_buffers = 3;
1844 // Number of encoded buffers dropped in this event
1845 // Default 0
1846 optional int32 num_dropped_encoded_frames = 4;
1847 // Number of encoded bytes dropped in this event
1848 // Default: 0
1849 optional int32 num_dropped_encoded_bytes = 5;
1850}
1851
1852/**
1853 * Logs when we receive reports regarding a device's RSSI value
1854 *
1855 * Logged from:
1856 * system/bt
1857 */
1858message BluetoothDeviceRssiReported {
1859 // An identifier that can be used to match events for this device.
1860 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1861 // Salt: Randomly generated 256 bit value
1862 // Hash algorithm: HMAC-SHA256
1863 // Size: 32 byte
1864 // Default: null or empty if the device identifier is not known
1865 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1866 // Connection handle of this connection if available
1867 // Range: 0x0000 - 0x0EFF (12 bits)
1868 // Default: 0xFFFF if the handle is unknown
1869 optional int32 connection_handle = 2;
1870 // HCI command status code if this is triggerred by hci_cmd
1871 // Default: STATUS_UNKNOWN
1872 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1873 // BR/EDR
1874 // Range: -128 ≤ N ≤ 127 (signed integer)
1875 // Units: dB
1876 // LE:
1877 // Range: -127 to 20, 127 (signed integer)
1878 // Units: dBm
1879 // Invalid when an out of range value is reported
1880 optional int32 rssi = 4;
1881}
1882
1883/**
1884 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1885 *
1886 * Logged from:
1887 * system/bt
1888 */
1889message BluetoothDeviceFailedContactCounterReported {
1890 // An identifier that can be used to match events for this device.
1891 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1892 // Salt: Randomly generated 256 bit value
1893 // Hash algorithm: HMAC-SHA256
1894 // Size: 32 byte
1895 // Default: null or empty if the device identifier is not known
1896 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1897 // Connection handle of this connection if available
1898 // Range: 0x0000 - 0x0EFF (12 bits)
1899 // Default: 0xFFFF if the handle is unknown
1900 optional int32 connection_handle = 2;
1901 // HCI command status code if this is triggerred by hci_cmd
1902 // Default: STATUS_UNKNOWN
1903 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1904 // Number of consecutive failed contacts for a connection corresponding to the Handle
1905 // Range: uint16_t, 0-0xFFFF
1906 // Default: 0xFFFFF
1907 optional int32 failed_contact_counter = 4;
1908}
1909
1910/**
1911 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1912 *
1913 * Logged from:
1914 * system/bt
1915 */
1916message BluetoothDeviceTxPowerLevelReported {
1917 // An identifier that can be used to match events for this device.
1918 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1919 // Salt: Randomly generated 256 bit value
1920 // Hash algorithm: HMAC-SHA256
1921 // Size: 32 byte
1922 // Default: null or empty if the device identifier is not known
1923 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1924 // Connection handle of this connection if available
1925 // Range: 0x0000 - 0x0EFF (12 bits)
1926 // Default: 0xFFFF if the handle is unknown
1927 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001928 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001929 // Default: STATUS_UNKNOWN
1930 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1931 // Range: -30 ≤ N ≤ 20
1932 // Units: dBm
1933 // Invalid when an out of range value is reported
1934 optional int32 transmit_power_level = 4;
1935}
Jack Heab86dbd22018-12-18 15:43:27 -08001936
Tej Singh5d991e12018-03-09 19:48:11 -08001937/**
Jack He1021a612019-01-20 21:22:46 -08001938 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1939 * receiving an HCI command from the host
1940 *
1941 * Logged from: system/bt
1942 */
1943message BluetoothHciTimeoutReported {
1944 // HCI command associated with this event
1945 // Default: CMD_UNKNOWN
1946 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1947}
1948
1949/**
1950 * Logs when we receive Bluetooth Link Quality Report event from the controller
1951 * See Android Bluetooth HCI specification for more details
1952 *
1953 * Note: all count and bytes field are counted since last event
1954 *
1955 * Logged from: system/bt
1956 */
1957message BluetoothQualityReportReported {
1958 // Quality report ID
1959 // Original type: uint8_t
1960 // Default: BQR_ID_UNKNOWN
1961 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1962 // Packet type of the connection
1963 // Original type: uint8_t
1964 // Default: BQR_PACKET_TYPE_UNKNOWN
1965 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1966 // Connection handle of the connection
1967 // Original type: uint16_t
1968 optional int32 connection_handle = 3;
1969 // Performing Role for the connection
1970 // Original type: uint8_t
1971 optional int32 connection_role = 4;
1972 // Current Transmit Power Level for the connection. This value is the same as the controller's
1973 // response to the HCI_Read_Transmit_Power_Level HCI command
1974 // Original type: uint8_t
1975 optional int32 tx_power_level = 5;
1976 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1977 // absolute receiver signal strength value
1978 // Original type: int8_t
1979 optional int32 rssi = 6;
1980 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1981 // channels used by the link currently
1982 // Original type: uint8_t
1983 optional int32 snr = 7;
1984 // Indicates the number of unused channels in AFH_channel_map
1985 // Original type: uint8_t
1986 optional int32 unused_afh_channel_count = 8;
1987 // Indicates the number of the channels which are interfered and quality is bad but are still
1988 // selected for AFH
1989 // Original type: uint8_t
1990 optional int32 afh_select_unideal_channel_count = 9;
1991 // Current Link Supervision Timeout Setting
1992 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1993 // Original type: uint16_t
1994 optional int32 lsto = 10;
1995 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1996 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1997 // 0x01 (Piconet Clock)
1998 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1999 // Original type: uint32_t
2000 optional int64 connection_piconet_clock = 11;
2001 // The count of retransmission
2002 // Original type: uint32_t
2003 optional int64 retransmission_count = 12;
2004 // The count of no RX
2005 // Original type: uint32_t
2006 optional int64 no_rx_count = 13;
2007 // The count of NAK (Negative Acknowledge)
2008 // Original type: uint32_t
2009 optional int64 nak_count = 14;
2010 // Controller timestamp of last TX ACK
2011 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2012 // Original type: uint32_t
2013 optional int64 last_tx_ack_timestamp = 15;
2014 // The count of Flow-off (STOP)
2015 // Original type: uint32_t
2016 optional int64 flow_off_count = 16;
2017 // Controller timestamp of last Flow-on (GO)
2018 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2019 // Original type: uint32_t
2020 optional int64 last_flow_on_timestamp = 17;
2021 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2022 // Original type: uint32_t
2023 optional int64 buffer_overflow_bytes = 18;
2024 // Buffer underflow count (in byte) since last event
2025 // Original type: uint32_t
2026 optional int64 buffer_underflow_bytes = 19;
2027}
2028
2029/**
2030 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2031 *
2032 * Notes:
2033 * - Each event can be partially filled as we might learn different pieces of device
2034 * information at different time
2035 * - Multiple device info events can be combined to give more complete picture
2036 * - When multiple device info events tries to describe the same information, the
2037 * later one wins
2038 *
2039 * Logged from:
2040 * packages/apps/Bluetooth
2041 */
Jack Heaea26982019-04-04 11:19:48 -07002042message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002043 // An identifier that can be used to match events for this device.
2044 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2045 // Salt: Randomly generated 256 bit value
2046 // Hash algorithm: HMAC-SHA256
2047 // Size: 32 byte
2048 // Default: null or empty if the device identifier is not known
2049 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2050 // Where is this device info obtained from
2051 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2052 // Name of the data source
2053 // For EXTERNAL: package name of the data source
2054 // For INTERNAL: null for general case, component name otherwise
2055 optional string source_name = 3;
2056 // Name of the manufacturer of this device
2057 optional string manufacturer = 4;
2058 // Model of this device
2059 optional string model = 5;
2060 // Hardware version of this device
2061 optional string hardware_version = 6;
2062 // Software version of this device
2063 optional string software_version = 7;
2064}
2065
2066/**
2067 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2068 * device, as documented by the Bluetooth Core HCI specification
2069 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2070 * Vol 2, Part E, Page 1118
2071 *
2072 * Logged from:
2073 * system/bt
2074 */
2075message BluetoothRemoteVersionInfoReported {
2076 // Connection handle of the connection
2077 // Original type: uint16_t
2078 optional int32 connection_handle = 1;
2079 // HCI command status code
2080 // Default: STATUS_UNKNOWN
2081 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2082 // 1 byte Version of current LMP in the remote controller
2083 optional int32 lmp_version = 3;
2084 // 2 bytes LMP manufacturer code of the remote controller
2085 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2086 optional int32 lmp_manufacturer_code = 4;
2087 // 4 bytes subversion of the LMP in the remote controller
2088 optional int32 lmp_subversion = 5;
2089}
2090
2091/**
2092 * Logs when certain Bluetooth SDP attributes are discovered
2093 * Constant definitions are from:
2094 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2095 *
2096 * Current logged attributes:
2097 * - BluetoothProfileDescriptorList
2098 * - Supported Features Bitmask
2099 *
2100 * Logged from:
2101 * system/bt
2102 */
2103message BluetoothSdpAttributeReported {
2104 // An identifier that can be used to match events for this device.
2105 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2106 // Salt: Randomly generated 256 bit value
2107 // Hash algorithm: HMAC-SHA256
2108 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2109 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2110 // Original type: uint16_t
2111 optional int32 protocol_uuid = 2;
2112 // Short form UUIDs used to identify Bluetooth SDP attribute types
2113 // Original type: uint16_t
2114 optional int32 attribute_id = 3;
2115 // Attribute value for the particular attribute
2116 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2117}
2118
2119/**
2120 * Logs when bond state of a Bluetooth device changes
2121 *
2122 * Logged from:
2123 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2124 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2125 */
2126message BluetoothBondStateChanged {
2127 // An identifier that can be used to match events for this device.
2128 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2129 // Salt: Randomly generated 256 bit value
2130 // Hash algorithm: HMAC-SHA256
2131 // Size: 32 byte
2132 // Default: null or empty if the device identifier is not known
2133 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2134 // Preferred transport type to remote dual mode device
2135 // Default: TRANSPORT_AUTO means no preference
2136 optional android.bluetooth.TransportTypeEnum transport = 2;
2137 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2138 // Default: UNKNOWN
2139 optional android.bluetooth.DeviceTypeEnum type = 3;
2140 // Current bond state (NONE, BONDING, BONDED)
2141 // Default: BOND_STATE_UNKNOWN
2142 optional android.bluetooth.BondStateEnum bond_state = 4;
2143 // Bonding sub state
2144 // Default: BOND_SUB_STATE_UNKNOWN
2145 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2146 // Unbond Reason
2147 // Default: UNBOND_REASON_UNKNOWN
2148 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2149}
2150
2151/**
2152 * Logs there is an event related Bluetooth classic pairing
2153 *
2154 * Logged from:
2155 * system/bt
2156 */
2157message BluetoothClassicPairingEventReported {
2158 // An identifier that can be used to match events for this device.
2159 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2160 // Salt: Randomly generated 256 bit value
2161 // Hash algorithm: HMAC-SHA256
2162 // Size: 32 byte
2163 // Default: null or empty if the device identifier is not known
2164 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2165 // Connection handle of this connection if available
2166 // Range: 0x0000 - 0x0EFF (12 bits)
2167 // Default: 0xFFFF if the handle is unknown
2168 optional int32 connection_handle = 2;
2169 // HCI command associated with this event
2170 // Default: CMD_UNKNOWN
2171 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2172 // HCI event associated with this event
2173 // Default: EVT_UNKNOWN
2174 optional android.bluetooth.hci.EventEnum hci_event = 4;
2175 // HCI command status code if this is triggerred by hci_cmd
2176 // Default: STATUS_UNKNOWN
2177 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2178 // HCI reason code associated with this event
2179 // Default: STATUS_UNKNOWN
2180 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002181 // A status value related to this specific event
2182 // Default: 0
2183 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002184}
2185
2186/**
2187 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2188 *
2189 * Logged from:
2190 * system/bt
2191 */
2192message BluetoothSmpPairingEventReported {
2193 // An identifier that can be used to match events for this device.
2194 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2195 // Salt: Randomly generated 256 bit value
2196 // Hash algorithm: HMAC-SHA256
2197 // Size: 32 byte
2198 // Default: null or empty if the device identifier is not known
2199 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2200 // SMP command sent or received over L2CAP
2201 // Default: CMD_UNKNOWN
2202 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2203 // Whether this command is sent or received
2204 // Default: DIRECTION_UNKNOWN
2205 optional android.bluetooth.DirectionEnum direction = 3;
2206 // SMP failure reason code
2207 // Default: PAIRING_FAIL_REASON_DEFAULT
2208 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2209}
2210
2211/**
Jack He815cdba2019-01-30 17:24:55 -08002212 * Logs when a Bluetooth socket’s connection state changed
2213 *
2214 * Logged from:
2215 * system/bt
2216 */
2217message BluetoothSocketConnectionStateChanged {
2218 // An identifier that can be used to match events for this device.
2219 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2220 // Salt: Randomly generated 256 bit value
2221 // Hash algorithm: HMAC-SHA256
2222 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002223 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002224 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002225 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002226 // Default 0 when unknown or don't care
2227 optional int32 port = 2;
2228 // Socket type as mentioned in
2229 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2230 // Default: SOCKET_TYPE_UNKNOWN
2231 optional android.bluetooth.SocketTypeEnum type = 3;
2232 // Socket connection state
2233 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2234 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2235 // Number of bytes sent to remote device during this connection
2236 optional int64 tx_bytes = 5;
2237 // Number of bytes received from remote device during this connection
2238 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002239 // Socket owner's UID
2240 optional int32 uid = 7 [(is_uid) = true];
2241 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2242 // |port| must be spawned by |server_port|
2243 // Default 0 when unknown or don't care
2244 optional int32 server_port = 8;
2245 // Whether this is a server listener socket
2246 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002247}
2248
2249/**
Jack He71426802019-04-02 13:32:52 -07002250 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2251 *
2252 * Logged from:
2253 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2254 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2255 *
2256 */
2257message BluetoothClassOfDeviceReported {
2258 // An identifier that can be used to match events for this device.
2259 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2260 // Salt: Randomly generated 256 bit value
2261 // Hash algorithm: HMAC-SHA256
2262 // Size: 32 byte
2263 // Default: null or empty if this is a server listener socket
2264 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2265 // Class of Device (CoD) value including both Major, Minor device class and service class
2266 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2267 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2268 // Default: 0
2269 optional int32 class_of_device = 2;
2270}
2271
2272/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002273 * Logs when something is plugged into or removed from the USB-C connector.
2274 *
2275 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002276 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002277 */
2278message UsbConnectorStateChanged {
2279 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002280 STATE_DISCONNECTED = 0;
2281 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002282 }
2283 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002284 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002285 // Last active session in ms.
2286 // 0 when the port is in connected state.
2287 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002288}
2289
2290/**
2291 * Logs the reported speaker impedance.
2292 *
2293 * Logged from:
2294 * Vendor audio implementation.
2295 */
2296message SpeakerImpedanceReported {
2297 optional int32 speaker_location = 1;
2298 optional int32 impedance = 2;
2299}
2300
2301/**
2302 * Logs the report of a failed hardware.
2303 *
2304 * Logged from:
2305 * Vendor HALs.
2306 *
2307 */
2308message HardwareFailed {
2309 enum HardwareType {
2310 HARDWARE_FAILED_UNKNOWN = 0;
2311 HARDWARE_FAILED_MICROPHONE = 1;
2312 HARDWARE_FAILED_CODEC = 2;
2313 HARDWARE_FAILED_SPEAKER = 3;
2314 HARDWARE_FAILED_FINGERPRINT = 4;
2315 }
2316 optional HardwareType hardware_type = 1;
2317
Maggie White6dcd8572019-01-31 14:11:50 -08002318 /**
2319 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002320 * the same hardware_type. The specific locations are vendor defined integers,
2321 * referring to board-specific numbering schemes.
2322 */
2323 optional int32 hardware_location = 2;
2324
Maggie White6dcd8572019-01-31 14:11:50 -08002325 /**
2326 * failure_code is specific to the HardwareType of the failed hardware.
2327 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002328 */
Maggie White6dcd8572019-01-31 14:11:50 -08002329 enum HardwareErrorCode {
2330 UNKNOWN = 0;
2331 COMPLETE = 1;
2332 SPEAKER_HIGH_Z = 2;
2333 SPEAKER_SHORT = 3;
2334 FINGERPRINT_SENSOR_BROKEN = 4;
2335 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002336 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002337 }
2338 optional int32 failure_code = 3;
2339}
2340
2341/**
2342 * Log an event when the device has been physically dropped.
2343 * Reported from the /vendor partition.
2344 */
2345message PhysicalDropDetected {
2346 // Confidence that the event was actually a drop, 0 -> 100
2347 optional int32 confidence_pctg = 1;
2348 // Peak acceleration of the drop, in 1/1000s of a g.
2349 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002350 // Duration of freefall in ms
2351 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002352}
2353
2354/**
2355 * Log bucketed battery charge cycles.
2356 *
2357 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002358 * a given charge point. For example, if 10 cycle buckets are
2359 * initialized, bucket 1 is the lowest 1/10th of the battery,
2360 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002361 *
2362 * Logged from:
2363 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2364 */
2365message ChargeCyclesReported {
2366 optional int32 cycle_bucket_1 = 1;
2367 optional int32 cycle_bucket_2 = 2;
2368 optional int32 cycle_bucket_3 = 3;
2369 optional int32 cycle_bucket_4 = 4;
2370 optional int32 cycle_bucket_5 = 5;
2371 optional int32 cycle_bucket_6 = 6;
2372 optional int32 cycle_bucket_7 = 7;
2373 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002374 optional int32 cycle_bucket_9 = 9;
2375 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002376}
2377
2378/**
Howard Roa46b6582018-09-18 16:45:02 -07002379 * Log battery health snapshot.
2380 *
2381 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2382 * are snapshotted periodically over 24hrs.
2383 */
2384message BatteryHealthSnapshot {
2385 enum BatterySnapshotType {
2386 UNKNOWN = 0;
2387 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2388 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2389 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2390 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2391 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2392 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2393 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2394 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2395 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2396 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2397 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2398 }
2399 optional BatterySnapshotType type = 1;
2400 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002401 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002402 // Voltage Battery Voltage, in microVolts.
2403 optional int32 voltage_micro_volt = 3;
2404 // Current Battery current, in microAmps.
2405 optional int32 current_micro_amps = 4;
2406 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2407 optional int32 open_circuit_micro_volt = 5;
2408 // Resistance Battery Resistance, in microOhms.
2409 optional int32 resistance_micro_ohm = 6;
2410 // Level Battery Level, as % of full.
2411 optional int32 level_percent = 7;
2412}
2413
2414/**
2415 * Log slow I/O operations on the primary storage.
2416 */
2417message SlowIo {
2418 // Classifications of IO Operations.
2419 enum IoOperation {
2420 UNKNOWN = 0;
2421 READ = 1;
2422 WRITE = 2;
2423 UNMAP = 3;
2424 SYNC = 4;
2425 }
2426 optional IoOperation operation = 1;
2427
2428 // The number of slow IO operations of this type over 24 hours.
2429 optional int32 count = 2;
2430}
2431
2432/**
2433 * Log battery caused shutdown with the last recorded voltage.
2434 */
2435message BatteryCausedShutdown {
2436 // The last recorded battery voltage prior to shutdown.
2437 optional int32 last_recorded_micro_volt = 1;
2438}
2439
2440/**
Tej Singha72344992019-04-17 18:55:08 -07002441 * Logs when ThermalService receives throttling events.
2442 *
2443 * Logged from:
2444 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2445 */
2446message ThermalThrottlingSeverityStateChanged {
2447 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2448 optional android.os.TemperatureTypeEnum sensor_type = 1;
2449
2450 // The name of the temperature source. Eg. CPU0
2451 optional string sensor_name = 2;
2452
2453 // Temperature in tenths of a degree C.
2454 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2455 optional int32 temperature_deci_celsius = 3;
2456
2457 // Relative severity of the throttling, see enum definition.
2458 optional android.os.ThrottlingSeverityEnum severity = 4;
2459}
2460
2461/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002462 * Logs the duration of a davey (jank of >=700ms) when it occurs
2463 *
2464 * Logged from:
2465 * frameworks/base/libs/hwui/JankTracker.cpp
2466 */
2467message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002468 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002469 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002470
Tej Singhbb8554a2018-01-26 11:59:14 -08002471 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002472 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002473}
2474
2475/**
Bookatze5885242017-10-24 20:10:31 -07002476 * Logs phone signal strength changes.
2477 *
2478 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002479 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002480 */
2481message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002482 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2483 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002484}
2485
Yangster4ccebea2018-10-09 17:09:02 -07002486
2487/**
2488 * Logs when the phone state, sim state or signal strength changes
2489 *
2490 * Logged from:
2491 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2492 */
2493message PhoneServiceStateChanged {
2494 optional android.telephony.ServiceStateEnum state = 1;
2495 optional android.telephony.SimStateEnum sim_state = 2;
2496 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2497}
2498
2499/**
2500 * Logs when the phone becomes on or off.
2501 *
2502 * Logged from:
2503 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2504 */
2505message PhoneStateChanged {
2506 enum State {
2507 OFF = 0;
2508 ON = 1;
2509 }
2510 optional State state = 1;
2511}
2512
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002513message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002514 optional android.stats.launcher.LauncherAction action = 1;
2515 optional android.stats.launcher.LauncherState src_state = 2;
2516 optional android.stats.launcher.LauncherState dst_state = 3;
2517 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002518 optional bool is_swipe_up_enabled = 5;
2519}
2520
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002521message StyleUIChanged {
2522 optional android.stats.style.Action action = 1;
2523 optional int32 color_package_hash = 2;
2524 optional int32 font_package_hash = 3;
2525 optional int32 shape_package_hash = 4;
2526 optional int32 clock_package_hash = 5;
2527 optional int32 launcher_grid = 6;
2528 optional int32 wallpaper_category_hash = 7;
2529 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002530 optional int32 color_preference = 9;
2531 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002532}
2533
David Chenc28b2bb2017-10-24 12:52:52 -07002534/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002535 * Logs when Settings UI has changed.
2536 *
2537 * Logged from:
2538 * packages/apps/Settings
2539 */
2540message SettingsUIChanged {
2541 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002542 * Where this SettingsUIChange event comes from. For example, if
2543 * it's a PAGE_VISIBLE event, where the page is opened from.
2544 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002545 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002546
2547 /**
2548 * What the UI action is.
2549 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002550 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002551
2552 /**
2553 * Where the action is happening
2554 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002555 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002556
2557 /**
2558 * What preference changed in this event.
2559 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002560 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002561
2562 /**
2563 * The new value of the changed preference.
2564 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002565 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002566}
2567
2568/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002569 * Logs basic timing information about touch events.
2570 * Reported at most every 5 minutes while device is being interacted with.
2571 *
2572 * Logged from:
2573 * frameworks/native/services/inputflinger
2574 */
2575message TouchEventReported {
2576 /**
2577 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2578 * and the standard deviation of latency between the kernel and framework
2579 * for touchscreen events. The units are microseconds.
2580 *
2581 * The number is measured as the difference between the time at which
2582 * the input event was received in the evdev driver,
2583 * and the time at which the input event was received in EventHub.
2584 */
2585 // Minimum value
2586 optional float latency_min_micros = 1;
2587 // Maximum value
2588 optional float latency_max_micros = 2;
2589 // Average value
2590 optional float latency_mean_micros = 3;
2591 // Standard deviation
2592 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002593 // Number of touch events (input_event) in this report
2594 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002595}
2596
2597/**
Philip Quinn0eded622019-01-29 12:46:28 -08002598 * Logs gesture classification and timing information for touch events.
2599 *
2600 * Logged from:
2601 * frameworks/base/core/java/android/view/GestureDetector.java
2602 * frameworks/base/core/java/android/view/View.java
2603 */
2604message TouchGestureClassified {
2605 // The source of the classification (e.g. Java class name).
2606 optional string source = 1;
2607
2608 enum Classification {
2609 UNKNOWN_CLASSIFICATION = 0;
2610 SINGLE_TAP = 1;
2611 DOUBLE_TAP = 2;
2612 LONG_PRESS = 3;
2613 DEEP_PRESS = 4;
2614 SCROLL = 5;
2615 }
2616 // The classification of the gesture.
2617 optional Classification classification = 2;
2618
2619 // The interval from the start of a touch event stream until the
2620 // classification was made.
2621 optional int32 latency_millis = 3;
2622
2623 // The distance from the location of the first touch event to the
2624 // location of the touch event when the classification was made.
2625 optional float displacement_px = 4;
2626}
2627
2628/**
David Chenc28b2bb2017-10-24 12:52:52 -07002629 * Logs that a setting was updated.
2630 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002631 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002632 * The tag and is_default allow resetting of settings to default values based on the specified
2633 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2634 */
2635message SettingChanged {
2636 // The name of the setting.
2637 optional string setting = 1;
2638
2639 // The change being imposed on this setting. May represent a number, eg "3".
2640 optional string value = 2;
2641
2642 // The new value of this setting. For most settings, this is same as value. For some settings,
2643 // value is +X or -X where X represents an element in a set. For example, if the previous value
2644 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2645 // The +/- feature is currently only used for location_providers_allowed.
2646 optional string new_value = 3;
2647
2648 // The previous value of this setting.
2649 optional string prev_value = 4;
2650
2651 // The tag used with the is_default for resetting sets of settings. This is generally null.
2652 optional string tag = 5;
2653
Bookatz90867622018-01-31 15:05:57 -08002654 // True if this setting with tag should be resettable.
2655 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002656
David Chenbd789912018-03-16 17:19:55 -07002657 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002658 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002659
2660 enum ChangeReason {
2661 UPDATED = 1; // Updated can be an insertion or an update.
2662 DELETED = 2;
2663 }
2664 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002665}
Chenjie Yub3dda412017-10-24 13:41:59 -07002666
Chenjie Yu05013b32017-11-21 10:21:41 -08002667/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002668 * Logs activity going to foreground or background
2669 *
2670 * Logged from:
2671 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2672 */
2673message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002674 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002675 optional string pkg_name = 2;
2676 optional string class_name = 3;
2677
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002678 enum State {
2679 BACKGROUND = 0;
2680 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002681 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002682 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002683}
David Chenc8a43242017-10-17 16:23:28 -07002684
2685/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002686 * Logs when a volume entered low Storage state.
2687 * Logged from:
2688 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2689 */
2690message LowStorageStateChanged {
2691 // Volume that ran out of storage.
2692 optional string volume_description = 1;
2693
2694 enum State {
2695 UNKNOWN = 0;
2696 OFF = 1;
2697 ON = 2;
2698 }
2699 optional State state = 2;
2700}
2701
2702/**
2703 * Logs when an app is downgraded.
2704 * Logged from:
2705 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2706 */
2707message AppDowngraded {
2708 optional string package_name = 1;
2709 // Size of the package (all data) before being downgraded.
2710 optional int64 size_in_bytes_before = 2;
2711 // Size of the package (all data) after being downgraded.
2712 optional int64 size_in_bytes_after = 3;
2713
2714 optional bool aggressive = 4;
2715}
2716
2717/**
2718 * Logs when an app is optimized after being downgraded.
2719 * Logged from:
2720 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2721 */
2722message AppOptimizedAfterDowngraded {
2723 optional string package_name = 1;
2724}
2725
2726/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002727 * Logs whenever an app is installed on external storage.
2728 * Logged from:
2729 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2730 */
2731message AppInstallOnExternalStorageReported {
2732 // The type of external storage.
2733 optional android.stats.storage.ExternalStorageType storage_type = 1;
2734 // The name of the package that is installed on the sd card.
2735 optional string package_name = 2;
2736}
2737
2738/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002739 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002740 * Logged from:
2741 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2742 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002743message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002744 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002745
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002746 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002747
2748 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002749 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002750 optional string process_name = 3;
2751
2752 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002753 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002754
2755 optional string package_name = 5;
2756
2757 enum InstantApp {
2758 UNAVAILABLE = 0;
2759 FALSE = 1;
2760 TRUE = 2;
2761 }
2762 optional InstantApp is_instant_app = 6;
2763
2764 enum ForegroundState {
2765 UNKNOWN = 0;
2766 BACKGROUND = 1;
2767 FOREGROUND = 2;
2768 }
2769 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002770
2771 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002772}
David Chen9e3808c2017-11-20 17:25:34 -08002773
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002774/**
2775 * Logs when a WTF (What a Terrible Failure) happened.
2776 * Logged from:
2777 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2778 */
2779message WTFOccurred {
2780 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002781
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002782 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002783
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002784 // The name of the process.
2785 // system_server if it is not by an app
2786 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002787
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002788 // The pid if available. -1 means not available.
2789 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002790
2791 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002792}
2793
2794/**
2795 * Logs when system server reports low memory.
2796 * Logged from:
2797 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2798 */
2799message LowMemReported {
2800}
2801
2802/**
2803 * Logs when an app ANR (App Not Responding) occurs.
2804 * Logged from:
2805 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2806 */
2807message ANROccurred {
2808 optional int32 uid = 1 [(is_uid) = true];
2809
2810 optional string process_name = 2;
2811
2812 optional string short_component_name = 3;
2813
2814 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002815
2816 enum InstantApp {
2817 UNAVAILABLE = 0;
2818 FALSE = 1;
2819 TRUE = 2;
2820 }
2821 optional InstantApp is_instant_app = 5;
2822
2823 enum ForegroundState {
2824 UNKNOWN = 0;
2825 BACKGROUND = 1;
2826 FOREGROUND = 2;
2827 }
2828 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002829
2830 optional android.server.ErrorSource error_source = 7;
2831
2832 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002833}
2834
Bookatza7020bd2018-08-28 16:29:35 -07002835/**
2836 * Logs when the vibrator state changes.
2837 * Logged from:
2838 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2839 */
2840message VibratorStateChanged {
2841 repeated AttributionNode attribution_node = 1;
2842
2843 enum State {
2844 OFF = 0;
2845 ON = 1;
2846 }
2847 optional State state = 2;
2848
2849 // Duration (in milliseconds) requested to keep the vibrator on.
2850 // Only applicable for State == ON.
2851 optional int64 duration_millis = 3;
2852}
2853
David Chen0a368b22017-12-06 16:28:16 -08002854/*
2855 * Allows other apps to push events into statsd.
2856 * Logged from:
2857 * frameworks/base/core/java/android/util/StatsLog.java
2858 */
David Chen0b5c90c2018-01-25 16:51:49 -08002859message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002860 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002861 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002862
2863 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2864 optional int32 label = 2;
2865
2866 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2867 // predicates for the metrics).
2868 enum State {
2869 UNKNOWN = 0;
2870 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2871 STOP = 2;
2872 START = 3;
2873 }
2874 optional State state = 3;
2875}
2876
David Chen9e3808c2017-11-20 17:25:34 -08002877/**
Bookatz7948c872018-09-04 12:58:33 -07002878 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2879 * For example, this could be due to the user manually changing the time.
2880 *
2881 * Logged from:
2882 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2883 */
2884message WallClockTimeShifted {
2885 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2886 optional int64 wall_clock_timestamp_millis = 1;
2887}
2888
2889/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002890 * Logs when statsd detects an anomaly.
2891 *
2892 * Logged from:
2893 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2894 */
2895message AnomalyDetected {
2896 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002897 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002898
Yangster-mac94e197c2018-01-02 16:03:03 -08002899 // Id of the config whose anomaly detection alert fired.
2900 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002901
Yangster-mac94e197c2018-01-02 16:03:03 -08002902 // Id of the alert (i.e. name of the anomaly that was detected).
2903 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002904}
2905
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002906message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002907 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002908 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002909
2910 // The app package name.
2911 optional string pkg_name = 2;
2912
2913 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002914 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002915 WARM = 1;
2916 HOT = 2;
2917 COLD = 3;
2918 }
2919 // The transition type.
2920 optional TransitionType type = 3;
2921
2922 // The activity name.
2923 optional string activity_name = 4;
2924
2925 // The name of the calling app. Empty if not set.
2926 optional string calling_pkg_name = 5;
2927
2928 // Whether the app is an instant app.
2929 optional bool is_instant_app = 6;
2930
2931 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002932 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002933
Bookatz80d11a02018-01-16 10:46:35 -08002934 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002935
David Chen0b5c90c2018-01-25 16:51:49 -08002936 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002937 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002938 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002939 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002940 optional int32 bind_application_delay_millis = 11;
2941 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002942
2943 // Empty if not set.
2944 optional string launch_token = 13;
2945
Calin Juravle759fbda2018-02-20 19:52:30 +00002946 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002947 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002948
2949 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002950 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002951}
2952
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002953message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002954 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002955 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002956
2957 // The app package name.
2958 optional string pkg_name = 2;
2959
2960 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002961 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002962 WARM = 1;
2963 HOT = 2;
2964 COLD = 3;
2965 }
2966 // The transition type.
2967 optional TransitionType type = 3;
2968
2969 // The activity name.
2970 optional string activity_name = 4;
2971}
2972
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002973message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002974 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002975 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002976
2977 // The app package name.
2978 optional string pkg_name = 2;
2979
2980 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002981 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002982 WITH_BUNDLE = 1;
2983 WITHOUT_BUNDLE = 2;
2984 }
2985 // The transition type.
2986 optional TransitionType type = 3;
2987
2988 // The activity name.
2989 optional string activity_name = 4;
2990
2991 optional bool transition_process_running = 5;
2992
2993 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002994 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002995}
2996
Bookatz8fcd09a2017-12-18 13:01:10 -08002997/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002998 * Logs a picture-in-picture action
2999 * Logged from:
3000 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3001 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3002 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3003 */
3004message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003005 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003006 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003007
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003008 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003009
Chenjie Yu52cacc62017-12-08 18:11:45 -08003010 enum State {
3011 ENTERED = 1;
3012 EXPANDED_TO_FULL_SCREEN = 2;
3013 MINIMIZED = 3;
3014 DISMISSED = 4;
3015 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003016 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003017}
3018
3019/**
Chenjie Yue8904192017-12-08 19:12:57 -08003020 * Logs overlay action
3021 * Logged from:
3022 * services/core/java/com/android/server/wm/Session.java
3023 */
3024message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003025 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003026
3027 optional string package_name = 2;
3028
3029 optional bool using_alert_window = 3;
3030
3031 enum State {
3032 ENTERED = 1;
3033 EXITED = 2;
3034 }
3035 optional State state = 4;
3036}
3037
Chenjie Yuccfe6452018-01-30 11:33:21 -08003038/*
3039 * Logs foreground service starts and stops.
3040 * Note that this is not when a service starts or stops, but when it is
3041 * considered foreground.
3042 * Logged from
3043 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3044 */
3045message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003046 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003047 // package_name + "/" + class_name
3048 optional string short_name = 2;
3049
3050 enum State {
3051 ENTER = 1;
3052 EXIT = 2;
3053 }
3054 optional State state = 3;
3055}
3056
Chenjie Yue8904192017-12-08 19:12:57 -08003057/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003058 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3059 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3060 * attributed back to the parent (host) uid. One example is Chrome.
3061 *
3062 * Logged from:
3063 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3064 */
3065message IsolatedUidChanged {
3066 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003067 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003068 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003069 optional int32 parent_uid = 1;
3070
3071 optional int32 isolated_uid = 2;
3072
3073 // We expect an isolated uid to be removed before if it's used for another parent uid.
3074 enum Event {
3075 REMOVED = 0;
3076 CREATED = 1;
3077 }
3078 optional Event event = 3;
3079}
3080
3081/*
3082 * Logs the reception of an incoming network packet causing the main system to wake up for
3083 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3084 * and processed by WakeupController.cpp.
3085 */
3086message PacketWakeupOccurred {
3087 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3088 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003089 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003090 // The interface name on which the packet was received.
3091 optional string iface = 2;
3092 // The ethertype value of the packet.
3093 optional int32 ethertype = 3;
3094 // String representation of the destination MAC address of the packet.
3095 optional string destination_hardware_address = 4;
3096 // String representation of the source address of the packet if this was an IP packet.
3097 optional string source_ip = 5;
3098 // String representation of the destination address of the packet if this was an IP packet.
3099 optional string destination_ip = 6;
3100 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3101 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3102 // families.
3103 optional int32 ip_next_header = 7;
3104 // The source port if this was a TCP or UDP packet.
3105 optional int32 source_port = 8;
3106 // The destination port if this was a TCP or UDP packet.
3107 optional int32 destination_port = 9;
3108}
3109
3110/*
3111 * Logs the memory stats for an app on startup.
3112 * Logged from:
3113 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3114 */
3115message AppStartMemoryStateCaptured {
3116 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003117 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003118
3119 // The process name.
3120 optional string process_name = 2;
3121
3122 // The activity name.
3123 optional string activity_name = 3;
3124
3125 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003126 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003127
3128 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003129 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003130
3131 // RSS
3132 optional int64 rss_in_bytes = 6;
3133
3134 // CACHE
3135 optional int64 cache_in_bytes = 7;
3136
3137 // SWAP
3138 optional int64 swap_in_bytes = 8;
3139}
3140
3141/*
3142 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3143 * for LMK event.
3144 * Logged from:
3145 * system/core/lmkd/lmkd.c
3146 */
3147message LmkStateChanged {
3148 enum State {
3149 UNKNOWN = 0;
3150 START = 1;
3151 STOP = 2;
3152 }
3153 optional State state = 1;
3154}
3155
3156/*
3157 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3158 * Logged from:
3159 * system/core/lmkd/lmkd.c
3160 */
3161message LmkKillOccurred {
3162 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003163 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003164
3165 // The process name.
3166 optional string process_name = 2;
3167
3168 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003169 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003170
3171 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003172 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003173
3174 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003175 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003176
3177 // RSS
3178 optional int64 rss_in_bytes = 6;
3179
3180 // CACHE
3181 optional int64 cache_in_bytes = 7;
3182
3183 // SWAP
3184 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003185
3186 // The elapsed real time of start of the process.
3187 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003188
3189 // Min oom adj score considered by lmkd.
3190 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003191}
3192
Rajeev Kumar51b54602018-03-01 12:18:26 -08003193/*
3194 * Logs when the ActivityManagerService detects that an app died.
3195 *
3196 * Logged from:
3197 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3198 */
3199message AppDied {
3200 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003201 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003202}
3203
Howard Ro21a039c2018-08-06 14:55:47 -07003204/**
3205 * An atom for generic metrics logging. Available from Android Q.
3206 */
3207message GenericAtom {
3208 // The uid of the application that sent this custom atom.
3209 optional int32 uid = 1 [(is_uid) = true];
3210
3211 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003212 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003213}
3214
Tej Singhd6d6d772018-09-05 17:41:25 -07003215/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003216 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003217 *
3218 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003219 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003220 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003221message BiometricAcquired {
3222 // Biometric modality that was acquired.
3223 optional android.hardware.biometrics.ModalityEnum modality = 1;
3224 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3225 optional int32 user = 2;
3226 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3227 optional bool is_crypto = 3;
3228 // Action that the device is performing. Acquired messages are only expected for enroll and
3229 // authenticate. Other actions may indicate an error.
3230 optional android.hardware.biometrics.ActionEnum action = 4;
3231 // The client that this acquisition was received for.
3232 optional android.hardware.biometrics.ClientEnum client = 5;
3233 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3234 optional int32 acquire_info = 6;
3235 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3236 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003237 // Dictates if this message should trigger additional debugging.
3238 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003239}
3240
3241/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003242 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003243 *
3244 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003245 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003246 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003247message BiometricAuthenticated {
3248 // Biometric modality that was used.
3249 optional android.hardware.biometrics.ModalityEnum modality = 1;
3250 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3251 optional int32 user = 2;
3252 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3253 // storage.
3254 optional bool is_crypto = 3;
3255 // The client that this acquisition was received for.
3256 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003257 // If authentication requires user confirmation. See BiometricPrompt's
3258 // setRequireConfirmation(bool) method.
3259 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003260
Kevin Chyn1741a072019-01-17 11:54:40 -08003261 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003262 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003263 REJECTED = 1;
3264 PENDING_CONFIRMATION = 2;
3265 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003266 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003267
3268 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003269 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003270 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3271 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3272 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3273 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003274 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003275 // Dictates if this message should trigger additional debugging.
3276 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003277}
3278
3279/**
3280 * Logs when a biometric error occurs.
3281 *
3282 * Logged from:
3283 * frameworks/base/services/core/java/com/android/server/biometrics
3284 */
3285message BiometricErrorOccurred {
3286 // Biometric modality that was used.
3287 optional android.hardware.biometrics.ModalityEnum modality = 1;
3288 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3289 optional int32 user = 2;
3290 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3291 optional bool is_crypto = 3;
3292 // Action that the device is performing.
3293 optional android.hardware.biometrics.ActionEnum action = 4;
3294 // The client that this acquisition was received for.
3295 optional android.hardware.biometrics.ClientEnum client = 5;
3296 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3297 // are unique to modality.
3298 optional int32 error_info = 6;
3299 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3300 // by the vendor and not specified by the HIDL interface.
3301 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003302 // Dictates if this message should trigger additional debugging.
3303 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003304 // Time spent during the authentication attempt.
3305 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003306}
3307
3308/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003309 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003310 * Logged from:
3311 * frameworks/base/services/core/java/com/android/server/biometrics
3312 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003313message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003314 // Biometric modality.
3315 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003316 // Type of issue detected.
3317 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003318 // Dictates if this message should trigger additional debugging.
3319 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003320}
Howard Ro688ae182018-09-25 00:09:36 -07003321
joshmccloskey6f952b22019-03-25 20:59:35 -07003322/**
3323 * Logs when a biometric enrollment occurs.
3324 *
3325 * Logged from:
3326 * frameworks/base/services/core/java/com/android/server/biometrics
3327 */
3328message BiometricEnrolled {
3329 // Biometric modality that was used.
3330 optional android.hardware.biometrics.ModalityEnum modality = 1;
3331 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3332 optional int32 user = 2;
3333 // The amount of time the enrollment took in milliseconds.
3334 optional int64 latency_millis = 3;
3335 // Whether or not the enrollment was successful.
3336 optional bool success = 4;
3337}
3338
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003339/*
Tej Singh0d176952019-01-16 19:10:54 -08003340 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003341 */
Tej Singh0d176952019-01-16 19:10:54 -08003342message FlagFlipUpdateOccurred {
3343 // If the event is from a flag config package, specify the package name.
3344 optional string flag_flip_package_name = 1;
3345
3346 // The order id of the package
3347 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003348}
3349
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003350/**
3351 * Potential experiment ids that goes with a train install.
3352 */
3353message TrainExperimentIds {
3354 repeated int64 experiment_id = 1;
3355}
3356
Yangster-macb89807e2018-11-15 21:10:57 -08003357/*
3358 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003359 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003360 */
3361message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003362 // Name of the train.
3363 optional string train_name = 1;
3364 // Version code for a "train" of packages that need to be installed atomically
3365 optional int64 train_version_code = 2;
3366 // After installation of this package, device requires a restart.
3367 optional bool requires_staging = 3;
3368 // Rollback should be enabled for this install.
3369 optional bool rollback_enabled = 4;
3370 // Requires low latency monitoring if possible.
3371 optional bool requires_low_latency_monitor = 5;
3372
Yangster-macb89807e2018-11-15 21:10:57 -08003373 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003374 UNKNOWN = 0;
3375 INSTALL_REQUESTED = 1;
3376 INSTALL_STARTED = 2;
3377 INSTALL_STAGED_NOT_READY = 3;
3378 INSTALL_STAGED_READY = 4;
3379 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003380 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3381 // and INSTALL_FAILURE_COMMIT.
3382 INSTALL_FAILURE = 6 [deprecated = true];
3383 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003384 INSTALL_CANCELLED = 7;
3385 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003386 INSTALLER_ROLLBACK_INITIATED = 9;
3387 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3388 INSTALLER_ROLLBACK_STAGED = 11;
3389 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3390 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3391 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3392 INSTALLER_ROLLBACK_SUCCESS = 15;
3393 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003394 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3395 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3396 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3397 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3398 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3399 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003400 INSTALL_FAILURE_DOWNLOAD = 23;
3401 INSTALL_FAILURE_STATE_MISMATCH = 24;
3402 INSTALL_FAILURE_COMMIT = 25;
Yangster-macb89807e2018-11-15 21:10:57 -08003403 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003404 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003405 // Possible experiment ids for monitoring this push.
3406 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3407 // user id
3408 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003409}
3410
Tej Singhc9203082019-05-03 13:42:23 -07003411/* Test atom, is not logged anywhere */
3412message TestAtomReported {
3413 repeated AttributionNode attribution_node = 1;
3414 optional int32 int_field = 2;
3415 optional int64 long_field = 3;
3416 optional float float_field = 4;
3417 optional string string_field = 5;
3418 optional bool boolean_field = 6;
3419 enum State {
3420 UNKNOWN = 0;
3421 OFF = 1;
3422 ON = 2;
3423 }
3424 optional State state = 7;
3425 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3426}
3427
Maggie Whitefc1aa592018-11-28 21:55:23 -08003428/** Represents USB port overheat event. */
3429message UsbPortOverheatEvent {
3430 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3431 optional int32 plug_temperature_deci_c = 1;
3432
3433 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3434 optional int32 max_temperature_deci_c = 2;
3435
3436 /* Time between USB plug event and overheat threshold trip, in seconds. */
3437 optional int32 time_to_overheat_secs = 3;
3438
3439 /* Time between overheat threshold trip and hysteresis, in seconds. */
3440 optional int32 time_to_hysteresis_secs = 4;
3441
3442 /* Time between hysteresis and active mitigation ending, in seconds. */
3443 optional int32 time_to_inactive_secs = 5;
3444};
3445
Maggie White8735b852019-01-18 11:40:49 -08003446/**
3447 * Logs total effective full charge and discharge cycles on a battery.
3448 * Here are some examples of one effective cycle:
3449 * 1) the battery charges from 0% to 100% and drains back to 0%,
3450 * 2) charging from 50% to 100% and draining back to 50% twice.
3451 * Pulled from:
3452 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3453 */
3454message BatteryCycleCount {
3455 /* Number of total charge and discharge cycles on the system battery. */
3456 optional int32 cycle_count = 1;
3457}
3458
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003459/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003460 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3461 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003462 * Pulled from:
3463 * StatsCompanionService
3464 */
3465
Carmen Agimof12dec122019-03-06 16:14:38 +00003466message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003467
Carmen Agimof12dec122019-03-06 16:14:38 +00003468 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003469 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003470 PUBLIC = 1;
3471 PRIVATE = 2;
3472 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003473 }
3474
Carmen Agimof12dec122019-03-06 16:14:38 +00003475 // The type of external storage.
3476 optional android.stats.storage.ExternalStorageType storage_type = 1;
3477 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3478 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003479 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003480 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003481}
3482
Yangster-macb89807e2018-11-15 21:10:57 -08003483/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003484 * Logs when a connection becomes available and lost.
3485 * Logged in StatsCompanionService.java
3486 */
3487message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003488 // Id of the network.
3489 optional int32 net_id = 1;
3490
3491 enum State {
3492 UNKNOWN = 0;
3493 CONNECTED = 1;
3494 DISCONNECTED = 2;
3495 }
3496 // Connected state of a network.
3497 optional State state = 2;
3498}
3499
3500/**
3501 * Logs when a service starts and stops.
3502 * Logged from:
3503 * services/core/java/com/android/server/am/ActiveServices.java
3504 */
3505message ServiceStateChanged {
3506
3507 optional int32 uid = 1 [(is_uid) = true];
3508
3509 optional string package_name = 2;
3510
3511 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003512
3513 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003514 START = 1;
3515 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003516 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003517
3518 optional State state = 4;
3519}
3520
3521/**
3522 * Logs when a service is launched.
3523 * Logged from:
3524 * services/core/java/com/android/server/am/ActiveServices.java
3525 */
3526message ServiceLaunchReported {
3527
3528 optional int32 uid = 1 [(is_uid) = true];
3529
3530 optional string package_name = 2;
3531
3532 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003533}
Howard Ro688ae182018-09-25 00:09:36 -07003534
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003535/**
3536 * Logs when a hidden API is used.
3537 *
3538 * Logged from:
3539 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3540 */
3541message HiddenApiUsed {
3542 // The uid of the app making the hidden access.
3543 optional int32 uid = 1 [(is_uid) = true];
3544
3545 // Signature of the method or field accessed.
3546 optional string signature = 2;
3547
3548 enum AccessMethod {
3549 NONE = 0;
3550 REFLECTION = 1;
3551 JNI = 2;
3552 LINKING = 3;
3553 }
3554
3555 // Type of access.
3556 optional AccessMethod access_method = 3;
3557
3558 // Whether the access was prevented or not.
3559 optional bool access_denied = 4;
3560}
3561
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003562/**
3563 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3564 * - When user sees privacy chip
3565 * - When user clicks privacy chip
3566 * - How does the user exit the Privacy Dialog
3567 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003568 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3569 */
3570message PrivacyIndicatorsInteracted {
3571
3572 enum Type {
3573 UNKNOWN = 0;
3574 CHIP_VIEWED = 1;
3575 CHIP_CLICKED = 2;
3576 DIALOG_PRIVACY_SETTINGS = 3;
3577 DIALOG_DISMISS = 4;
3578 DIALOG_LINE_ITEM = 5;
3579 }
3580
3581 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3582
3583 // Used if the type is LINE_ITEM
3584 optional string package_name = 2;
3585}
3586
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003587/**
3588 * Logs information about a package that is moved from the internal to external storage and vice
3589 * versa.
3590 * It logs the package name, the type of the external storage where the package is installed
3591 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3592 * and the move type: if it's from internal to external or the other way around.
3593 *
3594 * Logged from:
3595 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3596 */
3597message AppMovedStorageReported {
3598 enum MoveType {
3599 UNKNOWN = 0;
3600 TO_EXTERNAL = 1;
3601 TO_INTERNAL = 2;
3602 }
3603 // The type of the external storage.
3604 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3605 // The type of move.
3606 optional MoveType move_type = 2;
3607 // The name of the package that was moved.
3608 optional string package_name = 3;
3609}
3610
jianjin8f2dee02019-03-29 14:03:08 -07003611/**
3612 * Logs when system server watchdog occurs.
3613 * Logged from:
3614 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3615 */
3616message SystemServerWatchdogOccurred {
3617 optional string subject = 1;
3618}
3619
3620/**
3621 * Logs when new file added to tombstones.
3622 * Logged from:
3623 * frameworks/base/core/java/com/android/server/BootReceiver.java
3624 */
3625message TombStoneOccurred {
3626}
3627
Hai Zhang5d3328d2019-04-13 21:25:06 +08003628/*
3629 * Information about a role request
3630 *
3631 * Logged from:
3632 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3633 */
3634message RoleRequestResultReported {
3635 // UID of application requesting the role
3636 optional int32 requesting_uid = 1;
3637
3638 // Package name of application requesting the role
3639 optional string requesting_package_name = 2;
3640
3641 // The role to be granted
3642 optional string role_name = 3;
3643
3644 // The count of applications qualifying for the role
3645 optional int32 qualifying_count = 4;
3646
3647 // UID of application current granted the role
3648 optional int32 current_uid = 5;
3649
3650 // Package name of application current granted the role
3651 optional string current_package_name = 6;
3652
3653 // UID of another application that user chose to grant the role to, instead of the requesting
3654 // application
3655 optional int32 granted_another_uid = 7;
3656
3657 // Package name of another application that user chose to grant the role to, instead of the
3658 // requesting application
3659 optional string granted_another_package_name = 8;
3660
3661 enum Result {
3662 UNDEFINED = 0;
3663 // role request was ignored
3664 IGNORED = 1;
3665 // role request was ignored because it's already granted
3666 IGNORED_ALREADY_GRANTED = 2;
3667 // role request was ignored because the application isn't qualified
3668 IGNORED_NOT_QUALIFIED = 3;
3669 // role request was ignored because user said it should be always denied
3670 IGNORED_USER_ALWAYS_DENIED = 4;
3671 // role was granted by user action
3672 USER_GRANTED = 5;
3673 // role was denied by user action
3674 USER_DENIED = 6;
3675 // role was denied by user granting another application the role
3676 USER_DENIED_GRANTED_ANOTHER = 7;
3677 // role was denied and set to be always denied by the user
3678 USER_DENIED_WITH_ALWAYS = 8;
3679 }
3680 // The result of the role request
3681 optional Result result = 9;
3682}
3683
Chenjie Yubbcbc602018-02-05 16:51:52 -08003684//////////////////////////////////////////////////////////////////////
3685// Pulled atoms below this line //
3686//////////////////////////////////////////////////////////////////////
3687
3688/**
David Chenc8a43242017-10-17 16:23:28 -07003689 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3690 *
3691 * Pulled from:
3692 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3693 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003694message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003695 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003696
3697 optional int64 rx_bytes = 2;
3698
3699 optional int64 rx_packets = 3;
3700
3701 optional int64 tx_bytes = 4;
3702
3703 optional int64 tx_packets = 5;
3704}
3705
3706/**
3707 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3708 *
3709 * Pulled from:
3710 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3711 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003712message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003713 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003714
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003715 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3716 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003717
3718 optional int64 rx_bytes = 3;
3719
3720 optional int64 rx_packets = 4;
3721
3722 optional int64 tx_bytes = 5;
3723
3724 optional int64 tx_packets = 6;
3725}
3726
3727/**
3728 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3729 *
3730 * Pulled from:
3731 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3732 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003733message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003734 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003735
3736 optional int64 rx_bytes = 2;
3737
3738 optional int64 rx_packets = 3;
3739
3740 optional int64 tx_bytes = 4;
3741
3742 optional int64 tx_packets = 5;
3743}
3744
3745/**
3746 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3747 *
3748 * Pulled from:
3749 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3750 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003751message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003752 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003753
Yao Chenc40a19d2018-03-15 16:48:25 -07003754 // 1 denotes foreground and 0 denotes background. This is called Set in
3755 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003756 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003757
3758 optional int64 rx_bytes = 3;
3759
3760 optional int64 rx_packets = 4;
3761
3762 optional int64 tx_bytes = 5;
3763
3764 optional int64 tx_packets = 6;
3765}
3766
3767/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003768 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3769 *
3770 * Pulled from:
3771 * StatsCompanionService
3772 */
3773message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003774 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003775
3776 optional int64 rx_bytes = 2;
3777
3778 optional int64 tx_bytes = 3;
3779}
3780
3781/**
David Chenc8a43242017-10-17 16:23:28 -07003782 * Pulls the kernel wakelock durations. This atom is adapted from
3783 * android/internal/os/KernelWakelockStats.java
3784 *
3785 * Pulled from:
3786 * StatsCompanionService using KernelWakelockReader.
3787 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003788message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003789 optional string name = 1;
3790
3791 optional int32 count = 2;
3792
3793 optional int32 version = 3;
3794
Yangster-maca8a30442018-10-13 23:46:34 -07003795 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003796}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003797
Chenjie Yu05013b32017-11-21 10:21:41 -08003798/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003799 * Pulls low power state information. If power.stats HAL is not available, this
3800 * includes platform and subsystem sleep state information,
3801 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3802 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003803 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003804 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003805 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3806 * as defined in:
3807 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003808 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003809message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003810 // Subsystem name
3811 optional string subsystem_name = 1;
3812 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3813 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003814 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3815 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003816 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003817 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003818 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003819 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003820 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003821}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003822
Chenjie Yu05013b32017-11-21 10:21:41 -08003823/**
Bookatz92da2832018-11-01 18:10:03 -07003824 * Pulls on-device power measurement information.
3825 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3826 * Pulled from:
3827 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3828 */
3829message OnDevicePowerMeasurement {
3830 // Name of the subsystem (to which the rail belongs).
3831 optional string subsystem_name = 1;
3832
3833 // Rail name. The rail lies within the subsystem.
3834 optional string rail_name = 2;
3835
3836 // Time (in ms since boot) at which the rail energy value was measured.
3837 // This may differ slightly from the time that statsd logs this information.
3838 optional uint64 measurement_timestamp_millis = 3;
3839
3840 // Accumulated energy used via the rail since device boot in uWs.
3841 optional uint64 energy_microwatt_secs = 4;
3842}
3843
3844/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003845 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003846 * Pulls the time the cpu spend on the frequency index. Frequency index
3847 * starts from highest to lowest. The value should be monotonically
3848 * increasing since boot. However, if there is a cpu
3849 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003850 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003851message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003852 optional uint32 cluster = 1;
3853 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003854 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003855}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003856
Chenjie Yu05013b32017-11-21 10:21:41 -08003857/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003858 * Pulls Cpu Time Per Uid.
3859 * Note that isolated process uid time should be attributed to host uids.
3860 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003861message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003862 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003863 optional uint64 user_time_micros = 2;
3864 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003865}
3866
3867/**
3868 * Pulls Cpu Time Per Uid per frequency.
3869 * Note that isolated process uid time should be attributed to host uids.
3870 * For each uid, we order the time by descending frequencies.
3871 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003872message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003873 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003874 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003875 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003876}
Hugo Benichi884970e2017-11-14 22:42:46 +09003877
Chenjie Yu05013b32017-11-21 10:21:41 -08003878/**
3879 * Pulls Wifi Controller Activity Energy Info
3880 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003881message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003882 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003883 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003884 // stack reported state
3885 // TODO: replace this with proto enum
3886 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003887 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003888 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003889 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003890 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003891 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003892 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003893 // product of current(mA), voltage(V) and time(ms)
3894 optional uint64 controller_energy_used = 6;
3895}
3896
3897/**
3898 * Pulls Modem Activity Energy Info
3899 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003900message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003901 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003902 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003903 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003904 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003905 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003906 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003907 /**
3908 * Tx power index
3909 * index 0 = tx_power < 0dBm
3910 * index 1 = 0dBm < tx_power < 5dBm
3911 * index 2 = 5dBm < tx_power < 15dBm
3912 * index 3 = 15dBm < tx_power < 20dBm
3913 * index 4 = tx_power > 20dBm
3914 */
3915 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003916 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003917 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003918 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003919 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003920 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003921 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003922 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003923 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003924 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003925 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003926 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003927 // product of current(mA), voltage(V) and time(ms)
3928 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003929}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003930
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003931/**
3932 * Pulls Bluetooth Activity Energy Info
3933 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3934 */
3935message BluetoothActivityInfo {
3936 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003937 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003938 // bluetooth stack state
3939 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003940 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003941 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003942 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003943 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003944 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003945 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003946 // product of current(mA), voltage(V) and time(ms)
3947 optional uint64 energy_used = 6;
3948}
3949
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003950/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003951 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003952 *
3953 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003954 */
3955message ProcessMemoryState {
3956 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003957 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003958
3959 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003960 // Usually package name, "system" for system server.
3961 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003962 optional string process_name = 2;
3963
Rafal Slawikda51b932018-12-13 16:31:33 +00003964 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003965 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003966
3967 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003968 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003969
3970 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003971 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003972
Rajeev Kumar90235992018-01-29 11:06:48 -08003973 // RSS
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01003974 // Value is read from /proc/PID/status. Or from memory.stat, field
Rafal Slawikda51b932018-12-13 16:31:33 +00003975 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003976 optional int64 rss_in_bytes = 6;
3977
3978 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003979 // Value is read from memory.stat, field total_cache if per-app memory
3980 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003981 optional int64 cache_in_bytes = 7;
3982
3983 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003984 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik44af3b32019-04-16 13:16:15 +01003985 // cgroups are enabled. Otherwise, VmSwap from /proc/PID/status.
Rajeev Kumar90235992018-01-29 11:06:48 -08003986 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003987
Rafal Slawikd03ae422018-11-20 11:27:45 +00003988 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003989 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003990
3991 // Elapsed real time when the process started.
3992 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3993 optional int64 start_time_nanos = 10;
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01003994
3995 // Anonymous page size plus swap size. Values are read from /proc/PID/status.
3996 optional int32 anon_rss_and_swap_in_kilobytes = 11;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003997}
3998
3999/*
Rafal Slawik08621582018-10-15 14:53:07 +01004000 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00004001 *
4002 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01004003 */
4004message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01004005 // The uid if available. -1 means not available.
4006 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004007
Rafal Slawikbf67d072018-10-23 11:07:54 +01004008 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004009 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01004010 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01004011
Rafal Slawikbf67d072018-10-23 11:07:54 +01004012 // # of page-faults
4013 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01004014
Rafal Slawikbf67d072018-10-23 11:07:54 +01004015 // # of major page-faults
4016 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01004017
Rafal Slawikbf67d072018-10-23 11:07:54 +01004018 // RSS
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004019 // Value read from /proc/PID/status.
Rafal Slawikbf67d072018-10-23 11:07:54 +01004020 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01004021
Rafal Slawikd03ae422018-11-20 11:27:45 +00004022 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004023 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01004024
4025 // Elapsed real time when the process started.
4026 // Value is read from /proc/PID/stat, field 22.
4027 optional int64 start_time_nanos = 7;
Rafal Slawik44af3b32019-04-16 13:16:15 +01004028
4029 // SWAP
4030 // Value read from /proc/PID/status, field VmSwap.
4031 optional int64 swap_in_bytes = 8;
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004032
4033 // Anonymous page size plus swap size. Values are read from /proc/PID/status.
4034 optional int32 anon_rss_and_swap_in_kilobytes = 9;
Rafal Slawik08621582018-10-15 14:53:07 +01004035}
4036
4037/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004038 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004039 *
4040 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4041 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004042 *
4043 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004044 */
4045message ProcessMemoryHighWaterMark {
4046 // The uid if available. -1 means not available.
4047 optional int32 uid = 1 [(is_uid) = true];
4048
Rafal Slawikda51b932018-12-13 16:31:33 +00004049 // The process name.
4050 // Usually package name or process cmdline.
4051 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004052 optional string process_name = 2;
4053
4054 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4055 // /proc/PID/status.
4056 optional int64 rss_high_water_mark_in_bytes = 3;
4057}
4058
4059/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004060 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004061 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004062message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004063 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004064}
4065
4066/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004067 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004068 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004069message SystemUptime {
4070 // Milliseconds since the system was booted.
4071 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4072 // for external input).
4073 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004074 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004075}
4076
4077/*
4078 * Reads from /proc/uid_concurrent_active_time which has the format:
4079 * active: X (X is # cores)
4080 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4081 * [uid1]: [time-0] [time-1] [time-2] ... ...
4082 * ...
4083 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4084 * The file contains a monotonically increasing count of time for a single boot.
4085 */
4086message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004087 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004088 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004089}
4090
4091/**
4092 * Reads from /proc/uid_concurrent_policy_time which has the format:
4093 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4094 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4095 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4096 * ...
4097 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4098 * The file contains a monotonically increasing count of time for a single boot.
4099 */
4100message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004101 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004102 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004103 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004104}
4105
4106/*
4107 * Pulls free disk space, for data, system partition and temporary directory.
4108 */
4109message DiskSpace {
4110 // available bytes in data partition
4111 optional uint64 data_available_bytes = 1;
4112 // available bytes in system partition
4113 optional uint64 system_available_bytes = 2;
4114 // available bytes in download cache or temp directories
4115 optional uint64 temp_available_bytes = 3;
4116}
Tej Singhbf972d92018-01-10 20:51:13 -08004117
4118/**
4119 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004120 *
4121 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004122 */
4123message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004124 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004125}
4126
4127/**
4128 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004129 * Pulled from:
4130 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004131 */
4132message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004133 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004134}
4135
4136/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004137 * Pulls battery voltage.
4138 * Pulled from:
4139 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4140 */
4141message BatteryVoltage {
4142 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004143 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004144}
4145
4146/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004147 * Pulls battery level (percent full, from 0 to 100).
4148 *
4149 * Pulled from:
4150 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4151 */
4152message BatteryLevel {
4153 // Battery level. Should be in [0, 100].
4154 optional int32 battery_level = 1;
4155}
4156
4157/**
Tej Singhd89137e2018-03-26 14:51:40 -07004158 * Pulls the temperature of various parts of the device.
4159 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004160 *
Maggie White442b6312019-04-05 16:26:44 -07004161 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004162 */
4163message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004164 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004165 optional android.os.TemperatureTypeEnum sensor_location = 1;
4166
4167 // The name of the temperature source. Eg. CPU0
4168 optional string sensor_name = 2;
4169
Tej Singhd89137e2018-03-26 14:51:40 -07004170 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004171 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004172 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004173
4174 // Relative severity of the throttling, see enum definition.
4175 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004176}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004177
4178/**
4179 * Pulls the statistics of calls to Binder.
4180 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004181 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4182 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004183 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004184 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004185 */
4186message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004187 // UID of the process responsible for the binder transaction. It will be set if the process
4188 // executing the binder transaction attribute the transaction to another uid using
4189 // Binder.setThreadWorkSource().
4190 //
4191 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004192 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004193 // UID of the process executing the binder transaction.
4194 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004195 // Fully qualified class name of the API call.
4196 //
4197 // This is a system server class name.
4198 //
4199 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4200 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4201 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4202 // commonly used APIs.
4203 optional string service_class_name = 2;
4204 // Method name of the API call. It can also be a transaction code if we cannot
4205 // resolve it to a name. See Binder#getTransactionName.
4206 //
4207 // This is a system server method name.
4208 optional string service_method_name = 3;
4209 // Total number of API calls.
4210 optional int64 call_count = 4;
4211 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4212 optional bool screen_interactive = 13;
4213 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4214 // call_count will be equal to recorded_call_count.
4215 //
4216 // If recorded_call_count is different than call_count, it means data collection has been
4217 // sampled. All the fields below will be sampled in this case.
4218 optional int64 recorded_call_count = 12;
4219 // Number of exceptions thrown by the API.
4220 optional int64 recorded_exception_count = 5;
4221 // Total latency of all API calls.
4222 // Average can be computed using total_latency_micros / recorded_call_count.
4223 optional int64 recorded_total_latency_micros = 6;
4224 // Maximum latency of one API call.
4225 optional int64 recorded_max_latency_micros = 7;
4226 // Total CPU usage of all API calls.
4227 // Average can be computed using total_cpu_micros / recorded_call_count.
4228 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4229 optional int64 recorded_total_cpu_micros = 8;
4230 // Maximum CPU usage of one API call.
4231 optional int64 recorded_max_cpu_micros = 9;
4232 // Maximum parcel reply size of one API call.
4233 optional int64 recorded_max_reply_size_bytes = 10;
4234 // Maximum parcel request size of one API call.
4235 optional int64 recorded_max_request_size_bytes = 11;
4236}
4237
4238/**
4239 * Pulls the statistics of exceptions during calls to Binder.
4240 *
4241 * Binder stats are cumulative from boot unless somebody reset the data using
4242 * > adb shell dumpsys binder_calls_stats --reset
4243 */
4244message BinderCallsExceptions {
4245 // Exception class name, e.g. java.lang.IllegalArgumentException.
4246 //
4247 // This is an exception class name thrown by the system server.
4248 optional string exception_class_name = 1;
4249 // Total number of exceptions.
4250 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004251}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004252
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004253/**
4254 * Pulls the statistics of message dispatching on HandlerThreads.
4255 *
4256 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4257 * config on the device.
4258 *
4259 * Next tag: 11
4260 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004261message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004262 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004263 optional int32 uid = 1 [(is_uid) = true];
4264
4265 // Fully qualified class name of the handler target class.
4266 //
4267 // This field does not contain PII. This is a system server class name.
4268 optional string handler_class_name = 2;
4269
4270 // The name of the thread that runs the Looper.
4271 //
4272 // This field does not contain PII. This is a system server thread name.
4273 optional string looper_thread_name = 3;
4274
4275 // The name of the dispatched message.
4276 //
4277 // This field does not contain PII. This is a system server constant or class
4278 // name.
4279 optional string message_name = 4;
4280
4281 // Total number of successfully dispatched messages.
4282 optional int64 message_count = 5;
4283
4284 // Total number of messages that failed dispatching.
4285 optional int64 exception_count = 6;
4286
4287 // Total number of processed messages we have data recorded for. If we
4288 // collected data for all the messages, message_count will be equal to
4289 // recorded_message_count.
4290 //
4291 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004292 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004293 optional int64 recorded_message_count = 7;
4294
4295 // Total latency of all processed messages.
4296 // Average can be computed using recorded_total_latency_micros /
4297 // recorded_message_count.
4298 optional int64 recorded_total_latency_micros = 8;
4299
4300 // Total CPU usage of all processed message.
4301 // Average can be computed using recorded_total_cpu_micros /
4302 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004303 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004304 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004305
4306 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4307 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004308
4309 // Max recorded CPU usage of all processed messages.
4310 optional int64 recorded_max_cpu_micros = 11;
4311
4312 // Max recorded latency of all processed messages.
4313 optional int64 recorded_max_latency_micros = 12;
4314
4315 // Total number of messages we tracked the dispatching delay for. If we
4316 // collected data for all the messages, message_count will be equal to
4317 // recorded_delay_message_count.
4318 //
4319 // If recorded_delay_message_count is different than message_count, it means data
4320 // collection has been sampled or/and not all messages specified the target dispatch time.
4321 // The fields below will be sampled in this case.
4322 optional int64 recorded_delay_message_count = 13;
4323
4324 // Total dispatching delay of all processed messages.
4325 // Calculated as a difference between the target dispatching time (Message.when)
4326 // and the actual dispatching time.
4327 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4328 optional int64 recorded_total_delay_millis = 14;
4329
4330 // Max dispatching delay of all processed messages.
4331 // Calculated as a difference between the target dispatching time (Message.when)
4332 // and the actual dispatching time.
4333 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004334}
Tej Singh86dc9db2018-09-06 00:39:57 +00004335
4336/**
4337 * Pulls disk information, such as write speed and latency.
4338 */
4339message DiskStats {
4340 // Time taken to open, write 512B to, and close a file.
4341 // -1 if error performing the check.
4342 optional int64 data_write_latency_millis = 1;
4343
4344 optional bool file_based_encryption = 2;
4345
4346 // Recent disk write speed in kB/s.
4347 // -1 if error querying storageed.
4348 // 0 if data is unavailable.
4349 optional int32 recent_disk_write_speed = 3;
4350}
4351
4352
4353/**
4354 * Free and total bytes of the Data, Cache, and System partition.
4355 */
4356message DirectoryUsage {
4357 enum Directory {
4358 UNKNOWN = 0;
4359 DATA = 1;
4360 CACHE = 2;
4361 SYSTEM = 3;
4362 }
4363 optional Directory directory = 1;
4364 optional int64 free_bytes = 2;
4365 optional int64 total_bytes = 3;
4366}
4367
4368
4369/**
4370 * Size of an application: apk size, data size, and cache size.
4371 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4372 * Information is only reported for apps with the primary user (user 0).
4373 * Sizes are aggregated by package name.
4374 */
4375message AppSize {
4376 // Including uids will involve modifying diskstats logic.
4377 optional string package_name = 1;
4378 // App size in bytes. -1 if unavailable.
4379 optional int64 app_size_bytes = 2;
4380 // App data size in bytes. -1 if unavailable.
4381 optional int64 app_data_size_bytes = 3;
4382 // App cache size in bytes. -1 if unavailable.
4383 optional int64 app_cache_size_bytes = 4;
4384 // Time that the cache file was produced.
4385 // Uses System.currentTimeMillis(), which is wall clock time.
4386 optional int64 cache_time_millis = 5;
4387}
4388
4389
4390/**
4391 * Size of a particular category. Eg: photos, videos.
4392 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4393 */
4394message CategorySize {
4395 enum Category {
4396 UNKNOWN = 0;
4397 APP_SIZE = 1;
4398 APP_DATA_SIZE = 2;
4399 APP_CACHE_SIZE = 3;
4400 PHOTOS = 4;
4401 VIDEOS = 5;
4402 AUDIO = 6;
4403 DOWNLOADS = 7;
4404 SYSTEM = 8;
4405 OTHER = 9;
4406 }
4407 optional Category category = 1;
4408 // Category size in bytes.
4409 optional int64 size_bytes = 2;
4410 // Time that the cache file was produced.
4411 // Uses System.currentTimeMillis(), which is wall clock time.
4412 optional int64 cache_time_millis = 3;
4413}
Tej Singhd6d6d772018-09-05 17:41:25 -07004414
4415/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004416 * Pulls per uid I/O stats. The stats are cumulative since boot.
4417 *
4418 * Read/write bytes are I/O events from a storage device
4419 * Read/write chars are data requested by read/write syscalls, and can be
4420 * satisfied by caching.
4421 *
4422 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4423 */
4424message DiskIo {
4425 optional int32 uid = 1 [(is_uid) = true];
4426 optional int64 fg_chars_read = 2;
4427 optional int64 fg_chars_write = 3;
4428 optional int64 fg_bytes_read = 4;
4429 optional int64 fg_bytes_write = 5;
4430 optional int64 bg_chars_read = 6;
4431 optional int64 bg_chars_write = 7;
4432 optional int64 bg_bytes_read = 8;
4433 optional int64 bg_bytes_write = 9;
4434 optional int64 fg_fsync = 10;
4435 optional int64 bg_fsync= 11;
4436}
4437
4438
4439/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004440 * Pulls the number of fingerprints for each user.
4441 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004442 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004443 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004444message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004445 // The associated user. Eg: 0 for owners, 10+ for others.
4446 // Defined in android/os/UserHandle.java
4447 optional int32 user = 1;
4448 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004449 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004450}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004451
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004452/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004453 * Pulls the number of faces for each user.
4454 *
4455 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4456 */
4457message NumFacesEnrolled {
4458 // The associated user. Eg: 0 for owners, 10+ for others.
4459 // Defined in android/os/UserHandle.java
4460 optional int32 user = 1;
4461 // Number of faces registered to that user.
4462 optional int32 num_faces_enrolled = 2;
4463}
4464/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004465 * A mapping of role holder -> role
4466 */
4467message RoleHolder {
4468 // uid of the role holder
4469 optional int32 uid = 1 [(is_uid) = true];
4470
4471 // package name of the role holder
4472 optional string package_name = 2;
4473
4474 // the role held
4475 optional string role = 3;
4476}
4477
Yangsteraf9aee72018-10-12 09:26:16 -07004478message AggStats {
4479 optional int64 min = 1;
4480
4481 optional int64 average = 2;
4482
4483 optional int64 max = 3;
4484}
4485
4486message ProcessStatsStateProto {
4487 optional android.service.procstats.ScreenState screen_state = 1;
4488
4489 optional android.service.procstats.MemoryState memory_state = 2;
4490
4491 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4492 // and not frameworks/base/core/java/android/app/ActivityManager.java
4493 optional android.service.procstats.ProcessState process_state = 3;
4494
4495 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004496 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004497
4498 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004499 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004500
4501 // # of samples taken
4502 optional int32 sample_size = 5;
4503
4504 // PSS is memory reserved for this process
4505 optional AggStats pss = 6;
4506
4507 // USS is memory shared between processes, divided evenly for accounting
4508 optional AggStats uss = 7;
4509
4510 // RSS is memory resident for this process
4511 optional AggStats rss = 8;
4512}
4513
4514// Next Tag: 7
4515message ProcessStatsProto {
4516 // Name of process.
4517 optional string process = 1;
4518
4519 // Uid of the process.
4520 optional int32 uid = 2;
4521
4522 // Information about how often kills occurred
4523 message Kill {
4524 // Count of excessive CPU kills
4525 optional int32 cpu = 1;
4526
4527 // Count of kills when cached
4528 optional int32 cached = 2;
4529
4530 // PSS stats during cached kill
4531 optional AggStats cached_pss = 3;
4532 }
4533 optional Kill kill = 3;
4534
4535 // Time and memory spent in various states.
4536 repeated ProcessStatsStateProto states = 5;
4537
4538 // Total time process has been running... screen_state, memory_state, and process_state
4539 // will not be set.
4540 optional ProcessStatsStateProto total_running_state = 6;
4541}
4542
4543message PackageServiceOperationStatsProto {
4544 // Operate enum: Started, Foreground, Bound, Executing
4545 optional android.service.procstats.ServiceOperationState operation = 1;
4546
4547 // Number of times the service was in this operation.
4548 optional int32 count = 2;
4549
4550 // Information about a state the service can be in.
4551 message StateStats {
4552 // Screen state enum.
4553 optional android.service.procstats.ScreenState screen_state = 1;
4554 // Memory state enum.
4555 optional android.service.procstats.MemoryState memory_state = 2;
4556
4557 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004558 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004559 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004560 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004561 }
4562 repeated StateStats state_stats = 3;
4563}
4564
4565message PackageServiceStatsProto {
4566 // Name of service component.
4567 optional string service_name = 1;
4568
4569 // The operation stats.
4570 // The package_name, package_uid, package_version, service_name will not be set to save space.
4571 repeated PackageServiceOperationStatsProto operation_stats = 2;
4572}
4573
4574message PackageAssociationSourceProcessStatsProto {
4575 // Uid of the process.
4576 optional int32 process_uid = 1;
4577 // Process name.
4578 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004579 // Package name.
4580 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004581 // Total count of the times this association appeared.
4582 optional int32 total_count = 3;
4583
4584 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004585 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004586
4587 // Total count of the times this association became actively impacting its target process.
4588 optional int32 active_count = 5;
4589
4590 // Information on one source in this association.
4591 message StateStats {
4592 // Process state enum.
4593 optional android.service.procstats.ProcessState process_state = 1;
4594 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004595 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004596 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004597 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004598 }
4599 repeated StateStats active_state_stats = 6;
4600}
4601
4602message PackageAssociationProcessStatsProto {
4603 // Name of the target component.
4604 optional string component_name = 1;
4605 // Information on one source in this association.
4606 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4607}
4608
4609
4610message ProcessStatsPackageProto {
4611 // Name of package.
4612 optional string package = 1;
4613
4614 // Uid of the package.
4615 optional int32 uid = 2;
4616
4617 // Version of the package.
4618 optional int64 version = 3;
4619
4620 // Stats for each process running with the package loaded in to it.
4621 repeated ProcessStatsProto process_stats = 4;
4622
4623 // Stats for each of the package's services.
4624 repeated PackageServiceStatsProto service_stats = 5;
4625
4626 // Stats for each association with the package.
4627 repeated PackageAssociationProcessStatsProto association_stats = 6;
4628}
4629
4630message ProcessStatsSectionProto {
4631 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004632 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004633
4634 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004635 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004636
4637 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004638 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004639
4640 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004641 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004642
4643 // System runtime library. e.g. "libdvm.so", "libart.so".
4644 optional string runtime = 5;
4645
4646 // whether kernel reports swapped pss.
4647 optional bool has_swapped_pss = 6;
4648
4649 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4650 enum Status {
4651 STATUS_UNKNOWN = 0;
4652 STATUS_COMPLETE = 1;
4653 STATUS_PARTIAL = 2;
4654 STATUS_SHUTDOWN = 3;
4655 STATUS_SYSPROPS = 4;
4656 }
4657 repeated Status status = 7;
4658
Chenjie Yub2ecc792019-01-17 10:27:26 -08004659 // Number of pages available of various types and sizes, representation fragmentation.
4660 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4661
Yangsteraf9aee72018-10-12 09:26:16 -07004662 // Stats for each process.
4663 repeated ProcessStatsProto process_stats = 8;
4664
4665 // Stats for each package.
4666 repeated ProcessStatsPackageProto package_stats = 9;
4667}
4668
Chenjie Yub2ecc792019-01-17 10:27:26 -08004669message ProcessStatsAvailablePagesProto {
4670 // Node these pages are in (as per /proc/pagetypeinfo)
4671 optional int32 node = 1;
4672
4673 // Zone these pages are in (as per /proc/pagetypeinfo)
4674 optional string zone = 2;
4675
4676 // Label for the type of these pages (as per /proc/pagetypeinfo)
4677 optional string label = 3;
4678
4679 // Distribution of number of pages available by order size. First entry in array is
4680 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4681 repeated int32 pages_per_order = 4;
4682}
4683
Chenjie Yu12e5e672018-09-14 15:54:59 -07004684/**
4685 * Pulled from ProcessStatsService.java
4686 */
4687message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004688 optional ProcessStatsSectionProto proc_stats_section = 1;
4689}
4690
Chenjie Yuf910b7802019-01-11 16:08:20 -08004691/**
4692 * Pulled from ProcessStatsService.java
4693 */
4694message ProcStatsPkgProc {
4695 optional ProcessStatsSectionProto proc_stats_section = 1;
4696}
4697
Yangsteraf9aee72018-10-12 09:26:16 -07004698message PowerProfileProto {
4699 optional double cpu_suspend = 1;
4700
4701 optional double cpu_idle = 2;
4702
4703 optional double cpu_active = 3;
4704
4705 message CpuCluster {
4706 optional int32 id = 1;
4707 optional double cluster_power = 2;
4708 optional int32 cores = 3;
4709 repeated int64 speed = 4;
4710 repeated double core_power = 5;
4711 }
4712
4713 repeated CpuCluster cpu_cluster = 40;
4714
4715 optional double wifi_scan = 4;
4716
4717 optional double wifi_on = 5;
4718
4719 optional double wifi_active = 6;
4720
4721 optional double wifi_controller_idle = 7;
4722
4723 optional double wifi_controller_rx = 8;
4724
4725 optional double wifi_controller_tx = 9;
4726
4727 repeated double wifi_controller_tx_levels = 10;
4728
4729 optional double wifi_controller_operating_voltage = 11;
4730
4731 optional double bluetooth_controller_idle = 12;
4732
4733 optional double bluetooth_controller_rx = 13;
4734
4735 optional double bluetooth_controller_tx = 14;
4736
4737 optional double bluetooth_controller_operating_voltage = 15;
4738
4739 optional double modem_controller_sleep = 16;
4740
4741 optional double modem_controller_idle = 17;
4742
4743 optional double modem_controller_rx = 18;
4744
4745 repeated double modem_controller_tx = 19;
4746
4747 optional double modem_controller_operating_voltage = 20;
4748
4749 optional double gps_on = 21;
4750
4751 repeated double gps_signal_quality_based = 22;
4752
4753 optional double gps_operating_voltage = 23;
4754
4755 optional double bluetooth_on = 24;
4756
4757 optional double bluetooth_active = 25;
4758
4759 optional double bluetooth_at_cmd = 26;
4760
4761 optional double ambient_display = 27;
4762
4763 optional double screen_on = 28;
4764
4765 optional double radio_on = 29;
4766
4767 optional double radio_scanning = 30;
4768
4769 optional double radio_active = 31;
4770
4771 optional double screen_full = 32;
4772
4773 optional double audio = 33;
4774
4775 optional double video = 34;
4776
4777 optional double flashlight = 35;
4778
4779 optional double memory = 36;
4780
4781 optional double camera = 37;
4782
4783 optional double wifi_batched_scan = 38;
4784
4785 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004786}
Chenjie Yuab530202018-09-26 12:39:20 -07004787
4788/**
4789 * power_profile.xml and other constants for power model calculations.
4790 * Pulled from PowerProfile.java
4791 */
4792message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004793 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004794}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004795
4796/**
arangelovd5db50e2018-10-12 20:24:39 +01004797 * Logs when a user restriction was added or removed.
4798 *
4799 * Logged from:
4800 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4801 */
4802message UserRestrictionChanged {
4803 // The raw string of the user restriction as defined in UserManager.
4804 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4805 optional string restriction = 1;
4806 // Whether the restriction is enabled or disabled.
4807 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004808}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004809
4810/**
4811 * Pulls process user time and system time. Puller takes a snapshot of all pids
4812 * in the system and returns cpu stats for those that are working at the time.
4813 * Dead pids will be dropped. Kernel processes are excluded.
4814 * Min cool-down is 5 sec.
4815 */
4816message ProcessCpuTime {
4817 optional int32 uid = 1 [(is_uid) = true];
4818
4819 optional string process_name = 2;
4820 // Process cpu time in user space, cumulative from boot/process start
4821 optional int64 user_time_millis = 3;
4822 // Process cpu time in system space, cumulative from boot/process start
4823 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004824}
Misha Wagner5a51e002018-10-03 15:04:09 +01004825
4826/**
4827 * Pulls the CPU usage for each thread.
4828 *
4829 * Read from /proc/$PID/task/$TID/time_in_state files.
4830 *
4831 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4832 * time_in_state files not being present on some phones, have not been addressed. These should be
4833 * considered before a public release.
4834 */
4835message CpuTimePerThreadFreq {
4836 // UID that owns the process.
4837 optional int32 uid = 1 [(is_uid) = true];
4838 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004839 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004840 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004841 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004842 // Name of the process taken from `/proc/$PID/cmdline`.
4843 optional string process_name = 4;
4844 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4845 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004846
4847 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4848 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4849 // frequencies are given here as the alternative is sending eight separate atoms. This method
4850 // significantly reduces the amount of data created
4851 optional int32 frequency1_khz = 6;
4852 optional int32 time1_millis = 7;
4853 optional int32 frequency2_khz = 8;
4854 optional int32 time2_millis = 9;
4855 optional int32 frequency3_khz = 10;
4856 optional int32 time3_millis = 11;
4857 optional int32 frequency4_khz = 12;
4858 optional int32 time4_millis = 13;
4859 optional int32 frequency5_khz = 14;
4860 optional int32 time5_millis = 15;
4861 optional int32 frequency6_khz = 16;
4862 optional int32 time6_millis = 17;
4863 optional int32 frequency7_khz = 18;
4864 optional int32 time7_millis = 19;
4865 optional int32 frequency8_khz = 20;
4866 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004867}
Bookatz75ee60422018-11-09 12:27:37 -08004868
4869/**
Bookatz366a4432018-11-20 09:42:33 -08004870 * Pulls information about the device's build.
4871 */
4872message BuildInformation {
4873 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4874 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4875 optional string fingerprint = 1;
4876
4877 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4878 optional string brand = 2;
4879
4880 // Build.PRODUCT. The name of the overall product.
4881 optional string product = 3;
4882
4883 // Build.DEVICE. The name of the industrial design.
4884 optional string device = 4;
4885
4886 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4887 optional string version_release = 5;
4888
4889 // Build.ID. E.g. a label like "M4-rc20".
4890 optional string id = 6;
4891
4892 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4893 // represent this build.
4894 optional string version_incremental = 7;
4895
4896 // Build.TYPE. The type of build, like "user" or "eng".
4897 optional string type = 8;
4898
4899 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4900 optional string tags = 9;
4901}
4902
4903/**
Adam He420947c2019-01-23 15:59:09 -08004904 * Logs information about mismatched caller for content capture.
4905 *
4906 * Logged from:
4907 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
4908 */
4909message ContentCaptureCallerMismatchReported {
4910 optional string intended_package = 1;
4911 optional string calling_package = 2;
4912}
4913
4914/**
4915 * Logs information about content capture service events.
4916 *
4917 * Logged from:
4918 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4919 */
4920message ContentCaptureServiceEvents {
4921 // The type of event.
4922 enum Event {
4923 UNKNOWN = 0;
4924 ON_CONNECTED = 1;
4925 ON_DISCONNECTED = 2;
4926 SET_WHITELIST = 3;
4927 SET_DISABLED = 4;
4928 ON_USER_DATA_REMOVED = 5;
4929 }
4930 optional Event event = 1;
4931 // component/package of content capture service.
4932 optional string service_info = 2;
4933 // component/package of target.
4934 // it's a concatenated list of component/package for SET_WHITELIST event
4935 // separated by " ".
4936 optional string target_info = 3;
4937}
4938
4939/**
4940 * Logs information about content capture session events.
4941 *
4942 * Logged from:
4943 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4944 */
4945message ContentCaptureSessionEvents {
4946 // The type of event.
4947 enum Event {
4948 UNKNOWN = 0;
4949 ON_SESSION_STARTED = 1;
4950 ON_SESSION_FINISHED = 2;
4951 SESSION_NOT_CREATED = 3;
4952 }
4953 optional int32 session_id = 1;
4954 optional Event event = 2;
4955 // (n/a on session finished)
4956 optional int32 state_flags = 3;
4957 // component/package of content capture service.
4958 optional string service_info = 4;
4959 // component/package of app.
4960 // (n/a on session finished)
4961 optional string app_info = 5;
4962 optional bool is_child_session = 6;
4963}
4964
4965/**
4966 * Logs information about session being flushed.
4967 *
4968 * Logged from:
4969 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4970 */
4971message ContentCaptureFlushed {
4972 optional int32 session_id = 1;
4973 // component/package of content capture service.
4974 optional string service_info = 2;
4975 // component/package of app.
4976 optional string app_info = 3;
4977 // session start/finish events
4978 optional int32 child_session_started = 4;
4979 optional int32 child_session_finished = 5;
4980 // count of view events.
4981 optional int32 view_appeared_count = 6;
4982 optional int32 view_disappeared_count = 7;
4983 optional int32 view_text_changed_count = 8;
4984
4985 // Flush stats.
4986 optional int32 max_events = 9;
4987 optional int32 idle_flush_freq = 10;
4988 optional int32 text_flush_freq = 11;
4989 optional int32 flush_reason = 12;
4990}
4991
4992/**
Bookatz75ee60422018-11-09 12:27:37 -08004993 * Pulls on-device BatteryStats power use calculations for the overall device.
4994 */
4995message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004996 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4997 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4998 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4999 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005000}
5001
5002/**
5003 * Pulls on-device BatteryStats power use calculations broken down by uid.
5004 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5005 * that is attributed to non-uid items. They must all be included to get the total power use.
5006 */
5007message DeviceCalculatedPowerBlameUid {
5008 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5009 optional int32 uid = 1 [(is_uid) = true];
5010
Bookatz3dbc13a2018-12-21 12:16:51 -08005011 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5012 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5013 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005014}
5015
5016/**
5017 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5018 * drain type.
5019 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5020 * is attributed uids. They must all be included to get the total power use.
5021 */
5022message DeviceCalculatedPowerBlameOther {
5023 // The type of item whose power use is being reported.
5024 enum DrainType {
5025 AMBIENT_DISPLAY = 0;
5026 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5027 BLUETOOTH = 2;
5028 CAMERA = 3;
5029 // Cell-standby
5030 CELL = 4;
5031 FLASHLIGHT = 5;
5032 IDLE = 6;
5033 MEMORY = 7;
5034 // Amount that total computed drain exceeded the drain estimated using the
5035 // battery level changes and capacity.
5036 OVERCOUNTED = 8;
5037 PHONE = 9;
5038 SCREEN = 10;
5039 // Amount that total computed drain was below the drain estimated using the
5040 // battery level changes and capacity.
5041 UNACCOUNTED = 11;
5042 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5043 WIFI = 13;
5044 }
5045 optional DrainType drain_type = 1;
5046
Bookatz3dbc13a2018-12-21 12:16:51 -08005047 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5048 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5049 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005050}
arangelov4e994062018-11-13 16:12:38 +00005051
5052/**
5053 * Logs device policy features.
5054 *
5055 * Logged from:
5056 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5057 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5058 */
5059message DevicePolicyEvent {
5060 // The event id - unique for each event.
5061 optional android.stats.devicepolicy.EventId event_id = 1;
5062 // The admin package name.
5063 optional string admin_package_name = 2;
5064 // A generic integer parameter.
5065 optional int32 integer_value = 3;
5066 // A generic boolean parameter.
5067 optional bool boolean_value = 4;
5068 // A parameter specifying a time period in milliseconds.
5069 optional uint64 time_period_millis = 5;
5070 // A parameter specifying a list of package names, bundle extras or string parameters.
5071 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5072}
shawnlinea5b66b2018-11-13 15:05:29 +08005073
5074/**
5075 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5076 *
5077 * Logged from:
5078 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5079 */
5080message DocsUILaunchReported {
5081 optional android.stats.docsui.LaunchAction launch_action = 1;
5082 optional bool has_initial_uri = 2;
5083 optional android.stats.docsui.MimeType mime_type = 3;
5084 optional android.stats.docsui.Root initial_root = 4;
5085}
5086
5087/**
5088 * Logs root/app visited event in file managers/picker. Call this when the user
5089 * taps on root/app in hamburger menu.
5090 *
5091 * Logged from:
5092 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5093 */
5094message DocsUIRootVisitedReported {
5095 optional android.stats.docsui.ContextScope scope = 1;
5096 optional android.stats.docsui.Root root = 2;
5097}
5098
5099/**
5100 * Logs file operation stats. Call this when a file operation has completed.
5101 *
5102 * Logged from:
5103 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5104 */
5105message DocsUIFileOperationReported {
5106 optional android.stats.docsui.Provider provider = 1;
5107 optional android.stats.docsui.FileOperation file_op = 2;
5108}
5109
5110/**
5111 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5112 * mode.
5113 *
5114 * Logged from:
5115 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5116 */
5117message DocsUIFileOperationCopyMoveModeReported {
5118 optional android.stats.docsui.FileOperation file_op = 1;
5119 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5120}
5121
5122
5123/**
5124 * Logs file sub operation stats. Call this when a file operation has failed.
5125 *
5126 * Logged from:
5127 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5128 */
5129message DocsUIFileOperationFailureReported {
5130 optional android.stats.docsui.Authority authority = 1;
5131 optional android.stats.docsui.SubFileOperation sub_op = 2;
5132}
5133
5134/**
5135* Logs the cancellation of a file operation. Call this when a job is canceled
5136*
5137* Logged from:
5138* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5139*/
5140message DocsUIFileOperationCanceledReported {
5141 optional android.stats.docsui.FileOperation file_op = 1;
5142}
5143
5144/**
5145 * Logs startup time in milliseconds.
5146 *
5147 * Logged from:
5148 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5149 */
5150message DocsUIStartupMsReported {
5151 optional int32 startup_millis = 1;
5152}
5153
5154/**
5155 * Logs the action that was started by user.
5156 *
5157 * Logged from:
5158 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5159 */
5160message DocsUIUserActionReported {
5161 optional android.stats.docsui.UserAction action = 1;
5162}
5163
5164/**
5165 * Logs the invalid type when invalid scoped access is requested.
5166 *
5167 * Logged from:
5168 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5169 */
5170message DocsUIInvalidScopedAccessRequestReported {
5171 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005172}
Ben Murdochbab399f62018-12-06 11:01:38 +00005173
5174/**
shawnlina75e82d2019-01-07 10:31:12 +08005175 * Logs the package name that launches docsui picker mode.
5176 *
5177 * Logged from:
5178 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5179 */
5180message DocsUIPickerLaunchedFromReported {
5181 optional string package_name = 1;
5182}
5183
5184/**
5185 * Logs the search type.
5186 *
5187 * Logged from:
5188 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5189 */
5190message DocsUISearchTypeReported {
5191 optional android.stats.docsui.SearchType search_type = 1;
5192}
5193
5194/**
5195 * Logs the search mode.
5196 *
5197 * Logged from:
5198 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5199 */
5200message DocsUISearchModeReported {
5201 optional android.stats.docsui.SearchMode search_mode = 1;
5202}
5203
5204/**
5205 * Logs the pick result information.
5206 *
5207 * Logged from:
5208 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5209 */
5210message DocsUIPickResultReported {
5211 optional int32 total_action_count = 1;
5212 optional int64 duration_millis = 2;
5213 optional int32 file_count= 3;
5214 optional bool is_searching = 4;
5215 optional android.stats.docsui.Root picked_from = 5;
5216 optional android.stats.docsui.MimeType mime_type = 6;
5217 optional int32 repeatedly_pick_times = 7;
5218}
5219
5220/**
Ben Murdochbab399f62018-12-06 11:01:38 +00005221 * Logs when an app's memory is compacted.
5222 *
5223 * Logged from:
5224 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5225 */
5226message AppCompacted {
5227 // The pid of the process being compacted.
5228 optional int32 pid = 1;
5229
5230 // The name of the process being compacted.
5231 optional string process_name = 2;
5232
5233 // The type of compaction.
5234 enum Action {
5235 UNKNOWN = 0;
5236 SOME = 1;
5237 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005238 PERSISTENT = 3;
5239 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00005240 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005241 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00005242
5243 // Total RSS in kilobytes consumed by the process prior to compaction.
5244 optional int64 before_rss_total_kilobytes = 4;
5245
5246 // File RSS in kilobytes consumed by the process prior to compaction.
5247 optional int64 before_rss_file_kilobytes = 5;
5248
5249 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5250 optional int64 before_rss_anon_kilobytes = 6;
5251
5252 // Swap in kilobytes consumed by the process prior to compaction.
5253 optional int64 before_swap_kilobytes = 7;
5254
5255 // Total RSS in kilobytes consumed by the process after compaction.
5256 optional int64 after_rss_total_kilobytes = 8;
5257
5258 // File RSS in kilobytes consumed by the process after compaction.
5259 optional int64 after_rss_file_kilobytes = 9;
5260
5261 // Anonymous RSS in kilobytes consumed by the process after compaction.
5262 optional int64 after_rss_anon_kilobytes = 10;
5263
5264 // Swap in kilobytes consumed by the process after compaction.
5265 optional int64 after_swap_kilobytes = 11;
5266
5267 // The time taken to perform compaction in milliseconds.
5268 optional int64 time_to_compact_millis = 12;
5269
5270 // The last compaction action performed for this app.
5271 optional Action last_action = 13;
5272
Ben Murdoch01720b82018-12-19 18:03:44 +00005273 // The last time that compaction was attempted on this process in milliseconds
5274 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5275 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00005276
Ben Murdoch885c21b2019-03-15 18:02:04 +00005277 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005278 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00005279
5280 // The process state at the time of compaction.
5281 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005282
5283 // Free ZRAM in kilobytes before compaction.
5284 optional int64 before_zram_free_kilobytes = 17;
5285
5286 // Free ZRAM in kilobytes after compaction.
5287 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00005288}
lifr157fc552018-12-12 16:38:04 +08005289
5290/**
lifrb6b90b62019-03-29 00:40:17 +08005291 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5292 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5293 *
lifr1f74b052019-04-16 22:16:30 +08005294 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5295 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5296 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5297 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005298 */
5299message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08005300 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005301
lifr1f74b052019-04-16 22:16:30 +08005302 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005303
5304 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005305 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005306
lifr1f74b052019-04-16 22:16:30 +08005307 // Only valid for event_type = EVENT_GETADDRINFO.
5308 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005309
lifr1f74b052019-04-16 22:16:30 +08005310 // Flags passed to android_res_nsend() defined in multinetwork.h
5311 // Only valid for event_type = EVENT_RESNSEND.
5312 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005313
lifrad9becc2019-05-20 11:04:41 +08005314 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005315
5316 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08005317 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005318
5319 // Additional pass-through fields opaque to statsd.
5320 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08005321 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08005322
5323 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
5324 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08005325}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005326
5327/**
5328 * Logs when a data stall event occurs.
5329 *
5330 * Log from:
5331 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5332 */
5333message DataStallEvent {
5334 // Data stall evaluation type.
5335 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5336 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5337 optional int32 evaluation_type = 1;
5338 // See definition in data_stall_event.proto.
5339 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5340 // See definition in data_stall_event.proto.
5341 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5342 // See definition in data_stall_event.proto.
5343 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5344 // See definition in data_stall_event.proto.
5345 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5346 // See definition in data_stall_event.proto.
5347 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5348}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005349
5350/*
5351 * Logs when RescueParty resets some set of experiment flags.
5352 *
5353 * Logged from:
5354 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5355 */
5356message RescuePartyResetReported {
5357 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5358 optional int32 rescue_level = 1;
5359}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005360
5361/**
5362 * Logs when signed config is received from an APK, and if that config was applied successfully.
5363 * Logged from:
5364 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5365 */
5366message SignedConfigReported {
5367 enum Type {
5368 UNKNOWN_TYPE = 0;
5369 GLOBAL_SETTINGS = 1;
5370 }
5371 optional Type type = 1;
5372
5373 // The final status of the signed config received.
5374 enum Status {
5375 UNKNOWN_STATUS = 0;
5376 APPLIED = 1;
5377 BASE64_FAILURE_CONFIG = 2;
5378 BASE64_FAILURE_SIGNATURE = 3;
5379 SECURITY_EXCEPTION = 4;
5380 INVALID_CONFIG = 5;
5381 OLD_CONFIG = 6;
5382 SIGNATURE_CHECK_FAILED = 7;
5383 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005384 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005385 }
5386 optional Status status = 2;
5387
5388 // The version of the signed config processed.
5389 optional int32 version = 3;
5390
5391 // The package name that the config was extracted from.
5392 optional string from_package = 4;
5393
5394 enum Key {
5395 NO_KEY = 0;
5396 DEBUG = 1;
5397 PRODUCTION = 2;
5398 }
5399 // Which key was used to verify the config.
5400 optional Key verified_with = 5;
5401}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005402
5403/*
5404 * Logs GNSS Network-Initiated (NI) location events.
5405 *
5406 * Logged from:
5407 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5408 */
5409message GnssNiEventReported {
5410 // The type of GnssNiEvent.
5411 enum EventType {
5412 UNKNOWN = 0;
5413 NI_REQUEST = 1;
5414 NI_RESPONSE = 2;
5415 }
5416 optional EventType event_type = 1;
5417
5418 // An ID generated by HAL to associate NI notifications and UI responses.
5419 optional int32 notification_id = 2;
5420
5421 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005422 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005423
5424 // NI requires notification.
5425 optional bool need_notify = 4;
5426
5427 // NI requires verification.
5428 optional bool need_verify = 5;
5429
5430 // NI requires privacy override, no notification/minimal trace.
5431 optional bool privacy_override = 6;
5432
5433 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5434 // seconds.
5435 optional int32 timeout = 7;
5436
5437 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005438 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005439
5440 // String representing the requester of the network inititated location request.
5441 optional string requestor_id = 9;
5442
5443 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5444 // network initiated location request.
5445 optional string text = 10;
5446
5447 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005448 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005449
5450 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005451 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005452
5453 // True if SUPL ES is enabled.
5454 optional bool is_supl_es_enabled = 13;
5455
5456 // True if GNSS location is enabled.
5457 optional bool is_location_enabled = 14;
5458
5459 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005460 optional android.server.location.GnssUserResponseType user_response = 15;
5461}
5462
5463/**
5464 * Logs GNSS non-framework (NFW) location notification.
5465 *
5466 * Logged from:
5467 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5468 */
5469message GnssNfwNotificationReported {
5470 // Package name of the Android proxy application representing the non-framework entity that
5471 // requested location. Set to empty string if unknown.
5472 optional string proxy_app_package_name = 1;
5473
5474 // Protocol stack that initiated the non-framework location request.
5475 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5476
5477 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5478 // set to empty string. This field is opaque to the framework and used for logging purposes.
5479 optional string other_protocol_stack_name = 3;
5480
5481 // Source initiating/receiving the location information.
5482 optional android.server.location.NfwRequestor requestor = 4;
5483
5484 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5485 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5486 // and used for logging purposes.
5487 optional string requestor_id = 5;
5488
5489 // Indicates whether location information was provided for this request.
5490 optional android.server.location.NfwResponseType response_type = 6;
5491
5492 // True if the device is in user initiated emergency session.
5493 optional bool in_emergency_mode = 7;
5494
5495 // True if cached location is provided.
5496 optional bool is_cached_location = 8;
5497
5498 // True if proxy app permission mismatch between framework and GNSS HAL.
5499 optional bool is_permission_mismatched = 9;
5500}
5501
5502/**
5503 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5504 *
5505 * Logged from:
5506 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5507 */
5508message GnssConfigurationReported {
5509 // SUPL host name.
5510 optional string supl_host = 1;
5511
5512 // SUPL port number.
5513 optional int32 supl_port = 2;
5514
5515 // C2K host name.
5516 optional string c2k_host = 3;
5517
5518 // C2K port number.
5519 optional int32 c2k_port = 4;
5520
5521 // The SUPL version requested by Carrier.
5522 optional int32 supl_ver = 5;
5523
5524 // The SUPL mode.
5525 optional android.server.location.SuplMode supl_mode = 6;
5526
5527 // True if NI emergency SUPL restrictions is enabled.
5528 optional bool supl_es = 7;
5529
5530 // LTE Positioning Profile settings
5531 optional android.server.location.LppProfile lpp_profile = 8;
5532
5533 // Positioning protocol on A-Glonass system.
5534 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5535
5536 // True if emergency PDN is used. Otherwise, regular PDN is used.
5537 optional bool use_emergency_pdn_for_emergency_supl= 10;
5538
5539 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5540 optional android.server.location.GpsLock gps_lock = 11;
5541
5542 // Number of seconds to extend the emergency session duration post emergency call.
5543 optional int32 es_extension_sec = 12;
5544
5545 // The full list of package names of proxy Android applications representing the non-framework
5546 // location access entities (on/off the device) for which the framework user has granted
5547 // non-framework location access permission. The package names are concatenated in one string
5548 // with spaces as separators.
5549 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005550}
Jack Yu95b64f32018-12-13 18:26:11 +08005551
5552/**
5553 * Logs when a NFC device's error occurred.
5554 * Logged from:
5555 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5556 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5557 */
5558message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005559 enum Type {
5560 UNKNOWN = 0;
5561 CMD_TIMEOUT = 1;
5562 ERROR_NOTIFICATION = 2;
5563 AID_OVERFLOW = 3;
5564 }
5565 optional Type type = 1;
5566 // If it's nci cmd timeout, log the timeout command.
5567 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005568
Alex Salod7c3eef2019-01-25 14:43:27 -08005569 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005570}
5571
5572/**
5573 * Logs when a NFC device's state changed event
5574 * Logged from:
5575 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5576 */
5577message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005578 enum State {
5579 UNKNOWN = 0;
5580 OFF = 1;
5581 ON = 2;
5582 ON_LOCKED = 3; // Secure Nfc enabled.
5583 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5584 }
5585 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005586}
5587
5588/**
5589 * Logs when a NFC Beam Transaction occurred.
5590 * Logged from:
5591 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5592 */
5593message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005594 enum Operation {
5595 UNKNOWN = 0;
5596 SEND = 1;
5597 RECEIVE = 2;
5598 }
5599 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005600}
5601
5602/**
5603 * Logs when a NFC Card Emulation Transaction occurred.
5604 * Logged from:
5605 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5606 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5607 */
5608message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005609 enum Category {
5610 UNKNOWN = 0;
5611 HCE_PAYMENT = 1;
5612 HCE_OTHER = 2;
5613 OFFHOST = 3;
5614 }
5615 // Transaction belongs to HCE payment or HCE other category, or offhost.
5616 optional Category category = 1;
5617 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5618 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005619}
5620
5621/**
5622 * Logs when a NFC Tag event occurred.
5623 * Logged from:
5624 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5625 */
5626message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005627 enum Type {
5628 UNKNOWN = 0;
5629 URL = 1;
5630 BT_PAIRING = 2;
5631 PROVISION = 3;
5632 WIFI_CONNECT = 4;
5633 APP_LAUNCH = 5;
5634 OTHERS = 6;
5635 }
5636 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005637}
5638
5639/**
5640 * Logs when Hce transaction triggered
5641 * Logged from:
5642 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5643 */
5644message NfcHceTransactionOccurred {
5645 // The latency period(in microseconds) it took for the first HCE data
5646 // exchange.
5647 optional uint32 latency_micros = 1;
5648}
5649
5650/**
5651 * Logs when SecureElement state event changed
5652 * Logged from:
5653 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5654 */
5655message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005656 enum State {
5657 UNKNOWN = 0;
5658 INITIALIZED = 1;
5659 DISCONNECTED = 2;
5660 CONNECTED = 3;
5661 HALCRASH = 4;
5662 }
5663 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005664
Alex Salod7c3eef2019-01-25 14:43:27 -08005665 optional string state_change_reason = 2;
5666 // SIMx or eSEx.
5667 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005668}
5669
5670/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005671 * Information about a permission grant request
5672 */
5673message PermissionGrantRequestResultReported {
5674 // unique value identifying an API call. A API call might result in multiple of these atoms
5675 optional int64 request_id = 1;
5676
5677 // UID of package requesting the permission grant
5678 optional int32 requesting_uid = 2 [(is_uid) = true];
5679
5680 // Name of package requesting the permission grant
5681 optional string requesting_package_name = 3;
5682
5683 // The permission to be granted
5684 optional string permission_name = 4;
5685
5686 // If the permission was explicitly requested via the API or added by the system
5687 optional bool is_implicit = 5;
5688
5689 enum Result {
5690 UNDEFINED = 0;
5691 // permission request was ignored
5692 IGNORED = 1;
5693 // permission request was ignored because it was user fixed
5694 IGNORED_USER_FIXED = 2;
5695 // permission request was ignored because it was policy fixed
5696 IGNORED_POLICY_FIXED = 3;
5697 // permission was granted by user action
5698 USER_GRANTED = 4;
5699 // permission was automatically granted
5700 AUTO_GRANTED = 5;
5701 // permission was denied by user action
5702 USER_DENIED = 6;
5703 // permission was denied with prejudice by the user
5704 USER_DENIED_WITH_PREJUDICE = 7;
5705 // permission was automatically denied
5706 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07005707 // permission request was ignored because permission is restricted
5708 IGNORED_RESTRICTED_PERMISSION = 9;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005709 }
5710 // The result of the permission grant
5711 optional Result result = 6;
5712}
5713
5714/**
Jack Yu95b64f32018-12-13 18:26:11 +08005715 * Logs when Omapi API used
5716 * Logged from:
5717 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5718 */
5719message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005720 enum Operation {
5721 UNKNOWN = 0;
5722 OPEN_CHANNEL = 1;
5723 }
5724 optional Operation operation = 1;
5725 // SIMx or eSEx.
5726 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005727
Alex Salod7c3eef2019-01-25 14:43:27 -08005728 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005729}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005730
5731/**
Alex Saloa060aee2019-01-21 14:36:41 -08005732 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5733 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005734 * Logged from:
5735 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5736 */
5737message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005738 optional int64 dispatch_latency_millis = 1;
5739}
5740
5741/**
5742 * Logs AttentionManagerService attention check result.
5743 *
5744 * Logged from:
5745 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5746 */
5747message AttentionManagerServiceResultReported {
5748 // See core/java/android/service/attention/AttentionService.java
5749 enum AttentionCheckResult {
5750 UNKNOWN = 20;
5751 ATTENTION_SUCCESS_ABSENT = 0;
5752 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07005753 ATTENTION_FAILURE_UNKNOWN = 2;
5754 ATTENTION_FAILURE_CANCELLED = 3;
5755 ATTENTION_FAILURE_PREEMPTED = 4;
5756 ATTENTION_FAILURE_TIMED_OUT = 5;
5757 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08005758 }
5759 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005760}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005761
5762/**
5763 * Logs when an adb connection changes state.
5764 *
5765 * Logged from:
5766 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5767 */
5768message AdbConnectionChanged {
5769 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5770 // previously selected for this system.
5771 optional int64 last_connection_time_millis = 1;
5772
5773 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5774 // to reconnect via adb without user interaction.
5775 optional int64 auth_window_millis = 2;
5776
5777 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5778 optional android.debug.AdbConnectionStateEnum state = 3;
5779
5780 // True if the 'always allow' option was selected for this system.
5781 optional bool always_allow = 4;
5782}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005783
5784/*
5785 * Logs the reported speech DSP status.
5786 *
5787 * Logged from:
5788 * Vendor audio implementation.
5789 */
5790message SpeechDspStatReported {
5791 // The total Speech DSP uptime in milliseconds.
5792 optional int32 total_uptime_millis = 1;
5793 // The total Speech DSP downtime in milliseconds.
5794 optional int32 total_downtime_millis = 2;
5795 optional int32 total_crash_count = 3;
5796 optional int32 total_recover_count = 4;
5797}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005798
5799/**
5800 * Logs USB connector contaminant status.
5801 *
5802 * Logged from: USB Service.
5803 */
5804message UsbContaminantReported {
5805 optional string id = 1;
5806 optional android.service.usb.ContaminantPresenceStatus status = 2;
5807}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005808
5809/**
5810 * This atom is for debugging purpose.
5811 */
5812message DebugElapsedClock {
5813 // Monotically increasing value for each pull.
5814 optional int64 pull_count = 1;
5815 // Time from System.elapsedRealtime.
5816 optional int64 elapsed_clock_millis = 2;
5817 // Time from System.elapsedRealtime.
5818 optional int64 same_elapsed_clock_millis = 3;
5819 // Diff between current elapsed time and elapsed time from previous pull.
5820 optional int64 elapsed_clock_diff_millis = 4;
5821
5822 enum Type {
5823 TYPE_UNKNOWN = 0;
5824 ALWAYS_PRESENT = 1;
5825 PRESENT_ON_ODD_PULLS = 2;
5826 }
5827 // Type of behavior for the pulled data.
5828 optional Type type = 5;
5829}
5830
5831/**
5832 * This atom is for debugging purpose.
5833 */
5834message DebugFailingElapsedClock {
5835 // Monotically increasing value for each pull.
5836 optional int64 pull_count = 1;
5837 // Time from System.elapsedRealtime.
5838 optional int64 elapsed_clock_millis = 2;
5839 // Time from System.elapsedRealtime.
5840 optional int64 same_elapsed_clock_millis = 3;
5841 // Diff between current elapsed time and elapsed time from previous pull.
5842 optional int64 elapsed_clock_diff_millis = 4;
5843}
Steven Wuacef6bb2019-01-23 14:21:17 -05005844
5845/** Logs System UI bubbles event changed.
5846 *
5847 * Logged from:
5848 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5849 */
5850message BubbleUIChanged {
5851
5852 // The app package that is posting the bubble.
5853 optional string package_name = 1;
5854
5855 // The notification channel that is posting the bubble.
5856 optional string notification_channel = 2;
5857
5858 // The notification id associated with the posted bubble.
5859 optional int32 notification_id = 3;
5860
5861 // The position of the bubble within the bubble stack.
5862 optional int32 position = 4;
5863
5864 // The total number of bubbles within the bubble stack.
5865 optional int32 total_number = 5;
5866
5867 // User interactions with the bubble.
5868 enum Action {
5869 UNKNOWN = 0;
5870 POSTED = 1;
5871 UPDATED = 2;
5872 EXPANDED = 3;
5873 COLLAPSED = 4;
5874 DISMISSED = 5;
5875 STACK_DISMISSED = 6;
5876 STACK_MOVED = 7;
5877 HEADER_GO_TO_APP = 8;
5878 HEADER_GO_TO_SETTINGS = 9;
5879 PERMISSION_OPT_IN = 10;
5880 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005881 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005882 SWIPE_LEFT = 13;
5883 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005884 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04005885 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05005886 }
5887 optional Action action = 6;
5888
5889 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5890 optional float normalized_x_position = 7;
5891 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04005892
5893 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
5894 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04005895
5896 // Whether the bubble is an on-going one.
5897 optional bool is_ongoing = 10;
5898
5899 // Whether the bubble is produced by an app running in foreground.
5900 optional bool is_foreground = 11;
Steven Wuacef6bb2019-01-23 14:21:17 -05005901}
Kweku Adams8845d012018-12-11 20:06:45 -08005902
5903/**
Steven Wu552f63f2019-02-05 13:41:36 -05005904 * Logs System UI bubbles developer errors.
5905 *
5906 * Logged from:
5907 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5908 */
5909message BubbleDeveloperErrorReported {
5910
5911 // The app package that is posting the bubble.
5912 optional string package_name = 1;
5913
5914 // Bubble developer error type enums.
5915 enum Error {
5916 UNKNOWN = 0;
5917 ACTIVITY_INFO_MISSING = 1;
5918 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5919 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5920 }
5921 optional Error error = 2 [default = UNKNOWN];
5922}
5923
5924/**
Kweku Adams8845d012018-12-11 20:06:45 -08005925 * Logs that a constraint for a scheduled job has changed.
5926 *
5927 * Logged from:
5928 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5929 */
5930message ScheduledJobConstraintChanged {
5931 repeated AttributionNode attribution_node = 1;
5932
5933 // Name of the job.
5934 optional string job_name = 2;
5935
5936 optional com.android.server.job.ConstraintEnum constraint = 3;
5937
5938 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08005939 UNKNOWN = 0;
5940 UNSATISFIED = 1;
5941 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08005942 }
5943 optional State state = 4;
5944}
Alex Salod7c3eef2019-01-25 14:43:27 -08005945
5946/**
5947 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5948 * returns true.
5949 *
5950 * Logged from:
5951 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5952 */
5953message ScreenTimeoutExtensionReported {
5954 // Describes how many times in a row did the power manager reset the screen off timeout.
5955 optional uint32 consecutive_timeout_extended_count = 1;
5956}
Hui Yu885aca12019-01-10 17:11:34 -08005957
5958/*
5959* Logs number of milliseconds it takes to start a process.
5960* The definition of app process start time is from the app launch time to
5961* the time that Zygote finished forking the app process and loaded the
5962* application package's java classes.
5963
5964* This metric is different from AppStartOccurred which is for foreground
5965* activity only.
5966
5967* ProcessStartTime can report all processes (both foreground and background)
5968* start time.
5969*
5970* Logged from:
5971* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5972*/
5973message ProcessStartTime {
5974 // The uid of the ProcessRecord.
5975 optional int32 uid = 1 [(is_uid) = true];
5976
5977 // The process pid.
5978 optional int32 pid = 2;
5979
5980 // The process name.
5981 // Usually package name, "system" for system server.
5982 // Provided by ActivityManagerService.
5983 optional string process_name = 3;
5984
5985 enum StartType {
5986 UNKNOWN = 0;
5987 WARM = 1;
5988 HOT = 2;
5989 COLD = 3;
5990 }
5991
5992 // The start type.
5993 optional StartType type = 4;
5994
5995 // The elapsed realtime at the start of the process.
5996 optional int64 process_start_time_millis = 5;
5997
5998 // Number of milliseconds it takes to reach bind application.
5999 optional int32 bind_application_delay_millis = 6;
6000
6001 // Number of milliseconds it takes to finish start of the process.
6002 optional int32 process_start_delay_millis = 7;
6003
6004 // hostingType field in ProcessRecord, the component type such as "activity",
6005 // "service", "content provider", "broadcast" or other strings.
6006 optional string hosting_type = 8;
6007
6008 // hostingNameStr field in ProcessRecord. The component class name that runs
6009 // in this process.
6010 optional string hosting_name = 9;
6011}
6012
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006013/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006014 * Track Media Codec usage
6015 * Logged from:
6016 * frameworks/av/media/libstagefright/MediaCodec.cpp
6017 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6018 */
6019message MediametricsCodecReported {
6020 optional int64 timestamp_nanos = 1;
6021 optional string package_name = 2;
6022 optional int64 package_version_code = 3;
6023 optional int64 media_apex_version = 4;
6024
6025 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6026}
6027
6028/**
6029 * Track Media Extractor (pulling video/audio streams out of containers) usage
6030 * Logged from:
6031 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6032 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6033 */
6034message MediametricsExtractorReported {
6035 optional int64 timestamp_nanos = 1;
6036 optional string package_name = 2;
6037 optional int64 package_version_code = 3;
6038 optional int64 media_apex_version = 4;
6039
6040 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6041}
6042
6043/**
6044 * Track how we arbitrate between microphone/input requests.
6045 * Logged from
6046 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6047 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6048 */
6049message MediametricsAudiopolicyReported {
6050 optional int64 timestamp_nanos = 1;
6051 optional string package_name = 2;
6052 optional int64 package_version_code = 3;
6053 optional int64 media_apex_version = 4;
6054
6055 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6056}
6057
6058/**
6059 * Track how we arbitrate between microphone requests.
6060 * Logged from
6061 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6062 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6063 */
6064message MediametricsAudiorecordReported {
6065 optional int64 timestamp_nanos = 1;
6066 optional string package_name = 2;
6067 optional int64 package_version_code = 3;
6068 optional int64 media_apex_version = 4;
6069
6070 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6071}
6072
6073/**
6074 * Track how we arbitrate between microphone/input requests.
6075 * Logged from
6076 * frameworks/av/media/libnblog/ReportPerformance.cpp
6077 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6078 */
6079message MediametricsAudiothreadReported {
6080 optional int64 timestamp_nanos = 1;
6081 optional string package_name = 2;
6082 optional int64 package_version_code = 3;
6083 optional int64 media_apex_version = 4;
6084
6085 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6086}
6087
6088/**
6089 * Track how we arbitrate between microphone/input requests.
6090 * Logged from
6091 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6092 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6093 */
6094message MediametricsAudiotrackReported {
6095 optional int64 timestamp_nanos = 1;
6096 optional string package_name = 2;
6097 optional int64 package_version_code = 3;
6098 optional int64 media_apex_version = 4;
6099
6100 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6101}
6102
6103/**
6104 * Track information about DRM framework performance
6105 * Logged from
6106 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6107 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6108 */
6109message MediametricsMediadrmReported {
6110 optional int64 timestamp_nanos = 1;
6111 optional string package_name = 2;
6112 optional int64 package_version_code = 3;
6113 optional int64 media_apex_version = 4;
6114
6115 // vendor+description tell about which DRM plugin is in use on this device
6116 optional string vendor = 5;
6117 optional string description = 6;
6118 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6119 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6120}
6121
6122/**
6123 * Track information about the widevine DRM plugin performance
6124 * Logged from
6125 * vendor/widevine/libwvdrmengine/cdm/metrics
6126 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6127 */
6128message MediametricsDrmWidevineReported {
6129 optional int64 timestamp_nanos = 1;
6130 optional string package_name = 2;
6131 optional int64 package_version_code = 3;
6132 optional int64 media_apex_version = 4;
6133
6134 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6135}
6136
6137/**
6138 * Track information about recordings (e.g. camcorder)
6139 * Logged from
6140 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6141 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6142 */
6143message MediametricsRecorderReported {
6144 optional int64 timestamp_nanos = 1;
6145 optional string package_name = 2;
6146 optional int64 package_version_code = 3;
6147 optional int64 media_apex_version = 4;
6148
6149 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6150}
6151
6152/**
6153 * Track Media Player usage
6154 * Logged from:
6155 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6156 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6157 */
6158message MediametricsNuPlayerReported {
6159 optional int64 timestamp_nanos = 1;
6160 optional string package_name = 2;
6161 optional int64 package_version_code = 3;
6162 optional int64 media_apex_version = 4;
6163
6164 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6165}
6166
6167/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006168 * State of a dangerous permission requested by a package
6169 */
6170message DangerousPermissionState {
6171 // Name of the permission
6172 optional string permission_name = 1;
6173
6174 // Uid of the package
6175 optional int32 uid = 2 [(is_uid) = true];
6176
6177 // Package requesting the permission
6178 optional string package_name = 3;
6179
6180 // If the permission is granted to the uid
6181 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01006182
6183 // Permission flags as per android.content.pm.PermissionFlags
6184 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006185}
6186
Michael Groover4a0ca942019-01-24 17:41:25 -08006187/**
6188 * Logs when a package is denied access to a device identifier based on the new access requirements.
6189 *
6190 * Logged from:
6191 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6192 */
6193message DeviceIdentifierAccessDenied {
6194 // The name of the package denied access to the requested device identifier.
6195 optional string package_name = 1;
6196
6197 // The name of the device identifier method the package attempted to invoke.
6198 optional string method_name = 2;
6199
6200 // True if the package is preinstalled.
6201 optional bool is_preinstalled = 3;
6202
6203 // True if the package is privileged.
6204 optional bool is_priv_app = 4;
6205}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006206
6207/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006208 * Pulls the ongoing mainline install train version code.
6209 * Pulled from StatsCompanionService
6210 */
6211message TrainInfo {
6212 optional int64 train_version_code = 1;
6213
6214 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006215
6216 optional string train_name = 3;
6217
6218 enum Status {
6219 UNKNOWN = 0;
6220 INSTALL_REQUESTED = 1;
6221 INSTALL_STARTED = 2;
6222 INSTALL_STAGED_NOT_READY = 3;
6223 INSTALL_STAGED_READY = 4;
6224 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006225 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6226 // and INSTALL_FAILURE_COMMIT.
6227 INSTALL_FAILURE = 6 [deprecated = true];
6228 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006229 INSTALL_CANCELLED = 7;
6230 INSTALLER_ROLLBACK_REQUESTED = 8;
6231 INSTALLER_ROLLBACK_INITIATED = 9;
6232 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6233 INSTALLER_ROLLBACK_STAGED = 11;
6234 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6235 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6236 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6237 INSTALLER_ROLLBACK_SUCCESS = 15;
6238 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006239 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6240 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6241 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6242 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6243 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6244 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006245 INSTALL_FAILURE_DOWNLOAD = 23;
6246 INSTALL_FAILURE_STATE_MISMATCH = 24;
6247 INSTALL_FAILURE_COMMIT = 25;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006248 }
6249 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006250}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006251
6252/**
6253 * Logs the gesture stage changed event.
6254 *
6255 * Logged from:
6256 * frameworks/base/packages/SystemUI/
6257 */
6258message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006259 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006260}
6261
6262/**
6263 * Logs the feedback type.
6264 *
6265 * Logged from:
6266 * frameworks/base/packages/SystemUI/
6267 */
6268message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006269 // Whether or not the gesture was used.
6270 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006271}
6272
6273/**
6274 * Logs the progress.
6275 *
6276 * Logged from:
6277 * frameworks/base/packages/SystemUI/
6278 */
6279message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006280 // [0,100] progress for the assist gesture.
6281 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006282}
Neil Fullerdb14b482019-02-05 19:44:44 +00006283
6284/*
6285 * Information about the time zone data on a device.
6286 */
6287message TimeZoneDataInfo {
6288 // A version identifier for the data set on device. e.g. "2018i"
6289 optional string tzdb_version = 1;
6290}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006291
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006292/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006293 * Logs the GPU stats global health information.
6294 *
6295 * Logged from:
6296 * frameworks/native/services/gpuservice/gpustats/
6297 */
6298message GpuStatsGlobalInfo {
6299 // Package name of the gpu driver.
6300 optional string driver_package_name = 1;
6301
6302 // Version name of the gpu driver.
6303 optional string driver_version_name = 2;
6304
6305 // Version code of the gpu driver.
6306 optional int64 driver_version_code = 3;
6307
6308 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
6309 optional int64 driver_build_time = 4;
6310
6311 // Total count of the gl driver gets loaded.
6312 optional int64 gl_loading_count = 5;
6313
6314 // Total count of the gl driver fails to be loaded.
6315 optional int64 gl_loading_failure_count = 6;
6316
6317 // Total count of the Vulkan driver gets loaded.
6318 optional int64 vk_loading_count = 7;
6319
6320 // Total count of the Vulkan driver fails to be loaded.
6321 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07006322
6323 // Api version of the system Vulkan driver.
6324 optional int32 vulkan_version = 9;
6325
6326 // Api version of the system CPU Vulkan driver.
6327 optional int32 cpu_vulkan_version = 10;
6328
6329 // Api version of the system GLES driver.
6330 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006331
6332 // Total count of the angle driver gets loaded.
6333 optional int64 angle_loading_count = 12;
6334
6335 // Total count of the angle driver fails to be loaded.
6336 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006337}
6338
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006339/**
6340 * GPU driver loading time info.
6341 */
6342message GpuDriverLoadingTime {
6343 // List of all the driver loading times for this app. The list size is
6344 // capped at 50.
6345 repeated int64 driver_loading_time = 1;
6346}
6347
6348/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006349 * Logs the GPU stats per app health information.
6350 *
6351 * Logged from:
6352 * frameworks/native/services/gpuservice/gpustats/
6353 */
6354message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006355 // Package name of the application that loads the gpu driver. Total number
6356 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006357 optional string app_package_name = 1;
6358
6359 // Version code of the gpu driver this app loads.
6360 optional int64 driver_version_code = 2;
6361
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006362 // gl driver loading time info.
6363 optional GpuDriverLoadingTime gl_driver_loading_time = 3
6364 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006365
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006366 // Vulkan driver loading time info.
6367 optional GpuDriverLoadingTime vk_driver_loading_time = 4
6368 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006369
6370 // Angle driver loading time info.
6371 optional GpuDriverLoadingTime angle_driver_loading_time = 5
6372 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07006373
6374 // CPU Vulkan implementation is in use.
6375 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07006376
6377 // App is not doing pre-rotation correctly.
6378 optional bool false_prerotation = 7;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006379}
Rafal Slawikd4e87572019-03-12 13:08:38 +00006380
6381/*
6382 * Logs the size of the system ion heap.
6383 *
6384 * Pulled from StatsCompanionService.
6385 */
6386message SystemIonHeapSize {
6387 // Size of the system ion heap in bytes.
6388 optional int64 size_in_bytes = 1;
6389}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006390
Rafal Slawik77987ed2019-06-17 12:28:23 +01006391/*
6392 * Logs the per-process size of the system ion heap.
6393 *
6394 * Pulled from StatsCompanionService.
6395 */
6396message ProcessSystemIonHeapSize {
6397 // The uid if available. -1 means not available.
6398 optional int32 uid = 1 [(is_uid) = true];
6399
6400 // The process name (from /proc/PID/cmdline).
6401 optional string process_name = 2;
6402
6403 // Sum of sizes of all allocations.
6404 optional int32 total_size_in_kilobytes = 3;
6405
6406 // Number of allocations.
6407 optional int32 allocation_count = 4;
6408
6409 // Size of the largest allocation.
6410 optional int32 max_size_in_kilobytes = 5;
6411}
6412
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006413/**
6414 * Push network stack events.
6415 *
6416 * Log from:
6417 * frameworks/base/packages/NetworkStack/
6418 */
6419message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08006420 // The id that indicates the event reported from NetworkStack.
6421 optional int32 event_id = 1;
6422 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006423 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
6424}
Carmen Agimofa769c152019-03-04 14:39:14 +00006425
6426/**
6427 * Logs the apps that are installed on the external storage.
6428 * Pulled from:
6429 * StatsCompanionService
6430 */
6431message AppsOnExternalStorageInfo {
6432 // The type of the external storage.
6433 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
6434 // The name of the package that is installed on the external storage.
6435 optional string package_name = 2;
6436}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07006437
6438/**
6439 * Logs the settings related to Face.
6440 * Logged from:
6441 * frameworks/base/services/core/java/com/android/server/stats
6442 */
6443message FaceSettings {
6444 // Whether or not face unlock is allowed on Keyguard.
6445 optional bool unlock_keyguard_enabled = 1;
6446 // Whether or not face unlock dismisses the Keyguard.
6447 optional bool unlock_dismisses_keyguard = 2;
6448 // Whether or not face unlock requires attention.
6449 optional bool unlock_attention_required = 3;
6450 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
6451 optional bool unlock_app_enabled = 4;
6452 // Whether or not face unlock always requires user confirmation.
6453 optional bool unlock_always_require_confirmation = 5;
6454 // Whether or not a diverse set of poses are required during enrollment.
6455 optional bool unlock_diversity_required = 6;
6456}
Maggie White442b6312019-04-05 16:26:44 -07006457
6458/**
6459 * Logs cooling devices maintained by the kernel.
6460 *
6461 * Pulled from StatsCompanionService.java
6462 */
6463message CoolingDevice {
6464 // The type of cooling device being reported. Eg. CPU, GPU...
6465 optional android.os.CoolingTypeEnum device_location = 1;
6466 // The name of the cooling device source. Eg. CPU0
6467 optional string device_name = 2;
6468 // Current throttle state of the cooling device. The value can any unsigned
6469 // integer between 0 and max_state defined in its driver. 0 means device is
6470 // not in throttling, higher value means deeper throttling.
6471 optional int32 state = 3;
6472}
Ben Blount763a5d52019-04-10 11:48:58 -07006473
6474/**
6475 * Intelligence has several counter-type events that don't warrant a
6476 * full separate atom. These are primarily API call counters but also include
6477 * counters for feature usage and specific failure modes.
6478 *
6479 * Logged from the Intelligence mainline module.
6480 */
6481message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07006482 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07006483 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07006484 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07006485 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07006486 // How many times the event occured (to report a batch of high frequency events).
6487 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07006488 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07006489 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07006490}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07006491
6492/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07006493 * Logs when Car Power state changed.
6494 *
6495 * Logged from:
6496 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6497 */
6498message CarPowerStateChanged {
6499 // States come from CpmsState in CarPowerManagementService.java.
6500 enum State {
6501 WAIT_FOR_VHAL = 0;
6502 ON = 1;
6503 SHUTDOWN_PREPARE = 2;
6504 WAIT_FOR_FINISH = 3;
6505 SUSPEND = 4;
6506 SIMULATE_SLEEP = 5;
6507 }
6508 optional State state = 1;
6509}
6510
6511/**
6512 * Logs whether GarageMode is entered.
6513 *
6514 * Logged from:
6515 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6516 */
6517message GarageModeInfo {
6518 // Whether GarageMode is entered.
6519 optional bool is_garage_mode = 1;
6520}
Martijn Coenencd95d462019-04-25 17:09:45 +02006521
6522/**
6523 * Historical app ops data per package.
6524 */
6525message AppOps {
6526 // Uid of the package requesting the op
6527 optional int32 uid = 1 [(is_uid) = true];
6528
6529 // Nmae of the package performing the op
6530 optional string package_name = 2;
6531
6532 // operation id; maps to the OP_* constants in AppOpsManager.java
6533 optional int32 op_id = 3;
6534
6535 // The number of times the op was granted while the app was in the
6536 // foreground (only for trusted requests)
6537 optional int64 trusted_foreground_granted_count = 4;
6538
6539 // The number of times the op was granted while the app was in the
6540 // background (only for trusted requests)
6541 optional int64 trusted_background_granted_count = 5;
6542
6543 // The number of times the op was rejected while the app was in the
6544 // foreground (only for trusted requests)
6545 optional int64 trusted_foreground_rejected_count = 6;
6546
6547 // The number of times the op was rejected while the app was in the
6548 // background (only for trusted requests)
6549 optional int64 trusted_background_rejected_count = 7;
6550
6551 // For long-running operations, total duration of the operation
6552 // while the app was in the foreground (only for trusted requests)
6553 optional int64 trusted_foreground_duration_millis = 8;
6554
6555 // For long-running operations, total duration of the operation
6556 // while the app was in the background (only for trusted requests)
6557 optional int64 trusted_background_duration_millis = 9;
6558}
Hongyi Zhang700137e2019-05-23 21:19:36 -07006559
6560/**
6561 * Location Manager API Usage information(e.g. API under usage,
6562 * API call's parameters).
6563 * Logged from:
6564 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
6565 */
6566message LocationManagerApiUsageReported {
6567
6568 // Indicating if usage starts or usage ends.
6569 optional android.stats.location.UsageState state = 1;
6570
6571 // LocationManagerService's API in use.
6572 // We can identify which API from LocationManager is
6573 // invoking current LMS API by the combination of
6574 // API parameter(e.g. is_listener_null, is_intent_null,
6575 // is_location_request_null)
6576 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
6577
6578 // Name of the package calling the API.
6579 optional string calling_package_name = 3;
6580
6581 // Type of the location provider.
6582 optional android.stats.location.ProviderType provider = 4;
6583
6584 // Quality of the location request
6585 optional android.stats.location.LocationRequestQuality quality = 5;
6586
6587 // The desired interval for active location updates, in milliseconds.
6588 // Bucketized to reduce cardinality.
6589 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
6590
6591 // Minimum distance between location updates, in meters.
6592 // Bucketized to reduce cardinality.
6593 optional android.stats.location.SmallestDisplacementBucket
6594 bucketized_smallest_displacement = 7;
6595
6596 // The number of location updates.
6597 optional int64 num_updates = 8;
6598
6599 // The request expiration time, in millisecond since boot.
6600 // Bucketized to reduce cardinality.
6601 optional android.stats.location.ExpirationBucket
6602 bucketized_expire_in = 9;
6603
6604 // Type of Callback passed in for this API.
6605 optional android.stats.location.CallbackType callback_type = 10;
6606
6607 // The radius of the central point of the alert
6608 // region, in meters. Only for API REQUEST_GEOFENCE.
6609 // Bucketized to reduce cardinality.
6610 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
6611
6612 // Activity Importance of API caller.
6613 // Categorized to 3 types that are interesting from location's perspective.
6614 optional android.stats.location.ActivityImportance activiy_importance = 12;
6615}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01006616
6617/**
6618 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
6619 */
6620message ReviewPermissionsFragmentResultReported {
6621 // unique value identifying a permission group change. A permission group change might result
6622 // in multiple of these atoms
6623 optional int64 change_id = 1;
6624
6625 // UID of package the permission belongs to
6626 optional int32 uid = 2 [(is_uid) = true];
6627
6628 // Name of package the permission belongs to
6629 optional string package_name = 3;
6630
6631 // The permission to be granted
6632 optional string permission_name = 4;
6633
6634 // The result of the permission grant
6635 optional bool permission_granted = 5;
6636}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01006637
6638/**
6639* Information about results of permission upgrade by RuntimePermissionsUpgradeController
6640* Logged from: RuntimePermissionUpdgradeController
6641*/
6642message RuntimePermissionsUpgradeResult {
6643 // Permission granted as result of upgrade
6644 optional string permission_name = 1;
6645
6646 // UID of package granted permission
6647 optional int32 uid = 2 [(is_uid) = true];
6648
6649 // Name of package granted permission
6650 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01006651}
6652
6653/**
6654* Information about a buttons presented in GrantPermissionsActivty and choice made by user
6655*/
6656message GrantPermissionsActivityButtonActions {
6657 // Permission granted as result of upgrade
6658 optional string permission_group_name = 1;
6659
6660 // UID of package granted permission
6661 optional int32 uid = 2 [(is_uid) = true];
6662
6663 // Name of package requesting permission
6664 optional string package_name = 3;
6665
6666 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
6667 // LABEL_ constants in GrantPermissionActivity.java
6668 optional int32 buttons_presented = 4;
6669
6670 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
6671 optional int32 button_clicked = 5;
6672}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01006673
6674/**
6675 * Information about LocationAccessCheck notification presented to user
6676 */
6677message LocationAccessCheckNotificationAction {
6678
6679 // id which identifies single session of user interacting with permission controller
6680 optional int64 session_id = 1;
6681
6682 // Uid of package for which location access check is presented
6683 optional int32 package_uid = 2;
6684
6685 // Name of package for which location access check is presented
6686 optional string package_name = 3;
6687
6688 enum Result {
6689 UNDEFINED = 0;
6690 // notification was presented to the user
6691 NOTIFICATION_PRESENTED = 1;
6692 // notification was declined by the user
6693 NOTIFICATION_DECLINED = 2;
6694 // notification was clicked by the user
6695 NOTIFICATION_CLICKED = 3;
6696 }
6697
6698 // View / interaction recorded
6699 optional Result result = 4;
6700}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01006701
6702/**
6703 * Information about a permission grant or revoke made by user inside AppPermissionFragment
6704 */
6705message AppPermissionFragmentActionReported {
6706 // id which identifies single session of user interacting with permission controller
6707 optional int64 session_id = 1;
6708
6709 // unique value identifying a permission group change. A permission group change might result
6710 // in multiple of these atoms
6711 optional int64 change_id = 2;
6712
6713 // UID of package the permission belongs to
6714 optional int32 uid = 3 [(is_uid) = true];
6715
6716 // Name of package the permission belongs to
6717 optional string package_name = 4;
6718
6719 // The permission to be granted
6720 optional string permission_name = 5;
6721
6722 // The result of the permission grant
6723 optional bool permission_granted = 6;
6724}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01006725
6726/**
6727* Information about a AppPermissionFragment viewed by user
6728*/
6729message AppPermissionFragmentViewed {
6730 // id which identifies single session of user interacting with permission controller
6731 optional int64 session_id = 1;
6732
6733 // UID of package for which permissions are viewed
6734 optional int32 uid = 2 [(is_uid) = true];
6735
6736 // Name of package for which permissions are viewed
6737 optional string package_name = 3;
6738
6739 // Permission group viewed
6740 optional string permission_group_name = 4;
6741}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01006742
6743/**
6744* Information about a AppPermissionsFragment viewed by user
6745*/
6746message AppPermissionsFragmentViewed {
6747 // id which identifies single session of user interacting with permission controller
6748 optional int64 session_id = 1;
6749
6750 // id which identifies single view as every view might have several logging records
6751 // with different package information attached
6752 optional int64 view_id = 2;
6753
6754 // Permission group viewed
6755 optional string permission_group_name = 3;
6756
6757 // UID of package for which permissions are viewed
6758 optional int32 uid = 4 [(is_uid) = true];
6759
6760 // Name of package for which permissions are viewed
6761 optional string package_name = 5;
6762
6763 // Category in which permission is included
6764 enum Category {
6765 UNDEFINED = 0;
6766 ALLOWED = 1;
6767 ALLOWED_FOREGROUND = 2;
6768 DENIED = 3;
6769 }
6770 optional Category category = 6;
6771}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01006772
6773/**
6774* Information about a PermissionAppsFragment viewed by user.
6775* Logged from ui/handheld/PermissionAppsFragment.java
6776*/
6777message PermissionAppsFragmentViewed {
6778 // id which identifies single session of user interacting with permission controller
6779 optional int64 session_id = 1;
6780
6781 // id which identifies single view as every view might have several logging records
6782 // with different package information attached
6783 optional int64 view_id = 2;
6784
6785 // Permission group viewed
6786 optional string permission_group_name = 3;
6787
6788 // UID of package for which permissions are viewed
6789 optional int32 uid = 4 [(is_uid) = true];
6790
6791 // Name of package for which permissions are viewed
6792 optional string package_name = 5;
6793
6794 // Category in which app is included
6795 enum Category {
6796 UNDEFINED = 0;
6797 ALLOWED = 1;
6798 ALLOWED_FOREGROUND = 2;
6799 DENIED = 3;
6800 }
6801 optional Category category = 6;
6802}
Tony Make2b1b672019-07-29 16:59:47 +01006803
6804/**
6805 * Logs when there is a smart selection related event.
6806 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
6807 * Logged from: TextClassifierEventLogger.java
6808 */
6809message TextSelectionEvent {
6810 // A session ID.
6811 optional string session_id = 1;
6812
6813 // Event type of this event.
6814 optional android.stats.textclassifier.EventType event_type = 2;
6815
6816 // Name of the model that is involved in this event.
6817 optional string model_name = 3;
6818
6819 // Type of widget that was involved in triggering this event.
6820 optional android.stats.textclassifier.WidgetType widget_type = 4;
6821
6822 // Index of this event in a session.
6823 optional int32 event_index = 5;
6824
6825 // Entity type that is involved.
6826 optional string entity_type = 6;
6827
6828 // Relative word index of the start of the selection.
6829 optional int32 relative_word_start_index = 7;
6830
6831 // Relative word (exclusive) index of the end of the selection.
6832 optional int32 relative_word_end_index = 8;
6833
6834 // Relative word index of the start of the smart selection.
6835 optional int32 relative_suggested_word_start_index = 9;
6836
6837 // Relative word (exclusive) index of the end of the smart selection.
6838 optional int32 relative_suggested_word_end_index = 10;
6839}
6840
6841/**
6842 * Logs when there is a smart linkify related event.
6843 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
6844 * Logged from: TextClassifierEventLogger.java
6845 */
6846message TextLinkifyEvent {
6847 // A session ID.
6848 optional string session_id = 1;
6849
6850 // Event type of this event.
6851 optional android.stats.textclassifier.EventType event_type = 2;
6852
6853 // Name of the model that is involved in this event.
6854 optional string model_name = 3;
6855
6856 // Type of widget that was involved in triggering this event.
6857 optional android.stats.textclassifier.WidgetType widget_type = 4;
6858
6859 // Index of this event in a session.
6860 optional int32 event_index = 5;
6861
6862 // Entity type that is involved.
6863 optional string entity_type = 6;
6864
6865 // Number of links detected.
6866 optional int32 num_links = 7;
6867
6868 // The total length of all links.
6869 optional int32 linked_text_length = 8;
6870
6871 // Length of input text.
6872 optional int32 text_length = 9;
6873
6874 // Time spent on generating links in ms.
6875 optional int64 latency_millis = 10;
6876}
6877
6878/**
6879 * Logs when there is a conversation actions related event.
6880 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
6881 * Logged from: TextClassifierEventLogger.java
6882 */
6883message ConversationActionsEvent {
6884 // A session ID.
6885 optional string session_id = 1;
6886
6887 // Event type of this event.
6888 optional android.stats.textclassifier.EventType event_type = 2;
6889
6890 // Name of the model that is involved in this event.
6891 optional string model_name = 3;
6892
6893 // Type of widget that was involved in triggering this event.
6894 optional android.stats.textclassifier.WidgetType widget_type = 4;
6895
6896 // The first entity type that is involved.
6897 optional string first_entity_type = 5;
6898
6899 // The second entity type that is involved.
6900 optional string second_entity_type = 6;
6901
6902 // The third entity type that is involved.
6903 optional string third_entity_type = 7;
6904
6905 // The score of the first entity type.
6906 optional float score = 8;
6907}
6908
6909/**
6910 * Logs when there is a language detection related event.
6911 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
6912 * Logged from: TextClassifierEventLogger.java
6913 */
6914message LanguageDetectionEvent {
6915 // A session ID.
6916 optional string session_id = 1;
6917
6918 // Event type of this event.
6919 optional android.stats.textclassifier.EventType event_type = 2;
6920
6921 // Name of the model that is involved in this event.
6922 optional string model_name = 3;
6923
6924 // Type of widget that was involved in triggering this event.
6925 optional android.stats.textclassifier.WidgetType widget_type = 4;
6926
6927 // Detected language.
6928 optional string language_tag = 5;
6929
6930 // Score of the detected language.
6931 optional float score = 6;
6932
6933 // Position of this action.
6934 optional int32 action_index = 7;
6935}