blob: 2b23fe0379168da120996cc35eb115f61bbb9a95 [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 Murdochbab399f62018-12-06 11:01:38 +0000189 AppCompacted app_compacted = 115;
lifre82d8f62019-03-25 20:33:21 +0800190 NetworkDnsEventReported network_dns_event_reported = 116 [(log_from_module) = "resolv"];
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.
Carmen Agimofa769c152019-03-04 14:39:14 +0000261 // Next: 10058
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;
Bookatz75ee60422018-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;
Carmen Agimofa769c152019-03-04 14:39:14 +0000320 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
David Chenc8a43242017-10-17 16:23:28 -0700321 }
yroa1fe77c2018-02-26 14:22:54 -0800322
Bookatz76aafcf2018-09-17 16:17:10 -0700323 // DO NOT USE field numbers above 100,000 in AOSP.
324 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
325 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700326}
327
Yao Chend54f9dd2017-10-17 17:37:48 +0000328/**
Yangster-mac20877162017-12-22 17:19:39 -0800329 * This proto represents a node of an attribution chain.
330 * Note: All attribution chains are represented as a repeated field of type
331 * AttributionNode. It is understood that in such arrays, the order is that
332 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000333 */
Yangster-mac20877162017-12-22 17:19:39 -0800334message AttributionNode {
335 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800336 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800337
Yangster-mac20877162017-12-22 17:19:39 -0800338 // The (optional) string tag for an element in the attribution chain. If the
339 // element has no tag, it is encoded as an empty string.
340 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700341}
342
Yangster-mac48b3d622018-08-18 12:38:11 -0700343message KeyValuePair {
344 optional int32 key = 1;
345 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700346 int32 value_int = 2;
347 int64 value_long = 3;
348 string value_str = 4;
349 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700350 }
351}
352
353message KeyValuePairsAtom {
354 optional int32 uid = 1;
355 repeated KeyValuePair pairs = 2;
356}
357
Yao Chend54f9dd2017-10-17 17:37:48 +0000358/*
359 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800360 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000361 *
362 * RULES:
363 * - The field ids for each atom must start at 1, and count upwards by 1.
364 * Skipping field ids is not allowed.
365 * - These form an API, so renaming, renumbering or removing fields is
366 * not allowed between android releases. (This is not currently enforced,
367 * but there will be a tool to enforce this restriction).
368 * - The types must be built-in protocol buffer types, namely, no sub-messages
369 * are allowed (yet). The bytes type is also not allowed.
370 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800371 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000372 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800373 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000374 * - A field that is a uid should be a string field, tagged with the [xxx]
375 * annotation. The generated code on android will be represented by UIDs,
376 * and those UIDs will be translated in xxx to those strings.
377 *
378 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700379 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000380 * - If there is a UID, it goes first. Think in an object-oriented fashion.
381 * *****************************************************************************
382 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700383
Yao Chend54f9dd2017-10-17 17:37:48 +0000384/**
Yangster-mace16189a2018-08-26 12:20:16 -0700385 * Logs when the Thermal service HAL notifies the throttling start/stop events.
386 *
387 * Logged from:
388 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
389 */
390message ThermalThrottlingStateChanged {
391 optional android.os.TemperatureTypeEnum sensor_type = 1;
392
393 enum State {
394 UNKNOWN = 0;
395 START = 1;
396 STOP = 2;
397 }
398
399 optional State state = 2;
400
401 optional float temperature = 3;
402}
403
404/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000405 * Logs when the screen state changes.
406 *
407 * Logged from:
408 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
409 */
410message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800411 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700412 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700413}
Yao Chend54f9dd2017-10-17 17:37:48 +0000414
415/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700416 * Logs that the process state of the uid, as determined by ActivityManager
417 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000418 *
419 * Logged from:
420 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
421 */
Bookatzc1a050a2017-10-10 15:49:28 -0700422message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700423 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000424
Bookatzdb026a22018-01-10 19:01:56 -0800425 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700426 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000427}
428
429/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700430 * Logs process state change of a process, as per the activity manager.
431 *
432 * Logged from:
433 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
434 */
435message ProcessStateChanged {
436 optional int32 uid = 1;
437 optional string process_name = 2;
438 optional string package_name = 3;
439 // TODO: remove this when validation is done
440 optional int64 version = 5;
441 // The state, from frameworks/base/core/proto/android/app/enums.proto.
442 optional android.app.ProcessStateEnum state = 4;
443}
444
445/**
446 * Logs when ActivityManagerService sleep state is changed.
447 *
448 * Logged from:
449 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
450 */
451message ActivityManagerSleepStateChanged {
452 // TODO: import frameworks proto
453 enum State {
454 UNKNOWN = 0;
455 ASLEEP = 1;
456 AWAKE = 2;
457 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700458 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700459}
460
461/**
462 * Logs when system memory state changes.
463 *
464 * Logged from:
465 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
466 */
467message MemoryFactorStateChanged {
468 // TODO: import frameworks proto
469 enum State {
470 MEMORY_UNKNOWN = 0;
471 NORMAL = 1; // normal.
472 MODERATE = 2; // moderate memory pressure.
473 LOW = 3; // low memory.
474 CRITICAL = 4; // critical memory.
475
476 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700477 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700478}
479
480/**
481 * Logs when app is using too much cpu, according to ActivityManagerService.
482 *
483 * Logged from:
484 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
485 */
486message ExcessiveCpuUsageReported {
487 optional int32 uid = 1;
488 optional string process_name = 2;
489 optional string package_name = 3;
490 // package version. TODO: remove this when validation is done
491 optional int64 version = 4;
492}
493
494/**
495 * Logs when a cached process is killed, along with its pss.
496 *
497 * Logged from:
498 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
499 */
500message CachedKillReported {
501 optional int32 uid = 1;
502 optional string process_name = 2;
503 optional string package_name = 3;
504 // TODO: remove this when validation is done
505 optional int64 version = 5;
506 optional int64 pss = 4;
507}
508
509/**
510 * Logs when memory stats of a process is reported.
511 *
512 * Logged from:
513 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
514 */
515message ProcessMemoryStatReported {
516 optional int32 uid = 1;
517 optional string process_name = 2;
518 optional string package_name = 3;
519 //TODO: remove this when validation is done
520 optional int64 version = 9;
521 optional int64 pss = 4;
522 optional int64 uss = 5;
523 optional int64 rss = 6;
524 enum Type {
525 ADD_PSS_INTERNAL_SINGLE = 0;
526 ADD_PSS_INTERNAL_ALL_MEM = 1;
527 ADD_PSS_INTERNAL_ALL_POLL = 2;
528 ADD_PSS_EXTERNAL = 3;
529 ADD_PSS_EXTERNAL_SLOW = 4;
530 }
531 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800532 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700533}
534
535/**
Bookatzc1a050a2017-10-10 15:49:28 -0700536 * Logs that a process started, finished, crashed, or ANRed.
537 *
538 * Logged from:
539 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
540 */
541message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700542 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700543
David Chen0b5c90c2018-01-25 16:51:49 -0800544 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800545 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700546
Bookatzddccf0a2017-11-28 16:48:14 -0800547 // What lifecycle state the process changed to.
548 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800549 enum State {
550 FINISHED = 0;
551 STARTED = 1;
552 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800553 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800554 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700555}
556
Bookatzc1a050a2017-10-10 15:49:28 -0700557/**
558 * Logs when the ble scan state changes.
559 *
560 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700561 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700562 */
563message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800564 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700565
566 enum State {
567 OFF = 0;
568 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700569 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
570 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700571 }
572 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700573
Bookatze5ec0b42018-03-26 13:34:56 -0700574 // Does the scan have a filter.
575 optional bool is_filtered = 3;
576 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
577 optional bool is_first_match = 4;
578 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
579 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700580}
581
582/**
583 * Logs reporting of a ble scan finding results.
584 *
585 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700586 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700587 */
Bookatzae6738e2018-09-13 11:38:56 -0700588// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700589message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800590 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700591
592 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800593 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700594}
595
596/**
597 * Logs when a sensor state changes.
598 *
599 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700600 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700601 */
602message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800603 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700604
Bookatzc1a050a2017-10-10 15:49:28 -0700605 // The id (int) of the sensor.
606 optional int32 sensor_id = 2;
607
608 enum State {
609 OFF = 0;
610 ON = 1;
611 }
612 optional State state = 3;
613}
614
Bookatzc1a050a2017-10-10 15:49:28 -0700615/**
616 * Logs when GPS state changes.
617 *
618 * Logged from:
619 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
620 */
621message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800622 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700623
624 enum State {
625 OFF = 0;
626 ON = 1;
627 }
628 optional State state = 2;
629}
630
Bookatz48d362e2018-11-06 15:49:08 -0800631/**
632 * Logs when GPS signal quality.
633 *
634 * Logged from:
635 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
636 */
637message GpsSignalQualityChanged {
638 optional android.server.location.GpsSignalQualityEnum level = 1;
639}
640
Bookatzc1a050a2017-10-10 15:49:28 -0700641
642/**
643 * Logs when a sync manager sync state changes.
644 *
645 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700646 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700647 */
648message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800649 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700650
David Chen0b5c90c2018-01-25 16:51:49 -0800651 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800652 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700653
654 enum State {
655 OFF = 0;
656 ON = 1;
657 }
658 optional State state = 3;
659}
660
Yangster-mac96353002018-09-05 11:18:55 -0700661/*
662 * Deferred job stats.
663 *
664 * Logged from:
665 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
666*/
667message DeferredJobStatsReported {
668 repeated AttributionNode attribution_node = 1;
669
670 // Number of jobs deferred.
671 optional int32 num_jobs_deferred = 2;
672
673 // Time since the last job runs.
674 optional int64 time_since_last_job_millis = 3;
675}
676
Bookatzc1a050a2017-10-10 15:49:28 -0700677/**
678 * Logs when a job scheduler job state changes.
679 *
680 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700681 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700682 */
683message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800684 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700685
686 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800687 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700688
689 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800690 FINISHED = 0;
691 STARTED = 1;
692 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700693 }
694 optional State state = 3;
695
Tej Singh33a412b2018-03-16 18:43:59 -0700696 // The reason a job has stopped.
697 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700698 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700699 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700700}
701
702/**
703 * Logs when the audio state changes.
704 *
705 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700706 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700707 */
708message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800709 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700710
711 enum State {
712 OFF = 0;
713 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700714 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
715 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700716 }
717 optional State state = 2;
718}
719
720/**
721 * Logs when the video codec state changes.
722 *
723 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700724 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700725 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800726message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800727 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700728
729 enum State {
730 OFF = 0;
731 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700732 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
733 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700734 }
735 optional State state = 2;
736}
737
738/**
739 * Logs when the flashlight state changes.
740 *
741 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700742 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700743 */
744message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800745 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700746
747 enum State {
748 OFF = 0;
749 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700750 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
751 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700752 }
753 optional State state = 2;
754}
755
756/**
757 * Logs when the camera state changes.
758 *
759 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700760 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700761 */
762message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800763 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700764
765 enum State {
766 OFF = 0;
767 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700768 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
769 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700770 }
771 optional State state = 2;
772}
773
774/**
775 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000776 *
777 * Logged from:
778 * TODO
779 */
Bookatzd6746242017-10-24 18:39:35 -0700780message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800781 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000782
Bookatz1a1b0462018-01-12 11:47:03 -0800783 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
784 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700785 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700786
787 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
788 optional string tag = 3;
789
790 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800791 RELEASE = 0;
792 ACQUIRE = 1;
793 CHANGE_RELEASE = 2;
794 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700795 }
796 optional State state = 4;
797}
798
799/**
Bookatzc1a050a2017-10-10 15:49:28 -0700800 * Logs when a partial wakelock is considered 'long' (over 1 min).
801 *
802 * Logged from:
803 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
804 */
805message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800806 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700807
Yao Chend54f9dd2017-10-17 17:37:48 +0000808 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
809 optional string tag = 2;
810
Bookatzc1a050a2017-10-10 15:49:28 -0700811 // TODO: I have no idea what this is.
812 optional string history_tag = 3;
813
814 enum State {
815 OFF = 0;
816 ON = 1;
817 }
818 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000819}
820
Bookatzc1a050a2017-10-10 15:49:28 -0700821/**
Bookatza66083f2018-09-20 17:24:00 -0700822 * Logs when the device is interactive, according to the PowerManager Notifier.
823 *
824 * Logged from:
825 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
826 */
827message InteractiveStateChanged {
828 enum State {
829 OFF = 0;
830 ON = 1;
831 }
832 optional State state = 1;
833}
834
835/**
Bookatzc1a050a2017-10-10 15:49:28 -0700836 * Logs Battery Saver state change.
837 *
838 * Logged from:
839 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
840 */
841message BatterySaverModeStateChanged {
842 enum State {
843 OFF = 0;
844 ON = 1;
845 }
846 optional State state = 1;
847}
848
849/**
850 * Logs Doze mode state change.
851 *
852 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800853 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700854 */
855message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800856 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800857}
858
859
860/**
861 * Logs state change of Doze mode including maintenance windows.
862 *
863 * Logged from:
864 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
865 */
866message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800867 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700868}
869
870/**
871 * Logs screen brightness level.
872 *
873 * Logged from:
874 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
875 */
876message ScreenBrightnessChanged {
877 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
878 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700879}
880
881/**
882 * Logs battery level (percent full, from 0 to 100).
883 *
884 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700885 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700886 */
887message BatteryLevelChanged {
888 // Battery level. Should be in [0, 100].
889 optional int32 battery_level = 1;
890}
891
892/**
893 * Logs change in charging status of the device.
894 *
895 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700896 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700897 */
898message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800899 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
900 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700901}
902
903/**
904 * Logs whether the device is plugged in, and what power source it is using.
905 *
906 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700907 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700908 */
909message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800910 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
911 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700912}
913
Bookatz8c6571b2017-10-24 15:04:41 -0700914/**
915 * Logs when an app's wakeup alarm fires.
916 *
917 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700918 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700919 */
920message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800921 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800922
923 // Name of the wakeup alarm.
924 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700925
926 // Name of source package (for historical reasons, since BatteryStats tracked it).
927 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800928}
929
930/**
931 * Logs when an an app causes the mobile radio to change state.
932 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
933 *
934 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700935 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800936 */
937message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800938 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800939
Bookatz1a1b0462018-01-12 11:47:03 -0800940 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
941 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800942}
943
944/**
945 * Logs when an an app causes the wifi radio to change state.
946 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
947 *
948 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700949 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800950 */
951message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800952 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800953
Bookatz1a1b0462018-01-12 11:47:03 -0800954 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
955 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700956}
957
958/**
959 * Logs kernel wakeup reasons and aborts.
960 *
961 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700962 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700963 */
964message KernelWakeupReported {
965 // Name of the kernel wakeup reason (or abort).
966 optional string wakeup_reason_name = 1;
967
968 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800969 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700970}
971
972/**
Bookatzda1798c2018-12-13 14:16:00 -0800973 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800974 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800975 *
976 * Logged from:
977 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
978 */
979message WifiEnabledStateChanged {
980 enum State {
981 OFF = 0;
982 ON = 1;
983 }
984 optional State state = 1;
985}
986
987/**
988 * 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 -0800989 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
990 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800991 *
992 * Logged from:
993 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
994 */
995message WifiRunningStateChanged {
996 repeated AttributionNode attribution_node = 1;
997
998 enum State {
999 OFF = 0;
1000 ON = 1;
1001 }
1002 optional State state = 2;
1003}
1004
1005/**
Bookatze5885242017-10-24 20:10:31 -07001006 * Logs wifi locks held by an app.
1007 *
1008 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001009 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001010 */
1011message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001012 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001013
1014 enum State {
1015 OFF = 0;
1016 ON = 1;
1017 }
1018 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001019
1020 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1021 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001022}
1023
1024/**
1025 * Logs wifi signal strength changes.
1026 *
1027 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001028 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001029 */
1030message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001031 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1032 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001033}
1034
1035/**
1036 * Logs wifi scans performed by an app.
1037 *
1038 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001039 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001040 */
1041message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001042 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001043
1044 enum State {
1045 OFF = 0;
1046 ON = 1;
1047 }
1048 optional State state = 2;
1049}
1050
1051/**
Tej Singh4503e102018-01-04 14:35:01 -08001052 * Logs wifi multicast locks held by an app
1053 *
1054 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001055 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001056 */
1057message WifiMulticastLockStateChanged {
1058 repeated AttributionNode attribution_node = 1;
1059
1060 enum State {
1061 OFF = 0;
1062 ON = 1;
1063 }
1064 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001065
1066 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001067}
1068
1069/**
Tej Singh1ea42892018-01-19 09:27:00 -08001070 * Logs shutdown reason and duration on next boot.
1071 *
1072 * Logged from:
1073 * frameworks/base/core/java/com/android/server/BootReceiver.java
1074 */
1075message ShutdownSequenceReported {
1076 // True if shutdown is for a reboot. Default: false if we do not know.
1077 optional bool reboot = 1;
1078
1079 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1080 optional string reason = 2;
1081
1082 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1083 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001084 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001085
1086 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001087 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001088}
1089
Tej Singh6483ea42018-01-25 17:45:49 -08001090
1091/**
1092 * Logs boot reason and duration.
1093 *
1094 * Logged from:
1095 * system/core/bootstat/bootstat.cpp
1096 */
1097message BootSequenceReported {
1098 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1099 // Default: "<EMPTY>" if not available.
1100 optional string bootloader_reason = 1;
1101
1102 // Reason for system boot. Eg. bootloader, reboot,userrequested
1103 // Default: "<EMPTY>" if not available.
1104 optional string system_reason = 2;
1105
1106 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001107 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001108
1109 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001110 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001111
1112 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001113 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001114
1115 // Time since last boot in ms. Default: 0 if not available.
1116 optional int64 time_since_last_boot = 6;
1117}
1118
Tej Singhc477d9c2018-02-05 18:31:39 -08001119
1120/**
1121 * Logs call state and disconnect cause (if applicable).
1122 *
1123 * Logged from:
1124 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1125 */
1126message CallStateChanged {
1127 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1128 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1129 optional android.telecom.CallStateEnum call_state = 1;
1130
1131 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1132 // This value is only applicable when the call_state is DISCONNECTED, and
1133 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1134 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1135 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1136
1137 // True if the call is self-managed, which are apps that use the
1138 // telecom infrastructure to make their own calls.
1139 optional bool self_managed = 3;
1140
1141 // True if call is external. External calls are calls on connected Wear
1142 // devices but show up in Telecom so the user can pull them onto the device.
1143 optional bool external_call = 4;
1144}
1145
Tej Singh1ea42892018-01-19 09:27:00 -08001146/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001147 * Logs keyguard state. The keyguard is the lock screen.
1148 *
1149 * Logged from:
1150 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1151 */
1152message KeyguardStateChanged {
1153 enum State {
1154 UNKNOWN = 0;
1155 // The keyguard is hidden when the phone is unlocked.
1156 HIDDEN = 1;
1157 // The keyguard is shown when the phone is locked (screen turns off).
1158 SHOWN= 2;
1159 // The keyguard is occluded when something is overlaying the keyguard.
1160 // Eg. Opening the camera while on the lock screen.
1161 OCCLUDED = 3;
1162 }
1163 optional State state = 1;
1164}
1165
1166/**
1167 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1168 * prompts the user to enter a password (pattern, pin, etc).
1169 *
1170 * Logged from:
1171 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1172 */
1173
1174message KeyguardBouncerStateChanged {
1175 enum State {
1176 UNKNOWN = 0;
1177 // Bouncer is hidden, either as a result of successfully entering the
1178 // password, screen timing out, or user going back to lock screen.
1179 HIDDEN = 1;
1180 // This is when the user is being prompted to enter the password.
1181 SHOWN = 2;
1182 }
1183 optional State state = 1;
1184}
1185
1186/**
1187 * Logs the result of entering a password into the keyguard bouncer.
1188 *
1189 * Logged from:
1190 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1191 */
1192message KeyguardBouncerPasswordEntered {
1193 enum BouncerResult {
1194 UNKNOWN = 0;
1195 // The password entered was incorrect.
1196 FAILURE = 1;
1197 // The password entered was correct.
1198 SUCCESS = 2;
1199 }
1200 optional BouncerResult result = 1;
1201}
1202
Tej Singha883b372018-02-15 11:30:01 -08001203/*
1204 * Logs changes to the configuration of the device. The configuration is defined
1205 * in frameworks/base/core/java/android/content/res/Configuration.java
1206 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1207 * Please go there to interpret the possible values each field can be.
1208 *
1209 * Logged from:
1210 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1211 */
1212message ResourceConfigurationChanged {
1213 // Bit mask of color capabilities of the screen.
1214 // Contains information about the color gamut and hdr mode of the screen.
1215 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001216 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001217
1218 // The target screen density being rendered to.
1219 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001220 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001221
1222 // Current user preference for the scaling factor for fonts,
1223 // relative to the base density scaling.
1224 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001225 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001226
1227 // Flag indicating whether the hard keyboard is hidden.
1228 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001229 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001230
1231 // The type of keyboard attached to the device.
1232 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1233 optional int32 keyboard = 5;
1234
1235 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1236 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001237 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001238
1239 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1240 // 0 if undefined.
1241 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1242 optional int32 mcc = 7;
1243
1244 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1245 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1246 // MNC_ZERO symbol defined in Configuration.java.
1247 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1248 optional int32 mnc = 8;
1249
1250 // The kind of navigation available on the device.
1251 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1252 optional int32 navigation = 9;
1253
1254 // Flag indicating whether the navigation is available.
1255 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001256 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001257
1258 // Overall orientation of the screen.
1259 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1260 optional int32 orientation = 11;
1261
1262 // The current height of the available screen space, in dp units.
1263 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001264 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001265
1266 // Bit mask of overall layout of the screen.
1267 // Contains information about screen size, whether the screen is wider/taller
1268 // than normal, whether the screen layout is right-tl-left or left-to-right,
1269 // and whether the screen has a rounded shape.
1270 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001271 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001272
1273 // Current width of the available screen space, in dp units.
1274 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001275 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001276
1277 // The smallest screen size an application will see in normal operation.
1278 // This is the smallest value of both screenWidthDp and screenHeightDp
1279 // in portrait and landscape.
1280 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001281 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001282
1283 // The type of touch screen attached to the device.
1284 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1285 optional int32 touchscreen = 16;
1286
1287 // Bit mask of the ui mode.
1288 // Contains information about the overall ui mode of the device.
1289 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1290 // Also contains information about whether the device is in night mode.
1291 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001292 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001293}
1294
Tej Singheee317b2018-03-07 19:28:05 -08001295
1296/**
1297 * Logs changes in the connection state of the mobile radio.
1298 *
1299 * Logged from:
1300 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1301 */
1302message MobileConnectionStateChanged {
1303 // States are from the state machine DataConnection.java.
1304 enum State {
1305 UNKNOWN = 0;
1306 // The connection is inactive, or disconnected.
1307 INACTIVE = 1;
1308 // The connection is being activated, or connecting.
1309 ACTIVATING = 2;
1310 // The connection is active, or connected.
1311 ACTIVE = 3;
1312 // The connection is disconnecting.
1313 DISCONNECTING = 4;
1314 // The connection is disconnecting after creating a connection.
1315 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1316 }
1317 optional State state = 1;
1318 // For multi-sim phones, this distinguishes between the sim cards.
1319 optional int32 sim_slot_index = 2;
1320 // Used to identify the connection. Starts at 0 and increments by 1 for
1321 // every new network created. Resets whenever the device reboots.
1322 optional int32 data_connection_id = 3;
1323 // A bitmask for the capabilities of this connection.
1324 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1325 // Default value (if we have no information): 0
1326 optional int64 capabilities = 4;
1327 // If this connection has internet.
1328 // This just checks if the DEFAULT bit of capabilities is set.
1329 optional bool has_internet = 5;
1330}
1331
1332/**
1333 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1334 *
1335 * Logged from:
1336 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1337 */
1338message MobileRadioTechnologyChanged {
1339 optional android.telephony.NetworkTypeEnum state = 1;
1340 // For multi-sim phones, this distinguishes between the sim cards.
1341 optional int32 sim_slot_index = 2;
1342}
1343
Andrew Chantb56388b2018-03-22 21:07:33 -07001344/**
1345 * Logs the VID and PID of any connected USB devices.
1346 *
1347 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1348 *
1349 * Logged by Vendor.
1350 */
1351message UsbDeviceAttached {
1352 optional int32 vid = 1;
1353 optional int32 pid = 2;
1354 optional bool has_audio = 3;
1355 optional bool has_hid = 4;
1356 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001357 enum State {
1358 STATE_DISCONNECTED = 0;
1359 STATE_CONNECTED = 1;
1360 }
1361 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001362 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001363}
1364
Tej Singheee317b2018-03-07 19:28:05 -08001365
Tej Singhdd7bd352018-02-09 19:33:15 -08001366/**
Tej Singh5d991e12018-03-09 19:48:11 -08001367 * Logs when Bluetooth is enabled and disabled.
1368 *
1369 * Logged from:
1370 * services/core/java/com/android/server/BluetoothManagerService.java
1371 */
1372message BluetoothEnabledStateChanged {
1373 repeated AttributionNode attribution_node = 1;
1374 // Whether or not bluetooth is enabled on the device.
1375 enum State {
1376 UNKNOWN = 0;
1377 ENABLED = 1;
1378 DISABLED = 2;
1379 }
1380 optional State state = 2;
1381 // The reason for being enabled/disabled.
1382 // Eg. Airplane mode, crash, application request.
1383 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1384 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001385 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001386}
1387
1388/**
Jack Hed9837c82019-01-09 01:19:13 -08001389 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001390 *
1391 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001392 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1393 *
1394 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001395 */
1396message BluetoothConnectionStateChanged {
1397 // The state of the connection.
1398 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1399 optional android.bluetooth.ConnectionStateEnum state = 1;
1400 // An identifier that can be used to match connect and disconnect events.
1401 // Currently is last two bytes of a hash of a device level ID and
1402 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001403 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1404 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001405 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1406 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001407 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001408 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001409 // An identifier that can be used to match events for this device.
1410 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1411 // Salt: Randomly generated 256 bit value
1412 // Hash algorithm: HMAC-SHA256
1413 // Size: 32 byte
1414 // Default: null or empty if the device identifier is not known
1415 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1416}
1417
1418/**
1419 * Logs when a Bluetooth device connects and disconnects over ACL
1420 *
1421 * Logged from:
1422 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1423 *
1424 * Next Tag: 3
1425 */
1426message BluetoothAclConnectionStateChanged {
1427 // An identifier that can be used to match events for this device.
1428 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1429 // Salt: Randomly generated 256 bit value
1430 // Hash algorithm: HMAC-SHA256
1431 // Size: 32 byte
1432 // Default: null or empty if the device identifier is not known
1433 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1434 // The state of the connection.
1435 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1436 optional android.bluetooth.ConnectionStateEnum state = 2;
1437}
1438
1439/**
1440 * Logs when a Bluetooth device connects and disconnects over SCO
1441 *
1442 * Logged from:
1443 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1444 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1445 *
1446 * Next Tag: 4
1447 */
1448message BluetoothScoConnectionStateChanged {
1449 // An identifier that can be used to match events for this device.
1450 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1451 // Salt: Randomly generated 256 bit value
1452 // Hash algorithm: HMAC-SHA256
1453 // Size: 32 byte
1454 // Default: null or empty if the device identifier is not known
1455 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1456 // The state of the connection.
1457 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1458 optional android.bluetooth.ConnectionStateEnum state = 2;
1459 // Codec used for this SCO connection
1460 // Default: UNKNOWN
1461 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001462}
1463
Jack Hec27040a2019-01-09 20:54:41 -08001464/**
1465 * Logged when active device of a profile changes
1466 *
1467 * Logged from:
1468 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1469 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1470 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1471 */
1472message BluetoothActiveDeviceChanged {
1473 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1474 // From android.bluetooth.BluetoothProfile
1475 optional int32 bt_profile = 1;
1476 // An identifier that can be used to match events for this new active device.
1477 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1478 // Salt: Randomly generated 256 bit value
1479 // Hash algorithm: HMAC-SHA256
1480 // Size: 32 byte
1481 // Default: null or empty if there is no active device for this profile
1482 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1483}
1484
Jack Heab86dbd22018-12-18 15:43:27 -08001485// Logs when there is an event affecting Bluetooth device's link layer connection.
1486// - This event is triggered when there is a related HCI command or event
1487// - Users of this metrics can deduce Bluetooth device's connection state from these events
1488// - HCI commands are logged before the command is sent, after receiving command status, and after
1489// receiving command complete
1490// - HCI events are logged when they arrive
1491//
1492// Low level log from system/bt
1493//
1494// Bluetooth classic commands:
1495// - CMD_CREATE_CONNECTION
1496// - CMD_DISCONNECT
1497// - CMD_CREATE_CONNECTION_CANCEL
1498// - CMD_ACCEPT_CONNECTION_REQUEST
1499// - CMD_REJECT_CONNECTION_REQUEST
1500// - CMD_SETUP_ESCO_CONNECTION
1501// - CMD_ACCEPT_ESCO_CONNECTION
1502// - CMD_REJECT_ESCO_CONNECTION
1503// - CMD_ENH_SETUP_ESCO_CONNECTION
1504// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1505//
1506// Bluetooth low energy commands:
1507// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1508// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1509// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1510// - CMD_BLE_CLEAR_WHITE_LIST
1511// - CMD_BLE_ADD_WHITE_LIST
1512// - CMD_BLE_REMOVE_WHITE_LIST
1513//
1514// Bluetooth classic events:
1515// - EVT_CONNECTION_COMP
1516// - EVT_CONNECTION_REQUEST
1517// - EVT_DISCONNECTION_COMP
1518// - EVT_ESCO_CONNECTION_COMP
1519// - EVT_ESCO_CONNECTION_CHANGED
1520//
1521// Bluetooth low energy meta events:
1522// - BLE_EVT_CONN_COMPLETE_EVT
1523// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1524//
1525// Next tag: 10
1526message BluetoothLinkLayerConnectionEvent {
1527 // An identifier that can be used to match events for this device.
1528 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1529 // Salt: Randomly generated 256 bit value
1530 // Hash algorithm: HMAC-SHA256
1531 // Size: 32 byte
1532 // Default: null or empty if the device identifier is not known
1533 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1534 // Connection handle of this connection if available
1535 // Range: 0x0000 - 0x0EFF (12 bits)
1536 // Default: 0xFFFF if the handle is unknown
1537 optional int32 connection_handle = 2;
1538 // Direction of the link
1539 // Default: DIRECTION_UNKNOWN
1540 optional android.bluetooth.DirectionEnum direction = 3;
1541 // Type of this link
1542 // Default: LINK_TYPE_UNKNOWN
1543 optional android.bluetooth.LinkTypeEnum type = 4;
1544
1545 // Reason metadata for this link layer connection event, rules for interpretation:
1546 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1547 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1548 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1549 // set and valid, ignore hci_ble_event
1550
1551 // HCI command associated with this event
1552 // Default: CMD_UNKNOWN
1553 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1554 // HCI event associated with this event
1555 // Default: EVT_UNKNOWN
1556 optional android.bluetooth.hci.EventEnum hci_event = 6;
1557 // HCI BLE meta event associated with this event
1558 // Default: BLE_EVT_UNKNOWN
1559 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1560 // HCI command status code if this is triggerred by hci_cmd
1561 // Default: STATUS_UNKNOWN
1562 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1563 // HCI reason code associated with this event
1564 // Default: STATUS_UNKNOWN
1565 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1566}
1567
Howard Roe103fe22019-01-17 16:52:16 -08001568/**
1569 * Logs when a module is rolled back by Watchdog.
1570 *
1571 * Logged from: Rollback Manager
1572 */
1573message WatchdogRollbackOccurred {
1574 enum RollbackType {
1575 UNKNOWN = 0;
1576 ROLLBACK_INITIATE = 1;
1577 ROLLBACK_SUCCESS = 2;
1578 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001579 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001580 }
1581 optional RollbackType rollback_type = 1;
1582
1583 optional string package_name = 2;
1584
1585 optional int32 package_version_code = 3;
1586}
1587
Jack Hec27040a2019-01-09 20:54:41 -08001588/**
1589 * Logs when there is a change in Bluetooth A2DP playback state
1590 *
1591 * Logged from:
1592 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1593 */
1594message BluetoothA2dpPlaybackStateChanged {
1595 // An identifier that can be used to match events for this device.
1596 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1597 // Salt: Randomly generated 256 bit value
1598 // Hash algorithm: HMAC-SHA256
1599 // Size: 32 byte
1600 // Default: null or empty if the device identifier is not known
1601 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1602 // Current playback state
1603 // Default: PLAYBACK_STATE_UNKNOWN
1604 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1605 // Current audio coding mode
1606 // Default: AUDIO_CODING_MODE_UNKNOWN
1607 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1608}
1609
1610/**
1611 * Logs when there is a change in A2DP codec config for a particular remote device
1612 *
1613 * Logged from:
1614 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1615 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1616 */
1617message BluetoothA2dpCodecConfigChanged {
1618 // An identifier that can be used to match events for this device.
1619 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1620 // Salt: Randomly generated 256 bit value
1621 // Hash algorithm: HMAC-SHA256
1622 // Size: 32 byte
1623 // Default: null or empty if the device identifier is not known
1624 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1625 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1626 // Default SOURCE_CODEC_TYPE_INVALID
1627 optional int32 codec_type = 2;
1628 // Codec priroity, the higher the more preferred, -1 for disabled
1629 // Default: CODEC_PRIORITY_DEFAULT
1630 optional int32 codec_priority = 3;
1631 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1632 // Default: SAMPLE_RATE_NONE
1633 optional int32 sample_rate = 4;
1634 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1635 // Default: BITS_PER_SAMPLE_NONE
1636 optional int32 bits_per_sample = 5;
1637 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1638 // Default: CHANNEL_MODE_NONE
1639 optional int32 channel_mode = 6;
1640 // Codec specific values
1641 // Default 0
1642 optional int64 codec_specific_1 = 7;
1643 optional int64 codec_specific_2 = 8;
1644 optional int64 codec_specific_3 = 9;
1645 optional int64 codec_specific_4 = 10;
1646}
1647
1648/**
1649 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1650 * Each codec's capability is logged separately due to statsd restriction
1651 *
1652 * Logged from:
1653 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1654 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1655 */
1656message BluetoothA2dpCodecCapabilityChanged {
1657 // An identifier that can be used to match events for this device.
1658 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1659 // Salt: Randomly generated 256 bit value
1660 // Hash algorithm: HMAC-SHA256
1661 // Size: 32 byte
1662 // Default: null or empty if the device identifier is not known
1663 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1664 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1665 // Default SOURCE_CODEC_TYPE_INVALID
1666 optional int32 codec_type = 2;
1667 // Codec priroity, the higher the more preferred, -1 for disabled
1668 // Default: CODEC_PRIORITY_DEFAULT
1669 optional int32 codec_priority = 3;
1670 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1671 // in BluetoothCodecConfig
1672 // Default: empty and SAMPLE_RATE_NONE for individual item
1673 optional int32 sample_rate = 4;
1674 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1675 // in BluetoothCodecConfig
1676 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1677 optional int32 bits_per_sample = 5;
1678 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1679 // BluetoothCodecConfig
1680 // Default: empty and CHANNEL_MODE_NONE for individual item
1681 optional int32 channel_mode = 6;
1682 // Codec specific values
1683 // Default 0
1684 optional int64 codec_specific_1 = 7;
1685 optional int64 codec_specific_2 = 8;
1686 optional int64 codec_specific_3 = 9;
1687 optional int64 codec_specific_4 = 10;
1688}
1689
1690/**
1691 * Logs when A2DP failed to read from PCM source.
1692 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1693 *
1694 * Logged from:
1695 * system/bt
1696 */
1697message BluetoothA2dpAudioUnderrunReported {
1698 // An identifier that can be used to match events for this device.
1699 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1700 // Salt: Randomly generated 256 bit value
1701 // Hash algorithm: HMAC-SHA256
1702 // Size: 32 byte
1703 // Default: null or empty if the device identifier is not known
1704 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1705 // Encoding interval in nanoseconds
1706 // Default: 0
1707 optional int64 encoding_interval_nanos = 2;
1708 // Number of bytes of PCM data that could not be read from the source
1709 // Default: 0
1710 optional int32 num_missing_pcm_bytes = 3;
1711}
1712
1713/**
1714 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1715 * buffer queue is full and we have to drop data
1716 *
1717 * Logged from:
1718 * system/bt
1719 */
1720message BluetoothA2dpAudioOverrunReported {
1721 // An identifier that can be used to match events for this device.
1722 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1723 // Salt: Randomly generated 256 bit value
1724 // Hash algorithm: HMAC-SHA256
1725 // Size: 32 byte
1726 // Default: null or empty if the device identifier is not known
1727 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1728 // Encoding interval in nanoseconds
1729 // Default: 0
1730 optional int64 encoding_interval_nanos = 2;
1731 // Number of buffers dropped in this event
1732 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1733 // Default: 0
1734 optional int32 num_dropped_buffers = 3;
1735 // Number of encoded buffers dropped in this event
1736 // Default 0
1737 optional int32 num_dropped_encoded_frames = 4;
1738 // Number of encoded bytes dropped in this event
1739 // Default: 0
1740 optional int32 num_dropped_encoded_bytes = 5;
1741}
1742
1743/**
1744 * Logs when we receive reports regarding a device's RSSI value
1745 *
1746 * Logged from:
1747 * system/bt
1748 */
1749message BluetoothDeviceRssiReported {
1750 // An identifier that can be used to match events for this device.
1751 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1752 // Salt: Randomly generated 256 bit value
1753 // Hash algorithm: HMAC-SHA256
1754 // Size: 32 byte
1755 // Default: null or empty if the device identifier is not known
1756 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1757 // Connection handle of this connection if available
1758 // Range: 0x0000 - 0x0EFF (12 bits)
1759 // Default: 0xFFFF if the handle is unknown
1760 optional int32 connection_handle = 2;
1761 // HCI command status code if this is triggerred by hci_cmd
1762 // Default: STATUS_UNKNOWN
1763 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1764 // BR/EDR
1765 // Range: -128 ≤ N ≤ 127 (signed integer)
1766 // Units: dB
1767 // LE:
1768 // Range: -127 to 20, 127 (signed integer)
1769 // Units: dBm
1770 // Invalid when an out of range value is reported
1771 optional int32 rssi = 4;
1772}
1773
1774/**
1775 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1776 *
1777 * Logged from:
1778 * system/bt
1779 */
1780message BluetoothDeviceFailedContactCounterReported {
1781 // An identifier that can be used to match events for this device.
1782 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1783 // Salt: Randomly generated 256 bit value
1784 // Hash algorithm: HMAC-SHA256
1785 // Size: 32 byte
1786 // Default: null or empty if the device identifier is not known
1787 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1788 // Connection handle of this connection if available
1789 // Range: 0x0000 - 0x0EFF (12 bits)
1790 // Default: 0xFFFF if the handle is unknown
1791 optional int32 connection_handle = 2;
1792 // HCI command status code if this is triggerred by hci_cmd
1793 // Default: STATUS_UNKNOWN
1794 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1795 // Number of consecutive failed contacts for a connection corresponding to the Handle
1796 // Range: uint16_t, 0-0xFFFF
1797 // Default: 0xFFFFF
1798 optional int32 failed_contact_counter = 4;
1799}
1800
1801/**
1802 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1803 *
1804 * Logged from:
1805 * system/bt
1806 */
1807message BluetoothDeviceTxPowerLevelReported {
1808 // An identifier that can be used to match events for this device.
1809 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1810 // Salt: Randomly generated 256 bit value
1811 // Hash algorithm: HMAC-SHA256
1812 // Size: 32 byte
1813 // Default: null or empty if the device identifier is not known
1814 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1815 // Connection handle of this connection if available
1816 // Range: 0x0000 - 0x0EFF (12 bits)
1817 // Default: 0xFFFF if the handle is unknown
1818 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001819 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001820 // Default: STATUS_UNKNOWN
1821 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1822 // Range: -30 ≤ N ≤ 20
1823 // Units: dBm
1824 // Invalid when an out of range value is reported
1825 optional int32 transmit_power_level = 4;
1826}
Jack Heab86dbd22018-12-18 15:43:27 -08001827
Tej Singh5d991e12018-03-09 19:48:11 -08001828/**
Jack He1021a612019-01-20 21:22:46 -08001829 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1830 * receiving an HCI command from the host
1831 *
1832 * Logged from: system/bt
1833 */
1834message BluetoothHciTimeoutReported {
1835 // HCI command associated with this event
1836 // Default: CMD_UNKNOWN
1837 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1838}
1839
1840/**
1841 * Logs when we receive Bluetooth Link Quality Report event from the controller
1842 * See Android Bluetooth HCI specification for more details
1843 *
1844 * Note: all count and bytes field are counted since last event
1845 *
1846 * Logged from: system/bt
1847 */
1848message BluetoothQualityReportReported {
1849 // Quality report ID
1850 // Original type: uint8_t
1851 // Default: BQR_ID_UNKNOWN
1852 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1853 // Packet type of the connection
1854 // Original type: uint8_t
1855 // Default: BQR_PACKET_TYPE_UNKNOWN
1856 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1857 // Connection handle of the connection
1858 // Original type: uint16_t
1859 optional int32 connection_handle = 3;
1860 // Performing Role for the connection
1861 // Original type: uint8_t
1862 optional int32 connection_role = 4;
1863 // Current Transmit Power Level for the connection. This value is the same as the controller's
1864 // response to the HCI_Read_Transmit_Power_Level HCI command
1865 // Original type: uint8_t
1866 optional int32 tx_power_level = 5;
1867 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1868 // absolute receiver signal strength value
1869 // Original type: int8_t
1870 optional int32 rssi = 6;
1871 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1872 // channels used by the link currently
1873 // Original type: uint8_t
1874 optional int32 snr = 7;
1875 // Indicates the number of unused channels in AFH_channel_map
1876 // Original type: uint8_t
1877 optional int32 unused_afh_channel_count = 8;
1878 // Indicates the number of the channels which are interfered and quality is bad but are still
1879 // selected for AFH
1880 // Original type: uint8_t
1881 optional int32 afh_select_unideal_channel_count = 9;
1882 // Current Link Supervision Timeout Setting
1883 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1884 // Original type: uint16_t
1885 optional int32 lsto = 10;
1886 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1887 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1888 // 0x01 (Piconet Clock)
1889 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1890 // Original type: uint32_t
1891 optional int64 connection_piconet_clock = 11;
1892 // The count of retransmission
1893 // Original type: uint32_t
1894 optional int64 retransmission_count = 12;
1895 // The count of no RX
1896 // Original type: uint32_t
1897 optional int64 no_rx_count = 13;
1898 // The count of NAK (Negative Acknowledge)
1899 // Original type: uint32_t
1900 optional int64 nak_count = 14;
1901 // Controller timestamp of last TX ACK
1902 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1903 // Original type: uint32_t
1904 optional int64 last_tx_ack_timestamp = 15;
1905 // The count of Flow-off (STOP)
1906 // Original type: uint32_t
1907 optional int64 flow_off_count = 16;
1908 // Controller timestamp of last Flow-on (GO)
1909 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1910 // Original type: uint32_t
1911 optional int64 last_flow_on_timestamp = 17;
1912 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1913 // Original type: uint32_t
1914 optional int64 buffer_overflow_bytes = 18;
1915 // Buffer underflow count (in byte) since last event
1916 // Original type: uint32_t
1917 optional int64 buffer_underflow_bytes = 19;
1918}
1919
1920/**
1921 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1922 *
1923 * Notes:
1924 * - Each event can be partially filled as we might learn different pieces of device
1925 * information at different time
1926 * - Multiple device info events can be combined to give more complete picture
1927 * - When multiple device info events tries to describe the same information, the
1928 * later one wins
1929 *
1930 * Logged from:
1931 * packages/apps/Bluetooth
1932 */
1933message BluetoothManufacturerInfoReported {
1934 // An identifier that can be used to match events for this device.
1935 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1936 // Salt: Randomly generated 256 bit value
1937 // Hash algorithm: HMAC-SHA256
1938 // Size: 32 byte
1939 // Default: null or empty if the device identifier is not known
1940 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1941 // Where is this device info obtained from
1942 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1943 // Name of the data source
1944 // For EXTERNAL: package name of the data source
1945 // For INTERNAL: null for general case, component name otherwise
1946 optional string source_name = 3;
1947 // Name of the manufacturer of this device
1948 optional string manufacturer = 4;
1949 // Model of this device
1950 optional string model = 5;
1951 // Hardware version of this device
1952 optional string hardware_version = 6;
1953 // Software version of this device
1954 optional string software_version = 7;
1955}
1956
1957/**
1958 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1959 * device, as documented by the Bluetooth Core HCI specification
1960 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1961 * Vol 2, Part E, Page 1118
1962 *
1963 * Logged from:
1964 * system/bt
1965 */
1966message BluetoothRemoteVersionInfoReported {
1967 // Connection handle of the connection
1968 // Original type: uint16_t
1969 optional int32 connection_handle = 1;
1970 // HCI command status code
1971 // Default: STATUS_UNKNOWN
1972 optional android.bluetooth.hci.StatusEnum hci_status = 2;
1973 // 1 byte Version of current LMP in the remote controller
1974 optional int32 lmp_version = 3;
1975 // 2 bytes LMP manufacturer code of the remote controller
1976 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
1977 optional int32 lmp_manufacturer_code = 4;
1978 // 4 bytes subversion of the LMP in the remote controller
1979 optional int32 lmp_subversion = 5;
1980}
1981
1982/**
1983 * Logs when certain Bluetooth SDP attributes are discovered
1984 * Constant definitions are from:
1985 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
1986 *
1987 * Current logged attributes:
1988 * - BluetoothProfileDescriptorList
1989 * - Supported Features Bitmask
1990 *
1991 * Logged from:
1992 * system/bt
1993 */
1994message BluetoothSdpAttributeReported {
1995 // An identifier that can be used to match events for this device.
1996 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1997 // Salt: Randomly generated 256 bit value
1998 // Hash algorithm: HMAC-SHA256
1999 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2000 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2001 // Original type: uint16_t
2002 optional int32 protocol_uuid = 2;
2003 // Short form UUIDs used to identify Bluetooth SDP attribute types
2004 // Original type: uint16_t
2005 optional int32 attribute_id = 3;
2006 // Attribute value for the particular attribute
2007 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2008}
2009
2010/**
2011 * Logs when bond state of a Bluetooth device changes
2012 *
2013 * Logged from:
2014 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2015 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2016 */
2017message BluetoothBondStateChanged {
2018 // An identifier that can be used to match events for this device.
2019 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2020 // Salt: Randomly generated 256 bit value
2021 // Hash algorithm: HMAC-SHA256
2022 // Size: 32 byte
2023 // Default: null or empty if the device identifier is not known
2024 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2025 // Preferred transport type to remote dual mode device
2026 // Default: TRANSPORT_AUTO means no preference
2027 optional android.bluetooth.TransportTypeEnum transport = 2;
2028 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2029 // Default: UNKNOWN
2030 optional android.bluetooth.DeviceTypeEnum type = 3;
2031 // Current bond state (NONE, BONDING, BONDED)
2032 // Default: BOND_STATE_UNKNOWN
2033 optional android.bluetooth.BondStateEnum bond_state = 4;
2034 // Bonding sub state
2035 // Default: BOND_SUB_STATE_UNKNOWN
2036 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2037 // Unbond Reason
2038 // Default: UNBOND_REASON_UNKNOWN
2039 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2040}
2041
2042/**
2043 * Logs there is an event related Bluetooth classic pairing
2044 *
2045 * Logged from:
2046 * system/bt
2047 */
2048message BluetoothClassicPairingEventReported {
2049 // An identifier that can be used to match events for this device.
2050 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2051 // Salt: Randomly generated 256 bit value
2052 // Hash algorithm: HMAC-SHA256
2053 // Size: 32 byte
2054 // Default: null or empty if the device identifier is not known
2055 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2056 // Connection handle of this connection if available
2057 // Range: 0x0000 - 0x0EFF (12 bits)
2058 // Default: 0xFFFF if the handle is unknown
2059 optional int32 connection_handle = 2;
2060 // HCI command associated with this event
2061 // Default: CMD_UNKNOWN
2062 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2063 // HCI event associated with this event
2064 // Default: EVT_UNKNOWN
2065 optional android.bluetooth.hci.EventEnum hci_event = 4;
2066 // HCI command status code if this is triggerred by hci_cmd
2067 // Default: STATUS_UNKNOWN
2068 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2069 // HCI reason code associated with this event
2070 // Default: STATUS_UNKNOWN
2071 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002072 // A status value related to this specific event
2073 // Default: 0
2074 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002075}
2076
2077/**
2078 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2079 *
2080 * Logged from:
2081 * system/bt
2082 */
2083message BluetoothSmpPairingEventReported {
2084 // An identifier that can be used to match events for this device.
2085 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2086 // Salt: Randomly generated 256 bit value
2087 // Hash algorithm: HMAC-SHA256
2088 // Size: 32 byte
2089 // Default: null or empty if the device identifier is not known
2090 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2091 // SMP command sent or received over L2CAP
2092 // Default: CMD_UNKNOWN
2093 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2094 // Whether this command is sent or received
2095 // Default: DIRECTION_UNKNOWN
2096 optional android.bluetooth.DirectionEnum direction = 3;
2097 // SMP failure reason code
2098 // Default: PAIRING_FAIL_REASON_DEFAULT
2099 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2100}
2101
2102/**
Jack He815cdba2019-01-30 17:24:55 -08002103 * Logs when a Bluetooth socket’s connection state changed
2104 *
2105 * Logged from:
2106 * system/bt
2107 */
2108message BluetoothSocketConnectionStateChanged {
2109 // An identifier that can be used to match events for this device.
2110 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2111 // Salt: Randomly generated 256 bit value
2112 // Hash algorithm: HMAC-SHA256
2113 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002114 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002115 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002116 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002117 // Default 0 when unknown or don't care
2118 optional int32 port = 2;
2119 // Socket type as mentioned in
2120 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2121 // Default: SOCKET_TYPE_UNKNOWN
2122 optional android.bluetooth.SocketTypeEnum type = 3;
2123 // Socket connection state
2124 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2125 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2126 // Number of bytes sent to remote device during this connection
2127 optional int64 tx_bytes = 5;
2128 // Number of bytes received from remote device during this connection
2129 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002130 // Socket owner's UID
2131 optional int32 uid = 7 [(is_uid) = true];
2132 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2133 // |port| must be spawned by |server_port|
2134 // Default 0 when unknown or don't care
2135 optional int32 server_port = 8;
2136 // Whether this is a server listener socket
2137 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002138}
2139
2140/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002141 * Logs when something is plugged into or removed from the USB-C connector.
2142 *
2143 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002144 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002145 */
2146message UsbConnectorStateChanged {
2147 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002148 STATE_DISCONNECTED = 0;
2149 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002150 }
2151 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002152 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002153 // Last active session in ms.
2154 // 0 when the port is in connected state.
2155 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002156}
2157
2158/**
2159 * Logs the reported speaker impedance.
2160 *
2161 * Logged from:
2162 * Vendor audio implementation.
2163 */
2164message SpeakerImpedanceReported {
2165 optional int32 speaker_location = 1;
2166 optional int32 impedance = 2;
2167}
2168
2169/**
2170 * Logs the report of a failed hardware.
2171 *
2172 * Logged from:
2173 * Vendor HALs.
2174 *
2175 */
2176message HardwareFailed {
2177 enum HardwareType {
2178 HARDWARE_FAILED_UNKNOWN = 0;
2179 HARDWARE_FAILED_MICROPHONE = 1;
2180 HARDWARE_FAILED_CODEC = 2;
2181 HARDWARE_FAILED_SPEAKER = 3;
2182 HARDWARE_FAILED_FINGERPRINT = 4;
2183 }
2184 optional HardwareType hardware_type = 1;
2185
Maggie White6dcd8572019-01-31 14:11:50 -08002186 /**
2187 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002188 * the same hardware_type. The specific locations are vendor defined integers,
2189 * referring to board-specific numbering schemes.
2190 */
2191 optional int32 hardware_location = 2;
2192
Maggie White6dcd8572019-01-31 14:11:50 -08002193 /**
2194 * failure_code is specific to the HardwareType of the failed hardware.
2195 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002196 */
Maggie White6dcd8572019-01-31 14:11:50 -08002197 enum HardwareErrorCode {
2198 UNKNOWN = 0;
2199 COMPLETE = 1;
2200 SPEAKER_HIGH_Z = 2;
2201 SPEAKER_SHORT = 3;
2202 FINGERPRINT_SENSOR_BROKEN = 4;
2203 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002204 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002205 }
2206 optional int32 failure_code = 3;
2207}
2208
2209/**
2210 * Log an event when the device has been physically dropped.
2211 * Reported from the /vendor partition.
2212 */
2213message PhysicalDropDetected {
2214 // Confidence that the event was actually a drop, 0 -> 100
2215 optional int32 confidence_pctg = 1;
2216 // Peak acceleration of the drop, in 1/1000s of a g.
2217 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002218 // Duration of freefall in ms
2219 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002220}
2221
2222/**
2223 * Log bucketed battery charge cycles.
2224 *
2225 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002226 * a given charge point. For example, if 10 cycle buckets are
2227 * initialized, bucket 1 is the lowest 1/10th of the battery,
2228 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002229 *
2230 * Logged from:
2231 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2232 */
2233message ChargeCyclesReported {
2234 optional int32 cycle_bucket_1 = 1;
2235 optional int32 cycle_bucket_2 = 2;
2236 optional int32 cycle_bucket_3 = 3;
2237 optional int32 cycle_bucket_4 = 4;
2238 optional int32 cycle_bucket_5 = 5;
2239 optional int32 cycle_bucket_6 = 6;
2240 optional int32 cycle_bucket_7 = 7;
2241 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002242 optional int32 cycle_bucket_9 = 9;
2243 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002244}
2245
2246/**
Howard Roa46b6582018-09-18 16:45:02 -07002247 * Log battery health snapshot.
2248 *
2249 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2250 * are snapshotted periodically over 24hrs.
2251 */
2252message BatteryHealthSnapshot {
2253 enum BatterySnapshotType {
2254 UNKNOWN = 0;
2255 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2256 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2257 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2258 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2259 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2260 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2261 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2262 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2263 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2264 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2265 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2266 }
2267 optional BatterySnapshotType type = 1;
2268 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002269 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002270 // Voltage Battery Voltage, in microVolts.
2271 optional int32 voltage_micro_volt = 3;
2272 // Current Battery current, in microAmps.
2273 optional int32 current_micro_amps = 4;
2274 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2275 optional int32 open_circuit_micro_volt = 5;
2276 // Resistance Battery Resistance, in microOhms.
2277 optional int32 resistance_micro_ohm = 6;
2278 // Level Battery Level, as % of full.
2279 optional int32 level_percent = 7;
2280}
2281
2282/**
2283 * Log slow I/O operations on the primary storage.
2284 */
2285message SlowIo {
2286 // Classifications of IO Operations.
2287 enum IoOperation {
2288 UNKNOWN = 0;
2289 READ = 1;
2290 WRITE = 2;
2291 UNMAP = 3;
2292 SYNC = 4;
2293 }
2294 optional IoOperation operation = 1;
2295
2296 // The number of slow IO operations of this type over 24 hours.
2297 optional int32 count = 2;
2298}
2299
2300/**
2301 * Log battery caused shutdown with the last recorded voltage.
2302 */
2303message BatteryCausedShutdown {
2304 // The last recorded battery voltage prior to shutdown.
2305 optional int32 last_recorded_micro_volt = 1;
2306}
2307
2308/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002309 * Logs the duration of a davey (jank of >=700ms) when it occurs
2310 *
2311 * Logged from:
2312 * frameworks/base/libs/hwui/JankTracker.cpp
2313 */
2314message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002315 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002316 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002317
Tej Singhbb8554a2018-01-26 11:59:14 -08002318 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002319 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002320}
2321
2322/**
Bookatze5885242017-10-24 20:10:31 -07002323 * Logs phone signal strength changes.
2324 *
2325 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002326 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002327 */
2328message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002329 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2330 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002331}
2332
Yangster4ccebea2018-10-09 17:09:02 -07002333
2334/**
2335 * Logs when the phone state, sim state or signal strength changes
2336 *
2337 * Logged from:
2338 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2339 */
2340message PhoneServiceStateChanged {
2341 optional android.telephony.ServiceStateEnum state = 1;
2342 optional android.telephony.SimStateEnum sim_state = 2;
2343 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2344}
2345
2346/**
2347 * Logs when the phone becomes on or off.
2348 *
2349 * Logged from:
2350 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2351 */
2352message PhoneStateChanged {
2353 enum State {
2354 OFF = 0;
2355 ON = 1;
2356 }
2357 optional State state = 1;
2358}
2359
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002360message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002361 optional android.stats.launcher.LauncherAction action = 1;
2362 optional android.stats.launcher.LauncherState src_state = 2;
2363 optional android.stats.launcher.LauncherState dst_state = 3;
2364 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002365 optional bool is_swipe_up_enabled = 5;
2366}
2367
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002368message StyleUIChanged {
2369 optional android.stats.style.Action action = 1;
2370 optional int32 color_package_hash = 2;
2371 optional int32 font_package_hash = 3;
2372 optional int32 shape_package_hash = 4;
2373 optional int32 clock_package_hash = 5;
2374 optional int32 launcher_grid = 6;
2375 optional int32 wallpaper_category_hash = 7;
2376 optional int32 wallpaper_id_hash = 8;
2377}
2378
David Chenc28b2bb2017-10-24 12:52:52 -07002379/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002380 * Logs when Settings UI has changed.
2381 *
2382 * Logged from:
2383 * packages/apps/Settings
2384 */
2385message SettingsUIChanged {
2386 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002387 * Where this SettingsUIChange event comes from. For example, if
2388 * it's a PAGE_VISIBLE event, where the page is opened from.
2389 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002390 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002391
2392 /**
2393 * What the UI action is.
2394 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002395 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002396
2397 /**
2398 * Where the action is happening
2399 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002400 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002401
2402 /**
2403 * What preference changed in this event.
2404 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002405 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002406
2407 /**
2408 * The new value of the changed preference.
2409 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002410 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002411}
2412
2413/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002414 * Logs basic timing information about touch events.
2415 * Reported at most every 5 minutes while device is being interacted with.
2416 *
2417 * Logged from:
2418 * frameworks/native/services/inputflinger
2419 */
2420message TouchEventReported {
2421 /**
2422 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2423 * and the standard deviation of latency between the kernel and framework
2424 * for touchscreen events. The units are microseconds.
2425 *
2426 * The number is measured as the difference between the time at which
2427 * the input event was received in the evdev driver,
2428 * and the time at which the input event was received in EventHub.
2429 */
2430 // Minimum value
2431 optional float latency_min_micros = 1;
2432 // Maximum value
2433 optional float latency_max_micros = 2;
2434 // Average value
2435 optional float latency_mean_micros = 3;
2436 // Standard deviation
2437 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002438 // Number of touch events (input_event) in this report
2439 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002440}
2441
2442/**
Philip Quinn0eded622019-01-29 12:46:28 -08002443 * Logs gesture classification and timing information for touch events.
2444 *
2445 * Logged from:
2446 * frameworks/base/core/java/android/view/GestureDetector.java
2447 * frameworks/base/core/java/android/view/View.java
2448 */
2449message TouchGestureClassified {
2450 // The source of the classification (e.g. Java class name).
2451 optional string source = 1;
2452
2453 enum Classification {
2454 UNKNOWN_CLASSIFICATION = 0;
2455 SINGLE_TAP = 1;
2456 DOUBLE_TAP = 2;
2457 LONG_PRESS = 3;
2458 DEEP_PRESS = 4;
2459 SCROLL = 5;
2460 }
2461 // The classification of the gesture.
2462 optional Classification classification = 2;
2463
2464 // The interval from the start of a touch event stream until the
2465 // classification was made.
2466 optional int32 latency_millis = 3;
2467
2468 // The distance from the location of the first touch event to the
2469 // location of the touch event when the classification was made.
2470 optional float displacement_px = 4;
2471}
2472
2473/**
David Chenc28b2bb2017-10-24 12:52:52 -07002474 * Logs that a setting was updated.
2475 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002476 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002477 * The tag and is_default allow resetting of settings to default values based on the specified
2478 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2479 */
2480message SettingChanged {
2481 // The name of the setting.
2482 optional string setting = 1;
2483
2484 // The change being imposed on this setting. May represent a number, eg "3".
2485 optional string value = 2;
2486
2487 // The new value of this setting. For most settings, this is same as value. For some settings,
2488 // value is +X or -X where X represents an element in a set. For example, if the previous value
2489 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2490 // The +/- feature is currently only used for location_providers_allowed.
2491 optional string new_value = 3;
2492
2493 // The previous value of this setting.
2494 optional string prev_value = 4;
2495
2496 // The tag used with the is_default for resetting sets of settings. This is generally null.
2497 optional string tag = 5;
2498
Bookatz90867622018-01-31 15:05:57 -08002499 // True if this setting with tag should be resettable.
2500 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002501
David Chenbd789912018-03-16 17:19:55 -07002502 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002503 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002504
2505 enum ChangeReason {
2506 UPDATED = 1; // Updated can be an insertion or an update.
2507 DELETED = 2;
2508 }
2509 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002510}
Chenjie Yub3dda412017-10-24 13:41:59 -07002511
Chenjie Yu05013b32017-11-21 10:21:41 -08002512/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002513 * Logs activity going to foreground or background
2514 *
2515 * Logged from:
2516 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2517 */
2518message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002519 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002520 optional string pkg_name = 2;
2521 optional string class_name = 3;
2522
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002523 enum State {
2524 BACKGROUND = 0;
2525 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002526 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002527 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002528}
David Chenc8a43242017-10-17 16:23:28 -07002529
2530/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002531 * Logs when a volume entered low Storage state.
2532 * Logged from:
2533 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2534 */
2535message LowStorageStateChanged {
2536 // Volume that ran out of storage.
2537 optional string volume_description = 1;
2538
2539 enum State {
2540 UNKNOWN = 0;
2541 OFF = 1;
2542 ON = 2;
2543 }
2544 optional State state = 2;
2545}
2546
2547/**
2548 * Logs when an app is downgraded.
2549 * Logged from:
2550 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2551 */
2552message AppDowngraded {
2553 optional string package_name = 1;
2554 // Size of the package (all data) before being downgraded.
2555 optional int64 size_in_bytes_before = 2;
2556 // Size of the package (all data) after being downgraded.
2557 optional int64 size_in_bytes_after = 3;
2558
2559 optional bool aggressive = 4;
2560}
2561
2562/**
2563 * Logs when an app is optimized after being downgraded.
2564 * Logged from:
2565 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2566 */
2567message AppOptimizedAfterDowngraded {
2568 optional string package_name = 1;
2569}
2570
2571/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002572 * Logs whenever an app is installed on external storage.
2573 * Logged from:
2574 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2575 */
2576message AppInstallOnExternalStorageReported {
2577 // The type of external storage.
2578 optional android.stats.storage.ExternalStorageType storage_type = 1;
2579 // The name of the package that is installed on the sd card.
2580 optional string package_name = 2;
2581}
2582
2583/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002584 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002585 * Logged from:
2586 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2587 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002588message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002589 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002590
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002591 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002592
2593 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002594 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002595 optional string process_name = 3;
2596
2597 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002598 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002599
2600 optional string package_name = 5;
2601
2602 enum InstantApp {
2603 UNAVAILABLE = 0;
2604 FALSE = 1;
2605 TRUE = 2;
2606 }
2607 optional InstantApp is_instant_app = 6;
2608
2609 enum ForegroundState {
2610 UNKNOWN = 0;
2611 BACKGROUND = 1;
2612 FOREGROUND = 2;
2613 }
2614 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002615
2616 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002617}
David Chen9e3808c2017-11-20 17:25:34 -08002618
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002619/**
2620 * Logs when a WTF (What a Terrible Failure) happened.
2621 * Logged from:
2622 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2623 */
2624message WTFOccurred {
2625 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002626
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002627 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002628
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002629 // The name of the process.
2630 // system_server if it is not by an app
2631 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002632
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002633 // The pid if available. -1 means not available.
2634 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002635
2636 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002637}
2638
2639/**
2640 * Logs when system server reports low memory.
2641 * Logged from:
2642 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2643 */
2644message LowMemReported {
2645}
2646
2647/**
2648 * Logs when an app ANR (App Not Responding) occurs.
2649 * Logged from:
2650 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2651 */
2652message ANROccurred {
2653 optional int32 uid = 1 [(is_uid) = true];
2654
2655 optional string process_name = 2;
2656
2657 optional string short_component_name = 3;
2658
2659 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002660
2661 enum InstantApp {
2662 UNAVAILABLE = 0;
2663 FALSE = 1;
2664 TRUE = 2;
2665 }
2666 optional InstantApp is_instant_app = 5;
2667
2668 enum ForegroundState {
2669 UNKNOWN = 0;
2670 BACKGROUND = 1;
2671 FOREGROUND = 2;
2672 }
2673 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002674
2675 optional android.server.ErrorSource error_source = 7;
2676
2677 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002678}
2679
Bookatza7020bd2018-08-28 16:29:35 -07002680/**
2681 * Logs when the vibrator state changes.
2682 * Logged from:
2683 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2684 */
2685message VibratorStateChanged {
2686 repeated AttributionNode attribution_node = 1;
2687
2688 enum State {
2689 OFF = 0;
2690 ON = 1;
2691 }
2692 optional State state = 2;
2693
2694 // Duration (in milliseconds) requested to keep the vibrator on.
2695 // Only applicable for State == ON.
2696 optional int64 duration_millis = 3;
2697}
2698
David Chen0a368b22017-12-06 16:28:16 -08002699/*
2700 * Allows other apps to push events into statsd.
2701 * Logged from:
2702 * frameworks/base/core/java/android/util/StatsLog.java
2703 */
David Chen0b5c90c2018-01-25 16:51:49 -08002704message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002705 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002706 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002707
2708 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2709 optional int32 label = 2;
2710
2711 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2712 // predicates for the metrics).
2713 enum State {
2714 UNKNOWN = 0;
2715 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2716 STOP = 2;
2717 START = 3;
2718 }
2719 optional State state = 3;
2720}
2721
David Chen9e3808c2017-11-20 17:25:34 -08002722/**
Bookatz7948c872018-09-04 12:58:33 -07002723 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2724 * For example, this could be due to the user manually changing the time.
2725 *
2726 * Logged from:
2727 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2728 */
2729message WallClockTimeShifted {
2730 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2731 optional int64 wall_clock_timestamp_millis = 1;
2732}
2733
2734/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002735 * Logs when statsd detects an anomaly.
2736 *
2737 * Logged from:
2738 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2739 */
2740message AnomalyDetected {
2741 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002742 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002743
Yangster-mac94e197c2018-01-02 16:03:03 -08002744 // Id of the config whose anomaly detection alert fired.
2745 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002746
Yangster-mac94e197c2018-01-02 16:03:03 -08002747 // Id of the alert (i.e. name of the anomaly that was detected).
2748 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002749}
2750
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002751message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002752 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002753 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002754
2755 // The app package name.
2756 optional string pkg_name = 2;
2757
2758 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002759 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002760 WARM = 1;
2761 HOT = 2;
2762 COLD = 3;
2763 }
2764 // The transition type.
2765 optional TransitionType type = 3;
2766
2767 // The activity name.
2768 optional string activity_name = 4;
2769
2770 // The name of the calling app. Empty if not set.
2771 optional string calling_pkg_name = 5;
2772
2773 // Whether the app is an instant app.
2774 optional bool is_instant_app = 6;
2775
2776 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002777 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002778
Bookatz80d11a02018-01-16 10:46:35 -08002779 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002780
David Chen0b5c90c2018-01-25 16:51:49 -08002781 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002782 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002783 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002784 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002785 optional int32 bind_application_delay_millis = 11;
2786 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002787
2788 // Empty if not set.
2789 optional string launch_token = 13;
2790
Calin Juravle759fbda2018-02-20 19:52:30 +00002791 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002792 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002793
2794 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002795 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002796}
2797
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002798message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002799 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002800 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002801
2802 // The app package name.
2803 optional string pkg_name = 2;
2804
2805 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002806 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002807 WARM = 1;
2808 HOT = 2;
2809 COLD = 3;
2810 }
2811 // The transition type.
2812 optional TransitionType type = 3;
2813
2814 // The activity name.
2815 optional string activity_name = 4;
2816}
2817
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002818message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002819 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002820 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002821
2822 // The app package name.
2823 optional string pkg_name = 2;
2824
2825 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002826 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002827 WITH_BUNDLE = 1;
2828 WITHOUT_BUNDLE = 2;
2829 }
2830 // The transition type.
2831 optional TransitionType type = 3;
2832
2833 // The activity name.
2834 optional string activity_name = 4;
2835
2836 optional bool transition_process_running = 5;
2837
2838 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002839 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002840}
2841
Bookatz8fcd09a2017-12-18 13:01:10 -08002842/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002843 * Logs a picture-in-picture action
2844 * Logged from:
2845 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2846 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2847 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2848 */
2849message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002850 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002851 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002852
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002853 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002854
Chenjie Yu52cacc62017-12-08 18:11:45 -08002855 enum State {
2856 ENTERED = 1;
2857 EXPANDED_TO_FULL_SCREEN = 2;
2858 MINIMIZED = 3;
2859 DISMISSED = 4;
2860 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002861 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002862}
2863
2864/**
Chenjie Yue8904192017-12-08 19:12:57 -08002865 * Logs overlay action
2866 * Logged from:
2867 * services/core/java/com/android/server/wm/Session.java
2868 */
2869message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002870 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002871
2872 optional string package_name = 2;
2873
2874 optional bool using_alert_window = 3;
2875
2876 enum State {
2877 ENTERED = 1;
2878 EXITED = 2;
2879 }
2880 optional State state = 4;
2881}
2882
Chenjie Yuccfe6452018-01-30 11:33:21 -08002883/*
2884 * Logs foreground service starts and stops.
2885 * Note that this is not when a service starts or stops, but when it is
2886 * considered foreground.
2887 * Logged from
2888 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2889 */
2890message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002891 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002892 // package_name + "/" + class_name
2893 optional string short_name = 2;
2894
2895 enum State {
2896 ENTER = 1;
2897 EXIT = 2;
2898 }
2899 optional State state = 3;
2900}
2901
Chenjie Yue8904192017-12-08 19:12:57 -08002902/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002903 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2904 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2905 * attributed back to the parent (host) uid. One example is Chrome.
2906 *
2907 * Logged from:
2908 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2909 */
2910message IsolatedUidChanged {
2911 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002912 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002913 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002914 optional int32 parent_uid = 1;
2915
2916 optional int32 isolated_uid = 2;
2917
2918 // We expect an isolated uid to be removed before if it's used for another parent uid.
2919 enum Event {
2920 REMOVED = 0;
2921 CREATED = 1;
2922 }
2923 optional Event event = 3;
2924}
2925
2926/*
2927 * Logs the reception of an incoming network packet causing the main system to wake up for
2928 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2929 * and processed by WakeupController.cpp.
2930 */
2931message PacketWakeupOccurred {
2932 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2933 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002934 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002935 // The interface name on which the packet was received.
2936 optional string iface = 2;
2937 // The ethertype value of the packet.
2938 optional int32 ethertype = 3;
2939 // String representation of the destination MAC address of the packet.
2940 optional string destination_hardware_address = 4;
2941 // String representation of the source address of the packet if this was an IP packet.
2942 optional string source_ip = 5;
2943 // String representation of the destination address of the packet if this was an IP packet.
2944 optional string destination_ip = 6;
2945 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2946 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2947 // families.
2948 optional int32 ip_next_header = 7;
2949 // The source port if this was a TCP or UDP packet.
2950 optional int32 source_port = 8;
2951 // The destination port if this was a TCP or UDP packet.
2952 optional int32 destination_port = 9;
2953}
2954
2955/*
2956 * Logs the memory stats for an app on startup.
2957 * Logged from:
2958 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2959 */
2960message AppStartMemoryStateCaptured {
2961 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002962 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002963
2964 // The process name.
2965 optional string process_name = 2;
2966
2967 // The activity name.
2968 optional string activity_name = 3;
2969
2970 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002971 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002972
2973 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002974 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002975
2976 // RSS
2977 optional int64 rss_in_bytes = 6;
2978
2979 // CACHE
2980 optional int64 cache_in_bytes = 7;
2981
2982 // SWAP
2983 optional int64 swap_in_bytes = 8;
2984}
2985
2986/*
2987 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2988 * for LMK event.
2989 * Logged from:
2990 * system/core/lmkd/lmkd.c
2991 */
2992message LmkStateChanged {
2993 enum State {
2994 UNKNOWN = 0;
2995 START = 1;
2996 STOP = 2;
2997 }
2998 optional State state = 1;
2999}
3000
3001/*
3002 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3003 * Logged from:
3004 * system/core/lmkd/lmkd.c
3005 */
3006message LmkKillOccurred {
3007 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003008 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003009
3010 // The process name.
3011 optional string process_name = 2;
3012
3013 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003014 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003015
3016 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003017 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003018
3019 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003020 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003021
3022 // RSS
3023 optional int64 rss_in_bytes = 6;
3024
3025 // CACHE
3026 optional int64 cache_in_bytes = 7;
3027
3028 // SWAP
3029 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003030
3031 // The elapsed real time of start of the process.
3032 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003033
3034 // Min oom adj score considered by lmkd.
3035 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003036}
3037
Rajeev Kumar51b54602018-03-01 12:18:26 -08003038/*
3039 * Logs when the ActivityManagerService detects that an app died.
3040 *
3041 * Logged from:
3042 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3043 */
3044message AppDied {
3045 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003046 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003047}
3048
Howard Ro21a039c2018-08-06 14:55:47 -07003049/**
3050 * An atom for generic metrics logging. Available from Android Q.
3051 */
3052message GenericAtom {
3053 // The uid of the application that sent this custom atom.
3054 optional int32 uid = 1 [(is_uid) = true];
3055
3056 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003057 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003058}
3059
Tej Singhd6d6d772018-09-05 17:41:25 -07003060/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003061 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003062 *
3063 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003064 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003065 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003066message BiometricAcquired {
3067 // Biometric modality that was acquired.
3068 optional android.hardware.biometrics.ModalityEnum modality = 1;
3069 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3070 optional int32 user = 2;
3071 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3072 optional bool is_crypto = 3;
3073 // Action that the device is performing. Acquired messages are only expected for enroll and
3074 // authenticate. Other actions may indicate an error.
3075 optional android.hardware.biometrics.ActionEnum action = 4;
3076 // The client that this acquisition was received for.
3077 optional android.hardware.biometrics.ClientEnum client = 5;
3078 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3079 optional int32 acquire_info = 6;
3080 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3081 optional int32 acquire_info_vendor = 7;
Tej Singhd6d6d772018-09-05 17:41:25 -07003082}
3083
3084/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003085 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003086 *
3087 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003088 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003089 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003090message BiometricAuthenticated {
3091 // Biometric modality that was used.
3092 optional android.hardware.biometrics.ModalityEnum modality = 1;
3093 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3094 optional int32 user = 2;
3095 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3096 // storage.
3097 optional bool is_crypto = 3;
3098 // The client that this acquisition was received for.
3099 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003100 // If authentication requires user confirmation. See BiometricPrompt's
3101 // setRequireConfirmation(bool) method.
3102 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003103
Kevin Chyn1741a072019-01-17 11:54:40 -08003104 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003105 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003106 REJECTED = 1;
3107 PENDING_CONFIRMATION = 2;
3108 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003109 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003110
3111 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003112 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003113 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3114 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3115 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3116 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003117 optional int64 latency_millis = 7;
Kevin Chyn1741a072019-01-17 11:54:40 -08003118}
3119
3120/**
3121 * Logs when a biometric error occurs.
3122 *
3123 * Logged from:
3124 * frameworks/base/services/core/java/com/android/server/biometrics
3125 */
3126message BiometricErrorOccurred {
3127 // Biometric modality that was used.
3128 optional android.hardware.biometrics.ModalityEnum modality = 1;
3129 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3130 optional int32 user = 2;
3131 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3132 optional bool is_crypto = 3;
3133 // Action that the device is performing.
3134 optional android.hardware.biometrics.ActionEnum action = 4;
3135 // The client that this acquisition was received for.
3136 optional android.hardware.biometrics.ClientEnum client = 5;
3137 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3138 // are unique to modality.
3139 optional int32 error_info = 6;
3140 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3141 // by the vendor and not specified by the HIDL interface.
3142 optional int32 error_info_vendor = 7;
3143}
3144
3145/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003146 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003147 * Logged from:
3148 * frameworks/base/services/core/java/com/android/server/biometrics
3149 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003150message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003151 // Biometric modality.
3152 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003153 // Type of issue detected.
3154 optional android.hardware.biometrics.IssueEnum issue = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07003155}
Howard Ro688ae182018-09-25 00:09:36 -07003156
3157message Notification {
3158
3159 // Type of notification event.
3160 enum Type {
3161 TYPE_UNKNOWN = 0;
3162 // Notification became visible to the user.
3163 TYPE_OPEN = 1;
3164 // Notification became hidden.
3165 TYPE_CLOSE = 2;
3166 // Notification switched to detail mode.
3167 TYPE_DETAIL = 3;
3168 // Notification was clicked.
3169 TYPE_ACTION = 4;
3170 // Notification was dismissed.
3171 TYPE_DISMISS = 5;
3172 // Notification switched to summary mode. The enum value of 14 is to
3173 // match that of metrics_constants.
3174 TYPE_COLLAPSE = 14;
3175 }
3176 optional Type type = 1;
3177
3178 // Package name associated with the notification.
3179 optional string package_name = 2;
3180
3181 // Tag associated with notification.
3182 optional string tag = 3;
3183
3184 // Application-supplied ID associated with the notification.
3185 optional int32 id = 4;
3186
3187 // Index of notification in the notification panel.
3188 optional int32 shade_index = 5;
3189
3190 // The number of notifications in the notification panel.
3191 optional int32 shade_count = 6;
3192
3193 // Importance for the notification.
3194 optional int32 importance = 7;
3195
3196 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07003197 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07003198
3199 // Importance for the notification channel.
3200 optional int32 channel_importance = 9;
3201
Howard Ro183c2bd2018-10-18 13:52:10 -07003202 // Application-supplied ID associated with the notifications group.
3203 optional string group_id = 10;
3204
Howard Ro688ae182018-09-25 00:09:36 -07003205 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07003206 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07003207
Howard Ro183c2bd2018-10-18 13:52:10 -07003208 // Reason for dismissal of a notification. This field is only meaningful for
3209 // TYPE_DISMISS events.
3210 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07003211
Howard Ro183c2bd2018-10-18 13:52:10 -07003212 // The first post time of notification, stable across updates.
3213 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07003214
Howard Ro183c2bd2018-10-18 13:52:10 -07003215 // The most recent interruption time, or the creation time if no updates.
3216 // Differs from update_millis because updates are filtered based on whether
3217 // they actually interrupted the user.
3218 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07003219
Howard Ro183c2bd2018-10-18 13:52:10 -07003220 // The most recent update time, or the creation time if no updates.
3221 optional int64 update_millis = 15;
3222
3223 // The most recent visibility event.
3224 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07003225}
3226
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003227/*
Tej Singh0d176952019-01-16 19:10:54 -08003228 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003229 */
Tej Singh0d176952019-01-16 19:10:54 -08003230message FlagFlipUpdateOccurred {
3231 // If the event is from a flag config package, specify the package name.
3232 optional string flag_flip_package_name = 1;
3233
3234 // The order id of the package
3235 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003236}
3237
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003238/**
3239 * Potential experiment ids that goes with a train install.
3240 */
3241message TrainExperimentIds {
3242 repeated int64 experiment_id = 1;
3243}
3244
Yangster-macb89807e2018-11-15 21:10:57 -08003245/*
3246 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003247 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003248 */
3249message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003250 // Name of the train.
3251 optional string train_name = 1;
3252 // Version code for a "train" of packages that need to be installed atomically
3253 optional int64 train_version_code = 2;
3254 // After installation of this package, device requires a restart.
3255 optional bool requires_staging = 3;
3256 // Rollback should be enabled for this install.
3257 optional bool rollback_enabled = 4;
3258 // Requires low latency monitoring if possible.
3259 optional bool requires_low_latency_monitor = 5;
3260
Yangster-macb89807e2018-11-15 21:10:57 -08003261 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003262 UNKNOWN = 0;
3263 INSTALL_REQUESTED = 1;
3264 INSTALL_STARTED = 2;
3265 INSTALL_STAGED_NOT_READY = 3;
3266 INSTALL_STAGED_READY = 4;
3267 INSTALL_SUCCESS = 5;
3268 INSTALL_FAILURE = 6;
3269 INSTALL_CANCELLED = 7;
3270 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003271 INSTALLER_ROLLBACK_INITIATED = 9;
3272 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3273 INSTALLER_ROLLBACK_STAGED = 11;
3274 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3275 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3276 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3277 INSTALLER_ROLLBACK_SUCCESS = 15;
3278 INSTALLER_ROLLBACK_FAILURE = 16;
3279 INSTALLER_ROLLBACK_CANCEL_STAGED_REMOVE_FROM_QUEUE = 17;
3280 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_INITIATED = 18;
3281 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_SUCCESS = 19;
3282 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_FAILURE = 20;
Howard Ro3a662af2019-03-29 18:16:54 -07003283 INSTALL_STAGED_CANCEL_REQUESTED = 21;
3284 INSTALL_STAGED_CANCEL_SUCCESS = 22;
3285 INSTALL_STAGED_CANCEL_FAILURE = 23;
Yangster-macb89807e2018-11-15 21:10:57 -08003286 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003287 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003288 // Possible experiment ids for monitoring this push.
3289 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3290 // user id
3291 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003292}
3293
Maggie Whitefc1aa592018-11-28 21:55:23 -08003294/** Represents USB port overheat event. */
3295message UsbPortOverheatEvent {
3296 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3297 optional int32 plug_temperature_deci_c = 1;
3298
3299 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3300 optional int32 max_temperature_deci_c = 2;
3301
3302 /* Time between USB plug event and overheat threshold trip, in seconds. */
3303 optional int32 time_to_overheat_secs = 3;
3304
3305 /* Time between overheat threshold trip and hysteresis, in seconds. */
3306 optional int32 time_to_hysteresis_secs = 4;
3307
3308 /* Time between hysteresis and active mitigation ending, in seconds. */
3309 optional int32 time_to_inactive_secs = 5;
3310};
3311
Maggie White8735b852019-01-18 11:40:49 -08003312/**
3313 * Logs total effective full charge and discharge cycles on a battery.
3314 * Here are some examples of one effective cycle:
3315 * 1) the battery charges from 0% to 100% and drains back to 0%,
3316 * 2) charging from 50% to 100% and draining back to 50% twice.
3317 * Pulled from:
3318 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3319 */
3320message BatteryCycleCount {
3321 /* Number of total charge and discharge cycles on the system battery. */
3322 optional int32 cycle_count = 1;
3323}
3324
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003325/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003326 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3327 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003328 * Pulled from:
3329 * StatsCompanionService
3330 */
3331
Carmen Agimof12dec122019-03-06 16:14:38 +00003332message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003333
Carmen Agimof12dec122019-03-06 16:14:38 +00003334 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003335 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003336 PUBLIC = 1;
3337 PRIVATE = 2;
3338 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003339 }
3340
Carmen Agimof12dec122019-03-06 16:14:38 +00003341 // The type of external storage.
3342 optional android.stats.storage.ExternalStorageType storage_type = 1;
3343 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3344 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003345 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003346 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003347}
3348
Yangster-macb89807e2018-11-15 21:10:57 -08003349/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003350 * Logs when a connection becomes available and lost.
3351 * Logged in StatsCompanionService.java
3352 */
3353message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003354 // Id of the network.
3355 optional int32 net_id = 1;
3356
3357 enum State {
3358 UNKNOWN = 0;
3359 CONNECTED = 1;
3360 DISCONNECTED = 2;
3361 }
3362 // Connected state of a network.
3363 optional State state = 2;
3364}
3365
3366/**
3367 * Logs when a service starts and stops.
3368 * Logged from:
3369 * services/core/java/com/android/server/am/ActiveServices.java
3370 */
3371message ServiceStateChanged {
3372
3373 optional int32 uid = 1 [(is_uid) = true];
3374
3375 optional string package_name = 2;
3376
3377 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003378
3379 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003380 START = 1;
3381 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003382 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003383
3384 optional State state = 4;
3385}
3386
3387/**
3388 * Logs when a service is launched.
3389 * Logged from:
3390 * services/core/java/com/android/server/am/ActiveServices.java
3391 */
3392message ServiceLaunchReported {
3393
3394 optional int32 uid = 1 [(is_uid) = true];
3395
3396 optional string package_name = 2;
3397
3398 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003399}
Howard Ro688ae182018-09-25 00:09:36 -07003400
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003401/**
3402 * Logs when a hidden API is used.
3403 *
3404 * Logged from:
3405 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3406 */
3407message HiddenApiUsed {
3408 // The uid of the app making the hidden access.
3409 optional int32 uid = 1 [(is_uid) = true];
3410
3411 // Signature of the method or field accessed.
3412 optional string signature = 2;
3413
3414 enum AccessMethod {
3415 NONE = 0;
3416 REFLECTION = 1;
3417 JNI = 2;
3418 LINKING = 3;
3419 }
3420
3421 // Type of access.
3422 optional AccessMethod access_method = 3;
3423
3424 // Whether the access was prevented or not.
3425 optional bool access_denied = 4;
3426}
3427
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003428/**
3429 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3430 * - When user sees privacy chip
3431 * - When user clicks privacy chip
3432 * - How does the user exit the Privacy Dialog
3433 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003434 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3435 */
3436message PrivacyIndicatorsInteracted {
3437
3438 enum Type {
3439 UNKNOWN = 0;
3440 CHIP_VIEWED = 1;
3441 CHIP_CLICKED = 2;
3442 DIALOG_PRIVACY_SETTINGS = 3;
3443 DIALOG_DISMISS = 4;
3444 DIALOG_LINE_ITEM = 5;
3445 }
3446
3447 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3448
3449 // Used if the type is LINE_ITEM
3450 optional string package_name = 2;
3451}
3452
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003453/**
3454 * Logs information about a package that is moved from the internal to external storage and vice
3455 * versa.
3456 * It logs the package name, the type of the external storage where the package is installed
3457 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3458 * and the move type: if it's from internal to external or the other way around.
3459 *
3460 * Logged from:
3461 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3462 */
3463message AppMovedStorageReported {
3464 enum MoveType {
3465 UNKNOWN = 0;
3466 TO_EXTERNAL = 1;
3467 TO_INTERNAL = 2;
3468 }
3469 // The type of the external storage.
3470 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3471 // The type of move.
3472 optional MoveType move_type = 2;
3473 // The name of the package that was moved.
3474 optional string package_name = 3;
3475}
3476
Chenjie Yubbcbc602018-02-05 16:51:52 -08003477//////////////////////////////////////////////////////////////////////
3478// Pulled atoms below this line //
3479//////////////////////////////////////////////////////////////////////
3480
3481/**
David Chenc8a43242017-10-17 16:23:28 -07003482 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3483 *
3484 * Pulled from:
3485 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3486 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003487message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003488 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003489
3490 optional int64 rx_bytes = 2;
3491
3492 optional int64 rx_packets = 3;
3493
3494 optional int64 tx_bytes = 4;
3495
3496 optional int64 tx_packets = 5;
3497}
3498
3499/**
3500 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3501 *
3502 * Pulled from:
3503 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3504 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003505message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003506 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003507
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003508 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3509 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003510
3511 optional int64 rx_bytes = 3;
3512
3513 optional int64 rx_packets = 4;
3514
3515 optional int64 tx_bytes = 5;
3516
3517 optional int64 tx_packets = 6;
3518}
3519
3520/**
3521 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3522 *
3523 * Pulled from:
3524 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3525 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003526message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003527 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003528
3529 optional int64 rx_bytes = 2;
3530
3531 optional int64 rx_packets = 3;
3532
3533 optional int64 tx_bytes = 4;
3534
3535 optional int64 tx_packets = 5;
3536}
3537
3538/**
3539 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3540 *
3541 * Pulled from:
3542 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3543 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003544message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003545 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003546
Yao Chenc40a19d2018-03-15 16:48:25 -07003547 // 1 denotes foreground and 0 denotes background. This is called Set in
3548 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003549 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003550
3551 optional int64 rx_bytes = 3;
3552
3553 optional int64 rx_packets = 4;
3554
3555 optional int64 tx_bytes = 5;
3556
3557 optional int64 tx_packets = 6;
3558}
3559
3560/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003561 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3562 *
3563 * Pulled from:
3564 * StatsCompanionService
3565 */
3566message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003567 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003568
3569 optional int64 rx_bytes = 2;
3570
3571 optional int64 tx_bytes = 3;
3572}
3573
3574/**
David Chenc8a43242017-10-17 16:23:28 -07003575 * Pulls the kernel wakelock durations. This atom is adapted from
3576 * android/internal/os/KernelWakelockStats.java
3577 *
3578 * Pulled from:
3579 * StatsCompanionService using KernelWakelockReader.
3580 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003581message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003582 optional string name = 1;
3583
3584 optional int32 count = 2;
3585
3586 optional int32 version = 3;
3587
Yangster-maca8a30442018-10-13 23:46:34 -07003588 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003589}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003590
Chenjie Yu05013b32017-11-21 10:21:41 -08003591/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003592 * Pulls low power state information. If power.stats HAL is not available, this
3593 * includes platform and subsystem sleep state information,
3594 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3595 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003596 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003597 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003598 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3599 * as defined in:
3600 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003601 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003602message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003603 // Subsystem name
3604 optional string subsystem_name = 1;
3605 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3606 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003607 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3608 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003609 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003610 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003611 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003612 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003613 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003614}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003615
Chenjie Yu05013b32017-11-21 10:21:41 -08003616/**
Bookatz92da2832018-11-01 18:10:03 -07003617 * Pulls on-device power measurement information.
3618 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3619 * Pulled from:
3620 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3621 */
3622message OnDevicePowerMeasurement {
3623 // Name of the subsystem (to which the rail belongs).
3624 optional string subsystem_name = 1;
3625
3626 // Rail name. The rail lies within the subsystem.
3627 optional string rail_name = 2;
3628
3629 // Time (in ms since boot) at which the rail energy value was measured.
3630 // This may differ slightly from the time that statsd logs this information.
3631 optional uint64 measurement_timestamp_millis = 3;
3632
3633 // Accumulated energy used via the rail since device boot in uWs.
3634 optional uint64 energy_microwatt_secs = 4;
3635}
3636
3637/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003638 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003639 * Pulls the time the cpu spend on the frequency index. Frequency index
3640 * starts from highest to lowest. The value should be monotonically
3641 * increasing since boot. However, if there is a cpu
3642 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003643 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003644message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003645 optional uint32 cluster = 1;
3646 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003647 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003648}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003649
Chenjie Yu05013b32017-11-21 10:21:41 -08003650/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003651 * Pulls Cpu Time Per Uid.
3652 * Note that isolated process uid time should be attributed to host uids.
3653 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003654message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003655 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003656 optional uint64 user_time_micros = 2;
3657 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003658}
3659
3660/**
3661 * Pulls Cpu Time Per Uid per frequency.
3662 * Note that isolated process uid time should be attributed to host uids.
3663 * For each uid, we order the time by descending frequencies.
3664 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003665message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003666 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003667 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003668 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003669}
Hugo Benichi884970e2017-11-14 22:42:46 +09003670
Chenjie Yu05013b32017-11-21 10:21:41 -08003671/**
3672 * Pulls Wifi Controller Activity Energy Info
3673 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003674message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003675 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003676 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003677 // stack reported state
3678 // TODO: replace this with proto enum
3679 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003680 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003681 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003682 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003683 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003684 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003685 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003686 // product of current(mA), voltage(V) and time(ms)
3687 optional uint64 controller_energy_used = 6;
3688}
3689
3690/**
3691 * Pulls Modem Activity Energy Info
3692 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003693message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003694 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003695 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003696 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003697 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003698 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003699 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003700 /**
3701 * Tx power index
3702 * index 0 = tx_power < 0dBm
3703 * index 1 = 0dBm < tx_power < 5dBm
3704 * index 2 = 5dBm < tx_power < 15dBm
3705 * index 3 = 15dBm < tx_power < 20dBm
3706 * index 4 = tx_power > 20dBm
3707 */
3708 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003709 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003710 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003711 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003712 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003713 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003714 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003715 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003716 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003717 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003718 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003719 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003720 // product of current(mA), voltage(V) and time(ms)
3721 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003722}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003723
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003724/**
3725 * Pulls Bluetooth Activity Energy Info
3726 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3727 */
3728message BluetoothActivityInfo {
3729 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003730 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003731 // bluetooth stack state
3732 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003733 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003734 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003735 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003736 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003737 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003738 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003739 // product of current(mA), voltage(V) and time(ms)
3740 optional uint64 energy_used = 6;
3741}
3742
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003743/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003744 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003745 *
3746 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003747 */
3748message ProcessMemoryState {
3749 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003750 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003751
3752 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003753 // Usually package name, "system" for system server.
3754 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003755 optional string process_name = 2;
3756
Rafal Slawikda51b932018-12-13 16:31:33 +00003757 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003758 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003759
3760 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003761 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003762
3763 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003764 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003765
Rajeev Kumar90235992018-01-29 11:06:48 -08003766 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003767 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3768 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003769 optional int64 rss_in_bytes = 6;
3770
3771 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003772 // Value is read from memory.stat, field total_cache if per-app memory
3773 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003774 optional int64 cache_in_bytes = 7;
3775
3776 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003777 // Value is read from memory.stat, field total_swap if per-app memory
3778 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003779 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003780
Rafal Slawikd03ae422018-11-20 11:27:45 +00003781 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003782 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003783
3784 // Elapsed real time when the process started.
3785 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3786 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003787}
3788
3789/*
Rafal Slawik08621582018-10-15 14:53:07 +01003790 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003791 *
3792 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003793 */
3794message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003795 // The uid if available. -1 means not available.
3796 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003797
Rafal Slawikbf67d072018-10-23 11:07:54 +01003798 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003799 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003800 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003801
Rafal Slawikbf67d072018-10-23 11:07:54 +01003802 // # of page-faults
3803 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003804
Rafal Slawikbf67d072018-10-23 11:07:54 +01003805 // # of major page-faults
3806 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003807
Rafal Slawikbf67d072018-10-23 11:07:54 +01003808 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003809 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003810 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003811
Rafal Slawikd03ae422018-11-20 11:27:45 +00003812 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003813 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003814
3815 // Elapsed real time when the process started.
3816 // Value is read from /proc/PID/stat, field 22.
3817 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01003818}
3819
3820/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003821 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003822 *
3823 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3824 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003825 *
3826 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003827 */
3828message ProcessMemoryHighWaterMark {
3829 // The uid if available. -1 means not available.
3830 optional int32 uid = 1 [(is_uid) = true];
3831
Rafal Slawikda51b932018-12-13 16:31:33 +00003832 // The process name.
3833 // Usually package name or process cmdline.
3834 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003835 optional string process_name = 2;
3836
3837 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3838 // /proc/PID/status.
3839 optional int64 rss_high_water_mark_in_bytes = 3;
3840}
3841
3842/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003843 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003844 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003845message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003846 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003847}
3848
3849/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003850 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003851 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003852message SystemUptime {
3853 // Milliseconds since the system was booted.
3854 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3855 // for external input).
3856 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003857 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003858}
3859
3860/*
3861 * Reads from /proc/uid_concurrent_active_time which has the format:
3862 * active: X (X is # cores)
3863 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3864 * [uid1]: [time-0] [time-1] [time-2] ... ...
3865 * ...
3866 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3867 * The file contains a monotonically increasing count of time for a single boot.
3868 */
3869message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003870 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003871 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003872}
3873
3874/**
3875 * Reads from /proc/uid_concurrent_policy_time which has the format:
3876 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3877 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3878 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3879 * ...
3880 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3881 * The file contains a monotonically increasing count of time for a single boot.
3882 */
3883message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003884 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003885 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003886 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003887}
3888
3889/*
3890 * Pulls free disk space, for data, system partition and temporary directory.
3891 */
3892message DiskSpace {
3893 // available bytes in data partition
3894 optional uint64 data_available_bytes = 1;
3895 // available bytes in system partition
3896 optional uint64 system_available_bytes = 2;
3897 // available bytes in download cache or temp directories
3898 optional uint64 temp_available_bytes = 3;
3899}
Tej Singhbf972d92018-01-10 20:51:13 -08003900
3901/**
3902 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003903 *
3904 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003905 */
3906message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003907 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003908}
3909
3910/**
3911 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003912 * Pulled from:
3913 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003914 */
3915message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003916 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003917}
3918
3919/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003920 * Pulls battery voltage.
3921 * Pulled from:
3922 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3923 */
3924message BatteryVoltage {
3925 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003926 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003927}
3928
3929/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003930 * Pulls battery level (percent full, from 0 to 100).
3931 *
3932 * Pulled from:
3933 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3934 */
3935message BatteryLevel {
3936 // Battery level. Should be in [0, 100].
3937 optional int32 battery_level = 1;
3938}
3939
3940/**
Tej Singhd89137e2018-03-26 14:51:40 -07003941 * Pulls the temperature of various parts of the device.
3942 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003943 *
3944 * Pulled from:
3945 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3946 */
3947message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003948 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003949 optional android.os.TemperatureTypeEnum sensor_location = 1;
3950
3951 // The name of the temperature source. Eg. CPU0
3952 optional string sensor_name = 2;
3953
Tej Singhd89137e2018-03-26 14:51:40 -07003954 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003955 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003956 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003957}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003958
3959/**
3960 * Pulls the statistics of calls to Binder.
3961 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003962 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3963 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003964 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003965 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003966 */
3967message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003968 // UID of the process responsible for the binder transaction. It will be set if the process
3969 // executing the binder transaction attribute the transaction to another uid using
3970 // Binder.setThreadWorkSource().
3971 //
3972 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003973 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003974 // UID of the process executing the binder transaction.
3975 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003976 // Fully qualified class name of the API call.
3977 //
3978 // This is a system server class name.
3979 //
3980 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3981 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3982 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3983 // commonly used APIs.
3984 optional string service_class_name = 2;
3985 // Method name of the API call. It can also be a transaction code if we cannot
3986 // resolve it to a name. See Binder#getTransactionName.
3987 //
3988 // This is a system server method name.
3989 optional string service_method_name = 3;
3990 // Total number of API calls.
3991 optional int64 call_count = 4;
3992 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3993 optional bool screen_interactive = 13;
3994 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3995 // call_count will be equal to recorded_call_count.
3996 //
3997 // If recorded_call_count is different than call_count, it means data collection has been
3998 // sampled. All the fields below will be sampled in this case.
3999 optional int64 recorded_call_count = 12;
4000 // Number of exceptions thrown by the API.
4001 optional int64 recorded_exception_count = 5;
4002 // Total latency of all API calls.
4003 // Average can be computed using total_latency_micros / recorded_call_count.
4004 optional int64 recorded_total_latency_micros = 6;
4005 // Maximum latency of one API call.
4006 optional int64 recorded_max_latency_micros = 7;
4007 // Total CPU usage of all API calls.
4008 // Average can be computed using total_cpu_micros / recorded_call_count.
4009 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4010 optional int64 recorded_total_cpu_micros = 8;
4011 // Maximum CPU usage of one API call.
4012 optional int64 recorded_max_cpu_micros = 9;
4013 // Maximum parcel reply size of one API call.
4014 optional int64 recorded_max_reply_size_bytes = 10;
4015 // Maximum parcel request size of one API call.
4016 optional int64 recorded_max_request_size_bytes = 11;
4017}
4018
4019/**
4020 * Pulls the statistics of exceptions during calls to Binder.
4021 *
4022 * Binder stats are cumulative from boot unless somebody reset the data using
4023 * > adb shell dumpsys binder_calls_stats --reset
4024 */
4025message BinderCallsExceptions {
4026 // Exception class name, e.g. java.lang.IllegalArgumentException.
4027 //
4028 // This is an exception class name thrown by the system server.
4029 optional string exception_class_name = 1;
4030 // Total number of exceptions.
4031 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004032}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004033
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004034/**
4035 * Pulls the statistics of message dispatching on HandlerThreads.
4036 *
4037 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4038 * config on the device.
4039 *
4040 * Next tag: 11
4041 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004042message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004043 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004044 optional int32 uid = 1 [(is_uid) = true];
4045
4046 // Fully qualified class name of the handler target class.
4047 //
4048 // This field does not contain PII. This is a system server class name.
4049 optional string handler_class_name = 2;
4050
4051 // The name of the thread that runs the Looper.
4052 //
4053 // This field does not contain PII. This is a system server thread name.
4054 optional string looper_thread_name = 3;
4055
4056 // The name of the dispatched message.
4057 //
4058 // This field does not contain PII. This is a system server constant or class
4059 // name.
4060 optional string message_name = 4;
4061
4062 // Total number of successfully dispatched messages.
4063 optional int64 message_count = 5;
4064
4065 // Total number of messages that failed dispatching.
4066 optional int64 exception_count = 6;
4067
4068 // Total number of processed messages we have data recorded for. If we
4069 // collected data for all the messages, message_count will be equal to
4070 // recorded_message_count.
4071 //
4072 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004073 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004074 optional int64 recorded_message_count = 7;
4075
4076 // Total latency of all processed messages.
4077 // Average can be computed using recorded_total_latency_micros /
4078 // recorded_message_count.
4079 optional int64 recorded_total_latency_micros = 8;
4080
4081 // Total CPU usage of all processed message.
4082 // Average can be computed using recorded_total_cpu_micros /
4083 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004084 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004085 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004086
4087 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4088 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004089
4090 // Max recorded CPU usage of all processed messages.
4091 optional int64 recorded_max_cpu_micros = 11;
4092
4093 // Max recorded latency of all processed messages.
4094 optional int64 recorded_max_latency_micros = 12;
4095
4096 // Total number of messages we tracked the dispatching delay for. If we
4097 // collected data for all the messages, message_count will be equal to
4098 // recorded_delay_message_count.
4099 //
4100 // If recorded_delay_message_count is different than message_count, it means data
4101 // collection has been sampled or/and not all messages specified the target dispatch time.
4102 // The fields below will be sampled in this case.
4103 optional int64 recorded_delay_message_count = 13;
4104
4105 // Total dispatching delay of all processed messages.
4106 // Calculated as a difference between the target dispatching time (Message.when)
4107 // and the actual dispatching time.
4108 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4109 optional int64 recorded_total_delay_millis = 14;
4110
4111 // Max dispatching delay of all processed messages.
4112 // Calculated as a difference between the target dispatching time (Message.when)
4113 // and the actual dispatching time.
4114 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004115}
Tej Singh86dc9db2018-09-06 00:39:57 +00004116
4117/**
4118 * Pulls disk information, such as write speed and latency.
4119 */
4120message DiskStats {
4121 // Time taken to open, write 512B to, and close a file.
4122 // -1 if error performing the check.
4123 optional int64 data_write_latency_millis = 1;
4124
4125 optional bool file_based_encryption = 2;
4126
4127 // Recent disk write speed in kB/s.
4128 // -1 if error querying storageed.
4129 // 0 if data is unavailable.
4130 optional int32 recent_disk_write_speed = 3;
4131}
4132
4133
4134/**
4135 * Free and total bytes of the Data, Cache, and System partition.
4136 */
4137message DirectoryUsage {
4138 enum Directory {
4139 UNKNOWN = 0;
4140 DATA = 1;
4141 CACHE = 2;
4142 SYSTEM = 3;
4143 }
4144 optional Directory directory = 1;
4145 optional int64 free_bytes = 2;
4146 optional int64 total_bytes = 3;
4147}
4148
4149
4150/**
4151 * Size of an application: apk size, data size, and cache size.
4152 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4153 * Information is only reported for apps with the primary user (user 0).
4154 * Sizes are aggregated by package name.
4155 */
4156message AppSize {
4157 // Including uids will involve modifying diskstats logic.
4158 optional string package_name = 1;
4159 // App size in bytes. -1 if unavailable.
4160 optional int64 app_size_bytes = 2;
4161 // App data size in bytes. -1 if unavailable.
4162 optional int64 app_data_size_bytes = 3;
4163 // App cache size in bytes. -1 if unavailable.
4164 optional int64 app_cache_size_bytes = 4;
4165 // Time that the cache file was produced.
4166 // Uses System.currentTimeMillis(), which is wall clock time.
4167 optional int64 cache_time_millis = 5;
4168}
4169
4170
4171/**
4172 * Size of a particular category. Eg: photos, videos.
4173 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4174 */
4175message CategorySize {
4176 enum Category {
4177 UNKNOWN = 0;
4178 APP_SIZE = 1;
4179 APP_DATA_SIZE = 2;
4180 APP_CACHE_SIZE = 3;
4181 PHOTOS = 4;
4182 VIDEOS = 5;
4183 AUDIO = 6;
4184 DOWNLOADS = 7;
4185 SYSTEM = 8;
4186 OTHER = 9;
4187 }
4188 optional Category category = 1;
4189 // Category size in bytes.
4190 optional int64 size_bytes = 2;
4191 // Time that the cache file was produced.
4192 // Uses System.currentTimeMillis(), which is wall clock time.
4193 optional int64 cache_time_millis = 3;
4194}
Tej Singhd6d6d772018-09-05 17:41:25 -07004195
4196/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004197 * Pulls per uid I/O stats. The stats are cumulative since boot.
4198 *
4199 * Read/write bytes are I/O events from a storage device
4200 * Read/write chars are data requested by read/write syscalls, and can be
4201 * satisfied by caching.
4202 *
4203 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4204 */
4205message DiskIo {
4206 optional int32 uid = 1 [(is_uid) = true];
4207 optional int64 fg_chars_read = 2;
4208 optional int64 fg_chars_write = 3;
4209 optional int64 fg_bytes_read = 4;
4210 optional int64 fg_bytes_write = 5;
4211 optional int64 bg_chars_read = 6;
4212 optional int64 bg_chars_write = 7;
4213 optional int64 bg_bytes_read = 8;
4214 optional int64 bg_bytes_write = 9;
4215 optional int64 fg_fsync = 10;
4216 optional int64 bg_fsync= 11;
4217}
4218
4219
4220/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004221 * Pulls the number of fingerprints for each user.
4222 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004223 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004224 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004225message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004226 // The associated user. Eg: 0 for owners, 10+ for others.
4227 // Defined in android/os/UserHandle.java
4228 optional int32 user = 1;
4229 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004230 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004231}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004232
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004233/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004234 * Pulls the number of faces for each user.
4235 *
4236 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4237 */
4238message NumFacesEnrolled {
4239 // The associated user. Eg: 0 for owners, 10+ for others.
4240 // Defined in android/os/UserHandle.java
4241 optional int32 user = 1;
4242 // Number of faces registered to that user.
4243 optional int32 num_faces_enrolled = 2;
4244}
4245/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004246 * A mapping of role holder -> role
4247 */
4248message RoleHolder {
4249 // uid of the role holder
4250 optional int32 uid = 1 [(is_uid) = true];
4251
4252 // package name of the role holder
4253 optional string package_name = 2;
4254
4255 // the role held
4256 optional string role = 3;
4257}
4258
Yangsteraf9aee72018-10-12 09:26:16 -07004259message AggStats {
4260 optional int64 min = 1;
4261
4262 optional int64 average = 2;
4263
4264 optional int64 max = 3;
4265}
4266
4267message ProcessStatsStateProto {
4268 optional android.service.procstats.ScreenState screen_state = 1;
4269
4270 optional android.service.procstats.MemoryState memory_state = 2;
4271
4272 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4273 // and not frameworks/base/core/java/android/app/ActivityManager.java
4274 optional android.service.procstats.ProcessState process_state = 3;
4275
4276 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004277 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004278
4279 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004280 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004281
4282 // # of samples taken
4283 optional int32 sample_size = 5;
4284
4285 // PSS is memory reserved for this process
4286 optional AggStats pss = 6;
4287
4288 // USS is memory shared between processes, divided evenly for accounting
4289 optional AggStats uss = 7;
4290
4291 // RSS is memory resident for this process
4292 optional AggStats rss = 8;
4293}
4294
4295// Next Tag: 7
4296message ProcessStatsProto {
4297 // Name of process.
4298 optional string process = 1;
4299
4300 // Uid of the process.
4301 optional int32 uid = 2;
4302
4303 // Information about how often kills occurred
4304 message Kill {
4305 // Count of excessive CPU kills
4306 optional int32 cpu = 1;
4307
4308 // Count of kills when cached
4309 optional int32 cached = 2;
4310
4311 // PSS stats during cached kill
4312 optional AggStats cached_pss = 3;
4313 }
4314 optional Kill kill = 3;
4315
4316 // Time and memory spent in various states.
4317 repeated ProcessStatsStateProto states = 5;
4318
4319 // Total time process has been running... screen_state, memory_state, and process_state
4320 // will not be set.
4321 optional ProcessStatsStateProto total_running_state = 6;
4322}
4323
4324message PackageServiceOperationStatsProto {
4325 // Operate enum: Started, Foreground, Bound, Executing
4326 optional android.service.procstats.ServiceOperationState operation = 1;
4327
4328 // Number of times the service was in this operation.
4329 optional int32 count = 2;
4330
4331 // Information about a state the service can be in.
4332 message StateStats {
4333 // Screen state enum.
4334 optional android.service.procstats.ScreenState screen_state = 1;
4335 // Memory state enum.
4336 optional android.service.procstats.MemoryState memory_state = 2;
4337
4338 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004339 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004340 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004341 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004342 }
4343 repeated StateStats state_stats = 3;
4344}
4345
4346message PackageServiceStatsProto {
4347 // Name of service component.
4348 optional string service_name = 1;
4349
4350 // The operation stats.
4351 // The package_name, package_uid, package_version, service_name will not be set to save space.
4352 repeated PackageServiceOperationStatsProto operation_stats = 2;
4353}
4354
4355message PackageAssociationSourceProcessStatsProto {
4356 // Uid of the process.
4357 optional int32 process_uid = 1;
4358 // Process name.
4359 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004360 // Package name.
4361 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004362 // Total count of the times this association appeared.
4363 optional int32 total_count = 3;
4364
4365 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004366 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004367
4368 // Total count of the times this association became actively impacting its target process.
4369 optional int32 active_count = 5;
4370
4371 // Information on one source in this association.
4372 message StateStats {
4373 // Process state enum.
4374 optional android.service.procstats.ProcessState process_state = 1;
4375 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004376 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004377 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004378 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004379 }
4380 repeated StateStats active_state_stats = 6;
4381}
4382
4383message PackageAssociationProcessStatsProto {
4384 // Name of the target component.
4385 optional string component_name = 1;
4386 // Information on one source in this association.
4387 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4388}
4389
4390
4391message ProcessStatsPackageProto {
4392 // Name of package.
4393 optional string package = 1;
4394
4395 // Uid of the package.
4396 optional int32 uid = 2;
4397
4398 // Version of the package.
4399 optional int64 version = 3;
4400
4401 // Stats for each process running with the package loaded in to it.
4402 repeated ProcessStatsProto process_stats = 4;
4403
4404 // Stats for each of the package's services.
4405 repeated PackageServiceStatsProto service_stats = 5;
4406
4407 // Stats for each association with the package.
4408 repeated PackageAssociationProcessStatsProto association_stats = 6;
4409}
4410
4411message ProcessStatsSectionProto {
4412 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004413 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004414
4415 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004416 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004417
4418 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004419 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004420
4421 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004422 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004423
4424 // System runtime library. e.g. "libdvm.so", "libart.so".
4425 optional string runtime = 5;
4426
4427 // whether kernel reports swapped pss.
4428 optional bool has_swapped_pss = 6;
4429
4430 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4431 enum Status {
4432 STATUS_UNKNOWN = 0;
4433 STATUS_COMPLETE = 1;
4434 STATUS_PARTIAL = 2;
4435 STATUS_SHUTDOWN = 3;
4436 STATUS_SYSPROPS = 4;
4437 }
4438 repeated Status status = 7;
4439
Chenjie Yub2ecc792019-01-17 10:27:26 -08004440 // Number of pages available of various types and sizes, representation fragmentation.
4441 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4442
Yangsteraf9aee72018-10-12 09:26:16 -07004443 // Stats for each process.
4444 repeated ProcessStatsProto process_stats = 8;
4445
4446 // Stats for each package.
4447 repeated ProcessStatsPackageProto package_stats = 9;
4448}
4449
Chenjie Yub2ecc792019-01-17 10:27:26 -08004450message ProcessStatsAvailablePagesProto {
4451 // Node these pages are in (as per /proc/pagetypeinfo)
4452 optional int32 node = 1;
4453
4454 // Zone these pages are in (as per /proc/pagetypeinfo)
4455 optional string zone = 2;
4456
4457 // Label for the type of these pages (as per /proc/pagetypeinfo)
4458 optional string label = 3;
4459
4460 // Distribution of number of pages available by order size. First entry in array is
4461 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4462 repeated int32 pages_per_order = 4;
4463}
4464
Chenjie Yu12e5e672018-09-14 15:54:59 -07004465/**
4466 * Pulled from ProcessStatsService.java
4467 */
4468message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004469 optional ProcessStatsSectionProto proc_stats_section = 1;
4470}
4471
Chenjie Yuf910b7802019-01-11 16:08:20 -08004472/**
4473 * Pulled from ProcessStatsService.java
4474 */
4475message ProcStatsPkgProc {
4476 optional ProcessStatsSectionProto proc_stats_section = 1;
4477}
4478
Yangsteraf9aee72018-10-12 09:26:16 -07004479message PowerProfileProto {
4480 optional double cpu_suspend = 1;
4481
4482 optional double cpu_idle = 2;
4483
4484 optional double cpu_active = 3;
4485
4486 message CpuCluster {
4487 optional int32 id = 1;
4488 optional double cluster_power = 2;
4489 optional int32 cores = 3;
4490 repeated int64 speed = 4;
4491 repeated double core_power = 5;
4492 }
4493
4494 repeated CpuCluster cpu_cluster = 40;
4495
4496 optional double wifi_scan = 4;
4497
4498 optional double wifi_on = 5;
4499
4500 optional double wifi_active = 6;
4501
4502 optional double wifi_controller_idle = 7;
4503
4504 optional double wifi_controller_rx = 8;
4505
4506 optional double wifi_controller_tx = 9;
4507
4508 repeated double wifi_controller_tx_levels = 10;
4509
4510 optional double wifi_controller_operating_voltage = 11;
4511
4512 optional double bluetooth_controller_idle = 12;
4513
4514 optional double bluetooth_controller_rx = 13;
4515
4516 optional double bluetooth_controller_tx = 14;
4517
4518 optional double bluetooth_controller_operating_voltage = 15;
4519
4520 optional double modem_controller_sleep = 16;
4521
4522 optional double modem_controller_idle = 17;
4523
4524 optional double modem_controller_rx = 18;
4525
4526 repeated double modem_controller_tx = 19;
4527
4528 optional double modem_controller_operating_voltage = 20;
4529
4530 optional double gps_on = 21;
4531
4532 repeated double gps_signal_quality_based = 22;
4533
4534 optional double gps_operating_voltage = 23;
4535
4536 optional double bluetooth_on = 24;
4537
4538 optional double bluetooth_active = 25;
4539
4540 optional double bluetooth_at_cmd = 26;
4541
4542 optional double ambient_display = 27;
4543
4544 optional double screen_on = 28;
4545
4546 optional double radio_on = 29;
4547
4548 optional double radio_scanning = 30;
4549
4550 optional double radio_active = 31;
4551
4552 optional double screen_full = 32;
4553
4554 optional double audio = 33;
4555
4556 optional double video = 34;
4557
4558 optional double flashlight = 35;
4559
4560 optional double memory = 36;
4561
4562 optional double camera = 37;
4563
4564 optional double wifi_batched_scan = 38;
4565
4566 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004567}
Chenjie Yuab530202018-09-26 12:39:20 -07004568
4569/**
4570 * power_profile.xml and other constants for power model calculations.
4571 * Pulled from PowerProfile.java
4572 */
4573message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004574 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004575}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004576
4577/**
arangelovd5db50e2018-10-12 20:24:39 +01004578 * Logs when a user restriction was added or removed.
4579 *
4580 * Logged from:
4581 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4582 */
4583message UserRestrictionChanged {
4584 // The raw string of the user restriction as defined in UserManager.
4585 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4586 optional string restriction = 1;
4587 // Whether the restriction is enabled or disabled.
4588 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004589}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004590
4591/**
4592 * Pulls process user time and system time. Puller takes a snapshot of all pids
4593 * in the system and returns cpu stats for those that are working at the time.
4594 * Dead pids will be dropped. Kernel processes are excluded.
4595 * Min cool-down is 5 sec.
4596 */
4597message ProcessCpuTime {
4598 optional int32 uid = 1 [(is_uid) = true];
4599
4600 optional string process_name = 2;
4601 // Process cpu time in user space, cumulative from boot/process start
4602 optional int64 user_time_millis = 3;
4603 // Process cpu time in system space, cumulative from boot/process start
4604 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004605}
Misha Wagner5a51e002018-10-03 15:04:09 +01004606
4607/**
4608 * Pulls the CPU usage for each thread.
4609 *
4610 * Read from /proc/$PID/task/$TID/time_in_state files.
4611 *
4612 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4613 * time_in_state files not being present on some phones, have not been addressed. These should be
4614 * considered before a public release.
4615 */
4616message CpuTimePerThreadFreq {
4617 // UID that owns the process.
4618 optional int32 uid = 1 [(is_uid) = true];
4619 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004620 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004621 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004622 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004623 // Name of the process taken from `/proc/$PID/cmdline`.
4624 optional string process_name = 4;
4625 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4626 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004627
4628 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4629 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4630 // frequencies are given here as the alternative is sending eight separate atoms. This method
4631 // significantly reduces the amount of data created
4632 optional int32 frequency1_khz = 6;
4633 optional int32 time1_millis = 7;
4634 optional int32 frequency2_khz = 8;
4635 optional int32 time2_millis = 9;
4636 optional int32 frequency3_khz = 10;
4637 optional int32 time3_millis = 11;
4638 optional int32 frequency4_khz = 12;
4639 optional int32 time4_millis = 13;
4640 optional int32 frequency5_khz = 14;
4641 optional int32 time5_millis = 15;
4642 optional int32 frequency6_khz = 16;
4643 optional int32 time6_millis = 17;
4644 optional int32 frequency7_khz = 18;
4645 optional int32 time7_millis = 19;
4646 optional int32 frequency8_khz = 20;
4647 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004648}
Bookatz75ee60422018-11-09 12:27:37 -08004649
4650/**
Bookatz366a4432018-11-20 09:42:33 -08004651 * Pulls information about the device's build.
4652 */
4653message BuildInformation {
4654 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4655 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4656 optional string fingerprint = 1;
4657
4658 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4659 optional string brand = 2;
4660
4661 // Build.PRODUCT. The name of the overall product.
4662 optional string product = 3;
4663
4664 // Build.DEVICE. The name of the industrial design.
4665 optional string device = 4;
4666
4667 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4668 optional string version_release = 5;
4669
4670 // Build.ID. E.g. a label like "M4-rc20".
4671 optional string id = 6;
4672
4673 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4674 // represent this build.
4675 optional string version_incremental = 7;
4676
4677 // Build.TYPE. The type of build, like "user" or "eng".
4678 optional string type = 8;
4679
4680 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4681 optional string tags = 9;
4682}
4683
4684/**
Bookatz75ee60422018-11-09 12:27:37 -08004685 * Pulls on-device BatteryStats power use calculations for the overall device.
4686 */
4687message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004688 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4689 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4690 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4691 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08004692}
4693
4694/**
4695 * Pulls on-device BatteryStats power use calculations broken down by uid.
4696 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4697 * that is attributed to non-uid items. They must all be included to get the total power use.
4698 */
4699message DeviceCalculatedPowerBlameUid {
4700 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4701 optional int32 uid = 1 [(is_uid) = true];
4702
Bookatz3dbc13a2018-12-21 12:16:51 -08004703 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4704 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4705 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08004706}
4707
4708/**
4709 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4710 * drain type.
4711 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4712 * is attributed uids. They must all be included to get the total power use.
4713 */
4714message DeviceCalculatedPowerBlameOther {
4715 // The type of item whose power use is being reported.
4716 enum DrainType {
4717 AMBIENT_DISPLAY = 0;
4718 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4719 BLUETOOTH = 2;
4720 CAMERA = 3;
4721 // Cell-standby
4722 CELL = 4;
4723 FLASHLIGHT = 5;
4724 IDLE = 6;
4725 MEMORY = 7;
4726 // Amount that total computed drain exceeded the drain estimated using the
4727 // battery level changes and capacity.
4728 OVERCOUNTED = 8;
4729 PHONE = 9;
4730 SCREEN = 10;
4731 // Amount that total computed drain was below the drain estimated using the
4732 // battery level changes and capacity.
4733 UNACCOUNTED = 11;
4734 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4735 WIFI = 13;
4736 }
4737 optional DrainType drain_type = 1;
4738
Bookatz3dbc13a2018-12-21 12:16:51 -08004739 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4740 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4741 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004742}
arangelov4e994062018-11-13 16:12:38 +00004743
4744/**
4745 * Logs device policy features.
4746 *
4747 * Logged from:
4748 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4749 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4750 */
4751message DevicePolicyEvent {
4752 // The event id - unique for each event.
4753 optional android.stats.devicepolicy.EventId event_id = 1;
4754 // The admin package name.
4755 optional string admin_package_name = 2;
4756 // A generic integer parameter.
4757 optional int32 integer_value = 3;
4758 // A generic boolean parameter.
4759 optional bool boolean_value = 4;
4760 // A parameter specifying a time period in milliseconds.
4761 optional uint64 time_period_millis = 5;
4762 // A parameter specifying a list of package names, bundle extras or string parameters.
4763 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4764}
shawnlinea5b66b2018-11-13 15:05:29 +08004765
4766/**
4767 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4768 *
4769 * Logged from:
4770 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4771 */
4772message DocsUILaunchReported {
4773 optional android.stats.docsui.LaunchAction launch_action = 1;
4774 optional bool has_initial_uri = 2;
4775 optional android.stats.docsui.MimeType mime_type = 3;
4776 optional android.stats.docsui.Root initial_root = 4;
4777}
4778
4779/**
4780 * Logs root/app visited event in file managers/picker. Call this when the user
4781 * taps on root/app in hamburger menu.
4782 *
4783 * Logged from:
4784 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4785 */
4786message DocsUIRootVisitedReported {
4787 optional android.stats.docsui.ContextScope scope = 1;
4788 optional android.stats.docsui.Root root = 2;
4789}
4790
4791/**
4792 * Logs file operation stats. Call this when a file operation has completed.
4793 *
4794 * Logged from:
4795 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4796 */
4797message DocsUIFileOperationReported {
4798 optional android.stats.docsui.Provider provider = 1;
4799 optional android.stats.docsui.FileOperation file_op = 2;
4800}
4801
4802/**
4803 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4804 * mode.
4805 *
4806 * Logged from:
4807 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4808 */
4809message DocsUIFileOperationCopyMoveModeReported {
4810 optional android.stats.docsui.FileOperation file_op = 1;
4811 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4812}
4813
4814
4815/**
4816 * Logs file sub operation stats. Call this when a file operation has failed.
4817 *
4818 * Logged from:
4819 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4820 */
4821message DocsUIFileOperationFailureReported {
4822 optional android.stats.docsui.Authority authority = 1;
4823 optional android.stats.docsui.SubFileOperation sub_op = 2;
4824}
4825
4826/**
4827* Logs the cancellation of a file operation. Call this when a job is canceled
4828*
4829* Logged from:
4830* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4831*/
4832message DocsUIFileOperationCanceledReported {
4833 optional android.stats.docsui.FileOperation file_op = 1;
4834}
4835
4836/**
4837 * Logs startup time in milliseconds.
4838 *
4839 * Logged from:
4840 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4841 */
4842message DocsUIStartupMsReported {
4843 optional int32 startup_millis = 1;
4844}
4845
4846/**
4847 * Logs the action that was started by user.
4848 *
4849 * Logged from:
4850 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4851 */
4852message DocsUIUserActionReported {
4853 optional android.stats.docsui.UserAction action = 1;
4854}
4855
4856/**
4857 * Logs the invalid type when invalid scoped access is requested.
4858 *
4859 * Logged from:
4860 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4861 */
4862message DocsUIInvalidScopedAccessRequestReported {
4863 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004864}
Ben Murdochbab399f62018-12-06 11:01:38 +00004865
4866/**
shawnlina75e82d2019-01-07 10:31:12 +08004867 * Logs the package name that launches docsui picker mode.
4868 *
4869 * Logged from:
4870 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4871 */
4872message DocsUIPickerLaunchedFromReported {
4873 optional string package_name = 1;
4874}
4875
4876/**
4877 * Logs the search type.
4878 *
4879 * Logged from:
4880 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4881 */
4882message DocsUISearchTypeReported {
4883 optional android.stats.docsui.SearchType search_type = 1;
4884}
4885
4886/**
4887 * Logs the search mode.
4888 *
4889 * Logged from:
4890 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4891 */
4892message DocsUISearchModeReported {
4893 optional android.stats.docsui.SearchMode search_mode = 1;
4894}
4895
4896/**
4897 * Logs the pick result information.
4898 *
4899 * Logged from:
4900 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4901 */
4902message DocsUIPickResultReported {
4903 optional int32 total_action_count = 1;
4904 optional int64 duration_millis = 2;
4905 optional int32 file_count= 3;
4906 optional bool is_searching = 4;
4907 optional android.stats.docsui.Root picked_from = 5;
4908 optional android.stats.docsui.MimeType mime_type = 6;
4909 optional int32 repeatedly_pick_times = 7;
4910}
4911
4912/**
Ben Murdochbab399f62018-12-06 11:01:38 +00004913 * Logs when an app's memory is compacted.
4914 *
4915 * Logged from:
4916 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4917 */
4918message AppCompacted {
4919 // The pid of the process being compacted.
4920 optional int32 pid = 1;
4921
4922 // The name of the process being compacted.
4923 optional string process_name = 2;
4924
4925 // The type of compaction.
4926 enum Action {
4927 UNKNOWN = 0;
4928 SOME = 1;
4929 FULL = 2;
4930 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004931 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00004932
4933 // Total RSS in kilobytes consumed by the process prior to compaction.
4934 optional int64 before_rss_total_kilobytes = 4;
4935
4936 // File RSS in kilobytes consumed by the process prior to compaction.
4937 optional int64 before_rss_file_kilobytes = 5;
4938
4939 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4940 optional int64 before_rss_anon_kilobytes = 6;
4941
4942 // Swap in kilobytes consumed by the process prior to compaction.
4943 optional int64 before_swap_kilobytes = 7;
4944
4945 // Total RSS in kilobytes consumed by the process after compaction.
4946 optional int64 after_rss_total_kilobytes = 8;
4947
4948 // File RSS in kilobytes consumed by the process after compaction.
4949 optional int64 after_rss_file_kilobytes = 9;
4950
4951 // Anonymous RSS in kilobytes consumed by the process after compaction.
4952 optional int64 after_rss_anon_kilobytes = 10;
4953
4954 // Swap in kilobytes consumed by the process after compaction.
4955 optional int64 after_swap_kilobytes = 11;
4956
4957 // The time taken to perform compaction in milliseconds.
4958 optional int64 time_to_compact_millis = 12;
4959
4960 // The last compaction action performed for this app.
4961 optional Action last_action = 13;
4962
Ben Murdoch01720b82018-12-19 18:03:44 +00004963 // The last time that compaction was attempted on this process in milliseconds
4964 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4965 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00004966
Ben Murdoch885c21b2019-03-15 18:02:04 +00004967 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00004968 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00004969
4970 // The process state at the time of compaction.
4971 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00004972
4973 // Free ZRAM in kilobytes before compaction.
4974 optional int64 before_zram_free_kilobytes = 17;
4975
4976 // Free ZRAM in kilobytes after compaction.
4977 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00004978}
lifr157fc552018-12-12 16:38:04 +08004979
4980/**
4981 * Logs the latency period(in microseconds) and the return code of
4982 * the DNS(Domain Name System) lookups.
4983 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4984 * to get info(address or hostname) from DNS server(or DNS cache).
4985 * Logged from:
4986 * /system/netd/server/DnsProxyListener.cpp
4987 */
4988message NetworkDnsEventReported {
4989 // The types of the DNS lookups, as defined in
4990 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4991 enum EventType {
4992 EVENT_UNKNOWN = 0;
4993 EVENT_GETADDRINFO = 1;
4994 EVENT_GETHOSTBYNAME = 2;
4995 EVENT_GETHOSTBYADDR = 3;
4996 EVENT_RES_NSEND = 4;
4997 }
4998 optional EventType event_type = 1;
4999
5000 // The return value of the DNS resolver for each DNS lookups.
5001 //bionic/libc/include/netdb.h
5002 //system/netd/resolv/include/netd_resolv/resolv.h
5003 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08005004 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08005005 EAI_ADDRFAMILY = 1;
5006 EAI_AGAIN = 2;
5007 EAI_BADFLAGS = 3;
5008 EAI_FAIL = 4;
5009 EAI_FAMILY = 5;
5010 EAI_MEMORY = 6;
5011 EAI_NODATA = 7;
5012 EAI_NONAME = 8;
5013 EAI_SERVICE = 9;
5014 EAI_SOCKTYPE = 10;
5015 EAI_SYSTEM = 11;
5016 EAI_BADHINTS = 12;
5017 EAI_PROTOCOL = 13;
5018 EAI_OVERFLOW = 14;
5019 RESOLV_TIMEOUT = 255;
5020 EAI_MAX = 256;
5021 }
5022 optional ReturnCode return_code = 2;
5023
5024 // The latency period(in microseconds) it took for this DNS lookup to complete.
5025 optional int32 latency_micros = 3;
5026}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005027
5028/**
5029 * Logs when a data stall event occurs.
5030 *
5031 * Log from:
5032 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5033 */
5034message DataStallEvent {
5035 // Data stall evaluation type.
5036 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5037 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5038 optional int32 evaluation_type = 1;
5039 // See definition in data_stall_event.proto.
5040 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5041 // See definition in data_stall_event.proto.
5042 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5043 // See definition in data_stall_event.proto.
5044 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5045 // See definition in data_stall_event.proto.
5046 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5047 // See definition in data_stall_event.proto.
5048 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5049}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005050
5051/*
5052 * Logs when RescueParty resets some set of experiment flags.
5053 *
5054 * Logged from:
5055 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5056 */
5057message RescuePartyResetReported {
5058 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5059 optional int32 rescue_level = 1;
5060}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005061
5062/**
5063 * Logs when signed config is received from an APK, and if that config was applied successfully.
5064 * Logged from:
5065 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5066 */
5067message SignedConfigReported {
5068 enum Type {
5069 UNKNOWN_TYPE = 0;
5070 GLOBAL_SETTINGS = 1;
5071 }
5072 optional Type type = 1;
5073
5074 // The final status of the signed config received.
5075 enum Status {
5076 UNKNOWN_STATUS = 0;
5077 APPLIED = 1;
5078 BASE64_FAILURE_CONFIG = 2;
5079 BASE64_FAILURE_SIGNATURE = 3;
5080 SECURITY_EXCEPTION = 4;
5081 INVALID_CONFIG = 5;
5082 OLD_CONFIG = 6;
5083 SIGNATURE_CHECK_FAILED = 7;
5084 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005085 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005086 }
5087 optional Status status = 2;
5088
5089 // The version of the signed config processed.
5090 optional int32 version = 3;
5091
5092 // The package name that the config was extracted from.
5093 optional string from_package = 4;
5094
5095 enum Key {
5096 NO_KEY = 0;
5097 DEBUG = 1;
5098 PRODUCTION = 2;
5099 }
5100 // Which key was used to verify the config.
5101 optional Key verified_with = 5;
5102}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005103
5104/*
5105 * Logs GNSS Network-Initiated (NI) location events.
5106 *
5107 * Logged from:
5108 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5109 */
5110message GnssNiEventReported {
5111 // The type of GnssNiEvent.
5112 enum EventType {
5113 UNKNOWN = 0;
5114 NI_REQUEST = 1;
5115 NI_RESPONSE = 2;
5116 }
5117 optional EventType event_type = 1;
5118
5119 // An ID generated by HAL to associate NI notifications and UI responses.
5120 optional int32 notification_id = 2;
5121
5122 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005123 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005124
5125 // NI requires notification.
5126 optional bool need_notify = 4;
5127
5128 // NI requires verification.
5129 optional bool need_verify = 5;
5130
5131 // NI requires privacy override, no notification/minimal trace.
5132 optional bool privacy_override = 6;
5133
5134 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5135 // seconds.
5136 optional int32 timeout = 7;
5137
5138 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005139 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005140
5141 // String representing the requester of the network inititated location request.
5142 optional string requestor_id = 9;
5143
5144 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5145 // network initiated location request.
5146 optional string text = 10;
5147
5148 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005149 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005150
5151 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005152 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005153
5154 // True if SUPL ES is enabled.
5155 optional bool is_supl_es_enabled = 13;
5156
5157 // True if GNSS location is enabled.
5158 optional bool is_location_enabled = 14;
5159
5160 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005161 optional android.server.location.GnssUserResponseType user_response = 15;
5162}
5163
5164/**
5165 * Logs GNSS non-framework (NFW) location notification.
5166 *
5167 * Logged from:
5168 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5169 */
5170message GnssNfwNotificationReported {
5171 // Package name of the Android proxy application representing the non-framework entity that
5172 // requested location. Set to empty string if unknown.
5173 optional string proxy_app_package_name = 1;
5174
5175 // Protocol stack that initiated the non-framework location request.
5176 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5177
5178 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5179 // set to empty string. This field is opaque to the framework and used for logging purposes.
5180 optional string other_protocol_stack_name = 3;
5181
5182 // Source initiating/receiving the location information.
5183 optional android.server.location.NfwRequestor requestor = 4;
5184
5185 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5186 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5187 // and used for logging purposes.
5188 optional string requestor_id = 5;
5189
5190 // Indicates whether location information was provided for this request.
5191 optional android.server.location.NfwResponseType response_type = 6;
5192
5193 // True if the device is in user initiated emergency session.
5194 optional bool in_emergency_mode = 7;
5195
5196 // True if cached location is provided.
5197 optional bool is_cached_location = 8;
5198
5199 // True if proxy app permission mismatch between framework and GNSS HAL.
5200 optional bool is_permission_mismatched = 9;
5201}
5202
5203/**
5204 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5205 *
5206 * Logged from:
5207 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5208 */
5209message GnssConfigurationReported {
5210 // SUPL host name.
5211 optional string supl_host = 1;
5212
5213 // SUPL port number.
5214 optional int32 supl_port = 2;
5215
5216 // C2K host name.
5217 optional string c2k_host = 3;
5218
5219 // C2K port number.
5220 optional int32 c2k_port = 4;
5221
5222 // The SUPL version requested by Carrier.
5223 optional int32 supl_ver = 5;
5224
5225 // The SUPL mode.
5226 optional android.server.location.SuplMode supl_mode = 6;
5227
5228 // True if NI emergency SUPL restrictions is enabled.
5229 optional bool supl_es = 7;
5230
5231 // LTE Positioning Profile settings
5232 optional android.server.location.LppProfile lpp_profile = 8;
5233
5234 // Positioning protocol on A-Glonass system.
5235 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5236
5237 // True if emergency PDN is used. Otherwise, regular PDN is used.
5238 optional bool use_emergency_pdn_for_emergency_supl= 10;
5239
5240 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5241 optional android.server.location.GpsLock gps_lock = 11;
5242
5243 // Number of seconds to extend the emergency session duration post emergency call.
5244 optional int32 es_extension_sec = 12;
5245
5246 // The full list of package names of proxy Android applications representing the non-framework
5247 // location access entities (on/off the device) for which the framework user has granted
5248 // non-framework location access permission. The package names are concatenated in one string
5249 // with spaces as separators.
5250 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005251}
Jack Yu95b64f32018-12-13 18:26:11 +08005252
5253/**
5254 * Logs when a NFC device's error occurred.
5255 * Logged from:
5256 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5257 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5258 */
5259message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005260 enum Type {
5261 UNKNOWN = 0;
5262 CMD_TIMEOUT = 1;
5263 ERROR_NOTIFICATION = 2;
5264 AID_OVERFLOW = 3;
5265 }
5266 optional Type type = 1;
5267 // If it's nci cmd timeout, log the timeout command.
5268 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005269
Alex Salod7c3eef2019-01-25 14:43:27 -08005270 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005271}
5272
5273/**
5274 * Logs when a NFC device's state changed event
5275 * Logged from:
5276 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5277 */
5278message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005279 enum State {
5280 UNKNOWN = 0;
5281 OFF = 1;
5282 ON = 2;
5283 ON_LOCKED = 3; // Secure Nfc enabled.
5284 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5285 }
5286 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005287}
5288
5289/**
5290 * Logs when a NFC Beam Transaction occurred.
5291 * Logged from:
5292 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5293 */
5294message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005295 enum Operation {
5296 UNKNOWN = 0;
5297 SEND = 1;
5298 RECEIVE = 2;
5299 }
5300 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005301}
5302
5303/**
5304 * Logs when a NFC Card Emulation Transaction occurred.
5305 * Logged from:
5306 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5307 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5308 */
5309message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005310 enum Category {
5311 UNKNOWN = 0;
5312 HCE_PAYMENT = 1;
5313 HCE_OTHER = 2;
5314 OFFHOST = 3;
5315 }
5316 // Transaction belongs to HCE payment or HCE other category, or offhost.
5317 optional Category category = 1;
5318 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5319 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005320}
5321
5322/**
5323 * Logs when a NFC Tag event occurred.
5324 * Logged from:
5325 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5326 */
5327message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005328 enum Type {
5329 UNKNOWN = 0;
5330 URL = 1;
5331 BT_PAIRING = 2;
5332 PROVISION = 3;
5333 WIFI_CONNECT = 4;
5334 APP_LAUNCH = 5;
5335 OTHERS = 6;
5336 }
5337 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005338}
5339
5340/**
5341 * Logs when Hce transaction triggered
5342 * Logged from:
5343 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5344 */
5345message NfcHceTransactionOccurred {
5346 // The latency period(in microseconds) it took for the first HCE data
5347 // exchange.
5348 optional uint32 latency_micros = 1;
5349}
5350
5351/**
5352 * Logs when SecureElement state event changed
5353 * Logged from:
5354 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5355 */
5356message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005357 enum State {
5358 UNKNOWN = 0;
5359 INITIALIZED = 1;
5360 DISCONNECTED = 2;
5361 CONNECTED = 3;
5362 HALCRASH = 4;
5363 }
5364 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005365
Alex Salod7c3eef2019-01-25 14:43:27 -08005366 optional string state_change_reason = 2;
5367 // SIMx or eSEx.
5368 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005369}
5370
5371/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005372 * Information about a permission grant request
5373 */
5374message PermissionGrantRequestResultReported {
5375 // unique value identifying an API call. A API call might result in multiple of these atoms
5376 optional int64 request_id = 1;
5377
5378 // UID of package requesting the permission grant
5379 optional int32 requesting_uid = 2 [(is_uid) = true];
5380
5381 // Name of package requesting the permission grant
5382 optional string requesting_package_name = 3;
5383
5384 // The permission to be granted
5385 optional string permission_name = 4;
5386
5387 // If the permission was explicitly requested via the API or added by the system
5388 optional bool is_implicit = 5;
5389
5390 enum Result {
5391 UNDEFINED = 0;
5392 // permission request was ignored
5393 IGNORED = 1;
5394 // permission request was ignored because it was user fixed
5395 IGNORED_USER_FIXED = 2;
5396 // permission request was ignored because it was policy fixed
5397 IGNORED_POLICY_FIXED = 3;
5398 // permission was granted by user action
5399 USER_GRANTED = 4;
5400 // permission was automatically granted
5401 AUTO_GRANTED = 5;
5402 // permission was denied by user action
5403 USER_DENIED = 6;
5404 // permission was denied with prejudice by the user
5405 USER_DENIED_WITH_PREJUDICE = 7;
5406 // permission was automatically denied
5407 AUTO_DENIED = 8;
5408 }
5409 // The result of the permission grant
5410 optional Result result = 6;
5411}
5412
5413/**
Jack Yu95b64f32018-12-13 18:26:11 +08005414 * Logs when Omapi API used
5415 * Logged from:
5416 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5417 */
5418message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005419 enum Operation {
5420 UNKNOWN = 0;
5421 OPEN_CHANNEL = 1;
5422 }
5423 optional Operation operation = 1;
5424 // SIMx or eSEx.
5425 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005426
Alex Salod7c3eef2019-01-25 14:43:27 -08005427 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005428}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005429
5430/**
Alex Saloa060aee2019-01-21 14:36:41 -08005431 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5432 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005433 * Logged from:
5434 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5435 */
5436message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005437 optional int64 dispatch_latency_millis = 1;
5438}
5439
5440/**
5441 * Logs AttentionManagerService attention check result.
5442 *
5443 * Logged from:
5444 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5445 */
5446message AttentionManagerServiceResultReported {
5447 // See core/java/android/service/attention/AttentionService.java
5448 enum AttentionCheckResult {
5449 UNKNOWN = 20;
5450 ATTENTION_SUCCESS_ABSENT = 0;
5451 ATTENTION_SUCCESS_PRESENT = 1;
5452 ATTENTION_FAILURE_PREEMPTED = 2;
5453 ATTENTION_FAILURE_TIMED_OUT = 3;
5454 ATTENTION_FAILURE_UNKNOWN = 4;
5455 }
5456 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005457}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005458
5459/**
5460 * Logs when an adb connection changes state.
5461 *
5462 * Logged from:
5463 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5464 */
5465message AdbConnectionChanged {
5466 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5467 // previously selected for this system.
5468 optional int64 last_connection_time_millis = 1;
5469
5470 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5471 // to reconnect via adb without user interaction.
5472 optional int64 auth_window_millis = 2;
5473
5474 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5475 optional android.debug.AdbConnectionStateEnum state = 3;
5476
5477 // True if the 'always allow' option was selected for this system.
5478 optional bool always_allow = 4;
5479}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005480
5481/*
5482 * Logs the reported speech DSP status.
5483 *
5484 * Logged from:
5485 * Vendor audio implementation.
5486 */
5487message SpeechDspStatReported {
5488 // The total Speech DSP uptime in milliseconds.
5489 optional int32 total_uptime_millis = 1;
5490 // The total Speech DSP downtime in milliseconds.
5491 optional int32 total_downtime_millis = 2;
5492 optional int32 total_crash_count = 3;
5493 optional int32 total_recover_count = 4;
5494}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005495
5496/**
5497 * Logs USB connector contaminant status.
5498 *
5499 * Logged from: USB Service.
5500 */
5501message UsbContaminantReported {
5502 optional string id = 1;
5503 optional android.service.usb.ContaminantPresenceStatus status = 2;
5504}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005505
5506/**
5507 * This atom is for debugging purpose.
5508 */
5509message DebugElapsedClock {
5510 // Monotically increasing value for each pull.
5511 optional int64 pull_count = 1;
5512 // Time from System.elapsedRealtime.
5513 optional int64 elapsed_clock_millis = 2;
5514 // Time from System.elapsedRealtime.
5515 optional int64 same_elapsed_clock_millis = 3;
5516 // Diff between current elapsed time and elapsed time from previous pull.
5517 optional int64 elapsed_clock_diff_millis = 4;
5518
5519 enum Type {
5520 TYPE_UNKNOWN = 0;
5521 ALWAYS_PRESENT = 1;
5522 PRESENT_ON_ODD_PULLS = 2;
5523 }
5524 // Type of behavior for the pulled data.
5525 optional Type type = 5;
5526}
5527
5528/**
5529 * This atom is for debugging purpose.
5530 */
5531message DebugFailingElapsedClock {
5532 // Monotically increasing value for each pull.
5533 optional int64 pull_count = 1;
5534 // Time from System.elapsedRealtime.
5535 optional int64 elapsed_clock_millis = 2;
5536 // Time from System.elapsedRealtime.
5537 optional int64 same_elapsed_clock_millis = 3;
5538 // Diff between current elapsed time and elapsed time from previous pull.
5539 optional int64 elapsed_clock_diff_millis = 4;
5540}
Steven Wuacef6bb2019-01-23 14:21:17 -05005541
5542/** Logs System UI bubbles event changed.
5543 *
5544 * Logged from:
5545 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5546 */
5547message BubbleUIChanged {
5548
5549 // The app package that is posting the bubble.
5550 optional string package_name = 1;
5551
5552 // The notification channel that is posting the bubble.
5553 optional string notification_channel = 2;
5554
5555 // The notification id associated with the posted bubble.
5556 optional int32 notification_id = 3;
5557
5558 // The position of the bubble within the bubble stack.
5559 optional int32 position = 4;
5560
5561 // The total number of bubbles within the bubble stack.
5562 optional int32 total_number = 5;
5563
5564 // User interactions with the bubble.
5565 enum Action {
5566 UNKNOWN = 0;
5567 POSTED = 1;
5568 UPDATED = 2;
5569 EXPANDED = 3;
5570 COLLAPSED = 4;
5571 DISMISSED = 5;
5572 STACK_DISMISSED = 6;
5573 STACK_MOVED = 7;
5574 HEADER_GO_TO_APP = 8;
5575 HEADER_GO_TO_SETTINGS = 9;
5576 PERMISSION_OPT_IN = 10;
5577 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005578 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005579 SWIPE_LEFT = 13;
5580 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005581 STACK_EXPANDED = 15;
Steven Wuacef6bb2019-01-23 14:21:17 -05005582 }
5583 optional Action action = 6;
5584
5585 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5586 optional float normalized_x_position = 7;
5587 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04005588
5589 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
5590 optional bool is_unread = 9;
Steven Wuacef6bb2019-01-23 14:21:17 -05005591}
Kweku Adams8845d012018-12-11 20:06:45 -08005592
5593/**
Steven Wu552f63f2019-02-05 13:41:36 -05005594 * Logs System UI bubbles developer errors.
5595 *
5596 * Logged from:
5597 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5598 */
5599message BubbleDeveloperErrorReported {
5600
5601 // The app package that is posting the bubble.
5602 optional string package_name = 1;
5603
5604 // Bubble developer error type enums.
5605 enum Error {
5606 UNKNOWN = 0;
5607 ACTIVITY_INFO_MISSING = 1;
5608 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5609 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5610 }
5611 optional Error error = 2 [default = UNKNOWN];
5612}
5613
5614/**
Kweku Adams8845d012018-12-11 20:06:45 -08005615 * Logs that a constraint for a scheduled job has changed.
5616 *
5617 * Logged from:
5618 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5619 */
5620message ScheduledJobConstraintChanged {
5621 repeated AttributionNode attribution_node = 1;
5622
5623 // Name of the job.
5624 optional string job_name = 2;
5625
5626 optional com.android.server.job.ConstraintEnum constraint = 3;
5627
5628 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08005629 UNKNOWN = 0;
5630 UNSATISFIED = 1;
5631 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08005632 }
5633 optional State state = 4;
5634}
Alex Salod7c3eef2019-01-25 14:43:27 -08005635
5636/**
5637 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5638 * returns true.
5639 *
5640 * Logged from:
5641 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5642 */
5643message ScreenTimeoutExtensionReported {
5644 // Describes how many times in a row did the power manager reset the screen off timeout.
5645 optional uint32 consecutive_timeout_extended_count = 1;
5646}
Hui Yu885aca12019-01-10 17:11:34 -08005647
5648/*
5649* Logs number of milliseconds it takes to start a process.
5650* The definition of app process start time is from the app launch time to
5651* the time that Zygote finished forking the app process and loaded the
5652* application package's java classes.
5653
5654* This metric is different from AppStartOccurred which is for foreground
5655* activity only.
5656
5657* ProcessStartTime can report all processes (both foreground and background)
5658* start time.
5659*
5660* Logged from:
5661* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5662*/
5663message ProcessStartTime {
5664 // The uid of the ProcessRecord.
5665 optional int32 uid = 1 [(is_uid) = true];
5666
5667 // The process pid.
5668 optional int32 pid = 2;
5669
5670 // The process name.
5671 // Usually package name, "system" for system server.
5672 // Provided by ActivityManagerService.
5673 optional string process_name = 3;
5674
5675 enum StartType {
5676 UNKNOWN = 0;
5677 WARM = 1;
5678 HOT = 2;
5679 COLD = 3;
5680 }
5681
5682 // The start type.
5683 optional StartType type = 4;
5684
5685 // The elapsed realtime at the start of the process.
5686 optional int64 process_start_time_millis = 5;
5687
5688 // Number of milliseconds it takes to reach bind application.
5689 optional int32 bind_application_delay_millis = 6;
5690
5691 // Number of milliseconds it takes to finish start of the process.
5692 optional int32 process_start_delay_millis = 7;
5693
5694 // hostingType field in ProcessRecord, the component type such as "activity",
5695 // "service", "content provider", "broadcast" or other strings.
5696 optional string hosting_type = 8;
5697
5698 // hostingNameStr field in ProcessRecord. The component class name that runs
5699 // in this process.
5700 optional string hosting_name = 9;
5701}
5702
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005703/**
5704 * State of a dangerous permission requested by a package
5705 */
5706message DangerousPermissionState {
5707 // Name of the permission
5708 optional string permission_name = 1;
5709
5710 // Uid of the package
5711 optional int32 uid = 2 [(is_uid) = true];
5712
5713 // Package requesting the permission
5714 optional string package_name = 3;
5715
5716 // If the permission is granted to the uid
5717 optional bool is_granted = 4;
5718}
5719
Michael Groover4a0ca942019-01-24 17:41:25 -08005720/**
5721 * Logs when a package is denied access to a device identifier based on the new access requirements.
5722 *
5723 * Logged from:
5724 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
5725 */
5726message DeviceIdentifierAccessDenied {
5727 // The name of the package denied access to the requested device identifier.
5728 optional string package_name = 1;
5729
5730 // The name of the device identifier method the package attempted to invoke.
5731 optional string method_name = 2;
5732
5733 // True if the package is preinstalled.
5734 optional bool is_preinstalled = 3;
5735
5736 // True if the package is privileged.
5737 optional bool is_priv_app = 4;
5738}
Chenjie Yue13f44a2019-02-07 17:51:38 -08005739
5740/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08005741 * Pulls the ongoing mainline install train version code.
5742 * Pulled from StatsCompanionService
5743 */
5744message TrainInfo {
5745 optional int64 train_version_code = 1;
5746
5747 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08005748
5749 optional string train_name = 3;
5750
5751 enum Status {
5752 UNKNOWN = 0;
5753 INSTALL_REQUESTED = 1;
5754 INSTALL_STARTED = 2;
5755 INSTALL_STAGED_NOT_READY = 3;
5756 INSTALL_STAGED_READY = 4;
5757 INSTALL_SUCCESS = 5;
5758 INSTALL_FAILURE = 6;
5759 INSTALL_CANCELLED = 7;
5760 INSTALLER_ROLLBACK_REQUESTED = 8;
5761 INSTALLER_ROLLBACK_INITIATED = 9;
5762 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
5763 INSTALLER_ROLLBACK_STAGED = 11;
5764 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
5765 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
5766 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
5767 INSTALLER_ROLLBACK_SUCCESS = 15;
5768 INSTALLER_ROLLBACK_FAILURE = 16;
5769 INSTALLER_ROLLBACK_CANCEL_STAGED_REMOVE_FROM_QUEUE = 17;
5770 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_INITIATED = 18;
5771 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_SUCCESS = 19;
5772 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_FAILURE = 20;
Howard Ro3a662af2019-03-29 18:16:54 -07005773 INSTALL_STAGED_CANCEL_REQUESTED = 21;
5774 INSTALL_STAGED_CANCEL_SUCCESS = 22;
5775 INSTALL_STAGED_CANCEL_FAILURE = 23;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08005776 }
5777 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08005778}
joshmccloskey8c3322e2019-01-09 18:25:57 -08005779
5780/**
5781 * Logs the gesture stage changed event.
5782 *
5783 * Logged from:
5784 * frameworks/base/packages/SystemUI/
5785 */
5786message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005787 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005788}
5789
5790/**
5791 * Logs the feedback type.
5792 *
5793 * Logged from:
5794 * frameworks/base/packages/SystemUI/
5795 */
5796message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005797 // Whether or not the gesture was used.
5798 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005799}
5800
5801/**
5802 * Logs the progress.
5803 *
5804 * Logged from:
5805 * frameworks/base/packages/SystemUI/
5806 */
5807message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005808 // [0,100] progress for the assist gesture.
5809 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005810}
Neil Fullerdb14b482019-02-05 19:44:44 +00005811
5812/*
5813 * Information about the time zone data on a device.
5814 */
5815message TimeZoneDataInfo {
5816 // A version identifier for the data set on device. e.g. "2018i"
5817 optional string tzdb_version = 1;
5818}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005819
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005820/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005821 * Logs the GPU stats global health information.
5822 *
5823 * Logged from:
5824 * frameworks/native/services/gpuservice/gpustats/
5825 */
5826message GpuStatsGlobalInfo {
5827 // Package name of the gpu driver.
5828 optional string driver_package_name = 1;
5829
5830 // Version name of the gpu driver.
5831 optional string driver_version_name = 2;
5832
5833 // Version code of the gpu driver.
5834 optional int64 driver_version_code = 3;
5835
5836 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
5837 optional int64 driver_build_time = 4;
5838
5839 // Total count of the gl driver gets loaded.
5840 optional int64 gl_loading_count = 5;
5841
5842 // Total count of the gl driver fails to be loaded.
5843 optional int64 gl_loading_failure_count = 6;
5844
5845 // Total count of the Vulkan driver gets loaded.
5846 optional int64 vk_loading_count = 7;
5847
5848 // Total count of the Vulkan driver fails to be loaded.
5849 optional int64 vk_loading_failure_count = 8;
5850}
5851
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005852/**
5853 * GPU driver loading time info.
5854 */
5855message GpuDriverLoadingTime {
5856 // List of all the driver loading times for this app. The list size is
5857 // capped at 50.
5858 repeated int64 driver_loading_time = 1;
5859}
5860
5861/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005862 * Logs the GPU stats per app health information.
5863 *
5864 * Logged from:
5865 * frameworks/native/services/gpuservice/gpustats/
5866 */
5867message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005868 // Package name of the application that loads the gpu driver. Total number
5869 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005870 optional string app_package_name = 1;
5871
5872 // Version code of the gpu driver this app loads.
5873 optional int64 driver_version_code = 2;
5874
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005875 // gl driver loading time info.
5876 optional GpuDriverLoadingTime gl_driver_loading_time = 3
5877 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005878
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005879 // Vulkan driver loading time info.
5880 optional GpuDriverLoadingTime vk_driver_loading_time = 4
5881 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005882}
Rafal Slawikd4e87572019-03-12 13:08:38 +00005883
5884/*
5885 * Logs the size of the system ion heap.
5886 *
5887 * Pulled from StatsCompanionService.
5888 */
5889message SystemIonHeapSize {
5890 // Size of the system ion heap in bytes.
5891 optional int64 size_in_bytes = 1;
5892}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08005893
5894/**
5895 * Push network stack events.
5896 *
5897 * Log from:
5898 * frameworks/base/packages/NetworkStack/
5899 */
5900message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08005901 // The id that indicates the event reported from NetworkStack.
5902 optional int32 event_id = 1;
5903 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08005904 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
5905}
Carmen Agimofa769c152019-03-04 14:39:14 +00005906
5907/**
5908 * Logs the apps that are installed on the external storage.
5909 * Pulled from:
5910 * StatsCompanionService
5911 */
5912message AppsOnExternalStorageInfo {
5913 // The type of the external storage.
5914 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
5915 // The name of the package that is installed on the external storage.
5916 optional string package_name = 2;
5917}