blob: 1ffde972566f6a40a2616d62b66aeb26c50bba09 [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;
Yangster-macb89807e2018-11-15 21:10:57 -08003283 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003284 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003285 // Possible experiment ids for monitoring this push.
3286 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3287 // user id
3288 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003289}
3290
Maggie Whitefc1aa592018-11-28 21:55:23 -08003291/** Represents USB port overheat event. */
3292message UsbPortOverheatEvent {
3293 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3294 optional int32 plug_temperature_deci_c = 1;
3295
3296 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3297 optional int32 max_temperature_deci_c = 2;
3298
3299 /* Time between USB plug event and overheat threshold trip, in seconds. */
3300 optional int32 time_to_overheat_secs = 3;
3301
3302 /* Time between overheat threshold trip and hysteresis, in seconds. */
3303 optional int32 time_to_hysteresis_secs = 4;
3304
3305 /* Time between hysteresis and active mitigation ending, in seconds. */
3306 optional int32 time_to_inactive_secs = 5;
3307};
3308
Maggie White8735b852019-01-18 11:40:49 -08003309/**
3310 * Logs total effective full charge and discharge cycles on a battery.
3311 * Here are some examples of one effective cycle:
3312 * 1) the battery charges from 0% to 100% and drains back to 0%,
3313 * 2) charging from 50% to 100% and draining back to 50% twice.
3314 * Pulled from:
3315 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3316 */
3317message BatteryCycleCount {
3318 /* Number of total charge and discharge cycles on the system battery. */
3319 optional int32 cycle_count = 1;
3320}
3321
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003322/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003323 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3324 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003325 * Pulled from:
3326 * StatsCompanionService
3327 */
3328
Carmen Agimof12dec122019-03-06 16:14:38 +00003329message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003330
Carmen Agimof12dec122019-03-06 16:14:38 +00003331 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003332 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003333 PUBLIC = 1;
3334 PRIVATE = 2;
3335 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003336 }
3337
Carmen Agimof12dec122019-03-06 16:14:38 +00003338 // The type of external storage.
3339 optional android.stats.storage.ExternalStorageType storage_type = 1;
3340 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3341 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003342 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003343 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003344}
3345
Yangster-macb89807e2018-11-15 21:10:57 -08003346/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003347 * Logs when a connection becomes available and lost.
3348 * Logged in StatsCompanionService.java
3349 */
3350message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003351 // Id of the network.
3352 optional int32 net_id = 1;
3353
3354 enum State {
3355 UNKNOWN = 0;
3356 CONNECTED = 1;
3357 DISCONNECTED = 2;
3358 }
3359 // Connected state of a network.
3360 optional State state = 2;
3361}
3362
3363/**
3364 * Logs when a service starts and stops.
3365 * Logged from:
3366 * services/core/java/com/android/server/am/ActiveServices.java
3367 */
3368message ServiceStateChanged {
3369
3370 optional int32 uid = 1 [(is_uid) = true];
3371
3372 optional string package_name = 2;
3373
3374 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003375
3376 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003377 START = 1;
3378 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003379 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003380
3381 optional State state = 4;
3382}
3383
3384/**
3385 * Logs when a service is launched.
3386 * Logged from:
3387 * services/core/java/com/android/server/am/ActiveServices.java
3388 */
3389message ServiceLaunchReported {
3390
3391 optional int32 uid = 1 [(is_uid) = true];
3392
3393 optional string package_name = 2;
3394
3395 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003396}
Howard Ro688ae182018-09-25 00:09:36 -07003397
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003398/**
3399 * Logs when a hidden API is used.
3400 *
3401 * Logged from:
3402 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3403 */
3404message HiddenApiUsed {
3405 // The uid of the app making the hidden access.
3406 optional int32 uid = 1 [(is_uid) = true];
3407
3408 // Signature of the method or field accessed.
3409 optional string signature = 2;
3410
3411 enum AccessMethod {
3412 NONE = 0;
3413 REFLECTION = 1;
3414 JNI = 2;
3415 LINKING = 3;
3416 }
3417
3418 // Type of access.
3419 optional AccessMethod access_method = 3;
3420
3421 // Whether the access was prevented or not.
3422 optional bool access_denied = 4;
3423}
3424
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003425/**
3426 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3427 * - When user sees privacy chip
3428 * - When user clicks privacy chip
3429 * - How does the user exit the Privacy Dialog
3430 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003431 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3432 */
3433message PrivacyIndicatorsInteracted {
3434
3435 enum Type {
3436 UNKNOWN = 0;
3437 CHIP_VIEWED = 1;
3438 CHIP_CLICKED = 2;
3439 DIALOG_PRIVACY_SETTINGS = 3;
3440 DIALOG_DISMISS = 4;
3441 DIALOG_LINE_ITEM = 5;
3442 }
3443
3444 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3445
3446 // Used if the type is LINE_ITEM
3447 optional string package_name = 2;
3448}
3449
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003450/**
3451 * Logs information about a package that is moved from the internal to external storage and vice
3452 * versa.
3453 * It logs the package name, the type of the external storage where the package is installed
3454 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3455 * and the move type: if it's from internal to external or the other way around.
3456 *
3457 * Logged from:
3458 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3459 */
3460message AppMovedStorageReported {
3461 enum MoveType {
3462 UNKNOWN = 0;
3463 TO_EXTERNAL = 1;
3464 TO_INTERNAL = 2;
3465 }
3466 // The type of the external storage.
3467 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3468 // The type of move.
3469 optional MoveType move_type = 2;
3470 // The name of the package that was moved.
3471 optional string package_name = 3;
3472}
3473
Chenjie Yubbcbc602018-02-05 16:51:52 -08003474//////////////////////////////////////////////////////////////////////
3475// Pulled atoms below this line //
3476//////////////////////////////////////////////////////////////////////
3477
3478/**
David Chenc8a43242017-10-17 16:23:28 -07003479 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3480 *
3481 * Pulled from:
3482 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3483 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003484message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003485 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003486
3487 optional int64 rx_bytes = 2;
3488
3489 optional int64 rx_packets = 3;
3490
3491 optional int64 tx_bytes = 4;
3492
3493 optional int64 tx_packets = 5;
3494}
3495
3496/**
3497 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3498 *
3499 * Pulled from:
3500 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3501 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003502message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003503 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003504
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003505 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3506 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003507
3508 optional int64 rx_bytes = 3;
3509
3510 optional int64 rx_packets = 4;
3511
3512 optional int64 tx_bytes = 5;
3513
3514 optional int64 tx_packets = 6;
3515}
3516
3517/**
3518 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3519 *
3520 * Pulled from:
3521 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3522 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003523message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003524 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003525
3526 optional int64 rx_bytes = 2;
3527
3528 optional int64 rx_packets = 3;
3529
3530 optional int64 tx_bytes = 4;
3531
3532 optional int64 tx_packets = 5;
3533}
3534
3535/**
3536 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3537 *
3538 * Pulled from:
3539 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3540 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003541message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003542 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003543
Yao Chenc40a19d2018-03-15 16:48:25 -07003544 // 1 denotes foreground and 0 denotes background. This is called Set in
3545 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003546 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003547
3548 optional int64 rx_bytes = 3;
3549
3550 optional int64 rx_packets = 4;
3551
3552 optional int64 tx_bytes = 5;
3553
3554 optional int64 tx_packets = 6;
3555}
3556
3557/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003558 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3559 *
3560 * Pulled from:
3561 * StatsCompanionService
3562 */
3563message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003564 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003565
3566 optional int64 rx_bytes = 2;
3567
3568 optional int64 tx_bytes = 3;
3569}
3570
3571/**
David Chenc8a43242017-10-17 16:23:28 -07003572 * Pulls the kernel wakelock durations. This atom is adapted from
3573 * android/internal/os/KernelWakelockStats.java
3574 *
3575 * Pulled from:
3576 * StatsCompanionService using KernelWakelockReader.
3577 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003578message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003579 optional string name = 1;
3580
3581 optional int32 count = 2;
3582
3583 optional int32 version = 3;
3584
Yangster-maca8a30442018-10-13 23:46:34 -07003585 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003586}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003587
Chenjie Yu05013b32017-11-21 10:21:41 -08003588/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003589 * Pulls low power state information. If power.stats HAL is not available, this
3590 * includes platform and subsystem sleep state information,
3591 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3592 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003593 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003594 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003595 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3596 * as defined in:
3597 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003598 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003599message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003600 // Subsystem name
3601 optional string subsystem_name = 1;
3602 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3603 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003604 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3605 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003606 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003607 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003608 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003609 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003610 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003611}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003612
Chenjie Yu05013b32017-11-21 10:21:41 -08003613/**
Bookatz92da2832018-11-01 18:10:03 -07003614 * Pulls on-device power measurement information.
3615 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3616 * Pulled from:
3617 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3618 */
3619message OnDevicePowerMeasurement {
3620 // Name of the subsystem (to which the rail belongs).
3621 optional string subsystem_name = 1;
3622
3623 // Rail name. The rail lies within the subsystem.
3624 optional string rail_name = 2;
3625
3626 // Time (in ms since boot) at which the rail energy value was measured.
3627 // This may differ slightly from the time that statsd logs this information.
3628 optional uint64 measurement_timestamp_millis = 3;
3629
3630 // Accumulated energy used via the rail since device boot in uWs.
3631 optional uint64 energy_microwatt_secs = 4;
3632}
3633
3634/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003635 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003636 * Pulls the time the cpu spend on the frequency index. Frequency index
3637 * starts from highest to lowest. The value should be monotonically
3638 * increasing since boot. However, if there is a cpu
3639 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003640 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003641message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003642 optional uint32 cluster = 1;
3643 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003644 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003645}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003646
Chenjie Yu05013b32017-11-21 10:21:41 -08003647/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003648 * Pulls Cpu Time Per Uid.
3649 * Note that isolated process uid time should be attributed to host uids.
3650 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003651message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003652 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003653 optional uint64 user_time_micros = 2;
3654 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003655}
3656
3657/**
3658 * Pulls Cpu Time Per Uid per frequency.
3659 * Note that isolated process uid time should be attributed to host uids.
3660 * For each uid, we order the time by descending frequencies.
3661 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003662message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003663 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003664 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003665 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003666}
Hugo Benichi884970e2017-11-14 22:42:46 +09003667
Chenjie Yu05013b32017-11-21 10:21:41 -08003668/**
3669 * Pulls Wifi Controller Activity Energy Info
3670 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003671message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003672 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003673 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003674 // stack reported state
3675 // TODO: replace this with proto enum
3676 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003677 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003678 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003679 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003680 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003681 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003682 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003683 // product of current(mA), voltage(V) and time(ms)
3684 optional uint64 controller_energy_used = 6;
3685}
3686
3687/**
3688 * Pulls Modem Activity Energy Info
3689 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003690message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003691 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003692 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003693 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003694 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003695 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003696 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003697 /**
3698 * Tx power index
3699 * index 0 = tx_power < 0dBm
3700 * index 1 = 0dBm < tx_power < 5dBm
3701 * index 2 = 5dBm < tx_power < 15dBm
3702 * index 3 = 15dBm < tx_power < 20dBm
3703 * index 4 = tx_power > 20dBm
3704 */
3705 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003706 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003707 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003708 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003709 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003710 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003711 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003712 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003713 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003714 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003715 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003716 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003717 // product of current(mA), voltage(V) and time(ms)
3718 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003719}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003720
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003721/**
3722 * Pulls Bluetooth Activity Energy Info
3723 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3724 */
3725message BluetoothActivityInfo {
3726 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003727 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003728 // bluetooth stack state
3729 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003730 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003731 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003732 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003733 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003734 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003735 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003736 // product of current(mA), voltage(V) and time(ms)
3737 optional uint64 energy_used = 6;
3738}
3739
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003740/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003741 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003742 *
3743 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003744 */
3745message ProcessMemoryState {
3746 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003747 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003748
3749 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003750 // Usually package name, "system" for system server.
3751 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003752 optional string process_name = 2;
3753
Rafal Slawikda51b932018-12-13 16:31:33 +00003754 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003755 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003756
3757 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003758 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003759
3760 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003761 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003762
Rajeev Kumar90235992018-01-29 11:06:48 -08003763 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003764 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3765 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003766 optional int64 rss_in_bytes = 6;
3767
3768 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003769 // Value is read from memory.stat, field total_cache if per-app memory
3770 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003771 optional int64 cache_in_bytes = 7;
3772
3773 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003774 // Value is read from memory.stat, field total_swap if per-app memory
3775 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003776 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003777
Rafal Slawikd03ae422018-11-20 11:27:45 +00003778 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003779 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003780
3781 // Elapsed real time when the process started.
3782 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3783 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003784}
3785
3786/*
Rafal Slawik08621582018-10-15 14:53:07 +01003787 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003788 *
3789 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003790 */
3791message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003792 // The uid if available. -1 means not available.
3793 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003794
Rafal Slawikbf67d072018-10-23 11:07:54 +01003795 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003796 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003797 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003798
Rafal Slawikbf67d072018-10-23 11:07:54 +01003799 // # of page-faults
3800 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003801
Rafal Slawikbf67d072018-10-23 11:07:54 +01003802 // # of major page-faults
3803 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003804
Rafal Slawikbf67d072018-10-23 11:07:54 +01003805 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003806 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003807 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003808
Rafal Slawikd03ae422018-11-20 11:27:45 +00003809 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003810 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003811
3812 // Elapsed real time when the process started.
3813 // Value is read from /proc/PID/stat, field 22.
3814 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01003815}
3816
3817/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003818 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003819 *
3820 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3821 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003822 *
3823 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003824 */
3825message ProcessMemoryHighWaterMark {
3826 // The uid if available. -1 means not available.
3827 optional int32 uid = 1 [(is_uid) = true];
3828
Rafal Slawikda51b932018-12-13 16:31:33 +00003829 // The process name.
3830 // Usually package name or process cmdline.
3831 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003832 optional string process_name = 2;
3833
3834 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3835 // /proc/PID/status.
3836 optional int64 rss_high_water_mark_in_bytes = 3;
3837}
3838
3839/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003840 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003841 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003842message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003843 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003844}
3845
3846/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003847 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003848 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003849message SystemUptime {
3850 // Milliseconds since the system was booted.
3851 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3852 // for external input).
3853 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003854 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003855}
3856
3857/*
3858 * Reads from /proc/uid_concurrent_active_time which has the format:
3859 * active: X (X is # cores)
3860 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3861 * [uid1]: [time-0] [time-1] [time-2] ... ...
3862 * ...
3863 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3864 * The file contains a monotonically increasing count of time for a single boot.
3865 */
3866message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003867 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003868 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003869}
3870
3871/**
3872 * Reads from /proc/uid_concurrent_policy_time which has the format:
3873 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3874 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3875 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3876 * ...
3877 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3878 * The file contains a monotonically increasing count of time for a single boot.
3879 */
3880message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003881 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003882 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003883 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003884}
3885
3886/*
3887 * Pulls free disk space, for data, system partition and temporary directory.
3888 */
3889message DiskSpace {
3890 // available bytes in data partition
3891 optional uint64 data_available_bytes = 1;
3892 // available bytes in system partition
3893 optional uint64 system_available_bytes = 2;
3894 // available bytes in download cache or temp directories
3895 optional uint64 temp_available_bytes = 3;
3896}
Tej Singhbf972d92018-01-10 20:51:13 -08003897
3898/**
3899 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003900 *
3901 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003902 */
3903message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003904 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003905}
3906
3907/**
3908 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003909 * Pulled from:
3910 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003911 */
3912message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003913 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003914}
3915
3916/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003917 * Pulls battery voltage.
3918 * Pulled from:
3919 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3920 */
3921message BatteryVoltage {
3922 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003923 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003924}
3925
3926/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003927 * Pulls battery level (percent full, from 0 to 100).
3928 *
3929 * Pulled from:
3930 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3931 */
3932message BatteryLevel {
3933 // Battery level. Should be in [0, 100].
3934 optional int32 battery_level = 1;
3935}
3936
3937/**
Tej Singhd89137e2018-03-26 14:51:40 -07003938 * Pulls the temperature of various parts of the device.
3939 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003940 *
3941 * Pulled from:
3942 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3943 */
3944message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003945 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003946 optional android.os.TemperatureTypeEnum sensor_location = 1;
3947
3948 // The name of the temperature source. Eg. CPU0
3949 optional string sensor_name = 2;
3950
Tej Singhd89137e2018-03-26 14:51:40 -07003951 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003952 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003953 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003954}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003955
3956/**
3957 * Pulls the statistics of calls to Binder.
3958 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003959 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3960 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003961 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003962 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003963 */
3964message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003965 // UID of the process responsible for the binder transaction. It will be set if the process
3966 // executing the binder transaction attribute the transaction to another uid using
3967 // Binder.setThreadWorkSource().
3968 //
3969 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003970 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003971 // UID of the process executing the binder transaction.
3972 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003973 // Fully qualified class name of the API call.
3974 //
3975 // This is a system server class name.
3976 //
3977 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3978 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3979 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3980 // commonly used APIs.
3981 optional string service_class_name = 2;
3982 // Method name of the API call. It can also be a transaction code if we cannot
3983 // resolve it to a name. See Binder#getTransactionName.
3984 //
3985 // This is a system server method name.
3986 optional string service_method_name = 3;
3987 // Total number of API calls.
3988 optional int64 call_count = 4;
3989 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3990 optional bool screen_interactive = 13;
3991 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3992 // call_count will be equal to recorded_call_count.
3993 //
3994 // If recorded_call_count is different than call_count, it means data collection has been
3995 // sampled. All the fields below will be sampled in this case.
3996 optional int64 recorded_call_count = 12;
3997 // Number of exceptions thrown by the API.
3998 optional int64 recorded_exception_count = 5;
3999 // Total latency of all API calls.
4000 // Average can be computed using total_latency_micros / recorded_call_count.
4001 optional int64 recorded_total_latency_micros = 6;
4002 // Maximum latency of one API call.
4003 optional int64 recorded_max_latency_micros = 7;
4004 // Total CPU usage of all API calls.
4005 // Average can be computed using total_cpu_micros / recorded_call_count.
4006 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4007 optional int64 recorded_total_cpu_micros = 8;
4008 // Maximum CPU usage of one API call.
4009 optional int64 recorded_max_cpu_micros = 9;
4010 // Maximum parcel reply size of one API call.
4011 optional int64 recorded_max_reply_size_bytes = 10;
4012 // Maximum parcel request size of one API call.
4013 optional int64 recorded_max_request_size_bytes = 11;
4014}
4015
4016/**
4017 * Pulls the statistics of exceptions during calls to Binder.
4018 *
4019 * Binder stats are cumulative from boot unless somebody reset the data using
4020 * > adb shell dumpsys binder_calls_stats --reset
4021 */
4022message BinderCallsExceptions {
4023 // Exception class name, e.g. java.lang.IllegalArgumentException.
4024 //
4025 // This is an exception class name thrown by the system server.
4026 optional string exception_class_name = 1;
4027 // Total number of exceptions.
4028 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004029}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004030
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004031/**
4032 * Pulls the statistics of message dispatching on HandlerThreads.
4033 *
4034 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4035 * config on the device.
4036 *
4037 * Next tag: 11
4038 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004039message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004040 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004041 optional int32 uid = 1 [(is_uid) = true];
4042
4043 // Fully qualified class name of the handler target class.
4044 //
4045 // This field does not contain PII. This is a system server class name.
4046 optional string handler_class_name = 2;
4047
4048 // The name of the thread that runs the Looper.
4049 //
4050 // This field does not contain PII. This is a system server thread name.
4051 optional string looper_thread_name = 3;
4052
4053 // The name of the dispatched message.
4054 //
4055 // This field does not contain PII. This is a system server constant or class
4056 // name.
4057 optional string message_name = 4;
4058
4059 // Total number of successfully dispatched messages.
4060 optional int64 message_count = 5;
4061
4062 // Total number of messages that failed dispatching.
4063 optional int64 exception_count = 6;
4064
4065 // Total number of processed messages we have data recorded for. If we
4066 // collected data for all the messages, message_count will be equal to
4067 // recorded_message_count.
4068 //
4069 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004070 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004071 optional int64 recorded_message_count = 7;
4072
4073 // Total latency of all processed messages.
4074 // Average can be computed using recorded_total_latency_micros /
4075 // recorded_message_count.
4076 optional int64 recorded_total_latency_micros = 8;
4077
4078 // Total CPU usage of all processed message.
4079 // Average can be computed using recorded_total_cpu_micros /
4080 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004081 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004082 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004083
4084 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4085 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004086
4087 // Max recorded CPU usage of all processed messages.
4088 optional int64 recorded_max_cpu_micros = 11;
4089
4090 // Max recorded latency of all processed messages.
4091 optional int64 recorded_max_latency_micros = 12;
4092
4093 // Total number of messages we tracked the dispatching delay for. If we
4094 // collected data for all the messages, message_count will be equal to
4095 // recorded_delay_message_count.
4096 //
4097 // If recorded_delay_message_count is different than message_count, it means data
4098 // collection has been sampled or/and not all messages specified the target dispatch time.
4099 // The fields below will be sampled in this case.
4100 optional int64 recorded_delay_message_count = 13;
4101
4102 // Total dispatching delay of all processed messages.
4103 // Calculated as a difference between the target dispatching time (Message.when)
4104 // and the actual dispatching time.
4105 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4106 optional int64 recorded_total_delay_millis = 14;
4107
4108 // Max dispatching delay of all processed messages.
4109 // Calculated as a difference between the target dispatching time (Message.when)
4110 // and the actual dispatching time.
4111 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004112}
Tej Singh86dc9db2018-09-06 00:39:57 +00004113
4114/**
4115 * Pulls disk information, such as write speed and latency.
4116 */
4117message DiskStats {
4118 // Time taken to open, write 512B to, and close a file.
4119 // -1 if error performing the check.
4120 optional int64 data_write_latency_millis = 1;
4121
4122 optional bool file_based_encryption = 2;
4123
4124 // Recent disk write speed in kB/s.
4125 // -1 if error querying storageed.
4126 // 0 if data is unavailable.
4127 optional int32 recent_disk_write_speed = 3;
4128}
4129
4130
4131/**
4132 * Free and total bytes of the Data, Cache, and System partition.
4133 */
4134message DirectoryUsage {
4135 enum Directory {
4136 UNKNOWN = 0;
4137 DATA = 1;
4138 CACHE = 2;
4139 SYSTEM = 3;
4140 }
4141 optional Directory directory = 1;
4142 optional int64 free_bytes = 2;
4143 optional int64 total_bytes = 3;
4144}
4145
4146
4147/**
4148 * Size of an application: apk size, data size, and cache size.
4149 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4150 * Information is only reported for apps with the primary user (user 0).
4151 * Sizes are aggregated by package name.
4152 */
4153message AppSize {
4154 // Including uids will involve modifying diskstats logic.
4155 optional string package_name = 1;
4156 // App size in bytes. -1 if unavailable.
4157 optional int64 app_size_bytes = 2;
4158 // App data size in bytes. -1 if unavailable.
4159 optional int64 app_data_size_bytes = 3;
4160 // App cache size in bytes. -1 if unavailable.
4161 optional int64 app_cache_size_bytes = 4;
4162 // Time that the cache file was produced.
4163 // Uses System.currentTimeMillis(), which is wall clock time.
4164 optional int64 cache_time_millis = 5;
4165}
4166
4167
4168/**
4169 * Size of a particular category. Eg: photos, videos.
4170 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4171 */
4172message CategorySize {
4173 enum Category {
4174 UNKNOWN = 0;
4175 APP_SIZE = 1;
4176 APP_DATA_SIZE = 2;
4177 APP_CACHE_SIZE = 3;
4178 PHOTOS = 4;
4179 VIDEOS = 5;
4180 AUDIO = 6;
4181 DOWNLOADS = 7;
4182 SYSTEM = 8;
4183 OTHER = 9;
4184 }
4185 optional Category category = 1;
4186 // Category size in bytes.
4187 optional int64 size_bytes = 2;
4188 // Time that the cache file was produced.
4189 // Uses System.currentTimeMillis(), which is wall clock time.
4190 optional int64 cache_time_millis = 3;
4191}
Tej Singhd6d6d772018-09-05 17:41:25 -07004192
4193/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004194 * Pulls per uid I/O stats. The stats are cumulative since boot.
4195 *
4196 * Read/write bytes are I/O events from a storage device
4197 * Read/write chars are data requested by read/write syscalls, and can be
4198 * satisfied by caching.
4199 *
4200 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4201 */
4202message DiskIo {
4203 optional int32 uid = 1 [(is_uid) = true];
4204 optional int64 fg_chars_read = 2;
4205 optional int64 fg_chars_write = 3;
4206 optional int64 fg_bytes_read = 4;
4207 optional int64 fg_bytes_write = 5;
4208 optional int64 bg_chars_read = 6;
4209 optional int64 bg_chars_write = 7;
4210 optional int64 bg_bytes_read = 8;
4211 optional int64 bg_bytes_write = 9;
4212 optional int64 fg_fsync = 10;
4213 optional int64 bg_fsync= 11;
4214}
4215
4216
4217/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004218 * Pulls the number of fingerprints for each user.
4219 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004220 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004221 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004222message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004223 // The associated user. Eg: 0 for owners, 10+ for others.
4224 // Defined in android/os/UserHandle.java
4225 optional int32 user = 1;
4226 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004227 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004228}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004229
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004230/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004231 * Pulls the number of faces for each user.
4232 *
4233 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4234 */
4235message NumFacesEnrolled {
4236 // The associated user. Eg: 0 for owners, 10+ for others.
4237 // Defined in android/os/UserHandle.java
4238 optional int32 user = 1;
4239 // Number of faces registered to that user.
4240 optional int32 num_faces_enrolled = 2;
4241}
4242/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004243 * A mapping of role holder -> role
4244 */
4245message RoleHolder {
4246 // uid of the role holder
4247 optional int32 uid = 1 [(is_uid) = true];
4248
4249 // package name of the role holder
4250 optional string package_name = 2;
4251
4252 // the role held
4253 optional string role = 3;
4254}
4255
Yangsteraf9aee72018-10-12 09:26:16 -07004256message AggStats {
4257 optional int64 min = 1;
4258
4259 optional int64 average = 2;
4260
4261 optional int64 max = 3;
4262}
4263
4264message ProcessStatsStateProto {
4265 optional android.service.procstats.ScreenState screen_state = 1;
4266
4267 optional android.service.procstats.MemoryState memory_state = 2;
4268
4269 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4270 // and not frameworks/base/core/java/android/app/ActivityManager.java
4271 optional android.service.procstats.ProcessState process_state = 3;
4272
4273 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004274 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004275
4276 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004277 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004278
4279 // # of samples taken
4280 optional int32 sample_size = 5;
4281
4282 // PSS is memory reserved for this process
4283 optional AggStats pss = 6;
4284
4285 // USS is memory shared between processes, divided evenly for accounting
4286 optional AggStats uss = 7;
4287
4288 // RSS is memory resident for this process
4289 optional AggStats rss = 8;
4290}
4291
4292// Next Tag: 7
4293message ProcessStatsProto {
4294 // Name of process.
4295 optional string process = 1;
4296
4297 // Uid of the process.
4298 optional int32 uid = 2;
4299
4300 // Information about how often kills occurred
4301 message Kill {
4302 // Count of excessive CPU kills
4303 optional int32 cpu = 1;
4304
4305 // Count of kills when cached
4306 optional int32 cached = 2;
4307
4308 // PSS stats during cached kill
4309 optional AggStats cached_pss = 3;
4310 }
4311 optional Kill kill = 3;
4312
4313 // Time and memory spent in various states.
4314 repeated ProcessStatsStateProto states = 5;
4315
4316 // Total time process has been running... screen_state, memory_state, and process_state
4317 // will not be set.
4318 optional ProcessStatsStateProto total_running_state = 6;
4319}
4320
4321message PackageServiceOperationStatsProto {
4322 // Operate enum: Started, Foreground, Bound, Executing
4323 optional android.service.procstats.ServiceOperationState operation = 1;
4324
4325 // Number of times the service was in this operation.
4326 optional int32 count = 2;
4327
4328 // Information about a state the service can be in.
4329 message StateStats {
4330 // Screen state enum.
4331 optional android.service.procstats.ScreenState screen_state = 1;
4332 // Memory state enum.
4333 optional android.service.procstats.MemoryState memory_state = 2;
4334
4335 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004336 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004337 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004338 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004339 }
4340 repeated StateStats state_stats = 3;
4341}
4342
4343message PackageServiceStatsProto {
4344 // Name of service component.
4345 optional string service_name = 1;
4346
4347 // The operation stats.
4348 // The package_name, package_uid, package_version, service_name will not be set to save space.
4349 repeated PackageServiceOperationStatsProto operation_stats = 2;
4350}
4351
4352message PackageAssociationSourceProcessStatsProto {
4353 // Uid of the process.
4354 optional int32 process_uid = 1;
4355 // Process name.
4356 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004357 // Package name.
4358 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004359 // Total count of the times this association appeared.
4360 optional int32 total_count = 3;
4361
4362 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004363 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004364
4365 // Total count of the times this association became actively impacting its target process.
4366 optional int32 active_count = 5;
4367
4368 // Information on one source in this association.
4369 message StateStats {
4370 // Process state enum.
4371 optional android.service.procstats.ProcessState process_state = 1;
4372 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004373 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004374 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004375 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004376 }
4377 repeated StateStats active_state_stats = 6;
4378}
4379
4380message PackageAssociationProcessStatsProto {
4381 // Name of the target component.
4382 optional string component_name = 1;
4383 // Information on one source in this association.
4384 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4385}
4386
4387
4388message ProcessStatsPackageProto {
4389 // Name of package.
4390 optional string package = 1;
4391
4392 // Uid of the package.
4393 optional int32 uid = 2;
4394
4395 // Version of the package.
4396 optional int64 version = 3;
4397
4398 // Stats for each process running with the package loaded in to it.
4399 repeated ProcessStatsProto process_stats = 4;
4400
4401 // Stats for each of the package's services.
4402 repeated PackageServiceStatsProto service_stats = 5;
4403
4404 // Stats for each association with the package.
4405 repeated PackageAssociationProcessStatsProto association_stats = 6;
4406}
4407
4408message ProcessStatsSectionProto {
4409 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004410 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004411
4412 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004413 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004414
4415 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004416 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004417
4418 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004419 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004420
4421 // System runtime library. e.g. "libdvm.so", "libart.so".
4422 optional string runtime = 5;
4423
4424 // whether kernel reports swapped pss.
4425 optional bool has_swapped_pss = 6;
4426
4427 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4428 enum Status {
4429 STATUS_UNKNOWN = 0;
4430 STATUS_COMPLETE = 1;
4431 STATUS_PARTIAL = 2;
4432 STATUS_SHUTDOWN = 3;
4433 STATUS_SYSPROPS = 4;
4434 }
4435 repeated Status status = 7;
4436
Chenjie Yub2ecc792019-01-17 10:27:26 -08004437 // Number of pages available of various types and sizes, representation fragmentation.
4438 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4439
Yangsteraf9aee72018-10-12 09:26:16 -07004440 // Stats for each process.
4441 repeated ProcessStatsProto process_stats = 8;
4442
4443 // Stats for each package.
4444 repeated ProcessStatsPackageProto package_stats = 9;
4445}
4446
Chenjie Yub2ecc792019-01-17 10:27:26 -08004447message ProcessStatsAvailablePagesProto {
4448 // Node these pages are in (as per /proc/pagetypeinfo)
4449 optional int32 node = 1;
4450
4451 // Zone these pages are in (as per /proc/pagetypeinfo)
4452 optional string zone = 2;
4453
4454 // Label for the type of these pages (as per /proc/pagetypeinfo)
4455 optional string label = 3;
4456
4457 // Distribution of number of pages available by order size. First entry in array is
4458 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4459 repeated int32 pages_per_order = 4;
4460}
4461
Chenjie Yu12e5e672018-09-14 15:54:59 -07004462/**
4463 * Pulled from ProcessStatsService.java
4464 */
4465message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004466 optional ProcessStatsSectionProto proc_stats_section = 1;
4467}
4468
Chenjie Yuf910b7802019-01-11 16:08:20 -08004469/**
4470 * Pulled from ProcessStatsService.java
4471 */
4472message ProcStatsPkgProc {
4473 optional ProcessStatsSectionProto proc_stats_section = 1;
4474}
4475
Yangsteraf9aee72018-10-12 09:26:16 -07004476message PowerProfileProto {
4477 optional double cpu_suspend = 1;
4478
4479 optional double cpu_idle = 2;
4480
4481 optional double cpu_active = 3;
4482
4483 message CpuCluster {
4484 optional int32 id = 1;
4485 optional double cluster_power = 2;
4486 optional int32 cores = 3;
4487 repeated int64 speed = 4;
4488 repeated double core_power = 5;
4489 }
4490
4491 repeated CpuCluster cpu_cluster = 40;
4492
4493 optional double wifi_scan = 4;
4494
4495 optional double wifi_on = 5;
4496
4497 optional double wifi_active = 6;
4498
4499 optional double wifi_controller_idle = 7;
4500
4501 optional double wifi_controller_rx = 8;
4502
4503 optional double wifi_controller_tx = 9;
4504
4505 repeated double wifi_controller_tx_levels = 10;
4506
4507 optional double wifi_controller_operating_voltage = 11;
4508
4509 optional double bluetooth_controller_idle = 12;
4510
4511 optional double bluetooth_controller_rx = 13;
4512
4513 optional double bluetooth_controller_tx = 14;
4514
4515 optional double bluetooth_controller_operating_voltage = 15;
4516
4517 optional double modem_controller_sleep = 16;
4518
4519 optional double modem_controller_idle = 17;
4520
4521 optional double modem_controller_rx = 18;
4522
4523 repeated double modem_controller_tx = 19;
4524
4525 optional double modem_controller_operating_voltage = 20;
4526
4527 optional double gps_on = 21;
4528
4529 repeated double gps_signal_quality_based = 22;
4530
4531 optional double gps_operating_voltage = 23;
4532
4533 optional double bluetooth_on = 24;
4534
4535 optional double bluetooth_active = 25;
4536
4537 optional double bluetooth_at_cmd = 26;
4538
4539 optional double ambient_display = 27;
4540
4541 optional double screen_on = 28;
4542
4543 optional double radio_on = 29;
4544
4545 optional double radio_scanning = 30;
4546
4547 optional double radio_active = 31;
4548
4549 optional double screen_full = 32;
4550
4551 optional double audio = 33;
4552
4553 optional double video = 34;
4554
4555 optional double flashlight = 35;
4556
4557 optional double memory = 36;
4558
4559 optional double camera = 37;
4560
4561 optional double wifi_batched_scan = 38;
4562
4563 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004564}
Chenjie Yuab530202018-09-26 12:39:20 -07004565
4566/**
4567 * power_profile.xml and other constants for power model calculations.
4568 * Pulled from PowerProfile.java
4569 */
4570message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004571 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004572}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004573
4574/**
arangelovd5db50e2018-10-12 20:24:39 +01004575 * Logs when a user restriction was added or removed.
4576 *
4577 * Logged from:
4578 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4579 */
4580message UserRestrictionChanged {
4581 // The raw string of the user restriction as defined in UserManager.
4582 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4583 optional string restriction = 1;
4584 // Whether the restriction is enabled or disabled.
4585 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004586}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004587
4588/**
4589 * Pulls process user time and system time. Puller takes a snapshot of all pids
4590 * in the system and returns cpu stats for those that are working at the time.
4591 * Dead pids will be dropped. Kernel processes are excluded.
4592 * Min cool-down is 5 sec.
4593 */
4594message ProcessCpuTime {
4595 optional int32 uid = 1 [(is_uid) = true];
4596
4597 optional string process_name = 2;
4598 // Process cpu time in user space, cumulative from boot/process start
4599 optional int64 user_time_millis = 3;
4600 // Process cpu time in system space, cumulative from boot/process start
4601 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004602}
Misha Wagner5a51e002018-10-03 15:04:09 +01004603
4604/**
4605 * Pulls the CPU usage for each thread.
4606 *
4607 * Read from /proc/$PID/task/$TID/time_in_state files.
4608 *
4609 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4610 * time_in_state files not being present on some phones, have not been addressed. These should be
4611 * considered before a public release.
4612 */
4613message CpuTimePerThreadFreq {
4614 // UID that owns the process.
4615 optional int32 uid = 1 [(is_uid) = true];
4616 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004617 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004618 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004619 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004620 // Name of the process taken from `/proc/$PID/cmdline`.
4621 optional string process_name = 4;
4622 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4623 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004624
4625 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4626 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4627 // frequencies are given here as the alternative is sending eight separate atoms. This method
4628 // significantly reduces the amount of data created
4629 optional int32 frequency1_khz = 6;
4630 optional int32 time1_millis = 7;
4631 optional int32 frequency2_khz = 8;
4632 optional int32 time2_millis = 9;
4633 optional int32 frequency3_khz = 10;
4634 optional int32 time3_millis = 11;
4635 optional int32 frequency4_khz = 12;
4636 optional int32 time4_millis = 13;
4637 optional int32 frequency5_khz = 14;
4638 optional int32 time5_millis = 15;
4639 optional int32 frequency6_khz = 16;
4640 optional int32 time6_millis = 17;
4641 optional int32 frequency7_khz = 18;
4642 optional int32 time7_millis = 19;
4643 optional int32 frequency8_khz = 20;
4644 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004645}
Bookatz75ee60422018-11-09 12:27:37 -08004646
4647/**
Bookatz366a4432018-11-20 09:42:33 -08004648 * Pulls information about the device's build.
4649 */
4650message BuildInformation {
4651 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4652 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4653 optional string fingerprint = 1;
4654
4655 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4656 optional string brand = 2;
4657
4658 // Build.PRODUCT. The name of the overall product.
4659 optional string product = 3;
4660
4661 // Build.DEVICE. The name of the industrial design.
4662 optional string device = 4;
4663
4664 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4665 optional string version_release = 5;
4666
4667 // Build.ID. E.g. a label like "M4-rc20".
4668 optional string id = 6;
4669
4670 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4671 // represent this build.
4672 optional string version_incremental = 7;
4673
4674 // Build.TYPE. The type of build, like "user" or "eng".
4675 optional string type = 8;
4676
4677 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4678 optional string tags = 9;
4679}
4680
4681/**
Bookatz75ee60422018-11-09 12:27:37 -08004682 * Pulls on-device BatteryStats power use calculations for the overall device.
4683 */
4684message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004685 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4686 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4687 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4688 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08004689}
4690
4691/**
4692 * Pulls on-device BatteryStats power use calculations broken down by uid.
4693 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4694 * that is attributed to non-uid items. They must all be included to get the total power use.
4695 */
4696message DeviceCalculatedPowerBlameUid {
4697 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4698 optional int32 uid = 1 [(is_uid) = true];
4699
Bookatz3dbc13a2018-12-21 12:16:51 -08004700 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4701 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4702 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08004703}
4704
4705/**
4706 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4707 * drain type.
4708 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4709 * is attributed uids. They must all be included to get the total power use.
4710 */
4711message DeviceCalculatedPowerBlameOther {
4712 // The type of item whose power use is being reported.
4713 enum DrainType {
4714 AMBIENT_DISPLAY = 0;
4715 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4716 BLUETOOTH = 2;
4717 CAMERA = 3;
4718 // Cell-standby
4719 CELL = 4;
4720 FLASHLIGHT = 5;
4721 IDLE = 6;
4722 MEMORY = 7;
4723 // Amount that total computed drain exceeded the drain estimated using the
4724 // battery level changes and capacity.
4725 OVERCOUNTED = 8;
4726 PHONE = 9;
4727 SCREEN = 10;
4728 // Amount that total computed drain was below the drain estimated using the
4729 // battery level changes and capacity.
4730 UNACCOUNTED = 11;
4731 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4732 WIFI = 13;
4733 }
4734 optional DrainType drain_type = 1;
4735
Bookatz3dbc13a2018-12-21 12:16:51 -08004736 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4737 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4738 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004739}
arangelov4e994062018-11-13 16:12:38 +00004740
4741/**
4742 * Logs device policy features.
4743 *
4744 * Logged from:
4745 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4746 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4747 */
4748message DevicePolicyEvent {
4749 // The event id - unique for each event.
4750 optional android.stats.devicepolicy.EventId event_id = 1;
4751 // The admin package name.
4752 optional string admin_package_name = 2;
4753 // A generic integer parameter.
4754 optional int32 integer_value = 3;
4755 // A generic boolean parameter.
4756 optional bool boolean_value = 4;
4757 // A parameter specifying a time period in milliseconds.
4758 optional uint64 time_period_millis = 5;
4759 // A parameter specifying a list of package names, bundle extras or string parameters.
4760 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4761}
shawnlinea5b66b2018-11-13 15:05:29 +08004762
4763/**
4764 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4765 *
4766 * Logged from:
4767 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4768 */
4769message DocsUILaunchReported {
4770 optional android.stats.docsui.LaunchAction launch_action = 1;
4771 optional bool has_initial_uri = 2;
4772 optional android.stats.docsui.MimeType mime_type = 3;
4773 optional android.stats.docsui.Root initial_root = 4;
4774}
4775
4776/**
4777 * Logs root/app visited event in file managers/picker. Call this when the user
4778 * taps on root/app in hamburger menu.
4779 *
4780 * Logged from:
4781 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4782 */
4783message DocsUIRootVisitedReported {
4784 optional android.stats.docsui.ContextScope scope = 1;
4785 optional android.stats.docsui.Root root = 2;
4786}
4787
4788/**
4789 * Logs file operation stats. Call this when a file operation has completed.
4790 *
4791 * Logged from:
4792 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4793 */
4794message DocsUIFileOperationReported {
4795 optional android.stats.docsui.Provider provider = 1;
4796 optional android.stats.docsui.FileOperation file_op = 2;
4797}
4798
4799/**
4800 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4801 * mode.
4802 *
4803 * Logged from:
4804 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4805 */
4806message DocsUIFileOperationCopyMoveModeReported {
4807 optional android.stats.docsui.FileOperation file_op = 1;
4808 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4809}
4810
4811
4812/**
4813 * Logs file sub operation stats. Call this when a file operation has failed.
4814 *
4815 * Logged from:
4816 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4817 */
4818message DocsUIFileOperationFailureReported {
4819 optional android.stats.docsui.Authority authority = 1;
4820 optional android.stats.docsui.SubFileOperation sub_op = 2;
4821}
4822
4823/**
4824* Logs the cancellation of a file operation. Call this when a job is canceled
4825*
4826* Logged from:
4827* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4828*/
4829message DocsUIFileOperationCanceledReported {
4830 optional android.stats.docsui.FileOperation file_op = 1;
4831}
4832
4833/**
4834 * Logs startup time in milliseconds.
4835 *
4836 * Logged from:
4837 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4838 */
4839message DocsUIStartupMsReported {
4840 optional int32 startup_millis = 1;
4841}
4842
4843/**
4844 * Logs the action that was started by user.
4845 *
4846 * Logged from:
4847 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4848 */
4849message DocsUIUserActionReported {
4850 optional android.stats.docsui.UserAction action = 1;
4851}
4852
4853/**
4854 * Logs the invalid type when invalid scoped access is requested.
4855 *
4856 * Logged from:
4857 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4858 */
4859message DocsUIInvalidScopedAccessRequestReported {
4860 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004861}
Ben Murdochbab399f62018-12-06 11:01:38 +00004862
4863/**
shawnlina75e82d2019-01-07 10:31:12 +08004864 * Logs the package name that launches docsui picker mode.
4865 *
4866 * Logged from:
4867 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4868 */
4869message DocsUIPickerLaunchedFromReported {
4870 optional string package_name = 1;
4871}
4872
4873/**
4874 * Logs the search type.
4875 *
4876 * Logged from:
4877 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4878 */
4879message DocsUISearchTypeReported {
4880 optional android.stats.docsui.SearchType search_type = 1;
4881}
4882
4883/**
4884 * Logs the search mode.
4885 *
4886 * Logged from:
4887 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4888 */
4889message DocsUISearchModeReported {
4890 optional android.stats.docsui.SearchMode search_mode = 1;
4891}
4892
4893/**
4894 * Logs the pick result information.
4895 *
4896 * Logged from:
4897 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4898 */
4899message DocsUIPickResultReported {
4900 optional int32 total_action_count = 1;
4901 optional int64 duration_millis = 2;
4902 optional int32 file_count= 3;
4903 optional bool is_searching = 4;
4904 optional android.stats.docsui.Root picked_from = 5;
4905 optional android.stats.docsui.MimeType mime_type = 6;
4906 optional int32 repeatedly_pick_times = 7;
4907}
4908
4909/**
Ben Murdochbab399f62018-12-06 11:01:38 +00004910 * Logs when an app's memory is compacted.
4911 *
4912 * Logged from:
4913 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4914 */
4915message AppCompacted {
4916 // The pid of the process being compacted.
4917 optional int32 pid = 1;
4918
4919 // The name of the process being compacted.
4920 optional string process_name = 2;
4921
4922 // The type of compaction.
4923 enum Action {
4924 UNKNOWN = 0;
4925 SOME = 1;
4926 FULL = 2;
4927 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004928 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00004929
4930 // Total RSS in kilobytes consumed by the process prior to compaction.
4931 optional int64 before_rss_total_kilobytes = 4;
4932
4933 // File RSS in kilobytes consumed by the process prior to compaction.
4934 optional int64 before_rss_file_kilobytes = 5;
4935
4936 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4937 optional int64 before_rss_anon_kilobytes = 6;
4938
4939 // Swap in kilobytes consumed by the process prior to compaction.
4940 optional int64 before_swap_kilobytes = 7;
4941
4942 // Total RSS in kilobytes consumed by the process after compaction.
4943 optional int64 after_rss_total_kilobytes = 8;
4944
4945 // File RSS in kilobytes consumed by the process after compaction.
4946 optional int64 after_rss_file_kilobytes = 9;
4947
4948 // Anonymous RSS in kilobytes consumed by the process after compaction.
4949 optional int64 after_rss_anon_kilobytes = 10;
4950
4951 // Swap in kilobytes consumed by the process after compaction.
4952 optional int64 after_swap_kilobytes = 11;
4953
4954 // The time taken to perform compaction in milliseconds.
4955 optional int64 time_to_compact_millis = 12;
4956
4957 // The last compaction action performed for this app.
4958 optional Action last_action = 13;
4959
Ben Murdoch01720b82018-12-19 18:03:44 +00004960 // The last time that compaction was attempted on this process in milliseconds
4961 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4962 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00004963
Ben Murdoch885c21b2019-03-15 18:02:04 +00004964 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00004965 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00004966
4967 // The process state at the time of compaction.
4968 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00004969
4970 // Free ZRAM in kilobytes before compaction.
4971 optional int64 before_zram_free_kilobytes = 17;
4972
4973 // Free ZRAM in kilobytes after compaction.
4974 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00004975}
lifr157fc552018-12-12 16:38:04 +08004976
4977/**
4978 * Logs the latency period(in microseconds) and the return code of
4979 * the DNS(Domain Name System) lookups.
4980 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4981 * to get info(address or hostname) from DNS server(or DNS cache).
4982 * Logged from:
4983 * /system/netd/server/DnsProxyListener.cpp
4984 */
4985message NetworkDnsEventReported {
4986 // The types of the DNS lookups, as defined in
4987 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4988 enum EventType {
4989 EVENT_UNKNOWN = 0;
4990 EVENT_GETADDRINFO = 1;
4991 EVENT_GETHOSTBYNAME = 2;
4992 EVENT_GETHOSTBYADDR = 3;
4993 EVENT_RES_NSEND = 4;
4994 }
4995 optional EventType event_type = 1;
4996
4997 // The return value of the DNS resolver for each DNS lookups.
4998 //bionic/libc/include/netdb.h
4999 //system/netd/resolv/include/netd_resolv/resolv.h
5000 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08005001 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08005002 EAI_ADDRFAMILY = 1;
5003 EAI_AGAIN = 2;
5004 EAI_BADFLAGS = 3;
5005 EAI_FAIL = 4;
5006 EAI_FAMILY = 5;
5007 EAI_MEMORY = 6;
5008 EAI_NODATA = 7;
5009 EAI_NONAME = 8;
5010 EAI_SERVICE = 9;
5011 EAI_SOCKTYPE = 10;
5012 EAI_SYSTEM = 11;
5013 EAI_BADHINTS = 12;
5014 EAI_PROTOCOL = 13;
5015 EAI_OVERFLOW = 14;
5016 RESOLV_TIMEOUT = 255;
5017 EAI_MAX = 256;
5018 }
5019 optional ReturnCode return_code = 2;
5020
5021 // The latency period(in microseconds) it took for this DNS lookup to complete.
5022 optional int32 latency_micros = 3;
5023}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005024
5025/**
5026 * Logs when a data stall event occurs.
5027 *
5028 * Log from:
5029 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5030 */
5031message DataStallEvent {
5032 // Data stall evaluation type.
5033 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5034 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5035 optional int32 evaluation_type = 1;
5036 // See definition in data_stall_event.proto.
5037 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5038 // See definition in data_stall_event.proto.
5039 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5040 // See definition in data_stall_event.proto.
5041 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5042 // See definition in data_stall_event.proto.
5043 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5044 // See definition in data_stall_event.proto.
5045 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5046}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005047
5048/*
5049 * Logs when RescueParty resets some set of experiment flags.
5050 *
5051 * Logged from:
5052 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5053 */
5054message RescuePartyResetReported {
5055 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5056 optional int32 rescue_level = 1;
5057}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005058
5059/**
5060 * Logs when signed config is received from an APK, and if that config was applied successfully.
5061 * Logged from:
5062 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5063 */
5064message SignedConfigReported {
5065 enum Type {
5066 UNKNOWN_TYPE = 0;
5067 GLOBAL_SETTINGS = 1;
5068 }
5069 optional Type type = 1;
5070
5071 // The final status of the signed config received.
5072 enum Status {
5073 UNKNOWN_STATUS = 0;
5074 APPLIED = 1;
5075 BASE64_FAILURE_CONFIG = 2;
5076 BASE64_FAILURE_SIGNATURE = 3;
5077 SECURITY_EXCEPTION = 4;
5078 INVALID_CONFIG = 5;
5079 OLD_CONFIG = 6;
5080 SIGNATURE_CHECK_FAILED = 7;
5081 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005082 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005083 }
5084 optional Status status = 2;
5085
5086 // The version of the signed config processed.
5087 optional int32 version = 3;
5088
5089 // The package name that the config was extracted from.
5090 optional string from_package = 4;
5091
5092 enum Key {
5093 NO_KEY = 0;
5094 DEBUG = 1;
5095 PRODUCTION = 2;
5096 }
5097 // Which key was used to verify the config.
5098 optional Key verified_with = 5;
5099}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005100
5101/*
5102 * Logs GNSS Network-Initiated (NI) location events.
5103 *
5104 * Logged from:
5105 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5106 */
5107message GnssNiEventReported {
5108 // The type of GnssNiEvent.
5109 enum EventType {
5110 UNKNOWN = 0;
5111 NI_REQUEST = 1;
5112 NI_RESPONSE = 2;
5113 }
5114 optional EventType event_type = 1;
5115
5116 // An ID generated by HAL to associate NI notifications and UI responses.
5117 optional int32 notification_id = 2;
5118
5119 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005120 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005121
5122 // NI requires notification.
5123 optional bool need_notify = 4;
5124
5125 // NI requires verification.
5126 optional bool need_verify = 5;
5127
5128 // NI requires privacy override, no notification/minimal trace.
5129 optional bool privacy_override = 6;
5130
5131 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5132 // seconds.
5133 optional int32 timeout = 7;
5134
5135 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005136 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005137
5138 // String representing the requester of the network inititated location request.
5139 optional string requestor_id = 9;
5140
5141 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5142 // network initiated location request.
5143 optional string text = 10;
5144
5145 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005146 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005147
5148 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005149 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005150
5151 // True if SUPL ES is enabled.
5152 optional bool is_supl_es_enabled = 13;
5153
5154 // True if GNSS location is enabled.
5155 optional bool is_location_enabled = 14;
5156
5157 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005158 optional android.server.location.GnssUserResponseType user_response = 15;
5159}
5160
5161/**
5162 * Logs GNSS non-framework (NFW) location notification.
5163 *
5164 * Logged from:
5165 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5166 */
5167message GnssNfwNotificationReported {
5168 // Package name of the Android proxy application representing the non-framework entity that
5169 // requested location. Set to empty string if unknown.
5170 optional string proxy_app_package_name = 1;
5171
5172 // Protocol stack that initiated the non-framework location request.
5173 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5174
5175 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5176 // set to empty string. This field is opaque to the framework and used for logging purposes.
5177 optional string other_protocol_stack_name = 3;
5178
5179 // Source initiating/receiving the location information.
5180 optional android.server.location.NfwRequestor requestor = 4;
5181
5182 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5183 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5184 // and used for logging purposes.
5185 optional string requestor_id = 5;
5186
5187 // Indicates whether location information was provided for this request.
5188 optional android.server.location.NfwResponseType response_type = 6;
5189
5190 // True if the device is in user initiated emergency session.
5191 optional bool in_emergency_mode = 7;
5192
5193 // True if cached location is provided.
5194 optional bool is_cached_location = 8;
5195
5196 // True if proxy app permission mismatch between framework and GNSS HAL.
5197 optional bool is_permission_mismatched = 9;
5198}
5199
5200/**
5201 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5202 *
5203 * Logged from:
5204 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5205 */
5206message GnssConfigurationReported {
5207 // SUPL host name.
5208 optional string supl_host = 1;
5209
5210 // SUPL port number.
5211 optional int32 supl_port = 2;
5212
5213 // C2K host name.
5214 optional string c2k_host = 3;
5215
5216 // C2K port number.
5217 optional int32 c2k_port = 4;
5218
5219 // The SUPL version requested by Carrier.
5220 optional int32 supl_ver = 5;
5221
5222 // The SUPL mode.
5223 optional android.server.location.SuplMode supl_mode = 6;
5224
5225 // True if NI emergency SUPL restrictions is enabled.
5226 optional bool supl_es = 7;
5227
5228 // LTE Positioning Profile settings
5229 optional android.server.location.LppProfile lpp_profile = 8;
5230
5231 // Positioning protocol on A-Glonass system.
5232 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5233
5234 // True if emergency PDN is used. Otherwise, regular PDN is used.
5235 optional bool use_emergency_pdn_for_emergency_supl= 10;
5236
5237 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5238 optional android.server.location.GpsLock gps_lock = 11;
5239
5240 // Number of seconds to extend the emergency session duration post emergency call.
5241 optional int32 es_extension_sec = 12;
5242
5243 // The full list of package names of proxy Android applications representing the non-framework
5244 // location access entities (on/off the device) for which the framework user has granted
5245 // non-framework location access permission. The package names are concatenated in one string
5246 // with spaces as separators.
5247 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005248}
Jack Yu95b64f32018-12-13 18:26:11 +08005249
5250/**
5251 * Logs when a NFC device's error occurred.
5252 * Logged from:
5253 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5254 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5255 */
5256message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005257 enum Type {
5258 UNKNOWN = 0;
5259 CMD_TIMEOUT = 1;
5260 ERROR_NOTIFICATION = 2;
5261 AID_OVERFLOW = 3;
5262 }
5263 optional Type type = 1;
5264 // If it's nci cmd timeout, log the timeout command.
5265 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005266
Alex Salod7c3eef2019-01-25 14:43:27 -08005267 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005268}
5269
5270/**
5271 * Logs when a NFC device's state changed event
5272 * Logged from:
5273 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5274 */
5275message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005276 enum State {
5277 UNKNOWN = 0;
5278 OFF = 1;
5279 ON = 2;
5280 ON_LOCKED = 3; // Secure Nfc enabled.
5281 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5282 }
5283 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005284}
5285
5286/**
5287 * Logs when a NFC Beam Transaction occurred.
5288 * Logged from:
5289 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5290 */
5291message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005292 enum Operation {
5293 UNKNOWN = 0;
5294 SEND = 1;
5295 RECEIVE = 2;
5296 }
5297 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005298}
5299
5300/**
5301 * Logs when a NFC Card Emulation Transaction occurred.
5302 * Logged from:
5303 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5304 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5305 */
5306message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005307 enum Category {
5308 UNKNOWN = 0;
5309 HCE_PAYMENT = 1;
5310 HCE_OTHER = 2;
5311 OFFHOST = 3;
5312 }
5313 // Transaction belongs to HCE payment or HCE other category, or offhost.
5314 optional Category category = 1;
5315 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5316 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005317}
5318
5319/**
5320 * Logs when a NFC Tag event occurred.
5321 * Logged from:
5322 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5323 */
5324message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005325 enum Type {
5326 UNKNOWN = 0;
5327 URL = 1;
5328 BT_PAIRING = 2;
5329 PROVISION = 3;
5330 WIFI_CONNECT = 4;
5331 APP_LAUNCH = 5;
5332 OTHERS = 6;
5333 }
5334 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005335}
5336
5337/**
5338 * Logs when Hce transaction triggered
5339 * Logged from:
5340 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5341 */
5342message NfcHceTransactionOccurred {
5343 // The latency period(in microseconds) it took for the first HCE data
5344 // exchange.
5345 optional uint32 latency_micros = 1;
5346}
5347
5348/**
5349 * Logs when SecureElement state event changed
5350 * Logged from:
5351 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5352 */
5353message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005354 enum State {
5355 UNKNOWN = 0;
5356 INITIALIZED = 1;
5357 DISCONNECTED = 2;
5358 CONNECTED = 3;
5359 HALCRASH = 4;
5360 }
5361 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005362
Alex Salod7c3eef2019-01-25 14:43:27 -08005363 optional string state_change_reason = 2;
5364 // SIMx or eSEx.
5365 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005366}
5367
5368/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005369 * Information about a permission grant request
5370 */
5371message PermissionGrantRequestResultReported {
5372 // unique value identifying an API call. A API call might result in multiple of these atoms
5373 optional int64 request_id = 1;
5374
5375 // UID of package requesting the permission grant
5376 optional int32 requesting_uid = 2 [(is_uid) = true];
5377
5378 // Name of package requesting the permission grant
5379 optional string requesting_package_name = 3;
5380
5381 // The permission to be granted
5382 optional string permission_name = 4;
5383
5384 // If the permission was explicitly requested via the API or added by the system
5385 optional bool is_implicit = 5;
5386
5387 enum Result {
5388 UNDEFINED = 0;
5389 // permission request was ignored
5390 IGNORED = 1;
5391 // permission request was ignored because it was user fixed
5392 IGNORED_USER_FIXED = 2;
5393 // permission request was ignored because it was policy fixed
5394 IGNORED_POLICY_FIXED = 3;
5395 // permission was granted by user action
5396 USER_GRANTED = 4;
5397 // permission was automatically granted
5398 AUTO_GRANTED = 5;
5399 // permission was denied by user action
5400 USER_DENIED = 6;
5401 // permission was denied with prejudice by the user
5402 USER_DENIED_WITH_PREJUDICE = 7;
5403 // permission was automatically denied
5404 AUTO_DENIED = 8;
5405 }
5406 // The result of the permission grant
5407 optional Result result = 6;
5408}
5409
5410/**
Jack Yu95b64f32018-12-13 18:26:11 +08005411 * Logs when Omapi API used
5412 * Logged from:
5413 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5414 */
5415message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005416 enum Operation {
5417 UNKNOWN = 0;
5418 OPEN_CHANNEL = 1;
5419 }
5420 optional Operation operation = 1;
5421 // SIMx or eSEx.
5422 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005423
Alex Salod7c3eef2019-01-25 14:43:27 -08005424 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005425}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005426
5427/**
Alex Saloa060aee2019-01-21 14:36:41 -08005428 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5429 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005430 * Logged from:
5431 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5432 */
5433message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005434 optional int64 dispatch_latency_millis = 1;
5435}
5436
5437/**
5438 * Logs AttentionManagerService attention check result.
5439 *
5440 * Logged from:
5441 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5442 */
5443message AttentionManagerServiceResultReported {
5444 // See core/java/android/service/attention/AttentionService.java
5445 enum AttentionCheckResult {
5446 UNKNOWN = 20;
5447 ATTENTION_SUCCESS_ABSENT = 0;
5448 ATTENTION_SUCCESS_PRESENT = 1;
5449 ATTENTION_FAILURE_PREEMPTED = 2;
5450 ATTENTION_FAILURE_TIMED_OUT = 3;
5451 ATTENTION_FAILURE_UNKNOWN = 4;
5452 }
5453 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005454}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005455
5456/**
5457 * Logs when an adb connection changes state.
5458 *
5459 * Logged from:
5460 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5461 */
5462message AdbConnectionChanged {
5463 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5464 // previously selected for this system.
5465 optional int64 last_connection_time_millis = 1;
5466
5467 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5468 // to reconnect via adb without user interaction.
5469 optional int64 auth_window_millis = 2;
5470
5471 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5472 optional android.debug.AdbConnectionStateEnum state = 3;
5473
5474 // True if the 'always allow' option was selected for this system.
5475 optional bool always_allow = 4;
5476}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005477
5478/*
5479 * Logs the reported speech DSP status.
5480 *
5481 * Logged from:
5482 * Vendor audio implementation.
5483 */
5484message SpeechDspStatReported {
5485 // The total Speech DSP uptime in milliseconds.
5486 optional int32 total_uptime_millis = 1;
5487 // The total Speech DSP downtime in milliseconds.
5488 optional int32 total_downtime_millis = 2;
5489 optional int32 total_crash_count = 3;
5490 optional int32 total_recover_count = 4;
5491}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005492
5493/**
5494 * Logs USB connector contaminant status.
5495 *
5496 * Logged from: USB Service.
5497 */
5498message UsbContaminantReported {
5499 optional string id = 1;
5500 optional android.service.usb.ContaminantPresenceStatus status = 2;
5501}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005502
5503/**
5504 * This atom is for debugging purpose.
5505 */
5506message DebugElapsedClock {
5507 // Monotically increasing value for each pull.
5508 optional int64 pull_count = 1;
5509 // Time from System.elapsedRealtime.
5510 optional int64 elapsed_clock_millis = 2;
5511 // Time from System.elapsedRealtime.
5512 optional int64 same_elapsed_clock_millis = 3;
5513 // Diff between current elapsed time and elapsed time from previous pull.
5514 optional int64 elapsed_clock_diff_millis = 4;
5515
5516 enum Type {
5517 TYPE_UNKNOWN = 0;
5518 ALWAYS_PRESENT = 1;
5519 PRESENT_ON_ODD_PULLS = 2;
5520 }
5521 // Type of behavior for the pulled data.
5522 optional Type type = 5;
5523}
5524
5525/**
5526 * This atom is for debugging purpose.
5527 */
5528message DebugFailingElapsedClock {
5529 // Monotically increasing value for each pull.
5530 optional int64 pull_count = 1;
5531 // Time from System.elapsedRealtime.
5532 optional int64 elapsed_clock_millis = 2;
5533 // Time from System.elapsedRealtime.
5534 optional int64 same_elapsed_clock_millis = 3;
5535 // Diff between current elapsed time and elapsed time from previous pull.
5536 optional int64 elapsed_clock_diff_millis = 4;
5537}
Steven Wuacef6bb2019-01-23 14:21:17 -05005538
5539/** Logs System UI bubbles event changed.
5540 *
5541 * Logged from:
5542 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5543 */
5544message BubbleUIChanged {
5545
5546 // The app package that is posting the bubble.
5547 optional string package_name = 1;
5548
5549 // The notification channel that is posting the bubble.
5550 optional string notification_channel = 2;
5551
5552 // The notification id associated with the posted bubble.
5553 optional int32 notification_id = 3;
5554
5555 // The position of the bubble within the bubble stack.
5556 optional int32 position = 4;
5557
5558 // The total number of bubbles within the bubble stack.
5559 optional int32 total_number = 5;
5560
5561 // User interactions with the bubble.
5562 enum Action {
5563 UNKNOWN = 0;
5564 POSTED = 1;
5565 UPDATED = 2;
5566 EXPANDED = 3;
5567 COLLAPSED = 4;
5568 DISMISSED = 5;
5569 STACK_DISMISSED = 6;
5570 STACK_MOVED = 7;
5571 HEADER_GO_TO_APP = 8;
5572 HEADER_GO_TO_SETTINGS = 9;
5573 PERMISSION_OPT_IN = 10;
5574 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005575 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005576 SWIPE_LEFT = 13;
5577 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005578 STACK_EXPANDED = 15;
Steven Wuacef6bb2019-01-23 14:21:17 -05005579 }
5580 optional Action action = 6;
5581
5582 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5583 optional float normalized_x_position = 7;
5584 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04005585
5586 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
5587 optional bool is_unread = 9;
Steven Wuacef6bb2019-01-23 14:21:17 -05005588}
Kweku Adams8845d012018-12-11 20:06:45 -08005589
5590/**
Steven Wu552f63f2019-02-05 13:41:36 -05005591 * Logs System UI bubbles developer errors.
5592 *
5593 * Logged from:
5594 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5595 */
5596message BubbleDeveloperErrorReported {
5597
5598 // The app package that is posting the bubble.
5599 optional string package_name = 1;
5600
5601 // Bubble developer error type enums.
5602 enum Error {
5603 UNKNOWN = 0;
5604 ACTIVITY_INFO_MISSING = 1;
5605 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5606 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5607 }
5608 optional Error error = 2 [default = UNKNOWN];
5609}
5610
5611/**
Kweku Adams8845d012018-12-11 20:06:45 -08005612 * Logs that a constraint for a scheduled job has changed.
5613 *
5614 * Logged from:
5615 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5616 */
5617message ScheduledJobConstraintChanged {
5618 repeated AttributionNode attribution_node = 1;
5619
5620 // Name of the job.
5621 optional string job_name = 2;
5622
5623 optional com.android.server.job.ConstraintEnum constraint = 3;
5624
5625 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08005626 UNKNOWN = 0;
5627 UNSATISFIED = 1;
5628 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08005629 }
5630 optional State state = 4;
5631}
Alex Salod7c3eef2019-01-25 14:43:27 -08005632
5633/**
5634 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5635 * returns true.
5636 *
5637 * Logged from:
5638 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5639 */
5640message ScreenTimeoutExtensionReported {
5641 // Describes how many times in a row did the power manager reset the screen off timeout.
5642 optional uint32 consecutive_timeout_extended_count = 1;
5643}
Hui Yu885aca12019-01-10 17:11:34 -08005644
5645/*
5646* Logs number of milliseconds it takes to start a process.
5647* The definition of app process start time is from the app launch time to
5648* the time that Zygote finished forking the app process and loaded the
5649* application package's java classes.
5650
5651* This metric is different from AppStartOccurred which is for foreground
5652* activity only.
5653
5654* ProcessStartTime can report all processes (both foreground and background)
5655* start time.
5656*
5657* Logged from:
5658* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5659*/
5660message ProcessStartTime {
5661 // The uid of the ProcessRecord.
5662 optional int32 uid = 1 [(is_uid) = true];
5663
5664 // The process pid.
5665 optional int32 pid = 2;
5666
5667 // The process name.
5668 // Usually package name, "system" for system server.
5669 // Provided by ActivityManagerService.
5670 optional string process_name = 3;
5671
5672 enum StartType {
5673 UNKNOWN = 0;
5674 WARM = 1;
5675 HOT = 2;
5676 COLD = 3;
5677 }
5678
5679 // The start type.
5680 optional StartType type = 4;
5681
5682 // The elapsed realtime at the start of the process.
5683 optional int64 process_start_time_millis = 5;
5684
5685 // Number of milliseconds it takes to reach bind application.
5686 optional int32 bind_application_delay_millis = 6;
5687
5688 // Number of milliseconds it takes to finish start of the process.
5689 optional int32 process_start_delay_millis = 7;
5690
5691 // hostingType field in ProcessRecord, the component type such as "activity",
5692 // "service", "content provider", "broadcast" or other strings.
5693 optional string hosting_type = 8;
5694
5695 // hostingNameStr field in ProcessRecord. The component class name that runs
5696 // in this process.
5697 optional string hosting_name = 9;
5698}
5699
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005700/**
5701 * State of a dangerous permission requested by a package
5702 */
5703message DangerousPermissionState {
5704 // Name of the permission
5705 optional string permission_name = 1;
5706
5707 // Uid of the package
5708 optional int32 uid = 2 [(is_uid) = true];
5709
5710 // Package requesting the permission
5711 optional string package_name = 3;
5712
5713 // If the permission is granted to the uid
5714 optional bool is_granted = 4;
5715}
5716
Michael Groover4a0ca942019-01-24 17:41:25 -08005717/**
5718 * Logs when a package is denied access to a device identifier based on the new access requirements.
5719 *
5720 * Logged from:
5721 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
5722 */
5723message DeviceIdentifierAccessDenied {
5724 // The name of the package denied access to the requested device identifier.
5725 optional string package_name = 1;
5726
5727 // The name of the device identifier method the package attempted to invoke.
5728 optional string method_name = 2;
5729
5730 // True if the package is preinstalled.
5731 optional bool is_preinstalled = 3;
5732
5733 // True if the package is privileged.
5734 optional bool is_priv_app = 4;
5735}
Chenjie Yue13f44a2019-02-07 17:51:38 -08005736
5737/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08005738 * Pulls the ongoing mainline install train version code.
5739 * Pulled from StatsCompanionService
5740 */
5741message TrainInfo {
5742 optional int64 train_version_code = 1;
5743
5744 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08005745
5746 optional string train_name = 3;
5747
5748 enum Status {
5749 UNKNOWN = 0;
5750 INSTALL_REQUESTED = 1;
5751 INSTALL_STARTED = 2;
5752 INSTALL_STAGED_NOT_READY = 3;
5753 INSTALL_STAGED_READY = 4;
5754 INSTALL_SUCCESS = 5;
5755 INSTALL_FAILURE = 6;
5756 INSTALL_CANCELLED = 7;
5757 INSTALLER_ROLLBACK_REQUESTED = 8;
5758 INSTALLER_ROLLBACK_INITIATED = 9;
5759 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
5760 INSTALLER_ROLLBACK_STAGED = 11;
5761 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
5762 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
5763 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
5764 INSTALLER_ROLLBACK_SUCCESS = 15;
5765 INSTALLER_ROLLBACK_FAILURE = 16;
5766 INSTALLER_ROLLBACK_CANCEL_STAGED_REMOVE_FROM_QUEUE = 17;
5767 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_INITIATED = 18;
5768 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_SUCCESS = 19;
5769 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_FAILURE = 20;
5770 }
5771 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08005772}
joshmccloskey8c3322e2019-01-09 18:25:57 -08005773
5774/**
5775 * Logs the gesture stage changed event.
5776 *
5777 * Logged from:
5778 * frameworks/base/packages/SystemUI/
5779 */
5780message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005781 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005782}
5783
5784/**
5785 * Logs the feedback type.
5786 *
5787 * Logged from:
5788 * frameworks/base/packages/SystemUI/
5789 */
5790message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005791 // Whether or not the gesture was used.
5792 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005793}
5794
5795/**
5796 * Logs the progress.
5797 *
5798 * Logged from:
5799 * frameworks/base/packages/SystemUI/
5800 */
5801message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005802 // [0,100] progress for the assist gesture.
5803 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005804}
Neil Fullerdb14b482019-02-05 19:44:44 +00005805
5806/*
5807 * Information about the time zone data on a device.
5808 */
5809message TimeZoneDataInfo {
5810 // A version identifier for the data set on device. e.g. "2018i"
5811 optional string tzdb_version = 1;
5812}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005813
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005814/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005815 * Logs the GPU stats global health information.
5816 *
5817 * Logged from:
5818 * frameworks/native/services/gpuservice/gpustats/
5819 */
5820message GpuStatsGlobalInfo {
5821 // Package name of the gpu driver.
5822 optional string driver_package_name = 1;
5823
5824 // Version name of the gpu driver.
5825 optional string driver_version_name = 2;
5826
5827 // Version code of the gpu driver.
5828 optional int64 driver_version_code = 3;
5829
5830 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
5831 optional int64 driver_build_time = 4;
5832
5833 // Total count of the gl driver gets loaded.
5834 optional int64 gl_loading_count = 5;
5835
5836 // Total count of the gl driver fails to be loaded.
5837 optional int64 gl_loading_failure_count = 6;
5838
5839 // Total count of the Vulkan driver gets loaded.
5840 optional int64 vk_loading_count = 7;
5841
5842 // Total count of the Vulkan driver fails to be loaded.
5843 optional int64 vk_loading_failure_count = 8;
5844}
5845
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005846/**
5847 * GPU driver loading time info.
5848 */
5849message GpuDriverLoadingTime {
5850 // List of all the driver loading times for this app. The list size is
5851 // capped at 50.
5852 repeated int64 driver_loading_time = 1;
5853}
5854
5855/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005856 * Logs the GPU stats per app health information.
5857 *
5858 * Logged from:
5859 * frameworks/native/services/gpuservice/gpustats/
5860 */
5861message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005862 // Package name of the application that loads the gpu driver. Total number
5863 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005864 optional string app_package_name = 1;
5865
5866 // Version code of the gpu driver this app loads.
5867 optional int64 driver_version_code = 2;
5868
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005869 // gl driver loading time info.
5870 optional GpuDriverLoadingTime gl_driver_loading_time = 3
5871 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005872
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005873 // Vulkan driver loading time info.
5874 optional GpuDriverLoadingTime vk_driver_loading_time = 4
5875 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005876}
Rafal Slawikd4e87572019-03-12 13:08:38 +00005877
5878/*
5879 * Logs the size of the system ion heap.
5880 *
5881 * Pulled from StatsCompanionService.
5882 */
5883message SystemIonHeapSize {
5884 // Size of the system ion heap in bytes.
5885 optional int64 size_in_bytes = 1;
5886}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08005887
5888/**
5889 * Push network stack events.
5890 *
5891 * Log from:
5892 * frameworks/base/packages/NetworkStack/
5893 */
5894message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08005895 // The id that indicates the event reported from NetworkStack.
5896 optional int32 event_id = 1;
5897 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08005898 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
5899}
Carmen Agimofa769c152019-03-04 14:39:14 +00005900
5901/**
5902 * Logs the apps that are installed on the external storage.
5903 * Pulled from:
5904 * StatsCompanionService
5905 */
5906message AppsOnExternalStorageInfo {
5907 // The type of the external storage.
5908 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
5909 // The name of the package that is installed on the external storage.
5910 optional string package_name = 2;
5911}