blob: a752a9f25711265767fd672c90a092b2926be576 [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";
Yangsteraf9aee72018-10-12 09:26:16 -070044import "frameworks/base/core/proto/android/stats/enums.proto";
shawnlinea5b66b2018-11-13 15:05:29 +080045import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080046import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
47import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070048import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000049import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080050import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080051import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080052import "frameworks/base/core/proto/android/telephony/enums.proto";
53import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080054import "frameworks/base/core/proto/android/wifi/enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080055
Yao Chend54f9dd2017-10-17 17:37:48 +000056/**
Stefan Lafonae2df012017-11-14 09:17:21 -080057 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000058 * raw stats log events from the Android system, also known as "atoms."
59 *
60 * This field contains a single oneof with all of the available messages.
61 * The stats-log-api-gen tool runs as part of the Android build and
62 * generates the android.util.StatsLog class, which contains the constants
63 * and methods that Android uses to log.
64 *
Stefan Lafonae2df012017-11-14 09:17:21 -080065 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000066 * Instead, statsd on Android constructs these messages synthetically,
67 * in the format defined here and in stats_log.proto.
68 */
Stefan Lafonae2df012017-11-14 09:17:21 -080069message Atom {
70 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070071 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070072 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
73 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070074 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070075 BleScanResultReceived ble_scan_result_received = 4;
76 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080077 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070078 SyncStateChanged sync_state_changed = 7;
79 ScheduledJobStateChanged scheduled_job_state_changed = 8;
80 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070081 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080082 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
83 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
84 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070085 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
86 MemoryFactorStateChanged memory_factor_state_changed = 15;
87 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
88 CachedKillReported cached_kill_reported = 17;
89 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070090 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080091 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
92 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
93 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070094 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080095 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070096 CameraStateChanged camera_state_changed = 25;
97 FlashlightStateChanged flashlight_state_changed = 26;
98 UidProcessStateChanged uid_process_state_changed = 27;
99 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
100 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -0700101 BatteryLevelChanged battery_level_changed = 30;
102 ChargingStateChanged charging_state_changed = 31;
103 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -0700104 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800105 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -0700106 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
107 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -0700108 WifiLockStateChanged wifi_lock_state_changed = 37;
109 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
110 WifiScanStateChanged wifi_scan_state_changed = 39;
111 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700112 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700113 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700114 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900115 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700116 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800117 AnomalyDetected anomaly_detected = 46;
Andrei Oneada01ea52019-01-30 15:28:36 +0000118 AppBreadcrumbReported app_breadcrumb_reported = 47 [(allow_from_any_uid) = true];
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800119 AppStartOccurred app_start_occurred = 48;
120 AppStartCanceled app_start_canceled = 49;
121 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800122 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800123 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800124 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800125 LmkStateChanged lmk_state_changed = 54;
126 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800127 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800128 BootSequenceReported boot_sequence_reported = 57;
Andrei Oneada01ea52019-01-30 15:28:36 +0000129 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -0800130 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800131 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800132 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800133 KeyguardStateChanged keyguard_state_changed = 62;
134 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
135 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800136 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800137 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800138 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
139 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800140 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700141 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800142 SpeakerImpedanceReported speaker_impedance_reported = 71;
143 HardwareFailed hardware_failed = 72;
144 PhysicalDropDetected physical_drop_detected = 73;
145 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800146 MobileConnectionStateChanged mobile_connection_state_changed = 75;
147 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700148 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800149 AppCrashOccurred app_crash_occurred = 78;
150 ANROccurred anr_occurred = 79;
151 WTFOccurred wtf_occurred = 80;
152 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700153 GenericAtom generic_atom = 82;
jianjin6eada302019-02-28 11:25:57 -0800154 KeyValuePairsAtom key_value_pairs_atom = 83 [(allow_from_any_uid) = true];
Bookatza7020bd2018-08-28 16:29:35 -0700155 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700156 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700157 ThermalThrottlingStateChanged thermal_throttling = 86;
Kevin Chyn1741a072019-01-17 11:54:40 -0800158 BiometricAcquired biometric_acquired = 87;
159 BiometricAuthenticated biometric_authenticated = 88;
160 BiometricErrorOccurred biometric_error_occurred = 89;
Howard Ro688ae182018-09-25 00:09:36 -0700161 Notification notification = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700162 BatteryHealthSnapshot battery_health_snapshot = 91;
163 SlowIo slow_io = 92;
164 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700165 PhoneServiceStateChanged phone_service_state_changed = 94;
166 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100167 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700168 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700169 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700170 // TODO: service state change is very noisy shortly after boot, as well
171 // as at other transitions - coming out of doze, device plugged in, etc.
172 // Consider removing this if it becomes a problem
173 ServiceStateChanged service_state_changed = 99;
174 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800175 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800176 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000177 DevicePolicyEvent device_policy_event = 103;
shawnlinea5b66b2018-11-13 15:05:29 +0800178 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104;
179 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported = 105;
180 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106;
181 DocsUIFileOperationReported docs_ui_provider_file_op = 107;
182 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request = 108;
183 DocsUILaunchReported docs_ui_launch_reported = 109;
184 DocsUIRootVisitedReported docs_ui_root_visited = 110;
185 DocsUIStartupMsReported docs_ui_startup_ms = 111;
186 DocsUIUserActionReported docs_ui_user_action_reported = 112;
Bookatzda1798c2018-12-13 14:16:00 -0800187 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
188 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f2018-12-06 11:01:38 +0000189 AppCompacted app_compacted = 115;
lifr030d23a2019-01-11 16:54:51 +0800190 NetworkDnsEventReported network_dns_event_reported = 116;
shawnlina75e82d2019-01-07 10:31:12 +0800191 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported = 117;
192 DocsUIPickResultReported docs_ui_pick_result_reported = 118;
193 DocsUISearchModeReported docs_ui_search_mode_reported = 119;
194 DocsUISearchTypeReported docs_ui_search_type_reported = 120;
Chiachang Wangf6bedc22019-01-14 11:54:32 +0800195 DataStallEvent data_stall_event = 121;
Christian Brunschenf86039e2018-12-21 12:26:14 +0000196 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000197 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800198 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800199 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800200 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
201 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000202 AppDowngraded app_downgraded = 128;
203 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
204 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800205 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
206 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800207 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800208 NfcErrorOccurred nfc_error_occurred = 134;
209 NfcStateChanged nfc_state_changed = 135;
210 NfcBeamOccurred nfc_beam_occurred = 136;
211 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
212 NfcTagOccurred nfc_tag_occurred = 138;
213 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
214 SeStateChanged se_state_changed = 140;
215 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800216 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800217 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800218 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800219 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800220 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800221 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyne5a37fb2019-02-08 13:10:36 -0800222 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500223 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800224 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Jack Hec27040a2019-01-09 20:54:41 -0800225 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
226 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
227 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
228 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
229 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
230 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
231 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
232 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
233 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He1021a612019-01-20 21:22:46 -0800234 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
235 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
236 BluetoothManufacturerInfoReported bluetooth_device_info_reported = 162;
237 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
238 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
239 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
240 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
241 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Alex Salod7c3eef2019-01-25 14:43:27 -0800242 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800243 ProcessStartTime process_start_time = 169;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -0800244 PermissionGrantRequestResultReported permission_grant_request_result_reported = 170;
Jack He815cdba2019-01-30 17:24:55 -0800245 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Michael Groover4a0ca942019-01-24 17:41:25 -0800246 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Steven Wu552f63f2019-02-05 13:41:36 -0500247 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
joshmccloskey8c3322e2019-01-09 18:25:57 -0800248 AssistGestureStageReported assist_gesture_stage_reported = 174;
249 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
250 AssistGestureProgressReported assist_gesture_progress_reported = 176;
Philip Quinn0eded622019-01-29 12:46:28 -0800251 TouchGestureClassified touch_gesture_classified = 177;
Andrei Onea4ad6d0c2019-02-08 13:54:12 +0000252 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true];
Hyunyoung Song80adf6be2019-01-30 09:59:30 -0800253 StyleUIChanged style_ui_changed = 179;
Fabian Kozynskibfd6d852019-02-15 15:08:16 -0500254 PrivacyIndicatorsInteracted privacy_indicators_interacted = 180;
Carmen Agimof6688a352019-01-30 19:36:04 +0000255 AppInstallOnExternalStorageReported app_install_on_external_storage_reported = 181;
Chiachang Wang0e88ebf2019-03-21 10:18:07 +0800256 NetworkStackReported network_stack_reported = 182;
Carmen Agimof6dcc5032019-03-01 16:20:09 +0000257 AppMovedStorageReported app_moved_storage_reported = 183;
Yao Chend54f9dd2017-10-17 17:37:48 +0000258 }
David Chenc8a43242017-10-17 16:23:28 -0700259
David Chen6e3e6cb2018-01-03 16:14:06 -0800260 // Pulled events will start at field 10000.
Rafal Slawikd4e87572019-03-12 13:08:38 +0000261 // Next: 10057
David Chenc8a43242017-10-17 16:23:28 -0700262 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800263 WifiBytesTransfer wifi_bytes_transfer = 10000;
264 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
265 MobileBytesTransfer mobile_bytes_transfer = 10002;
266 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800267 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800268 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800269 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800270 CpuTimePerFreq cpu_time_per_freq = 10008;
271 CpuTimePerUid cpu_time_per_uid = 10009;
272 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800273 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800274 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800275 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800276 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800277 SystemElapsedRealtime system_elapsed_realtime = 10014;
278 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800279 CpuActiveTime cpu_active_time = 10016;
280 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000281 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800282 RemainingBatteryCapacity remaining_battery_capacity = 10019;
283 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800284 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100285 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100286 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100287 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000288 DiskStats disk_stats = 10025;
289 DirectoryUsage directory_usage = 10026;
290 AppSize app_size = 10027;
291 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700292 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700293 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800294 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700295 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700296 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800297 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700298 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100299 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100300 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700301 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800302 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
303 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
304 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000305 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800306 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800307 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800308 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000309 DebugElapsedClock debug_elapsed_clock = 10046;
310 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800311 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800312 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800313 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800314 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000315 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000316 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800317 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
318 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000319 SystemIonHeapSize system_ion_heap_size = 10056;
David Chenc8a43242017-10-17 16:23:28 -0700320 }
yroa1fe77c2018-02-26 14:22:54 -0800321
Bookatz76aafcf2018-09-17 16:17:10 -0700322 // DO NOT USE field numbers above 100,000 in AOSP.
323 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
324 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700325}
326
Yao Chend54f9dd2017-10-17 17:37:48 +0000327/**
Yangster-mac20877162017-12-22 17:19:39 -0800328 * This proto represents a node of an attribution chain.
329 * Note: All attribution chains are represented as a repeated field of type
330 * AttributionNode. It is understood that in such arrays, the order is that
331 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000332 */
Yangster-mac20877162017-12-22 17:19:39 -0800333message AttributionNode {
334 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800335 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800336
Yangster-mac20877162017-12-22 17:19:39 -0800337 // The (optional) string tag for an element in the attribution chain. If the
338 // element has no tag, it is encoded as an empty string.
339 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700340}
341
Yangster-mac48b3d622018-08-18 12:38:11 -0700342message KeyValuePair {
343 optional int32 key = 1;
344 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700345 int32 value_int = 2;
346 int64 value_long = 3;
347 string value_str = 4;
348 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700349 }
350}
351
352message KeyValuePairsAtom {
353 optional int32 uid = 1;
354 repeated KeyValuePair pairs = 2;
355}
356
Yao Chend54f9dd2017-10-17 17:37:48 +0000357/*
358 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800359 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000360 *
361 * RULES:
362 * - The field ids for each atom must start at 1, and count upwards by 1.
363 * Skipping field ids is not allowed.
364 * - These form an API, so renaming, renumbering or removing fields is
365 * not allowed between android releases. (This is not currently enforced,
366 * but there will be a tool to enforce this restriction).
367 * - The types must be built-in protocol buffer types, namely, no sub-messages
368 * are allowed (yet). The bytes type is also not allowed.
369 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800370 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000371 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800372 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000373 * - A field that is a uid should be a string field, tagged with the [xxx]
374 * annotation. The generated code on android will be represented by UIDs,
375 * and those UIDs will be translated in xxx to those strings.
376 *
377 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700378 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000379 * - If there is a UID, it goes first. Think in an object-oriented fashion.
380 * *****************************************************************************
381 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700382
Yao Chend54f9dd2017-10-17 17:37:48 +0000383/**
Yangster-mace16189a2018-08-26 12:20:16 -0700384 * Logs when the Thermal service HAL notifies the throttling start/stop events.
385 *
386 * Logged from:
387 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
388 */
389message ThermalThrottlingStateChanged {
390 optional android.os.TemperatureTypeEnum sensor_type = 1;
391
392 enum State {
393 UNKNOWN = 0;
394 START = 1;
395 STOP = 2;
396 }
397
398 optional State state = 2;
399
400 optional float temperature = 3;
401}
402
403/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000404 * Logs when the screen state changes.
405 *
406 * Logged from:
407 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
408 */
409message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800410 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700411 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700412}
Yao Chend54f9dd2017-10-17 17:37:48 +0000413
414/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700415 * Logs that the process state of the uid, as determined by ActivityManager
416 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000417 *
418 * Logged from:
419 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
420 */
Bookatzc1a050a2017-10-10 15:49:28 -0700421message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700422 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000423
Bookatzdb026a22018-01-10 19:01:56 -0800424 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700425 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000426}
427
428/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700429 * Logs process state change of a process, as per the activity manager.
430 *
431 * Logged from:
432 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
433 */
434message ProcessStateChanged {
435 optional int32 uid = 1;
436 optional string process_name = 2;
437 optional string package_name = 3;
438 // TODO: remove this when validation is done
439 optional int64 version = 5;
440 // The state, from frameworks/base/core/proto/android/app/enums.proto.
441 optional android.app.ProcessStateEnum state = 4;
442}
443
444/**
445 * Logs when ActivityManagerService sleep state is changed.
446 *
447 * Logged from:
448 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
449 */
450message ActivityManagerSleepStateChanged {
451 // TODO: import frameworks proto
452 enum State {
453 UNKNOWN = 0;
454 ASLEEP = 1;
455 AWAKE = 2;
456 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700457 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700458}
459
460/**
461 * Logs when system memory state changes.
462 *
463 * Logged from:
464 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
465 */
466message MemoryFactorStateChanged {
467 // TODO: import frameworks proto
468 enum State {
469 MEMORY_UNKNOWN = 0;
470 NORMAL = 1; // normal.
471 MODERATE = 2; // moderate memory pressure.
472 LOW = 3; // low memory.
473 CRITICAL = 4; // critical memory.
474
475 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700476 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700477}
478
479/**
480 * Logs when app is using too much cpu, according to ActivityManagerService.
481 *
482 * Logged from:
483 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
484 */
485message ExcessiveCpuUsageReported {
486 optional int32 uid = 1;
487 optional string process_name = 2;
488 optional string package_name = 3;
489 // package version. TODO: remove this when validation is done
490 optional int64 version = 4;
491}
492
493/**
494 * Logs when a cached process is killed, along with its pss.
495 *
496 * Logged from:
497 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
498 */
499message CachedKillReported {
500 optional int32 uid = 1;
501 optional string process_name = 2;
502 optional string package_name = 3;
503 // TODO: remove this when validation is done
504 optional int64 version = 5;
505 optional int64 pss = 4;
506}
507
508/**
509 * Logs when memory stats of a process is reported.
510 *
511 * Logged from:
512 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
513 */
514message ProcessMemoryStatReported {
515 optional int32 uid = 1;
516 optional string process_name = 2;
517 optional string package_name = 3;
518 //TODO: remove this when validation is done
519 optional int64 version = 9;
520 optional int64 pss = 4;
521 optional int64 uss = 5;
522 optional int64 rss = 6;
523 enum Type {
524 ADD_PSS_INTERNAL_SINGLE = 0;
525 ADD_PSS_INTERNAL_ALL_MEM = 1;
526 ADD_PSS_INTERNAL_ALL_POLL = 2;
527 ADD_PSS_EXTERNAL = 3;
528 ADD_PSS_EXTERNAL_SLOW = 4;
529 }
530 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800531 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700532}
533
534/**
Bookatzc1a050a2017-10-10 15:49:28 -0700535 * Logs that a process started, finished, crashed, or ANRed.
536 *
537 * Logged from:
538 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
539 */
540message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700541 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700542
David Chen0b5c90c2018-01-25 16:51:49 -0800543 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800544 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700545
Bookatzddccf0a2017-11-28 16:48:14 -0800546 // What lifecycle state the process changed to.
547 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800548 enum State {
549 FINISHED = 0;
550 STARTED = 1;
551 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800552 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800553 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700554}
555
Bookatzc1a050a2017-10-10 15:49:28 -0700556/**
557 * Logs when the ble scan state changes.
558 *
559 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700560 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700561 */
562message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800563 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700564
565 enum State {
566 OFF = 0;
567 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700568 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
569 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700570 }
571 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700572
Bookatze5ec0b42018-03-26 13:34:56 -0700573 // Does the scan have a filter.
574 optional bool is_filtered = 3;
575 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
576 optional bool is_first_match = 4;
577 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
578 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700579}
580
581/**
582 * Logs reporting of a ble scan finding results.
583 *
584 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700585 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700586 */
Bookatzae6738e2018-09-13 11:38:56 -0700587// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700588message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800589 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700590
591 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800592 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700593}
594
595/**
596 * Logs when a sensor state changes.
597 *
598 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700599 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700600 */
601message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800602 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700603
Bookatzc1a050a2017-10-10 15:49:28 -0700604 // The id (int) of the sensor.
605 optional int32 sensor_id = 2;
606
607 enum State {
608 OFF = 0;
609 ON = 1;
610 }
611 optional State state = 3;
612}
613
Bookatzc1a050a2017-10-10 15:49:28 -0700614/**
615 * Logs when GPS state changes.
616 *
617 * Logged from:
618 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
619 */
620message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800621 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700622
623 enum State {
624 OFF = 0;
625 ON = 1;
626 }
627 optional State state = 2;
628}
629
Bookatz48d362e2018-11-06 15:49:08 -0800630/**
631 * Logs when GPS signal quality.
632 *
633 * Logged from:
634 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
635 */
636message GpsSignalQualityChanged {
637 optional android.server.location.GpsSignalQualityEnum level = 1;
638}
639
Bookatzc1a050a2017-10-10 15:49:28 -0700640
641/**
642 * Logs when a sync manager sync state changes.
643 *
644 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700645 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700646 */
647message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800648 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700649
David Chen0b5c90c2018-01-25 16:51:49 -0800650 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800651 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700652
653 enum State {
654 OFF = 0;
655 ON = 1;
656 }
657 optional State state = 3;
658}
659
Yangster-mac96353002018-09-05 11:18:55 -0700660/*
661 * Deferred job stats.
662 *
663 * Logged from:
664 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
665*/
666message DeferredJobStatsReported {
667 repeated AttributionNode attribution_node = 1;
668
669 // Number of jobs deferred.
670 optional int32 num_jobs_deferred = 2;
671
672 // Time since the last job runs.
673 optional int64 time_since_last_job_millis = 3;
674}
675
Bookatzc1a050a2017-10-10 15:49:28 -0700676/**
677 * Logs when a job scheduler job state changes.
678 *
679 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700680 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700681 */
682message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800683 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700684
685 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800686 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700687
688 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800689 FINISHED = 0;
690 STARTED = 1;
691 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700692 }
693 optional State state = 3;
694
Tej Singh33a412b2018-03-16 18:43:59 -0700695 // The reason a job has stopped.
696 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700697 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700698 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700699}
700
701/**
702 * Logs when the audio state changes.
703 *
704 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700705 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700706 */
707message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800708 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700709
710 enum State {
711 OFF = 0;
712 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700713 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
714 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700715 }
716 optional State state = 2;
717}
718
719/**
720 * Logs when the video codec state changes.
721 *
722 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700723 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700724 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800725message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800726 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700727
728 enum State {
729 OFF = 0;
730 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700731 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
732 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700733 }
734 optional State state = 2;
735}
736
737/**
738 * Logs when the flashlight state changes.
739 *
740 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700741 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700742 */
743message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800744 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700745
746 enum State {
747 OFF = 0;
748 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700749 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
750 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700751 }
752 optional State state = 2;
753}
754
755/**
756 * Logs when the camera state changes.
757 *
758 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700759 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700760 */
761message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800762 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700763
764 enum State {
765 OFF = 0;
766 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700767 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
768 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700769 }
770 optional State state = 2;
771}
772
773/**
774 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000775 *
776 * Logged from:
777 * TODO
778 */
Bookatzd6746242017-10-24 18:39:35 -0700779message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800780 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000781
Bookatz1a1b0462018-01-12 11:47:03 -0800782 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
783 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700784 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700785
786 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
787 optional string tag = 3;
788
789 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800790 RELEASE = 0;
791 ACQUIRE = 1;
792 CHANGE_RELEASE = 2;
793 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700794 }
795 optional State state = 4;
796}
797
798/**
Bookatzc1a050a2017-10-10 15:49:28 -0700799 * Logs when a partial wakelock is considered 'long' (over 1 min).
800 *
801 * Logged from:
802 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
803 */
804message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800805 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700806
Yao Chend54f9dd2017-10-17 17:37:48 +0000807 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
808 optional string tag = 2;
809
Bookatzc1a050a2017-10-10 15:49:28 -0700810 // TODO: I have no idea what this is.
811 optional string history_tag = 3;
812
813 enum State {
814 OFF = 0;
815 ON = 1;
816 }
817 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000818}
819
Bookatzc1a050a2017-10-10 15:49:28 -0700820/**
Bookatza66083f2018-09-20 17:24:00 -0700821 * Logs when the device is interactive, according to the PowerManager Notifier.
822 *
823 * Logged from:
824 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
825 */
826message InteractiveStateChanged {
827 enum State {
828 OFF = 0;
829 ON = 1;
830 }
831 optional State state = 1;
832}
833
834/**
Bookatzc1a050a2017-10-10 15:49:28 -0700835 * Logs Battery Saver state change.
836 *
837 * Logged from:
838 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
839 */
840message BatterySaverModeStateChanged {
841 enum State {
842 OFF = 0;
843 ON = 1;
844 }
845 optional State state = 1;
846}
847
848/**
849 * Logs Doze mode state change.
850 *
851 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800852 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700853 */
854message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800855 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800856}
857
858
859/**
860 * Logs state change of Doze mode including maintenance windows.
861 *
862 * Logged from:
863 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
864 */
865message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800866 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700867}
868
869/**
870 * Logs screen brightness level.
871 *
872 * Logged from:
873 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
874 */
875message ScreenBrightnessChanged {
876 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
877 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700878}
879
880/**
881 * Logs battery level (percent full, from 0 to 100).
882 *
883 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700884 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700885 */
886message BatteryLevelChanged {
887 // Battery level. Should be in [0, 100].
888 optional int32 battery_level = 1;
889}
890
891/**
892 * Logs change in charging status of the device.
893 *
894 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700895 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700896 */
897message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800898 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
899 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700900}
901
902/**
903 * Logs whether the device is plugged in, and what power source it is using.
904 *
905 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700906 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700907 */
908message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800909 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
910 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700911}
912
Bookatz8c6571b2017-10-24 15:04:41 -0700913/**
914 * Logs when an app's wakeup alarm fires.
915 *
916 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700917 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700918 */
919message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800920 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800921
922 // Name of the wakeup alarm.
923 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700924
925 // Name of source package (for historical reasons, since BatteryStats tracked it).
926 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800927}
928
929/**
930 * Logs when an an app causes the mobile radio to change state.
931 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
932 *
933 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700934 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800935 */
936message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800937 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800938
Bookatz1a1b0462018-01-12 11:47:03 -0800939 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
940 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800941}
942
943/**
944 * Logs when an an app causes the wifi radio to change state.
945 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
946 *
947 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700948 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800949 */
950message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800951 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800952
Bookatz1a1b0462018-01-12 11:47:03 -0800953 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
954 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700955}
956
957/**
958 * Logs kernel wakeup reasons and aborts.
959 *
960 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700961 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700962 */
963message KernelWakeupReported {
964 // Name of the kernel wakeup reason (or abort).
965 optional string wakeup_reason_name = 1;
966
967 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800968 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700969}
970
971/**
Bookatzda1798c2018-12-13 14:16:00 -0800972 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800973 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800974 *
975 * Logged from:
976 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
977 */
978message WifiEnabledStateChanged {
979 enum State {
980 OFF = 0;
981 ON = 1;
982 }
983 optional State state = 1;
984}
985
986/**
987 * 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 -0800988 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
989 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800990 *
991 * Logged from:
992 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
993 */
994message WifiRunningStateChanged {
995 repeated AttributionNode attribution_node = 1;
996
997 enum State {
998 OFF = 0;
999 ON = 1;
1000 }
1001 optional State state = 2;
1002}
1003
1004/**
Bookatze5885242017-10-24 20:10:31 -07001005 * Logs wifi locks held by an app.
1006 *
1007 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001008 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001009 */
1010message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001011 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001012
1013 enum State {
1014 OFF = 0;
1015 ON = 1;
1016 }
1017 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001018
1019 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1020 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001021}
1022
1023/**
1024 * Logs wifi signal strength changes.
1025 *
1026 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001027 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001028 */
1029message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001030 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1031 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001032}
1033
1034/**
1035 * Logs wifi scans performed by an app.
1036 *
1037 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001038 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001039 */
1040message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001041 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001042
1043 enum State {
1044 OFF = 0;
1045 ON = 1;
1046 }
1047 optional State state = 2;
1048}
1049
1050/**
Tej Singh4503e102018-01-04 14:35:01 -08001051 * Logs wifi multicast locks held by an app
1052 *
1053 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001054 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001055 */
1056message WifiMulticastLockStateChanged {
1057 repeated AttributionNode attribution_node = 1;
1058
1059 enum State {
1060 OFF = 0;
1061 ON = 1;
1062 }
1063 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001064
1065 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001066}
1067
1068/**
Tej Singh1ea42892018-01-19 09:27:00 -08001069 * Logs shutdown reason and duration on next boot.
1070 *
1071 * Logged from:
1072 * frameworks/base/core/java/com/android/server/BootReceiver.java
1073 */
1074message ShutdownSequenceReported {
1075 // True if shutdown is for a reboot. Default: false if we do not know.
1076 optional bool reboot = 1;
1077
1078 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1079 optional string reason = 2;
1080
1081 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1082 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001083 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001084
1085 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001086 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001087}
1088
Tej Singh6483ea42018-01-25 17:45:49 -08001089
1090/**
1091 * Logs boot reason and duration.
1092 *
1093 * Logged from:
1094 * system/core/bootstat/bootstat.cpp
1095 */
1096message BootSequenceReported {
1097 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1098 // Default: "<EMPTY>" if not available.
1099 optional string bootloader_reason = 1;
1100
1101 // Reason for system boot. Eg. bootloader, reboot,userrequested
1102 // Default: "<EMPTY>" if not available.
1103 optional string system_reason = 2;
1104
1105 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001106 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001107
1108 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001109 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001110
1111 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001112 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001113
1114 // Time since last boot in ms. Default: 0 if not available.
1115 optional int64 time_since_last_boot = 6;
1116}
1117
Tej Singhc477d9c2018-02-05 18:31:39 -08001118
1119/**
1120 * Logs call state and disconnect cause (if applicable).
1121 *
1122 * Logged from:
1123 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1124 */
1125message CallStateChanged {
1126 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1127 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1128 optional android.telecom.CallStateEnum call_state = 1;
1129
1130 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1131 // This value is only applicable when the call_state is DISCONNECTED, and
1132 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1133 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1134 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1135
1136 // True if the call is self-managed, which are apps that use the
1137 // telecom infrastructure to make their own calls.
1138 optional bool self_managed = 3;
1139
1140 // True if call is external. External calls are calls on connected Wear
1141 // devices but show up in Telecom so the user can pull them onto the device.
1142 optional bool external_call = 4;
1143}
1144
Tej Singh1ea42892018-01-19 09:27:00 -08001145/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001146 * Logs keyguard state. The keyguard is the lock screen.
1147 *
1148 * Logged from:
1149 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1150 */
1151message KeyguardStateChanged {
1152 enum State {
1153 UNKNOWN = 0;
1154 // The keyguard is hidden when the phone is unlocked.
1155 HIDDEN = 1;
1156 // The keyguard is shown when the phone is locked (screen turns off).
1157 SHOWN= 2;
1158 // The keyguard is occluded when something is overlaying the keyguard.
1159 // Eg. Opening the camera while on the lock screen.
1160 OCCLUDED = 3;
1161 }
1162 optional State state = 1;
1163}
1164
1165/**
1166 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1167 * prompts the user to enter a password (pattern, pin, etc).
1168 *
1169 * Logged from:
1170 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1171 */
1172
1173message KeyguardBouncerStateChanged {
1174 enum State {
1175 UNKNOWN = 0;
1176 // Bouncer is hidden, either as a result of successfully entering the
1177 // password, screen timing out, or user going back to lock screen.
1178 HIDDEN = 1;
1179 // This is when the user is being prompted to enter the password.
1180 SHOWN = 2;
1181 }
1182 optional State state = 1;
1183}
1184
1185/**
1186 * Logs the result of entering a password into the keyguard bouncer.
1187 *
1188 * Logged from:
1189 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1190 */
1191message KeyguardBouncerPasswordEntered {
1192 enum BouncerResult {
1193 UNKNOWN = 0;
1194 // The password entered was incorrect.
1195 FAILURE = 1;
1196 // The password entered was correct.
1197 SUCCESS = 2;
1198 }
1199 optional BouncerResult result = 1;
1200}
1201
Tej Singha883b372018-02-15 11:30:01 -08001202/*
1203 * Logs changes to the configuration of the device. The configuration is defined
1204 * in frameworks/base/core/java/android/content/res/Configuration.java
1205 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1206 * Please go there to interpret the possible values each field can be.
1207 *
1208 * Logged from:
1209 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1210 */
1211message ResourceConfigurationChanged {
1212 // Bit mask of color capabilities of the screen.
1213 // Contains information about the color gamut and hdr mode of the screen.
1214 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001215 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001216
1217 // The target screen density being rendered to.
1218 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001219 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001220
1221 // Current user preference for the scaling factor for fonts,
1222 // relative to the base density scaling.
1223 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001224 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001225
1226 // Flag indicating whether the hard keyboard is hidden.
1227 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001228 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001229
1230 // The type of keyboard attached to the device.
1231 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1232 optional int32 keyboard = 5;
1233
1234 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1235 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001236 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001237
1238 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1239 // 0 if undefined.
1240 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1241 optional int32 mcc = 7;
1242
1243 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1244 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1245 // MNC_ZERO symbol defined in Configuration.java.
1246 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1247 optional int32 mnc = 8;
1248
1249 // The kind of navigation available on the device.
1250 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1251 optional int32 navigation = 9;
1252
1253 // Flag indicating whether the navigation is available.
1254 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001255 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001256
1257 // Overall orientation of the screen.
1258 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1259 optional int32 orientation = 11;
1260
1261 // The current height of the available screen space, in dp units.
1262 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001263 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001264
1265 // Bit mask of overall layout of the screen.
1266 // Contains information about screen size, whether the screen is wider/taller
1267 // than normal, whether the screen layout is right-tl-left or left-to-right,
1268 // and whether the screen has a rounded shape.
1269 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001270 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001271
1272 // Current width of the available screen space, in dp units.
1273 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001274 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001275
1276 // The smallest screen size an application will see in normal operation.
1277 // This is the smallest value of both screenWidthDp and screenHeightDp
1278 // in portrait and landscape.
1279 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001280 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001281
1282 // The type of touch screen attached to the device.
1283 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1284 optional int32 touchscreen = 16;
1285
1286 // Bit mask of the ui mode.
1287 // Contains information about the overall ui mode of the device.
1288 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1289 // Also contains information about whether the device is in night mode.
1290 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001291 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001292}
1293
Tej Singheee317b2018-03-07 19:28:05 -08001294
1295/**
1296 * Logs changes in the connection state of the mobile radio.
1297 *
1298 * Logged from:
1299 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1300 */
1301message MobileConnectionStateChanged {
1302 // States are from the state machine DataConnection.java.
1303 enum State {
1304 UNKNOWN = 0;
1305 // The connection is inactive, or disconnected.
1306 INACTIVE = 1;
1307 // The connection is being activated, or connecting.
1308 ACTIVATING = 2;
1309 // The connection is active, or connected.
1310 ACTIVE = 3;
1311 // The connection is disconnecting.
1312 DISCONNECTING = 4;
1313 // The connection is disconnecting after creating a connection.
1314 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1315 }
1316 optional State state = 1;
1317 // For multi-sim phones, this distinguishes between the sim cards.
1318 optional int32 sim_slot_index = 2;
1319 // Used to identify the connection. Starts at 0 and increments by 1 for
1320 // every new network created. Resets whenever the device reboots.
1321 optional int32 data_connection_id = 3;
1322 // A bitmask for the capabilities of this connection.
1323 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1324 // Default value (if we have no information): 0
1325 optional int64 capabilities = 4;
1326 // If this connection has internet.
1327 // This just checks if the DEFAULT bit of capabilities is set.
1328 optional bool has_internet = 5;
1329}
1330
1331/**
1332 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1333 *
1334 * Logged from:
1335 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1336 */
1337message MobileRadioTechnologyChanged {
1338 optional android.telephony.NetworkTypeEnum state = 1;
1339 // For multi-sim phones, this distinguishes between the sim cards.
1340 optional int32 sim_slot_index = 2;
1341}
1342
Andrew Chantb56388b2018-03-22 21:07:33 -07001343/**
1344 * Logs the VID and PID of any connected USB devices.
1345 *
1346 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1347 *
1348 * Logged by Vendor.
1349 */
1350message UsbDeviceAttached {
1351 optional int32 vid = 1;
1352 optional int32 pid = 2;
1353 optional bool has_audio = 3;
1354 optional bool has_hid = 4;
1355 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001356 enum State {
1357 STATE_DISCONNECTED = 0;
1358 STATE_CONNECTED = 1;
1359 }
1360 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001361 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001362}
1363
Tej Singheee317b2018-03-07 19:28:05 -08001364
Tej Singhdd7bd352018-02-09 19:33:15 -08001365/**
Tej Singh5d991e12018-03-09 19:48:11 -08001366 * Logs when Bluetooth is enabled and disabled.
1367 *
1368 * Logged from:
1369 * services/core/java/com/android/server/BluetoothManagerService.java
1370 */
1371message BluetoothEnabledStateChanged {
1372 repeated AttributionNode attribution_node = 1;
1373 // Whether or not bluetooth is enabled on the device.
1374 enum State {
1375 UNKNOWN = 0;
1376 ENABLED = 1;
1377 DISABLED = 2;
1378 }
1379 optional State state = 2;
1380 // The reason for being enabled/disabled.
1381 // Eg. Airplane mode, crash, application request.
1382 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1383 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001384 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001385}
1386
1387/**
Jack Hed9837c82019-01-09 01:19:13 -08001388 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001389 *
1390 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001391 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1392 *
1393 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001394 */
1395message BluetoothConnectionStateChanged {
1396 // The state of the connection.
1397 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1398 optional android.bluetooth.ConnectionStateEnum state = 1;
1399 // An identifier that can be used to match connect and disconnect events.
1400 // Currently is last two bytes of a hash of a device level ID and
1401 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001402 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1403 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001404 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1405 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001406 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001407 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001408 // An identifier that can be used to match events for this device.
1409 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1410 // Salt: Randomly generated 256 bit value
1411 // Hash algorithm: HMAC-SHA256
1412 // Size: 32 byte
1413 // Default: null or empty if the device identifier is not known
1414 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1415}
1416
1417/**
1418 * Logs when a Bluetooth device connects and disconnects over ACL
1419 *
1420 * Logged from:
1421 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1422 *
1423 * Next Tag: 3
1424 */
1425message BluetoothAclConnectionStateChanged {
1426 // An identifier that can be used to match events for this device.
1427 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1428 // Salt: Randomly generated 256 bit value
1429 // Hash algorithm: HMAC-SHA256
1430 // Size: 32 byte
1431 // Default: null or empty if the device identifier is not known
1432 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1433 // The state of the connection.
1434 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1435 optional android.bluetooth.ConnectionStateEnum state = 2;
1436}
1437
1438/**
1439 * Logs when a Bluetooth device connects and disconnects over SCO
1440 *
1441 * Logged from:
1442 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1443 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1444 *
1445 * Next Tag: 4
1446 */
1447message BluetoothScoConnectionStateChanged {
1448 // An identifier that can be used to match events for this device.
1449 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1450 // Salt: Randomly generated 256 bit value
1451 // Hash algorithm: HMAC-SHA256
1452 // Size: 32 byte
1453 // Default: null or empty if the device identifier is not known
1454 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1455 // The state of the connection.
1456 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1457 optional android.bluetooth.ConnectionStateEnum state = 2;
1458 // Codec used for this SCO connection
1459 // Default: UNKNOWN
1460 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001461}
1462
Jack Hec27040a2019-01-09 20:54:41 -08001463/**
1464 * Logged when active device of a profile changes
1465 *
1466 * Logged from:
1467 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1468 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1469 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1470 */
1471message BluetoothActiveDeviceChanged {
1472 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1473 // From android.bluetooth.BluetoothProfile
1474 optional int32 bt_profile = 1;
1475 // An identifier that can be used to match events for this new active device.
1476 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1477 // Salt: Randomly generated 256 bit value
1478 // Hash algorithm: HMAC-SHA256
1479 // Size: 32 byte
1480 // Default: null or empty if there is no active device for this profile
1481 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1482}
1483
Jack Heab86dbd22018-12-18 15:43:27 -08001484// Logs when there is an event affecting Bluetooth device's link layer connection.
1485// - This event is triggered when there is a related HCI command or event
1486// - Users of this metrics can deduce Bluetooth device's connection state from these events
1487// - HCI commands are logged before the command is sent, after receiving command status, and after
1488// receiving command complete
1489// - HCI events are logged when they arrive
1490//
1491// Low level log from system/bt
1492//
1493// Bluetooth classic commands:
1494// - CMD_CREATE_CONNECTION
1495// - CMD_DISCONNECT
1496// - CMD_CREATE_CONNECTION_CANCEL
1497// - CMD_ACCEPT_CONNECTION_REQUEST
1498// - CMD_REJECT_CONNECTION_REQUEST
1499// - CMD_SETUP_ESCO_CONNECTION
1500// - CMD_ACCEPT_ESCO_CONNECTION
1501// - CMD_REJECT_ESCO_CONNECTION
1502// - CMD_ENH_SETUP_ESCO_CONNECTION
1503// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1504//
1505// Bluetooth low energy commands:
1506// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1507// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1508// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1509// - CMD_BLE_CLEAR_WHITE_LIST
1510// - CMD_BLE_ADD_WHITE_LIST
1511// - CMD_BLE_REMOVE_WHITE_LIST
1512//
1513// Bluetooth classic events:
1514// - EVT_CONNECTION_COMP
1515// - EVT_CONNECTION_REQUEST
1516// - EVT_DISCONNECTION_COMP
1517// - EVT_ESCO_CONNECTION_COMP
1518// - EVT_ESCO_CONNECTION_CHANGED
1519//
1520// Bluetooth low energy meta events:
1521// - BLE_EVT_CONN_COMPLETE_EVT
1522// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1523//
1524// Next tag: 10
1525message BluetoothLinkLayerConnectionEvent {
1526 // An identifier that can be used to match events for this device.
1527 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1528 // Salt: Randomly generated 256 bit value
1529 // Hash algorithm: HMAC-SHA256
1530 // Size: 32 byte
1531 // Default: null or empty if the device identifier is not known
1532 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1533 // Connection handle of this connection if available
1534 // Range: 0x0000 - 0x0EFF (12 bits)
1535 // Default: 0xFFFF if the handle is unknown
1536 optional int32 connection_handle = 2;
1537 // Direction of the link
1538 // Default: DIRECTION_UNKNOWN
1539 optional android.bluetooth.DirectionEnum direction = 3;
1540 // Type of this link
1541 // Default: LINK_TYPE_UNKNOWN
1542 optional android.bluetooth.LinkTypeEnum type = 4;
1543
1544 // Reason metadata for this link layer connection event, rules for interpretation:
1545 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1546 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1547 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1548 // set and valid, ignore hci_ble_event
1549
1550 // HCI command associated with this event
1551 // Default: CMD_UNKNOWN
1552 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1553 // HCI event associated with this event
1554 // Default: EVT_UNKNOWN
1555 optional android.bluetooth.hci.EventEnum hci_event = 6;
1556 // HCI BLE meta event associated with this event
1557 // Default: BLE_EVT_UNKNOWN
1558 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1559 // HCI command status code if this is triggerred by hci_cmd
1560 // Default: STATUS_UNKNOWN
1561 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1562 // HCI reason code associated with this event
1563 // Default: STATUS_UNKNOWN
1564 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1565}
1566
Howard Roe103fe22019-01-17 16:52:16 -08001567/**
1568 * Logs when a module is rolled back by Watchdog.
1569 *
1570 * Logged from: Rollback Manager
1571 */
1572message WatchdogRollbackOccurred {
1573 enum RollbackType {
1574 UNKNOWN = 0;
1575 ROLLBACK_INITIATE = 1;
1576 ROLLBACK_SUCCESS = 2;
1577 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001578 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001579 }
1580 optional RollbackType rollback_type = 1;
1581
1582 optional string package_name = 2;
1583
1584 optional int32 package_version_code = 3;
1585}
1586
Jack Hec27040a2019-01-09 20:54:41 -08001587/**
1588 * Logs when there is a change in Bluetooth A2DP playback state
1589 *
1590 * Logged from:
1591 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1592 */
1593message BluetoothA2dpPlaybackStateChanged {
1594 // An identifier that can be used to match events for this device.
1595 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1596 // Salt: Randomly generated 256 bit value
1597 // Hash algorithm: HMAC-SHA256
1598 // Size: 32 byte
1599 // Default: null or empty if the device identifier is not known
1600 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1601 // Current playback state
1602 // Default: PLAYBACK_STATE_UNKNOWN
1603 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1604 // Current audio coding mode
1605 // Default: AUDIO_CODING_MODE_UNKNOWN
1606 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1607}
1608
1609/**
1610 * Logs when there is a change in A2DP codec config for a particular remote device
1611 *
1612 * Logged from:
1613 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1614 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1615 */
1616message BluetoothA2dpCodecConfigChanged {
1617 // An identifier that can be used to match events for this device.
1618 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1619 // Salt: Randomly generated 256 bit value
1620 // Hash algorithm: HMAC-SHA256
1621 // Size: 32 byte
1622 // Default: null or empty if the device identifier is not known
1623 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1624 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1625 // Default SOURCE_CODEC_TYPE_INVALID
1626 optional int32 codec_type = 2;
1627 // Codec priroity, the higher the more preferred, -1 for disabled
1628 // Default: CODEC_PRIORITY_DEFAULT
1629 optional int32 codec_priority = 3;
1630 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1631 // Default: SAMPLE_RATE_NONE
1632 optional int32 sample_rate = 4;
1633 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1634 // Default: BITS_PER_SAMPLE_NONE
1635 optional int32 bits_per_sample = 5;
1636 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1637 // Default: CHANNEL_MODE_NONE
1638 optional int32 channel_mode = 6;
1639 // Codec specific values
1640 // Default 0
1641 optional int64 codec_specific_1 = 7;
1642 optional int64 codec_specific_2 = 8;
1643 optional int64 codec_specific_3 = 9;
1644 optional int64 codec_specific_4 = 10;
1645}
1646
1647/**
1648 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1649 * Each codec's capability is logged separately due to statsd restriction
1650 *
1651 * Logged from:
1652 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1653 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1654 */
1655message BluetoothA2dpCodecCapabilityChanged {
1656 // An identifier that can be used to match events for this device.
1657 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1658 // Salt: Randomly generated 256 bit value
1659 // Hash algorithm: HMAC-SHA256
1660 // Size: 32 byte
1661 // Default: null or empty if the device identifier is not known
1662 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1663 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1664 // Default SOURCE_CODEC_TYPE_INVALID
1665 optional int32 codec_type = 2;
1666 // Codec priroity, the higher the more preferred, -1 for disabled
1667 // Default: CODEC_PRIORITY_DEFAULT
1668 optional int32 codec_priority = 3;
1669 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1670 // in BluetoothCodecConfig
1671 // Default: empty and SAMPLE_RATE_NONE for individual item
1672 optional int32 sample_rate = 4;
1673 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1674 // in BluetoothCodecConfig
1675 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1676 optional int32 bits_per_sample = 5;
1677 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1678 // BluetoothCodecConfig
1679 // Default: empty and CHANNEL_MODE_NONE for individual item
1680 optional int32 channel_mode = 6;
1681 // Codec specific values
1682 // Default 0
1683 optional int64 codec_specific_1 = 7;
1684 optional int64 codec_specific_2 = 8;
1685 optional int64 codec_specific_3 = 9;
1686 optional int64 codec_specific_4 = 10;
1687}
1688
1689/**
1690 * Logs when A2DP failed to read from PCM source.
1691 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1692 *
1693 * Logged from:
1694 * system/bt
1695 */
1696message BluetoothA2dpAudioUnderrunReported {
1697 // An identifier that can be used to match events for this device.
1698 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1699 // Salt: Randomly generated 256 bit value
1700 // Hash algorithm: HMAC-SHA256
1701 // Size: 32 byte
1702 // Default: null or empty if the device identifier is not known
1703 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1704 // Encoding interval in nanoseconds
1705 // Default: 0
1706 optional int64 encoding_interval_nanos = 2;
1707 // Number of bytes of PCM data that could not be read from the source
1708 // Default: 0
1709 optional int32 num_missing_pcm_bytes = 3;
1710}
1711
1712/**
1713 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1714 * buffer queue is full and we have to drop data
1715 *
1716 * Logged from:
1717 * system/bt
1718 */
1719message BluetoothA2dpAudioOverrunReported {
1720 // An identifier that can be used to match events for this device.
1721 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1722 // Salt: Randomly generated 256 bit value
1723 // Hash algorithm: HMAC-SHA256
1724 // Size: 32 byte
1725 // Default: null or empty if the device identifier is not known
1726 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1727 // Encoding interval in nanoseconds
1728 // Default: 0
1729 optional int64 encoding_interval_nanos = 2;
1730 // Number of buffers dropped in this event
1731 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1732 // Default: 0
1733 optional int32 num_dropped_buffers = 3;
1734 // Number of encoded buffers dropped in this event
1735 // Default 0
1736 optional int32 num_dropped_encoded_frames = 4;
1737 // Number of encoded bytes dropped in this event
1738 // Default: 0
1739 optional int32 num_dropped_encoded_bytes = 5;
1740}
1741
1742/**
1743 * Logs when we receive reports regarding a device's RSSI value
1744 *
1745 * Logged from:
1746 * system/bt
1747 */
1748message BluetoothDeviceRssiReported {
1749 // An identifier that can be used to match events for this device.
1750 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1751 // Salt: Randomly generated 256 bit value
1752 // Hash algorithm: HMAC-SHA256
1753 // Size: 32 byte
1754 // Default: null or empty if the device identifier is not known
1755 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1756 // Connection handle of this connection if available
1757 // Range: 0x0000 - 0x0EFF (12 bits)
1758 // Default: 0xFFFF if the handle is unknown
1759 optional int32 connection_handle = 2;
1760 // HCI command status code if this is triggerred by hci_cmd
1761 // Default: STATUS_UNKNOWN
1762 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1763 // BR/EDR
1764 // Range: -128 ≤ N ≤ 127 (signed integer)
1765 // Units: dB
1766 // LE:
1767 // Range: -127 to 20, 127 (signed integer)
1768 // Units: dBm
1769 // Invalid when an out of range value is reported
1770 optional int32 rssi = 4;
1771}
1772
1773/**
1774 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1775 *
1776 * Logged from:
1777 * system/bt
1778 */
1779message BluetoothDeviceFailedContactCounterReported {
1780 // An identifier that can be used to match events for this device.
1781 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1782 // Salt: Randomly generated 256 bit value
1783 // Hash algorithm: HMAC-SHA256
1784 // Size: 32 byte
1785 // Default: null or empty if the device identifier is not known
1786 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1787 // Connection handle of this connection if available
1788 // Range: 0x0000 - 0x0EFF (12 bits)
1789 // Default: 0xFFFF if the handle is unknown
1790 optional int32 connection_handle = 2;
1791 // HCI command status code if this is triggerred by hci_cmd
1792 // Default: STATUS_UNKNOWN
1793 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1794 // Number of consecutive failed contacts for a connection corresponding to the Handle
1795 // Range: uint16_t, 0-0xFFFF
1796 // Default: 0xFFFFF
1797 optional int32 failed_contact_counter = 4;
1798}
1799
1800/**
1801 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1802 *
1803 * Logged from:
1804 * system/bt
1805 */
1806message BluetoothDeviceTxPowerLevelReported {
1807 // An identifier that can be used to match events for this device.
1808 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1809 // Salt: Randomly generated 256 bit value
1810 // Hash algorithm: HMAC-SHA256
1811 // Size: 32 byte
1812 // Default: null or empty if the device identifier is not known
1813 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1814 // Connection handle of this connection if available
1815 // Range: 0x0000 - 0x0EFF (12 bits)
1816 // Default: 0xFFFF if the handle is unknown
1817 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001818 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001819 // Default: STATUS_UNKNOWN
1820 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1821 // Range: -30 ≤ N ≤ 20
1822 // Units: dBm
1823 // Invalid when an out of range value is reported
1824 optional int32 transmit_power_level = 4;
1825}
Jack Heab86dbd22018-12-18 15:43:27 -08001826
Tej Singh5d991e12018-03-09 19:48:11 -08001827/**
Jack He1021a612019-01-20 21:22:46 -08001828 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1829 * receiving an HCI command from the host
1830 *
1831 * Logged from: system/bt
1832 */
1833message BluetoothHciTimeoutReported {
1834 // HCI command associated with this event
1835 // Default: CMD_UNKNOWN
1836 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1837}
1838
1839/**
1840 * Logs when we receive Bluetooth Link Quality Report event from the controller
1841 * See Android Bluetooth HCI specification for more details
1842 *
1843 * Note: all count and bytes field are counted since last event
1844 *
1845 * Logged from: system/bt
1846 */
1847message BluetoothQualityReportReported {
1848 // Quality report ID
1849 // Original type: uint8_t
1850 // Default: BQR_ID_UNKNOWN
1851 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1852 // Packet type of the connection
1853 // Original type: uint8_t
1854 // Default: BQR_PACKET_TYPE_UNKNOWN
1855 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1856 // Connection handle of the connection
1857 // Original type: uint16_t
1858 optional int32 connection_handle = 3;
1859 // Performing Role for the connection
1860 // Original type: uint8_t
1861 optional int32 connection_role = 4;
1862 // Current Transmit Power Level for the connection. This value is the same as the controller's
1863 // response to the HCI_Read_Transmit_Power_Level HCI command
1864 // Original type: uint8_t
1865 optional int32 tx_power_level = 5;
1866 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1867 // absolute receiver signal strength value
1868 // Original type: int8_t
1869 optional int32 rssi = 6;
1870 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1871 // channels used by the link currently
1872 // Original type: uint8_t
1873 optional int32 snr = 7;
1874 // Indicates the number of unused channels in AFH_channel_map
1875 // Original type: uint8_t
1876 optional int32 unused_afh_channel_count = 8;
1877 // Indicates the number of the channels which are interfered and quality is bad but are still
1878 // selected for AFH
1879 // Original type: uint8_t
1880 optional int32 afh_select_unideal_channel_count = 9;
1881 // Current Link Supervision Timeout Setting
1882 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1883 // Original type: uint16_t
1884 optional int32 lsto = 10;
1885 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1886 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1887 // 0x01 (Piconet Clock)
1888 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1889 // Original type: uint32_t
1890 optional int64 connection_piconet_clock = 11;
1891 // The count of retransmission
1892 // Original type: uint32_t
1893 optional int64 retransmission_count = 12;
1894 // The count of no RX
1895 // Original type: uint32_t
1896 optional int64 no_rx_count = 13;
1897 // The count of NAK (Negative Acknowledge)
1898 // Original type: uint32_t
1899 optional int64 nak_count = 14;
1900 // Controller timestamp of last TX ACK
1901 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1902 // Original type: uint32_t
1903 optional int64 last_tx_ack_timestamp = 15;
1904 // The count of Flow-off (STOP)
1905 // Original type: uint32_t
1906 optional int64 flow_off_count = 16;
1907 // Controller timestamp of last Flow-on (GO)
1908 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1909 // Original type: uint32_t
1910 optional int64 last_flow_on_timestamp = 17;
1911 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1912 // Original type: uint32_t
1913 optional int64 buffer_overflow_bytes = 18;
1914 // Buffer underflow count (in byte) since last event
1915 // Original type: uint32_t
1916 optional int64 buffer_underflow_bytes = 19;
1917}
1918
1919/**
1920 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1921 *
1922 * Notes:
1923 * - Each event can be partially filled as we might learn different pieces of device
1924 * information at different time
1925 * - Multiple device info events can be combined to give more complete picture
1926 * - When multiple device info events tries to describe the same information, the
1927 * later one wins
1928 *
1929 * Logged from:
1930 * packages/apps/Bluetooth
1931 */
1932message BluetoothManufacturerInfoReported {
1933 // An identifier that can be used to match events for this device.
1934 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1935 // Salt: Randomly generated 256 bit value
1936 // Hash algorithm: HMAC-SHA256
1937 // Size: 32 byte
1938 // Default: null or empty if the device identifier is not known
1939 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1940 // Where is this device info obtained from
1941 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1942 // Name of the data source
1943 // For EXTERNAL: package name of the data source
1944 // For INTERNAL: null for general case, component name otherwise
1945 optional string source_name = 3;
1946 // Name of the manufacturer of this device
1947 optional string manufacturer = 4;
1948 // Model of this device
1949 optional string model = 5;
1950 // Hardware version of this device
1951 optional string hardware_version = 6;
1952 // Software version of this device
1953 optional string software_version = 7;
1954}
1955
1956/**
1957 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1958 * device, as documented by the Bluetooth Core HCI specification
1959 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1960 * Vol 2, Part E, Page 1118
1961 *
1962 * Logged from:
1963 * system/bt
1964 */
1965message BluetoothRemoteVersionInfoReported {
1966 // Connection handle of the connection
1967 // Original type: uint16_t
1968 optional int32 connection_handle = 1;
1969 // HCI command status code
1970 // Default: STATUS_UNKNOWN
1971 optional android.bluetooth.hci.StatusEnum hci_status = 2;
1972 // 1 byte Version of current LMP in the remote controller
1973 optional int32 lmp_version = 3;
1974 // 2 bytes LMP manufacturer code of the remote controller
1975 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
1976 optional int32 lmp_manufacturer_code = 4;
1977 // 4 bytes subversion of the LMP in the remote controller
1978 optional int32 lmp_subversion = 5;
1979}
1980
1981/**
1982 * Logs when certain Bluetooth SDP attributes are discovered
1983 * Constant definitions are from:
1984 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
1985 *
1986 * Current logged attributes:
1987 * - BluetoothProfileDescriptorList
1988 * - Supported Features Bitmask
1989 *
1990 * Logged from:
1991 * system/bt
1992 */
1993message BluetoothSdpAttributeReported {
1994 // An identifier that can be used to match events for this device.
1995 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1996 // Salt: Randomly generated 256 bit value
1997 // Hash algorithm: HMAC-SHA256
1998 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1999 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2000 // Original type: uint16_t
2001 optional int32 protocol_uuid = 2;
2002 // Short form UUIDs used to identify Bluetooth SDP attribute types
2003 // Original type: uint16_t
2004 optional int32 attribute_id = 3;
2005 // Attribute value for the particular attribute
2006 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2007}
2008
2009/**
2010 * Logs when bond state of a Bluetooth device changes
2011 *
2012 * Logged from:
2013 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2014 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2015 */
2016message BluetoothBondStateChanged {
2017 // An identifier that can be used to match events for this device.
2018 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2019 // Salt: Randomly generated 256 bit value
2020 // Hash algorithm: HMAC-SHA256
2021 // Size: 32 byte
2022 // Default: null or empty if the device identifier is not known
2023 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2024 // Preferred transport type to remote dual mode device
2025 // Default: TRANSPORT_AUTO means no preference
2026 optional android.bluetooth.TransportTypeEnum transport = 2;
2027 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2028 // Default: UNKNOWN
2029 optional android.bluetooth.DeviceTypeEnum type = 3;
2030 // Current bond state (NONE, BONDING, BONDED)
2031 // Default: BOND_STATE_UNKNOWN
2032 optional android.bluetooth.BondStateEnum bond_state = 4;
2033 // Bonding sub state
2034 // Default: BOND_SUB_STATE_UNKNOWN
2035 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2036 // Unbond Reason
2037 // Default: UNBOND_REASON_UNKNOWN
2038 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2039}
2040
2041/**
2042 * Logs there is an event related Bluetooth classic pairing
2043 *
2044 * Logged from:
2045 * system/bt
2046 */
2047message BluetoothClassicPairingEventReported {
2048 // An identifier that can be used to match events for this device.
2049 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2050 // Salt: Randomly generated 256 bit value
2051 // Hash algorithm: HMAC-SHA256
2052 // Size: 32 byte
2053 // Default: null or empty if the device identifier is not known
2054 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2055 // Connection handle of this connection if available
2056 // Range: 0x0000 - 0x0EFF (12 bits)
2057 // Default: 0xFFFF if the handle is unknown
2058 optional int32 connection_handle = 2;
2059 // HCI command associated with this event
2060 // Default: CMD_UNKNOWN
2061 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2062 // HCI event associated with this event
2063 // Default: EVT_UNKNOWN
2064 optional android.bluetooth.hci.EventEnum hci_event = 4;
2065 // HCI command status code if this is triggerred by hci_cmd
2066 // Default: STATUS_UNKNOWN
2067 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2068 // HCI reason code associated with this event
2069 // Default: STATUS_UNKNOWN
2070 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002071 // A status value related to this specific event
2072 // Default: 0
2073 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002074}
2075
2076/**
2077 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2078 *
2079 * Logged from:
2080 * system/bt
2081 */
2082message BluetoothSmpPairingEventReported {
2083 // An identifier that can be used to match events for this device.
2084 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2085 // Salt: Randomly generated 256 bit value
2086 // Hash algorithm: HMAC-SHA256
2087 // Size: 32 byte
2088 // Default: null or empty if the device identifier is not known
2089 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2090 // SMP command sent or received over L2CAP
2091 // Default: CMD_UNKNOWN
2092 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2093 // Whether this command is sent or received
2094 // Default: DIRECTION_UNKNOWN
2095 optional android.bluetooth.DirectionEnum direction = 3;
2096 // SMP failure reason code
2097 // Default: PAIRING_FAIL_REASON_DEFAULT
2098 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2099}
2100
2101/**
Jack He815cdba2019-01-30 17:24:55 -08002102 * Logs when a Bluetooth socket’s connection state changed
2103 *
2104 * Logged from:
2105 * system/bt
2106 */
2107message BluetoothSocketConnectionStateChanged {
2108 // An identifier that can be used to match events for this device.
2109 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2110 // Salt: Randomly generated 256 bit value
2111 // Hash algorithm: HMAC-SHA256
2112 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002113 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002114 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002115 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002116 // Default 0 when unknown or don't care
2117 optional int32 port = 2;
2118 // Socket type as mentioned in
2119 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2120 // Default: SOCKET_TYPE_UNKNOWN
2121 optional android.bluetooth.SocketTypeEnum type = 3;
2122 // Socket connection state
2123 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2124 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2125 // Number of bytes sent to remote device during this connection
2126 optional int64 tx_bytes = 5;
2127 // Number of bytes received from remote device during this connection
2128 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002129 // Socket owner's UID
2130 optional int32 uid = 7 [(is_uid) = true];
2131 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2132 // |port| must be spawned by |server_port|
2133 // Default 0 when unknown or don't care
2134 optional int32 server_port = 8;
2135 // Whether this is a server listener socket
2136 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002137}
2138
2139/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002140 * Logs when something is plugged into or removed from the USB-C connector.
2141 *
2142 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002143 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002144 */
2145message UsbConnectorStateChanged {
2146 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002147 STATE_DISCONNECTED = 0;
2148 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002149 }
2150 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002151 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002152 // Last active session in ms.
2153 // 0 when the port is in connected state.
2154 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002155}
2156
2157/**
2158 * Logs the reported speaker impedance.
2159 *
2160 * Logged from:
2161 * Vendor audio implementation.
2162 */
2163message SpeakerImpedanceReported {
2164 optional int32 speaker_location = 1;
2165 optional int32 impedance = 2;
2166}
2167
2168/**
2169 * Logs the report of a failed hardware.
2170 *
2171 * Logged from:
2172 * Vendor HALs.
2173 *
2174 */
2175message HardwareFailed {
2176 enum HardwareType {
2177 HARDWARE_FAILED_UNKNOWN = 0;
2178 HARDWARE_FAILED_MICROPHONE = 1;
2179 HARDWARE_FAILED_CODEC = 2;
2180 HARDWARE_FAILED_SPEAKER = 3;
2181 HARDWARE_FAILED_FINGERPRINT = 4;
2182 }
2183 optional HardwareType hardware_type = 1;
2184
Maggie White6dcd8572019-01-31 14:11:50 -08002185 /**
2186 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002187 * the same hardware_type. The specific locations are vendor defined integers,
2188 * referring to board-specific numbering schemes.
2189 */
2190 optional int32 hardware_location = 2;
2191
Maggie White6dcd8572019-01-31 14:11:50 -08002192 /**
2193 * failure_code is specific to the HardwareType of the failed hardware.
2194 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002195 */
Maggie White6dcd8572019-01-31 14:11:50 -08002196 enum HardwareErrorCode {
2197 UNKNOWN = 0;
2198 COMPLETE = 1;
2199 SPEAKER_HIGH_Z = 2;
2200 SPEAKER_SHORT = 3;
2201 FINGERPRINT_SENSOR_BROKEN = 4;
2202 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002203 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002204 }
2205 optional int32 failure_code = 3;
2206}
2207
2208/**
2209 * Log an event when the device has been physically dropped.
2210 * Reported from the /vendor partition.
2211 */
2212message PhysicalDropDetected {
2213 // Confidence that the event was actually a drop, 0 -> 100
2214 optional int32 confidence_pctg = 1;
2215 // Peak acceleration of the drop, in 1/1000s of a g.
2216 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002217 // Duration of freefall in ms
2218 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002219}
2220
2221/**
2222 * Log bucketed battery charge cycles.
2223 *
2224 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002225 * a given charge point. For example, if 10 cycle buckets are
2226 * initialized, bucket 1 is the lowest 1/10th of the battery,
2227 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002228 *
2229 * Logged from:
2230 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2231 */
2232message ChargeCyclesReported {
2233 optional int32 cycle_bucket_1 = 1;
2234 optional int32 cycle_bucket_2 = 2;
2235 optional int32 cycle_bucket_3 = 3;
2236 optional int32 cycle_bucket_4 = 4;
2237 optional int32 cycle_bucket_5 = 5;
2238 optional int32 cycle_bucket_6 = 6;
2239 optional int32 cycle_bucket_7 = 7;
2240 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002241 optional int32 cycle_bucket_9 = 9;
2242 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002243}
2244
2245/**
Howard Roa46b6582018-09-18 16:45:02 -07002246 * Log battery health snapshot.
2247 *
2248 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2249 * are snapshotted periodically over 24hrs.
2250 */
2251message BatteryHealthSnapshot {
2252 enum BatterySnapshotType {
2253 UNKNOWN = 0;
2254 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2255 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2256 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2257 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2258 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2259 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2260 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2261 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2262 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2263 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2264 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2265 }
2266 optional BatterySnapshotType type = 1;
2267 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002268 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002269 // Voltage Battery Voltage, in microVolts.
2270 optional int32 voltage_micro_volt = 3;
2271 // Current Battery current, in microAmps.
2272 optional int32 current_micro_amps = 4;
2273 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2274 optional int32 open_circuit_micro_volt = 5;
2275 // Resistance Battery Resistance, in microOhms.
2276 optional int32 resistance_micro_ohm = 6;
2277 // Level Battery Level, as % of full.
2278 optional int32 level_percent = 7;
2279}
2280
2281/**
2282 * Log slow I/O operations on the primary storage.
2283 */
2284message SlowIo {
2285 // Classifications of IO Operations.
2286 enum IoOperation {
2287 UNKNOWN = 0;
2288 READ = 1;
2289 WRITE = 2;
2290 UNMAP = 3;
2291 SYNC = 4;
2292 }
2293 optional IoOperation operation = 1;
2294
2295 // The number of slow IO operations of this type over 24 hours.
2296 optional int32 count = 2;
2297}
2298
2299/**
2300 * Log battery caused shutdown with the last recorded voltage.
2301 */
2302message BatteryCausedShutdown {
2303 // The last recorded battery voltage prior to shutdown.
2304 optional int32 last_recorded_micro_volt = 1;
2305}
2306
2307/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002308 * Logs the duration of a davey (jank of >=700ms) when it occurs
2309 *
2310 * Logged from:
2311 * frameworks/base/libs/hwui/JankTracker.cpp
2312 */
2313message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002314 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002315 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002316
Tej Singhbb8554a2018-01-26 11:59:14 -08002317 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002318 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002319}
2320
2321/**
Bookatze5885242017-10-24 20:10:31 -07002322 * Logs phone signal strength changes.
2323 *
2324 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002325 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002326 */
2327message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002328 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2329 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002330}
2331
Yangster4ccebea2018-10-09 17:09:02 -07002332
2333/**
2334 * Logs when the phone state, sim state or signal strength changes
2335 *
2336 * Logged from:
2337 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2338 */
2339message PhoneServiceStateChanged {
2340 optional android.telephony.ServiceStateEnum state = 1;
2341 optional android.telephony.SimStateEnum sim_state = 2;
2342 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2343}
2344
2345/**
2346 * Logs when the phone becomes on or off.
2347 *
2348 * Logged from:
2349 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2350 */
2351message PhoneStateChanged {
2352 enum State {
2353 OFF = 0;
2354 ON = 1;
2355 }
2356 optional State state = 1;
2357}
2358
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002359message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002360 optional android.stats.launcher.LauncherAction action = 1;
2361 optional android.stats.launcher.LauncherState src_state = 2;
2362 optional android.stats.launcher.LauncherState dst_state = 3;
2363 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002364 optional bool is_swipe_up_enabled = 5;
2365}
2366
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002367message StyleUIChanged {
2368 optional android.stats.style.Action action = 1;
2369 optional int32 color_package_hash = 2;
2370 optional int32 font_package_hash = 3;
2371 optional int32 shape_package_hash = 4;
2372 optional int32 clock_package_hash = 5;
2373 optional int32 launcher_grid = 6;
2374 optional int32 wallpaper_category_hash = 7;
2375 optional int32 wallpaper_id_hash = 8;
2376}
2377
David Chenc28b2bb2017-10-24 12:52:52 -07002378/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002379 * Logs when Settings UI has changed.
2380 *
2381 * Logged from:
2382 * packages/apps/Settings
2383 */
2384message SettingsUIChanged {
2385 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002386 * Where this SettingsUIChange event comes from. For example, if
2387 * it's a PAGE_VISIBLE event, where the page is opened from.
2388 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002389 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002390
2391 /**
2392 * What the UI action is.
2393 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002394 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002395
2396 /**
2397 * Where the action is happening
2398 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002399 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002400
2401 /**
2402 * What preference changed in this event.
2403 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002404 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002405
2406 /**
2407 * The new value of the changed preference.
2408 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002409 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002410}
2411
2412/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002413 * Logs basic timing information about touch events.
2414 * Reported at most every 5 minutes while device is being interacted with.
2415 *
2416 * Logged from:
2417 * frameworks/native/services/inputflinger
2418 */
2419message TouchEventReported {
2420 /**
2421 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2422 * and the standard deviation of latency between the kernel and framework
2423 * for touchscreen events. The units are microseconds.
2424 *
2425 * The number is measured as the difference between the time at which
2426 * the input event was received in the evdev driver,
2427 * and the time at which the input event was received in EventHub.
2428 */
2429 // Minimum value
2430 optional float latency_min_micros = 1;
2431 // Maximum value
2432 optional float latency_max_micros = 2;
2433 // Average value
2434 optional float latency_mean_micros = 3;
2435 // Standard deviation
2436 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002437 // Number of touch events (input_event) in this report
2438 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002439}
2440
2441/**
Philip Quinn0eded622019-01-29 12:46:28 -08002442 * Logs gesture classification and timing information for touch events.
2443 *
2444 * Logged from:
2445 * frameworks/base/core/java/android/view/GestureDetector.java
2446 * frameworks/base/core/java/android/view/View.java
2447 */
2448message TouchGestureClassified {
2449 // The source of the classification (e.g. Java class name).
2450 optional string source = 1;
2451
2452 enum Classification {
2453 UNKNOWN_CLASSIFICATION = 0;
2454 SINGLE_TAP = 1;
2455 DOUBLE_TAP = 2;
2456 LONG_PRESS = 3;
2457 DEEP_PRESS = 4;
2458 SCROLL = 5;
2459 }
2460 // The classification of the gesture.
2461 optional Classification classification = 2;
2462
2463 // The interval from the start of a touch event stream until the
2464 // classification was made.
2465 optional int32 latency_millis = 3;
2466
2467 // The distance from the location of the first touch event to the
2468 // location of the touch event when the classification was made.
2469 optional float displacement_px = 4;
2470}
2471
2472/**
David Chenc28b2bb2017-10-24 12:52:52 -07002473 * Logs that a setting was updated.
2474 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002475 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002476 * The tag and is_default allow resetting of settings to default values based on the specified
2477 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2478 */
2479message SettingChanged {
2480 // The name of the setting.
2481 optional string setting = 1;
2482
2483 // The change being imposed on this setting. May represent a number, eg "3".
2484 optional string value = 2;
2485
2486 // The new value of this setting. For most settings, this is same as value. For some settings,
2487 // value is +X or -X where X represents an element in a set. For example, if the previous value
2488 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2489 // The +/- feature is currently only used for location_providers_allowed.
2490 optional string new_value = 3;
2491
2492 // The previous value of this setting.
2493 optional string prev_value = 4;
2494
2495 // The tag used with the is_default for resetting sets of settings. This is generally null.
2496 optional string tag = 5;
2497
Bookatz90867622018-01-31 15:05:57 -08002498 // True if this setting with tag should be resettable.
2499 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002500
David Chenbd789912018-03-16 17:19:55 -07002501 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002502 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002503
2504 enum ChangeReason {
2505 UPDATED = 1; // Updated can be an insertion or an update.
2506 DELETED = 2;
2507 }
2508 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002509}
Chenjie Yub3dda412017-10-24 13:41:59 -07002510
Chenjie Yu05013b32017-11-21 10:21:41 -08002511/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002512 * Logs activity going to foreground or background
2513 *
2514 * Logged from:
2515 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2516 */
2517message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002518 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002519 optional string pkg_name = 2;
2520 optional string class_name = 3;
2521
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002522 enum State {
2523 BACKGROUND = 0;
2524 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002525 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002526 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002527}
David Chenc8a43242017-10-17 16:23:28 -07002528
2529/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002530 * Logs when a volume entered low Storage state.
2531 * Logged from:
2532 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2533 */
2534message LowStorageStateChanged {
2535 // Volume that ran out of storage.
2536 optional string volume_description = 1;
2537
2538 enum State {
2539 UNKNOWN = 0;
2540 OFF = 1;
2541 ON = 2;
2542 }
2543 optional State state = 2;
2544}
2545
2546/**
2547 * Logs when an app is downgraded.
2548 * Logged from:
2549 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2550 */
2551message AppDowngraded {
2552 optional string package_name = 1;
2553 // Size of the package (all data) before being downgraded.
2554 optional int64 size_in_bytes_before = 2;
2555 // Size of the package (all data) after being downgraded.
2556 optional int64 size_in_bytes_after = 3;
2557
2558 optional bool aggressive = 4;
2559}
2560
2561/**
2562 * Logs when an app is optimized after being downgraded.
2563 * Logged from:
2564 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2565 */
2566message AppOptimizedAfterDowngraded {
2567 optional string package_name = 1;
2568}
2569
2570/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002571 * Logs whenever an app is installed on external storage.
2572 * Logged from:
2573 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2574 */
2575message AppInstallOnExternalStorageReported {
2576 // The type of external storage.
2577 optional android.stats.storage.ExternalStorageType storage_type = 1;
2578 // The name of the package that is installed on the sd card.
2579 optional string package_name = 2;
2580}
2581
2582/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002583 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002584 * Logged from:
2585 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2586 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002587message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002588 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002589
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002590 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002591
2592 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002593 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002594 optional string process_name = 3;
2595
2596 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002597 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002598
2599 optional string package_name = 5;
2600
2601 enum InstantApp {
2602 UNAVAILABLE = 0;
2603 FALSE = 1;
2604 TRUE = 2;
2605 }
2606 optional InstantApp is_instant_app = 6;
2607
2608 enum ForegroundState {
2609 UNKNOWN = 0;
2610 BACKGROUND = 1;
2611 FOREGROUND = 2;
2612 }
2613 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002614
2615 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002616}
David Chen9e3808c2017-11-20 17:25:34 -08002617
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002618/**
2619 * Logs when a WTF (What a Terrible Failure) happened.
2620 * Logged from:
2621 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2622 */
2623message WTFOccurred {
2624 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002625
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002626 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002627
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002628 // The name of the process.
2629 // system_server if it is not by an app
2630 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002631
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002632 // The pid if available. -1 means not available.
2633 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002634
2635 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002636}
2637
2638/**
2639 * Logs when system server reports low memory.
2640 * Logged from:
2641 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2642 */
2643message LowMemReported {
2644}
2645
2646/**
2647 * Logs when an app ANR (App Not Responding) occurs.
2648 * Logged from:
2649 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2650 */
2651message ANROccurred {
2652 optional int32 uid = 1 [(is_uid) = true];
2653
2654 optional string process_name = 2;
2655
2656 optional string short_component_name = 3;
2657
2658 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002659
2660 enum InstantApp {
2661 UNAVAILABLE = 0;
2662 FALSE = 1;
2663 TRUE = 2;
2664 }
2665 optional InstantApp is_instant_app = 5;
2666
2667 enum ForegroundState {
2668 UNKNOWN = 0;
2669 BACKGROUND = 1;
2670 FOREGROUND = 2;
2671 }
2672 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002673
2674 optional android.server.ErrorSource error_source = 7;
2675
2676 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002677}
2678
Bookatza7020bd2018-08-28 16:29:35 -07002679/**
2680 * Logs when the vibrator state changes.
2681 * Logged from:
2682 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2683 */
2684message VibratorStateChanged {
2685 repeated AttributionNode attribution_node = 1;
2686
2687 enum State {
2688 OFF = 0;
2689 ON = 1;
2690 }
2691 optional State state = 2;
2692
2693 // Duration (in milliseconds) requested to keep the vibrator on.
2694 // Only applicable for State == ON.
2695 optional int64 duration_millis = 3;
2696}
2697
David Chen0a368b22017-12-06 16:28:16 -08002698/*
2699 * Allows other apps to push events into statsd.
2700 * Logged from:
2701 * frameworks/base/core/java/android/util/StatsLog.java
2702 */
David Chen0b5c90c2018-01-25 16:51:49 -08002703message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002704 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002705 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002706
2707 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2708 optional int32 label = 2;
2709
2710 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2711 // predicates for the metrics).
2712 enum State {
2713 UNKNOWN = 0;
2714 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2715 STOP = 2;
2716 START = 3;
2717 }
2718 optional State state = 3;
2719}
2720
David Chen9e3808c2017-11-20 17:25:34 -08002721/**
Bookatz7948c872018-09-04 12:58:33 -07002722 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2723 * For example, this could be due to the user manually changing the time.
2724 *
2725 * Logged from:
2726 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2727 */
2728message WallClockTimeShifted {
2729 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2730 optional int64 wall_clock_timestamp_millis = 1;
2731}
2732
2733/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002734 * Logs when statsd detects an anomaly.
2735 *
2736 * Logged from:
2737 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2738 */
2739message AnomalyDetected {
2740 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002741 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002742
Yangster-mac94e197c2018-01-02 16:03:03 -08002743 // Id of the config whose anomaly detection alert fired.
2744 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002745
Yangster-mac94e197c2018-01-02 16:03:03 -08002746 // Id of the alert (i.e. name of the anomaly that was detected).
2747 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002748}
2749
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002750message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002751 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002752 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002753
2754 // The app package name.
2755 optional string pkg_name = 2;
2756
2757 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002758 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002759 WARM = 1;
2760 HOT = 2;
2761 COLD = 3;
2762 }
2763 // The transition type.
2764 optional TransitionType type = 3;
2765
2766 // The activity name.
2767 optional string activity_name = 4;
2768
2769 // The name of the calling app. Empty if not set.
2770 optional string calling_pkg_name = 5;
2771
2772 // Whether the app is an instant app.
2773 optional bool is_instant_app = 6;
2774
2775 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002776 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002777
Bookatz80d11a02018-01-16 10:46:35 -08002778 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002779
David Chen0b5c90c2018-01-25 16:51:49 -08002780 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002781 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002782 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002783 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002784 optional int32 bind_application_delay_millis = 11;
2785 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002786
2787 // Empty if not set.
2788 optional string launch_token = 13;
2789
Calin Juravle759fbda2018-02-20 19:52:30 +00002790 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002791 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002792
2793 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002794 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002795}
2796
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002797message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002798 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002799 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002800
2801 // The app package name.
2802 optional string pkg_name = 2;
2803
2804 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002805 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002806 WARM = 1;
2807 HOT = 2;
2808 COLD = 3;
2809 }
2810 // The transition type.
2811 optional TransitionType type = 3;
2812
2813 // The activity name.
2814 optional string activity_name = 4;
2815}
2816
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002817message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002818 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002819 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002820
2821 // The app package name.
2822 optional string pkg_name = 2;
2823
2824 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002825 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002826 WITH_BUNDLE = 1;
2827 WITHOUT_BUNDLE = 2;
2828 }
2829 // The transition type.
2830 optional TransitionType type = 3;
2831
2832 // The activity name.
2833 optional string activity_name = 4;
2834
2835 optional bool transition_process_running = 5;
2836
2837 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002838 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002839}
2840
Bookatz8fcd09a2017-12-18 13:01:10 -08002841/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002842 * Logs a picture-in-picture action
2843 * Logged from:
2844 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2845 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2846 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2847 */
2848message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002849 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002850 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002851
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002852 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002853
Chenjie Yu52cacc62017-12-08 18:11:45 -08002854 enum State {
2855 ENTERED = 1;
2856 EXPANDED_TO_FULL_SCREEN = 2;
2857 MINIMIZED = 3;
2858 DISMISSED = 4;
2859 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002860 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002861}
2862
2863/**
Chenjie Yue8904192017-12-08 19:12:57 -08002864 * Logs overlay action
2865 * Logged from:
2866 * services/core/java/com/android/server/wm/Session.java
2867 */
2868message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002869 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002870
2871 optional string package_name = 2;
2872
2873 optional bool using_alert_window = 3;
2874
2875 enum State {
2876 ENTERED = 1;
2877 EXITED = 2;
2878 }
2879 optional State state = 4;
2880}
2881
Chenjie Yuccfe6452018-01-30 11:33:21 -08002882/*
2883 * Logs foreground service starts and stops.
2884 * Note that this is not when a service starts or stops, but when it is
2885 * considered foreground.
2886 * Logged from
2887 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2888 */
2889message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002890 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002891 // package_name + "/" + class_name
2892 optional string short_name = 2;
2893
2894 enum State {
2895 ENTER = 1;
2896 EXIT = 2;
2897 }
2898 optional State state = 3;
2899}
2900
Chenjie Yue8904192017-12-08 19:12:57 -08002901/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002902 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2903 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2904 * attributed back to the parent (host) uid. One example is Chrome.
2905 *
2906 * Logged from:
2907 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2908 */
2909message IsolatedUidChanged {
2910 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002911 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002912 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002913 optional int32 parent_uid = 1;
2914
2915 optional int32 isolated_uid = 2;
2916
2917 // We expect an isolated uid to be removed before if it's used for another parent uid.
2918 enum Event {
2919 REMOVED = 0;
2920 CREATED = 1;
2921 }
2922 optional Event event = 3;
2923}
2924
2925/*
2926 * Logs the reception of an incoming network packet causing the main system to wake up for
2927 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2928 * and processed by WakeupController.cpp.
2929 */
2930message PacketWakeupOccurred {
2931 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2932 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002933 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002934 // The interface name on which the packet was received.
2935 optional string iface = 2;
2936 // The ethertype value of the packet.
2937 optional int32 ethertype = 3;
2938 // String representation of the destination MAC address of the packet.
2939 optional string destination_hardware_address = 4;
2940 // String representation of the source address of the packet if this was an IP packet.
2941 optional string source_ip = 5;
2942 // String representation of the destination address of the packet if this was an IP packet.
2943 optional string destination_ip = 6;
2944 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2945 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2946 // families.
2947 optional int32 ip_next_header = 7;
2948 // The source port if this was a TCP or UDP packet.
2949 optional int32 source_port = 8;
2950 // The destination port if this was a TCP or UDP packet.
2951 optional int32 destination_port = 9;
2952}
2953
2954/*
2955 * Logs the memory stats for an app on startup.
2956 * Logged from:
2957 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2958 */
2959message AppStartMemoryStateCaptured {
2960 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002961 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002962
2963 // The process name.
2964 optional string process_name = 2;
2965
2966 // The activity name.
2967 optional string activity_name = 3;
2968
2969 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002970 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002971
2972 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002973 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002974
2975 // RSS
2976 optional int64 rss_in_bytes = 6;
2977
2978 // CACHE
2979 optional int64 cache_in_bytes = 7;
2980
2981 // SWAP
2982 optional int64 swap_in_bytes = 8;
2983}
2984
2985/*
2986 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2987 * for LMK event.
2988 * Logged from:
2989 * system/core/lmkd/lmkd.c
2990 */
2991message LmkStateChanged {
2992 enum State {
2993 UNKNOWN = 0;
2994 START = 1;
2995 STOP = 2;
2996 }
2997 optional State state = 1;
2998}
2999
3000/*
3001 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3002 * Logged from:
3003 * system/core/lmkd/lmkd.c
3004 */
3005message LmkKillOccurred {
3006 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003007 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003008
3009 // The process name.
3010 optional string process_name = 2;
3011
3012 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003013 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003014
3015 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003016 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003017
3018 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003019 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003020
3021 // RSS
3022 optional int64 rss_in_bytes = 6;
3023
3024 // CACHE
3025 optional int64 cache_in_bytes = 7;
3026
3027 // SWAP
3028 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003029
3030 // The elapsed real time of start of the process.
3031 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003032
3033 // Min oom adj score considered by lmkd.
3034 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003035}
3036
Rajeev Kumar51b54602018-03-01 12:18:26 -08003037/*
3038 * Logs when the ActivityManagerService detects that an app died.
3039 *
3040 * Logged from:
3041 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3042 */
3043message AppDied {
3044 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003045 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003046}
3047
Howard Ro21a039c2018-08-06 14:55:47 -07003048/**
3049 * An atom for generic metrics logging. Available from Android Q.
3050 */
3051message GenericAtom {
3052 // The uid of the application that sent this custom atom.
3053 optional int32 uid = 1 [(is_uid) = true];
3054
3055 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003056 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003057}
3058
Tej Singhd6d6d772018-09-05 17:41:25 -07003059/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003060 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003061 *
3062 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003063 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003064 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003065message BiometricAcquired {
3066 // Biometric modality that was acquired.
3067 optional android.hardware.biometrics.ModalityEnum modality = 1;
3068 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3069 optional int32 user = 2;
3070 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3071 optional bool is_crypto = 3;
3072 // Action that the device is performing. Acquired messages are only expected for enroll and
3073 // authenticate. Other actions may indicate an error.
3074 optional android.hardware.biometrics.ActionEnum action = 4;
3075 // The client that this acquisition was received for.
3076 optional android.hardware.biometrics.ClientEnum client = 5;
3077 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3078 optional int32 acquire_info = 6;
3079 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3080 optional int32 acquire_info_vendor = 7;
Tej Singhd6d6d772018-09-05 17:41:25 -07003081}
3082
3083/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003084 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003085 *
3086 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003087 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003088 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003089message BiometricAuthenticated {
3090 // Biometric modality that was used.
3091 optional android.hardware.biometrics.ModalityEnum modality = 1;
3092 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3093 optional int32 user = 2;
3094 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3095 // storage.
3096 optional bool is_crypto = 3;
3097 // The client that this acquisition was received for.
3098 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003099 // If authentication requires user confirmation. See BiometricPrompt's
3100 // setRequireConfirmation(bool) method.
3101 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003102
Kevin Chyn1741a072019-01-17 11:54:40 -08003103 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003104 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003105 REJECTED = 1;
3106 PENDING_CONFIRMATION = 2;
3107 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003108 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003109
3110 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003111 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003112 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3113 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3114 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3115 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003116 optional int64 latency_millis = 7;
Kevin Chyn1741a072019-01-17 11:54:40 -08003117}
3118
3119/**
3120 * Logs when a biometric error occurs.
3121 *
3122 * Logged from:
3123 * frameworks/base/services/core/java/com/android/server/biometrics
3124 */
3125message BiometricErrorOccurred {
3126 // Biometric modality that was used.
3127 optional android.hardware.biometrics.ModalityEnum modality = 1;
3128 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3129 optional int32 user = 2;
3130 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3131 optional bool is_crypto = 3;
3132 // Action that the device is performing.
3133 optional android.hardware.biometrics.ActionEnum action = 4;
3134 // The client that this acquisition was received for.
3135 optional android.hardware.biometrics.ClientEnum client = 5;
3136 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3137 // are unique to modality.
3138 optional int32 error_info = 6;
3139 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3140 // by the vendor and not specified by the HIDL interface.
3141 optional int32 error_info_vendor = 7;
3142}
3143
3144/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003145 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003146 * Logged from:
3147 * frameworks/base/services/core/java/com/android/server/biometrics
3148 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003149message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003150 // Biometric modality.
3151 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003152 // Type of issue detected.
3153 optional android.hardware.biometrics.IssueEnum issue = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07003154}
Howard Ro688ae182018-09-25 00:09:36 -07003155
3156message Notification {
3157
3158 // Type of notification event.
3159 enum Type {
3160 TYPE_UNKNOWN = 0;
3161 // Notification became visible to the user.
3162 TYPE_OPEN = 1;
3163 // Notification became hidden.
3164 TYPE_CLOSE = 2;
3165 // Notification switched to detail mode.
3166 TYPE_DETAIL = 3;
3167 // Notification was clicked.
3168 TYPE_ACTION = 4;
3169 // Notification was dismissed.
3170 TYPE_DISMISS = 5;
3171 // Notification switched to summary mode. The enum value of 14 is to
3172 // match that of metrics_constants.
3173 TYPE_COLLAPSE = 14;
3174 }
3175 optional Type type = 1;
3176
3177 // Package name associated with the notification.
3178 optional string package_name = 2;
3179
3180 // Tag associated with notification.
3181 optional string tag = 3;
3182
3183 // Application-supplied ID associated with the notification.
3184 optional int32 id = 4;
3185
3186 // Index of notification in the notification panel.
3187 optional int32 shade_index = 5;
3188
3189 // The number of notifications in the notification panel.
3190 optional int32 shade_count = 6;
3191
3192 // Importance for the notification.
3193 optional int32 importance = 7;
3194
3195 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07003196 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07003197
3198 // Importance for the notification channel.
3199 optional int32 channel_importance = 9;
3200
Howard Ro183c2bd2018-10-18 13:52:10 -07003201 // Application-supplied ID associated with the notifications group.
3202 optional string group_id = 10;
3203
Howard Ro688ae182018-09-25 00:09:36 -07003204 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07003205 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07003206
Howard Ro183c2bd2018-10-18 13:52:10 -07003207 // Reason for dismissal of a notification. This field is only meaningful for
3208 // TYPE_DISMISS events.
3209 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07003210
Howard Ro183c2bd2018-10-18 13:52:10 -07003211 // The first post time of notification, stable across updates.
3212 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07003213
Howard Ro183c2bd2018-10-18 13:52:10 -07003214 // The most recent interruption time, or the creation time if no updates.
3215 // Differs from update_millis because updates are filtered based on whether
3216 // they actually interrupted the user.
3217 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07003218
Howard Ro183c2bd2018-10-18 13:52:10 -07003219 // The most recent update time, or the creation time if no updates.
3220 optional int64 update_millis = 15;
3221
3222 // The most recent visibility event.
3223 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07003224}
3225
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003226/*
Tej Singh0d176952019-01-16 19:10:54 -08003227 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003228 */
Tej Singh0d176952019-01-16 19:10:54 -08003229message FlagFlipUpdateOccurred {
3230 // If the event is from a flag config package, specify the package name.
3231 optional string flag_flip_package_name = 1;
3232
3233 // The order id of the package
3234 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003235}
3236
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003237/**
3238 * Potential experiment ids that goes with a train install.
3239 */
3240message TrainExperimentIds {
3241 repeated int64 experiment_id = 1;
3242}
3243
Yangster-macb89807e2018-11-15 21:10:57 -08003244/*
3245 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003246 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003247 */
3248message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003249 // Name of the train.
3250 optional string train_name = 1;
3251 // Version code for a "train" of packages that need to be installed atomically
3252 optional int64 train_version_code = 2;
3253 // After installation of this package, device requires a restart.
3254 optional bool requires_staging = 3;
3255 // Rollback should be enabled for this install.
3256 optional bool rollback_enabled = 4;
3257 // Requires low latency monitoring if possible.
3258 optional bool requires_low_latency_monitor = 5;
3259
Yangster-macb89807e2018-11-15 21:10:57 -08003260 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003261 UNKNOWN = 0;
3262 INSTALL_REQUESTED = 1;
3263 INSTALL_STARTED = 2;
3264 INSTALL_STAGED_NOT_READY = 3;
3265 INSTALL_STAGED_READY = 4;
3266 INSTALL_SUCCESS = 5;
3267 INSTALL_FAILURE = 6;
3268 INSTALL_CANCELLED = 7;
3269 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003270 INSTALLER_ROLLBACK_INITIATED = 9;
3271 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3272 INSTALLER_ROLLBACK_STAGED = 11;
3273 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3274 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3275 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3276 INSTALLER_ROLLBACK_SUCCESS = 15;
3277 INSTALLER_ROLLBACK_FAILURE = 16;
3278 INSTALLER_ROLLBACK_CANCEL_STAGED_REMOVE_FROM_QUEUE = 17;
3279 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_INITIATED = 18;
3280 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_SUCCESS = 19;
3281 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_FAILURE = 20;
Yangster-macb89807e2018-11-15 21:10:57 -08003282 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003283 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003284 // Possible experiment ids for monitoring this push.
3285 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3286 // user id
3287 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003288}
3289
Maggie Whitefc1aa592018-11-28 21:55:23 -08003290/** Represents USB port overheat event. */
3291message UsbPortOverheatEvent {
3292 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3293 optional int32 plug_temperature_deci_c = 1;
3294
3295 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3296 optional int32 max_temperature_deci_c = 2;
3297
3298 /* Time between USB plug event and overheat threshold trip, in seconds. */
3299 optional int32 time_to_overheat_secs = 3;
3300
3301 /* Time between overheat threshold trip and hysteresis, in seconds. */
3302 optional int32 time_to_hysteresis_secs = 4;
3303
3304 /* Time between hysteresis and active mitigation ending, in seconds. */
3305 optional int32 time_to_inactive_secs = 5;
3306};
3307
Maggie White8735b852019-01-18 11:40:49 -08003308/**
3309 * Logs total effective full charge and discharge cycles on a battery.
3310 * Here are some examples of one effective cycle:
3311 * 1) the battery charges from 0% to 100% and drains back to 0%,
3312 * 2) charging from 50% to 100% and draining back to 50% twice.
3313 * Pulled from:
3314 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3315 */
3316message BatteryCycleCount {
3317 /* Number of total charge and discharge cycles on the system battery. */
3318 optional int32 cycle_count = 1;
3319}
3320
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003321/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003322 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3323 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003324 * Pulled from:
3325 * StatsCompanionService
3326 */
3327
Carmen Agimof12dec122019-03-06 16:14:38 +00003328message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003329
Carmen Agimof12dec122019-03-06 16:14:38 +00003330 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003331 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003332 PUBLIC = 1;
3333 PRIVATE = 2;
3334 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003335 }
3336
Carmen Agimof12dec122019-03-06 16:14:38 +00003337 // The type of external storage.
3338 optional android.stats.storage.ExternalStorageType storage_type = 1;
3339 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3340 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003341 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003342 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003343}
3344
Yangster-macb89807e2018-11-15 21:10:57 -08003345/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003346 * Logs when a connection becomes available and lost.
3347 * Logged in StatsCompanionService.java
3348 */
3349message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003350 // Id of the network.
3351 optional int32 net_id = 1;
3352
3353 enum State {
3354 UNKNOWN = 0;
3355 CONNECTED = 1;
3356 DISCONNECTED = 2;
3357 }
3358 // Connected state of a network.
3359 optional State state = 2;
3360}
3361
3362/**
3363 * Logs when a service starts and stops.
3364 * Logged from:
3365 * services/core/java/com/android/server/am/ActiveServices.java
3366 */
3367message ServiceStateChanged {
3368
3369 optional int32 uid = 1 [(is_uid) = true];
3370
3371 optional string package_name = 2;
3372
3373 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003374
3375 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003376 START = 1;
3377 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003378 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003379
3380 optional State state = 4;
3381}
3382
3383/**
3384 * Logs when a service is launched.
3385 * Logged from:
3386 * services/core/java/com/android/server/am/ActiveServices.java
3387 */
3388message ServiceLaunchReported {
3389
3390 optional int32 uid = 1 [(is_uid) = true];
3391
3392 optional string package_name = 2;
3393
3394 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003395}
Howard Ro688ae182018-09-25 00:09:36 -07003396
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003397/**
3398 * Logs when a hidden API is used.
3399 *
3400 * Logged from:
3401 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3402 */
3403message HiddenApiUsed {
3404 // The uid of the app making the hidden access.
3405 optional int32 uid = 1 [(is_uid) = true];
3406
3407 // Signature of the method or field accessed.
3408 optional string signature = 2;
3409
3410 enum AccessMethod {
3411 NONE = 0;
3412 REFLECTION = 1;
3413 JNI = 2;
3414 LINKING = 3;
3415 }
3416
3417 // Type of access.
3418 optional AccessMethod access_method = 3;
3419
3420 // Whether the access was prevented or not.
3421 optional bool access_denied = 4;
3422}
3423
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003424/**
3425 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3426 * - When user sees privacy chip
3427 * - When user clicks privacy chip
3428 * - How does the user exit the Privacy Dialog
3429 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003430 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3431 */
3432message PrivacyIndicatorsInteracted {
3433
3434 enum Type {
3435 UNKNOWN = 0;
3436 CHIP_VIEWED = 1;
3437 CHIP_CLICKED = 2;
3438 DIALOG_PRIVACY_SETTINGS = 3;
3439 DIALOG_DISMISS = 4;
3440 DIALOG_LINE_ITEM = 5;
3441 }
3442
3443 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3444
3445 // Used if the type is LINE_ITEM
3446 optional string package_name = 2;
3447}
3448
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003449/**
3450 * Logs information about a package that is moved from the internal to external storage and vice
3451 * versa.
3452 * It logs the package name, the type of the external storage where the package is installed
3453 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3454 * and the move type: if it's from internal to external or the other way around.
3455 *
3456 * Logged from:
3457 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3458 */
3459message AppMovedStorageReported {
3460 enum MoveType {
3461 UNKNOWN = 0;
3462 TO_EXTERNAL = 1;
3463 TO_INTERNAL = 2;
3464 }
3465 // The type of the external storage.
3466 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3467 // The type of move.
3468 optional MoveType move_type = 2;
3469 // The name of the package that was moved.
3470 optional string package_name = 3;
3471}
3472
Chenjie Yubbcbc602018-02-05 16:51:52 -08003473//////////////////////////////////////////////////////////////////////
3474// Pulled atoms below this line //
3475//////////////////////////////////////////////////////////////////////
3476
3477/**
David Chenc8a43242017-10-17 16:23:28 -07003478 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3479 *
3480 * Pulled from:
3481 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3482 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003483message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003484 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003485
3486 optional int64 rx_bytes = 2;
3487
3488 optional int64 rx_packets = 3;
3489
3490 optional int64 tx_bytes = 4;
3491
3492 optional int64 tx_packets = 5;
3493}
3494
3495/**
3496 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3497 *
3498 * Pulled from:
3499 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3500 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003501message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003502 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003503
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003504 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3505 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003506
3507 optional int64 rx_bytes = 3;
3508
3509 optional int64 rx_packets = 4;
3510
3511 optional int64 tx_bytes = 5;
3512
3513 optional int64 tx_packets = 6;
3514}
3515
3516/**
3517 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3518 *
3519 * Pulled from:
3520 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3521 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003522message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003523 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003524
3525 optional int64 rx_bytes = 2;
3526
3527 optional int64 rx_packets = 3;
3528
3529 optional int64 tx_bytes = 4;
3530
3531 optional int64 tx_packets = 5;
3532}
3533
3534/**
3535 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3536 *
3537 * Pulled from:
3538 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3539 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003540message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003541 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003542
Yao Chenc40a19d2018-03-15 16:48:25 -07003543 // 1 denotes foreground and 0 denotes background. This is called Set in
3544 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003545 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003546
3547 optional int64 rx_bytes = 3;
3548
3549 optional int64 rx_packets = 4;
3550
3551 optional int64 tx_bytes = 5;
3552
3553 optional int64 tx_packets = 6;
3554}
3555
3556/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003557 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3558 *
3559 * Pulled from:
3560 * StatsCompanionService
3561 */
3562message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003563 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003564
3565 optional int64 rx_bytes = 2;
3566
3567 optional int64 tx_bytes = 3;
3568}
3569
3570/**
David Chenc8a43242017-10-17 16:23:28 -07003571 * Pulls the kernel wakelock durations. This atom is adapted from
3572 * android/internal/os/KernelWakelockStats.java
3573 *
3574 * Pulled from:
3575 * StatsCompanionService using KernelWakelockReader.
3576 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003577message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003578 optional string name = 1;
3579
3580 optional int32 count = 2;
3581
3582 optional int32 version = 3;
3583
Yangster-maca8a30442018-10-13 23:46:34 -07003584 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003585}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003586
Chenjie Yu05013b32017-11-21 10:21:41 -08003587/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003588 * Pulls low power state information. If power.stats HAL is not available, this
3589 * includes platform and subsystem sleep state information,
3590 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3591 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003592 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003593 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003594 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3595 * as defined in:
3596 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003597 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003598message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003599 // Subsystem name
3600 optional string subsystem_name = 1;
3601 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3602 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003603 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3604 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003605 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003606 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003607 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003608 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003609 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003610}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003611
Chenjie Yu05013b32017-11-21 10:21:41 -08003612/**
Bookatz92da2832018-11-01 18:10:03 -07003613 * Pulls on-device power measurement information.
3614 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3615 * Pulled from:
3616 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3617 */
3618message OnDevicePowerMeasurement {
3619 // Name of the subsystem (to which the rail belongs).
3620 optional string subsystem_name = 1;
3621
3622 // Rail name. The rail lies within the subsystem.
3623 optional string rail_name = 2;
3624
3625 // Time (in ms since boot) at which the rail energy value was measured.
3626 // This may differ slightly from the time that statsd logs this information.
3627 optional uint64 measurement_timestamp_millis = 3;
3628
3629 // Accumulated energy used via the rail since device boot in uWs.
3630 optional uint64 energy_microwatt_secs = 4;
3631}
3632
3633/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003634 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003635 * Pulls the time the cpu spend on the frequency index. Frequency index
3636 * starts from highest to lowest. The value should be monotonically
3637 * increasing since boot. However, if there is a cpu
3638 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003639 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003640message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003641 optional uint32 cluster = 1;
3642 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003643 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003644}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003645
Chenjie Yu05013b32017-11-21 10:21:41 -08003646/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003647 * Pulls Cpu Time Per Uid.
3648 * Note that isolated process uid time should be attributed to host uids.
3649 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003650message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003651 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003652 optional uint64 user_time_micros = 2;
3653 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003654}
3655
3656/**
3657 * Pulls Cpu Time Per Uid per frequency.
3658 * Note that isolated process uid time should be attributed to host uids.
3659 * For each uid, we order the time by descending frequencies.
3660 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003661message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003662 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003663 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003664 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003665}
Hugo Benichi884970e2017-11-14 22:42:46 +09003666
Chenjie Yu05013b32017-11-21 10:21:41 -08003667/**
3668 * Pulls Wifi Controller Activity Energy Info
3669 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003670message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003671 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003672 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003673 // stack reported state
3674 // TODO: replace this with proto enum
3675 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003676 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003677 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003678 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003679 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003680 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003681 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003682 // product of current(mA), voltage(V) and time(ms)
3683 optional uint64 controller_energy_used = 6;
3684}
3685
3686/**
3687 * Pulls Modem Activity Energy Info
3688 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003689message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003690 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003691 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003692 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003693 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003694 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003695 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003696 /**
3697 * Tx power index
3698 * index 0 = tx_power < 0dBm
3699 * index 1 = 0dBm < tx_power < 5dBm
3700 * index 2 = 5dBm < tx_power < 15dBm
3701 * index 3 = 15dBm < tx_power < 20dBm
3702 * index 4 = tx_power > 20dBm
3703 */
3704 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003705 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003706 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003707 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003708 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003709 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003710 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003711 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003712 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003713 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003714 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003715 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003716 // product of current(mA), voltage(V) and time(ms)
3717 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003718}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003719
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003720/**
3721 * Pulls Bluetooth Activity Energy Info
3722 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3723 */
3724message BluetoothActivityInfo {
3725 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003726 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003727 // bluetooth stack state
3728 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003729 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003730 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003731 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003732 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003733 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003734 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003735 // product of current(mA), voltage(V) and time(ms)
3736 optional uint64 energy_used = 6;
3737}
3738
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003739/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003740 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003741 *
3742 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003743 */
3744message ProcessMemoryState {
3745 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003746 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003747
3748 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003749 // Usually package name, "system" for system server.
3750 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003751 optional string process_name = 2;
3752
Rafal Slawikda51b932018-12-13 16:31:33 +00003753 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003754 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003755
3756 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003757 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003758
3759 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003760 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003761
Rajeev Kumar90235992018-01-29 11:06:48 -08003762 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003763 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3764 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003765 optional int64 rss_in_bytes = 6;
3766
3767 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003768 // Value is read from memory.stat, field total_cache if per-app memory
3769 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003770 optional int64 cache_in_bytes = 7;
3771
3772 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003773 // Value is read from memory.stat, field total_swap if per-app memory
3774 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003775 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003776
Rafal Slawikd03ae422018-11-20 11:27:45 +00003777 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003778 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003779
3780 // Elapsed real time when the process started.
3781 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3782 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003783}
3784
3785/*
Rafal Slawik08621582018-10-15 14:53:07 +01003786 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003787 *
3788 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003789 */
3790message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003791 // The uid if available. -1 means not available.
3792 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003793
Rafal Slawikbf67d072018-10-23 11:07:54 +01003794 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003795 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003796 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003797
Rafal Slawikbf67d072018-10-23 11:07:54 +01003798 // # of page-faults
3799 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003800
Rafal Slawikbf67d072018-10-23 11:07:54 +01003801 // # of major page-faults
3802 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003803
Rafal Slawikbf67d072018-10-23 11:07:54 +01003804 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003805 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003806 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003807
Rafal Slawikd03ae422018-11-20 11:27:45 +00003808 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003809 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003810
3811 // Elapsed real time when the process started.
3812 // Value is read from /proc/PID/stat, field 22.
3813 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01003814}
3815
3816/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003817 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003818 *
3819 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3820 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003821 *
3822 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003823 */
3824message ProcessMemoryHighWaterMark {
3825 // The uid if available. -1 means not available.
3826 optional int32 uid = 1 [(is_uid) = true];
3827
Rafal Slawikda51b932018-12-13 16:31:33 +00003828 // The process name.
3829 // Usually package name or process cmdline.
3830 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003831 optional string process_name = 2;
3832
3833 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3834 // /proc/PID/status.
3835 optional int64 rss_high_water_mark_in_bytes = 3;
3836}
3837
3838/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003839 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003840 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003841message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003842 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003843}
3844
3845/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003846 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003847 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003848message SystemUptime {
3849 // Milliseconds since the system was booted.
3850 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3851 // for external input).
3852 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003853 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003854}
3855
3856/*
3857 * Reads from /proc/uid_concurrent_active_time which has the format:
3858 * active: X (X is # cores)
3859 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3860 * [uid1]: [time-0] [time-1] [time-2] ... ...
3861 * ...
3862 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3863 * The file contains a monotonically increasing count of time for a single boot.
3864 */
3865message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003866 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003867 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003868}
3869
3870/**
3871 * Reads from /proc/uid_concurrent_policy_time which has the format:
3872 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3873 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3874 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3875 * ...
3876 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3877 * The file contains a monotonically increasing count of time for a single boot.
3878 */
3879message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003880 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003881 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003882 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003883}
3884
3885/*
3886 * Pulls free disk space, for data, system partition and temporary directory.
3887 */
3888message DiskSpace {
3889 // available bytes in data partition
3890 optional uint64 data_available_bytes = 1;
3891 // available bytes in system partition
3892 optional uint64 system_available_bytes = 2;
3893 // available bytes in download cache or temp directories
3894 optional uint64 temp_available_bytes = 3;
3895}
Tej Singhbf972d92018-01-10 20:51:13 -08003896
3897/**
3898 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003899 *
3900 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003901 */
3902message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003903 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003904}
3905
3906/**
3907 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003908 * Pulled from:
3909 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003910 */
3911message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003912 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003913}
3914
3915/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003916 * Pulls battery voltage.
3917 * Pulled from:
3918 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3919 */
3920message BatteryVoltage {
3921 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003922 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003923}
3924
3925/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003926 * Pulls battery level (percent full, from 0 to 100).
3927 *
3928 * Pulled from:
3929 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3930 */
3931message BatteryLevel {
3932 // Battery level. Should be in [0, 100].
3933 optional int32 battery_level = 1;
3934}
3935
3936/**
Tej Singhd89137e2018-03-26 14:51:40 -07003937 * Pulls the temperature of various parts of the device.
3938 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003939 *
3940 * Pulled from:
3941 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3942 */
3943message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003944 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003945 optional android.os.TemperatureTypeEnum sensor_location = 1;
3946
3947 // The name of the temperature source. Eg. CPU0
3948 optional string sensor_name = 2;
3949
Tej Singhd89137e2018-03-26 14:51:40 -07003950 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003951 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003952 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003953}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003954
3955/**
3956 * Pulls the statistics of calls to Binder.
3957 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003958 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3959 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003960 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003961 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003962 */
3963message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003964 // UID of the process responsible for the binder transaction. It will be set if the process
3965 // executing the binder transaction attribute the transaction to another uid using
3966 // Binder.setThreadWorkSource().
3967 //
3968 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003969 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003970 // UID of the process executing the binder transaction.
3971 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003972 // Fully qualified class name of the API call.
3973 //
3974 // This is a system server class name.
3975 //
3976 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3977 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3978 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3979 // commonly used APIs.
3980 optional string service_class_name = 2;
3981 // Method name of the API call. It can also be a transaction code if we cannot
3982 // resolve it to a name. See Binder#getTransactionName.
3983 //
3984 // This is a system server method name.
3985 optional string service_method_name = 3;
3986 // Total number of API calls.
3987 optional int64 call_count = 4;
3988 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3989 optional bool screen_interactive = 13;
3990 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3991 // call_count will be equal to recorded_call_count.
3992 //
3993 // If recorded_call_count is different than call_count, it means data collection has been
3994 // sampled. All the fields below will be sampled in this case.
3995 optional int64 recorded_call_count = 12;
3996 // Number of exceptions thrown by the API.
3997 optional int64 recorded_exception_count = 5;
3998 // Total latency of all API calls.
3999 // Average can be computed using total_latency_micros / recorded_call_count.
4000 optional int64 recorded_total_latency_micros = 6;
4001 // Maximum latency of one API call.
4002 optional int64 recorded_max_latency_micros = 7;
4003 // Total CPU usage of all API calls.
4004 // Average can be computed using total_cpu_micros / recorded_call_count.
4005 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4006 optional int64 recorded_total_cpu_micros = 8;
4007 // Maximum CPU usage of one API call.
4008 optional int64 recorded_max_cpu_micros = 9;
4009 // Maximum parcel reply size of one API call.
4010 optional int64 recorded_max_reply_size_bytes = 10;
4011 // Maximum parcel request size of one API call.
4012 optional int64 recorded_max_request_size_bytes = 11;
4013}
4014
4015/**
4016 * Pulls the statistics of exceptions during calls to Binder.
4017 *
4018 * Binder stats are cumulative from boot unless somebody reset the data using
4019 * > adb shell dumpsys binder_calls_stats --reset
4020 */
4021message BinderCallsExceptions {
4022 // Exception class name, e.g. java.lang.IllegalArgumentException.
4023 //
4024 // This is an exception class name thrown by the system server.
4025 optional string exception_class_name = 1;
4026 // Total number of exceptions.
4027 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004028}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004029
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004030/**
4031 * Pulls the statistics of message dispatching on HandlerThreads.
4032 *
4033 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4034 * config on the device.
4035 *
4036 * Next tag: 11
4037 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004038message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004039 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004040 optional int32 uid = 1 [(is_uid) = true];
4041
4042 // Fully qualified class name of the handler target class.
4043 //
4044 // This field does not contain PII. This is a system server class name.
4045 optional string handler_class_name = 2;
4046
4047 // The name of the thread that runs the Looper.
4048 //
4049 // This field does not contain PII. This is a system server thread name.
4050 optional string looper_thread_name = 3;
4051
4052 // The name of the dispatched message.
4053 //
4054 // This field does not contain PII. This is a system server constant or class
4055 // name.
4056 optional string message_name = 4;
4057
4058 // Total number of successfully dispatched messages.
4059 optional int64 message_count = 5;
4060
4061 // Total number of messages that failed dispatching.
4062 optional int64 exception_count = 6;
4063
4064 // Total number of processed messages we have data recorded for. If we
4065 // collected data for all the messages, message_count will be equal to
4066 // recorded_message_count.
4067 //
4068 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004069 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004070 optional int64 recorded_message_count = 7;
4071
4072 // Total latency of all processed messages.
4073 // Average can be computed using recorded_total_latency_micros /
4074 // recorded_message_count.
4075 optional int64 recorded_total_latency_micros = 8;
4076
4077 // Total CPU usage of all processed message.
4078 // Average can be computed using recorded_total_cpu_micros /
4079 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004080 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004081 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004082
4083 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4084 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004085
4086 // Max recorded CPU usage of all processed messages.
4087 optional int64 recorded_max_cpu_micros = 11;
4088
4089 // Max recorded latency of all processed messages.
4090 optional int64 recorded_max_latency_micros = 12;
4091
4092 // Total number of messages we tracked the dispatching delay for. If we
4093 // collected data for all the messages, message_count will be equal to
4094 // recorded_delay_message_count.
4095 //
4096 // If recorded_delay_message_count is different than message_count, it means data
4097 // collection has been sampled or/and not all messages specified the target dispatch time.
4098 // The fields below will be sampled in this case.
4099 optional int64 recorded_delay_message_count = 13;
4100
4101 // Total dispatching delay of all processed messages.
4102 // Calculated as a difference between the target dispatching time (Message.when)
4103 // and the actual dispatching time.
4104 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4105 optional int64 recorded_total_delay_millis = 14;
4106
4107 // Max dispatching delay of all processed messages.
4108 // Calculated as a difference between the target dispatching time (Message.when)
4109 // and the actual dispatching time.
4110 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004111}
Tej Singh86dc9db2018-09-06 00:39:57 +00004112
4113/**
4114 * Pulls disk information, such as write speed and latency.
4115 */
4116message DiskStats {
4117 // Time taken to open, write 512B to, and close a file.
4118 // -1 if error performing the check.
4119 optional int64 data_write_latency_millis = 1;
4120
4121 optional bool file_based_encryption = 2;
4122
4123 // Recent disk write speed in kB/s.
4124 // -1 if error querying storageed.
4125 // 0 if data is unavailable.
4126 optional int32 recent_disk_write_speed = 3;
4127}
4128
4129
4130/**
4131 * Free and total bytes of the Data, Cache, and System partition.
4132 */
4133message DirectoryUsage {
4134 enum Directory {
4135 UNKNOWN = 0;
4136 DATA = 1;
4137 CACHE = 2;
4138 SYSTEM = 3;
4139 }
4140 optional Directory directory = 1;
4141 optional int64 free_bytes = 2;
4142 optional int64 total_bytes = 3;
4143}
4144
4145
4146/**
4147 * Size of an application: apk size, data size, and cache size.
4148 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4149 * Information is only reported for apps with the primary user (user 0).
4150 * Sizes are aggregated by package name.
4151 */
4152message AppSize {
4153 // Including uids will involve modifying diskstats logic.
4154 optional string package_name = 1;
4155 // App size in bytes. -1 if unavailable.
4156 optional int64 app_size_bytes = 2;
4157 // App data size in bytes. -1 if unavailable.
4158 optional int64 app_data_size_bytes = 3;
4159 // App cache size in bytes. -1 if unavailable.
4160 optional int64 app_cache_size_bytes = 4;
4161 // Time that the cache file was produced.
4162 // Uses System.currentTimeMillis(), which is wall clock time.
4163 optional int64 cache_time_millis = 5;
4164}
4165
4166
4167/**
4168 * Size of a particular category. Eg: photos, videos.
4169 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4170 */
4171message CategorySize {
4172 enum Category {
4173 UNKNOWN = 0;
4174 APP_SIZE = 1;
4175 APP_DATA_SIZE = 2;
4176 APP_CACHE_SIZE = 3;
4177 PHOTOS = 4;
4178 VIDEOS = 5;
4179 AUDIO = 6;
4180 DOWNLOADS = 7;
4181 SYSTEM = 8;
4182 OTHER = 9;
4183 }
4184 optional Category category = 1;
4185 // Category size in bytes.
4186 optional int64 size_bytes = 2;
4187 // Time that the cache file was produced.
4188 // Uses System.currentTimeMillis(), which is wall clock time.
4189 optional int64 cache_time_millis = 3;
4190}
Tej Singhd6d6d772018-09-05 17:41:25 -07004191
4192/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004193 * Pulls per uid I/O stats. The stats are cumulative since boot.
4194 *
4195 * Read/write bytes are I/O events from a storage device
4196 * Read/write chars are data requested by read/write syscalls, and can be
4197 * satisfied by caching.
4198 *
4199 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4200 */
4201message DiskIo {
4202 optional int32 uid = 1 [(is_uid) = true];
4203 optional int64 fg_chars_read = 2;
4204 optional int64 fg_chars_write = 3;
4205 optional int64 fg_bytes_read = 4;
4206 optional int64 fg_bytes_write = 5;
4207 optional int64 bg_chars_read = 6;
4208 optional int64 bg_chars_write = 7;
4209 optional int64 bg_bytes_read = 8;
4210 optional int64 bg_bytes_write = 9;
4211 optional int64 fg_fsync = 10;
4212 optional int64 bg_fsync= 11;
4213}
4214
4215
4216/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004217 * Pulls the number of fingerprints for each user.
4218 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004219 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004220 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004221message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004222 // The associated user. Eg: 0 for owners, 10+ for others.
4223 // Defined in android/os/UserHandle.java
4224 optional int32 user = 1;
4225 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004226 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004227}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004228
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004229/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004230 * Pulls the number of faces for each user.
4231 *
4232 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4233 */
4234message NumFacesEnrolled {
4235 // The associated user. Eg: 0 for owners, 10+ for others.
4236 // Defined in android/os/UserHandle.java
4237 optional int32 user = 1;
4238 // Number of faces registered to that user.
4239 optional int32 num_faces_enrolled = 2;
4240}
4241/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004242 * A mapping of role holder -> role
4243 */
4244message RoleHolder {
4245 // uid of the role holder
4246 optional int32 uid = 1 [(is_uid) = true];
4247
4248 // package name of the role holder
4249 optional string package_name = 2;
4250
4251 // the role held
4252 optional string role = 3;
4253}
4254
Yangsteraf9aee72018-10-12 09:26:16 -07004255message AggStats {
4256 optional int64 min = 1;
4257
4258 optional int64 average = 2;
4259
4260 optional int64 max = 3;
4261}
4262
4263message ProcessStatsStateProto {
4264 optional android.service.procstats.ScreenState screen_state = 1;
4265
4266 optional android.service.procstats.MemoryState memory_state = 2;
4267
4268 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4269 // and not frameworks/base/core/java/android/app/ActivityManager.java
4270 optional android.service.procstats.ProcessState process_state = 3;
4271
4272 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004273 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004274
4275 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004276 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004277
4278 // # of samples taken
4279 optional int32 sample_size = 5;
4280
4281 // PSS is memory reserved for this process
4282 optional AggStats pss = 6;
4283
4284 // USS is memory shared between processes, divided evenly for accounting
4285 optional AggStats uss = 7;
4286
4287 // RSS is memory resident for this process
4288 optional AggStats rss = 8;
4289}
4290
4291// Next Tag: 7
4292message ProcessStatsProto {
4293 // Name of process.
4294 optional string process = 1;
4295
4296 // Uid of the process.
4297 optional int32 uid = 2;
4298
4299 // Information about how often kills occurred
4300 message Kill {
4301 // Count of excessive CPU kills
4302 optional int32 cpu = 1;
4303
4304 // Count of kills when cached
4305 optional int32 cached = 2;
4306
4307 // PSS stats during cached kill
4308 optional AggStats cached_pss = 3;
4309 }
4310 optional Kill kill = 3;
4311
4312 // Time and memory spent in various states.
4313 repeated ProcessStatsStateProto states = 5;
4314
4315 // Total time process has been running... screen_state, memory_state, and process_state
4316 // will not be set.
4317 optional ProcessStatsStateProto total_running_state = 6;
4318}
4319
4320message PackageServiceOperationStatsProto {
4321 // Operate enum: Started, Foreground, Bound, Executing
4322 optional android.service.procstats.ServiceOperationState operation = 1;
4323
4324 // Number of times the service was in this operation.
4325 optional int32 count = 2;
4326
4327 // Information about a state the service can be in.
4328 message StateStats {
4329 // Screen state enum.
4330 optional android.service.procstats.ScreenState screen_state = 1;
4331 // Memory state enum.
4332 optional android.service.procstats.MemoryState memory_state = 2;
4333
4334 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004335 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004336 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004337 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004338 }
4339 repeated StateStats state_stats = 3;
4340}
4341
4342message PackageServiceStatsProto {
4343 // Name of service component.
4344 optional string service_name = 1;
4345
4346 // The operation stats.
4347 // The package_name, package_uid, package_version, service_name will not be set to save space.
4348 repeated PackageServiceOperationStatsProto operation_stats = 2;
4349}
4350
4351message PackageAssociationSourceProcessStatsProto {
4352 // Uid of the process.
4353 optional int32 process_uid = 1;
4354 // Process name.
4355 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004356 // Package name.
4357 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004358 // Total count of the times this association appeared.
4359 optional int32 total_count = 3;
4360
4361 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004362 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004363
4364 // Total count of the times this association became actively impacting its target process.
4365 optional int32 active_count = 5;
4366
4367 // Information on one source in this association.
4368 message StateStats {
4369 // Process state enum.
4370 optional android.service.procstats.ProcessState process_state = 1;
4371 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004372 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004373 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004374 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004375 }
4376 repeated StateStats active_state_stats = 6;
4377}
4378
4379message PackageAssociationProcessStatsProto {
4380 // Name of the target component.
4381 optional string component_name = 1;
4382 // Information on one source in this association.
4383 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4384}
4385
4386
4387message ProcessStatsPackageProto {
4388 // Name of package.
4389 optional string package = 1;
4390
4391 // Uid of the package.
4392 optional int32 uid = 2;
4393
4394 // Version of the package.
4395 optional int64 version = 3;
4396
4397 // Stats for each process running with the package loaded in to it.
4398 repeated ProcessStatsProto process_stats = 4;
4399
4400 // Stats for each of the package's services.
4401 repeated PackageServiceStatsProto service_stats = 5;
4402
4403 // Stats for each association with the package.
4404 repeated PackageAssociationProcessStatsProto association_stats = 6;
4405}
4406
4407message ProcessStatsSectionProto {
4408 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004409 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004410
4411 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004412 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004413
4414 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004415 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004416
4417 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004418 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004419
4420 // System runtime library. e.g. "libdvm.so", "libart.so".
4421 optional string runtime = 5;
4422
4423 // whether kernel reports swapped pss.
4424 optional bool has_swapped_pss = 6;
4425
4426 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4427 enum Status {
4428 STATUS_UNKNOWN = 0;
4429 STATUS_COMPLETE = 1;
4430 STATUS_PARTIAL = 2;
4431 STATUS_SHUTDOWN = 3;
4432 STATUS_SYSPROPS = 4;
4433 }
4434 repeated Status status = 7;
4435
Chenjie Yub2ecc792019-01-17 10:27:26 -08004436 // Number of pages available of various types and sizes, representation fragmentation.
4437 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4438
Yangsteraf9aee72018-10-12 09:26:16 -07004439 // Stats for each process.
4440 repeated ProcessStatsProto process_stats = 8;
4441
4442 // Stats for each package.
4443 repeated ProcessStatsPackageProto package_stats = 9;
4444}
4445
Chenjie Yub2ecc792019-01-17 10:27:26 -08004446message ProcessStatsAvailablePagesProto {
4447 // Node these pages are in (as per /proc/pagetypeinfo)
4448 optional int32 node = 1;
4449
4450 // Zone these pages are in (as per /proc/pagetypeinfo)
4451 optional string zone = 2;
4452
4453 // Label for the type of these pages (as per /proc/pagetypeinfo)
4454 optional string label = 3;
4455
4456 // Distribution of number of pages available by order size. First entry in array is
4457 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4458 repeated int32 pages_per_order = 4;
4459}
4460
Chenjie Yu12e5e672018-09-14 15:54:59 -07004461/**
4462 * Pulled from ProcessStatsService.java
4463 */
4464message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004465 optional ProcessStatsSectionProto proc_stats_section = 1;
4466}
4467
Chenjie Yuf910b7802019-01-11 16:08:20 -08004468/**
4469 * Pulled from ProcessStatsService.java
4470 */
4471message ProcStatsPkgProc {
4472 optional ProcessStatsSectionProto proc_stats_section = 1;
4473}
4474
Yangsteraf9aee72018-10-12 09:26:16 -07004475message PowerProfileProto {
4476 optional double cpu_suspend = 1;
4477
4478 optional double cpu_idle = 2;
4479
4480 optional double cpu_active = 3;
4481
4482 message CpuCluster {
4483 optional int32 id = 1;
4484 optional double cluster_power = 2;
4485 optional int32 cores = 3;
4486 repeated int64 speed = 4;
4487 repeated double core_power = 5;
4488 }
4489
4490 repeated CpuCluster cpu_cluster = 40;
4491
4492 optional double wifi_scan = 4;
4493
4494 optional double wifi_on = 5;
4495
4496 optional double wifi_active = 6;
4497
4498 optional double wifi_controller_idle = 7;
4499
4500 optional double wifi_controller_rx = 8;
4501
4502 optional double wifi_controller_tx = 9;
4503
4504 repeated double wifi_controller_tx_levels = 10;
4505
4506 optional double wifi_controller_operating_voltage = 11;
4507
4508 optional double bluetooth_controller_idle = 12;
4509
4510 optional double bluetooth_controller_rx = 13;
4511
4512 optional double bluetooth_controller_tx = 14;
4513
4514 optional double bluetooth_controller_operating_voltage = 15;
4515
4516 optional double modem_controller_sleep = 16;
4517
4518 optional double modem_controller_idle = 17;
4519
4520 optional double modem_controller_rx = 18;
4521
4522 repeated double modem_controller_tx = 19;
4523
4524 optional double modem_controller_operating_voltage = 20;
4525
4526 optional double gps_on = 21;
4527
4528 repeated double gps_signal_quality_based = 22;
4529
4530 optional double gps_operating_voltage = 23;
4531
4532 optional double bluetooth_on = 24;
4533
4534 optional double bluetooth_active = 25;
4535
4536 optional double bluetooth_at_cmd = 26;
4537
4538 optional double ambient_display = 27;
4539
4540 optional double screen_on = 28;
4541
4542 optional double radio_on = 29;
4543
4544 optional double radio_scanning = 30;
4545
4546 optional double radio_active = 31;
4547
4548 optional double screen_full = 32;
4549
4550 optional double audio = 33;
4551
4552 optional double video = 34;
4553
4554 optional double flashlight = 35;
4555
4556 optional double memory = 36;
4557
4558 optional double camera = 37;
4559
4560 optional double wifi_batched_scan = 38;
4561
4562 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004563}
Chenjie Yuab530202018-09-26 12:39:20 -07004564
4565/**
4566 * power_profile.xml and other constants for power model calculations.
4567 * Pulled from PowerProfile.java
4568 */
4569message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004570 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004571}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004572
4573/**
arangelovd5db50e2018-10-12 20:24:39 +01004574 * Logs when a user restriction was added or removed.
4575 *
4576 * Logged from:
4577 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4578 */
4579message UserRestrictionChanged {
4580 // The raw string of the user restriction as defined in UserManager.
4581 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4582 optional string restriction = 1;
4583 // Whether the restriction is enabled or disabled.
4584 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004585}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004586
4587/**
4588 * Pulls process user time and system time. Puller takes a snapshot of all pids
4589 * in the system and returns cpu stats for those that are working at the time.
4590 * Dead pids will be dropped. Kernel processes are excluded.
4591 * Min cool-down is 5 sec.
4592 */
4593message ProcessCpuTime {
4594 optional int32 uid = 1 [(is_uid) = true];
4595
4596 optional string process_name = 2;
4597 // Process cpu time in user space, cumulative from boot/process start
4598 optional int64 user_time_millis = 3;
4599 // Process cpu time in system space, cumulative from boot/process start
4600 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004601}
Misha Wagner5a51e002018-10-03 15:04:09 +01004602
4603/**
4604 * Pulls the CPU usage for each thread.
4605 *
4606 * Read from /proc/$PID/task/$TID/time_in_state files.
4607 *
4608 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4609 * time_in_state files not being present on some phones, have not been addressed. These should be
4610 * considered before a public release.
4611 */
4612message CpuTimePerThreadFreq {
4613 // UID that owns the process.
4614 optional int32 uid = 1 [(is_uid) = true];
4615 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004616 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004617 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004618 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004619 // Name of the process taken from `/proc/$PID/cmdline`.
4620 optional string process_name = 4;
4621 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4622 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004623
4624 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4625 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4626 // frequencies are given here as the alternative is sending eight separate atoms. This method
4627 // significantly reduces the amount of data created
4628 optional int32 frequency1_khz = 6;
4629 optional int32 time1_millis = 7;
4630 optional int32 frequency2_khz = 8;
4631 optional int32 time2_millis = 9;
4632 optional int32 frequency3_khz = 10;
4633 optional int32 time3_millis = 11;
4634 optional int32 frequency4_khz = 12;
4635 optional int32 time4_millis = 13;
4636 optional int32 frequency5_khz = 14;
4637 optional int32 time5_millis = 15;
4638 optional int32 frequency6_khz = 16;
4639 optional int32 time6_millis = 17;
4640 optional int32 frequency7_khz = 18;
4641 optional int32 time7_millis = 19;
4642 optional int32 frequency8_khz = 20;
4643 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004644}
Bookatz75ee6042018-11-09 12:27:37 -08004645
4646/**
Bookatz366a4432018-11-20 09:42:33 -08004647 * Pulls information about the device's build.
4648 */
4649message BuildInformation {
4650 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4651 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4652 optional string fingerprint = 1;
4653
4654 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4655 optional string brand = 2;
4656
4657 // Build.PRODUCT. The name of the overall product.
4658 optional string product = 3;
4659
4660 // Build.DEVICE. The name of the industrial design.
4661 optional string device = 4;
4662
4663 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4664 optional string version_release = 5;
4665
4666 // Build.ID. E.g. a label like "M4-rc20".
4667 optional string id = 6;
4668
4669 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4670 // represent this build.
4671 optional string version_incremental = 7;
4672
4673 // Build.TYPE. The type of build, like "user" or "eng".
4674 optional string type = 8;
4675
4676 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4677 optional string tags = 9;
4678}
4679
4680/**
Bookatz75ee6042018-11-09 12:27:37 -08004681 * Pulls on-device BatteryStats power use calculations for the overall device.
4682 */
4683message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004684 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4685 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4686 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4687 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08004688}
4689
4690/**
4691 * Pulls on-device BatteryStats power use calculations broken down by uid.
4692 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4693 * that is attributed to non-uid items. They must all be included to get the total power use.
4694 */
4695message DeviceCalculatedPowerBlameUid {
4696 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4697 optional int32 uid = 1 [(is_uid) = true];
4698
Bookatz3dbc13a2018-12-21 12:16:51 -08004699 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4700 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4701 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08004702}
4703
4704/**
4705 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4706 * drain type.
4707 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4708 * is attributed uids. They must all be included to get the total power use.
4709 */
4710message DeviceCalculatedPowerBlameOther {
4711 // The type of item whose power use is being reported.
4712 enum DrainType {
4713 AMBIENT_DISPLAY = 0;
4714 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4715 BLUETOOTH = 2;
4716 CAMERA = 3;
4717 // Cell-standby
4718 CELL = 4;
4719 FLASHLIGHT = 5;
4720 IDLE = 6;
4721 MEMORY = 7;
4722 // Amount that total computed drain exceeded the drain estimated using the
4723 // battery level changes and capacity.
4724 OVERCOUNTED = 8;
4725 PHONE = 9;
4726 SCREEN = 10;
4727 // Amount that total computed drain was below the drain estimated using the
4728 // battery level changes and capacity.
4729 UNACCOUNTED = 11;
4730 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4731 WIFI = 13;
4732 }
4733 optional DrainType drain_type = 1;
4734
Bookatz3dbc13a2018-12-21 12:16:51 -08004735 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4736 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4737 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004738}
arangelov4e994062018-11-13 16:12:38 +00004739
4740/**
4741 * Logs device policy features.
4742 *
4743 * Logged from:
4744 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4745 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4746 */
4747message DevicePolicyEvent {
4748 // The event id - unique for each event.
4749 optional android.stats.devicepolicy.EventId event_id = 1;
4750 // The admin package name.
4751 optional string admin_package_name = 2;
4752 // A generic integer parameter.
4753 optional int32 integer_value = 3;
4754 // A generic boolean parameter.
4755 optional bool boolean_value = 4;
4756 // A parameter specifying a time period in milliseconds.
4757 optional uint64 time_period_millis = 5;
4758 // A parameter specifying a list of package names, bundle extras or string parameters.
4759 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4760}
shawnlinea5b66b2018-11-13 15:05:29 +08004761
4762/**
4763 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4764 *
4765 * Logged from:
4766 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4767 */
4768message DocsUILaunchReported {
4769 optional android.stats.docsui.LaunchAction launch_action = 1;
4770 optional bool has_initial_uri = 2;
4771 optional android.stats.docsui.MimeType mime_type = 3;
4772 optional android.stats.docsui.Root initial_root = 4;
4773}
4774
4775/**
4776 * Logs root/app visited event in file managers/picker. Call this when the user
4777 * taps on root/app in hamburger menu.
4778 *
4779 * Logged from:
4780 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4781 */
4782message DocsUIRootVisitedReported {
4783 optional android.stats.docsui.ContextScope scope = 1;
4784 optional android.stats.docsui.Root root = 2;
4785}
4786
4787/**
4788 * Logs file operation stats. Call this when a file operation has completed.
4789 *
4790 * Logged from:
4791 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4792 */
4793message DocsUIFileOperationReported {
4794 optional android.stats.docsui.Provider provider = 1;
4795 optional android.stats.docsui.FileOperation file_op = 2;
4796}
4797
4798/**
4799 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4800 * mode.
4801 *
4802 * Logged from:
4803 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4804 */
4805message DocsUIFileOperationCopyMoveModeReported {
4806 optional android.stats.docsui.FileOperation file_op = 1;
4807 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4808}
4809
4810
4811/**
4812 * Logs file sub operation stats. Call this when a file operation has failed.
4813 *
4814 * Logged from:
4815 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4816 */
4817message DocsUIFileOperationFailureReported {
4818 optional android.stats.docsui.Authority authority = 1;
4819 optional android.stats.docsui.SubFileOperation sub_op = 2;
4820}
4821
4822/**
4823* Logs the cancellation of a file operation. Call this when a job is canceled
4824*
4825* Logged from:
4826* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4827*/
4828message DocsUIFileOperationCanceledReported {
4829 optional android.stats.docsui.FileOperation file_op = 1;
4830}
4831
4832/**
4833 * Logs startup time in milliseconds.
4834 *
4835 * Logged from:
4836 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4837 */
4838message DocsUIStartupMsReported {
4839 optional int32 startup_millis = 1;
4840}
4841
4842/**
4843 * Logs the action that was started by user.
4844 *
4845 * Logged from:
4846 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4847 */
4848message DocsUIUserActionReported {
4849 optional android.stats.docsui.UserAction action = 1;
4850}
4851
4852/**
4853 * Logs the invalid type when invalid scoped access is requested.
4854 *
4855 * Logged from:
4856 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4857 */
4858message DocsUIInvalidScopedAccessRequestReported {
4859 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004860}
Ben Murdochbab399f2018-12-06 11:01:38 +00004861
4862/**
shawnlina75e82d2019-01-07 10:31:12 +08004863 * Logs the package name that launches docsui picker mode.
4864 *
4865 * Logged from:
4866 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4867 */
4868message DocsUIPickerLaunchedFromReported {
4869 optional string package_name = 1;
4870}
4871
4872/**
4873 * Logs the search type.
4874 *
4875 * Logged from:
4876 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4877 */
4878message DocsUISearchTypeReported {
4879 optional android.stats.docsui.SearchType search_type = 1;
4880}
4881
4882/**
4883 * Logs the search mode.
4884 *
4885 * Logged from:
4886 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4887 */
4888message DocsUISearchModeReported {
4889 optional android.stats.docsui.SearchMode search_mode = 1;
4890}
4891
4892/**
4893 * Logs the pick result information.
4894 *
4895 * Logged from:
4896 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4897 */
4898message DocsUIPickResultReported {
4899 optional int32 total_action_count = 1;
4900 optional int64 duration_millis = 2;
4901 optional int32 file_count= 3;
4902 optional bool is_searching = 4;
4903 optional android.stats.docsui.Root picked_from = 5;
4904 optional android.stats.docsui.MimeType mime_type = 6;
4905 optional int32 repeatedly_pick_times = 7;
4906}
4907
4908/**
Ben Murdochbab399f2018-12-06 11:01:38 +00004909 * Logs when an app's memory is compacted.
4910 *
4911 * Logged from:
4912 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4913 */
4914message AppCompacted {
4915 // The pid of the process being compacted.
4916 optional int32 pid = 1;
4917
4918 // The name of the process being compacted.
4919 optional string process_name = 2;
4920
4921 // The type of compaction.
4922 enum Action {
4923 UNKNOWN = 0;
4924 SOME = 1;
4925 FULL = 2;
4926 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004927 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00004928
4929 // Total RSS in kilobytes consumed by the process prior to compaction.
4930 optional int64 before_rss_total_kilobytes = 4;
4931
4932 // File RSS in kilobytes consumed by the process prior to compaction.
4933 optional int64 before_rss_file_kilobytes = 5;
4934
4935 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4936 optional int64 before_rss_anon_kilobytes = 6;
4937
4938 // Swap in kilobytes consumed by the process prior to compaction.
4939 optional int64 before_swap_kilobytes = 7;
4940
4941 // Total RSS in kilobytes consumed by the process after compaction.
4942 optional int64 after_rss_total_kilobytes = 8;
4943
4944 // File RSS in kilobytes consumed by the process after compaction.
4945 optional int64 after_rss_file_kilobytes = 9;
4946
4947 // Anonymous RSS in kilobytes consumed by the process after compaction.
4948 optional int64 after_rss_anon_kilobytes = 10;
4949
4950 // Swap in kilobytes consumed by the process after compaction.
4951 optional int64 after_swap_kilobytes = 11;
4952
4953 // The time taken to perform compaction in milliseconds.
4954 optional int64 time_to_compact_millis = 12;
4955
4956 // The last compaction action performed for this app.
4957 optional Action last_action = 13;
4958
Ben Murdoch01720b82018-12-19 18:03:44 +00004959 // The last time that compaction was attempted on this process in milliseconds
4960 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4961 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00004962
Ben Murdoch885c21b2019-03-15 18:02:04 +00004963 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00004964 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00004965
4966 // The process state at the time of compaction.
4967 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00004968
4969 // Free ZRAM in kilobytes before compaction.
4970 optional int64 before_zram_free_kilobytes = 17;
4971
4972 // Free ZRAM in kilobytes after compaction.
4973 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00004974}
lifr157fc552018-12-12 16:38:04 +08004975
4976/**
4977 * Logs the latency period(in microseconds) and the return code of
4978 * the DNS(Domain Name System) lookups.
4979 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4980 * to get info(address or hostname) from DNS server(or DNS cache).
4981 * Logged from:
4982 * /system/netd/server/DnsProxyListener.cpp
4983 */
4984message NetworkDnsEventReported {
4985 // The types of the DNS lookups, as defined in
4986 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4987 enum EventType {
4988 EVENT_UNKNOWN = 0;
4989 EVENT_GETADDRINFO = 1;
4990 EVENT_GETHOSTBYNAME = 2;
4991 EVENT_GETHOSTBYADDR = 3;
4992 EVENT_RES_NSEND = 4;
4993 }
4994 optional EventType event_type = 1;
4995
4996 // The return value of the DNS resolver for each DNS lookups.
4997 //bionic/libc/include/netdb.h
4998 //system/netd/resolv/include/netd_resolv/resolv.h
4999 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08005000 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08005001 EAI_ADDRFAMILY = 1;
5002 EAI_AGAIN = 2;
5003 EAI_BADFLAGS = 3;
5004 EAI_FAIL = 4;
5005 EAI_FAMILY = 5;
5006 EAI_MEMORY = 6;
5007 EAI_NODATA = 7;
5008 EAI_NONAME = 8;
5009 EAI_SERVICE = 9;
5010 EAI_SOCKTYPE = 10;
5011 EAI_SYSTEM = 11;
5012 EAI_BADHINTS = 12;
5013 EAI_PROTOCOL = 13;
5014 EAI_OVERFLOW = 14;
5015 RESOLV_TIMEOUT = 255;
5016 EAI_MAX = 256;
5017 }
5018 optional ReturnCode return_code = 2;
5019
5020 // The latency period(in microseconds) it took for this DNS lookup to complete.
5021 optional int32 latency_micros = 3;
5022}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005023
5024/**
5025 * Logs when a data stall event occurs.
5026 *
5027 * Log from:
5028 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5029 */
5030message DataStallEvent {
5031 // Data stall evaluation type.
5032 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5033 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5034 optional int32 evaluation_type = 1;
5035 // See definition in data_stall_event.proto.
5036 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5037 // See definition in data_stall_event.proto.
5038 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5039 // See definition in data_stall_event.proto.
5040 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5041 // See definition in data_stall_event.proto.
5042 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5043 // See definition in data_stall_event.proto.
5044 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5045}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005046
5047/*
5048 * Logs when RescueParty resets some set of experiment flags.
5049 *
5050 * Logged from:
5051 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5052 */
5053message RescuePartyResetReported {
5054 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5055 optional int32 rescue_level = 1;
5056}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005057
5058/**
5059 * Logs when signed config is received from an APK, and if that config was applied successfully.
5060 * Logged from:
5061 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5062 */
5063message SignedConfigReported {
5064 enum Type {
5065 UNKNOWN_TYPE = 0;
5066 GLOBAL_SETTINGS = 1;
5067 }
5068 optional Type type = 1;
5069
5070 // The final status of the signed config received.
5071 enum Status {
5072 UNKNOWN_STATUS = 0;
5073 APPLIED = 1;
5074 BASE64_FAILURE_CONFIG = 2;
5075 BASE64_FAILURE_SIGNATURE = 3;
5076 SECURITY_EXCEPTION = 4;
5077 INVALID_CONFIG = 5;
5078 OLD_CONFIG = 6;
5079 SIGNATURE_CHECK_FAILED = 7;
5080 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005081 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005082 }
5083 optional Status status = 2;
5084
5085 // The version of the signed config processed.
5086 optional int32 version = 3;
5087
5088 // The package name that the config was extracted from.
5089 optional string from_package = 4;
5090
5091 enum Key {
5092 NO_KEY = 0;
5093 DEBUG = 1;
5094 PRODUCTION = 2;
5095 }
5096 // Which key was used to verify the config.
5097 optional Key verified_with = 5;
5098}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005099
5100/*
5101 * Logs GNSS Network-Initiated (NI) location events.
5102 *
5103 * Logged from:
5104 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5105 */
5106message GnssNiEventReported {
5107 // The type of GnssNiEvent.
5108 enum EventType {
5109 UNKNOWN = 0;
5110 NI_REQUEST = 1;
5111 NI_RESPONSE = 2;
5112 }
5113 optional EventType event_type = 1;
5114
5115 // An ID generated by HAL to associate NI notifications and UI responses.
5116 optional int32 notification_id = 2;
5117
5118 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005119 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005120
5121 // NI requires notification.
5122 optional bool need_notify = 4;
5123
5124 // NI requires verification.
5125 optional bool need_verify = 5;
5126
5127 // NI requires privacy override, no notification/minimal trace.
5128 optional bool privacy_override = 6;
5129
5130 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5131 // seconds.
5132 optional int32 timeout = 7;
5133
5134 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005135 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005136
5137 // String representing the requester of the network inititated location request.
5138 optional string requestor_id = 9;
5139
5140 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5141 // network initiated location request.
5142 optional string text = 10;
5143
5144 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005145 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005146
5147 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005148 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005149
5150 // True if SUPL ES is enabled.
5151 optional bool is_supl_es_enabled = 13;
5152
5153 // True if GNSS location is enabled.
5154 optional bool is_location_enabled = 14;
5155
5156 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005157 optional android.server.location.GnssUserResponseType user_response = 15;
5158}
5159
5160/**
5161 * Logs GNSS non-framework (NFW) location notification.
5162 *
5163 * Logged from:
5164 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5165 */
5166message GnssNfwNotificationReported {
5167 // Package name of the Android proxy application representing the non-framework entity that
5168 // requested location. Set to empty string if unknown.
5169 optional string proxy_app_package_name = 1;
5170
5171 // Protocol stack that initiated the non-framework location request.
5172 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5173
5174 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5175 // set to empty string. This field is opaque to the framework and used for logging purposes.
5176 optional string other_protocol_stack_name = 3;
5177
5178 // Source initiating/receiving the location information.
5179 optional android.server.location.NfwRequestor requestor = 4;
5180
5181 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5182 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5183 // and used for logging purposes.
5184 optional string requestor_id = 5;
5185
5186 // Indicates whether location information was provided for this request.
5187 optional android.server.location.NfwResponseType response_type = 6;
5188
5189 // True if the device is in user initiated emergency session.
5190 optional bool in_emergency_mode = 7;
5191
5192 // True if cached location is provided.
5193 optional bool is_cached_location = 8;
5194
5195 // True if proxy app permission mismatch between framework and GNSS HAL.
5196 optional bool is_permission_mismatched = 9;
5197}
5198
5199/**
5200 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5201 *
5202 * Logged from:
5203 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5204 */
5205message GnssConfigurationReported {
5206 // SUPL host name.
5207 optional string supl_host = 1;
5208
5209 // SUPL port number.
5210 optional int32 supl_port = 2;
5211
5212 // C2K host name.
5213 optional string c2k_host = 3;
5214
5215 // C2K port number.
5216 optional int32 c2k_port = 4;
5217
5218 // The SUPL version requested by Carrier.
5219 optional int32 supl_ver = 5;
5220
5221 // The SUPL mode.
5222 optional android.server.location.SuplMode supl_mode = 6;
5223
5224 // True if NI emergency SUPL restrictions is enabled.
5225 optional bool supl_es = 7;
5226
5227 // LTE Positioning Profile settings
5228 optional android.server.location.LppProfile lpp_profile = 8;
5229
5230 // Positioning protocol on A-Glonass system.
5231 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5232
5233 // True if emergency PDN is used. Otherwise, regular PDN is used.
5234 optional bool use_emergency_pdn_for_emergency_supl= 10;
5235
5236 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5237 optional android.server.location.GpsLock gps_lock = 11;
5238
5239 // Number of seconds to extend the emergency session duration post emergency call.
5240 optional int32 es_extension_sec = 12;
5241
5242 // The full list of package names of proxy Android applications representing the non-framework
5243 // location access entities (on/off the device) for which the framework user has granted
5244 // non-framework location access permission. The package names are concatenated in one string
5245 // with spaces as separators.
5246 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005247}
Jack Yu95b64f32018-12-13 18:26:11 +08005248
5249/**
5250 * Logs when a NFC device's error occurred.
5251 * Logged from:
5252 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5253 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5254 */
5255message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005256 enum Type {
5257 UNKNOWN = 0;
5258 CMD_TIMEOUT = 1;
5259 ERROR_NOTIFICATION = 2;
5260 AID_OVERFLOW = 3;
5261 }
5262 optional Type type = 1;
5263 // If it's nci cmd timeout, log the timeout command.
5264 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005265
Alex Salod7c3eef2019-01-25 14:43:27 -08005266 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005267}
5268
5269/**
5270 * Logs when a NFC device's state changed event
5271 * Logged from:
5272 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5273 */
5274message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005275 enum State {
5276 UNKNOWN = 0;
5277 OFF = 1;
5278 ON = 2;
5279 ON_LOCKED = 3; // Secure Nfc enabled.
5280 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5281 }
5282 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005283}
5284
5285/**
5286 * Logs when a NFC Beam Transaction occurred.
5287 * Logged from:
5288 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5289 */
5290message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005291 enum Operation {
5292 UNKNOWN = 0;
5293 SEND = 1;
5294 RECEIVE = 2;
5295 }
5296 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005297}
5298
5299/**
5300 * Logs when a NFC Card Emulation Transaction occurred.
5301 * Logged from:
5302 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5303 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5304 */
5305message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005306 enum Category {
5307 UNKNOWN = 0;
5308 HCE_PAYMENT = 1;
5309 HCE_OTHER = 2;
5310 OFFHOST = 3;
5311 }
5312 // Transaction belongs to HCE payment or HCE other category, or offhost.
5313 optional Category category = 1;
5314 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5315 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005316}
5317
5318/**
5319 * Logs when a NFC Tag event occurred.
5320 * Logged from:
5321 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5322 */
5323message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005324 enum Type {
5325 UNKNOWN = 0;
5326 URL = 1;
5327 BT_PAIRING = 2;
5328 PROVISION = 3;
5329 WIFI_CONNECT = 4;
5330 APP_LAUNCH = 5;
5331 OTHERS = 6;
5332 }
5333 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005334}
5335
5336/**
5337 * Logs when Hce transaction triggered
5338 * Logged from:
5339 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5340 */
5341message NfcHceTransactionOccurred {
5342 // The latency period(in microseconds) it took for the first HCE data
5343 // exchange.
5344 optional uint32 latency_micros = 1;
5345}
5346
5347/**
5348 * Logs when SecureElement state event changed
5349 * Logged from:
5350 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5351 */
5352message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005353 enum State {
5354 UNKNOWN = 0;
5355 INITIALIZED = 1;
5356 DISCONNECTED = 2;
5357 CONNECTED = 3;
5358 HALCRASH = 4;
5359 }
5360 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005361
Alex Salod7c3eef2019-01-25 14:43:27 -08005362 optional string state_change_reason = 2;
5363 // SIMx or eSEx.
5364 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005365}
5366
5367/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005368 * Information about a permission grant request
5369 */
5370message PermissionGrantRequestResultReported {
5371 // unique value identifying an API call. A API call might result in multiple of these atoms
5372 optional int64 request_id = 1;
5373
5374 // UID of package requesting the permission grant
5375 optional int32 requesting_uid = 2 [(is_uid) = true];
5376
5377 // Name of package requesting the permission grant
5378 optional string requesting_package_name = 3;
5379
5380 // The permission to be granted
5381 optional string permission_name = 4;
5382
5383 // If the permission was explicitly requested via the API or added by the system
5384 optional bool is_implicit = 5;
5385
5386 enum Result {
5387 UNDEFINED = 0;
5388 // permission request was ignored
5389 IGNORED = 1;
5390 // permission request was ignored because it was user fixed
5391 IGNORED_USER_FIXED = 2;
5392 // permission request was ignored because it was policy fixed
5393 IGNORED_POLICY_FIXED = 3;
5394 // permission was granted by user action
5395 USER_GRANTED = 4;
5396 // permission was automatically granted
5397 AUTO_GRANTED = 5;
5398 // permission was denied by user action
5399 USER_DENIED = 6;
5400 // permission was denied with prejudice by the user
5401 USER_DENIED_WITH_PREJUDICE = 7;
5402 // permission was automatically denied
5403 AUTO_DENIED = 8;
5404 }
5405 // The result of the permission grant
5406 optional Result result = 6;
5407}
5408
5409/**
Jack Yu95b64f32018-12-13 18:26:11 +08005410 * Logs when Omapi API used
5411 * Logged from:
5412 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5413 */
5414message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005415 enum Operation {
5416 UNKNOWN = 0;
5417 OPEN_CHANNEL = 1;
5418 }
5419 optional Operation operation = 1;
5420 // SIMx or eSEx.
5421 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005422
Alex Salod7c3eef2019-01-25 14:43:27 -08005423 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005424}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005425
5426/**
Alex Saloa060aee2019-01-21 14:36:41 -08005427 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5428 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005429 * Logged from:
5430 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5431 */
5432message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005433 optional int64 dispatch_latency_millis = 1;
5434}
5435
5436/**
5437 * Logs AttentionManagerService attention check result.
5438 *
5439 * Logged from:
5440 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5441 */
5442message AttentionManagerServiceResultReported {
5443 // See core/java/android/service/attention/AttentionService.java
5444 enum AttentionCheckResult {
5445 UNKNOWN = 20;
5446 ATTENTION_SUCCESS_ABSENT = 0;
5447 ATTENTION_SUCCESS_PRESENT = 1;
5448 ATTENTION_FAILURE_PREEMPTED = 2;
5449 ATTENTION_FAILURE_TIMED_OUT = 3;
5450 ATTENTION_FAILURE_UNKNOWN = 4;
5451 }
5452 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005453}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005454
5455/**
5456 * Logs when an adb connection changes state.
5457 *
5458 * Logged from:
5459 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5460 */
5461message AdbConnectionChanged {
5462 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5463 // previously selected for this system.
5464 optional int64 last_connection_time_millis = 1;
5465
5466 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5467 // to reconnect via adb without user interaction.
5468 optional int64 auth_window_millis = 2;
5469
5470 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5471 optional android.debug.AdbConnectionStateEnum state = 3;
5472
5473 // True if the 'always allow' option was selected for this system.
5474 optional bool always_allow = 4;
5475}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005476
5477/*
5478 * Logs the reported speech DSP status.
5479 *
5480 * Logged from:
5481 * Vendor audio implementation.
5482 */
5483message SpeechDspStatReported {
5484 // The total Speech DSP uptime in milliseconds.
5485 optional int32 total_uptime_millis = 1;
5486 // The total Speech DSP downtime in milliseconds.
5487 optional int32 total_downtime_millis = 2;
5488 optional int32 total_crash_count = 3;
5489 optional int32 total_recover_count = 4;
5490}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005491
5492/**
5493 * Logs USB connector contaminant status.
5494 *
5495 * Logged from: USB Service.
5496 */
5497message UsbContaminantReported {
5498 optional string id = 1;
5499 optional android.service.usb.ContaminantPresenceStatus status = 2;
5500}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005501
5502/**
5503 * This atom is for debugging purpose.
5504 */
5505message DebugElapsedClock {
5506 // Monotically increasing value for each pull.
5507 optional int64 pull_count = 1;
5508 // Time from System.elapsedRealtime.
5509 optional int64 elapsed_clock_millis = 2;
5510 // Time from System.elapsedRealtime.
5511 optional int64 same_elapsed_clock_millis = 3;
5512 // Diff between current elapsed time and elapsed time from previous pull.
5513 optional int64 elapsed_clock_diff_millis = 4;
5514
5515 enum Type {
5516 TYPE_UNKNOWN = 0;
5517 ALWAYS_PRESENT = 1;
5518 PRESENT_ON_ODD_PULLS = 2;
5519 }
5520 // Type of behavior for the pulled data.
5521 optional Type type = 5;
5522}
5523
5524/**
5525 * This atom is for debugging purpose.
5526 */
5527message DebugFailingElapsedClock {
5528 // Monotically increasing value for each pull.
5529 optional int64 pull_count = 1;
5530 // Time from System.elapsedRealtime.
5531 optional int64 elapsed_clock_millis = 2;
5532 // Time from System.elapsedRealtime.
5533 optional int64 same_elapsed_clock_millis = 3;
5534 // Diff between current elapsed time and elapsed time from previous pull.
5535 optional int64 elapsed_clock_diff_millis = 4;
5536}
Steven Wuacef6bb2019-01-23 14:21:17 -05005537
5538/** Logs System UI bubbles event changed.
5539 *
5540 * Logged from:
5541 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5542 */
5543message BubbleUIChanged {
5544
5545 // The app package that is posting the bubble.
5546 optional string package_name = 1;
5547
5548 // The notification channel that is posting the bubble.
5549 optional string notification_channel = 2;
5550
5551 // The notification id associated with the posted bubble.
5552 optional int32 notification_id = 3;
5553
5554 // The position of the bubble within the bubble stack.
5555 optional int32 position = 4;
5556
5557 // The total number of bubbles within the bubble stack.
5558 optional int32 total_number = 5;
5559
5560 // User interactions with the bubble.
5561 enum Action {
5562 UNKNOWN = 0;
5563 POSTED = 1;
5564 UPDATED = 2;
5565 EXPANDED = 3;
5566 COLLAPSED = 4;
5567 DISMISSED = 5;
5568 STACK_DISMISSED = 6;
5569 STACK_MOVED = 7;
5570 HEADER_GO_TO_APP = 8;
5571 HEADER_GO_TO_SETTINGS = 9;
5572 PERMISSION_OPT_IN = 10;
5573 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005574 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005575 SWIPE_LEFT = 13;
5576 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005577 STACK_EXPANDED = 15;
Steven Wuacef6bb2019-01-23 14:21:17 -05005578 }
5579 optional Action action = 6;
5580
5581 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5582 optional float normalized_x_position = 7;
5583 optional float normalized_y_position = 8;
5584}
Kweku Adams8845d012018-12-11 20:06:45 -08005585
5586/**
Steven Wu552f63f2019-02-05 13:41:36 -05005587 * Logs System UI bubbles developer errors.
5588 *
5589 * Logged from:
5590 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5591 */
5592message BubbleDeveloperErrorReported {
5593
5594 // The app package that is posting the bubble.
5595 optional string package_name = 1;
5596
5597 // Bubble developer error type enums.
5598 enum Error {
5599 UNKNOWN = 0;
5600 ACTIVITY_INFO_MISSING = 1;
5601 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5602 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5603 }
5604 optional Error error = 2 [default = UNKNOWN];
5605}
5606
5607/**
Kweku Adams8845d012018-12-11 20:06:45 -08005608 * Logs that a constraint for a scheduled job has changed.
5609 *
5610 * Logged from:
5611 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5612 */
5613message ScheduledJobConstraintChanged {
5614 repeated AttributionNode attribution_node = 1;
5615
5616 // Name of the job.
5617 optional string job_name = 2;
5618
5619 optional com.android.server.job.ConstraintEnum constraint = 3;
5620
5621 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08005622 UNKNOWN = 0;
5623 UNSATISFIED = 1;
5624 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08005625 }
5626 optional State state = 4;
5627}
Alex Salod7c3eef2019-01-25 14:43:27 -08005628
5629/**
5630 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5631 * returns true.
5632 *
5633 * Logged from:
5634 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5635 */
5636message ScreenTimeoutExtensionReported {
5637 // Describes how many times in a row did the power manager reset the screen off timeout.
5638 optional uint32 consecutive_timeout_extended_count = 1;
5639}
Hui Yu885aca12019-01-10 17:11:34 -08005640
5641/*
5642* Logs number of milliseconds it takes to start a process.
5643* The definition of app process start time is from the app launch time to
5644* the time that Zygote finished forking the app process and loaded the
5645* application package's java classes.
5646
5647* This metric is different from AppStartOccurred which is for foreground
5648* activity only.
5649
5650* ProcessStartTime can report all processes (both foreground and background)
5651* start time.
5652*
5653* Logged from:
5654* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5655*/
5656message ProcessStartTime {
5657 // The uid of the ProcessRecord.
5658 optional int32 uid = 1 [(is_uid) = true];
5659
5660 // The process pid.
5661 optional int32 pid = 2;
5662
5663 // The process name.
5664 // Usually package name, "system" for system server.
5665 // Provided by ActivityManagerService.
5666 optional string process_name = 3;
5667
5668 enum StartType {
5669 UNKNOWN = 0;
5670 WARM = 1;
5671 HOT = 2;
5672 COLD = 3;
5673 }
5674
5675 // The start type.
5676 optional StartType type = 4;
5677
5678 // The elapsed realtime at the start of the process.
5679 optional int64 process_start_time_millis = 5;
5680
5681 // Number of milliseconds it takes to reach bind application.
5682 optional int32 bind_application_delay_millis = 6;
5683
5684 // Number of milliseconds it takes to finish start of the process.
5685 optional int32 process_start_delay_millis = 7;
5686
5687 // hostingType field in ProcessRecord, the component type such as "activity",
5688 // "service", "content provider", "broadcast" or other strings.
5689 optional string hosting_type = 8;
5690
5691 // hostingNameStr field in ProcessRecord. The component class name that runs
5692 // in this process.
5693 optional string hosting_name = 9;
5694}
5695
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005696/**
5697 * State of a dangerous permission requested by a package
5698 */
5699message DangerousPermissionState {
5700 // Name of the permission
5701 optional string permission_name = 1;
5702
5703 // Uid of the package
5704 optional int32 uid = 2 [(is_uid) = true];
5705
5706 // Package requesting the permission
5707 optional string package_name = 3;
5708
5709 // If the permission is granted to the uid
5710 optional bool is_granted = 4;
5711}
5712
Michael Groover4a0ca942019-01-24 17:41:25 -08005713/**
5714 * Logs when a package is denied access to a device identifier based on the new access requirements.
5715 *
5716 * Logged from:
5717 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
5718 */
5719message DeviceIdentifierAccessDenied {
5720 // The name of the package denied access to the requested device identifier.
5721 optional string package_name = 1;
5722
5723 // The name of the device identifier method the package attempted to invoke.
5724 optional string method_name = 2;
5725
5726 // True if the package is preinstalled.
5727 optional bool is_preinstalled = 3;
5728
5729 // True if the package is privileged.
5730 optional bool is_priv_app = 4;
5731}
Chenjie Yue13f44a2019-02-07 17:51:38 -08005732
5733/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08005734 * Pulls the ongoing mainline install train version code.
5735 * Pulled from StatsCompanionService
5736 */
5737message TrainInfo {
5738 optional int64 train_version_code = 1;
5739
5740 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08005741
5742 optional string train_name = 3;
5743
5744 enum Status {
5745 UNKNOWN = 0;
5746 INSTALL_REQUESTED = 1;
5747 INSTALL_STARTED = 2;
5748 INSTALL_STAGED_NOT_READY = 3;
5749 INSTALL_STAGED_READY = 4;
5750 INSTALL_SUCCESS = 5;
5751 INSTALL_FAILURE = 6;
5752 INSTALL_CANCELLED = 7;
5753 INSTALLER_ROLLBACK_REQUESTED = 8;
5754 INSTALLER_ROLLBACK_INITIATED = 9;
5755 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
5756 INSTALLER_ROLLBACK_STAGED = 11;
5757 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
5758 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
5759 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
5760 INSTALLER_ROLLBACK_SUCCESS = 15;
5761 INSTALLER_ROLLBACK_FAILURE = 16;
5762 INSTALLER_ROLLBACK_CANCEL_STAGED_REMOVE_FROM_QUEUE = 17;
5763 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_INITIATED = 18;
5764 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_SUCCESS = 19;
5765 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_FAILURE = 20;
5766 }
5767 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08005768}
joshmccloskey8c3322e2019-01-09 18:25:57 -08005769
5770/**
5771 * Logs the gesture stage changed event.
5772 *
5773 * Logged from:
5774 * frameworks/base/packages/SystemUI/
5775 */
5776message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005777 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005778}
5779
5780/**
5781 * Logs the feedback type.
5782 *
5783 * Logged from:
5784 * frameworks/base/packages/SystemUI/
5785 */
5786message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005787 // Whether or not the gesture was used.
5788 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005789}
5790
5791/**
5792 * Logs the progress.
5793 *
5794 * Logged from:
5795 * frameworks/base/packages/SystemUI/
5796 */
5797message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005798 // [0,100] progress for the assist gesture.
5799 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005800}
Neil Fullerdb14b482019-02-05 19:44:44 +00005801
5802/*
5803 * Information about the time zone data on a device.
5804 */
5805message TimeZoneDataInfo {
5806 // A version identifier for the data set on device. e.g. "2018i"
5807 optional string tzdb_version = 1;
5808}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005809
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005810/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005811 * Logs the GPU stats global health information.
5812 *
5813 * Logged from:
5814 * frameworks/native/services/gpuservice/gpustats/
5815 */
5816message GpuStatsGlobalInfo {
5817 // Package name of the gpu driver.
5818 optional string driver_package_name = 1;
5819
5820 // Version name of the gpu driver.
5821 optional string driver_version_name = 2;
5822
5823 // Version code of the gpu driver.
5824 optional int64 driver_version_code = 3;
5825
5826 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
5827 optional int64 driver_build_time = 4;
5828
5829 // Total count of the gl driver gets loaded.
5830 optional int64 gl_loading_count = 5;
5831
5832 // Total count of the gl driver fails to be loaded.
5833 optional int64 gl_loading_failure_count = 6;
5834
5835 // Total count of the Vulkan driver gets loaded.
5836 optional int64 vk_loading_count = 7;
5837
5838 // Total count of the Vulkan driver fails to be loaded.
5839 optional int64 vk_loading_failure_count = 8;
5840}
5841
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005842/**
5843 * GPU driver loading time info.
5844 */
5845message GpuDriverLoadingTime {
5846 // List of all the driver loading times for this app. The list size is
5847 // capped at 50.
5848 repeated int64 driver_loading_time = 1;
5849}
5850
5851/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005852 * Logs the GPU stats per app health information.
5853 *
5854 * Logged from:
5855 * frameworks/native/services/gpuservice/gpustats/
5856 */
5857message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005858 // Package name of the application that loads the gpu driver. Total number
5859 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005860 optional string app_package_name = 1;
5861
5862 // Version code of the gpu driver this app loads.
5863 optional int64 driver_version_code = 2;
5864
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005865 // gl driver loading time info.
5866 optional GpuDriverLoadingTime gl_driver_loading_time = 3
5867 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005868
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005869 // Vulkan driver loading time info.
5870 optional GpuDriverLoadingTime vk_driver_loading_time = 4
5871 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005872}
Rafal Slawikd4e87572019-03-12 13:08:38 +00005873
5874/*
5875 * Logs the size of the system ion heap.
5876 *
5877 * Pulled from StatsCompanionService.
5878 */
5879message SystemIonHeapSize {
5880 // Size of the system ion heap in bytes.
5881 optional int64 size_in_bytes = 1;
5882}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08005883
5884/**
5885 * Push network stack events.
5886 *
5887 * Log from:
5888 * frameworks/base/packages/NetworkStack/
5889 */
5890message NetworkStackReported {
5891 optional int32 eventId = 1;
5892 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
5893}