blob: 8986c6fd02c21ae9a11128125e1aed600b5b5532 [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";
Fan Zhangf837b8e2018-10-23 12:38:30 -070025import "frameworks/base/core/proto/android/app/settings_enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070026import "frameworks/base/core/proto/android/app/job/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";
lifrb6b90b62019-03-29 00:40:17 +080044import "frameworks/base/core/proto/android/stats/connectivity/resolv_stats.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070045import "frameworks/base/core/proto/android/stats/enums.proto";
shawnlinea5b66b2018-11-13 15:05:29 +080046import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080047import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
48import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070049import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000050import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080051import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080052import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080053import "frameworks/base/core/proto/android/telephony/enums.proto";
54import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080055import "frameworks/base/core/proto/android/wifi/enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080056
Yao Chend54f9dd2017-10-17 17:37:48 +000057/**
Stefan Lafonae2df012017-11-14 09:17:21 -080058 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000059 * raw stats log events from the Android system, also known as "atoms."
60 *
61 * This field contains a single oneof with all of the available messages.
62 * The stats-log-api-gen tool runs as part of the Android build and
63 * generates the android.util.StatsLog class, which contains the constants
64 * and methods that Android uses to log.
65 *
Stefan Lafonae2df012017-11-14 09:17:21 -080066 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000067 * Instead, statsd on Android constructs these messages synthetically,
68 * in the format defined here and in stats_log.proto.
69 */
Stefan Lafonae2df012017-11-14 09:17:21 -080070message Atom {
71 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070072 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070073 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
74 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070075 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070076 BleScanResultReceived ble_scan_result_received = 4;
77 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080078 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070079 SyncStateChanged sync_state_changed = 7;
80 ScheduledJobStateChanged scheduled_job_state_changed = 8;
81 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070082 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080083 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
84 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
85 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070086 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
87 MemoryFactorStateChanged memory_factor_state_changed = 15;
88 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
89 CachedKillReported cached_kill_reported = 17;
90 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070091 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080092 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
93 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
94 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070095 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080096 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070097 CameraStateChanged camera_state_changed = 25;
98 FlashlightStateChanged flashlight_state_changed = 26;
99 UidProcessStateChanged uid_process_state_changed = 27;
100 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
101 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -0700102 BatteryLevelChanged battery_level_changed = 30;
103 ChargingStateChanged charging_state_changed = 31;
104 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -0700105 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800106 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -0700107 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
108 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -0700109 WifiLockStateChanged wifi_lock_state_changed = 37;
110 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
111 WifiScanStateChanged wifi_scan_state_changed = 39;
112 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700113 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700114 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700115 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900116 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700117 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800118 AnomalyDetected anomaly_detected = 46;
Andrei Oneada01ea52019-01-30 15:28:36 +0000119 AppBreadcrumbReported app_breadcrumb_reported = 47 [(allow_from_any_uid) = true];
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800120 AppStartOccurred app_start_occurred = 48;
121 AppStartCanceled app_start_canceled = 49;
122 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800123 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800124 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800125 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800126 LmkStateChanged lmk_state_changed = 54;
127 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800128 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800129 BootSequenceReported boot_sequence_reported = 57;
Andrei Oneada01ea52019-01-30 15:28:36 +0000130 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -0800131 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800132 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800133 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800134 KeyguardStateChanged keyguard_state_changed = 62;
135 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
136 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800137 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800138 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800139 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
140 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800141 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700142 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800143 SpeakerImpedanceReported speaker_impedance_reported = 71;
144 HardwareFailed hardware_failed = 72;
145 PhysicalDropDetected physical_drop_detected = 73;
146 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800147 MobileConnectionStateChanged mobile_connection_state_changed = 75;
148 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700149 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800150 AppCrashOccurred app_crash_occurred = 78;
151 ANROccurred anr_occurred = 79;
152 WTFOccurred wtf_occurred = 80;
153 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700154 GenericAtom generic_atom = 82;
jianjin6eada302019-02-28 11:25:57 -0800155 KeyValuePairsAtom key_value_pairs_atom = 83 [(allow_from_any_uid) = true];
Bookatza7020bd2018-08-28 16:29:35 -0700156 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700157 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700158 ThermalThrottlingStateChanged thermal_throttling = 86;
Kevin Chyn1741a072019-01-17 11:54:40 -0800159 BiometricAcquired biometric_acquired = 87;
160 BiometricAuthenticated biometric_authenticated = 88;
161 BiometricErrorOccurred biometric_error_occurred = 89;
Howard Ro688ae182018-09-25 00:09:36 -0700162 Notification notification = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700163 BatteryHealthSnapshot battery_health_snapshot = 91;
164 SlowIo slow_io = 92;
165 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700166 PhoneServiceStateChanged phone_service_state_changed = 94;
167 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100168 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700169 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700170 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700171 // TODO: service state change is very noisy shortly after boot, as well
172 // as at other transitions - coming out of doze, device plugged in, etc.
173 // Consider removing this if it becomes a problem
174 ServiceStateChanged service_state_changed = 99;
175 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800176 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800177 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000178 DevicePolicyEvent device_policy_event = 103;
shawnlinea5b66b2018-11-13 15:05:29 +0800179 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104;
180 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported = 105;
181 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106;
182 DocsUIFileOperationReported docs_ui_provider_file_op = 107;
183 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request = 108;
184 DocsUILaunchReported docs_ui_launch_reported = 109;
185 DocsUIRootVisitedReported docs_ui_root_visited = 110;
186 DocsUIStartupMsReported docs_ui_startup_ms = 111;
187 DocsUIUserActionReported docs_ui_user_action_reported = 112;
Bookatzda1798c2018-12-13 14:16:00 -0800188 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
189 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f2018-12-06 11:01:38 +0000190 AppCompacted app_compacted = 115;
lifre82d8f62019-03-25 20:33:21 +0800191 NetworkDnsEventReported network_dns_event_reported = 116 [(log_from_module) = "resolv"];
shawnlina75e82d2019-01-07 10:31:12 +0800192 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported = 117;
193 DocsUIPickResultReported docs_ui_pick_result_reported = 118;
194 DocsUISearchModeReported docs_ui_search_mode_reported = 119;
195 DocsUISearchTypeReported docs_ui_search_type_reported = 120;
Chiachang Wangf6bedc22019-01-14 11:54:32 +0800196 DataStallEvent data_stall_event = 121;
Christian Brunschenf86039e2018-12-21 12:26:14 +0000197 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000198 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800199 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800200 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800201 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
202 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000203 AppDowngraded app_downgraded = 128;
204 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
205 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800206 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
207 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800208 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800209 NfcErrorOccurred nfc_error_occurred = 134;
210 NfcStateChanged nfc_state_changed = 135;
211 NfcBeamOccurred nfc_beam_occurred = 136;
212 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
213 NfcTagOccurred nfc_tag_occurred = 138;
214 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
215 SeStateChanged se_state_changed = 140;
216 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800217 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800218 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800219 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800220 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800221 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800222 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyne5a37fb2019-02-08 13:10:36 -0800223 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500224 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800225 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Jack Hec27040a2019-01-09 20:54:41 -0800226 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
227 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
228 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
229 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
230 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
231 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
232 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
233 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
234 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He1021a612019-01-20 21:22:46 -0800235 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
236 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
Jack Heaea26982019-04-04 11:19:48 -0700237 BluetoothDeviceInfoReported bluetooth_device_info_reported = 162;
Jack He1021a612019-01-20 21:22:46 -0800238 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
239 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
240 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
241 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
242 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Alex Salod7c3eef2019-01-25 14:43:27 -0800243 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800244 ProcessStartTime process_start_time = 169;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -0800245 PermissionGrantRequestResultReported permission_grant_request_result_reported = 170;
Jack He815cdba2019-01-30 17:24:55 -0800246 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Michael Groover4a0ca942019-01-24 17:41:25 -0800247 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Steven Wu552f63f2019-02-05 13:41:36 -0500248 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
joshmccloskey8c3322e2019-01-09 18:25:57 -0800249 AssistGestureStageReported assist_gesture_stage_reported = 174;
250 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
251 AssistGestureProgressReported assist_gesture_progress_reported = 176;
Philip Quinn0eded622019-01-29 12:46:28 -0800252 TouchGestureClassified touch_gesture_classified = 177;
Andrei Onea4ad6d0c2019-02-08 13:54:12 +0000253 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true];
Hyunyoung Song80adf6be2019-01-30 09:59:30 -0800254 StyleUIChanged style_ui_changed = 179;
Fabian Kozynskibfd6d852019-02-15 15:08:16 -0500255 PrivacyIndicatorsInteracted privacy_indicators_interacted = 180;
Carmen Agimof6688a352019-01-30 19:36:04 +0000256 AppInstallOnExternalStorageReported app_install_on_external_storage_reported = 181;
Chiachang Wang0e88ebf2019-03-21 10:18:07 +0800257 NetworkStackReported network_stack_reported = 182;
Carmen Agimof6dcc5032019-03-01 16:20:09 +0000258 AppMovedStorageReported app_moved_storage_reported = 183;
joshmccloskey6f952b22019-03-25 20:59:35 -0700259 BiometricEnrolled biometric_enrolled = 184;
jianjin8f2dee02019-03-29 14:03:08 -0700260 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185;
261 TombStoneOccurred tomb_stone_occurred = 186;
Jack He71426802019-04-02 13:32:52 -0700262 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported = 187;
Yao Chend54f9dd2017-10-17 17:37:48 +0000263 }
David Chenc8a43242017-10-17 16:23:28 -0700264
David Chen6e3e6cb2018-01-03 16:14:06 -0800265 // Pulled events will start at field 10000.
Carmen Agimofa769c152019-03-04 14:39:14 +0000266 // Next: 10058
David Chenc8a43242017-10-17 16:23:28 -0700267 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800268 WifiBytesTransfer wifi_bytes_transfer = 10000;
269 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
270 MobileBytesTransfer mobile_bytes_transfer = 10002;
271 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800272 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800273 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800274 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800275 CpuTimePerFreq cpu_time_per_freq = 10008;
276 CpuTimePerUid cpu_time_per_uid = 10009;
277 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800278 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800279 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800280 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800281 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800282 SystemElapsedRealtime system_elapsed_realtime = 10014;
283 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800284 CpuActiveTime cpu_active_time = 10016;
285 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000286 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800287 RemainingBatteryCapacity remaining_battery_capacity = 10019;
288 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800289 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100290 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100291 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100292 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000293 DiskStats disk_stats = 10025;
294 DirectoryUsage directory_usage = 10026;
295 AppSize app_size = 10027;
296 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700297 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700298 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800299 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700300 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700301 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800302 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700303 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100304 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100305 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700306 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800307 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
308 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
309 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000310 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800311 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800312 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800313 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000314 DebugElapsedClock debug_elapsed_clock = 10046;
315 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800316 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800317 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800318 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800319 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000320 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000321 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800322 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
323 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000324 SystemIonHeapSize system_ion_heap_size = 10056;
Carmen Agimofa769c152019-03-04 14:39:14 +0000325 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
David Chenc8a43242017-10-17 16:23:28 -0700326 }
yroa1fe77c2018-02-26 14:22:54 -0800327
Bookatz76aafcf2018-09-17 16:17:10 -0700328 // DO NOT USE field numbers above 100,000 in AOSP.
329 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
330 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700331}
332
Yao Chend54f9dd2017-10-17 17:37:48 +0000333/**
Yangster-mac20877162017-12-22 17:19:39 -0800334 * This proto represents a node of an attribution chain.
335 * Note: All attribution chains are represented as a repeated field of type
336 * AttributionNode. It is understood that in such arrays, the order is that
337 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000338 */
Yangster-mac20877162017-12-22 17:19:39 -0800339message AttributionNode {
340 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800341 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800342
Yangster-mac20877162017-12-22 17:19:39 -0800343 // The (optional) string tag for an element in the attribution chain. If the
344 // element has no tag, it is encoded as an empty string.
345 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700346}
347
Yangster-mac48b3d622018-08-18 12:38:11 -0700348message KeyValuePair {
349 optional int32 key = 1;
350 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700351 int32 value_int = 2;
352 int64 value_long = 3;
353 string value_str = 4;
354 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700355 }
356}
357
358message KeyValuePairsAtom {
359 optional int32 uid = 1;
360 repeated KeyValuePair pairs = 2;
361}
362
Yao Chend54f9dd2017-10-17 17:37:48 +0000363/*
364 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800365 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000366 *
367 * RULES:
368 * - The field ids for each atom must start at 1, and count upwards by 1.
369 * Skipping field ids is not allowed.
370 * - These form an API, so renaming, renumbering or removing fields is
371 * not allowed between android releases. (This is not currently enforced,
372 * but there will be a tool to enforce this restriction).
373 * - The types must be built-in protocol buffer types, namely, no sub-messages
374 * are allowed (yet). The bytes type is also not allowed.
375 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800376 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000377 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800378 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000379 * - A field that is a uid should be a string field, tagged with the [xxx]
380 * annotation. The generated code on android will be represented by UIDs,
381 * and those UIDs will be translated in xxx to those strings.
382 *
383 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700384 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000385 * - If there is a UID, it goes first. Think in an object-oriented fashion.
386 * *****************************************************************************
387 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700388
Yao Chend54f9dd2017-10-17 17:37:48 +0000389/**
Yangster-mace16189a2018-08-26 12:20:16 -0700390 * Logs when the Thermal service HAL notifies the throttling start/stop events.
391 *
392 * Logged from:
393 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
394 */
395message ThermalThrottlingStateChanged {
396 optional android.os.TemperatureTypeEnum sensor_type = 1;
397
398 enum State {
399 UNKNOWN = 0;
400 START = 1;
401 STOP = 2;
402 }
403
404 optional State state = 2;
405
406 optional float temperature = 3;
407}
408
409/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000410 * Logs when the screen state changes.
411 *
412 * Logged from:
413 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
414 */
415message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800416 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700417 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700418}
Yao Chend54f9dd2017-10-17 17:37:48 +0000419
420/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700421 * Logs that the process state of the uid, as determined by ActivityManager
422 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000423 *
424 * Logged from:
425 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
426 */
Bookatzc1a050a2017-10-10 15:49:28 -0700427message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700428 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000429
Bookatzdb026a22018-01-10 19:01:56 -0800430 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700431 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000432}
433
434/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700435 * Logs process state change of a process, as per the activity manager.
436 *
437 * Logged from:
438 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
439 */
440message ProcessStateChanged {
441 optional int32 uid = 1;
442 optional string process_name = 2;
443 optional string package_name = 3;
444 // TODO: remove this when validation is done
445 optional int64 version = 5;
446 // The state, from frameworks/base/core/proto/android/app/enums.proto.
447 optional android.app.ProcessStateEnum state = 4;
448}
449
450/**
451 * Logs when ActivityManagerService sleep state is changed.
452 *
453 * Logged from:
454 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
455 */
456message ActivityManagerSleepStateChanged {
457 // TODO: import frameworks proto
458 enum State {
459 UNKNOWN = 0;
460 ASLEEP = 1;
461 AWAKE = 2;
462 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700463 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700464}
465
466/**
467 * Logs when system memory state changes.
468 *
469 * Logged from:
470 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
471 */
472message MemoryFactorStateChanged {
473 // TODO: import frameworks proto
474 enum State {
475 MEMORY_UNKNOWN = 0;
476 NORMAL = 1; // normal.
477 MODERATE = 2; // moderate memory pressure.
478 LOW = 3; // low memory.
479 CRITICAL = 4; // critical memory.
480
481 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700482 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700483}
484
485/**
486 * Logs when app is using too much cpu, according to ActivityManagerService.
487 *
488 * Logged from:
489 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
490 */
491message ExcessiveCpuUsageReported {
492 optional int32 uid = 1;
493 optional string process_name = 2;
494 optional string package_name = 3;
495 // package version. TODO: remove this when validation is done
496 optional int64 version = 4;
497}
498
499/**
500 * Logs when a cached process is killed, along with its pss.
501 *
502 * Logged from:
503 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
504 */
505message CachedKillReported {
506 optional int32 uid = 1;
507 optional string process_name = 2;
508 optional string package_name = 3;
509 // TODO: remove this when validation is done
510 optional int64 version = 5;
511 optional int64 pss = 4;
512}
513
514/**
515 * Logs when memory stats of a process is reported.
516 *
517 * Logged from:
518 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
519 */
520message ProcessMemoryStatReported {
521 optional int32 uid = 1;
522 optional string process_name = 2;
523 optional string package_name = 3;
524 //TODO: remove this when validation is done
525 optional int64 version = 9;
526 optional int64 pss = 4;
527 optional int64 uss = 5;
528 optional int64 rss = 6;
529 enum Type {
530 ADD_PSS_INTERNAL_SINGLE = 0;
531 ADD_PSS_INTERNAL_ALL_MEM = 1;
532 ADD_PSS_INTERNAL_ALL_POLL = 2;
533 ADD_PSS_EXTERNAL = 3;
534 ADD_PSS_EXTERNAL_SLOW = 4;
535 }
536 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800537 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700538}
539
540/**
Bookatzc1a050a2017-10-10 15:49:28 -0700541 * Logs that a process started, finished, crashed, or ANRed.
542 *
543 * Logged from:
544 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
545 */
546message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700547 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700548
David Chen0b5c90c2018-01-25 16:51:49 -0800549 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800550 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700551
Bookatzddccf0a2017-11-28 16:48:14 -0800552 // What lifecycle state the process changed to.
553 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800554 enum State {
555 FINISHED = 0;
556 STARTED = 1;
557 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800558 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800559 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700560}
561
Bookatzc1a050a2017-10-10 15:49:28 -0700562/**
563 * Logs when the ble scan state changes.
564 *
565 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700566 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700567 */
568message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800569 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700570
571 enum State {
572 OFF = 0;
573 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700574 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
575 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700576 }
577 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700578
Bookatze5ec0b42018-03-26 13:34:56 -0700579 // Does the scan have a filter.
580 optional bool is_filtered = 3;
581 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
582 optional bool is_first_match = 4;
583 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
584 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700585}
586
587/**
588 * Logs reporting of a ble scan finding results.
589 *
590 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700591 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700592 */
Bookatzae6738e2018-09-13 11:38:56 -0700593// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700594message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800595 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700596
597 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800598 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700599}
600
601/**
602 * Logs when a sensor state changes.
603 *
604 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700605 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700606 */
607message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800608 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700609
Bookatzc1a050a2017-10-10 15:49:28 -0700610 // The id (int) of the sensor.
611 optional int32 sensor_id = 2;
612
613 enum State {
614 OFF = 0;
615 ON = 1;
616 }
617 optional State state = 3;
618}
619
Bookatzc1a050a2017-10-10 15:49:28 -0700620/**
621 * Logs when GPS state changes.
622 *
623 * Logged from:
624 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
625 */
626message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800627 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700628
629 enum State {
630 OFF = 0;
631 ON = 1;
632 }
633 optional State state = 2;
634}
635
Bookatz48d362e2018-11-06 15:49:08 -0800636/**
637 * Logs when GPS signal quality.
638 *
639 * Logged from:
640 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
641 */
642message GpsSignalQualityChanged {
643 optional android.server.location.GpsSignalQualityEnum level = 1;
644}
645
Bookatzc1a050a2017-10-10 15:49:28 -0700646
647/**
648 * Logs when a sync manager sync state changes.
649 *
650 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700651 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700652 */
653message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800654 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700655
David Chen0b5c90c2018-01-25 16:51:49 -0800656 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800657 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700658
659 enum State {
660 OFF = 0;
661 ON = 1;
662 }
663 optional State state = 3;
664}
665
Yangster-mac96353002018-09-05 11:18:55 -0700666/*
667 * Deferred job stats.
668 *
669 * Logged from:
670 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
671*/
672message DeferredJobStatsReported {
673 repeated AttributionNode attribution_node = 1;
674
675 // Number of jobs deferred.
676 optional int32 num_jobs_deferred = 2;
677
678 // Time since the last job runs.
679 optional int64 time_since_last_job_millis = 3;
680}
681
Bookatzc1a050a2017-10-10 15:49:28 -0700682/**
683 * Logs when a job scheduler job state changes.
684 *
685 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700686 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700687 */
688message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800689 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700690
691 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800692 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700693
694 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800695 FINISHED = 0;
696 STARTED = 1;
697 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700698 }
699 optional State state = 3;
700
Tej Singh33a412b2018-03-16 18:43:59 -0700701 // The reason a job has stopped.
702 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700703 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700704 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700705}
706
707/**
708 * Logs when the audio state changes.
709 *
710 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700711 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700712 */
713message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800714 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700715
716 enum State {
717 OFF = 0;
718 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700719 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
720 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700721 }
722 optional State state = 2;
723}
724
725/**
726 * Logs when the video codec state changes.
727 *
728 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700729 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700730 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800731message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800732 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700733
734 enum State {
735 OFF = 0;
736 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700737 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
738 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700739 }
740 optional State state = 2;
741}
742
743/**
744 * Logs when the flashlight state changes.
745 *
746 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700747 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700748 */
749message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800750 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700751
752 enum State {
753 OFF = 0;
754 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700755 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
756 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700757 }
758 optional State state = 2;
759}
760
761/**
762 * Logs when the camera state changes.
763 *
764 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700765 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700766 */
767message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800768 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700769
770 enum State {
771 OFF = 0;
772 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700773 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
774 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700775 }
776 optional State state = 2;
777}
778
779/**
780 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000781 *
782 * Logged from:
783 * TODO
784 */
Bookatzd6746242017-10-24 18:39:35 -0700785message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800786 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000787
Bookatz1a1b0462018-01-12 11:47:03 -0800788 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
789 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700790 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700791
792 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
793 optional string tag = 3;
794
795 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800796 RELEASE = 0;
797 ACQUIRE = 1;
798 CHANGE_RELEASE = 2;
799 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700800 }
801 optional State state = 4;
802}
803
804/**
Bookatzc1a050a2017-10-10 15:49:28 -0700805 * Logs when a partial wakelock is considered 'long' (over 1 min).
806 *
807 * Logged from:
808 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
809 */
810message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800811 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700812
Yao Chend54f9dd2017-10-17 17:37:48 +0000813 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
814 optional string tag = 2;
815
Bookatzc1a050a2017-10-10 15:49:28 -0700816 // TODO: I have no idea what this is.
817 optional string history_tag = 3;
818
819 enum State {
820 OFF = 0;
821 ON = 1;
822 }
823 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000824}
825
Bookatzc1a050a2017-10-10 15:49:28 -0700826/**
Bookatza66083f2018-09-20 17:24:00 -0700827 * Logs when the device is interactive, according to the PowerManager Notifier.
828 *
829 * Logged from:
830 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
831 */
832message InteractiveStateChanged {
833 enum State {
834 OFF = 0;
835 ON = 1;
836 }
837 optional State state = 1;
838}
839
840/**
Bookatzc1a050a2017-10-10 15:49:28 -0700841 * Logs Battery Saver state change.
842 *
843 * Logged from:
844 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
845 */
846message BatterySaverModeStateChanged {
847 enum State {
848 OFF = 0;
849 ON = 1;
850 }
851 optional State state = 1;
852}
853
854/**
855 * Logs Doze mode state change.
856 *
857 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800858 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700859 */
860message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800861 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800862}
863
864
865/**
866 * Logs state change of Doze mode including maintenance windows.
867 *
868 * Logged from:
869 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
870 */
871message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800872 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700873}
874
875/**
876 * Logs screen brightness level.
877 *
878 * Logged from:
879 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
880 */
881message ScreenBrightnessChanged {
882 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
883 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700884}
885
886/**
887 * Logs battery level (percent full, from 0 to 100).
888 *
889 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700890 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700891 */
892message BatteryLevelChanged {
893 // Battery level. Should be in [0, 100].
894 optional int32 battery_level = 1;
895}
896
897/**
898 * Logs change in charging status of the device.
899 *
900 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700901 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700902 */
903message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800904 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
905 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700906}
907
908/**
909 * Logs whether the device is plugged in, and what power source it is using.
910 *
911 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700912 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700913 */
914message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800915 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
916 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700917}
918
Bookatz8c6571b2017-10-24 15:04:41 -0700919/**
920 * Logs when an app's wakeup alarm fires.
921 *
922 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700923 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700924 */
925message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800926 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800927
928 // Name of the wakeup alarm.
929 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700930
931 // Name of source package (for historical reasons, since BatteryStats tracked it).
932 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800933}
934
935/**
936 * Logs when an an app causes the mobile radio to change state.
937 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
938 *
939 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700940 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800941 */
942message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800943 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800944
Bookatz1a1b0462018-01-12 11:47:03 -0800945 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
946 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800947}
948
949/**
950 * Logs when an an app causes the wifi radio to change state.
951 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
952 *
953 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700954 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800955 */
956message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800957 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800958
Bookatz1a1b0462018-01-12 11:47:03 -0800959 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
960 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700961}
962
963/**
964 * Logs kernel wakeup reasons and aborts.
965 *
966 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700967 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700968 */
969message KernelWakeupReported {
970 // Name of the kernel wakeup reason (or abort).
971 optional string wakeup_reason_name = 1;
972
973 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800974 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700975}
976
977/**
Bookatzda1798c2018-12-13 14:16:00 -0800978 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800979 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800980 *
981 * Logged from:
982 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
983 */
984message WifiEnabledStateChanged {
985 enum State {
986 OFF = 0;
987 ON = 1;
988 }
989 optional State state = 1;
990}
991
992/**
993 * 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 -0800994 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
995 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800996 *
997 * Logged from:
998 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
999 */
1000message WifiRunningStateChanged {
1001 repeated AttributionNode attribution_node = 1;
1002
1003 enum State {
1004 OFF = 0;
1005 ON = 1;
1006 }
1007 optional State state = 2;
1008}
1009
1010/**
Bookatze5885242017-10-24 20:10:31 -07001011 * Logs wifi locks held by an app.
1012 *
1013 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001014 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001015 */
1016message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001017 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001018
1019 enum State {
1020 OFF = 0;
1021 ON = 1;
1022 }
1023 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001024
1025 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1026 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001027}
1028
1029/**
1030 * Logs wifi signal strength changes.
1031 *
1032 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001033 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001034 */
1035message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001036 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1037 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001038}
1039
1040/**
1041 * Logs wifi scans performed by an app.
1042 *
1043 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001044 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001045 */
1046message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001047 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001048
1049 enum State {
1050 OFF = 0;
1051 ON = 1;
1052 }
1053 optional State state = 2;
1054}
1055
1056/**
Tej Singh4503e102018-01-04 14:35:01 -08001057 * Logs wifi multicast locks held by an app
1058 *
1059 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001060 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001061 */
1062message WifiMulticastLockStateChanged {
1063 repeated AttributionNode attribution_node = 1;
1064
1065 enum State {
1066 OFF = 0;
1067 ON = 1;
1068 }
1069 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001070
1071 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001072}
1073
1074/**
Tej Singh1ea42892018-01-19 09:27:00 -08001075 * Logs shutdown reason and duration on next boot.
1076 *
1077 * Logged from:
1078 * frameworks/base/core/java/com/android/server/BootReceiver.java
1079 */
1080message ShutdownSequenceReported {
1081 // True if shutdown is for a reboot. Default: false if we do not know.
1082 optional bool reboot = 1;
1083
1084 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1085 optional string reason = 2;
1086
1087 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1088 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001089 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001090
1091 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001092 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001093}
1094
Tej Singh6483ea42018-01-25 17:45:49 -08001095
1096/**
1097 * Logs boot reason and duration.
1098 *
1099 * Logged from:
1100 * system/core/bootstat/bootstat.cpp
1101 */
1102message BootSequenceReported {
1103 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1104 // Default: "<EMPTY>" if not available.
1105 optional string bootloader_reason = 1;
1106
1107 // Reason for system boot. Eg. bootloader, reboot,userrequested
1108 // Default: "<EMPTY>" if not available.
1109 optional string system_reason = 2;
1110
1111 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001112 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001113
1114 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001115 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001116
1117 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001118 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001119
1120 // Time since last boot in ms. Default: 0 if not available.
1121 optional int64 time_since_last_boot = 6;
1122}
1123
Tej Singhc477d9c2018-02-05 18:31:39 -08001124
1125/**
1126 * Logs call state and disconnect cause (if applicable).
1127 *
1128 * Logged from:
1129 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1130 */
1131message CallStateChanged {
1132 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1133 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1134 optional android.telecom.CallStateEnum call_state = 1;
1135
1136 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1137 // This value is only applicable when the call_state is DISCONNECTED, and
1138 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1139 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1140 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1141
1142 // True if the call is self-managed, which are apps that use the
1143 // telecom infrastructure to make their own calls.
1144 optional bool self_managed = 3;
1145
1146 // True if call is external. External calls are calls on connected Wear
1147 // devices but show up in Telecom so the user can pull them onto the device.
1148 optional bool external_call = 4;
1149}
1150
Tej Singh1ea42892018-01-19 09:27:00 -08001151/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001152 * Logs keyguard state. The keyguard is the lock screen.
1153 *
1154 * Logged from:
1155 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1156 */
1157message KeyguardStateChanged {
1158 enum State {
1159 UNKNOWN = 0;
1160 // The keyguard is hidden when the phone is unlocked.
1161 HIDDEN = 1;
1162 // The keyguard is shown when the phone is locked (screen turns off).
1163 SHOWN= 2;
1164 // The keyguard is occluded when something is overlaying the keyguard.
1165 // Eg. Opening the camera while on the lock screen.
1166 OCCLUDED = 3;
1167 }
1168 optional State state = 1;
1169}
1170
1171/**
1172 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1173 * prompts the user to enter a password (pattern, pin, etc).
1174 *
1175 * Logged from:
1176 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1177 */
1178
1179message KeyguardBouncerStateChanged {
1180 enum State {
1181 UNKNOWN = 0;
1182 // Bouncer is hidden, either as a result of successfully entering the
1183 // password, screen timing out, or user going back to lock screen.
1184 HIDDEN = 1;
1185 // This is when the user is being prompted to enter the password.
1186 SHOWN = 2;
1187 }
1188 optional State state = 1;
1189}
1190
1191/**
1192 * Logs the result of entering a password into the keyguard bouncer.
1193 *
1194 * Logged from:
1195 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1196 */
1197message KeyguardBouncerPasswordEntered {
1198 enum BouncerResult {
1199 UNKNOWN = 0;
1200 // The password entered was incorrect.
1201 FAILURE = 1;
1202 // The password entered was correct.
1203 SUCCESS = 2;
1204 }
1205 optional BouncerResult result = 1;
1206}
1207
Tej Singha883b372018-02-15 11:30:01 -08001208/*
1209 * Logs changes to the configuration of the device. The configuration is defined
1210 * in frameworks/base/core/java/android/content/res/Configuration.java
1211 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1212 * Please go there to interpret the possible values each field can be.
1213 *
1214 * Logged from:
1215 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1216 */
1217message ResourceConfigurationChanged {
1218 // Bit mask of color capabilities of the screen.
1219 // Contains information about the color gamut and hdr mode of the screen.
1220 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001221 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001222
1223 // The target screen density being rendered to.
1224 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001225 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001226
1227 // Current user preference for the scaling factor for fonts,
1228 // relative to the base density scaling.
1229 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001230 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001231
1232 // Flag indicating whether the hard keyboard is hidden.
1233 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001234 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001235
1236 // The type of keyboard attached to the device.
1237 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1238 optional int32 keyboard = 5;
1239
1240 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1241 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001242 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001243
1244 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1245 // 0 if undefined.
1246 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1247 optional int32 mcc = 7;
1248
1249 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1250 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1251 // MNC_ZERO symbol defined in Configuration.java.
1252 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1253 optional int32 mnc = 8;
1254
1255 // The kind of navigation available on the device.
1256 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1257 optional int32 navigation = 9;
1258
1259 // Flag indicating whether the navigation is available.
1260 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001261 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001262
1263 // Overall orientation of the screen.
1264 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1265 optional int32 orientation = 11;
1266
1267 // The current height of the available screen space, in dp units.
1268 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001269 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001270
1271 // Bit mask of overall layout of the screen.
1272 // Contains information about screen size, whether the screen is wider/taller
1273 // than normal, whether the screen layout is right-tl-left or left-to-right,
1274 // and whether the screen has a rounded shape.
1275 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001276 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001277
1278 // Current width of the available screen space, in dp units.
1279 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001280 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001281
1282 // The smallest screen size an application will see in normal operation.
1283 // This is the smallest value of both screenWidthDp and screenHeightDp
1284 // in portrait and landscape.
1285 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001286 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001287
1288 // The type of touch screen attached to the device.
1289 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1290 optional int32 touchscreen = 16;
1291
1292 // Bit mask of the ui mode.
1293 // Contains information about the overall ui mode of the device.
1294 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1295 // Also contains information about whether the device is in night mode.
1296 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001297 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001298}
1299
Tej Singheee317b2018-03-07 19:28:05 -08001300
1301/**
1302 * Logs changes in the connection state of the mobile radio.
1303 *
1304 * Logged from:
1305 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1306 */
1307message MobileConnectionStateChanged {
1308 // States are from the state machine DataConnection.java.
1309 enum State {
1310 UNKNOWN = 0;
1311 // The connection is inactive, or disconnected.
1312 INACTIVE = 1;
1313 // The connection is being activated, or connecting.
1314 ACTIVATING = 2;
1315 // The connection is active, or connected.
1316 ACTIVE = 3;
1317 // The connection is disconnecting.
1318 DISCONNECTING = 4;
1319 // The connection is disconnecting after creating a connection.
1320 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1321 }
1322 optional State state = 1;
1323 // For multi-sim phones, this distinguishes between the sim cards.
1324 optional int32 sim_slot_index = 2;
1325 // Used to identify the connection. Starts at 0 and increments by 1 for
1326 // every new network created. Resets whenever the device reboots.
1327 optional int32 data_connection_id = 3;
1328 // A bitmask for the capabilities of this connection.
1329 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1330 // Default value (if we have no information): 0
1331 optional int64 capabilities = 4;
1332 // If this connection has internet.
1333 // This just checks if the DEFAULT bit of capabilities is set.
1334 optional bool has_internet = 5;
1335}
1336
1337/**
1338 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1339 *
1340 * Logged from:
1341 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1342 */
1343message MobileRadioTechnologyChanged {
1344 optional android.telephony.NetworkTypeEnum state = 1;
1345 // For multi-sim phones, this distinguishes between the sim cards.
1346 optional int32 sim_slot_index = 2;
1347}
1348
Andrew Chantb56388b2018-03-22 21:07:33 -07001349/**
1350 * Logs the VID and PID of any connected USB devices.
1351 *
1352 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1353 *
1354 * Logged by Vendor.
1355 */
1356message UsbDeviceAttached {
1357 optional int32 vid = 1;
1358 optional int32 pid = 2;
1359 optional bool has_audio = 3;
1360 optional bool has_hid = 4;
1361 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001362 enum State {
1363 STATE_DISCONNECTED = 0;
1364 STATE_CONNECTED = 1;
1365 }
1366 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001367 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001368}
1369
Tej Singheee317b2018-03-07 19:28:05 -08001370
Tej Singhdd7bd352018-02-09 19:33:15 -08001371/**
Tej Singh5d991e12018-03-09 19:48:11 -08001372 * Logs when Bluetooth is enabled and disabled.
1373 *
1374 * Logged from:
1375 * services/core/java/com/android/server/BluetoothManagerService.java
1376 */
1377message BluetoothEnabledStateChanged {
1378 repeated AttributionNode attribution_node = 1;
1379 // Whether or not bluetooth is enabled on the device.
1380 enum State {
1381 UNKNOWN = 0;
1382 ENABLED = 1;
1383 DISABLED = 2;
1384 }
1385 optional State state = 2;
1386 // The reason for being enabled/disabled.
1387 // Eg. Airplane mode, crash, application request.
1388 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1389 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001390 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001391}
1392
1393/**
Jack Hed9837c82019-01-09 01:19:13 -08001394 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001395 *
1396 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001397 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1398 *
1399 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001400 */
1401message BluetoothConnectionStateChanged {
1402 // The state of the connection.
1403 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1404 optional android.bluetooth.ConnectionStateEnum state = 1;
1405 // An identifier that can be used to match connect and disconnect events.
1406 // Currently is last two bytes of a hash of a device level ID and
1407 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001408 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001409 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001410 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1411 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001412 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001413 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001414 // An identifier that can be used to match events for this device.
1415 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1416 // Salt: Randomly generated 256 bit value
1417 // Hash algorithm: HMAC-SHA256
1418 // Size: 32 byte
1419 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001420 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001421}
1422
1423/**
1424 * Logs when a Bluetooth device connects and disconnects over ACL
1425 *
1426 * Logged from:
1427 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1428 *
1429 * Next Tag: 3
1430 */
1431message BluetoothAclConnectionStateChanged {
1432 // An identifier that can be used to match events for this device.
1433 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1434 // Salt: Randomly generated 256 bit value
1435 // Hash algorithm: HMAC-SHA256
1436 // Size: 32 byte
1437 // Default: null or empty if the device identifier is not known
1438 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1439 // The state of the connection.
1440 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1441 optional android.bluetooth.ConnectionStateEnum state = 2;
1442}
1443
1444/**
1445 * Logs when a Bluetooth device connects and disconnects over SCO
1446 *
1447 * Logged from:
1448 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1449 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1450 *
1451 * Next Tag: 4
1452 */
1453message BluetoothScoConnectionStateChanged {
1454 // An identifier that can be used to match events for this device.
1455 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1456 // Salt: Randomly generated 256 bit value
1457 // Hash algorithm: HMAC-SHA256
1458 // Size: 32 byte
1459 // Default: null or empty if the device identifier is not known
1460 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1461 // The state of the connection.
1462 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1463 optional android.bluetooth.ConnectionStateEnum state = 2;
1464 // Codec used for this SCO connection
1465 // Default: UNKNOWN
1466 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001467}
1468
Jack Hec27040a2019-01-09 20:54:41 -08001469/**
1470 * Logged when active device of a profile changes
1471 *
1472 * Logged from:
1473 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1474 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1475 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1476 */
1477message BluetoothActiveDeviceChanged {
1478 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1479 // From android.bluetooth.BluetoothProfile
1480 optional int32 bt_profile = 1;
1481 // An identifier that can be used to match events for this new active device.
1482 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1483 // Salt: Randomly generated 256 bit value
1484 // Hash algorithm: HMAC-SHA256
1485 // Size: 32 byte
1486 // Default: null or empty if there is no active device for this profile
1487 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1488}
1489
Jack Heab86dbd22018-12-18 15:43:27 -08001490// Logs when there is an event affecting Bluetooth device's link layer connection.
1491// - This event is triggered when there is a related HCI command or event
1492// - Users of this metrics can deduce Bluetooth device's connection state from these events
1493// - HCI commands are logged before the command is sent, after receiving command status, and after
1494// receiving command complete
1495// - HCI events are logged when they arrive
1496//
1497// Low level log from system/bt
1498//
1499// Bluetooth classic commands:
1500// - CMD_CREATE_CONNECTION
1501// - CMD_DISCONNECT
1502// - CMD_CREATE_CONNECTION_CANCEL
1503// - CMD_ACCEPT_CONNECTION_REQUEST
1504// - CMD_REJECT_CONNECTION_REQUEST
1505// - CMD_SETUP_ESCO_CONNECTION
1506// - CMD_ACCEPT_ESCO_CONNECTION
1507// - CMD_REJECT_ESCO_CONNECTION
1508// - CMD_ENH_SETUP_ESCO_CONNECTION
1509// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1510//
1511// Bluetooth low energy commands:
1512// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1513// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1514// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1515// - CMD_BLE_CLEAR_WHITE_LIST
1516// - CMD_BLE_ADD_WHITE_LIST
1517// - CMD_BLE_REMOVE_WHITE_LIST
1518//
1519// Bluetooth classic events:
1520// - EVT_CONNECTION_COMP
1521// - EVT_CONNECTION_REQUEST
1522// - EVT_DISCONNECTION_COMP
1523// - EVT_ESCO_CONNECTION_COMP
1524// - EVT_ESCO_CONNECTION_CHANGED
1525//
1526// Bluetooth low energy meta events:
1527// - BLE_EVT_CONN_COMPLETE_EVT
1528// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1529//
1530// Next tag: 10
1531message BluetoothLinkLayerConnectionEvent {
1532 // An identifier that can be used to match events for this device.
1533 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1534 // Salt: Randomly generated 256 bit value
1535 // Hash algorithm: HMAC-SHA256
1536 // Size: 32 byte
1537 // Default: null or empty if the device identifier is not known
1538 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1539 // Connection handle of this connection if available
1540 // Range: 0x0000 - 0x0EFF (12 bits)
1541 // Default: 0xFFFF if the handle is unknown
1542 optional int32 connection_handle = 2;
1543 // Direction of the link
1544 // Default: DIRECTION_UNKNOWN
1545 optional android.bluetooth.DirectionEnum direction = 3;
1546 // Type of this link
1547 // Default: LINK_TYPE_UNKNOWN
1548 optional android.bluetooth.LinkTypeEnum type = 4;
1549
1550 // Reason metadata for this link layer connection event, rules for interpretation:
1551 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1552 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1553 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1554 // set and valid, ignore hci_ble_event
1555
1556 // HCI command associated with this event
1557 // Default: CMD_UNKNOWN
1558 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1559 // HCI event associated with this event
1560 // Default: EVT_UNKNOWN
1561 optional android.bluetooth.hci.EventEnum hci_event = 6;
1562 // HCI BLE meta event associated with this event
1563 // Default: BLE_EVT_UNKNOWN
1564 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1565 // HCI command status code if this is triggerred by hci_cmd
1566 // Default: STATUS_UNKNOWN
1567 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1568 // HCI reason code associated with this event
1569 // Default: STATUS_UNKNOWN
1570 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1571}
1572
Howard Roe103fe22019-01-17 16:52:16 -08001573/**
1574 * Logs when a module is rolled back by Watchdog.
1575 *
1576 * Logged from: Rollback Manager
1577 */
1578message WatchdogRollbackOccurred {
1579 enum RollbackType {
1580 UNKNOWN = 0;
1581 ROLLBACK_INITIATE = 1;
1582 ROLLBACK_SUCCESS = 2;
1583 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001584 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001585 }
1586 optional RollbackType rollback_type = 1;
1587
1588 optional string package_name = 2;
1589
1590 optional int32 package_version_code = 3;
1591}
1592
Jack Hec27040a2019-01-09 20:54:41 -08001593/**
1594 * Logs when there is a change in Bluetooth A2DP playback state
1595 *
1596 * Logged from:
1597 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1598 */
1599message BluetoothA2dpPlaybackStateChanged {
1600 // An identifier that can be used to match events for this device.
1601 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1602 // Salt: Randomly generated 256 bit value
1603 // Hash algorithm: HMAC-SHA256
1604 // Size: 32 byte
1605 // Default: null or empty if the device identifier is not known
1606 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1607 // Current playback state
1608 // Default: PLAYBACK_STATE_UNKNOWN
1609 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1610 // Current audio coding mode
1611 // Default: AUDIO_CODING_MODE_UNKNOWN
1612 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1613}
1614
1615/**
1616 * Logs when there is a change in A2DP codec config for a particular remote device
1617 *
1618 * Logged from:
1619 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1620 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1621 */
1622message BluetoothA2dpCodecConfigChanged {
1623 // An identifier that can be used to match events for this device.
1624 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1625 // Salt: Randomly generated 256 bit value
1626 // Hash algorithm: HMAC-SHA256
1627 // Size: 32 byte
1628 // Default: null or empty if the device identifier is not known
1629 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1630 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1631 // Default SOURCE_CODEC_TYPE_INVALID
1632 optional int32 codec_type = 2;
1633 // Codec priroity, the higher the more preferred, -1 for disabled
1634 // Default: CODEC_PRIORITY_DEFAULT
1635 optional int32 codec_priority = 3;
1636 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1637 // Default: SAMPLE_RATE_NONE
1638 optional int32 sample_rate = 4;
1639 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1640 // Default: BITS_PER_SAMPLE_NONE
1641 optional int32 bits_per_sample = 5;
1642 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1643 // Default: CHANNEL_MODE_NONE
1644 optional int32 channel_mode = 6;
1645 // Codec specific values
1646 // Default 0
1647 optional int64 codec_specific_1 = 7;
1648 optional int64 codec_specific_2 = 8;
1649 optional int64 codec_specific_3 = 9;
1650 optional int64 codec_specific_4 = 10;
1651}
1652
1653/**
1654 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1655 * Each codec's capability is logged separately due to statsd restriction
1656 *
1657 * Logged from:
1658 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1659 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1660 */
1661message BluetoothA2dpCodecCapabilityChanged {
1662 // An identifier that can be used to match events for this device.
1663 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1664 // Salt: Randomly generated 256 bit value
1665 // Hash algorithm: HMAC-SHA256
1666 // Size: 32 byte
1667 // Default: null or empty if the device identifier is not known
1668 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1669 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1670 // Default SOURCE_CODEC_TYPE_INVALID
1671 optional int32 codec_type = 2;
1672 // Codec priroity, the higher the more preferred, -1 for disabled
1673 // Default: CODEC_PRIORITY_DEFAULT
1674 optional int32 codec_priority = 3;
1675 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1676 // in BluetoothCodecConfig
1677 // Default: empty and SAMPLE_RATE_NONE for individual item
1678 optional int32 sample_rate = 4;
1679 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1680 // in BluetoothCodecConfig
1681 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1682 optional int32 bits_per_sample = 5;
1683 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1684 // BluetoothCodecConfig
1685 // Default: empty and CHANNEL_MODE_NONE for individual item
1686 optional int32 channel_mode = 6;
1687 // Codec specific values
1688 // Default 0
1689 optional int64 codec_specific_1 = 7;
1690 optional int64 codec_specific_2 = 8;
1691 optional int64 codec_specific_3 = 9;
1692 optional int64 codec_specific_4 = 10;
1693}
1694
1695/**
1696 * Logs when A2DP failed to read from PCM source.
1697 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1698 *
1699 * Logged from:
1700 * system/bt
1701 */
1702message BluetoothA2dpAudioUnderrunReported {
1703 // An identifier that can be used to match events for this device.
1704 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1705 // Salt: Randomly generated 256 bit value
1706 // Hash algorithm: HMAC-SHA256
1707 // Size: 32 byte
1708 // Default: null or empty if the device identifier is not known
1709 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1710 // Encoding interval in nanoseconds
1711 // Default: 0
1712 optional int64 encoding_interval_nanos = 2;
1713 // Number of bytes of PCM data that could not be read from the source
1714 // Default: 0
1715 optional int32 num_missing_pcm_bytes = 3;
1716}
1717
1718/**
1719 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1720 * buffer queue is full and we have to drop data
1721 *
1722 * Logged from:
1723 * system/bt
1724 */
1725message BluetoothA2dpAudioOverrunReported {
1726 // An identifier that can be used to match events for this device.
1727 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1728 // Salt: Randomly generated 256 bit value
1729 // Hash algorithm: HMAC-SHA256
1730 // Size: 32 byte
1731 // Default: null or empty if the device identifier is not known
1732 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1733 // Encoding interval in nanoseconds
1734 // Default: 0
1735 optional int64 encoding_interval_nanos = 2;
1736 // Number of buffers dropped in this event
1737 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1738 // Default: 0
1739 optional int32 num_dropped_buffers = 3;
1740 // Number of encoded buffers dropped in this event
1741 // Default 0
1742 optional int32 num_dropped_encoded_frames = 4;
1743 // Number of encoded bytes dropped in this event
1744 // Default: 0
1745 optional int32 num_dropped_encoded_bytes = 5;
1746}
1747
1748/**
1749 * Logs when we receive reports regarding a device's RSSI value
1750 *
1751 * Logged from:
1752 * system/bt
1753 */
1754message BluetoothDeviceRssiReported {
1755 // An identifier that can be used to match events for this device.
1756 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1757 // Salt: Randomly generated 256 bit value
1758 // Hash algorithm: HMAC-SHA256
1759 // Size: 32 byte
1760 // Default: null or empty if the device identifier is not known
1761 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1762 // Connection handle of this connection if available
1763 // Range: 0x0000 - 0x0EFF (12 bits)
1764 // Default: 0xFFFF if the handle is unknown
1765 optional int32 connection_handle = 2;
1766 // HCI command status code if this is triggerred by hci_cmd
1767 // Default: STATUS_UNKNOWN
1768 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1769 // BR/EDR
1770 // Range: -128 ≤ N ≤ 127 (signed integer)
1771 // Units: dB
1772 // LE:
1773 // Range: -127 to 20, 127 (signed integer)
1774 // Units: dBm
1775 // Invalid when an out of range value is reported
1776 optional int32 rssi = 4;
1777}
1778
1779/**
1780 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1781 *
1782 * Logged from:
1783 * system/bt
1784 */
1785message BluetoothDeviceFailedContactCounterReported {
1786 // An identifier that can be used to match events for this device.
1787 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1788 // Salt: Randomly generated 256 bit value
1789 // Hash algorithm: HMAC-SHA256
1790 // Size: 32 byte
1791 // Default: null or empty if the device identifier is not known
1792 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1793 // Connection handle of this connection if available
1794 // Range: 0x0000 - 0x0EFF (12 bits)
1795 // Default: 0xFFFF if the handle is unknown
1796 optional int32 connection_handle = 2;
1797 // HCI command status code if this is triggerred by hci_cmd
1798 // Default: STATUS_UNKNOWN
1799 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1800 // Number of consecutive failed contacts for a connection corresponding to the Handle
1801 // Range: uint16_t, 0-0xFFFF
1802 // Default: 0xFFFFF
1803 optional int32 failed_contact_counter = 4;
1804}
1805
1806/**
1807 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1808 *
1809 * Logged from:
1810 * system/bt
1811 */
1812message BluetoothDeviceTxPowerLevelReported {
1813 // An identifier that can be used to match events for this device.
1814 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1815 // Salt: Randomly generated 256 bit value
1816 // Hash algorithm: HMAC-SHA256
1817 // Size: 32 byte
1818 // Default: null or empty if the device identifier is not known
1819 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1820 // Connection handle of this connection if available
1821 // Range: 0x0000 - 0x0EFF (12 bits)
1822 // Default: 0xFFFF if the handle is unknown
1823 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001824 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001825 // Default: STATUS_UNKNOWN
1826 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1827 // Range: -30 ≤ N ≤ 20
1828 // Units: dBm
1829 // Invalid when an out of range value is reported
1830 optional int32 transmit_power_level = 4;
1831}
Jack Heab86dbd22018-12-18 15:43:27 -08001832
Tej Singh5d991e12018-03-09 19:48:11 -08001833/**
Jack He1021a612019-01-20 21:22:46 -08001834 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1835 * receiving an HCI command from the host
1836 *
1837 * Logged from: system/bt
1838 */
1839message BluetoothHciTimeoutReported {
1840 // HCI command associated with this event
1841 // Default: CMD_UNKNOWN
1842 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1843}
1844
1845/**
1846 * Logs when we receive Bluetooth Link Quality Report event from the controller
1847 * See Android Bluetooth HCI specification for more details
1848 *
1849 * Note: all count and bytes field are counted since last event
1850 *
1851 * Logged from: system/bt
1852 */
1853message BluetoothQualityReportReported {
1854 // Quality report ID
1855 // Original type: uint8_t
1856 // Default: BQR_ID_UNKNOWN
1857 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1858 // Packet type of the connection
1859 // Original type: uint8_t
1860 // Default: BQR_PACKET_TYPE_UNKNOWN
1861 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1862 // Connection handle of the connection
1863 // Original type: uint16_t
1864 optional int32 connection_handle = 3;
1865 // Performing Role for the connection
1866 // Original type: uint8_t
1867 optional int32 connection_role = 4;
1868 // Current Transmit Power Level for the connection. This value is the same as the controller's
1869 // response to the HCI_Read_Transmit_Power_Level HCI command
1870 // Original type: uint8_t
1871 optional int32 tx_power_level = 5;
1872 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1873 // absolute receiver signal strength value
1874 // Original type: int8_t
1875 optional int32 rssi = 6;
1876 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1877 // channels used by the link currently
1878 // Original type: uint8_t
1879 optional int32 snr = 7;
1880 // Indicates the number of unused channels in AFH_channel_map
1881 // Original type: uint8_t
1882 optional int32 unused_afh_channel_count = 8;
1883 // Indicates the number of the channels which are interfered and quality is bad but are still
1884 // selected for AFH
1885 // Original type: uint8_t
1886 optional int32 afh_select_unideal_channel_count = 9;
1887 // Current Link Supervision Timeout Setting
1888 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1889 // Original type: uint16_t
1890 optional int32 lsto = 10;
1891 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1892 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1893 // 0x01 (Piconet Clock)
1894 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1895 // Original type: uint32_t
1896 optional int64 connection_piconet_clock = 11;
1897 // The count of retransmission
1898 // Original type: uint32_t
1899 optional int64 retransmission_count = 12;
1900 // The count of no RX
1901 // Original type: uint32_t
1902 optional int64 no_rx_count = 13;
1903 // The count of NAK (Negative Acknowledge)
1904 // Original type: uint32_t
1905 optional int64 nak_count = 14;
1906 // Controller timestamp of last TX ACK
1907 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1908 // Original type: uint32_t
1909 optional int64 last_tx_ack_timestamp = 15;
1910 // The count of Flow-off (STOP)
1911 // Original type: uint32_t
1912 optional int64 flow_off_count = 16;
1913 // Controller timestamp of last Flow-on (GO)
1914 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1915 // Original type: uint32_t
1916 optional int64 last_flow_on_timestamp = 17;
1917 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1918 // Original type: uint32_t
1919 optional int64 buffer_overflow_bytes = 18;
1920 // Buffer underflow count (in byte) since last event
1921 // Original type: uint32_t
1922 optional int64 buffer_underflow_bytes = 19;
1923}
1924
1925/**
1926 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1927 *
1928 * Notes:
1929 * - Each event can be partially filled as we might learn different pieces of device
1930 * information at different time
1931 * - Multiple device info events can be combined to give more complete picture
1932 * - When multiple device info events tries to describe the same information, the
1933 * later one wins
1934 *
1935 * Logged from:
1936 * packages/apps/Bluetooth
1937 */
Jack Heaea26982019-04-04 11:19:48 -07001938message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08001939 // An identifier that can be used to match events for this device.
1940 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1941 // Salt: Randomly generated 256 bit value
1942 // Hash algorithm: HMAC-SHA256
1943 // Size: 32 byte
1944 // Default: null or empty if the device identifier is not known
1945 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1946 // Where is this device info obtained from
1947 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1948 // Name of the data source
1949 // For EXTERNAL: package name of the data source
1950 // For INTERNAL: null for general case, component name otherwise
1951 optional string source_name = 3;
1952 // Name of the manufacturer of this device
1953 optional string manufacturer = 4;
1954 // Model of this device
1955 optional string model = 5;
1956 // Hardware version of this device
1957 optional string hardware_version = 6;
1958 // Software version of this device
1959 optional string software_version = 7;
1960}
1961
1962/**
1963 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1964 * device, as documented by the Bluetooth Core HCI specification
1965 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1966 * Vol 2, Part E, Page 1118
1967 *
1968 * Logged from:
1969 * system/bt
1970 */
1971message BluetoothRemoteVersionInfoReported {
1972 // Connection handle of the connection
1973 // Original type: uint16_t
1974 optional int32 connection_handle = 1;
1975 // HCI command status code
1976 // Default: STATUS_UNKNOWN
1977 optional android.bluetooth.hci.StatusEnum hci_status = 2;
1978 // 1 byte Version of current LMP in the remote controller
1979 optional int32 lmp_version = 3;
1980 // 2 bytes LMP manufacturer code of the remote controller
1981 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
1982 optional int32 lmp_manufacturer_code = 4;
1983 // 4 bytes subversion of the LMP in the remote controller
1984 optional int32 lmp_subversion = 5;
1985}
1986
1987/**
1988 * Logs when certain Bluetooth SDP attributes are discovered
1989 * Constant definitions are from:
1990 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
1991 *
1992 * Current logged attributes:
1993 * - BluetoothProfileDescriptorList
1994 * - Supported Features Bitmask
1995 *
1996 * Logged from:
1997 * system/bt
1998 */
1999message BluetoothSdpAttributeReported {
2000 // An identifier that can be used to match events for this device.
2001 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2002 // Salt: Randomly generated 256 bit value
2003 // Hash algorithm: HMAC-SHA256
2004 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2005 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2006 // Original type: uint16_t
2007 optional int32 protocol_uuid = 2;
2008 // Short form UUIDs used to identify Bluetooth SDP attribute types
2009 // Original type: uint16_t
2010 optional int32 attribute_id = 3;
2011 // Attribute value for the particular attribute
2012 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2013}
2014
2015/**
2016 * Logs when bond state of a Bluetooth device changes
2017 *
2018 * Logged from:
2019 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2020 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2021 */
2022message BluetoothBondStateChanged {
2023 // An identifier that can be used to match events for this device.
2024 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2025 // Salt: Randomly generated 256 bit value
2026 // Hash algorithm: HMAC-SHA256
2027 // Size: 32 byte
2028 // Default: null or empty if the device identifier is not known
2029 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2030 // Preferred transport type to remote dual mode device
2031 // Default: TRANSPORT_AUTO means no preference
2032 optional android.bluetooth.TransportTypeEnum transport = 2;
2033 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2034 // Default: UNKNOWN
2035 optional android.bluetooth.DeviceTypeEnum type = 3;
2036 // Current bond state (NONE, BONDING, BONDED)
2037 // Default: BOND_STATE_UNKNOWN
2038 optional android.bluetooth.BondStateEnum bond_state = 4;
2039 // Bonding sub state
2040 // Default: BOND_SUB_STATE_UNKNOWN
2041 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2042 // Unbond Reason
2043 // Default: UNBOND_REASON_UNKNOWN
2044 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2045}
2046
2047/**
2048 * Logs there is an event related Bluetooth classic pairing
2049 *
2050 * Logged from:
2051 * system/bt
2052 */
2053message BluetoothClassicPairingEventReported {
2054 // An identifier that can be used to match events for this device.
2055 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2056 // Salt: Randomly generated 256 bit value
2057 // Hash algorithm: HMAC-SHA256
2058 // Size: 32 byte
2059 // Default: null or empty if the device identifier is not known
2060 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2061 // Connection handle of this connection if available
2062 // Range: 0x0000 - 0x0EFF (12 bits)
2063 // Default: 0xFFFF if the handle is unknown
2064 optional int32 connection_handle = 2;
2065 // HCI command associated with this event
2066 // Default: CMD_UNKNOWN
2067 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2068 // HCI event associated with this event
2069 // Default: EVT_UNKNOWN
2070 optional android.bluetooth.hci.EventEnum hci_event = 4;
2071 // HCI command status code if this is triggerred by hci_cmd
2072 // Default: STATUS_UNKNOWN
2073 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2074 // HCI reason code associated with this event
2075 // Default: STATUS_UNKNOWN
2076 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002077 // A status value related to this specific event
2078 // Default: 0
2079 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002080}
2081
2082/**
2083 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2084 *
2085 * Logged from:
2086 * system/bt
2087 */
2088message BluetoothSmpPairingEventReported {
2089 // An identifier that can be used to match events for this device.
2090 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2091 // Salt: Randomly generated 256 bit value
2092 // Hash algorithm: HMAC-SHA256
2093 // Size: 32 byte
2094 // Default: null or empty if the device identifier is not known
2095 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2096 // SMP command sent or received over L2CAP
2097 // Default: CMD_UNKNOWN
2098 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2099 // Whether this command is sent or received
2100 // Default: DIRECTION_UNKNOWN
2101 optional android.bluetooth.DirectionEnum direction = 3;
2102 // SMP failure reason code
2103 // Default: PAIRING_FAIL_REASON_DEFAULT
2104 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2105}
2106
2107/**
Jack He815cdba2019-01-30 17:24:55 -08002108 * Logs when a Bluetooth socket’s connection state changed
2109 *
2110 * Logged from:
2111 * system/bt
2112 */
2113message BluetoothSocketConnectionStateChanged {
2114 // An identifier that can be used to match events for this device.
2115 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2116 // Salt: Randomly generated 256 bit value
2117 // Hash algorithm: HMAC-SHA256
2118 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002119 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002120 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002121 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002122 // Default 0 when unknown or don't care
2123 optional int32 port = 2;
2124 // Socket type as mentioned in
2125 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2126 // Default: SOCKET_TYPE_UNKNOWN
2127 optional android.bluetooth.SocketTypeEnum type = 3;
2128 // Socket connection state
2129 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2130 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2131 // Number of bytes sent to remote device during this connection
2132 optional int64 tx_bytes = 5;
2133 // Number of bytes received from remote device during this connection
2134 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002135 // Socket owner's UID
2136 optional int32 uid = 7 [(is_uid) = true];
2137 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2138 // |port| must be spawned by |server_port|
2139 // Default 0 when unknown or don't care
2140 optional int32 server_port = 8;
2141 // Whether this is a server listener socket
2142 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002143}
2144
2145/**
Jack He71426802019-04-02 13:32:52 -07002146 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2147 *
2148 * Logged from:
2149 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2150 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2151 *
2152 */
2153message BluetoothClassOfDeviceReported {
2154 // An identifier that can be used to match events for this device.
2155 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2156 // Salt: Randomly generated 256 bit value
2157 // Hash algorithm: HMAC-SHA256
2158 // Size: 32 byte
2159 // Default: null or empty if this is a server listener socket
2160 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2161 // Class of Device (CoD) value including both Major, Minor device class and service class
2162 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2163 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2164 // Default: 0
2165 optional int32 class_of_device = 2;
2166}
2167
2168/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002169 * Logs when something is plugged into or removed from the USB-C connector.
2170 *
2171 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002172 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002173 */
2174message UsbConnectorStateChanged {
2175 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002176 STATE_DISCONNECTED = 0;
2177 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002178 }
2179 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002180 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002181 // Last active session in ms.
2182 // 0 when the port is in connected state.
2183 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002184}
2185
2186/**
2187 * Logs the reported speaker impedance.
2188 *
2189 * Logged from:
2190 * Vendor audio implementation.
2191 */
2192message SpeakerImpedanceReported {
2193 optional int32 speaker_location = 1;
2194 optional int32 impedance = 2;
2195}
2196
2197/**
2198 * Logs the report of a failed hardware.
2199 *
2200 * Logged from:
2201 * Vendor HALs.
2202 *
2203 */
2204message HardwareFailed {
2205 enum HardwareType {
2206 HARDWARE_FAILED_UNKNOWN = 0;
2207 HARDWARE_FAILED_MICROPHONE = 1;
2208 HARDWARE_FAILED_CODEC = 2;
2209 HARDWARE_FAILED_SPEAKER = 3;
2210 HARDWARE_FAILED_FINGERPRINT = 4;
2211 }
2212 optional HardwareType hardware_type = 1;
2213
Maggie White6dcd8572019-01-31 14:11:50 -08002214 /**
2215 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002216 * the same hardware_type. The specific locations are vendor defined integers,
2217 * referring to board-specific numbering schemes.
2218 */
2219 optional int32 hardware_location = 2;
2220
Maggie White6dcd8572019-01-31 14:11:50 -08002221 /**
2222 * failure_code is specific to the HardwareType of the failed hardware.
2223 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002224 */
Maggie White6dcd8572019-01-31 14:11:50 -08002225 enum HardwareErrorCode {
2226 UNKNOWN = 0;
2227 COMPLETE = 1;
2228 SPEAKER_HIGH_Z = 2;
2229 SPEAKER_SHORT = 3;
2230 FINGERPRINT_SENSOR_BROKEN = 4;
2231 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002232 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002233 }
2234 optional int32 failure_code = 3;
2235}
2236
2237/**
2238 * Log an event when the device has been physically dropped.
2239 * Reported from the /vendor partition.
2240 */
2241message PhysicalDropDetected {
2242 // Confidence that the event was actually a drop, 0 -> 100
2243 optional int32 confidence_pctg = 1;
2244 // Peak acceleration of the drop, in 1/1000s of a g.
2245 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002246 // Duration of freefall in ms
2247 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002248}
2249
2250/**
2251 * Log bucketed battery charge cycles.
2252 *
2253 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002254 * a given charge point. For example, if 10 cycle buckets are
2255 * initialized, bucket 1 is the lowest 1/10th of the battery,
2256 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002257 *
2258 * Logged from:
2259 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2260 */
2261message ChargeCyclesReported {
2262 optional int32 cycle_bucket_1 = 1;
2263 optional int32 cycle_bucket_2 = 2;
2264 optional int32 cycle_bucket_3 = 3;
2265 optional int32 cycle_bucket_4 = 4;
2266 optional int32 cycle_bucket_5 = 5;
2267 optional int32 cycle_bucket_6 = 6;
2268 optional int32 cycle_bucket_7 = 7;
2269 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002270 optional int32 cycle_bucket_9 = 9;
2271 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002272}
2273
2274/**
Howard Roa46b6582018-09-18 16:45:02 -07002275 * Log battery health snapshot.
2276 *
2277 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2278 * are snapshotted periodically over 24hrs.
2279 */
2280message BatteryHealthSnapshot {
2281 enum BatterySnapshotType {
2282 UNKNOWN = 0;
2283 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2284 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2285 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2286 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2287 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2288 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2289 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2290 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2291 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2292 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2293 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2294 }
2295 optional BatterySnapshotType type = 1;
2296 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002297 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002298 // Voltage Battery Voltage, in microVolts.
2299 optional int32 voltage_micro_volt = 3;
2300 // Current Battery current, in microAmps.
2301 optional int32 current_micro_amps = 4;
2302 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2303 optional int32 open_circuit_micro_volt = 5;
2304 // Resistance Battery Resistance, in microOhms.
2305 optional int32 resistance_micro_ohm = 6;
2306 // Level Battery Level, as % of full.
2307 optional int32 level_percent = 7;
2308}
2309
2310/**
2311 * Log slow I/O operations on the primary storage.
2312 */
2313message SlowIo {
2314 // Classifications of IO Operations.
2315 enum IoOperation {
2316 UNKNOWN = 0;
2317 READ = 1;
2318 WRITE = 2;
2319 UNMAP = 3;
2320 SYNC = 4;
2321 }
2322 optional IoOperation operation = 1;
2323
2324 // The number of slow IO operations of this type over 24 hours.
2325 optional int32 count = 2;
2326}
2327
2328/**
2329 * Log battery caused shutdown with the last recorded voltage.
2330 */
2331message BatteryCausedShutdown {
2332 // The last recorded battery voltage prior to shutdown.
2333 optional int32 last_recorded_micro_volt = 1;
2334}
2335
2336/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002337 * Logs the duration of a davey (jank of >=700ms) when it occurs
2338 *
2339 * Logged from:
2340 * frameworks/base/libs/hwui/JankTracker.cpp
2341 */
2342message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002343 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002344 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002345
Tej Singhbb8554a2018-01-26 11:59:14 -08002346 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002347 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002348}
2349
2350/**
Bookatze5885242017-10-24 20:10:31 -07002351 * Logs phone signal strength changes.
2352 *
2353 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002354 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002355 */
2356message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002357 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2358 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002359}
2360
Yangster4ccebea2018-10-09 17:09:02 -07002361
2362/**
2363 * Logs when the phone state, sim state or signal strength changes
2364 *
2365 * Logged from:
2366 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2367 */
2368message PhoneServiceStateChanged {
2369 optional android.telephony.ServiceStateEnum state = 1;
2370 optional android.telephony.SimStateEnum sim_state = 2;
2371 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2372}
2373
2374/**
2375 * Logs when the phone becomes on or off.
2376 *
2377 * Logged from:
2378 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2379 */
2380message PhoneStateChanged {
2381 enum State {
2382 OFF = 0;
2383 ON = 1;
2384 }
2385 optional State state = 1;
2386}
2387
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002388message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002389 optional android.stats.launcher.LauncherAction action = 1;
2390 optional android.stats.launcher.LauncherState src_state = 2;
2391 optional android.stats.launcher.LauncherState dst_state = 3;
2392 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002393 optional bool is_swipe_up_enabled = 5;
2394}
2395
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002396message StyleUIChanged {
2397 optional android.stats.style.Action action = 1;
2398 optional int32 color_package_hash = 2;
2399 optional int32 font_package_hash = 3;
2400 optional int32 shape_package_hash = 4;
2401 optional int32 clock_package_hash = 5;
2402 optional int32 launcher_grid = 6;
2403 optional int32 wallpaper_category_hash = 7;
2404 optional int32 wallpaper_id_hash = 8;
2405}
2406
David Chenc28b2bb2017-10-24 12:52:52 -07002407/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002408 * Logs when Settings UI has changed.
2409 *
2410 * Logged from:
2411 * packages/apps/Settings
2412 */
2413message SettingsUIChanged {
2414 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002415 * Where this SettingsUIChange event comes from. For example, if
2416 * it's a PAGE_VISIBLE event, where the page is opened from.
2417 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002418 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002419
2420 /**
2421 * What the UI action is.
2422 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002423 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002424
2425 /**
2426 * Where the action is happening
2427 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002428 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002429
2430 /**
2431 * What preference changed in this event.
2432 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002433 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002434
2435 /**
2436 * The new value of the changed preference.
2437 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002438 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002439}
2440
2441/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002442 * Logs basic timing information about touch events.
2443 * Reported at most every 5 minutes while device is being interacted with.
2444 *
2445 * Logged from:
2446 * frameworks/native/services/inputflinger
2447 */
2448message TouchEventReported {
2449 /**
2450 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2451 * and the standard deviation of latency between the kernel and framework
2452 * for touchscreen events. The units are microseconds.
2453 *
2454 * The number is measured as the difference between the time at which
2455 * the input event was received in the evdev driver,
2456 * and the time at which the input event was received in EventHub.
2457 */
2458 // Minimum value
2459 optional float latency_min_micros = 1;
2460 // Maximum value
2461 optional float latency_max_micros = 2;
2462 // Average value
2463 optional float latency_mean_micros = 3;
2464 // Standard deviation
2465 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002466 // Number of touch events (input_event) in this report
2467 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002468}
2469
2470/**
Philip Quinn0eded622019-01-29 12:46:28 -08002471 * Logs gesture classification and timing information for touch events.
2472 *
2473 * Logged from:
2474 * frameworks/base/core/java/android/view/GestureDetector.java
2475 * frameworks/base/core/java/android/view/View.java
2476 */
2477message TouchGestureClassified {
2478 // The source of the classification (e.g. Java class name).
2479 optional string source = 1;
2480
2481 enum Classification {
2482 UNKNOWN_CLASSIFICATION = 0;
2483 SINGLE_TAP = 1;
2484 DOUBLE_TAP = 2;
2485 LONG_PRESS = 3;
2486 DEEP_PRESS = 4;
2487 SCROLL = 5;
2488 }
2489 // The classification of the gesture.
2490 optional Classification classification = 2;
2491
2492 // The interval from the start of a touch event stream until the
2493 // classification was made.
2494 optional int32 latency_millis = 3;
2495
2496 // The distance from the location of the first touch event to the
2497 // location of the touch event when the classification was made.
2498 optional float displacement_px = 4;
2499}
2500
2501/**
David Chenc28b2bb2017-10-24 12:52:52 -07002502 * Logs that a setting was updated.
2503 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002504 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002505 * The tag and is_default allow resetting of settings to default values based on the specified
2506 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2507 */
2508message SettingChanged {
2509 // The name of the setting.
2510 optional string setting = 1;
2511
2512 // The change being imposed on this setting. May represent a number, eg "3".
2513 optional string value = 2;
2514
2515 // The new value of this setting. For most settings, this is same as value. For some settings,
2516 // value is +X or -X where X represents an element in a set. For example, if the previous value
2517 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2518 // The +/- feature is currently only used for location_providers_allowed.
2519 optional string new_value = 3;
2520
2521 // The previous value of this setting.
2522 optional string prev_value = 4;
2523
2524 // The tag used with the is_default for resetting sets of settings. This is generally null.
2525 optional string tag = 5;
2526
Bookatz90867622018-01-31 15:05:57 -08002527 // True if this setting with tag should be resettable.
2528 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002529
David Chenbd789912018-03-16 17:19:55 -07002530 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002531 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002532
2533 enum ChangeReason {
2534 UPDATED = 1; // Updated can be an insertion or an update.
2535 DELETED = 2;
2536 }
2537 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002538}
Chenjie Yub3dda412017-10-24 13:41:59 -07002539
Chenjie Yu05013b32017-11-21 10:21:41 -08002540/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002541 * Logs activity going to foreground or background
2542 *
2543 * Logged from:
2544 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2545 */
2546message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002547 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002548 optional string pkg_name = 2;
2549 optional string class_name = 3;
2550
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002551 enum State {
2552 BACKGROUND = 0;
2553 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002554 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002555 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002556}
David Chenc8a43242017-10-17 16:23:28 -07002557
2558/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002559 * Logs when a volume entered low Storage state.
2560 * Logged from:
2561 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2562 */
2563message LowStorageStateChanged {
2564 // Volume that ran out of storage.
2565 optional string volume_description = 1;
2566
2567 enum State {
2568 UNKNOWN = 0;
2569 OFF = 1;
2570 ON = 2;
2571 }
2572 optional State state = 2;
2573}
2574
2575/**
2576 * Logs when an app is downgraded.
2577 * Logged from:
2578 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2579 */
2580message AppDowngraded {
2581 optional string package_name = 1;
2582 // Size of the package (all data) before being downgraded.
2583 optional int64 size_in_bytes_before = 2;
2584 // Size of the package (all data) after being downgraded.
2585 optional int64 size_in_bytes_after = 3;
2586
2587 optional bool aggressive = 4;
2588}
2589
2590/**
2591 * Logs when an app is optimized after being downgraded.
2592 * Logged from:
2593 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2594 */
2595message AppOptimizedAfterDowngraded {
2596 optional string package_name = 1;
2597}
2598
2599/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002600 * Logs whenever an app is installed on external storage.
2601 * Logged from:
2602 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2603 */
2604message AppInstallOnExternalStorageReported {
2605 // The type of external storage.
2606 optional android.stats.storage.ExternalStorageType storage_type = 1;
2607 // The name of the package that is installed on the sd card.
2608 optional string package_name = 2;
2609}
2610
2611/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002612 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002613 * Logged from:
2614 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2615 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002616message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002617 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002618
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002619 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002620
2621 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002622 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002623 optional string process_name = 3;
2624
2625 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002626 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002627
2628 optional string package_name = 5;
2629
2630 enum InstantApp {
2631 UNAVAILABLE = 0;
2632 FALSE = 1;
2633 TRUE = 2;
2634 }
2635 optional InstantApp is_instant_app = 6;
2636
2637 enum ForegroundState {
2638 UNKNOWN = 0;
2639 BACKGROUND = 1;
2640 FOREGROUND = 2;
2641 }
2642 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002643
2644 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002645}
David Chen9e3808c2017-11-20 17:25:34 -08002646
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002647/**
2648 * Logs when a WTF (What a Terrible Failure) happened.
2649 * Logged from:
2650 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2651 */
2652message WTFOccurred {
2653 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002654
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002655 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002656
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002657 // The name of the process.
2658 // system_server if it is not by an app
2659 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002660
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002661 // The pid if available. -1 means not available.
2662 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002663
2664 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002665}
2666
2667/**
2668 * Logs when system server reports low memory.
2669 * Logged from:
2670 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2671 */
2672message LowMemReported {
2673}
2674
2675/**
2676 * Logs when an app ANR (App Not Responding) occurs.
2677 * Logged from:
2678 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2679 */
2680message ANROccurred {
2681 optional int32 uid = 1 [(is_uid) = true];
2682
2683 optional string process_name = 2;
2684
2685 optional string short_component_name = 3;
2686
2687 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002688
2689 enum InstantApp {
2690 UNAVAILABLE = 0;
2691 FALSE = 1;
2692 TRUE = 2;
2693 }
2694 optional InstantApp is_instant_app = 5;
2695
2696 enum ForegroundState {
2697 UNKNOWN = 0;
2698 BACKGROUND = 1;
2699 FOREGROUND = 2;
2700 }
2701 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002702
2703 optional android.server.ErrorSource error_source = 7;
2704
2705 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002706}
2707
Bookatza7020bd2018-08-28 16:29:35 -07002708/**
2709 * Logs when the vibrator state changes.
2710 * Logged from:
2711 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2712 */
2713message VibratorStateChanged {
2714 repeated AttributionNode attribution_node = 1;
2715
2716 enum State {
2717 OFF = 0;
2718 ON = 1;
2719 }
2720 optional State state = 2;
2721
2722 // Duration (in milliseconds) requested to keep the vibrator on.
2723 // Only applicable for State == ON.
2724 optional int64 duration_millis = 3;
2725}
2726
David Chen0a368b22017-12-06 16:28:16 -08002727/*
2728 * Allows other apps to push events into statsd.
2729 * Logged from:
2730 * frameworks/base/core/java/android/util/StatsLog.java
2731 */
David Chen0b5c90c2018-01-25 16:51:49 -08002732message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002733 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002734 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002735
2736 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2737 optional int32 label = 2;
2738
2739 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2740 // predicates for the metrics).
2741 enum State {
2742 UNKNOWN = 0;
2743 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2744 STOP = 2;
2745 START = 3;
2746 }
2747 optional State state = 3;
2748}
2749
David Chen9e3808c2017-11-20 17:25:34 -08002750/**
Bookatz7948c872018-09-04 12:58:33 -07002751 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2752 * For example, this could be due to the user manually changing the time.
2753 *
2754 * Logged from:
2755 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2756 */
2757message WallClockTimeShifted {
2758 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2759 optional int64 wall_clock_timestamp_millis = 1;
2760}
2761
2762/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002763 * Logs when statsd detects an anomaly.
2764 *
2765 * Logged from:
2766 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2767 */
2768message AnomalyDetected {
2769 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002770 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002771
Yangster-mac94e197c2018-01-02 16:03:03 -08002772 // Id of the config whose anomaly detection alert fired.
2773 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002774
Yangster-mac94e197c2018-01-02 16:03:03 -08002775 // Id of the alert (i.e. name of the anomaly that was detected).
2776 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002777}
2778
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002779message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002780 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002781 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002782
2783 // The app package name.
2784 optional string pkg_name = 2;
2785
2786 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002787 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002788 WARM = 1;
2789 HOT = 2;
2790 COLD = 3;
2791 }
2792 // The transition type.
2793 optional TransitionType type = 3;
2794
2795 // The activity name.
2796 optional string activity_name = 4;
2797
2798 // The name of the calling app. Empty if not set.
2799 optional string calling_pkg_name = 5;
2800
2801 // Whether the app is an instant app.
2802 optional bool is_instant_app = 6;
2803
2804 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002805 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002806
Bookatz80d11a02018-01-16 10:46:35 -08002807 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002808
David Chen0b5c90c2018-01-25 16:51:49 -08002809 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002810 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002811 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002812 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002813 optional int32 bind_application_delay_millis = 11;
2814 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002815
2816 // Empty if not set.
2817 optional string launch_token = 13;
2818
Calin Juravle759fbda2018-02-20 19:52:30 +00002819 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002820 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002821
2822 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002823 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002824}
2825
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002826message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002827 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002828 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002829
2830 // The app package name.
2831 optional string pkg_name = 2;
2832
2833 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002834 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002835 WARM = 1;
2836 HOT = 2;
2837 COLD = 3;
2838 }
2839 // The transition type.
2840 optional TransitionType type = 3;
2841
2842 // The activity name.
2843 optional string activity_name = 4;
2844}
2845
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002846message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002847 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002848 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002849
2850 // The app package name.
2851 optional string pkg_name = 2;
2852
2853 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002854 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002855 WITH_BUNDLE = 1;
2856 WITHOUT_BUNDLE = 2;
2857 }
2858 // The transition type.
2859 optional TransitionType type = 3;
2860
2861 // The activity name.
2862 optional string activity_name = 4;
2863
2864 optional bool transition_process_running = 5;
2865
2866 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002867 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002868}
2869
Bookatz8fcd09a2017-12-18 13:01:10 -08002870/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002871 * Logs a picture-in-picture action
2872 * Logged from:
2873 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2874 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2875 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2876 */
2877message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002878 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002879 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002880
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002881 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002882
Chenjie Yu52cacc62017-12-08 18:11:45 -08002883 enum State {
2884 ENTERED = 1;
2885 EXPANDED_TO_FULL_SCREEN = 2;
2886 MINIMIZED = 3;
2887 DISMISSED = 4;
2888 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002889 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002890}
2891
2892/**
Chenjie Yue8904192017-12-08 19:12:57 -08002893 * Logs overlay action
2894 * Logged from:
2895 * services/core/java/com/android/server/wm/Session.java
2896 */
2897message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002898 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002899
2900 optional string package_name = 2;
2901
2902 optional bool using_alert_window = 3;
2903
2904 enum State {
2905 ENTERED = 1;
2906 EXITED = 2;
2907 }
2908 optional State state = 4;
2909}
2910
Chenjie Yuccfe6452018-01-30 11:33:21 -08002911/*
2912 * Logs foreground service starts and stops.
2913 * Note that this is not when a service starts or stops, but when it is
2914 * considered foreground.
2915 * Logged from
2916 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2917 */
2918message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002919 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002920 // package_name + "/" + class_name
2921 optional string short_name = 2;
2922
2923 enum State {
2924 ENTER = 1;
2925 EXIT = 2;
2926 }
2927 optional State state = 3;
2928}
2929
Chenjie Yue8904192017-12-08 19:12:57 -08002930/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002931 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2932 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2933 * attributed back to the parent (host) uid. One example is Chrome.
2934 *
2935 * Logged from:
2936 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2937 */
2938message IsolatedUidChanged {
2939 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002940 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002941 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002942 optional int32 parent_uid = 1;
2943
2944 optional int32 isolated_uid = 2;
2945
2946 // We expect an isolated uid to be removed before if it's used for another parent uid.
2947 enum Event {
2948 REMOVED = 0;
2949 CREATED = 1;
2950 }
2951 optional Event event = 3;
2952}
2953
2954/*
2955 * Logs the reception of an incoming network packet causing the main system to wake up for
2956 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2957 * and processed by WakeupController.cpp.
2958 */
2959message PacketWakeupOccurred {
2960 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2961 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002962 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002963 // The interface name on which the packet was received.
2964 optional string iface = 2;
2965 // The ethertype value of the packet.
2966 optional int32 ethertype = 3;
2967 // String representation of the destination MAC address of the packet.
2968 optional string destination_hardware_address = 4;
2969 // String representation of the source address of the packet if this was an IP packet.
2970 optional string source_ip = 5;
2971 // String representation of the destination address of the packet if this was an IP packet.
2972 optional string destination_ip = 6;
2973 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2974 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2975 // families.
2976 optional int32 ip_next_header = 7;
2977 // The source port if this was a TCP or UDP packet.
2978 optional int32 source_port = 8;
2979 // The destination port if this was a TCP or UDP packet.
2980 optional int32 destination_port = 9;
2981}
2982
2983/*
2984 * Logs the memory stats for an app on startup.
2985 * Logged from:
2986 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2987 */
2988message AppStartMemoryStateCaptured {
2989 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002990 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002991
2992 // The process name.
2993 optional string process_name = 2;
2994
2995 // The activity name.
2996 optional string activity_name = 3;
2997
2998 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002999 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003000
3001 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003002 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003003
3004 // RSS
3005 optional int64 rss_in_bytes = 6;
3006
3007 // CACHE
3008 optional int64 cache_in_bytes = 7;
3009
3010 // SWAP
3011 optional int64 swap_in_bytes = 8;
3012}
3013
3014/*
3015 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3016 * for LMK event.
3017 * Logged from:
3018 * system/core/lmkd/lmkd.c
3019 */
3020message LmkStateChanged {
3021 enum State {
3022 UNKNOWN = 0;
3023 START = 1;
3024 STOP = 2;
3025 }
3026 optional State state = 1;
3027}
3028
3029/*
3030 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3031 * Logged from:
3032 * system/core/lmkd/lmkd.c
3033 */
3034message LmkKillOccurred {
3035 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003036 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003037
3038 // The process name.
3039 optional string process_name = 2;
3040
3041 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003042 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003043
3044 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003045 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003046
3047 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003048 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003049
3050 // RSS
3051 optional int64 rss_in_bytes = 6;
3052
3053 // CACHE
3054 optional int64 cache_in_bytes = 7;
3055
3056 // SWAP
3057 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003058
3059 // The elapsed real time of start of the process.
3060 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003061
3062 // Min oom adj score considered by lmkd.
3063 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003064}
3065
Rajeev Kumar51b54602018-03-01 12:18:26 -08003066/*
3067 * Logs when the ActivityManagerService detects that an app died.
3068 *
3069 * Logged from:
3070 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3071 */
3072message AppDied {
3073 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003074 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003075}
3076
Howard Ro21a039c2018-08-06 14:55:47 -07003077/**
3078 * An atom for generic metrics logging. Available from Android Q.
3079 */
3080message GenericAtom {
3081 // The uid of the application that sent this custom atom.
3082 optional int32 uid = 1 [(is_uid) = true];
3083
3084 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003085 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003086}
3087
Tej Singhd6d6d772018-09-05 17:41:25 -07003088/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003089 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003090 *
3091 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003092 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003093 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003094message BiometricAcquired {
3095 // Biometric modality that was acquired.
3096 optional android.hardware.biometrics.ModalityEnum modality = 1;
3097 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3098 optional int32 user = 2;
3099 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3100 optional bool is_crypto = 3;
3101 // Action that the device is performing. Acquired messages are only expected for enroll and
3102 // authenticate. Other actions may indicate an error.
3103 optional android.hardware.biometrics.ActionEnum action = 4;
3104 // The client that this acquisition was received for.
3105 optional android.hardware.biometrics.ClientEnum client = 5;
3106 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3107 optional int32 acquire_info = 6;
3108 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3109 optional int32 acquire_info_vendor = 7;
Tej Singhd6d6d772018-09-05 17:41:25 -07003110}
3111
3112/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003113 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003114 *
3115 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003116 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003117 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003118message BiometricAuthenticated {
3119 // Biometric modality that was used.
3120 optional android.hardware.biometrics.ModalityEnum modality = 1;
3121 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3122 optional int32 user = 2;
3123 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3124 // storage.
3125 optional bool is_crypto = 3;
3126 // The client that this acquisition was received for.
3127 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003128 // If authentication requires user confirmation. See BiometricPrompt's
3129 // setRequireConfirmation(bool) method.
3130 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003131
Kevin Chyn1741a072019-01-17 11:54:40 -08003132 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003133 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003134 REJECTED = 1;
3135 PENDING_CONFIRMATION = 2;
3136 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003137 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003138
3139 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003140 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003141 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3142 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3143 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3144 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003145 optional int64 latency_millis = 7;
Kevin Chyn1741a072019-01-17 11:54:40 -08003146}
3147
3148/**
3149 * Logs when a biometric error occurs.
3150 *
3151 * Logged from:
3152 * frameworks/base/services/core/java/com/android/server/biometrics
3153 */
3154message BiometricErrorOccurred {
3155 // Biometric modality that was used.
3156 optional android.hardware.biometrics.ModalityEnum modality = 1;
3157 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3158 optional int32 user = 2;
3159 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3160 optional bool is_crypto = 3;
3161 // Action that the device is performing.
3162 optional android.hardware.biometrics.ActionEnum action = 4;
3163 // The client that this acquisition was received for.
3164 optional android.hardware.biometrics.ClientEnum client = 5;
3165 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3166 // are unique to modality.
3167 optional int32 error_info = 6;
3168 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3169 // by the vendor and not specified by the HIDL interface.
3170 optional int32 error_info_vendor = 7;
3171}
3172
3173/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003174 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003175 * Logged from:
3176 * frameworks/base/services/core/java/com/android/server/biometrics
3177 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003178message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003179 // Biometric modality.
3180 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003181 // Type of issue detected.
3182 optional android.hardware.biometrics.IssueEnum issue = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07003183}
Howard Ro688ae182018-09-25 00:09:36 -07003184
joshmccloskey6f952b22019-03-25 20:59:35 -07003185/**
3186 * Logs when a biometric enrollment occurs.
3187 *
3188 * Logged from:
3189 * frameworks/base/services/core/java/com/android/server/biometrics
3190 */
3191message BiometricEnrolled {
3192 // Biometric modality that was used.
3193 optional android.hardware.biometrics.ModalityEnum modality = 1;
3194 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3195 optional int32 user = 2;
3196 // The amount of time the enrollment took in milliseconds.
3197 optional int64 latency_millis = 3;
3198 // Whether or not the enrollment was successful.
3199 optional bool success = 4;
3200}
3201
Howard Ro688ae182018-09-25 00:09:36 -07003202message Notification {
3203
3204 // Type of notification event.
3205 enum Type {
3206 TYPE_UNKNOWN = 0;
3207 // Notification became visible to the user.
3208 TYPE_OPEN = 1;
3209 // Notification became hidden.
3210 TYPE_CLOSE = 2;
3211 // Notification switched to detail mode.
3212 TYPE_DETAIL = 3;
3213 // Notification was clicked.
3214 TYPE_ACTION = 4;
3215 // Notification was dismissed.
3216 TYPE_DISMISS = 5;
3217 // Notification switched to summary mode. The enum value of 14 is to
3218 // match that of metrics_constants.
3219 TYPE_COLLAPSE = 14;
3220 }
3221 optional Type type = 1;
3222
3223 // Package name associated with the notification.
3224 optional string package_name = 2;
3225
3226 // Tag associated with notification.
3227 optional string tag = 3;
3228
3229 // Application-supplied ID associated with the notification.
3230 optional int32 id = 4;
3231
3232 // Index of notification in the notification panel.
3233 optional int32 shade_index = 5;
3234
3235 // The number of notifications in the notification panel.
3236 optional int32 shade_count = 6;
3237
3238 // Importance for the notification.
3239 optional int32 importance = 7;
3240
3241 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07003242 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07003243
3244 // Importance for the notification channel.
3245 optional int32 channel_importance = 9;
3246
Howard Ro183c2bd2018-10-18 13:52:10 -07003247 // Application-supplied ID associated with the notifications group.
3248 optional string group_id = 10;
3249
Howard Ro688ae182018-09-25 00:09:36 -07003250 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07003251 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07003252
Howard Ro183c2bd2018-10-18 13:52:10 -07003253 // Reason for dismissal of a notification. This field is only meaningful for
3254 // TYPE_DISMISS events.
3255 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07003256
Howard Ro183c2bd2018-10-18 13:52:10 -07003257 // The first post time of notification, stable across updates.
3258 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07003259
Howard Ro183c2bd2018-10-18 13:52:10 -07003260 // The most recent interruption time, or the creation time if no updates.
3261 // Differs from update_millis because updates are filtered based on whether
3262 // they actually interrupted the user.
3263 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07003264
Howard Ro183c2bd2018-10-18 13:52:10 -07003265 // The most recent update time, or the creation time if no updates.
3266 optional int64 update_millis = 15;
3267
3268 // The most recent visibility event.
3269 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07003270}
3271
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003272/*
Tej Singh0d176952019-01-16 19:10:54 -08003273 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003274 */
Tej Singh0d176952019-01-16 19:10:54 -08003275message FlagFlipUpdateOccurred {
3276 // If the event is from a flag config package, specify the package name.
3277 optional string flag_flip_package_name = 1;
3278
3279 // The order id of the package
3280 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003281}
3282
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003283/**
3284 * Potential experiment ids that goes with a train install.
3285 */
3286message TrainExperimentIds {
3287 repeated int64 experiment_id = 1;
3288}
3289
Yangster-macb89807e2018-11-15 21:10:57 -08003290/*
3291 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003292 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003293 */
3294message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003295 // Name of the train.
3296 optional string train_name = 1;
3297 // Version code for a "train" of packages that need to be installed atomically
3298 optional int64 train_version_code = 2;
3299 // After installation of this package, device requires a restart.
3300 optional bool requires_staging = 3;
3301 // Rollback should be enabled for this install.
3302 optional bool rollback_enabled = 4;
3303 // Requires low latency monitoring if possible.
3304 optional bool requires_low_latency_monitor = 5;
3305
Yangster-macb89807e2018-11-15 21:10:57 -08003306 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003307 UNKNOWN = 0;
3308 INSTALL_REQUESTED = 1;
3309 INSTALL_STARTED = 2;
3310 INSTALL_STAGED_NOT_READY = 3;
3311 INSTALL_STAGED_READY = 4;
3312 INSTALL_SUCCESS = 5;
3313 INSTALL_FAILURE = 6;
3314 INSTALL_CANCELLED = 7;
3315 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003316 INSTALLER_ROLLBACK_INITIATED = 9;
3317 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3318 INSTALLER_ROLLBACK_STAGED = 11;
3319 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3320 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3321 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3322 INSTALLER_ROLLBACK_SUCCESS = 15;
3323 INSTALLER_ROLLBACK_FAILURE = 16;
3324 INSTALLER_ROLLBACK_CANCEL_STAGED_REMOVE_FROM_QUEUE = 17;
3325 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_INITIATED = 18;
3326 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_SUCCESS = 19;
3327 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_FAILURE = 20;
Howard Ro3a662af2019-03-29 18:16:54 -07003328 INSTALL_STAGED_CANCEL_REQUESTED = 21;
3329 INSTALL_STAGED_CANCEL_SUCCESS = 22;
3330 INSTALL_STAGED_CANCEL_FAILURE = 23;
Yangster-macb89807e2018-11-15 21:10:57 -08003331 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003332 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003333 // Possible experiment ids for monitoring this push.
3334 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3335 // user id
3336 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003337}
3338
Maggie Whitefc1aa592018-11-28 21:55:23 -08003339/** Represents USB port overheat event. */
3340message UsbPortOverheatEvent {
3341 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3342 optional int32 plug_temperature_deci_c = 1;
3343
3344 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3345 optional int32 max_temperature_deci_c = 2;
3346
3347 /* Time between USB plug event and overheat threshold trip, in seconds. */
3348 optional int32 time_to_overheat_secs = 3;
3349
3350 /* Time between overheat threshold trip and hysteresis, in seconds. */
3351 optional int32 time_to_hysteresis_secs = 4;
3352
3353 /* Time between hysteresis and active mitigation ending, in seconds. */
3354 optional int32 time_to_inactive_secs = 5;
3355};
3356
Maggie White8735b852019-01-18 11:40:49 -08003357/**
3358 * Logs total effective full charge and discharge cycles on a battery.
3359 * Here are some examples of one effective cycle:
3360 * 1) the battery charges from 0% to 100% and drains back to 0%,
3361 * 2) charging from 50% to 100% and draining back to 50% twice.
3362 * Pulled from:
3363 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3364 */
3365message BatteryCycleCount {
3366 /* Number of total charge and discharge cycles on the system battery. */
3367 optional int32 cycle_count = 1;
3368}
3369
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003370/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003371 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3372 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003373 * Pulled from:
3374 * StatsCompanionService
3375 */
3376
Carmen Agimof12dec122019-03-06 16:14:38 +00003377message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003378
Carmen Agimof12dec122019-03-06 16:14:38 +00003379 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003380 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003381 PUBLIC = 1;
3382 PRIVATE = 2;
3383 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003384 }
3385
Carmen Agimof12dec122019-03-06 16:14:38 +00003386 // The type of external storage.
3387 optional android.stats.storage.ExternalStorageType storage_type = 1;
3388 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3389 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003390 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003391 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003392}
3393
Yangster-macb89807e2018-11-15 21:10:57 -08003394/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003395 * Logs when a connection becomes available and lost.
3396 * Logged in StatsCompanionService.java
3397 */
3398message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003399 // Id of the network.
3400 optional int32 net_id = 1;
3401
3402 enum State {
3403 UNKNOWN = 0;
3404 CONNECTED = 1;
3405 DISCONNECTED = 2;
3406 }
3407 // Connected state of a network.
3408 optional State state = 2;
3409}
3410
3411/**
3412 * Logs when a service starts and stops.
3413 * Logged from:
3414 * services/core/java/com/android/server/am/ActiveServices.java
3415 */
3416message ServiceStateChanged {
3417
3418 optional int32 uid = 1 [(is_uid) = true];
3419
3420 optional string package_name = 2;
3421
3422 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003423
3424 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003425 START = 1;
3426 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003427 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003428
3429 optional State state = 4;
3430}
3431
3432/**
3433 * Logs when a service is launched.
3434 * Logged from:
3435 * services/core/java/com/android/server/am/ActiveServices.java
3436 */
3437message ServiceLaunchReported {
3438
3439 optional int32 uid = 1 [(is_uid) = true];
3440
3441 optional string package_name = 2;
3442
3443 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003444}
Howard Ro688ae182018-09-25 00:09:36 -07003445
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003446/**
3447 * Logs when a hidden API is used.
3448 *
3449 * Logged from:
3450 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3451 */
3452message HiddenApiUsed {
3453 // The uid of the app making the hidden access.
3454 optional int32 uid = 1 [(is_uid) = true];
3455
3456 // Signature of the method or field accessed.
3457 optional string signature = 2;
3458
3459 enum AccessMethod {
3460 NONE = 0;
3461 REFLECTION = 1;
3462 JNI = 2;
3463 LINKING = 3;
3464 }
3465
3466 // Type of access.
3467 optional AccessMethod access_method = 3;
3468
3469 // Whether the access was prevented or not.
3470 optional bool access_denied = 4;
3471}
3472
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003473/**
3474 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3475 * - When user sees privacy chip
3476 * - When user clicks privacy chip
3477 * - How does the user exit the Privacy Dialog
3478 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003479 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3480 */
3481message PrivacyIndicatorsInteracted {
3482
3483 enum Type {
3484 UNKNOWN = 0;
3485 CHIP_VIEWED = 1;
3486 CHIP_CLICKED = 2;
3487 DIALOG_PRIVACY_SETTINGS = 3;
3488 DIALOG_DISMISS = 4;
3489 DIALOG_LINE_ITEM = 5;
3490 }
3491
3492 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3493
3494 // Used if the type is LINE_ITEM
3495 optional string package_name = 2;
3496}
3497
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003498/**
3499 * Logs information about a package that is moved from the internal to external storage and vice
3500 * versa.
3501 * It logs the package name, the type of the external storage where the package is installed
3502 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3503 * and the move type: if it's from internal to external or the other way around.
3504 *
3505 * Logged from:
3506 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3507 */
3508message AppMovedStorageReported {
3509 enum MoveType {
3510 UNKNOWN = 0;
3511 TO_EXTERNAL = 1;
3512 TO_INTERNAL = 2;
3513 }
3514 // The type of the external storage.
3515 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3516 // The type of move.
3517 optional MoveType move_type = 2;
3518 // The name of the package that was moved.
3519 optional string package_name = 3;
3520}
3521
jianjin8f2dee02019-03-29 14:03:08 -07003522/**
3523 * Logs when system server watchdog occurs.
3524 * Logged from:
3525 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3526 */
3527message SystemServerWatchdogOccurred {
3528 optional string subject = 1;
3529}
3530
3531/**
3532 * Logs when new file added to tombstones.
3533 * Logged from:
3534 * frameworks/base/core/java/com/android/server/BootReceiver.java
3535 */
3536message TombStoneOccurred {
3537}
3538
Chenjie Yubbcbc602018-02-05 16:51:52 -08003539//////////////////////////////////////////////////////////////////////
3540// Pulled atoms below this line //
3541//////////////////////////////////////////////////////////////////////
3542
3543/**
David Chenc8a43242017-10-17 16:23:28 -07003544 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3545 *
3546 * Pulled from:
3547 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3548 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003549message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003550 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003551
3552 optional int64 rx_bytes = 2;
3553
3554 optional int64 rx_packets = 3;
3555
3556 optional int64 tx_bytes = 4;
3557
3558 optional int64 tx_packets = 5;
3559}
3560
3561/**
3562 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3563 *
3564 * Pulled from:
3565 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3566 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003567message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003568 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003569
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003570 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3571 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003572
3573 optional int64 rx_bytes = 3;
3574
3575 optional int64 rx_packets = 4;
3576
3577 optional int64 tx_bytes = 5;
3578
3579 optional int64 tx_packets = 6;
3580}
3581
3582/**
3583 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3584 *
3585 * Pulled from:
3586 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3587 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003588message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003589 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003590
3591 optional int64 rx_bytes = 2;
3592
3593 optional int64 rx_packets = 3;
3594
3595 optional int64 tx_bytes = 4;
3596
3597 optional int64 tx_packets = 5;
3598}
3599
3600/**
3601 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3602 *
3603 * Pulled from:
3604 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3605 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003606message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003607 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003608
Yao Chenc40a19d2018-03-15 16:48:25 -07003609 // 1 denotes foreground and 0 denotes background. This is called Set in
3610 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003611 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003612
3613 optional int64 rx_bytes = 3;
3614
3615 optional int64 rx_packets = 4;
3616
3617 optional int64 tx_bytes = 5;
3618
3619 optional int64 tx_packets = 6;
3620}
3621
3622/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003623 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3624 *
3625 * Pulled from:
3626 * StatsCompanionService
3627 */
3628message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003629 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003630
3631 optional int64 rx_bytes = 2;
3632
3633 optional int64 tx_bytes = 3;
3634}
3635
3636/**
David Chenc8a43242017-10-17 16:23:28 -07003637 * Pulls the kernel wakelock durations. This atom is adapted from
3638 * android/internal/os/KernelWakelockStats.java
3639 *
3640 * Pulled from:
3641 * StatsCompanionService using KernelWakelockReader.
3642 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003643message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003644 optional string name = 1;
3645
3646 optional int32 count = 2;
3647
3648 optional int32 version = 3;
3649
Yangster-maca8a30442018-10-13 23:46:34 -07003650 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003651}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003652
Chenjie Yu05013b32017-11-21 10:21:41 -08003653/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003654 * Pulls low power state information. If power.stats HAL is not available, this
3655 * includes platform and subsystem sleep state information,
3656 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3657 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003658 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003659 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003660 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3661 * as defined in:
3662 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003663 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003664message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003665 // Subsystem name
3666 optional string subsystem_name = 1;
3667 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3668 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003669 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3670 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003671 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003672 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003673 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003674 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003675 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003676}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003677
Chenjie Yu05013b32017-11-21 10:21:41 -08003678/**
Bookatz92da2832018-11-01 18:10:03 -07003679 * Pulls on-device power measurement information.
3680 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3681 * Pulled from:
3682 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3683 */
3684message OnDevicePowerMeasurement {
3685 // Name of the subsystem (to which the rail belongs).
3686 optional string subsystem_name = 1;
3687
3688 // Rail name. The rail lies within the subsystem.
3689 optional string rail_name = 2;
3690
3691 // Time (in ms since boot) at which the rail energy value was measured.
3692 // This may differ slightly from the time that statsd logs this information.
3693 optional uint64 measurement_timestamp_millis = 3;
3694
3695 // Accumulated energy used via the rail since device boot in uWs.
3696 optional uint64 energy_microwatt_secs = 4;
3697}
3698
3699/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003700 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003701 * Pulls the time the cpu spend on the frequency index. Frequency index
3702 * starts from highest to lowest. The value should be monotonically
3703 * increasing since boot. However, if there is a cpu
3704 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003705 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003706message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003707 optional uint32 cluster = 1;
3708 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003709 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003710}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003711
Chenjie Yu05013b32017-11-21 10:21:41 -08003712/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003713 * Pulls Cpu Time Per Uid.
3714 * Note that isolated process uid time should be attributed to host uids.
3715 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003716message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003717 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003718 optional uint64 user_time_micros = 2;
3719 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003720}
3721
3722/**
3723 * Pulls Cpu Time Per Uid per frequency.
3724 * Note that isolated process uid time should be attributed to host uids.
3725 * For each uid, we order the time by descending frequencies.
3726 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003727message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003728 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003729 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003730 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003731}
Hugo Benichi884970e2017-11-14 22:42:46 +09003732
Chenjie Yu05013b32017-11-21 10:21:41 -08003733/**
3734 * Pulls Wifi Controller Activity Energy Info
3735 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003736message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003737 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003738 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003739 // stack reported state
3740 // TODO: replace this with proto enum
3741 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003742 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003743 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003744 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003745 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003746 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003747 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003748 // product of current(mA), voltage(V) and time(ms)
3749 optional uint64 controller_energy_used = 6;
3750}
3751
3752/**
3753 * Pulls Modem Activity Energy Info
3754 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003755message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003756 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003757 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003758 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003759 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003760 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003761 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003762 /**
3763 * Tx power index
3764 * index 0 = tx_power < 0dBm
3765 * index 1 = 0dBm < tx_power < 5dBm
3766 * index 2 = 5dBm < tx_power < 15dBm
3767 * index 3 = 15dBm < tx_power < 20dBm
3768 * index 4 = tx_power > 20dBm
3769 */
3770 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003771 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003772 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003773 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003774 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003775 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003776 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003777 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003778 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003779 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003780 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003781 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003782 // product of current(mA), voltage(V) and time(ms)
3783 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003784}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003785
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003786/**
3787 * Pulls Bluetooth Activity Energy Info
3788 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3789 */
3790message BluetoothActivityInfo {
3791 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003792 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003793 // bluetooth stack state
3794 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003795 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003796 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003797 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003798 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003799 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003800 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003801 // product of current(mA), voltage(V) and time(ms)
3802 optional uint64 energy_used = 6;
3803}
3804
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003805/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003806 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003807 *
3808 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003809 */
3810message ProcessMemoryState {
3811 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003812 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003813
3814 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003815 // Usually package name, "system" for system server.
3816 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003817 optional string process_name = 2;
3818
Rafal Slawikda51b932018-12-13 16:31:33 +00003819 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003820 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003821
3822 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003823 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003824
3825 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003826 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003827
Rajeev Kumar90235992018-01-29 11:06:48 -08003828 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003829 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3830 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003831 optional int64 rss_in_bytes = 6;
3832
3833 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003834 // Value is read from memory.stat, field total_cache if per-app memory
3835 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003836 optional int64 cache_in_bytes = 7;
3837
3838 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003839 // Value is read from memory.stat, field total_swap if per-app memory
3840 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003841 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003842
Rafal Slawikd03ae422018-11-20 11:27:45 +00003843 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003844 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003845
3846 // Elapsed real time when the process started.
3847 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3848 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003849}
3850
3851/*
Rafal Slawik08621582018-10-15 14:53:07 +01003852 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003853 *
3854 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003855 */
3856message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003857 // The uid if available. -1 means not available.
3858 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003859
Rafal Slawikbf67d072018-10-23 11:07:54 +01003860 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003861 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003862 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003863
Rafal Slawikbf67d072018-10-23 11:07:54 +01003864 // # of page-faults
3865 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003866
Rafal Slawikbf67d072018-10-23 11:07:54 +01003867 // # of major page-faults
3868 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003869
Rafal Slawikbf67d072018-10-23 11:07:54 +01003870 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003871 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003872 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003873
Rafal Slawikd03ae422018-11-20 11:27:45 +00003874 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003875 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003876
3877 // Elapsed real time when the process started.
3878 // Value is read from /proc/PID/stat, field 22.
3879 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01003880}
3881
3882/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003883 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003884 *
3885 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3886 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003887 *
3888 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003889 */
3890message ProcessMemoryHighWaterMark {
3891 // The uid if available. -1 means not available.
3892 optional int32 uid = 1 [(is_uid) = true];
3893
Rafal Slawikda51b932018-12-13 16:31:33 +00003894 // The process name.
3895 // Usually package name or process cmdline.
3896 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003897 optional string process_name = 2;
3898
3899 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3900 // /proc/PID/status.
3901 optional int64 rss_high_water_mark_in_bytes = 3;
3902}
3903
3904/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003905 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003906 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003907message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003908 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003909}
3910
3911/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003912 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003913 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003914message SystemUptime {
3915 // Milliseconds since the system was booted.
3916 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3917 // for external input).
3918 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003919 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003920}
3921
3922/*
3923 * Reads from /proc/uid_concurrent_active_time which has the format:
3924 * active: X (X is # cores)
3925 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3926 * [uid1]: [time-0] [time-1] [time-2] ... ...
3927 * ...
3928 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3929 * The file contains a monotonically increasing count of time for a single boot.
3930 */
3931message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003932 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003933 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003934}
3935
3936/**
3937 * Reads from /proc/uid_concurrent_policy_time which has the format:
3938 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3939 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3940 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3941 * ...
3942 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3943 * The file contains a monotonically increasing count of time for a single boot.
3944 */
3945message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003946 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003947 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003948 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003949}
3950
3951/*
3952 * Pulls free disk space, for data, system partition and temporary directory.
3953 */
3954message DiskSpace {
3955 // available bytes in data partition
3956 optional uint64 data_available_bytes = 1;
3957 // available bytes in system partition
3958 optional uint64 system_available_bytes = 2;
3959 // available bytes in download cache or temp directories
3960 optional uint64 temp_available_bytes = 3;
3961}
Tej Singhbf972d92018-01-10 20:51:13 -08003962
3963/**
3964 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003965 *
3966 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003967 */
3968message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003969 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003970}
3971
3972/**
3973 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003974 * Pulled from:
3975 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003976 */
3977message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003978 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003979}
3980
3981/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003982 * Pulls battery voltage.
3983 * Pulled from:
3984 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3985 */
3986message BatteryVoltage {
3987 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003988 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003989}
3990
3991/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003992 * Pulls battery level (percent full, from 0 to 100).
3993 *
3994 * Pulled from:
3995 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3996 */
3997message BatteryLevel {
3998 // Battery level. Should be in [0, 100].
3999 optional int32 battery_level = 1;
4000}
4001
4002/**
Tej Singhd89137e2018-03-26 14:51:40 -07004003 * Pulls the temperature of various parts of the device.
4004 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004005 *
4006 * Pulled from:
4007 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
4008 */
4009message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004010 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004011 optional android.os.TemperatureTypeEnum sensor_location = 1;
4012
4013 // The name of the temperature source. Eg. CPU0
4014 optional string sensor_name = 2;
4015
Tej Singhd89137e2018-03-26 14:51:40 -07004016 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004017 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004018 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08004019}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004020
4021/**
4022 * Pulls the statistics of calls to Binder.
4023 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004024 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4025 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004026 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004027 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004028 */
4029message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004030 // UID of the process responsible for the binder transaction. It will be set if the process
4031 // executing the binder transaction attribute the transaction to another uid using
4032 // Binder.setThreadWorkSource().
4033 //
4034 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004035 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004036 // UID of the process executing the binder transaction.
4037 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004038 // Fully qualified class name of the API call.
4039 //
4040 // This is a system server class name.
4041 //
4042 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4043 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4044 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4045 // commonly used APIs.
4046 optional string service_class_name = 2;
4047 // Method name of the API call. It can also be a transaction code if we cannot
4048 // resolve it to a name. See Binder#getTransactionName.
4049 //
4050 // This is a system server method name.
4051 optional string service_method_name = 3;
4052 // Total number of API calls.
4053 optional int64 call_count = 4;
4054 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4055 optional bool screen_interactive = 13;
4056 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4057 // call_count will be equal to recorded_call_count.
4058 //
4059 // If recorded_call_count is different than call_count, it means data collection has been
4060 // sampled. All the fields below will be sampled in this case.
4061 optional int64 recorded_call_count = 12;
4062 // Number of exceptions thrown by the API.
4063 optional int64 recorded_exception_count = 5;
4064 // Total latency of all API calls.
4065 // Average can be computed using total_latency_micros / recorded_call_count.
4066 optional int64 recorded_total_latency_micros = 6;
4067 // Maximum latency of one API call.
4068 optional int64 recorded_max_latency_micros = 7;
4069 // Total CPU usage of all API calls.
4070 // Average can be computed using total_cpu_micros / recorded_call_count.
4071 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4072 optional int64 recorded_total_cpu_micros = 8;
4073 // Maximum CPU usage of one API call.
4074 optional int64 recorded_max_cpu_micros = 9;
4075 // Maximum parcel reply size of one API call.
4076 optional int64 recorded_max_reply_size_bytes = 10;
4077 // Maximum parcel request size of one API call.
4078 optional int64 recorded_max_request_size_bytes = 11;
4079}
4080
4081/**
4082 * Pulls the statistics of exceptions during calls to Binder.
4083 *
4084 * Binder stats are cumulative from boot unless somebody reset the data using
4085 * > adb shell dumpsys binder_calls_stats --reset
4086 */
4087message BinderCallsExceptions {
4088 // Exception class name, e.g. java.lang.IllegalArgumentException.
4089 //
4090 // This is an exception class name thrown by the system server.
4091 optional string exception_class_name = 1;
4092 // Total number of exceptions.
4093 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004094}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004095
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004096/**
4097 * Pulls the statistics of message dispatching on HandlerThreads.
4098 *
4099 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4100 * config on the device.
4101 *
4102 * Next tag: 11
4103 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004104message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004105 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004106 optional int32 uid = 1 [(is_uid) = true];
4107
4108 // Fully qualified class name of the handler target class.
4109 //
4110 // This field does not contain PII. This is a system server class name.
4111 optional string handler_class_name = 2;
4112
4113 // The name of the thread that runs the Looper.
4114 //
4115 // This field does not contain PII. This is a system server thread name.
4116 optional string looper_thread_name = 3;
4117
4118 // The name of the dispatched message.
4119 //
4120 // This field does not contain PII. This is a system server constant or class
4121 // name.
4122 optional string message_name = 4;
4123
4124 // Total number of successfully dispatched messages.
4125 optional int64 message_count = 5;
4126
4127 // Total number of messages that failed dispatching.
4128 optional int64 exception_count = 6;
4129
4130 // Total number of processed messages we have data recorded for. If we
4131 // collected data for all the messages, message_count will be equal to
4132 // recorded_message_count.
4133 //
4134 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004135 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004136 optional int64 recorded_message_count = 7;
4137
4138 // Total latency of all processed messages.
4139 // Average can be computed using recorded_total_latency_micros /
4140 // recorded_message_count.
4141 optional int64 recorded_total_latency_micros = 8;
4142
4143 // Total CPU usage of all processed message.
4144 // Average can be computed using recorded_total_cpu_micros /
4145 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004146 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004147 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004148
4149 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4150 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004151
4152 // Max recorded CPU usage of all processed messages.
4153 optional int64 recorded_max_cpu_micros = 11;
4154
4155 // Max recorded latency of all processed messages.
4156 optional int64 recorded_max_latency_micros = 12;
4157
4158 // Total number of messages we tracked the dispatching delay for. If we
4159 // collected data for all the messages, message_count will be equal to
4160 // recorded_delay_message_count.
4161 //
4162 // If recorded_delay_message_count is different than message_count, it means data
4163 // collection has been sampled or/and not all messages specified the target dispatch time.
4164 // The fields below will be sampled in this case.
4165 optional int64 recorded_delay_message_count = 13;
4166
4167 // Total dispatching delay of all processed messages.
4168 // Calculated as a difference between the target dispatching time (Message.when)
4169 // and the actual dispatching time.
4170 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4171 optional int64 recorded_total_delay_millis = 14;
4172
4173 // Max dispatching delay of all processed messages.
4174 // Calculated as a difference between the target dispatching time (Message.when)
4175 // and the actual dispatching time.
4176 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004177}
Tej Singh86dc9db2018-09-06 00:39:57 +00004178
4179/**
4180 * Pulls disk information, such as write speed and latency.
4181 */
4182message DiskStats {
4183 // Time taken to open, write 512B to, and close a file.
4184 // -1 if error performing the check.
4185 optional int64 data_write_latency_millis = 1;
4186
4187 optional bool file_based_encryption = 2;
4188
4189 // Recent disk write speed in kB/s.
4190 // -1 if error querying storageed.
4191 // 0 if data is unavailable.
4192 optional int32 recent_disk_write_speed = 3;
4193}
4194
4195
4196/**
4197 * Free and total bytes of the Data, Cache, and System partition.
4198 */
4199message DirectoryUsage {
4200 enum Directory {
4201 UNKNOWN = 0;
4202 DATA = 1;
4203 CACHE = 2;
4204 SYSTEM = 3;
4205 }
4206 optional Directory directory = 1;
4207 optional int64 free_bytes = 2;
4208 optional int64 total_bytes = 3;
4209}
4210
4211
4212/**
4213 * Size of an application: apk size, data size, and cache size.
4214 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4215 * Information is only reported for apps with the primary user (user 0).
4216 * Sizes are aggregated by package name.
4217 */
4218message AppSize {
4219 // Including uids will involve modifying diskstats logic.
4220 optional string package_name = 1;
4221 // App size in bytes. -1 if unavailable.
4222 optional int64 app_size_bytes = 2;
4223 // App data size in bytes. -1 if unavailable.
4224 optional int64 app_data_size_bytes = 3;
4225 // App cache size in bytes. -1 if unavailable.
4226 optional int64 app_cache_size_bytes = 4;
4227 // Time that the cache file was produced.
4228 // Uses System.currentTimeMillis(), which is wall clock time.
4229 optional int64 cache_time_millis = 5;
4230}
4231
4232
4233/**
4234 * Size of a particular category. Eg: photos, videos.
4235 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4236 */
4237message CategorySize {
4238 enum Category {
4239 UNKNOWN = 0;
4240 APP_SIZE = 1;
4241 APP_DATA_SIZE = 2;
4242 APP_CACHE_SIZE = 3;
4243 PHOTOS = 4;
4244 VIDEOS = 5;
4245 AUDIO = 6;
4246 DOWNLOADS = 7;
4247 SYSTEM = 8;
4248 OTHER = 9;
4249 }
4250 optional Category category = 1;
4251 // Category size in bytes.
4252 optional int64 size_bytes = 2;
4253 // Time that the cache file was produced.
4254 // Uses System.currentTimeMillis(), which is wall clock time.
4255 optional int64 cache_time_millis = 3;
4256}
Tej Singhd6d6d772018-09-05 17:41:25 -07004257
4258/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004259 * Pulls per uid I/O stats. The stats are cumulative since boot.
4260 *
4261 * Read/write bytes are I/O events from a storage device
4262 * Read/write chars are data requested by read/write syscalls, and can be
4263 * satisfied by caching.
4264 *
4265 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4266 */
4267message DiskIo {
4268 optional int32 uid = 1 [(is_uid) = true];
4269 optional int64 fg_chars_read = 2;
4270 optional int64 fg_chars_write = 3;
4271 optional int64 fg_bytes_read = 4;
4272 optional int64 fg_bytes_write = 5;
4273 optional int64 bg_chars_read = 6;
4274 optional int64 bg_chars_write = 7;
4275 optional int64 bg_bytes_read = 8;
4276 optional int64 bg_bytes_write = 9;
4277 optional int64 fg_fsync = 10;
4278 optional int64 bg_fsync= 11;
4279}
4280
4281
4282/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004283 * Pulls the number of fingerprints for each user.
4284 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004285 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004286 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004287message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004288 // The associated user. Eg: 0 for owners, 10+ for others.
4289 // Defined in android/os/UserHandle.java
4290 optional int32 user = 1;
4291 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004292 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004293}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004294
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004295/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004296 * Pulls the number of faces for each user.
4297 *
4298 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4299 */
4300message NumFacesEnrolled {
4301 // The associated user. Eg: 0 for owners, 10+ for others.
4302 // Defined in android/os/UserHandle.java
4303 optional int32 user = 1;
4304 // Number of faces registered to that user.
4305 optional int32 num_faces_enrolled = 2;
4306}
4307/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004308 * A mapping of role holder -> role
4309 */
4310message RoleHolder {
4311 // uid of the role holder
4312 optional int32 uid = 1 [(is_uid) = true];
4313
4314 // package name of the role holder
4315 optional string package_name = 2;
4316
4317 // the role held
4318 optional string role = 3;
4319}
4320
Yangsteraf9aee72018-10-12 09:26:16 -07004321message AggStats {
4322 optional int64 min = 1;
4323
4324 optional int64 average = 2;
4325
4326 optional int64 max = 3;
4327}
4328
4329message ProcessStatsStateProto {
4330 optional android.service.procstats.ScreenState screen_state = 1;
4331
4332 optional android.service.procstats.MemoryState memory_state = 2;
4333
4334 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4335 // and not frameworks/base/core/java/android/app/ActivityManager.java
4336 optional android.service.procstats.ProcessState process_state = 3;
4337
4338 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004339 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004340
4341 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004342 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004343
4344 // # of samples taken
4345 optional int32 sample_size = 5;
4346
4347 // PSS is memory reserved for this process
4348 optional AggStats pss = 6;
4349
4350 // USS is memory shared between processes, divided evenly for accounting
4351 optional AggStats uss = 7;
4352
4353 // RSS is memory resident for this process
4354 optional AggStats rss = 8;
4355}
4356
4357// Next Tag: 7
4358message ProcessStatsProto {
4359 // Name of process.
4360 optional string process = 1;
4361
4362 // Uid of the process.
4363 optional int32 uid = 2;
4364
4365 // Information about how often kills occurred
4366 message Kill {
4367 // Count of excessive CPU kills
4368 optional int32 cpu = 1;
4369
4370 // Count of kills when cached
4371 optional int32 cached = 2;
4372
4373 // PSS stats during cached kill
4374 optional AggStats cached_pss = 3;
4375 }
4376 optional Kill kill = 3;
4377
4378 // Time and memory spent in various states.
4379 repeated ProcessStatsStateProto states = 5;
4380
4381 // Total time process has been running... screen_state, memory_state, and process_state
4382 // will not be set.
4383 optional ProcessStatsStateProto total_running_state = 6;
4384}
4385
4386message PackageServiceOperationStatsProto {
4387 // Operate enum: Started, Foreground, Bound, Executing
4388 optional android.service.procstats.ServiceOperationState operation = 1;
4389
4390 // Number of times the service was in this operation.
4391 optional int32 count = 2;
4392
4393 // Information about a state the service can be in.
4394 message StateStats {
4395 // Screen state enum.
4396 optional android.service.procstats.ScreenState screen_state = 1;
4397 // Memory state enum.
4398 optional android.service.procstats.MemoryState memory_state = 2;
4399
4400 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004401 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004402 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004403 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004404 }
4405 repeated StateStats state_stats = 3;
4406}
4407
4408message PackageServiceStatsProto {
4409 // Name of service component.
4410 optional string service_name = 1;
4411
4412 // The operation stats.
4413 // The package_name, package_uid, package_version, service_name will not be set to save space.
4414 repeated PackageServiceOperationStatsProto operation_stats = 2;
4415}
4416
4417message PackageAssociationSourceProcessStatsProto {
4418 // Uid of the process.
4419 optional int32 process_uid = 1;
4420 // Process name.
4421 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004422 // Package name.
4423 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004424 // Total count of the times this association appeared.
4425 optional int32 total_count = 3;
4426
4427 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004428 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004429
4430 // Total count of the times this association became actively impacting its target process.
4431 optional int32 active_count = 5;
4432
4433 // Information on one source in this association.
4434 message StateStats {
4435 // Process state enum.
4436 optional android.service.procstats.ProcessState process_state = 1;
4437 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004438 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004439 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004440 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004441 }
4442 repeated StateStats active_state_stats = 6;
4443}
4444
4445message PackageAssociationProcessStatsProto {
4446 // Name of the target component.
4447 optional string component_name = 1;
4448 // Information on one source in this association.
4449 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4450}
4451
4452
4453message ProcessStatsPackageProto {
4454 // Name of package.
4455 optional string package = 1;
4456
4457 // Uid of the package.
4458 optional int32 uid = 2;
4459
4460 // Version of the package.
4461 optional int64 version = 3;
4462
4463 // Stats for each process running with the package loaded in to it.
4464 repeated ProcessStatsProto process_stats = 4;
4465
4466 // Stats for each of the package's services.
4467 repeated PackageServiceStatsProto service_stats = 5;
4468
4469 // Stats for each association with the package.
4470 repeated PackageAssociationProcessStatsProto association_stats = 6;
4471}
4472
4473message ProcessStatsSectionProto {
4474 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004475 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004476
4477 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004478 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004479
4480 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004481 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004482
4483 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004484 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004485
4486 // System runtime library. e.g. "libdvm.so", "libart.so".
4487 optional string runtime = 5;
4488
4489 // whether kernel reports swapped pss.
4490 optional bool has_swapped_pss = 6;
4491
4492 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4493 enum Status {
4494 STATUS_UNKNOWN = 0;
4495 STATUS_COMPLETE = 1;
4496 STATUS_PARTIAL = 2;
4497 STATUS_SHUTDOWN = 3;
4498 STATUS_SYSPROPS = 4;
4499 }
4500 repeated Status status = 7;
4501
Chenjie Yub2ecc792019-01-17 10:27:26 -08004502 // Number of pages available of various types and sizes, representation fragmentation.
4503 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4504
Yangsteraf9aee72018-10-12 09:26:16 -07004505 // Stats for each process.
4506 repeated ProcessStatsProto process_stats = 8;
4507
4508 // Stats for each package.
4509 repeated ProcessStatsPackageProto package_stats = 9;
4510}
4511
Chenjie Yub2ecc792019-01-17 10:27:26 -08004512message ProcessStatsAvailablePagesProto {
4513 // Node these pages are in (as per /proc/pagetypeinfo)
4514 optional int32 node = 1;
4515
4516 // Zone these pages are in (as per /proc/pagetypeinfo)
4517 optional string zone = 2;
4518
4519 // Label for the type of these pages (as per /proc/pagetypeinfo)
4520 optional string label = 3;
4521
4522 // Distribution of number of pages available by order size. First entry in array is
4523 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4524 repeated int32 pages_per_order = 4;
4525}
4526
Chenjie Yu12e5e672018-09-14 15:54:59 -07004527/**
4528 * Pulled from ProcessStatsService.java
4529 */
4530message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004531 optional ProcessStatsSectionProto proc_stats_section = 1;
4532}
4533
Chenjie Yuf910b7802019-01-11 16:08:20 -08004534/**
4535 * Pulled from ProcessStatsService.java
4536 */
4537message ProcStatsPkgProc {
4538 optional ProcessStatsSectionProto proc_stats_section = 1;
4539}
4540
Yangsteraf9aee72018-10-12 09:26:16 -07004541message PowerProfileProto {
4542 optional double cpu_suspend = 1;
4543
4544 optional double cpu_idle = 2;
4545
4546 optional double cpu_active = 3;
4547
4548 message CpuCluster {
4549 optional int32 id = 1;
4550 optional double cluster_power = 2;
4551 optional int32 cores = 3;
4552 repeated int64 speed = 4;
4553 repeated double core_power = 5;
4554 }
4555
4556 repeated CpuCluster cpu_cluster = 40;
4557
4558 optional double wifi_scan = 4;
4559
4560 optional double wifi_on = 5;
4561
4562 optional double wifi_active = 6;
4563
4564 optional double wifi_controller_idle = 7;
4565
4566 optional double wifi_controller_rx = 8;
4567
4568 optional double wifi_controller_tx = 9;
4569
4570 repeated double wifi_controller_tx_levels = 10;
4571
4572 optional double wifi_controller_operating_voltage = 11;
4573
4574 optional double bluetooth_controller_idle = 12;
4575
4576 optional double bluetooth_controller_rx = 13;
4577
4578 optional double bluetooth_controller_tx = 14;
4579
4580 optional double bluetooth_controller_operating_voltage = 15;
4581
4582 optional double modem_controller_sleep = 16;
4583
4584 optional double modem_controller_idle = 17;
4585
4586 optional double modem_controller_rx = 18;
4587
4588 repeated double modem_controller_tx = 19;
4589
4590 optional double modem_controller_operating_voltage = 20;
4591
4592 optional double gps_on = 21;
4593
4594 repeated double gps_signal_quality_based = 22;
4595
4596 optional double gps_operating_voltage = 23;
4597
4598 optional double bluetooth_on = 24;
4599
4600 optional double bluetooth_active = 25;
4601
4602 optional double bluetooth_at_cmd = 26;
4603
4604 optional double ambient_display = 27;
4605
4606 optional double screen_on = 28;
4607
4608 optional double radio_on = 29;
4609
4610 optional double radio_scanning = 30;
4611
4612 optional double radio_active = 31;
4613
4614 optional double screen_full = 32;
4615
4616 optional double audio = 33;
4617
4618 optional double video = 34;
4619
4620 optional double flashlight = 35;
4621
4622 optional double memory = 36;
4623
4624 optional double camera = 37;
4625
4626 optional double wifi_batched_scan = 38;
4627
4628 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004629}
Chenjie Yuab530202018-09-26 12:39:20 -07004630
4631/**
4632 * power_profile.xml and other constants for power model calculations.
4633 * Pulled from PowerProfile.java
4634 */
4635message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004636 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004637}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004638
4639/**
arangelovd5db50e2018-10-12 20:24:39 +01004640 * Logs when a user restriction was added or removed.
4641 *
4642 * Logged from:
4643 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4644 */
4645message UserRestrictionChanged {
4646 // The raw string of the user restriction as defined in UserManager.
4647 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4648 optional string restriction = 1;
4649 // Whether the restriction is enabled or disabled.
4650 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004651}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004652
4653/**
4654 * Pulls process user time and system time. Puller takes a snapshot of all pids
4655 * in the system and returns cpu stats for those that are working at the time.
4656 * Dead pids will be dropped. Kernel processes are excluded.
4657 * Min cool-down is 5 sec.
4658 */
4659message ProcessCpuTime {
4660 optional int32 uid = 1 [(is_uid) = true];
4661
4662 optional string process_name = 2;
4663 // Process cpu time in user space, cumulative from boot/process start
4664 optional int64 user_time_millis = 3;
4665 // Process cpu time in system space, cumulative from boot/process start
4666 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004667}
Misha Wagner5a51e002018-10-03 15:04:09 +01004668
4669/**
4670 * Pulls the CPU usage for each thread.
4671 *
4672 * Read from /proc/$PID/task/$TID/time_in_state files.
4673 *
4674 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4675 * time_in_state files not being present on some phones, have not been addressed. These should be
4676 * considered before a public release.
4677 */
4678message CpuTimePerThreadFreq {
4679 // UID that owns the process.
4680 optional int32 uid = 1 [(is_uid) = true];
4681 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004682 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004683 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004684 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004685 // Name of the process taken from `/proc/$PID/cmdline`.
4686 optional string process_name = 4;
4687 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4688 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004689
4690 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4691 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4692 // frequencies are given here as the alternative is sending eight separate atoms. This method
4693 // significantly reduces the amount of data created
4694 optional int32 frequency1_khz = 6;
4695 optional int32 time1_millis = 7;
4696 optional int32 frequency2_khz = 8;
4697 optional int32 time2_millis = 9;
4698 optional int32 frequency3_khz = 10;
4699 optional int32 time3_millis = 11;
4700 optional int32 frequency4_khz = 12;
4701 optional int32 time4_millis = 13;
4702 optional int32 frequency5_khz = 14;
4703 optional int32 time5_millis = 15;
4704 optional int32 frequency6_khz = 16;
4705 optional int32 time6_millis = 17;
4706 optional int32 frequency7_khz = 18;
4707 optional int32 time7_millis = 19;
4708 optional int32 frequency8_khz = 20;
4709 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004710}
Bookatz75ee6042018-11-09 12:27:37 -08004711
4712/**
Bookatz366a4432018-11-20 09:42:33 -08004713 * Pulls information about the device's build.
4714 */
4715message BuildInformation {
4716 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4717 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4718 optional string fingerprint = 1;
4719
4720 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4721 optional string brand = 2;
4722
4723 // Build.PRODUCT. The name of the overall product.
4724 optional string product = 3;
4725
4726 // Build.DEVICE. The name of the industrial design.
4727 optional string device = 4;
4728
4729 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4730 optional string version_release = 5;
4731
4732 // Build.ID. E.g. a label like "M4-rc20".
4733 optional string id = 6;
4734
4735 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4736 // represent this build.
4737 optional string version_incremental = 7;
4738
4739 // Build.TYPE. The type of build, like "user" or "eng".
4740 optional string type = 8;
4741
4742 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4743 optional string tags = 9;
4744}
4745
4746/**
Bookatz75ee6042018-11-09 12:27:37 -08004747 * Pulls on-device BatteryStats power use calculations for the overall device.
4748 */
4749message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004750 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4751 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4752 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4753 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08004754}
4755
4756/**
4757 * Pulls on-device BatteryStats power use calculations broken down by uid.
4758 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4759 * that is attributed to non-uid items. They must all be included to get the total power use.
4760 */
4761message DeviceCalculatedPowerBlameUid {
4762 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4763 optional int32 uid = 1 [(is_uid) = true];
4764
Bookatz3dbc13a2018-12-21 12:16:51 -08004765 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4766 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4767 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08004768}
4769
4770/**
4771 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4772 * drain type.
4773 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4774 * is attributed uids. They must all be included to get the total power use.
4775 */
4776message DeviceCalculatedPowerBlameOther {
4777 // The type of item whose power use is being reported.
4778 enum DrainType {
4779 AMBIENT_DISPLAY = 0;
4780 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4781 BLUETOOTH = 2;
4782 CAMERA = 3;
4783 // Cell-standby
4784 CELL = 4;
4785 FLASHLIGHT = 5;
4786 IDLE = 6;
4787 MEMORY = 7;
4788 // Amount that total computed drain exceeded the drain estimated using the
4789 // battery level changes and capacity.
4790 OVERCOUNTED = 8;
4791 PHONE = 9;
4792 SCREEN = 10;
4793 // Amount that total computed drain was below the drain estimated using the
4794 // battery level changes and capacity.
4795 UNACCOUNTED = 11;
4796 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4797 WIFI = 13;
4798 }
4799 optional DrainType drain_type = 1;
4800
Bookatz3dbc13a2018-12-21 12:16:51 -08004801 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4802 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4803 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004804}
arangelov4e994062018-11-13 16:12:38 +00004805
4806/**
4807 * Logs device policy features.
4808 *
4809 * Logged from:
4810 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4811 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4812 */
4813message DevicePolicyEvent {
4814 // The event id - unique for each event.
4815 optional android.stats.devicepolicy.EventId event_id = 1;
4816 // The admin package name.
4817 optional string admin_package_name = 2;
4818 // A generic integer parameter.
4819 optional int32 integer_value = 3;
4820 // A generic boolean parameter.
4821 optional bool boolean_value = 4;
4822 // A parameter specifying a time period in milliseconds.
4823 optional uint64 time_period_millis = 5;
4824 // A parameter specifying a list of package names, bundle extras or string parameters.
4825 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4826}
shawnlinea5b66b2018-11-13 15:05:29 +08004827
4828/**
4829 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4830 *
4831 * Logged from:
4832 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4833 */
4834message DocsUILaunchReported {
4835 optional android.stats.docsui.LaunchAction launch_action = 1;
4836 optional bool has_initial_uri = 2;
4837 optional android.stats.docsui.MimeType mime_type = 3;
4838 optional android.stats.docsui.Root initial_root = 4;
4839}
4840
4841/**
4842 * Logs root/app visited event in file managers/picker. Call this when the user
4843 * taps on root/app in hamburger menu.
4844 *
4845 * Logged from:
4846 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4847 */
4848message DocsUIRootVisitedReported {
4849 optional android.stats.docsui.ContextScope scope = 1;
4850 optional android.stats.docsui.Root root = 2;
4851}
4852
4853/**
4854 * Logs file operation stats. Call this when a file operation has completed.
4855 *
4856 * Logged from:
4857 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4858 */
4859message DocsUIFileOperationReported {
4860 optional android.stats.docsui.Provider provider = 1;
4861 optional android.stats.docsui.FileOperation file_op = 2;
4862}
4863
4864/**
4865 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4866 * mode.
4867 *
4868 * Logged from:
4869 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4870 */
4871message DocsUIFileOperationCopyMoveModeReported {
4872 optional android.stats.docsui.FileOperation file_op = 1;
4873 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4874}
4875
4876
4877/**
4878 * Logs file sub operation stats. Call this when a file operation has failed.
4879 *
4880 * Logged from:
4881 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4882 */
4883message DocsUIFileOperationFailureReported {
4884 optional android.stats.docsui.Authority authority = 1;
4885 optional android.stats.docsui.SubFileOperation sub_op = 2;
4886}
4887
4888/**
4889* Logs the cancellation of a file operation. Call this when a job is canceled
4890*
4891* Logged from:
4892* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4893*/
4894message DocsUIFileOperationCanceledReported {
4895 optional android.stats.docsui.FileOperation file_op = 1;
4896}
4897
4898/**
4899 * Logs startup time in milliseconds.
4900 *
4901 * Logged from:
4902 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4903 */
4904message DocsUIStartupMsReported {
4905 optional int32 startup_millis = 1;
4906}
4907
4908/**
4909 * Logs the action that was started by user.
4910 *
4911 * Logged from:
4912 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4913 */
4914message DocsUIUserActionReported {
4915 optional android.stats.docsui.UserAction action = 1;
4916}
4917
4918/**
4919 * Logs the invalid type when invalid scoped access is requested.
4920 *
4921 * Logged from:
4922 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4923 */
4924message DocsUIInvalidScopedAccessRequestReported {
4925 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004926}
Ben Murdochbab399f2018-12-06 11:01:38 +00004927
4928/**
shawnlina75e82d2019-01-07 10:31:12 +08004929 * Logs the package name that launches docsui picker mode.
4930 *
4931 * Logged from:
4932 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4933 */
4934message DocsUIPickerLaunchedFromReported {
4935 optional string package_name = 1;
4936}
4937
4938/**
4939 * Logs the search type.
4940 *
4941 * Logged from:
4942 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4943 */
4944message DocsUISearchTypeReported {
4945 optional android.stats.docsui.SearchType search_type = 1;
4946}
4947
4948/**
4949 * Logs the search mode.
4950 *
4951 * Logged from:
4952 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4953 */
4954message DocsUISearchModeReported {
4955 optional android.stats.docsui.SearchMode search_mode = 1;
4956}
4957
4958/**
4959 * Logs the pick result information.
4960 *
4961 * Logged from:
4962 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4963 */
4964message DocsUIPickResultReported {
4965 optional int32 total_action_count = 1;
4966 optional int64 duration_millis = 2;
4967 optional int32 file_count= 3;
4968 optional bool is_searching = 4;
4969 optional android.stats.docsui.Root picked_from = 5;
4970 optional android.stats.docsui.MimeType mime_type = 6;
4971 optional int32 repeatedly_pick_times = 7;
4972}
4973
4974/**
Ben Murdochbab399f2018-12-06 11:01:38 +00004975 * Logs when an app's memory is compacted.
4976 *
4977 * Logged from:
4978 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4979 */
4980message AppCompacted {
4981 // The pid of the process being compacted.
4982 optional int32 pid = 1;
4983
4984 // The name of the process being compacted.
4985 optional string process_name = 2;
4986
4987 // The type of compaction.
4988 enum Action {
4989 UNKNOWN = 0;
4990 SOME = 1;
4991 FULL = 2;
4992 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004993 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00004994
4995 // Total RSS in kilobytes consumed by the process prior to compaction.
4996 optional int64 before_rss_total_kilobytes = 4;
4997
4998 // File RSS in kilobytes consumed by the process prior to compaction.
4999 optional int64 before_rss_file_kilobytes = 5;
5000
5001 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5002 optional int64 before_rss_anon_kilobytes = 6;
5003
5004 // Swap in kilobytes consumed by the process prior to compaction.
5005 optional int64 before_swap_kilobytes = 7;
5006
5007 // Total RSS in kilobytes consumed by the process after compaction.
5008 optional int64 after_rss_total_kilobytes = 8;
5009
5010 // File RSS in kilobytes consumed by the process after compaction.
5011 optional int64 after_rss_file_kilobytes = 9;
5012
5013 // Anonymous RSS in kilobytes consumed by the process after compaction.
5014 optional int64 after_rss_anon_kilobytes = 10;
5015
5016 // Swap in kilobytes consumed by the process after compaction.
5017 optional int64 after_swap_kilobytes = 11;
5018
5019 // The time taken to perform compaction in milliseconds.
5020 optional int64 time_to_compact_millis = 12;
5021
5022 // The last compaction action performed for this app.
5023 optional Action last_action = 13;
5024
Ben Murdoch01720b82018-12-19 18:03:44 +00005025 // The last time that compaction was attempted on this process in milliseconds
5026 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5027 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00005028
Ben Murdoch885c21b2019-03-15 18:02:04 +00005029 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005030 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00005031
5032 // The process state at the time of compaction.
5033 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005034
5035 // Free ZRAM in kilobytes before compaction.
5036 optional int64 before_zram_free_kilobytes = 17;
5037
5038 // Free ZRAM in kilobytes after compaction.
5039 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00005040}
lifr157fc552018-12-12 16:38:04 +08005041
5042/**
lifrb6b90b62019-03-29 00:40:17 +08005043 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5044 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5045 *
5046 * The top-level message represents the entire lookup operation, which may result one or more
5047 * queries to the recursive DNS resolvers. Those are individually logged in DnsQueryEvent to
5048 * enable computing error rates and network latency and timeouts broken up by query type,
5049 * transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005050 */
5051message NetworkDnsEventReported {
lifr157fc552018-12-12 16:38:04 +08005052
lifrb6b90b62019-03-29 00:40:17 +08005053 optional android.stats.connectivity.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005054
lifrb6b90b62019-03-29 00:40:17 +08005055 optional android.stats.connectivity.ReturnCode return_code = 2;
5056
5057 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005058 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005059
5060 optional android.stats.connectivity.DnsQueryEventRe dns_query_event_re = 4 [(log_mode) = MODE_BYTES];
5061
5062 // ResNSend flags defined in android/multinetwork.h
5063 optional int32 flags = 5;
5064
5065 optional android.net.NetworkCapabilitiesProto.Transport network_type = 6;
5066
5067 // The DNS over TLS mode on a specific netId.
5068 optional android.stats.connectivity.PrivateDnsModes private_dns_modes = 7;
5069
5070 // Additional pass-through fields opaque to statsd.
5071 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
5072 optional android.stats.connectivity.DnsCallEvent dns_call_event = 8 [(log_mode) = MODE_BYTES];
lifr157fc552018-12-12 16:38:04 +08005073}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005074
lifrb6b90b62019-03-29 00:40:17 +08005075
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005076/**
5077 * Logs when a data stall event occurs.
5078 *
5079 * Log from:
5080 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5081 */
5082message DataStallEvent {
5083 // Data stall evaluation type.
5084 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5085 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5086 optional int32 evaluation_type = 1;
5087 // See definition in data_stall_event.proto.
5088 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5089 // See definition in data_stall_event.proto.
5090 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5091 // See definition in data_stall_event.proto.
5092 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5093 // See definition in data_stall_event.proto.
5094 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5095 // See definition in data_stall_event.proto.
5096 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5097}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005098
5099/*
5100 * Logs when RescueParty resets some set of experiment flags.
5101 *
5102 * Logged from:
5103 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5104 */
5105message RescuePartyResetReported {
5106 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5107 optional int32 rescue_level = 1;
5108}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005109
5110/**
5111 * Logs when signed config is received from an APK, and if that config was applied successfully.
5112 * Logged from:
5113 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5114 */
5115message SignedConfigReported {
5116 enum Type {
5117 UNKNOWN_TYPE = 0;
5118 GLOBAL_SETTINGS = 1;
5119 }
5120 optional Type type = 1;
5121
5122 // The final status of the signed config received.
5123 enum Status {
5124 UNKNOWN_STATUS = 0;
5125 APPLIED = 1;
5126 BASE64_FAILURE_CONFIG = 2;
5127 BASE64_FAILURE_SIGNATURE = 3;
5128 SECURITY_EXCEPTION = 4;
5129 INVALID_CONFIG = 5;
5130 OLD_CONFIG = 6;
5131 SIGNATURE_CHECK_FAILED = 7;
5132 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005133 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005134 }
5135 optional Status status = 2;
5136
5137 // The version of the signed config processed.
5138 optional int32 version = 3;
5139
5140 // The package name that the config was extracted from.
5141 optional string from_package = 4;
5142
5143 enum Key {
5144 NO_KEY = 0;
5145 DEBUG = 1;
5146 PRODUCTION = 2;
5147 }
5148 // Which key was used to verify the config.
5149 optional Key verified_with = 5;
5150}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005151
5152/*
5153 * Logs GNSS Network-Initiated (NI) location events.
5154 *
5155 * Logged from:
5156 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5157 */
5158message GnssNiEventReported {
5159 // The type of GnssNiEvent.
5160 enum EventType {
5161 UNKNOWN = 0;
5162 NI_REQUEST = 1;
5163 NI_RESPONSE = 2;
5164 }
5165 optional EventType event_type = 1;
5166
5167 // An ID generated by HAL to associate NI notifications and UI responses.
5168 optional int32 notification_id = 2;
5169
5170 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005171 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005172
5173 // NI requires notification.
5174 optional bool need_notify = 4;
5175
5176 // NI requires verification.
5177 optional bool need_verify = 5;
5178
5179 // NI requires privacy override, no notification/minimal trace.
5180 optional bool privacy_override = 6;
5181
5182 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5183 // seconds.
5184 optional int32 timeout = 7;
5185
5186 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005187 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005188
5189 // String representing the requester of the network inititated location request.
5190 optional string requestor_id = 9;
5191
5192 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5193 // network initiated location request.
5194 optional string text = 10;
5195
5196 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005197 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005198
5199 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005200 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005201
5202 // True if SUPL ES is enabled.
5203 optional bool is_supl_es_enabled = 13;
5204
5205 // True if GNSS location is enabled.
5206 optional bool is_location_enabled = 14;
5207
5208 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005209 optional android.server.location.GnssUserResponseType user_response = 15;
5210}
5211
5212/**
5213 * Logs GNSS non-framework (NFW) location notification.
5214 *
5215 * Logged from:
5216 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5217 */
5218message GnssNfwNotificationReported {
5219 // Package name of the Android proxy application representing the non-framework entity that
5220 // requested location. Set to empty string if unknown.
5221 optional string proxy_app_package_name = 1;
5222
5223 // Protocol stack that initiated the non-framework location request.
5224 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5225
5226 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5227 // set to empty string. This field is opaque to the framework and used for logging purposes.
5228 optional string other_protocol_stack_name = 3;
5229
5230 // Source initiating/receiving the location information.
5231 optional android.server.location.NfwRequestor requestor = 4;
5232
5233 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5234 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5235 // and used for logging purposes.
5236 optional string requestor_id = 5;
5237
5238 // Indicates whether location information was provided for this request.
5239 optional android.server.location.NfwResponseType response_type = 6;
5240
5241 // True if the device is in user initiated emergency session.
5242 optional bool in_emergency_mode = 7;
5243
5244 // True if cached location is provided.
5245 optional bool is_cached_location = 8;
5246
5247 // True if proxy app permission mismatch between framework and GNSS HAL.
5248 optional bool is_permission_mismatched = 9;
5249}
5250
5251/**
5252 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5253 *
5254 * Logged from:
5255 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5256 */
5257message GnssConfigurationReported {
5258 // SUPL host name.
5259 optional string supl_host = 1;
5260
5261 // SUPL port number.
5262 optional int32 supl_port = 2;
5263
5264 // C2K host name.
5265 optional string c2k_host = 3;
5266
5267 // C2K port number.
5268 optional int32 c2k_port = 4;
5269
5270 // The SUPL version requested by Carrier.
5271 optional int32 supl_ver = 5;
5272
5273 // The SUPL mode.
5274 optional android.server.location.SuplMode supl_mode = 6;
5275
5276 // True if NI emergency SUPL restrictions is enabled.
5277 optional bool supl_es = 7;
5278
5279 // LTE Positioning Profile settings
5280 optional android.server.location.LppProfile lpp_profile = 8;
5281
5282 // Positioning protocol on A-Glonass system.
5283 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5284
5285 // True if emergency PDN is used. Otherwise, regular PDN is used.
5286 optional bool use_emergency_pdn_for_emergency_supl= 10;
5287
5288 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5289 optional android.server.location.GpsLock gps_lock = 11;
5290
5291 // Number of seconds to extend the emergency session duration post emergency call.
5292 optional int32 es_extension_sec = 12;
5293
5294 // The full list of package names of proxy Android applications representing the non-framework
5295 // location access entities (on/off the device) for which the framework user has granted
5296 // non-framework location access permission. The package names are concatenated in one string
5297 // with spaces as separators.
5298 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005299}
Jack Yu95b64f32018-12-13 18:26:11 +08005300
5301/**
5302 * Logs when a NFC device's error occurred.
5303 * Logged from:
5304 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5305 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5306 */
5307message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005308 enum Type {
5309 UNKNOWN = 0;
5310 CMD_TIMEOUT = 1;
5311 ERROR_NOTIFICATION = 2;
5312 AID_OVERFLOW = 3;
5313 }
5314 optional Type type = 1;
5315 // If it's nci cmd timeout, log the timeout command.
5316 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005317
Alex Salod7c3eef2019-01-25 14:43:27 -08005318 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005319}
5320
5321/**
5322 * Logs when a NFC device's state changed event
5323 * Logged from:
5324 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5325 */
5326message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005327 enum State {
5328 UNKNOWN = 0;
5329 OFF = 1;
5330 ON = 2;
5331 ON_LOCKED = 3; // Secure Nfc enabled.
5332 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5333 }
5334 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005335}
5336
5337/**
5338 * Logs when a NFC Beam Transaction occurred.
5339 * Logged from:
5340 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5341 */
5342message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005343 enum Operation {
5344 UNKNOWN = 0;
5345 SEND = 1;
5346 RECEIVE = 2;
5347 }
5348 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005349}
5350
5351/**
5352 * Logs when a NFC Card Emulation Transaction occurred.
5353 * Logged from:
5354 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5355 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5356 */
5357message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005358 enum Category {
5359 UNKNOWN = 0;
5360 HCE_PAYMENT = 1;
5361 HCE_OTHER = 2;
5362 OFFHOST = 3;
5363 }
5364 // Transaction belongs to HCE payment or HCE other category, or offhost.
5365 optional Category category = 1;
5366 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5367 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005368}
5369
5370/**
5371 * Logs when a NFC Tag event occurred.
5372 * Logged from:
5373 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5374 */
5375message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005376 enum Type {
5377 UNKNOWN = 0;
5378 URL = 1;
5379 BT_PAIRING = 2;
5380 PROVISION = 3;
5381 WIFI_CONNECT = 4;
5382 APP_LAUNCH = 5;
5383 OTHERS = 6;
5384 }
5385 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005386}
5387
5388/**
5389 * Logs when Hce transaction triggered
5390 * Logged from:
5391 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5392 */
5393message NfcHceTransactionOccurred {
5394 // The latency period(in microseconds) it took for the first HCE data
5395 // exchange.
5396 optional uint32 latency_micros = 1;
5397}
5398
5399/**
5400 * Logs when SecureElement state event changed
5401 * Logged from:
5402 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5403 */
5404message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005405 enum State {
5406 UNKNOWN = 0;
5407 INITIALIZED = 1;
5408 DISCONNECTED = 2;
5409 CONNECTED = 3;
5410 HALCRASH = 4;
5411 }
5412 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005413
Alex Salod7c3eef2019-01-25 14:43:27 -08005414 optional string state_change_reason = 2;
5415 // SIMx or eSEx.
5416 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005417}
5418
5419/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005420 * Information about a permission grant request
5421 */
5422message PermissionGrantRequestResultReported {
5423 // unique value identifying an API call. A API call might result in multiple of these atoms
5424 optional int64 request_id = 1;
5425
5426 // UID of package requesting the permission grant
5427 optional int32 requesting_uid = 2 [(is_uid) = true];
5428
5429 // Name of package requesting the permission grant
5430 optional string requesting_package_name = 3;
5431
5432 // The permission to be granted
5433 optional string permission_name = 4;
5434
5435 // If the permission was explicitly requested via the API or added by the system
5436 optional bool is_implicit = 5;
5437
5438 enum Result {
5439 UNDEFINED = 0;
5440 // permission request was ignored
5441 IGNORED = 1;
5442 // permission request was ignored because it was user fixed
5443 IGNORED_USER_FIXED = 2;
5444 // permission request was ignored because it was policy fixed
5445 IGNORED_POLICY_FIXED = 3;
5446 // permission was granted by user action
5447 USER_GRANTED = 4;
5448 // permission was automatically granted
5449 AUTO_GRANTED = 5;
5450 // permission was denied by user action
5451 USER_DENIED = 6;
5452 // permission was denied with prejudice by the user
5453 USER_DENIED_WITH_PREJUDICE = 7;
5454 // permission was automatically denied
5455 AUTO_DENIED = 8;
5456 }
5457 // The result of the permission grant
5458 optional Result result = 6;
5459}
5460
5461/**
Jack Yu95b64f32018-12-13 18:26:11 +08005462 * Logs when Omapi API used
5463 * Logged from:
5464 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5465 */
5466message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005467 enum Operation {
5468 UNKNOWN = 0;
5469 OPEN_CHANNEL = 1;
5470 }
5471 optional Operation operation = 1;
5472 // SIMx or eSEx.
5473 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005474
Alex Salod7c3eef2019-01-25 14:43:27 -08005475 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005476}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005477
5478/**
Alex Saloa060aee2019-01-21 14:36:41 -08005479 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5480 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005481 * Logged from:
5482 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5483 */
5484message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005485 optional int64 dispatch_latency_millis = 1;
5486}
5487
5488/**
5489 * Logs AttentionManagerService attention check result.
5490 *
5491 * Logged from:
5492 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5493 */
5494message AttentionManagerServiceResultReported {
5495 // See core/java/android/service/attention/AttentionService.java
5496 enum AttentionCheckResult {
5497 UNKNOWN = 20;
5498 ATTENTION_SUCCESS_ABSENT = 0;
5499 ATTENTION_SUCCESS_PRESENT = 1;
5500 ATTENTION_FAILURE_PREEMPTED = 2;
5501 ATTENTION_FAILURE_TIMED_OUT = 3;
5502 ATTENTION_FAILURE_UNKNOWN = 4;
5503 }
5504 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005505}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005506
5507/**
5508 * Logs when an adb connection changes state.
5509 *
5510 * Logged from:
5511 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5512 */
5513message AdbConnectionChanged {
5514 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5515 // previously selected for this system.
5516 optional int64 last_connection_time_millis = 1;
5517
5518 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5519 // to reconnect via adb without user interaction.
5520 optional int64 auth_window_millis = 2;
5521
5522 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5523 optional android.debug.AdbConnectionStateEnum state = 3;
5524
5525 // True if the 'always allow' option was selected for this system.
5526 optional bool always_allow = 4;
5527}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005528
5529/*
5530 * Logs the reported speech DSP status.
5531 *
5532 * Logged from:
5533 * Vendor audio implementation.
5534 */
5535message SpeechDspStatReported {
5536 // The total Speech DSP uptime in milliseconds.
5537 optional int32 total_uptime_millis = 1;
5538 // The total Speech DSP downtime in milliseconds.
5539 optional int32 total_downtime_millis = 2;
5540 optional int32 total_crash_count = 3;
5541 optional int32 total_recover_count = 4;
5542}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005543
5544/**
5545 * Logs USB connector contaminant status.
5546 *
5547 * Logged from: USB Service.
5548 */
5549message UsbContaminantReported {
5550 optional string id = 1;
5551 optional android.service.usb.ContaminantPresenceStatus status = 2;
5552}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005553
5554/**
5555 * This atom is for debugging purpose.
5556 */
5557message DebugElapsedClock {
5558 // Monotically increasing value for each pull.
5559 optional int64 pull_count = 1;
5560 // Time from System.elapsedRealtime.
5561 optional int64 elapsed_clock_millis = 2;
5562 // Time from System.elapsedRealtime.
5563 optional int64 same_elapsed_clock_millis = 3;
5564 // Diff between current elapsed time and elapsed time from previous pull.
5565 optional int64 elapsed_clock_diff_millis = 4;
5566
5567 enum Type {
5568 TYPE_UNKNOWN = 0;
5569 ALWAYS_PRESENT = 1;
5570 PRESENT_ON_ODD_PULLS = 2;
5571 }
5572 // Type of behavior for the pulled data.
5573 optional Type type = 5;
5574}
5575
5576/**
5577 * This atom is for debugging purpose.
5578 */
5579message DebugFailingElapsedClock {
5580 // Monotically increasing value for each pull.
5581 optional int64 pull_count = 1;
5582 // Time from System.elapsedRealtime.
5583 optional int64 elapsed_clock_millis = 2;
5584 // Time from System.elapsedRealtime.
5585 optional int64 same_elapsed_clock_millis = 3;
5586 // Diff between current elapsed time and elapsed time from previous pull.
5587 optional int64 elapsed_clock_diff_millis = 4;
5588}
Steven Wuacef6bb2019-01-23 14:21:17 -05005589
5590/** Logs System UI bubbles event changed.
5591 *
5592 * Logged from:
5593 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5594 */
5595message BubbleUIChanged {
5596
5597 // The app package that is posting the bubble.
5598 optional string package_name = 1;
5599
5600 // The notification channel that is posting the bubble.
5601 optional string notification_channel = 2;
5602
5603 // The notification id associated with the posted bubble.
5604 optional int32 notification_id = 3;
5605
5606 // The position of the bubble within the bubble stack.
5607 optional int32 position = 4;
5608
5609 // The total number of bubbles within the bubble stack.
5610 optional int32 total_number = 5;
5611
5612 // User interactions with the bubble.
5613 enum Action {
5614 UNKNOWN = 0;
5615 POSTED = 1;
5616 UPDATED = 2;
5617 EXPANDED = 3;
5618 COLLAPSED = 4;
5619 DISMISSED = 5;
5620 STACK_DISMISSED = 6;
5621 STACK_MOVED = 7;
5622 HEADER_GO_TO_APP = 8;
5623 HEADER_GO_TO_SETTINGS = 9;
5624 PERMISSION_OPT_IN = 10;
5625 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005626 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005627 SWIPE_LEFT = 13;
5628 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005629 STACK_EXPANDED = 15;
Steven Wuacef6bb2019-01-23 14:21:17 -05005630 }
5631 optional Action action = 6;
5632
5633 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5634 optional float normalized_x_position = 7;
5635 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04005636
5637 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
5638 optional bool is_unread = 9;
Steven Wuacef6bb2019-01-23 14:21:17 -05005639}
Kweku Adams8845d012018-12-11 20:06:45 -08005640
5641/**
Steven Wu552f63f2019-02-05 13:41:36 -05005642 * Logs System UI bubbles developer errors.
5643 *
5644 * Logged from:
5645 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5646 */
5647message BubbleDeveloperErrorReported {
5648
5649 // The app package that is posting the bubble.
5650 optional string package_name = 1;
5651
5652 // Bubble developer error type enums.
5653 enum Error {
5654 UNKNOWN = 0;
5655 ACTIVITY_INFO_MISSING = 1;
5656 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5657 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5658 }
5659 optional Error error = 2 [default = UNKNOWN];
5660}
5661
5662/**
Kweku Adams8845d012018-12-11 20:06:45 -08005663 * Logs that a constraint for a scheduled job has changed.
5664 *
5665 * Logged from:
5666 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5667 */
5668message ScheduledJobConstraintChanged {
5669 repeated AttributionNode attribution_node = 1;
5670
5671 // Name of the job.
5672 optional string job_name = 2;
5673
5674 optional com.android.server.job.ConstraintEnum constraint = 3;
5675
5676 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08005677 UNKNOWN = 0;
5678 UNSATISFIED = 1;
5679 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08005680 }
5681 optional State state = 4;
5682}
Alex Salod7c3eef2019-01-25 14:43:27 -08005683
5684/**
5685 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5686 * returns true.
5687 *
5688 * Logged from:
5689 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5690 */
5691message ScreenTimeoutExtensionReported {
5692 // Describes how many times in a row did the power manager reset the screen off timeout.
5693 optional uint32 consecutive_timeout_extended_count = 1;
5694}
Hui Yu885aca12019-01-10 17:11:34 -08005695
5696/*
5697* Logs number of milliseconds it takes to start a process.
5698* The definition of app process start time is from the app launch time to
5699* the time that Zygote finished forking the app process and loaded the
5700* application package's java classes.
5701
5702* This metric is different from AppStartOccurred which is for foreground
5703* activity only.
5704
5705* ProcessStartTime can report all processes (both foreground and background)
5706* start time.
5707*
5708* Logged from:
5709* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5710*/
5711message ProcessStartTime {
5712 // The uid of the ProcessRecord.
5713 optional int32 uid = 1 [(is_uid) = true];
5714
5715 // The process pid.
5716 optional int32 pid = 2;
5717
5718 // The process name.
5719 // Usually package name, "system" for system server.
5720 // Provided by ActivityManagerService.
5721 optional string process_name = 3;
5722
5723 enum StartType {
5724 UNKNOWN = 0;
5725 WARM = 1;
5726 HOT = 2;
5727 COLD = 3;
5728 }
5729
5730 // The start type.
5731 optional StartType type = 4;
5732
5733 // The elapsed realtime at the start of the process.
5734 optional int64 process_start_time_millis = 5;
5735
5736 // Number of milliseconds it takes to reach bind application.
5737 optional int32 bind_application_delay_millis = 6;
5738
5739 // Number of milliseconds it takes to finish start of the process.
5740 optional int32 process_start_delay_millis = 7;
5741
5742 // hostingType field in ProcessRecord, the component type such as "activity",
5743 // "service", "content provider", "broadcast" or other strings.
5744 optional string hosting_type = 8;
5745
5746 // hostingNameStr field in ProcessRecord. The component class name that runs
5747 // in this process.
5748 optional string hosting_name = 9;
5749}
5750
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005751/**
5752 * State of a dangerous permission requested by a package
5753 */
5754message DangerousPermissionState {
5755 // Name of the permission
5756 optional string permission_name = 1;
5757
5758 // Uid of the package
5759 optional int32 uid = 2 [(is_uid) = true];
5760
5761 // Package requesting the permission
5762 optional string package_name = 3;
5763
5764 // If the permission is granted to the uid
5765 optional bool is_granted = 4;
5766}
5767
Michael Groover4a0ca942019-01-24 17:41:25 -08005768/**
5769 * Logs when a package is denied access to a device identifier based on the new access requirements.
5770 *
5771 * Logged from:
5772 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
5773 */
5774message DeviceIdentifierAccessDenied {
5775 // The name of the package denied access to the requested device identifier.
5776 optional string package_name = 1;
5777
5778 // The name of the device identifier method the package attempted to invoke.
5779 optional string method_name = 2;
5780
5781 // True if the package is preinstalled.
5782 optional bool is_preinstalled = 3;
5783
5784 // True if the package is privileged.
5785 optional bool is_priv_app = 4;
5786}
Chenjie Yue13f44a2019-02-07 17:51:38 -08005787
5788/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08005789 * Pulls the ongoing mainline install train version code.
5790 * Pulled from StatsCompanionService
5791 */
5792message TrainInfo {
5793 optional int64 train_version_code = 1;
5794
5795 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08005796
5797 optional string train_name = 3;
5798
5799 enum Status {
5800 UNKNOWN = 0;
5801 INSTALL_REQUESTED = 1;
5802 INSTALL_STARTED = 2;
5803 INSTALL_STAGED_NOT_READY = 3;
5804 INSTALL_STAGED_READY = 4;
5805 INSTALL_SUCCESS = 5;
5806 INSTALL_FAILURE = 6;
5807 INSTALL_CANCELLED = 7;
5808 INSTALLER_ROLLBACK_REQUESTED = 8;
5809 INSTALLER_ROLLBACK_INITIATED = 9;
5810 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
5811 INSTALLER_ROLLBACK_STAGED = 11;
5812 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
5813 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
5814 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
5815 INSTALLER_ROLLBACK_SUCCESS = 15;
5816 INSTALLER_ROLLBACK_FAILURE = 16;
5817 INSTALLER_ROLLBACK_CANCEL_STAGED_REMOVE_FROM_QUEUE = 17;
5818 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_INITIATED = 18;
5819 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_SUCCESS = 19;
5820 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_FAILURE = 20;
Howard Ro3a662af2019-03-29 18:16:54 -07005821 INSTALL_STAGED_CANCEL_REQUESTED = 21;
5822 INSTALL_STAGED_CANCEL_SUCCESS = 22;
5823 INSTALL_STAGED_CANCEL_FAILURE = 23;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08005824 }
5825 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08005826}
joshmccloskey8c3322e2019-01-09 18:25:57 -08005827
5828/**
5829 * Logs the gesture stage changed event.
5830 *
5831 * Logged from:
5832 * frameworks/base/packages/SystemUI/
5833 */
5834message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005835 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005836}
5837
5838/**
5839 * Logs the feedback type.
5840 *
5841 * Logged from:
5842 * frameworks/base/packages/SystemUI/
5843 */
5844message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005845 // Whether or not the gesture was used.
5846 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005847}
5848
5849/**
5850 * Logs the progress.
5851 *
5852 * Logged from:
5853 * frameworks/base/packages/SystemUI/
5854 */
5855message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005856 // [0,100] progress for the assist gesture.
5857 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005858}
Neil Fullerdb14b482019-02-05 19:44:44 +00005859
5860/*
5861 * Information about the time zone data on a device.
5862 */
5863message TimeZoneDataInfo {
5864 // A version identifier for the data set on device. e.g. "2018i"
5865 optional string tzdb_version = 1;
5866}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005867
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005868/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005869 * Logs the GPU stats global health information.
5870 *
5871 * Logged from:
5872 * frameworks/native/services/gpuservice/gpustats/
5873 */
5874message GpuStatsGlobalInfo {
5875 // Package name of the gpu driver.
5876 optional string driver_package_name = 1;
5877
5878 // Version name of the gpu driver.
5879 optional string driver_version_name = 2;
5880
5881 // Version code of the gpu driver.
5882 optional int64 driver_version_code = 3;
5883
5884 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
5885 optional int64 driver_build_time = 4;
5886
5887 // Total count of the gl driver gets loaded.
5888 optional int64 gl_loading_count = 5;
5889
5890 // Total count of the gl driver fails to be loaded.
5891 optional int64 gl_loading_failure_count = 6;
5892
5893 // Total count of the Vulkan driver gets loaded.
5894 optional int64 vk_loading_count = 7;
5895
5896 // Total count of the Vulkan driver fails to be loaded.
5897 optional int64 vk_loading_failure_count = 8;
5898}
5899
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005900/**
5901 * GPU driver loading time info.
5902 */
5903message GpuDriverLoadingTime {
5904 // List of all the driver loading times for this app. The list size is
5905 // capped at 50.
5906 repeated int64 driver_loading_time = 1;
5907}
5908
5909/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005910 * Logs the GPU stats per app health information.
5911 *
5912 * Logged from:
5913 * frameworks/native/services/gpuservice/gpustats/
5914 */
5915message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005916 // Package name of the application that loads the gpu driver. Total number
5917 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005918 optional string app_package_name = 1;
5919
5920 // Version code of the gpu driver this app loads.
5921 optional int64 driver_version_code = 2;
5922
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005923 // gl driver loading time info.
5924 optional GpuDriverLoadingTime gl_driver_loading_time = 3
5925 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005926
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005927 // Vulkan driver loading time info.
5928 optional GpuDriverLoadingTime vk_driver_loading_time = 4
5929 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005930}
Rafal Slawikd4e87572019-03-12 13:08:38 +00005931
5932/*
5933 * Logs the size of the system ion heap.
5934 *
5935 * Pulled from StatsCompanionService.
5936 */
5937message SystemIonHeapSize {
5938 // Size of the system ion heap in bytes.
5939 optional int64 size_in_bytes = 1;
5940}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08005941
5942/**
5943 * Push network stack events.
5944 *
5945 * Log from:
5946 * frameworks/base/packages/NetworkStack/
5947 */
5948message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08005949 // The id that indicates the event reported from NetworkStack.
5950 optional int32 event_id = 1;
5951 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08005952 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
5953}
Carmen Agimofa769c152019-03-04 14:39:14 +00005954
5955/**
5956 * Logs the apps that are installed on the external storage.
5957 * Pulled from:
5958 * StatsCompanionService
5959 */
5960message AppsOnExternalStorageInfo {
5961 // The type of the external storage.
5962 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
5963 // The name of the package that is installed on the external storage.
5964 optional string package_name = 2;
5965}