blob: d6ea7e6572c91a2334c08986c2338b93b97ae4be [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;
lifr030d23a2019-01-11 16:54:51 +0800190 NetworkDnsEventReported network_dns_event_reported = 116;
shawnlina75e82d2019-01-07 10:31:12 +0800191 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported = 117;
192 DocsUIPickResultReported docs_ui_pick_result_reported = 118;
193 DocsUISearchModeReported docs_ui_search_mode_reported = 119;
194 DocsUISearchTypeReported docs_ui_search_type_reported = 120;
Chiachang Wangf6bedc22019-01-14 11:54:32 +0800195 DataStallEvent data_stall_event = 121;
Christian Brunschenf86039e2018-12-21 12:26:14 +0000196 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000197 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800198 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800199 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800200 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
201 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000202 AppDowngraded app_downgraded = 128;
203 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
204 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800205 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
206 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800207 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800208 NfcErrorOccurred nfc_error_occurred = 134;
209 NfcStateChanged nfc_state_changed = 135;
210 NfcBeamOccurred nfc_beam_occurred = 136;
211 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
212 NfcTagOccurred nfc_tag_occurred = 138;
213 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
214 SeStateChanged se_state_changed = 140;
215 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800216 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800217 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800218 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800219 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800220 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800221 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyne5a37fb2019-02-08 13:10:36 -0800222 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500223 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800224 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Jack Hec27040a2019-01-09 20:54:41 -0800225 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
226 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
227 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
228 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
229 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
230 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
231 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
232 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
233 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He1021a612019-01-20 21:22:46 -0800234 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
235 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
236 BluetoothManufacturerInfoReported bluetooth_device_info_reported = 162;
237 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
238 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
239 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
240 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
241 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Alex Salod7c3eef2019-01-25 14:43:27 -0800242 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800243 ProcessStartTime process_start_time = 169;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -0800244 PermissionGrantRequestResultReported permission_grant_request_result_reported = 170;
Jack He815cdba2019-01-30 17:24:55 -0800245 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Michael Groover4a0ca942019-01-24 17:41:25 -0800246 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Steven Wu552f63f2019-02-05 13:41:36 -0500247 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
joshmccloskey8c3322e2019-01-09 18:25:57 -0800248 AssistGestureStageReported assist_gesture_stage_reported = 174;
249 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
250 AssistGestureProgressReported assist_gesture_progress_reported = 176;
Philip Quinn0eded622019-01-29 12:46:28 -0800251 TouchGestureClassified touch_gesture_classified = 177;
Andrei Onea4ad6d0c2019-02-08 13:54:12 +0000252 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true];
Hyunyoung Song80adf6be2019-01-30 09:59:30 -0800253 StyleUIChanged style_ui_changed = 179;
Fabian Kozynskibfd6d852019-02-15 15:08:16 -0500254 PrivacyIndicatorsInteracted privacy_indicators_interacted = 180;
Carmen Agimof6688a352019-01-30 19:36:04 +0000255 AppInstallOnExternalStorageReported app_install_on_external_storage_reported = 181;
Chiachang Wang0e88ebf2019-03-21 10:18:07 +0800256 NetworkStackReported network_stack_reported = 182;
Yao Chend54f9dd2017-10-17 17:37:48 +0000257 }
David Chenc8a43242017-10-17 16:23:28 -0700258
David Chen6e3e6cb2018-01-03 16:14:06 -0800259 // Pulled events will start at field 10000.
Rafal Slawikd4e87572019-03-12 13:08:38 +0000260 // Next: 10057
David Chenc8a43242017-10-17 16:23:28 -0700261 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800262 WifiBytesTransfer wifi_bytes_transfer = 10000;
263 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
264 MobileBytesTransfer mobile_bytes_transfer = 10002;
265 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800266 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800267 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800268 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800269 CpuTimePerFreq cpu_time_per_freq = 10008;
270 CpuTimePerUid cpu_time_per_uid = 10009;
271 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800272 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800273 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800274 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800275 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800276 SystemElapsedRealtime system_elapsed_realtime = 10014;
277 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800278 CpuActiveTime cpu_active_time = 10016;
279 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000280 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800281 RemainingBatteryCapacity remaining_battery_capacity = 10019;
282 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800283 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100284 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100285 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100286 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000287 DiskStats disk_stats = 10025;
288 DirectoryUsage directory_usage = 10026;
289 AppSize app_size = 10027;
290 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700291 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700292 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800293 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700294 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700295 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800296 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700297 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100298 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100299 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700300 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee60422018-11-09 12:27:37 -0800301 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
302 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
303 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000304 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800305 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800306 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800307 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000308 DebugElapsedClock debug_elapsed_clock = 10046;
309 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800310 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800311 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800312 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800313 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000314 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000315 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800316 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
317 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000318 SystemIonHeapSize system_ion_heap_size = 10056;
David Chenc8a43242017-10-17 16:23:28 -0700319 }
yroa1fe77c2018-02-26 14:22:54 -0800320
Bookatz76aafcf2018-09-17 16:17:10 -0700321 // DO NOT USE field numbers above 100,000 in AOSP.
322 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
323 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700324}
325
Yao Chend54f9dd2017-10-17 17:37:48 +0000326/**
Yangster-mac20877162017-12-22 17:19:39 -0800327 * This proto represents a node of an attribution chain.
328 * Note: All attribution chains are represented as a repeated field of type
329 * AttributionNode. It is understood that in such arrays, the order is that
330 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000331 */
Yangster-mac20877162017-12-22 17:19:39 -0800332message AttributionNode {
333 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800334 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800335
Yangster-mac20877162017-12-22 17:19:39 -0800336 // The (optional) string tag for an element in the attribution chain. If the
337 // element has no tag, it is encoded as an empty string.
338 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700339}
340
Yangster-mac48b3d622018-08-18 12:38:11 -0700341message KeyValuePair {
342 optional int32 key = 1;
343 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700344 int32 value_int = 2;
345 int64 value_long = 3;
346 string value_str = 4;
347 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700348 }
349}
350
351message KeyValuePairsAtom {
352 optional int32 uid = 1;
353 repeated KeyValuePair pairs = 2;
354}
355
Yao Chend54f9dd2017-10-17 17:37:48 +0000356/*
357 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800358 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000359 *
360 * RULES:
361 * - The field ids for each atom must start at 1, and count upwards by 1.
362 * Skipping field ids is not allowed.
363 * - These form an API, so renaming, renumbering or removing fields is
364 * not allowed between android releases. (This is not currently enforced,
365 * but there will be a tool to enforce this restriction).
366 * - The types must be built-in protocol buffer types, namely, no sub-messages
367 * are allowed (yet). The bytes type is also not allowed.
368 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800369 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000370 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800371 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000372 * - A field that is a uid should be a string field, tagged with the [xxx]
373 * annotation. The generated code on android will be represented by UIDs,
374 * and those UIDs will be translated in xxx to those strings.
375 *
376 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700377 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000378 * - If there is a UID, it goes first. Think in an object-oriented fashion.
379 * *****************************************************************************
380 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700381
Yao Chend54f9dd2017-10-17 17:37:48 +0000382/**
Yangster-mace16189a2018-08-26 12:20:16 -0700383 * Logs when the Thermal service HAL notifies the throttling start/stop events.
384 *
385 * Logged from:
386 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
387 */
388message ThermalThrottlingStateChanged {
389 optional android.os.TemperatureTypeEnum sensor_type = 1;
390
391 enum State {
392 UNKNOWN = 0;
393 START = 1;
394 STOP = 2;
395 }
396
397 optional State state = 2;
398
399 optional float temperature = 3;
400}
401
402/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000403 * Logs when the screen state changes.
404 *
405 * Logged from:
406 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
407 */
408message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800409 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700410 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700411}
Yao Chend54f9dd2017-10-17 17:37:48 +0000412
413/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700414 * Logs that the process state of the uid, as determined by ActivityManager
415 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000416 *
417 * Logged from:
418 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
419 */
Bookatzc1a050a2017-10-10 15:49:28 -0700420message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700421 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000422
Bookatzdb026a22018-01-10 19:01:56 -0800423 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700424 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000425}
426
427/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700428 * Logs process state change of a process, as per the activity manager.
429 *
430 * Logged from:
431 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
432 */
433message ProcessStateChanged {
434 optional int32 uid = 1;
435 optional string process_name = 2;
436 optional string package_name = 3;
437 // TODO: remove this when validation is done
438 optional int64 version = 5;
439 // The state, from frameworks/base/core/proto/android/app/enums.proto.
440 optional android.app.ProcessStateEnum state = 4;
441}
442
443/**
444 * Logs when ActivityManagerService sleep state is changed.
445 *
446 * Logged from:
447 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
448 */
449message ActivityManagerSleepStateChanged {
450 // TODO: import frameworks proto
451 enum State {
452 UNKNOWN = 0;
453 ASLEEP = 1;
454 AWAKE = 2;
455 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700456 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700457}
458
459/**
460 * Logs when system memory state changes.
461 *
462 * Logged from:
463 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
464 */
465message MemoryFactorStateChanged {
466 // TODO: import frameworks proto
467 enum State {
468 MEMORY_UNKNOWN = 0;
469 NORMAL = 1; // normal.
470 MODERATE = 2; // moderate memory pressure.
471 LOW = 3; // low memory.
472 CRITICAL = 4; // critical memory.
473
474 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700475 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700476}
477
478/**
479 * Logs when app is using too much cpu, according to ActivityManagerService.
480 *
481 * Logged from:
482 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
483 */
484message ExcessiveCpuUsageReported {
485 optional int32 uid = 1;
486 optional string process_name = 2;
487 optional string package_name = 3;
488 // package version. TODO: remove this when validation is done
489 optional int64 version = 4;
490}
491
492/**
493 * Logs when a cached process is killed, along with its pss.
494 *
495 * Logged from:
496 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
497 */
498message CachedKillReported {
499 optional int32 uid = 1;
500 optional string process_name = 2;
501 optional string package_name = 3;
502 // TODO: remove this when validation is done
503 optional int64 version = 5;
504 optional int64 pss = 4;
505}
506
507/**
508 * Logs when memory stats of a process is reported.
509 *
510 * Logged from:
511 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
512 */
513message ProcessMemoryStatReported {
514 optional int32 uid = 1;
515 optional string process_name = 2;
516 optional string package_name = 3;
517 //TODO: remove this when validation is done
518 optional int64 version = 9;
519 optional int64 pss = 4;
520 optional int64 uss = 5;
521 optional int64 rss = 6;
522 enum Type {
523 ADD_PSS_INTERNAL_SINGLE = 0;
524 ADD_PSS_INTERNAL_ALL_MEM = 1;
525 ADD_PSS_INTERNAL_ALL_POLL = 2;
526 ADD_PSS_EXTERNAL = 3;
527 ADD_PSS_EXTERNAL_SLOW = 4;
528 }
529 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800530 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700531}
532
533/**
Bookatzc1a050a2017-10-10 15:49:28 -0700534 * Logs that a process started, finished, crashed, or ANRed.
535 *
536 * Logged from:
537 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
538 */
539message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700540 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700541
David Chen0b5c90c2018-01-25 16:51:49 -0800542 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800543 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700544
Bookatzddccf0a2017-11-28 16:48:14 -0800545 // What lifecycle state the process changed to.
546 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800547 enum State {
548 FINISHED = 0;
549 STARTED = 1;
550 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800551 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800552 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700553}
554
Bookatzc1a050a2017-10-10 15:49:28 -0700555/**
556 * Logs when the ble scan state changes.
557 *
558 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700559 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700560 */
561message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800562 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700563
564 enum State {
565 OFF = 0;
566 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700567 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
568 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700569 }
570 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700571
Bookatze5ec0b42018-03-26 13:34:56 -0700572 // Does the scan have a filter.
573 optional bool is_filtered = 3;
574 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
575 optional bool is_first_match = 4;
576 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
577 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700578}
579
580/**
581 * Logs reporting of a ble scan finding results.
582 *
583 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700584 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700585 */
Bookatzae6738e2018-09-13 11:38:56 -0700586// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700587message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800588 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700589
590 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800591 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700592}
593
594/**
595 * Logs when a sensor state changes.
596 *
597 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700598 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700599 */
600message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800601 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700602
Bookatzc1a050a2017-10-10 15:49:28 -0700603 // The id (int) of the sensor.
604 optional int32 sensor_id = 2;
605
606 enum State {
607 OFF = 0;
608 ON = 1;
609 }
610 optional State state = 3;
611}
612
Bookatzc1a050a2017-10-10 15:49:28 -0700613/**
614 * Logs when GPS state changes.
615 *
616 * Logged from:
617 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
618 */
619message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800620 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700621
622 enum State {
623 OFF = 0;
624 ON = 1;
625 }
626 optional State state = 2;
627}
628
Bookatz48d362e2018-11-06 15:49:08 -0800629/**
630 * Logs when GPS signal quality.
631 *
632 * Logged from:
633 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
634 */
635message GpsSignalQualityChanged {
636 optional android.server.location.GpsSignalQualityEnum level = 1;
637}
638
Bookatzc1a050a2017-10-10 15:49:28 -0700639
640/**
641 * Logs when a sync manager sync state changes.
642 *
643 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700644 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700645 */
646message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800647 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700648
David Chen0b5c90c2018-01-25 16:51:49 -0800649 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800650 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700651
652 enum State {
653 OFF = 0;
654 ON = 1;
655 }
656 optional State state = 3;
657}
658
Yangster-mac96353002018-09-05 11:18:55 -0700659/*
660 * Deferred job stats.
661 *
662 * Logged from:
663 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
664*/
665message DeferredJobStatsReported {
666 repeated AttributionNode attribution_node = 1;
667
668 // Number of jobs deferred.
669 optional int32 num_jobs_deferred = 2;
670
671 // Time since the last job runs.
672 optional int64 time_since_last_job_millis = 3;
673}
674
Bookatzc1a050a2017-10-10 15:49:28 -0700675/**
676 * Logs when a job scheduler job state changes.
677 *
678 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700679 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700680 */
681message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800682 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700683
684 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800685 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700686
687 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800688 FINISHED = 0;
689 STARTED = 1;
690 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700691 }
692 optional State state = 3;
693
Tej Singh33a412b2018-03-16 18:43:59 -0700694 // The reason a job has stopped.
695 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700696 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700697 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700698}
699
700/**
701 * Logs when the audio state changes.
702 *
703 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700704 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700705 */
706message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800707 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700708
709 enum State {
710 OFF = 0;
711 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700712 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
713 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700714 }
715 optional State state = 2;
716}
717
718/**
719 * Logs when the video codec state changes.
720 *
721 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700722 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700723 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800724message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800725 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700726
727 enum State {
728 OFF = 0;
729 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700730 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
731 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700732 }
733 optional State state = 2;
734}
735
736/**
737 * Logs when the flashlight state changes.
738 *
739 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700740 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700741 */
742message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800743 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700744
745 enum State {
746 OFF = 0;
747 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700748 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
749 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700750 }
751 optional State state = 2;
752}
753
754/**
755 * Logs when the camera state changes.
756 *
757 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700758 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700759 */
760message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800761 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700762
763 enum State {
764 OFF = 0;
765 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700766 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
767 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700768 }
769 optional State state = 2;
770}
771
772/**
773 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000774 *
775 * Logged from:
776 * TODO
777 */
Bookatzd6746242017-10-24 18:39:35 -0700778message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800779 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000780
Bookatz1a1b0462018-01-12 11:47:03 -0800781 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
782 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700783 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700784
785 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
786 optional string tag = 3;
787
788 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800789 RELEASE = 0;
790 ACQUIRE = 1;
791 CHANGE_RELEASE = 2;
792 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700793 }
794 optional State state = 4;
795}
796
797/**
Bookatzc1a050a2017-10-10 15:49:28 -0700798 * Logs when a partial wakelock is considered 'long' (over 1 min).
799 *
800 * Logged from:
801 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
802 */
803message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800804 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700805
Yao Chend54f9dd2017-10-17 17:37:48 +0000806 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
807 optional string tag = 2;
808
Bookatzc1a050a2017-10-10 15:49:28 -0700809 // TODO: I have no idea what this is.
810 optional string history_tag = 3;
811
812 enum State {
813 OFF = 0;
814 ON = 1;
815 }
816 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000817}
818
Bookatzc1a050a2017-10-10 15:49:28 -0700819/**
Bookatza66083f2018-09-20 17:24:00 -0700820 * Logs when the device is interactive, according to the PowerManager Notifier.
821 *
822 * Logged from:
823 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
824 */
825message InteractiveStateChanged {
826 enum State {
827 OFF = 0;
828 ON = 1;
829 }
830 optional State state = 1;
831}
832
833/**
Bookatzc1a050a2017-10-10 15:49:28 -0700834 * Logs Battery Saver state change.
835 *
836 * Logged from:
837 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
838 */
839message BatterySaverModeStateChanged {
840 enum State {
841 OFF = 0;
842 ON = 1;
843 }
844 optional State state = 1;
845}
846
847/**
848 * Logs Doze mode state change.
849 *
850 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800851 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700852 */
853message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800854 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800855}
856
857
858/**
859 * Logs state change of Doze mode including maintenance windows.
860 *
861 * Logged from:
862 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
863 */
864message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800865 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700866}
867
868/**
869 * Logs screen brightness level.
870 *
871 * Logged from:
872 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
873 */
874message ScreenBrightnessChanged {
875 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
876 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700877}
878
879/**
880 * Logs battery level (percent full, from 0 to 100).
881 *
882 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700883 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700884 */
885message BatteryLevelChanged {
886 // Battery level. Should be in [0, 100].
887 optional int32 battery_level = 1;
888}
889
890/**
891 * Logs change in charging status of the device.
892 *
893 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700894 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700895 */
896message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800897 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
898 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700899}
900
901/**
902 * Logs whether the device is plugged in, and what power source it is using.
903 *
904 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700905 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700906 */
907message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800908 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
909 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700910}
911
Bookatz8c6571b2017-10-24 15:04:41 -0700912/**
913 * Logs when an app's wakeup alarm fires.
914 *
915 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700916 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700917 */
918message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800919 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800920
921 // Name of the wakeup alarm.
922 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700923
924 // Name of source package (for historical reasons, since BatteryStats tracked it).
925 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800926}
927
928/**
929 * Logs when an an app causes the mobile radio to change state.
930 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
931 *
932 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700933 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800934 */
935message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800936 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800937
Bookatz1a1b0462018-01-12 11:47:03 -0800938 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
939 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800940}
941
942/**
943 * Logs when an an app causes the wifi radio to change state.
944 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
945 *
946 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700947 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800948 */
949message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800950 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800951
Bookatz1a1b0462018-01-12 11:47:03 -0800952 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
953 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700954}
955
956/**
957 * Logs kernel wakeup reasons and aborts.
958 *
959 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700960 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700961 */
962message KernelWakeupReported {
963 // Name of the kernel wakeup reason (or abort).
964 optional string wakeup_reason_name = 1;
965
966 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800967 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700968}
969
970/**
Bookatzda1798c2018-12-13 14:16:00 -0800971 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800972 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800973 *
974 * Logged from:
975 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
976 */
977message WifiEnabledStateChanged {
978 enum State {
979 OFF = 0;
980 ON = 1;
981 }
982 optional State state = 1;
983}
984
985/**
986 * 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 -0800987 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
988 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800989 *
990 * Logged from:
991 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
992 */
993message WifiRunningStateChanged {
994 repeated AttributionNode attribution_node = 1;
995
996 enum State {
997 OFF = 0;
998 ON = 1;
999 }
1000 optional State state = 2;
1001}
1002
1003/**
Bookatze5885242017-10-24 20:10:31 -07001004 * Logs wifi locks held by an app.
1005 *
1006 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001007 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001008 */
1009message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001010 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001011
1012 enum State {
1013 OFF = 0;
1014 ON = 1;
1015 }
1016 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001017
1018 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1019 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001020}
1021
1022/**
1023 * Logs wifi signal strength changes.
1024 *
1025 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001026 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001027 */
1028message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001029 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1030 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001031}
1032
1033/**
1034 * Logs wifi scans performed by an app.
1035 *
1036 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001037 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001038 */
1039message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001040 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001041
1042 enum State {
1043 OFF = 0;
1044 ON = 1;
1045 }
1046 optional State state = 2;
1047}
1048
1049/**
Tej Singh4503e102018-01-04 14:35:01 -08001050 * Logs wifi multicast locks held by an app
1051 *
1052 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001053 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001054 */
1055message WifiMulticastLockStateChanged {
1056 repeated AttributionNode attribution_node = 1;
1057
1058 enum State {
1059 OFF = 0;
1060 ON = 1;
1061 }
1062 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001063
1064 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001065}
1066
1067/**
Tej Singh1ea42892018-01-19 09:27:00 -08001068 * Logs shutdown reason and duration on next boot.
1069 *
1070 * Logged from:
1071 * frameworks/base/core/java/com/android/server/BootReceiver.java
1072 */
1073message ShutdownSequenceReported {
1074 // True if shutdown is for a reboot. Default: false if we do not know.
1075 optional bool reboot = 1;
1076
1077 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1078 optional string reason = 2;
1079
1080 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1081 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001082 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001083
1084 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001085 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001086}
1087
Tej Singh6483ea42018-01-25 17:45:49 -08001088
1089/**
1090 * Logs boot reason and duration.
1091 *
1092 * Logged from:
1093 * system/core/bootstat/bootstat.cpp
1094 */
1095message BootSequenceReported {
1096 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1097 // Default: "<EMPTY>" if not available.
1098 optional string bootloader_reason = 1;
1099
1100 // Reason for system boot. Eg. bootloader, reboot,userrequested
1101 // Default: "<EMPTY>" if not available.
1102 optional string system_reason = 2;
1103
1104 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001105 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001106
1107 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001108 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001109
1110 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001111 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001112
1113 // Time since last boot in ms. Default: 0 if not available.
1114 optional int64 time_since_last_boot = 6;
1115}
1116
Tej Singhc477d9c2018-02-05 18:31:39 -08001117
1118/**
1119 * Logs call state and disconnect cause (if applicable).
1120 *
1121 * Logged from:
1122 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1123 */
1124message CallStateChanged {
1125 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1126 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1127 optional android.telecom.CallStateEnum call_state = 1;
1128
1129 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1130 // This value is only applicable when the call_state is DISCONNECTED, and
1131 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1132 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1133 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1134
1135 // True if the call is self-managed, which are apps that use the
1136 // telecom infrastructure to make their own calls.
1137 optional bool self_managed = 3;
1138
1139 // True if call is external. External calls are calls on connected Wear
1140 // devices but show up in Telecom so the user can pull them onto the device.
1141 optional bool external_call = 4;
1142}
1143
Tej Singh1ea42892018-01-19 09:27:00 -08001144/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001145 * Logs keyguard state. The keyguard is the lock screen.
1146 *
1147 * Logged from:
1148 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1149 */
1150message KeyguardStateChanged {
1151 enum State {
1152 UNKNOWN = 0;
1153 // The keyguard is hidden when the phone is unlocked.
1154 HIDDEN = 1;
1155 // The keyguard is shown when the phone is locked (screen turns off).
1156 SHOWN= 2;
1157 // The keyguard is occluded when something is overlaying the keyguard.
1158 // Eg. Opening the camera while on the lock screen.
1159 OCCLUDED = 3;
1160 }
1161 optional State state = 1;
1162}
1163
1164/**
1165 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1166 * prompts the user to enter a password (pattern, pin, etc).
1167 *
1168 * Logged from:
1169 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1170 */
1171
1172message KeyguardBouncerStateChanged {
1173 enum State {
1174 UNKNOWN = 0;
1175 // Bouncer is hidden, either as a result of successfully entering the
1176 // password, screen timing out, or user going back to lock screen.
1177 HIDDEN = 1;
1178 // This is when the user is being prompted to enter the password.
1179 SHOWN = 2;
1180 }
1181 optional State state = 1;
1182}
1183
1184/**
1185 * Logs the result of entering a password into the keyguard bouncer.
1186 *
1187 * Logged from:
1188 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1189 */
1190message KeyguardBouncerPasswordEntered {
1191 enum BouncerResult {
1192 UNKNOWN = 0;
1193 // The password entered was incorrect.
1194 FAILURE = 1;
1195 // The password entered was correct.
1196 SUCCESS = 2;
1197 }
1198 optional BouncerResult result = 1;
1199}
1200
Tej Singha883b372018-02-15 11:30:01 -08001201/*
1202 * Logs changes to the configuration of the device. The configuration is defined
1203 * in frameworks/base/core/java/android/content/res/Configuration.java
1204 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1205 * Please go there to interpret the possible values each field can be.
1206 *
1207 * Logged from:
1208 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1209 */
1210message ResourceConfigurationChanged {
1211 // Bit mask of color capabilities of the screen.
1212 // Contains information about the color gamut and hdr mode of the screen.
1213 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001214 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001215
1216 // The target screen density being rendered to.
1217 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001218 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001219
1220 // Current user preference for the scaling factor for fonts,
1221 // relative to the base density scaling.
1222 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001223 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001224
1225 // Flag indicating whether the hard keyboard is hidden.
1226 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001227 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001228
1229 // The type of keyboard attached to the device.
1230 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1231 optional int32 keyboard = 5;
1232
1233 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1234 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001235 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001236
1237 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1238 // 0 if undefined.
1239 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1240 optional int32 mcc = 7;
1241
1242 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1243 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1244 // MNC_ZERO symbol defined in Configuration.java.
1245 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1246 optional int32 mnc = 8;
1247
1248 // The kind of navigation available on the device.
1249 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1250 optional int32 navigation = 9;
1251
1252 // Flag indicating whether the navigation is available.
1253 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001254 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001255
1256 // Overall orientation of the screen.
1257 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1258 optional int32 orientation = 11;
1259
1260 // The current height of the available screen space, in dp units.
1261 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001262 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001263
1264 // Bit mask of overall layout of the screen.
1265 // Contains information about screen size, whether the screen is wider/taller
1266 // than normal, whether the screen layout is right-tl-left or left-to-right,
1267 // and whether the screen has a rounded shape.
1268 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001269 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001270
1271 // Current width of the available screen space, in dp units.
1272 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001273 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001274
1275 // The smallest screen size an application will see in normal operation.
1276 // This is the smallest value of both screenWidthDp and screenHeightDp
1277 // in portrait and landscape.
1278 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001279 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001280
1281 // The type of touch screen attached to the device.
1282 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1283 optional int32 touchscreen = 16;
1284
1285 // Bit mask of the ui mode.
1286 // Contains information about the overall ui mode of the device.
1287 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1288 // Also contains information about whether the device is in night mode.
1289 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001290 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001291}
1292
Tej Singheee317b2018-03-07 19:28:05 -08001293
1294/**
1295 * Logs changes in the connection state of the mobile radio.
1296 *
1297 * Logged from:
1298 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1299 */
1300message MobileConnectionStateChanged {
1301 // States are from the state machine DataConnection.java.
1302 enum State {
1303 UNKNOWN = 0;
1304 // The connection is inactive, or disconnected.
1305 INACTIVE = 1;
1306 // The connection is being activated, or connecting.
1307 ACTIVATING = 2;
1308 // The connection is active, or connected.
1309 ACTIVE = 3;
1310 // The connection is disconnecting.
1311 DISCONNECTING = 4;
1312 // The connection is disconnecting after creating a connection.
1313 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1314 }
1315 optional State state = 1;
1316 // For multi-sim phones, this distinguishes between the sim cards.
1317 optional int32 sim_slot_index = 2;
1318 // Used to identify the connection. Starts at 0 and increments by 1 for
1319 // every new network created. Resets whenever the device reboots.
1320 optional int32 data_connection_id = 3;
1321 // A bitmask for the capabilities of this connection.
1322 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1323 // Default value (if we have no information): 0
1324 optional int64 capabilities = 4;
1325 // If this connection has internet.
1326 // This just checks if the DEFAULT bit of capabilities is set.
1327 optional bool has_internet = 5;
1328}
1329
1330/**
1331 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1332 *
1333 * Logged from:
1334 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1335 */
1336message MobileRadioTechnologyChanged {
1337 optional android.telephony.NetworkTypeEnum state = 1;
1338 // For multi-sim phones, this distinguishes between the sim cards.
1339 optional int32 sim_slot_index = 2;
1340}
1341
Andrew Chantb56388b2018-03-22 21:07:33 -07001342/**
1343 * Logs the VID and PID of any connected USB devices.
1344 *
1345 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1346 *
1347 * Logged by Vendor.
1348 */
1349message UsbDeviceAttached {
1350 optional int32 vid = 1;
1351 optional int32 pid = 2;
1352 optional bool has_audio = 3;
1353 optional bool has_hid = 4;
1354 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001355 enum State {
1356 STATE_DISCONNECTED = 0;
1357 STATE_CONNECTED = 1;
1358 }
1359 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001360 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001361}
1362
Tej Singheee317b2018-03-07 19:28:05 -08001363
Tej Singhdd7bd352018-02-09 19:33:15 -08001364/**
Tej Singh5d991e12018-03-09 19:48:11 -08001365 * Logs when Bluetooth is enabled and disabled.
1366 *
1367 * Logged from:
1368 * services/core/java/com/android/server/BluetoothManagerService.java
1369 */
1370message BluetoothEnabledStateChanged {
1371 repeated AttributionNode attribution_node = 1;
1372 // Whether or not bluetooth is enabled on the device.
1373 enum State {
1374 UNKNOWN = 0;
1375 ENABLED = 1;
1376 DISABLED = 2;
1377 }
1378 optional State state = 2;
1379 // The reason for being enabled/disabled.
1380 // Eg. Airplane mode, crash, application request.
1381 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1382 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001383 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001384}
1385
1386/**
Jack Hed9837c82019-01-09 01:19:13 -08001387 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001388 *
1389 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001390 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1391 *
1392 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001393 */
1394message BluetoothConnectionStateChanged {
1395 // The state of the connection.
1396 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1397 optional android.bluetooth.ConnectionStateEnum state = 1;
1398 // An identifier that can be used to match connect and disconnect events.
1399 // Currently is last two bytes of a hash of a device level ID and
1400 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001401 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1402 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001403 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1404 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001405 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001406 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001407 // An identifier that can be used to match events for this device.
1408 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1409 // Salt: Randomly generated 256 bit value
1410 // Hash algorithm: HMAC-SHA256
1411 // Size: 32 byte
1412 // Default: null or empty if the device identifier is not known
1413 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1414}
1415
1416/**
1417 * Logs when a Bluetooth device connects and disconnects over ACL
1418 *
1419 * Logged from:
1420 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1421 *
1422 * Next Tag: 3
1423 */
1424message BluetoothAclConnectionStateChanged {
1425 // An identifier that can be used to match events for this device.
1426 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1427 // Salt: Randomly generated 256 bit value
1428 // Hash algorithm: HMAC-SHA256
1429 // Size: 32 byte
1430 // Default: null or empty if the device identifier is not known
1431 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1432 // The state of the connection.
1433 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1434 optional android.bluetooth.ConnectionStateEnum state = 2;
1435}
1436
1437/**
1438 * Logs when a Bluetooth device connects and disconnects over SCO
1439 *
1440 * Logged from:
1441 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1442 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1443 *
1444 * Next Tag: 4
1445 */
1446message BluetoothScoConnectionStateChanged {
1447 // An identifier that can be used to match events for this device.
1448 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1449 // Salt: Randomly generated 256 bit value
1450 // Hash algorithm: HMAC-SHA256
1451 // Size: 32 byte
1452 // Default: null or empty if the device identifier is not known
1453 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1454 // The state of the connection.
1455 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1456 optional android.bluetooth.ConnectionStateEnum state = 2;
1457 // Codec used for this SCO connection
1458 // Default: UNKNOWN
1459 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001460}
1461
Jack Hec27040a2019-01-09 20:54:41 -08001462/**
1463 * Logged when active device of a profile changes
1464 *
1465 * Logged from:
1466 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1467 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1468 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1469 */
1470message BluetoothActiveDeviceChanged {
1471 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1472 // From android.bluetooth.BluetoothProfile
1473 optional int32 bt_profile = 1;
1474 // An identifier that can be used to match events for this new active device.
1475 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1476 // Salt: Randomly generated 256 bit value
1477 // Hash algorithm: HMAC-SHA256
1478 // Size: 32 byte
1479 // Default: null or empty if there is no active device for this profile
1480 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1481}
1482
Jack Heab86dbd22018-12-18 15:43:27 -08001483// Logs when there is an event affecting Bluetooth device's link layer connection.
1484// - This event is triggered when there is a related HCI command or event
1485// - Users of this metrics can deduce Bluetooth device's connection state from these events
1486// - HCI commands are logged before the command is sent, after receiving command status, and after
1487// receiving command complete
1488// - HCI events are logged when they arrive
1489//
1490// Low level log from system/bt
1491//
1492// Bluetooth classic commands:
1493// - CMD_CREATE_CONNECTION
1494// - CMD_DISCONNECT
1495// - CMD_CREATE_CONNECTION_CANCEL
1496// - CMD_ACCEPT_CONNECTION_REQUEST
1497// - CMD_REJECT_CONNECTION_REQUEST
1498// - CMD_SETUP_ESCO_CONNECTION
1499// - CMD_ACCEPT_ESCO_CONNECTION
1500// - CMD_REJECT_ESCO_CONNECTION
1501// - CMD_ENH_SETUP_ESCO_CONNECTION
1502// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1503//
1504// Bluetooth low energy commands:
1505// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1506// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1507// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1508// - CMD_BLE_CLEAR_WHITE_LIST
1509// - CMD_BLE_ADD_WHITE_LIST
1510// - CMD_BLE_REMOVE_WHITE_LIST
1511//
1512// Bluetooth classic events:
1513// - EVT_CONNECTION_COMP
1514// - EVT_CONNECTION_REQUEST
1515// - EVT_DISCONNECTION_COMP
1516// - EVT_ESCO_CONNECTION_COMP
1517// - EVT_ESCO_CONNECTION_CHANGED
1518//
1519// Bluetooth low energy meta events:
1520// - BLE_EVT_CONN_COMPLETE_EVT
1521// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1522//
1523// Next tag: 10
1524message BluetoothLinkLayerConnectionEvent {
1525 // An identifier that can be used to match events for this device.
1526 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1527 // Salt: Randomly generated 256 bit value
1528 // Hash algorithm: HMAC-SHA256
1529 // Size: 32 byte
1530 // Default: null or empty if the device identifier is not known
1531 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1532 // Connection handle of this connection if available
1533 // Range: 0x0000 - 0x0EFF (12 bits)
1534 // Default: 0xFFFF if the handle is unknown
1535 optional int32 connection_handle = 2;
1536 // Direction of the link
1537 // Default: DIRECTION_UNKNOWN
1538 optional android.bluetooth.DirectionEnum direction = 3;
1539 // Type of this link
1540 // Default: LINK_TYPE_UNKNOWN
1541 optional android.bluetooth.LinkTypeEnum type = 4;
1542
1543 // Reason metadata for this link layer connection event, rules for interpretation:
1544 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1545 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1546 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1547 // set and valid, ignore hci_ble_event
1548
1549 // HCI command associated with this event
1550 // Default: CMD_UNKNOWN
1551 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1552 // HCI event associated with this event
1553 // Default: EVT_UNKNOWN
1554 optional android.bluetooth.hci.EventEnum hci_event = 6;
1555 // HCI BLE meta event associated with this event
1556 // Default: BLE_EVT_UNKNOWN
1557 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1558 // HCI command status code if this is triggerred by hci_cmd
1559 // Default: STATUS_UNKNOWN
1560 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1561 // HCI reason code associated with this event
1562 // Default: STATUS_UNKNOWN
1563 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1564}
1565
Howard Roe103fe22019-01-17 16:52:16 -08001566/**
1567 * Logs when a module is rolled back by Watchdog.
1568 *
1569 * Logged from: Rollback Manager
1570 */
1571message WatchdogRollbackOccurred {
1572 enum RollbackType {
1573 UNKNOWN = 0;
1574 ROLLBACK_INITIATE = 1;
1575 ROLLBACK_SUCCESS = 2;
1576 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001577 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001578 }
1579 optional RollbackType rollback_type = 1;
1580
1581 optional string package_name = 2;
1582
1583 optional int32 package_version_code = 3;
1584}
1585
Jack Hec27040a2019-01-09 20:54:41 -08001586/**
1587 * Logs when there is a change in Bluetooth A2DP playback state
1588 *
1589 * Logged from:
1590 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1591 */
1592message BluetoothA2dpPlaybackStateChanged {
1593 // An identifier that can be used to match events for this device.
1594 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1595 // Salt: Randomly generated 256 bit value
1596 // Hash algorithm: HMAC-SHA256
1597 // Size: 32 byte
1598 // Default: null or empty if the device identifier is not known
1599 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1600 // Current playback state
1601 // Default: PLAYBACK_STATE_UNKNOWN
1602 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1603 // Current audio coding mode
1604 // Default: AUDIO_CODING_MODE_UNKNOWN
1605 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1606}
1607
1608/**
1609 * Logs when there is a change in A2DP codec config for a particular remote device
1610 *
1611 * Logged from:
1612 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1613 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1614 */
1615message BluetoothA2dpCodecConfigChanged {
1616 // An identifier that can be used to match events for this device.
1617 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1618 // Salt: Randomly generated 256 bit value
1619 // Hash algorithm: HMAC-SHA256
1620 // Size: 32 byte
1621 // Default: null or empty if the device identifier is not known
1622 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1623 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1624 // Default SOURCE_CODEC_TYPE_INVALID
1625 optional int32 codec_type = 2;
1626 // Codec priroity, the higher the more preferred, -1 for disabled
1627 // Default: CODEC_PRIORITY_DEFAULT
1628 optional int32 codec_priority = 3;
1629 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1630 // Default: SAMPLE_RATE_NONE
1631 optional int32 sample_rate = 4;
1632 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1633 // Default: BITS_PER_SAMPLE_NONE
1634 optional int32 bits_per_sample = 5;
1635 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1636 // Default: CHANNEL_MODE_NONE
1637 optional int32 channel_mode = 6;
1638 // Codec specific values
1639 // Default 0
1640 optional int64 codec_specific_1 = 7;
1641 optional int64 codec_specific_2 = 8;
1642 optional int64 codec_specific_3 = 9;
1643 optional int64 codec_specific_4 = 10;
1644}
1645
1646/**
1647 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1648 * Each codec's capability is logged separately due to statsd restriction
1649 *
1650 * Logged from:
1651 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1652 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1653 */
1654message BluetoothA2dpCodecCapabilityChanged {
1655 // An identifier that can be used to match events for this device.
1656 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1657 // Salt: Randomly generated 256 bit value
1658 // Hash algorithm: HMAC-SHA256
1659 // Size: 32 byte
1660 // Default: null or empty if the device identifier is not known
1661 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1662 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1663 // Default SOURCE_CODEC_TYPE_INVALID
1664 optional int32 codec_type = 2;
1665 // Codec priroity, the higher the more preferred, -1 for disabled
1666 // Default: CODEC_PRIORITY_DEFAULT
1667 optional int32 codec_priority = 3;
1668 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1669 // in BluetoothCodecConfig
1670 // Default: empty and SAMPLE_RATE_NONE for individual item
1671 optional int32 sample_rate = 4;
1672 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1673 // in BluetoothCodecConfig
1674 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1675 optional int32 bits_per_sample = 5;
1676 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1677 // BluetoothCodecConfig
1678 // Default: empty and CHANNEL_MODE_NONE for individual item
1679 optional int32 channel_mode = 6;
1680 // Codec specific values
1681 // Default 0
1682 optional int64 codec_specific_1 = 7;
1683 optional int64 codec_specific_2 = 8;
1684 optional int64 codec_specific_3 = 9;
1685 optional int64 codec_specific_4 = 10;
1686}
1687
1688/**
1689 * Logs when A2DP failed to read from PCM source.
1690 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1691 *
1692 * Logged from:
1693 * system/bt
1694 */
1695message BluetoothA2dpAudioUnderrunReported {
1696 // An identifier that can be used to match events for this device.
1697 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1698 // Salt: Randomly generated 256 bit value
1699 // Hash algorithm: HMAC-SHA256
1700 // Size: 32 byte
1701 // Default: null or empty if the device identifier is not known
1702 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1703 // Encoding interval in nanoseconds
1704 // Default: 0
1705 optional int64 encoding_interval_nanos = 2;
1706 // Number of bytes of PCM data that could not be read from the source
1707 // Default: 0
1708 optional int32 num_missing_pcm_bytes = 3;
1709}
1710
1711/**
1712 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1713 * buffer queue is full and we have to drop data
1714 *
1715 * Logged from:
1716 * system/bt
1717 */
1718message BluetoothA2dpAudioOverrunReported {
1719 // An identifier that can be used to match events for this device.
1720 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1721 // Salt: Randomly generated 256 bit value
1722 // Hash algorithm: HMAC-SHA256
1723 // Size: 32 byte
1724 // Default: null or empty if the device identifier is not known
1725 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1726 // Encoding interval in nanoseconds
1727 // Default: 0
1728 optional int64 encoding_interval_nanos = 2;
1729 // Number of buffers dropped in this event
1730 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1731 // Default: 0
1732 optional int32 num_dropped_buffers = 3;
1733 // Number of encoded buffers dropped in this event
1734 // Default 0
1735 optional int32 num_dropped_encoded_frames = 4;
1736 // Number of encoded bytes dropped in this event
1737 // Default: 0
1738 optional int32 num_dropped_encoded_bytes = 5;
1739}
1740
1741/**
1742 * Logs when we receive reports regarding a device's RSSI value
1743 *
1744 * Logged from:
1745 * system/bt
1746 */
1747message BluetoothDeviceRssiReported {
1748 // An identifier that can be used to match events for this device.
1749 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1750 // Salt: Randomly generated 256 bit value
1751 // Hash algorithm: HMAC-SHA256
1752 // Size: 32 byte
1753 // Default: null or empty if the device identifier is not known
1754 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1755 // Connection handle of this connection if available
1756 // Range: 0x0000 - 0x0EFF (12 bits)
1757 // Default: 0xFFFF if the handle is unknown
1758 optional int32 connection_handle = 2;
1759 // HCI command status code if this is triggerred by hci_cmd
1760 // Default: STATUS_UNKNOWN
1761 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1762 // BR/EDR
1763 // Range: -128 ≤ N ≤ 127 (signed integer)
1764 // Units: dB
1765 // LE:
1766 // Range: -127 to 20, 127 (signed integer)
1767 // Units: dBm
1768 // Invalid when an out of range value is reported
1769 optional int32 rssi = 4;
1770}
1771
1772/**
1773 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1774 *
1775 * Logged from:
1776 * system/bt
1777 */
1778message BluetoothDeviceFailedContactCounterReported {
1779 // An identifier that can be used to match events for this device.
1780 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1781 // Salt: Randomly generated 256 bit value
1782 // Hash algorithm: HMAC-SHA256
1783 // Size: 32 byte
1784 // Default: null or empty if the device identifier is not known
1785 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1786 // Connection handle of this connection if available
1787 // Range: 0x0000 - 0x0EFF (12 bits)
1788 // Default: 0xFFFF if the handle is unknown
1789 optional int32 connection_handle = 2;
1790 // HCI command status code if this is triggerred by hci_cmd
1791 // Default: STATUS_UNKNOWN
1792 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1793 // Number of consecutive failed contacts for a connection corresponding to the Handle
1794 // Range: uint16_t, 0-0xFFFF
1795 // Default: 0xFFFFF
1796 optional int32 failed_contact_counter = 4;
1797}
1798
1799/**
1800 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1801 *
1802 * Logged from:
1803 * system/bt
1804 */
1805message BluetoothDeviceTxPowerLevelReported {
1806 // An identifier that can be used to match events for this device.
1807 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1808 // Salt: Randomly generated 256 bit value
1809 // Hash algorithm: HMAC-SHA256
1810 // Size: 32 byte
1811 // Default: null or empty if the device identifier is not known
1812 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1813 // Connection handle of this connection if available
1814 // Range: 0x0000 - 0x0EFF (12 bits)
1815 // Default: 0xFFFF if the handle is unknown
1816 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001817 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001818 // Default: STATUS_UNKNOWN
1819 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1820 // Range: -30 ≤ N ≤ 20
1821 // Units: dBm
1822 // Invalid when an out of range value is reported
1823 optional int32 transmit_power_level = 4;
1824}
Jack Heab86dbd22018-12-18 15:43:27 -08001825
Tej Singh5d991e12018-03-09 19:48:11 -08001826/**
Jack He1021a612019-01-20 21:22:46 -08001827 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1828 * receiving an HCI command from the host
1829 *
1830 * Logged from: system/bt
1831 */
1832message BluetoothHciTimeoutReported {
1833 // HCI command associated with this event
1834 // Default: CMD_UNKNOWN
1835 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1836}
1837
1838/**
1839 * Logs when we receive Bluetooth Link Quality Report event from the controller
1840 * See Android Bluetooth HCI specification for more details
1841 *
1842 * Note: all count and bytes field are counted since last event
1843 *
1844 * Logged from: system/bt
1845 */
1846message BluetoothQualityReportReported {
1847 // Quality report ID
1848 // Original type: uint8_t
1849 // Default: BQR_ID_UNKNOWN
1850 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1851 // Packet type of the connection
1852 // Original type: uint8_t
1853 // Default: BQR_PACKET_TYPE_UNKNOWN
1854 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1855 // Connection handle of the connection
1856 // Original type: uint16_t
1857 optional int32 connection_handle = 3;
1858 // Performing Role for the connection
1859 // Original type: uint8_t
1860 optional int32 connection_role = 4;
1861 // Current Transmit Power Level for the connection. This value is the same as the controller's
1862 // response to the HCI_Read_Transmit_Power_Level HCI command
1863 // Original type: uint8_t
1864 optional int32 tx_power_level = 5;
1865 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1866 // absolute receiver signal strength value
1867 // Original type: int8_t
1868 optional int32 rssi = 6;
1869 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1870 // channels used by the link currently
1871 // Original type: uint8_t
1872 optional int32 snr = 7;
1873 // Indicates the number of unused channels in AFH_channel_map
1874 // Original type: uint8_t
1875 optional int32 unused_afh_channel_count = 8;
1876 // Indicates the number of the channels which are interfered and quality is bad but are still
1877 // selected for AFH
1878 // Original type: uint8_t
1879 optional int32 afh_select_unideal_channel_count = 9;
1880 // Current Link Supervision Timeout Setting
1881 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1882 // Original type: uint16_t
1883 optional int32 lsto = 10;
1884 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1885 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1886 // 0x01 (Piconet Clock)
1887 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1888 // Original type: uint32_t
1889 optional int64 connection_piconet_clock = 11;
1890 // The count of retransmission
1891 // Original type: uint32_t
1892 optional int64 retransmission_count = 12;
1893 // The count of no RX
1894 // Original type: uint32_t
1895 optional int64 no_rx_count = 13;
1896 // The count of NAK (Negative Acknowledge)
1897 // Original type: uint32_t
1898 optional int64 nak_count = 14;
1899 // Controller timestamp of last TX ACK
1900 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1901 // Original type: uint32_t
1902 optional int64 last_tx_ack_timestamp = 15;
1903 // The count of Flow-off (STOP)
1904 // Original type: uint32_t
1905 optional int64 flow_off_count = 16;
1906 // Controller timestamp of last Flow-on (GO)
1907 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1908 // Original type: uint32_t
1909 optional int64 last_flow_on_timestamp = 17;
1910 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1911 // Original type: uint32_t
1912 optional int64 buffer_overflow_bytes = 18;
1913 // Buffer underflow count (in byte) since last event
1914 // Original type: uint32_t
1915 optional int64 buffer_underflow_bytes = 19;
1916}
1917
1918/**
1919 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1920 *
1921 * Notes:
1922 * - Each event can be partially filled as we might learn different pieces of device
1923 * information at different time
1924 * - Multiple device info events can be combined to give more complete picture
1925 * - When multiple device info events tries to describe the same information, the
1926 * later one wins
1927 *
1928 * Logged from:
1929 * packages/apps/Bluetooth
1930 */
1931message BluetoothManufacturerInfoReported {
1932 // An identifier that can be used to match events for this device.
1933 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1934 // Salt: Randomly generated 256 bit value
1935 // Hash algorithm: HMAC-SHA256
1936 // Size: 32 byte
1937 // Default: null or empty if the device identifier is not known
1938 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1939 // Where is this device info obtained from
1940 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1941 // Name of the data source
1942 // For EXTERNAL: package name of the data source
1943 // For INTERNAL: null for general case, component name otherwise
1944 optional string source_name = 3;
1945 // Name of the manufacturer of this device
1946 optional string manufacturer = 4;
1947 // Model of this device
1948 optional string model = 5;
1949 // Hardware version of this device
1950 optional string hardware_version = 6;
1951 // Software version of this device
1952 optional string software_version = 7;
1953}
1954
1955/**
1956 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1957 * device, as documented by the Bluetooth Core HCI specification
1958 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1959 * Vol 2, Part E, Page 1118
1960 *
1961 * Logged from:
1962 * system/bt
1963 */
1964message BluetoothRemoteVersionInfoReported {
1965 // Connection handle of the connection
1966 // Original type: uint16_t
1967 optional int32 connection_handle = 1;
1968 // HCI command status code
1969 // Default: STATUS_UNKNOWN
1970 optional android.bluetooth.hci.StatusEnum hci_status = 2;
1971 // 1 byte Version of current LMP in the remote controller
1972 optional int32 lmp_version = 3;
1973 // 2 bytes LMP manufacturer code of the remote controller
1974 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
1975 optional int32 lmp_manufacturer_code = 4;
1976 // 4 bytes subversion of the LMP in the remote controller
1977 optional int32 lmp_subversion = 5;
1978}
1979
1980/**
1981 * Logs when certain Bluetooth SDP attributes are discovered
1982 * Constant definitions are from:
1983 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
1984 *
1985 * Current logged attributes:
1986 * - BluetoothProfileDescriptorList
1987 * - Supported Features Bitmask
1988 *
1989 * Logged from:
1990 * system/bt
1991 */
1992message BluetoothSdpAttributeReported {
1993 // An identifier that can be used to match events for this device.
1994 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1995 // Salt: Randomly generated 256 bit value
1996 // Hash algorithm: HMAC-SHA256
1997 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1998 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
1999 // Original type: uint16_t
2000 optional int32 protocol_uuid = 2;
2001 // Short form UUIDs used to identify Bluetooth SDP attribute types
2002 // Original type: uint16_t
2003 optional int32 attribute_id = 3;
2004 // Attribute value for the particular attribute
2005 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2006}
2007
2008/**
2009 * Logs when bond state of a Bluetooth device changes
2010 *
2011 * Logged from:
2012 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2013 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2014 */
2015message BluetoothBondStateChanged {
2016 // An identifier that can be used to match events for this device.
2017 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2018 // Salt: Randomly generated 256 bit value
2019 // Hash algorithm: HMAC-SHA256
2020 // Size: 32 byte
2021 // Default: null or empty if the device identifier is not known
2022 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2023 // Preferred transport type to remote dual mode device
2024 // Default: TRANSPORT_AUTO means no preference
2025 optional android.bluetooth.TransportTypeEnum transport = 2;
2026 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2027 // Default: UNKNOWN
2028 optional android.bluetooth.DeviceTypeEnum type = 3;
2029 // Current bond state (NONE, BONDING, BONDED)
2030 // Default: BOND_STATE_UNKNOWN
2031 optional android.bluetooth.BondStateEnum bond_state = 4;
2032 // Bonding sub state
2033 // Default: BOND_SUB_STATE_UNKNOWN
2034 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2035 // Unbond Reason
2036 // Default: UNBOND_REASON_UNKNOWN
2037 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2038}
2039
2040/**
2041 * Logs there is an event related Bluetooth classic pairing
2042 *
2043 * Logged from:
2044 * system/bt
2045 */
2046message BluetoothClassicPairingEventReported {
2047 // An identifier that can be used to match events for this device.
2048 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2049 // Salt: Randomly generated 256 bit value
2050 // Hash algorithm: HMAC-SHA256
2051 // Size: 32 byte
2052 // Default: null or empty if the device identifier is not known
2053 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2054 // Connection handle of this connection if available
2055 // Range: 0x0000 - 0x0EFF (12 bits)
2056 // Default: 0xFFFF if the handle is unknown
2057 optional int32 connection_handle = 2;
2058 // HCI command associated with this event
2059 // Default: CMD_UNKNOWN
2060 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2061 // HCI event associated with this event
2062 // Default: EVT_UNKNOWN
2063 optional android.bluetooth.hci.EventEnum hci_event = 4;
2064 // HCI command status code if this is triggerred by hci_cmd
2065 // Default: STATUS_UNKNOWN
2066 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2067 // HCI reason code associated with this event
2068 // Default: STATUS_UNKNOWN
2069 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002070 // A status value related to this specific event
2071 // Default: 0
2072 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002073}
2074
2075/**
2076 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2077 *
2078 * Logged from:
2079 * system/bt
2080 */
2081message BluetoothSmpPairingEventReported {
2082 // An identifier that can be used to match events for this device.
2083 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2084 // Salt: Randomly generated 256 bit value
2085 // Hash algorithm: HMAC-SHA256
2086 // Size: 32 byte
2087 // Default: null or empty if the device identifier is not known
2088 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2089 // SMP command sent or received over L2CAP
2090 // Default: CMD_UNKNOWN
2091 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2092 // Whether this command is sent or received
2093 // Default: DIRECTION_UNKNOWN
2094 optional android.bluetooth.DirectionEnum direction = 3;
2095 // SMP failure reason code
2096 // Default: PAIRING_FAIL_REASON_DEFAULT
2097 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2098}
2099
2100/**
Jack He815cdba2019-01-30 17:24:55 -08002101 * Logs when a Bluetooth socket’s connection state changed
2102 *
2103 * Logged from:
2104 * system/bt
2105 */
2106message BluetoothSocketConnectionStateChanged {
2107 // An identifier that can be used to match events for this device.
2108 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2109 // Salt: Randomly generated 256 bit value
2110 // Hash algorithm: HMAC-SHA256
2111 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002112 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002113 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002114 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002115 // Default 0 when unknown or don't care
2116 optional int32 port = 2;
2117 // Socket type as mentioned in
2118 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2119 // Default: SOCKET_TYPE_UNKNOWN
2120 optional android.bluetooth.SocketTypeEnum type = 3;
2121 // Socket connection state
2122 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2123 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2124 // Number of bytes sent to remote device during this connection
2125 optional int64 tx_bytes = 5;
2126 // Number of bytes received from remote device during this connection
2127 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002128 // Socket owner's UID
2129 optional int32 uid = 7 [(is_uid) = true];
2130 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2131 // |port| must be spawned by |server_port|
2132 // Default 0 when unknown or don't care
2133 optional int32 server_port = 8;
2134 // Whether this is a server listener socket
2135 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002136}
2137
2138/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002139 * Logs when something is plugged into or removed from the USB-C connector.
2140 *
2141 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002142 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002143 */
2144message UsbConnectorStateChanged {
2145 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002146 STATE_DISCONNECTED = 0;
2147 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002148 }
2149 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002150 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002151 // Last active session in ms.
2152 // 0 when the port is in connected state.
2153 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002154}
2155
2156/**
2157 * Logs the reported speaker impedance.
2158 *
2159 * Logged from:
2160 * Vendor audio implementation.
2161 */
2162message SpeakerImpedanceReported {
2163 optional int32 speaker_location = 1;
2164 optional int32 impedance = 2;
2165}
2166
2167/**
2168 * Logs the report of a failed hardware.
2169 *
2170 * Logged from:
2171 * Vendor HALs.
2172 *
2173 */
2174message HardwareFailed {
2175 enum HardwareType {
2176 HARDWARE_FAILED_UNKNOWN = 0;
2177 HARDWARE_FAILED_MICROPHONE = 1;
2178 HARDWARE_FAILED_CODEC = 2;
2179 HARDWARE_FAILED_SPEAKER = 3;
2180 HARDWARE_FAILED_FINGERPRINT = 4;
2181 }
2182 optional HardwareType hardware_type = 1;
2183
Maggie White6dcd8572019-01-31 14:11:50 -08002184 /**
2185 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002186 * the same hardware_type. The specific locations are vendor defined integers,
2187 * referring to board-specific numbering schemes.
2188 */
2189 optional int32 hardware_location = 2;
2190
Maggie White6dcd8572019-01-31 14:11:50 -08002191 /**
2192 * failure_code is specific to the HardwareType of the failed hardware.
2193 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002194 */
Maggie White6dcd8572019-01-31 14:11:50 -08002195 enum HardwareErrorCode {
2196 UNKNOWN = 0;
2197 COMPLETE = 1;
2198 SPEAKER_HIGH_Z = 2;
2199 SPEAKER_SHORT = 3;
2200 FINGERPRINT_SENSOR_BROKEN = 4;
2201 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002202 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002203 }
2204 optional int32 failure_code = 3;
2205}
2206
2207/**
2208 * Log an event when the device has been physically dropped.
2209 * Reported from the /vendor partition.
2210 */
2211message PhysicalDropDetected {
2212 // Confidence that the event was actually a drop, 0 -> 100
2213 optional int32 confidence_pctg = 1;
2214 // Peak acceleration of the drop, in 1/1000s of a g.
2215 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002216 // Duration of freefall in ms
2217 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002218}
2219
2220/**
2221 * Log bucketed battery charge cycles.
2222 *
2223 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002224 * a given charge point. For example, if 10 cycle buckets are
2225 * initialized, bucket 1 is the lowest 1/10th of the battery,
2226 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002227 *
2228 * Logged from:
2229 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2230 */
2231message ChargeCyclesReported {
2232 optional int32 cycle_bucket_1 = 1;
2233 optional int32 cycle_bucket_2 = 2;
2234 optional int32 cycle_bucket_3 = 3;
2235 optional int32 cycle_bucket_4 = 4;
2236 optional int32 cycle_bucket_5 = 5;
2237 optional int32 cycle_bucket_6 = 6;
2238 optional int32 cycle_bucket_7 = 7;
2239 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002240 optional int32 cycle_bucket_9 = 9;
2241 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002242}
2243
2244/**
Howard Roa46b6582018-09-18 16:45:02 -07002245 * Log battery health snapshot.
2246 *
2247 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2248 * are snapshotted periodically over 24hrs.
2249 */
2250message BatteryHealthSnapshot {
2251 enum BatterySnapshotType {
2252 UNKNOWN = 0;
2253 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2254 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2255 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2256 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2257 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2258 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2259 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2260 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2261 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2262 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2263 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2264 }
2265 optional BatterySnapshotType type = 1;
2266 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002267 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002268 // Voltage Battery Voltage, in microVolts.
2269 optional int32 voltage_micro_volt = 3;
2270 // Current Battery current, in microAmps.
2271 optional int32 current_micro_amps = 4;
2272 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2273 optional int32 open_circuit_micro_volt = 5;
2274 // Resistance Battery Resistance, in microOhms.
2275 optional int32 resistance_micro_ohm = 6;
2276 // Level Battery Level, as % of full.
2277 optional int32 level_percent = 7;
2278}
2279
2280/**
2281 * Log slow I/O operations on the primary storage.
2282 */
2283message SlowIo {
2284 // Classifications of IO Operations.
2285 enum IoOperation {
2286 UNKNOWN = 0;
2287 READ = 1;
2288 WRITE = 2;
2289 UNMAP = 3;
2290 SYNC = 4;
2291 }
2292 optional IoOperation operation = 1;
2293
2294 // The number of slow IO operations of this type over 24 hours.
2295 optional int32 count = 2;
2296}
2297
2298/**
2299 * Log battery caused shutdown with the last recorded voltage.
2300 */
2301message BatteryCausedShutdown {
2302 // The last recorded battery voltage prior to shutdown.
2303 optional int32 last_recorded_micro_volt = 1;
2304}
2305
2306/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002307 * Logs the duration of a davey (jank of >=700ms) when it occurs
2308 *
2309 * Logged from:
2310 * frameworks/base/libs/hwui/JankTracker.cpp
2311 */
2312message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002313 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002314 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002315
Tej Singhbb8554a2018-01-26 11:59:14 -08002316 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002317 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002318}
2319
2320/**
Bookatze5885242017-10-24 20:10:31 -07002321 * Logs phone signal strength changes.
2322 *
2323 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002324 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002325 */
2326message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002327 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2328 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002329}
2330
Yangster4ccebea2018-10-09 17:09:02 -07002331
2332/**
2333 * Logs when the phone state, sim state or signal strength changes
2334 *
2335 * Logged from:
2336 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2337 */
2338message PhoneServiceStateChanged {
2339 optional android.telephony.ServiceStateEnum state = 1;
2340 optional android.telephony.SimStateEnum sim_state = 2;
2341 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2342}
2343
2344/**
2345 * Logs when the phone becomes on or off.
2346 *
2347 * Logged from:
2348 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2349 */
2350message PhoneStateChanged {
2351 enum State {
2352 OFF = 0;
2353 ON = 1;
2354 }
2355 optional State state = 1;
2356}
2357
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002358message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002359 optional android.stats.launcher.LauncherAction action = 1;
2360 optional android.stats.launcher.LauncherState src_state = 2;
2361 optional android.stats.launcher.LauncherState dst_state = 3;
2362 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002363 optional bool is_swipe_up_enabled = 5;
2364}
2365
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002366message StyleUIChanged {
2367 optional android.stats.style.Action action = 1;
2368 optional int32 color_package_hash = 2;
2369 optional int32 font_package_hash = 3;
2370 optional int32 shape_package_hash = 4;
2371 optional int32 clock_package_hash = 5;
2372 optional int32 launcher_grid = 6;
2373 optional int32 wallpaper_category_hash = 7;
2374 optional int32 wallpaper_id_hash = 8;
2375}
2376
David Chenc28b2bb2017-10-24 12:52:52 -07002377/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002378 * Logs when Settings UI has changed.
2379 *
2380 * Logged from:
2381 * packages/apps/Settings
2382 */
2383message SettingsUIChanged {
2384 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002385 * Where this SettingsUIChange event comes from. For example, if
2386 * it's a PAGE_VISIBLE event, where the page is opened from.
2387 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002388 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002389
2390 /**
2391 * What the UI action is.
2392 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002393 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002394
2395 /**
2396 * Where the action is happening
2397 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002398 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002399
2400 /**
2401 * What preference changed in this event.
2402 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002403 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002404
2405 /**
2406 * The new value of the changed preference.
2407 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002408 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002409}
2410
2411/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002412 * Logs basic timing information about touch events.
2413 * Reported at most every 5 minutes while device is being interacted with.
2414 *
2415 * Logged from:
2416 * frameworks/native/services/inputflinger
2417 */
2418message TouchEventReported {
2419 /**
2420 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2421 * and the standard deviation of latency between the kernel and framework
2422 * for touchscreen events. The units are microseconds.
2423 *
2424 * The number is measured as the difference between the time at which
2425 * the input event was received in the evdev driver,
2426 * and the time at which the input event was received in EventHub.
2427 */
2428 // Minimum value
2429 optional float latency_min_micros = 1;
2430 // Maximum value
2431 optional float latency_max_micros = 2;
2432 // Average value
2433 optional float latency_mean_micros = 3;
2434 // Standard deviation
2435 optional float latency_stdev_micros = 4;
2436}
2437
2438/**
Philip Quinn0eded622019-01-29 12:46:28 -08002439 * Logs gesture classification and timing information for touch events.
2440 *
2441 * Logged from:
2442 * frameworks/base/core/java/android/view/GestureDetector.java
2443 * frameworks/base/core/java/android/view/View.java
2444 */
2445message TouchGestureClassified {
2446 // The source of the classification (e.g. Java class name).
2447 optional string source = 1;
2448
2449 enum Classification {
2450 UNKNOWN_CLASSIFICATION = 0;
2451 SINGLE_TAP = 1;
2452 DOUBLE_TAP = 2;
2453 LONG_PRESS = 3;
2454 DEEP_PRESS = 4;
2455 SCROLL = 5;
2456 }
2457 // The classification of the gesture.
2458 optional Classification classification = 2;
2459
2460 // The interval from the start of a touch event stream until the
2461 // classification was made.
2462 optional int32 latency_millis = 3;
2463
2464 // The distance from the location of the first touch event to the
2465 // location of the touch event when the classification was made.
2466 optional float displacement_px = 4;
2467}
2468
2469/**
David Chenc28b2bb2017-10-24 12:52:52 -07002470 * Logs that a setting was updated.
2471 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002472 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002473 * The tag and is_default allow resetting of settings to default values based on the specified
2474 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2475 */
2476message SettingChanged {
2477 // The name of the setting.
2478 optional string setting = 1;
2479
2480 // The change being imposed on this setting. May represent a number, eg "3".
2481 optional string value = 2;
2482
2483 // The new value of this setting. For most settings, this is same as value. For some settings,
2484 // value is +X or -X where X represents an element in a set. For example, if the previous value
2485 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2486 // The +/- feature is currently only used for location_providers_allowed.
2487 optional string new_value = 3;
2488
2489 // The previous value of this setting.
2490 optional string prev_value = 4;
2491
2492 // The tag used with the is_default for resetting sets of settings. This is generally null.
2493 optional string tag = 5;
2494
Bookatz90867622018-01-31 15:05:57 -08002495 // True if this setting with tag should be resettable.
2496 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002497
David Chenbd789912018-03-16 17:19:55 -07002498 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002499 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002500
2501 enum ChangeReason {
2502 UPDATED = 1; // Updated can be an insertion or an update.
2503 DELETED = 2;
2504 }
2505 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002506}
Chenjie Yub3dda412017-10-24 13:41:59 -07002507
Chenjie Yu05013b32017-11-21 10:21:41 -08002508/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002509 * Logs activity going to foreground or background
2510 *
2511 * Logged from:
2512 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2513 */
2514message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002515 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002516 optional string pkg_name = 2;
2517 optional string class_name = 3;
2518
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002519 enum State {
2520 BACKGROUND = 0;
2521 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002522 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002523 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002524}
David Chenc8a43242017-10-17 16:23:28 -07002525
2526/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002527 * Logs when a volume entered low Storage state.
2528 * Logged from:
2529 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2530 */
2531message LowStorageStateChanged {
2532 // Volume that ran out of storage.
2533 optional string volume_description = 1;
2534
2535 enum State {
2536 UNKNOWN = 0;
2537 OFF = 1;
2538 ON = 2;
2539 }
2540 optional State state = 2;
2541}
2542
2543/**
2544 * Logs when an app is downgraded.
2545 * Logged from:
2546 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2547 */
2548message AppDowngraded {
2549 optional string package_name = 1;
2550 // Size of the package (all data) before being downgraded.
2551 optional int64 size_in_bytes_before = 2;
2552 // Size of the package (all data) after being downgraded.
2553 optional int64 size_in_bytes_after = 3;
2554
2555 optional bool aggressive = 4;
2556}
2557
2558/**
2559 * Logs when an app is optimized after being downgraded.
2560 * Logged from:
2561 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2562 */
2563message AppOptimizedAfterDowngraded {
2564 optional string package_name = 1;
2565}
2566
2567/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002568 * Logs whenever an app is installed on external storage.
2569 * Logged from:
2570 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2571 */
2572message AppInstallOnExternalStorageReported {
2573 // The type of external storage.
2574 optional android.stats.storage.ExternalStorageType storage_type = 1;
2575 // The name of the package that is installed on the sd card.
2576 optional string package_name = 2;
2577}
2578
2579/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002580 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002581 * Logged from:
2582 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2583 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002584message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002585 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002586
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002587 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002588
2589 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002590 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002591 optional string process_name = 3;
2592
2593 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002594 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002595
2596 optional string package_name = 5;
2597
2598 enum InstantApp {
2599 UNAVAILABLE = 0;
2600 FALSE = 1;
2601 TRUE = 2;
2602 }
2603 optional InstantApp is_instant_app = 6;
2604
2605 enum ForegroundState {
2606 UNKNOWN = 0;
2607 BACKGROUND = 1;
2608 FOREGROUND = 2;
2609 }
2610 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002611
2612 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002613}
David Chen9e3808c2017-11-20 17:25:34 -08002614
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002615/**
2616 * Logs when a WTF (What a Terrible Failure) happened.
2617 * Logged from:
2618 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2619 */
2620message WTFOccurred {
2621 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002622
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002623 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002624
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002625 // The name of the process.
2626 // system_server if it is not by an app
2627 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002628
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002629 // The pid if available. -1 means not available.
2630 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002631
2632 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002633}
2634
2635/**
2636 * Logs when system server reports low memory.
2637 * Logged from:
2638 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2639 */
2640message LowMemReported {
2641}
2642
2643/**
2644 * Logs when an app ANR (App Not Responding) occurs.
2645 * Logged from:
2646 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2647 */
2648message ANROccurred {
2649 optional int32 uid = 1 [(is_uid) = true];
2650
2651 optional string process_name = 2;
2652
2653 optional string short_component_name = 3;
2654
2655 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002656
2657 enum InstantApp {
2658 UNAVAILABLE = 0;
2659 FALSE = 1;
2660 TRUE = 2;
2661 }
2662 optional InstantApp is_instant_app = 5;
2663
2664 enum ForegroundState {
2665 UNKNOWN = 0;
2666 BACKGROUND = 1;
2667 FOREGROUND = 2;
2668 }
2669 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002670
2671 optional android.server.ErrorSource error_source = 7;
2672
2673 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002674}
2675
Bookatza7020bd2018-08-28 16:29:35 -07002676/**
2677 * Logs when the vibrator state changes.
2678 * Logged from:
2679 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2680 */
2681message VibratorStateChanged {
2682 repeated AttributionNode attribution_node = 1;
2683
2684 enum State {
2685 OFF = 0;
2686 ON = 1;
2687 }
2688 optional State state = 2;
2689
2690 // Duration (in milliseconds) requested to keep the vibrator on.
2691 // Only applicable for State == ON.
2692 optional int64 duration_millis = 3;
2693}
2694
David Chen0a368b22017-12-06 16:28:16 -08002695/*
2696 * Allows other apps to push events into statsd.
2697 * Logged from:
2698 * frameworks/base/core/java/android/util/StatsLog.java
2699 */
David Chen0b5c90c2018-01-25 16:51:49 -08002700message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002701 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002702 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002703
2704 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2705 optional int32 label = 2;
2706
2707 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2708 // predicates for the metrics).
2709 enum State {
2710 UNKNOWN = 0;
2711 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2712 STOP = 2;
2713 START = 3;
2714 }
2715 optional State state = 3;
2716}
2717
David Chen9e3808c2017-11-20 17:25:34 -08002718/**
Bookatz7948c872018-09-04 12:58:33 -07002719 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2720 * For example, this could be due to the user manually changing the time.
2721 *
2722 * Logged from:
2723 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2724 */
2725message WallClockTimeShifted {
2726 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2727 optional int64 wall_clock_timestamp_millis = 1;
2728}
2729
2730/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002731 * Logs when statsd detects an anomaly.
2732 *
2733 * Logged from:
2734 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2735 */
2736message AnomalyDetected {
2737 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002738 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002739
Yangster-mac94e197c2018-01-02 16:03:03 -08002740 // Id of the config whose anomaly detection alert fired.
2741 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002742
Yangster-mac94e197c2018-01-02 16:03:03 -08002743 // Id of the alert (i.e. name of the anomaly that was detected).
2744 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002745}
2746
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002747message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002748 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002749 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002750
2751 // The app package name.
2752 optional string pkg_name = 2;
2753
2754 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002755 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002756 WARM = 1;
2757 HOT = 2;
2758 COLD = 3;
2759 }
2760 // The transition type.
2761 optional TransitionType type = 3;
2762
2763 // The activity name.
2764 optional string activity_name = 4;
2765
2766 // The name of the calling app. Empty if not set.
2767 optional string calling_pkg_name = 5;
2768
2769 // Whether the app is an instant app.
2770 optional bool is_instant_app = 6;
2771
2772 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002773 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002774
Bookatz80d11a02018-01-16 10:46:35 -08002775 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002776
David Chen0b5c90c2018-01-25 16:51:49 -08002777 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002778 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002779 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002780 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002781 optional int32 bind_application_delay_millis = 11;
2782 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002783
2784 // Empty if not set.
2785 optional string launch_token = 13;
2786
Calin Juravle759fbda2018-02-20 19:52:30 +00002787 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002788 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002789
2790 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002791 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002792}
2793
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002794message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002795 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002796 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002797
2798 // The app package name.
2799 optional string pkg_name = 2;
2800
2801 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002802 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002803 WARM = 1;
2804 HOT = 2;
2805 COLD = 3;
2806 }
2807 // The transition type.
2808 optional TransitionType type = 3;
2809
2810 // The activity name.
2811 optional string activity_name = 4;
2812}
2813
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002814message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002815 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002816 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002817
2818 // The app package name.
2819 optional string pkg_name = 2;
2820
2821 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002822 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002823 WITH_BUNDLE = 1;
2824 WITHOUT_BUNDLE = 2;
2825 }
2826 // The transition type.
2827 optional TransitionType type = 3;
2828
2829 // The activity name.
2830 optional string activity_name = 4;
2831
2832 optional bool transition_process_running = 5;
2833
2834 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002835 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002836}
2837
Bookatz8fcd09a2017-12-18 13:01:10 -08002838/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002839 * Logs a picture-in-picture action
2840 * Logged from:
2841 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2842 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2843 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2844 */
2845message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002846 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002847 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002848
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002849 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002850
Chenjie Yu52cacc62017-12-08 18:11:45 -08002851 enum State {
2852 ENTERED = 1;
2853 EXPANDED_TO_FULL_SCREEN = 2;
2854 MINIMIZED = 3;
2855 DISMISSED = 4;
2856 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002857 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002858}
2859
2860/**
Chenjie Yue8904192017-12-08 19:12:57 -08002861 * Logs overlay action
2862 * Logged from:
2863 * services/core/java/com/android/server/wm/Session.java
2864 */
2865message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002866 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002867
2868 optional string package_name = 2;
2869
2870 optional bool using_alert_window = 3;
2871
2872 enum State {
2873 ENTERED = 1;
2874 EXITED = 2;
2875 }
2876 optional State state = 4;
2877}
2878
Chenjie Yuccfe6452018-01-30 11:33:21 -08002879/*
2880 * Logs foreground service starts and stops.
2881 * Note that this is not when a service starts or stops, but when it is
2882 * considered foreground.
2883 * Logged from
2884 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2885 */
2886message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002887 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002888 // package_name + "/" + class_name
2889 optional string short_name = 2;
2890
2891 enum State {
2892 ENTER = 1;
2893 EXIT = 2;
2894 }
2895 optional State state = 3;
2896}
2897
Chenjie Yue8904192017-12-08 19:12:57 -08002898/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002899 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2900 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2901 * attributed back to the parent (host) uid. One example is Chrome.
2902 *
2903 * Logged from:
2904 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2905 */
2906message IsolatedUidChanged {
2907 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002908 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002909 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002910 optional int32 parent_uid = 1;
2911
2912 optional int32 isolated_uid = 2;
2913
2914 // We expect an isolated uid to be removed before if it's used for another parent uid.
2915 enum Event {
2916 REMOVED = 0;
2917 CREATED = 1;
2918 }
2919 optional Event event = 3;
2920}
2921
2922/*
2923 * Logs the reception of an incoming network packet causing the main system to wake up for
2924 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2925 * and processed by WakeupController.cpp.
2926 */
2927message PacketWakeupOccurred {
2928 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2929 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002930 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002931 // The interface name on which the packet was received.
2932 optional string iface = 2;
2933 // The ethertype value of the packet.
2934 optional int32 ethertype = 3;
2935 // String representation of the destination MAC address of the packet.
2936 optional string destination_hardware_address = 4;
2937 // String representation of the source address of the packet if this was an IP packet.
2938 optional string source_ip = 5;
2939 // String representation of the destination address of the packet if this was an IP packet.
2940 optional string destination_ip = 6;
2941 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2942 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2943 // families.
2944 optional int32 ip_next_header = 7;
2945 // The source port if this was a TCP or UDP packet.
2946 optional int32 source_port = 8;
2947 // The destination port if this was a TCP or UDP packet.
2948 optional int32 destination_port = 9;
2949}
2950
2951/*
2952 * Logs the memory stats for an app on startup.
2953 * Logged from:
2954 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2955 */
2956message AppStartMemoryStateCaptured {
2957 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002958 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002959
2960 // The process name.
2961 optional string process_name = 2;
2962
2963 // The activity name.
2964 optional string activity_name = 3;
2965
2966 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002967 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002968
2969 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002970 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002971
2972 // RSS
2973 optional int64 rss_in_bytes = 6;
2974
2975 // CACHE
2976 optional int64 cache_in_bytes = 7;
2977
2978 // SWAP
2979 optional int64 swap_in_bytes = 8;
2980}
2981
2982/*
2983 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2984 * for LMK event.
2985 * Logged from:
2986 * system/core/lmkd/lmkd.c
2987 */
2988message LmkStateChanged {
2989 enum State {
2990 UNKNOWN = 0;
2991 START = 1;
2992 STOP = 2;
2993 }
2994 optional State state = 1;
2995}
2996
2997/*
2998 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2999 * Logged from:
3000 * system/core/lmkd/lmkd.c
3001 */
3002message LmkKillOccurred {
3003 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003004 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003005
3006 // The process name.
3007 optional string process_name = 2;
3008
3009 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003010 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003011
3012 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003013 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003014
3015 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003016 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003017
3018 // RSS
3019 optional int64 rss_in_bytes = 6;
3020
3021 // CACHE
3022 optional int64 cache_in_bytes = 7;
3023
3024 // SWAP
3025 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003026
3027 // The elapsed real time of start of the process.
3028 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003029
3030 // Min oom adj score considered by lmkd.
3031 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003032}
3033
Rajeev Kumar51b54602018-03-01 12:18:26 -08003034/*
3035 * Logs when the ActivityManagerService detects that an app died.
3036 *
3037 * Logged from:
3038 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3039 */
3040message AppDied {
3041 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003042 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003043}
3044
Howard Ro21a039c2018-08-06 14:55:47 -07003045/**
3046 * An atom for generic metrics logging. Available from Android Q.
3047 */
3048message GenericAtom {
3049 // The uid of the application that sent this custom atom.
3050 optional int32 uid = 1 [(is_uid) = true];
3051
3052 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003053 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003054}
3055
Tej Singhd6d6d772018-09-05 17:41:25 -07003056/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003057 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003058 *
3059 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003060 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003061 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003062message BiometricAcquired {
3063 // Biometric modality that was acquired.
3064 optional android.hardware.biometrics.ModalityEnum modality = 1;
3065 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3066 optional int32 user = 2;
3067 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3068 optional bool is_crypto = 3;
3069 // Action that the device is performing. Acquired messages are only expected for enroll and
3070 // authenticate. Other actions may indicate an error.
3071 optional android.hardware.biometrics.ActionEnum action = 4;
3072 // The client that this acquisition was received for.
3073 optional android.hardware.biometrics.ClientEnum client = 5;
3074 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3075 optional int32 acquire_info = 6;
3076 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3077 optional int32 acquire_info_vendor = 7;
Tej Singhd6d6d772018-09-05 17:41:25 -07003078}
3079
3080/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003081 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003082 *
3083 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003084 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003085 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003086message BiometricAuthenticated {
3087 // Biometric modality that was used.
3088 optional android.hardware.biometrics.ModalityEnum modality = 1;
3089 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3090 optional int32 user = 2;
3091 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3092 // storage.
3093 optional bool is_crypto = 3;
3094 // The client that this acquisition was received for.
3095 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003096 // If authentication requires user confirmation. See BiometricPrompt's
3097 // setRequireConfirmation(bool) method.
3098 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003099
Kevin Chyn1741a072019-01-17 11:54:40 -08003100 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003101 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003102 REJECTED = 1;
3103 PENDING_CONFIRMATION = 2;
3104 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003105 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003106
3107 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003108 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003109 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3110 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3111 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3112 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003113 optional int64 latency_millis = 7;
Kevin Chyn1741a072019-01-17 11:54:40 -08003114}
3115
3116/**
3117 * Logs when a biometric error occurs.
3118 *
3119 * Logged from:
3120 * frameworks/base/services/core/java/com/android/server/biometrics
3121 */
3122message BiometricErrorOccurred {
3123 // Biometric modality that was used.
3124 optional android.hardware.biometrics.ModalityEnum modality = 1;
3125 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3126 optional int32 user = 2;
3127 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3128 optional bool is_crypto = 3;
3129 // Action that the device is performing.
3130 optional android.hardware.biometrics.ActionEnum action = 4;
3131 // The client that this acquisition was received for.
3132 optional android.hardware.biometrics.ClientEnum client = 5;
3133 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3134 // are unique to modality.
3135 optional int32 error_info = 6;
3136 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3137 // by the vendor and not specified by the HIDL interface.
3138 optional int32 error_info_vendor = 7;
3139}
3140
3141/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003142 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003143 * Logged from:
3144 * frameworks/base/services/core/java/com/android/server/biometrics
3145 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003146message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003147 // Biometric modality.
3148 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003149 // Type of issue detected.
3150 optional android.hardware.biometrics.IssueEnum issue = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07003151}
Howard Ro688ae182018-09-25 00:09:36 -07003152
3153message Notification {
3154
3155 // Type of notification event.
3156 enum Type {
3157 TYPE_UNKNOWN = 0;
3158 // Notification became visible to the user.
3159 TYPE_OPEN = 1;
3160 // Notification became hidden.
3161 TYPE_CLOSE = 2;
3162 // Notification switched to detail mode.
3163 TYPE_DETAIL = 3;
3164 // Notification was clicked.
3165 TYPE_ACTION = 4;
3166 // Notification was dismissed.
3167 TYPE_DISMISS = 5;
3168 // Notification switched to summary mode. The enum value of 14 is to
3169 // match that of metrics_constants.
3170 TYPE_COLLAPSE = 14;
3171 }
3172 optional Type type = 1;
3173
3174 // Package name associated with the notification.
3175 optional string package_name = 2;
3176
3177 // Tag associated with notification.
3178 optional string tag = 3;
3179
3180 // Application-supplied ID associated with the notification.
3181 optional int32 id = 4;
3182
3183 // Index of notification in the notification panel.
3184 optional int32 shade_index = 5;
3185
3186 // The number of notifications in the notification panel.
3187 optional int32 shade_count = 6;
3188
3189 // Importance for the notification.
3190 optional int32 importance = 7;
3191
3192 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07003193 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07003194
3195 // Importance for the notification channel.
3196 optional int32 channel_importance = 9;
3197
Howard Ro183c2bd2018-10-18 13:52:10 -07003198 // Application-supplied ID associated with the notifications group.
3199 optional string group_id = 10;
3200
Howard Ro688ae182018-09-25 00:09:36 -07003201 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07003202 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07003203
Howard Ro183c2bd2018-10-18 13:52:10 -07003204 // Reason for dismissal of a notification. This field is only meaningful for
3205 // TYPE_DISMISS events.
3206 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07003207
Howard Ro183c2bd2018-10-18 13:52:10 -07003208 // The first post time of notification, stable across updates.
3209 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07003210
Howard Ro183c2bd2018-10-18 13:52:10 -07003211 // The most recent interruption time, or the creation time if no updates.
3212 // Differs from update_millis because updates are filtered based on whether
3213 // they actually interrupted the user.
3214 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07003215
Howard Ro183c2bd2018-10-18 13:52:10 -07003216 // The most recent update time, or the creation time if no updates.
3217 optional int64 update_millis = 15;
3218
3219 // The most recent visibility event.
3220 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07003221}
3222
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003223/*
Tej Singh0d176952019-01-16 19:10:54 -08003224 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003225 */
Tej Singh0d176952019-01-16 19:10:54 -08003226message FlagFlipUpdateOccurred {
3227 // If the event is from a flag config package, specify the package name.
3228 optional string flag_flip_package_name = 1;
3229
3230 // The order id of the package
3231 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003232}
3233
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003234/**
3235 * Potential experiment ids that goes with a train install.
3236 */
3237message TrainExperimentIds {
3238 repeated int64 experiment_id = 1;
3239}
3240
Yangster-macb89807e2018-11-15 21:10:57 -08003241/*
3242 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003243 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003244 */
3245message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003246 // Name of the train.
3247 optional string train_name = 1;
3248 // Version code for a "train" of packages that need to be installed atomically
3249 optional int64 train_version_code = 2;
3250 // After installation of this package, device requires a restart.
3251 optional bool requires_staging = 3;
3252 // Rollback should be enabled for this install.
3253 optional bool rollback_enabled = 4;
3254 // Requires low latency monitoring if possible.
3255 optional bool requires_low_latency_monitor = 5;
3256
Yangster-macb89807e2018-11-15 21:10:57 -08003257 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003258 UNKNOWN = 0;
3259 INSTALL_REQUESTED = 1;
3260 INSTALL_STARTED = 2;
3261 INSTALL_STAGED_NOT_READY = 3;
3262 INSTALL_STAGED_READY = 4;
3263 INSTALL_SUCCESS = 5;
3264 INSTALL_FAILURE = 6;
3265 INSTALL_CANCELLED = 7;
3266 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003267 INSTALLER_ROLLBACK_INITIATED = 9;
3268 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3269 INSTALLER_ROLLBACK_STAGED = 11;
3270 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3271 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3272 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3273 INSTALLER_ROLLBACK_SUCCESS = 15;
3274 INSTALLER_ROLLBACK_FAILURE = 16;
3275 INSTALLER_ROLLBACK_CANCEL_STAGED_REMOVE_FROM_QUEUE = 17;
3276 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_INITIATED = 18;
3277 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_SUCCESS = 19;
3278 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_FAILURE = 20;
Yangster-macb89807e2018-11-15 21:10:57 -08003279 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003280 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003281 // Possible experiment ids for monitoring this push.
3282 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3283 // user id
3284 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003285}
3286
Maggie Whitefc1aa592018-11-28 21:55:23 -08003287/** Represents USB port overheat event. */
3288message UsbPortOverheatEvent {
3289 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3290 optional int32 plug_temperature_deci_c = 1;
3291
3292 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3293 optional int32 max_temperature_deci_c = 2;
3294
3295 /* Time between USB plug event and overheat threshold trip, in seconds. */
3296 optional int32 time_to_overheat_secs = 3;
3297
3298 /* Time between overheat threshold trip and hysteresis, in seconds. */
3299 optional int32 time_to_hysteresis_secs = 4;
3300
3301 /* Time between hysteresis and active mitigation ending, in seconds. */
3302 optional int32 time_to_inactive_secs = 5;
3303};
3304
Maggie White8735b852019-01-18 11:40:49 -08003305/**
3306 * Logs total effective full charge and discharge cycles on a battery.
3307 * Here are some examples of one effective cycle:
3308 * 1) the battery charges from 0% to 100% and drains back to 0%,
3309 * 2) charging from 50% to 100% and draining back to 50% twice.
3310 * Pulled from:
3311 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3312 */
3313message BatteryCycleCount {
3314 /* Number of total charge and discharge cycles on the system battery. */
3315 optional int32 cycle_count = 1;
3316}
3317
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003318/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003319 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3320 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003321 * Pulled from:
3322 * StatsCompanionService
3323 */
3324
Carmen Agimof12dec122019-03-06 16:14:38 +00003325message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003326
Carmen Agimof12dec122019-03-06 16:14:38 +00003327 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003328 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003329 PUBLIC = 1;
3330 PRIVATE = 2;
3331 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003332 }
3333
Carmen Agimof12dec122019-03-06 16:14:38 +00003334 // The type of external storage.
3335 optional android.stats.storage.ExternalStorageType storage_type = 1;
3336 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3337 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003338 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003339 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003340}
3341
Yangster-macb89807e2018-11-15 21:10:57 -08003342/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003343 * Logs when a connection becomes available and lost.
3344 * Logged in StatsCompanionService.java
3345 */
3346message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003347 // Id of the network.
3348 optional int32 net_id = 1;
3349
3350 enum State {
3351 UNKNOWN = 0;
3352 CONNECTED = 1;
3353 DISCONNECTED = 2;
3354 }
3355 // Connected state of a network.
3356 optional State state = 2;
3357}
3358
3359/**
3360 * Logs when a service starts and stops.
3361 * Logged from:
3362 * services/core/java/com/android/server/am/ActiveServices.java
3363 */
3364message ServiceStateChanged {
3365
3366 optional int32 uid = 1 [(is_uid) = true];
3367
3368 optional string package_name = 2;
3369
3370 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003371
3372 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003373 START = 1;
3374 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003375 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003376
3377 optional State state = 4;
3378}
3379
3380/**
3381 * Logs when a service is launched.
3382 * Logged from:
3383 * services/core/java/com/android/server/am/ActiveServices.java
3384 */
3385message ServiceLaunchReported {
3386
3387 optional int32 uid = 1 [(is_uid) = true];
3388
3389 optional string package_name = 2;
3390
3391 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003392}
Howard Ro688ae182018-09-25 00:09:36 -07003393
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003394/**
3395 * Logs when a hidden API is used.
3396 *
3397 * Logged from:
3398 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3399 */
3400message HiddenApiUsed {
3401 // The uid of the app making the hidden access.
3402 optional int32 uid = 1 [(is_uid) = true];
3403
3404 // Signature of the method or field accessed.
3405 optional string signature = 2;
3406
3407 enum AccessMethod {
3408 NONE = 0;
3409 REFLECTION = 1;
3410 JNI = 2;
3411 LINKING = 3;
3412 }
3413
3414 // Type of access.
3415 optional AccessMethod access_method = 3;
3416
3417 // Whether the access was prevented or not.
3418 optional bool access_denied = 4;
3419}
3420
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003421/**
3422 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3423 * - When user sees privacy chip
3424 * - When user clicks privacy chip
3425 * - How does the user exit the Privacy Dialog
3426 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003427 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3428 */
3429message PrivacyIndicatorsInteracted {
3430
3431 enum Type {
3432 UNKNOWN = 0;
3433 CHIP_VIEWED = 1;
3434 CHIP_CLICKED = 2;
3435 DIALOG_PRIVACY_SETTINGS = 3;
3436 DIALOG_DISMISS = 4;
3437 DIALOG_LINE_ITEM = 5;
3438 }
3439
3440 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3441
3442 // Used if the type is LINE_ITEM
3443 optional string package_name = 2;
3444}
3445
Chenjie Yubbcbc602018-02-05 16:51:52 -08003446//////////////////////////////////////////////////////////////////////
3447// Pulled atoms below this line //
3448//////////////////////////////////////////////////////////////////////
3449
3450/**
David Chenc8a43242017-10-17 16:23:28 -07003451 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3452 *
3453 * Pulled from:
3454 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3455 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003456message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003457 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003458
3459 optional int64 rx_bytes = 2;
3460
3461 optional int64 rx_packets = 3;
3462
3463 optional int64 tx_bytes = 4;
3464
3465 optional int64 tx_packets = 5;
3466}
3467
3468/**
3469 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3470 *
3471 * Pulled from:
3472 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3473 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003474message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003475 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003476
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003477 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3478 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003479
3480 optional int64 rx_bytes = 3;
3481
3482 optional int64 rx_packets = 4;
3483
3484 optional int64 tx_bytes = 5;
3485
3486 optional int64 tx_packets = 6;
3487}
3488
3489/**
3490 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3491 *
3492 * Pulled from:
3493 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3494 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003495message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003496 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003497
3498 optional int64 rx_bytes = 2;
3499
3500 optional int64 rx_packets = 3;
3501
3502 optional int64 tx_bytes = 4;
3503
3504 optional int64 tx_packets = 5;
3505}
3506
3507/**
3508 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3509 *
3510 * Pulled from:
3511 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3512 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003513message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003514 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003515
Yao Chenc40a19d2018-03-15 16:48:25 -07003516 // 1 denotes foreground and 0 denotes background. This is called Set in
3517 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003518 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003519
3520 optional int64 rx_bytes = 3;
3521
3522 optional int64 rx_packets = 4;
3523
3524 optional int64 tx_bytes = 5;
3525
3526 optional int64 tx_packets = 6;
3527}
3528
3529/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003530 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3531 *
3532 * Pulled from:
3533 * StatsCompanionService
3534 */
3535message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003536 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003537
3538 optional int64 rx_bytes = 2;
3539
3540 optional int64 tx_bytes = 3;
3541}
3542
3543/**
David Chenc8a43242017-10-17 16:23:28 -07003544 * Pulls the kernel wakelock durations. This atom is adapted from
3545 * android/internal/os/KernelWakelockStats.java
3546 *
3547 * Pulled from:
3548 * StatsCompanionService using KernelWakelockReader.
3549 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003550message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003551 optional string name = 1;
3552
3553 optional int32 count = 2;
3554
3555 optional int32 version = 3;
3556
Yangster-maca8a30442018-10-13 23:46:34 -07003557 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003558}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003559
Chenjie Yu05013b32017-11-21 10:21:41 -08003560/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003561 * Pulls low power state information. If power.stats HAL is not available, this
3562 * includes platform and subsystem sleep state information,
3563 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3564 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003565 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003566 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003567 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3568 * as defined in:
3569 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003570 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003571message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003572 // Subsystem name
3573 optional string subsystem_name = 1;
3574 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3575 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003576 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3577 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003578 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003579 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003580 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003581 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003582 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003583}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003584
Chenjie Yu05013b32017-11-21 10:21:41 -08003585/**
Bookatz92da2832018-11-01 18:10:03 -07003586 * Pulls on-device power measurement information.
3587 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3588 * Pulled from:
3589 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3590 */
3591message OnDevicePowerMeasurement {
3592 // Name of the subsystem (to which the rail belongs).
3593 optional string subsystem_name = 1;
3594
3595 // Rail name. The rail lies within the subsystem.
3596 optional string rail_name = 2;
3597
3598 // Time (in ms since boot) at which the rail energy value was measured.
3599 // This may differ slightly from the time that statsd logs this information.
3600 optional uint64 measurement_timestamp_millis = 3;
3601
3602 // Accumulated energy used via the rail since device boot in uWs.
3603 optional uint64 energy_microwatt_secs = 4;
3604}
3605
3606/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003607 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003608 * Pulls the time the cpu spend on the frequency index. Frequency index
3609 * starts from highest to lowest. The value should be monotonically
3610 * increasing since boot. However, if there is a cpu
3611 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003612 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003613message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003614 optional uint32 cluster = 1;
3615 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003616 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003617}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003618
Chenjie Yu05013b32017-11-21 10:21:41 -08003619/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003620 * Pulls Cpu Time Per Uid.
3621 * Note that isolated process uid time should be attributed to host uids.
3622 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003623message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003624 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003625 optional uint64 user_time_micros = 2;
3626 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003627}
3628
3629/**
3630 * Pulls Cpu Time Per Uid per frequency.
3631 * Note that isolated process uid time should be attributed to host uids.
3632 * For each uid, we order the time by descending frequencies.
3633 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003634message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003635 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003636 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003637 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003638}
Hugo Benichi884970e2017-11-14 22:42:46 +09003639
Chenjie Yu05013b32017-11-21 10:21:41 -08003640/**
3641 * Pulls Wifi Controller Activity Energy Info
3642 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003643message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003644 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003645 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003646 // stack reported state
3647 // TODO: replace this with proto enum
3648 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003649 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003650 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003651 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003652 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003653 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003654 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003655 // product of current(mA), voltage(V) and time(ms)
3656 optional uint64 controller_energy_used = 6;
3657}
3658
3659/**
3660 * Pulls Modem Activity Energy Info
3661 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003662message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003663 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003664 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003665 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003666 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003667 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003668 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003669 /**
3670 * Tx power index
3671 * index 0 = tx_power < 0dBm
3672 * index 1 = 0dBm < tx_power < 5dBm
3673 * index 2 = 5dBm < tx_power < 15dBm
3674 * index 3 = 15dBm < tx_power < 20dBm
3675 * index 4 = tx_power > 20dBm
3676 */
3677 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003678 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003679 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003680 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003681 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003682 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003683 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003684 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003685 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003686 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003687 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003688 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003689 // product of current(mA), voltage(V) and time(ms)
3690 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003691}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003692
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003693/**
3694 * Pulls Bluetooth Activity Energy Info
3695 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3696 */
3697message BluetoothActivityInfo {
3698 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003699 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003700 // bluetooth stack state
3701 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003702 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003703 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003704 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003705 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003706 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003707 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003708 // product of current(mA), voltage(V) and time(ms)
3709 optional uint64 energy_used = 6;
3710}
3711
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003712/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003713 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003714 *
3715 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003716 */
3717message ProcessMemoryState {
3718 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003719 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003720
3721 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003722 // Usually package name, "system" for system server.
3723 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003724 optional string process_name = 2;
3725
Rafal Slawikda51b932018-12-13 16:31:33 +00003726 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003727 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003728
3729 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003730 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003731
3732 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003733 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003734
Rajeev Kumar90235992018-01-29 11:06:48 -08003735 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003736 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3737 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003738 optional int64 rss_in_bytes = 6;
3739
3740 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003741 // Value is read from memory.stat, field total_cache if per-app memory
3742 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003743 optional int64 cache_in_bytes = 7;
3744
3745 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003746 // Value is read from memory.stat, field total_swap if per-app memory
3747 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003748 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003749
Rafal Slawikd03ae422018-11-20 11:27:45 +00003750 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003751 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003752
3753 // Elapsed real time when the process started.
3754 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3755 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003756}
3757
3758/*
Rafal Slawik08621582018-10-15 14:53:07 +01003759 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003760 *
3761 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003762 */
3763message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003764 // The uid if available. -1 means not available.
3765 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003766
Rafal Slawikbf67d072018-10-23 11:07:54 +01003767 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003768 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003769 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003770
Rafal Slawikbf67d072018-10-23 11:07:54 +01003771 // # of page-faults
3772 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003773
Rafal Slawikbf67d072018-10-23 11:07:54 +01003774 // # of major page-faults
3775 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003776
Rafal Slawikbf67d072018-10-23 11:07:54 +01003777 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003778 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003779 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003780
Rafal Slawikd03ae422018-11-20 11:27:45 +00003781 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003782 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003783
3784 // Elapsed real time when the process started.
3785 // Value is read from /proc/PID/stat, field 22.
3786 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01003787}
3788
3789/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003790 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003791 *
3792 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3793 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003794 *
3795 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003796 */
3797message ProcessMemoryHighWaterMark {
3798 // The uid if available. -1 means not available.
3799 optional int32 uid = 1 [(is_uid) = true];
3800
Rafal Slawikda51b932018-12-13 16:31:33 +00003801 // The process name.
3802 // Usually package name or process cmdline.
3803 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003804 optional string process_name = 2;
3805
3806 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3807 // /proc/PID/status.
3808 optional int64 rss_high_water_mark_in_bytes = 3;
3809}
3810
3811/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003812 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003813 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003814message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003815 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003816}
3817
3818/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003819 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003820 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003821message SystemUptime {
3822 // Milliseconds since the system was booted.
3823 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3824 // for external input).
3825 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003826 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003827}
3828
3829/*
3830 * Reads from /proc/uid_concurrent_active_time which has the format:
3831 * active: X (X is # cores)
3832 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3833 * [uid1]: [time-0] [time-1] [time-2] ... ...
3834 * ...
3835 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3836 * The file contains a monotonically increasing count of time for a single boot.
3837 */
3838message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003839 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003840 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003841}
3842
3843/**
3844 * Reads from /proc/uid_concurrent_policy_time which has the format:
3845 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3846 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3847 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3848 * ...
3849 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3850 * The file contains a monotonically increasing count of time for a single boot.
3851 */
3852message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003853 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003854 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003855 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003856}
3857
3858/*
3859 * Pulls free disk space, for data, system partition and temporary directory.
3860 */
3861message DiskSpace {
3862 // available bytes in data partition
3863 optional uint64 data_available_bytes = 1;
3864 // available bytes in system partition
3865 optional uint64 system_available_bytes = 2;
3866 // available bytes in download cache or temp directories
3867 optional uint64 temp_available_bytes = 3;
3868}
Tej Singhbf972d92018-01-10 20:51:13 -08003869
3870/**
3871 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003872 *
3873 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003874 */
3875message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003876 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003877}
3878
3879/**
3880 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003881 * Pulled from:
3882 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003883 */
3884message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003885 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003886}
3887
3888/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003889 * Pulls battery voltage.
3890 * Pulled from:
3891 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3892 */
3893message BatteryVoltage {
3894 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003895 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003896}
3897
3898/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003899 * Pulls battery level (percent full, from 0 to 100).
3900 *
3901 * Pulled from:
3902 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3903 */
3904message BatteryLevel {
3905 // Battery level. Should be in [0, 100].
3906 optional int32 battery_level = 1;
3907}
3908
3909/**
Tej Singhd89137e2018-03-26 14:51:40 -07003910 * Pulls the temperature of various parts of the device.
3911 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003912 *
3913 * Pulled from:
3914 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3915 */
3916message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003917 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003918 optional android.os.TemperatureTypeEnum sensor_location = 1;
3919
3920 // The name of the temperature source. Eg. CPU0
3921 optional string sensor_name = 2;
3922
Tej Singhd89137e2018-03-26 14:51:40 -07003923 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003924 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003925 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003926}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003927
3928/**
3929 * Pulls the statistics of calls to Binder.
3930 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003931 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3932 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003933 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003934 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003935 */
3936message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003937 // UID of the process responsible for the binder transaction. It will be set if the process
3938 // executing the binder transaction attribute the transaction to another uid using
3939 // Binder.setThreadWorkSource().
3940 //
3941 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003942 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003943 // UID of the process executing the binder transaction.
3944 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003945 // Fully qualified class name of the API call.
3946 //
3947 // This is a system server class name.
3948 //
3949 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3950 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3951 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3952 // commonly used APIs.
3953 optional string service_class_name = 2;
3954 // Method name of the API call. It can also be a transaction code if we cannot
3955 // resolve it to a name. See Binder#getTransactionName.
3956 //
3957 // This is a system server method name.
3958 optional string service_method_name = 3;
3959 // Total number of API calls.
3960 optional int64 call_count = 4;
3961 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3962 optional bool screen_interactive = 13;
3963 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3964 // call_count will be equal to recorded_call_count.
3965 //
3966 // If recorded_call_count is different than call_count, it means data collection has been
3967 // sampled. All the fields below will be sampled in this case.
3968 optional int64 recorded_call_count = 12;
3969 // Number of exceptions thrown by the API.
3970 optional int64 recorded_exception_count = 5;
3971 // Total latency of all API calls.
3972 // Average can be computed using total_latency_micros / recorded_call_count.
3973 optional int64 recorded_total_latency_micros = 6;
3974 // Maximum latency of one API call.
3975 optional int64 recorded_max_latency_micros = 7;
3976 // Total CPU usage of all API calls.
3977 // Average can be computed using total_cpu_micros / recorded_call_count.
3978 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3979 optional int64 recorded_total_cpu_micros = 8;
3980 // Maximum CPU usage of one API call.
3981 optional int64 recorded_max_cpu_micros = 9;
3982 // Maximum parcel reply size of one API call.
3983 optional int64 recorded_max_reply_size_bytes = 10;
3984 // Maximum parcel request size of one API call.
3985 optional int64 recorded_max_request_size_bytes = 11;
3986}
3987
3988/**
3989 * Pulls the statistics of exceptions during calls to Binder.
3990 *
3991 * Binder stats are cumulative from boot unless somebody reset the data using
3992 * > adb shell dumpsys binder_calls_stats --reset
3993 */
3994message BinderCallsExceptions {
3995 // Exception class name, e.g. java.lang.IllegalArgumentException.
3996 //
3997 // This is an exception class name thrown by the system server.
3998 optional string exception_class_name = 1;
3999 // Total number of exceptions.
4000 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004001}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004002
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004003/**
4004 * Pulls the statistics of message dispatching on HandlerThreads.
4005 *
4006 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4007 * config on the device.
4008 *
4009 * Next tag: 11
4010 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004011message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004012 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004013 optional int32 uid = 1 [(is_uid) = true];
4014
4015 // Fully qualified class name of the handler target class.
4016 //
4017 // This field does not contain PII. This is a system server class name.
4018 optional string handler_class_name = 2;
4019
4020 // The name of the thread that runs the Looper.
4021 //
4022 // This field does not contain PII. This is a system server thread name.
4023 optional string looper_thread_name = 3;
4024
4025 // The name of the dispatched message.
4026 //
4027 // This field does not contain PII. This is a system server constant or class
4028 // name.
4029 optional string message_name = 4;
4030
4031 // Total number of successfully dispatched messages.
4032 optional int64 message_count = 5;
4033
4034 // Total number of messages that failed dispatching.
4035 optional int64 exception_count = 6;
4036
4037 // Total number of processed messages we have data recorded for. If we
4038 // collected data for all the messages, message_count will be equal to
4039 // recorded_message_count.
4040 //
4041 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004042 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004043 optional int64 recorded_message_count = 7;
4044
4045 // Total latency of all processed messages.
4046 // Average can be computed using recorded_total_latency_micros /
4047 // recorded_message_count.
4048 optional int64 recorded_total_latency_micros = 8;
4049
4050 // Total CPU usage of all processed message.
4051 // Average can be computed using recorded_total_cpu_micros /
4052 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004053 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004054 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004055
4056 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4057 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004058
4059 // Max recorded CPU usage of all processed messages.
4060 optional int64 recorded_max_cpu_micros = 11;
4061
4062 // Max recorded latency of all processed messages.
4063 optional int64 recorded_max_latency_micros = 12;
4064
4065 // Total number of messages we tracked the dispatching delay for. If we
4066 // collected data for all the messages, message_count will be equal to
4067 // recorded_delay_message_count.
4068 //
4069 // If recorded_delay_message_count is different than message_count, it means data
4070 // collection has been sampled or/and not all messages specified the target dispatch time.
4071 // The fields below will be sampled in this case.
4072 optional int64 recorded_delay_message_count = 13;
4073
4074 // Total dispatching delay of all processed messages.
4075 // Calculated as a difference between the target dispatching time (Message.when)
4076 // and the actual dispatching time.
4077 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4078 optional int64 recorded_total_delay_millis = 14;
4079
4080 // Max dispatching delay of all processed messages.
4081 // Calculated as a difference between the target dispatching time (Message.when)
4082 // and the actual dispatching time.
4083 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004084}
Tej Singh86dc9db2018-09-06 00:39:57 +00004085
4086/**
4087 * Pulls disk information, such as write speed and latency.
4088 */
4089message DiskStats {
4090 // Time taken to open, write 512B to, and close a file.
4091 // -1 if error performing the check.
4092 optional int64 data_write_latency_millis = 1;
4093
4094 optional bool file_based_encryption = 2;
4095
4096 // Recent disk write speed in kB/s.
4097 // -1 if error querying storageed.
4098 // 0 if data is unavailable.
4099 optional int32 recent_disk_write_speed = 3;
4100}
4101
4102
4103/**
4104 * Free and total bytes of the Data, Cache, and System partition.
4105 */
4106message DirectoryUsage {
4107 enum Directory {
4108 UNKNOWN = 0;
4109 DATA = 1;
4110 CACHE = 2;
4111 SYSTEM = 3;
4112 }
4113 optional Directory directory = 1;
4114 optional int64 free_bytes = 2;
4115 optional int64 total_bytes = 3;
4116}
4117
4118
4119/**
4120 * Size of an application: apk size, data size, and cache size.
4121 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4122 * Information is only reported for apps with the primary user (user 0).
4123 * Sizes are aggregated by package name.
4124 */
4125message AppSize {
4126 // Including uids will involve modifying diskstats logic.
4127 optional string package_name = 1;
4128 // App size in bytes. -1 if unavailable.
4129 optional int64 app_size_bytes = 2;
4130 // App data size in bytes. -1 if unavailable.
4131 optional int64 app_data_size_bytes = 3;
4132 // App cache size in bytes. -1 if unavailable.
4133 optional int64 app_cache_size_bytes = 4;
4134 // Time that the cache file was produced.
4135 // Uses System.currentTimeMillis(), which is wall clock time.
4136 optional int64 cache_time_millis = 5;
4137}
4138
4139
4140/**
4141 * Size of a particular category. Eg: photos, videos.
4142 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4143 */
4144message CategorySize {
4145 enum Category {
4146 UNKNOWN = 0;
4147 APP_SIZE = 1;
4148 APP_DATA_SIZE = 2;
4149 APP_CACHE_SIZE = 3;
4150 PHOTOS = 4;
4151 VIDEOS = 5;
4152 AUDIO = 6;
4153 DOWNLOADS = 7;
4154 SYSTEM = 8;
4155 OTHER = 9;
4156 }
4157 optional Category category = 1;
4158 // Category size in bytes.
4159 optional int64 size_bytes = 2;
4160 // Time that the cache file was produced.
4161 // Uses System.currentTimeMillis(), which is wall clock time.
4162 optional int64 cache_time_millis = 3;
4163}
Tej Singhd6d6d772018-09-05 17:41:25 -07004164
4165/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004166 * Pulls per uid I/O stats. The stats are cumulative since boot.
4167 *
4168 * Read/write bytes are I/O events from a storage device
4169 * Read/write chars are data requested by read/write syscalls, and can be
4170 * satisfied by caching.
4171 *
4172 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4173 */
4174message DiskIo {
4175 optional int32 uid = 1 [(is_uid) = true];
4176 optional int64 fg_chars_read = 2;
4177 optional int64 fg_chars_write = 3;
4178 optional int64 fg_bytes_read = 4;
4179 optional int64 fg_bytes_write = 5;
4180 optional int64 bg_chars_read = 6;
4181 optional int64 bg_chars_write = 7;
4182 optional int64 bg_bytes_read = 8;
4183 optional int64 bg_bytes_write = 9;
4184 optional int64 fg_fsync = 10;
4185 optional int64 bg_fsync= 11;
4186}
4187
4188
4189/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004190 * Pulls the number of fingerprints for each user.
4191 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004192 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004193 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004194message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004195 // The associated user. Eg: 0 for owners, 10+ for others.
4196 // Defined in android/os/UserHandle.java
4197 optional int32 user = 1;
4198 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004199 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004200}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004201
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004202/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004203 * Pulls the number of faces for each user.
4204 *
4205 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4206 */
4207message NumFacesEnrolled {
4208 // The associated user. Eg: 0 for owners, 10+ for others.
4209 // Defined in android/os/UserHandle.java
4210 optional int32 user = 1;
4211 // Number of faces registered to that user.
4212 optional int32 num_faces_enrolled = 2;
4213}
4214/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004215 * A mapping of role holder -> role
4216 */
4217message RoleHolder {
4218 // uid of the role holder
4219 optional int32 uid = 1 [(is_uid) = true];
4220
4221 // package name of the role holder
4222 optional string package_name = 2;
4223
4224 // the role held
4225 optional string role = 3;
4226}
4227
Yangsteraf9aee72018-10-12 09:26:16 -07004228message AggStats {
4229 optional int64 min = 1;
4230
4231 optional int64 average = 2;
4232
4233 optional int64 max = 3;
4234}
4235
4236message ProcessStatsStateProto {
4237 optional android.service.procstats.ScreenState screen_state = 1;
4238
4239 optional android.service.procstats.MemoryState memory_state = 2;
4240
4241 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4242 // and not frameworks/base/core/java/android/app/ActivityManager.java
4243 optional android.service.procstats.ProcessState process_state = 3;
4244
4245 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004246 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004247
4248 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004249 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004250
4251 // # of samples taken
4252 optional int32 sample_size = 5;
4253
4254 // PSS is memory reserved for this process
4255 optional AggStats pss = 6;
4256
4257 // USS is memory shared between processes, divided evenly for accounting
4258 optional AggStats uss = 7;
4259
4260 // RSS is memory resident for this process
4261 optional AggStats rss = 8;
4262}
4263
4264// Next Tag: 7
4265message ProcessStatsProto {
4266 // Name of process.
4267 optional string process = 1;
4268
4269 // Uid of the process.
4270 optional int32 uid = 2;
4271
4272 // Information about how often kills occurred
4273 message Kill {
4274 // Count of excessive CPU kills
4275 optional int32 cpu = 1;
4276
4277 // Count of kills when cached
4278 optional int32 cached = 2;
4279
4280 // PSS stats during cached kill
4281 optional AggStats cached_pss = 3;
4282 }
4283 optional Kill kill = 3;
4284
4285 // Time and memory spent in various states.
4286 repeated ProcessStatsStateProto states = 5;
4287
4288 // Total time process has been running... screen_state, memory_state, and process_state
4289 // will not be set.
4290 optional ProcessStatsStateProto total_running_state = 6;
4291}
4292
4293message PackageServiceOperationStatsProto {
4294 // Operate enum: Started, Foreground, Bound, Executing
4295 optional android.service.procstats.ServiceOperationState operation = 1;
4296
4297 // Number of times the service was in this operation.
4298 optional int32 count = 2;
4299
4300 // Information about a state the service can be in.
4301 message StateStats {
4302 // Screen state enum.
4303 optional android.service.procstats.ScreenState screen_state = 1;
4304 // Memory state enum.
4305 optional android.service.procstats.MemoryState memory_state = 2;
4306
4307 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004308 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004309 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004310 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004311 }
4312 repeated StateStats state_stats = 3;
4313}
4314
4315message PackageServiceStatsProto {
4316 // Name of service component.
4317 optional string service_name = 1;
4318
4319 // The operation stats.
4320 // The package_name, package_uid, package_version, service_name will not be set to save space.
4321 repeated PackageServiceOperationStatsProto operation_stats = 2;
4322}
4323
4324message PackageAssociationSourceProcessStatsProto {
4325 // Uid of the process.
4326 optional int32 process_uid = 1;
4327 // Process name.
4328 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004329 // Package name.
4330 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004331 // Total count of the times this association appeared.
4332 optional int32 total_count = 3;
4333
4334 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004335 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004336
4337 // Total count of the times this association became actively impacting its target process.
4338 optional int32 active_count = 5;
4339
4340 // Information on one source in this association.
4341 message StateStats {
4342 // Process state enum.
4343 optional android.service.procstats.ProcessState process_state = 1;
4344 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004345 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004346 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004347 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004348 }
4349 repeated StateStats active_state_stats = 6;
4350}
4351
4352message PackageAssociationProcessStatsProto {
4353 // Name of the target component.
4354 optional string component_name = 1;
4355 // Information on one source in this association.
4356 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4357}
4358
4359
4360message ProcessStatsPackageProto {
4361 // Name of package.
4362 optional string package = 1;
4363
4364 // Uid of the package.
4365 optional int32 uid = 2;
4366
4367 // Version of the package.
4368 optional int64 version = 3;
4369
4370 // Stats for each process running with the package loaded in to it.
4371 repeated ProcessStatsProto process_stats = 4;
4372
4373 // Stats for each of the package's services.
4374 repeated PackageServiceStatsProto service_stats = 5;
4375
4376 // Stats for each association with the package.
4377 repeated PackageAssociationProcessStatsProto association_stats = 6;
4378}
4379
4380message ProcessStatsSectionProto {
4381 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004382 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004383
4384 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004385 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004386
4387 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004388 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004389
4390 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004391 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004392
4393 // System runtime library. e.g. "libdvm.so", "libart.so".
4394 optional string runtime = 5;
4395
4396 // whether kernel reports swapped pss.
4397 optional bool has_swapped_pss = 6;
4398
4399 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4400 enum Status {
4401 STATUS_UNKNOWN = 0;
4402 STATUS_COMPLETE = 1;
4403 STATUS_PARTIAL = 2;
4404 STATUS_SHUTDOWN = 3;
4405 STATUS_SYSPROPS = 4;
4406 }
4407 repeated Status status = 7;
4408
Chenjie Yub2ecc792019-01-17 10:27:26 -08004409 // Number of pages available of various types and sizes, representation fragmentation.
4410 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4411
Yangsteraf9aee72018-10-12 09:26:16 -07004412 // Stats for each process.
4413 repeated ProcessStatsProto process_stats = 8;
4414
4415 // Stats for each package.
4416 repeated ProcessStatsPackageProto package_stats = 9;
4417}
4418
Chenjie Yub2ecc792019-01-17 10:27:26 -08004419message ProcessStatsAvailablePagesProto {
4420 // Node these pages are in (as per /proc/pagetypeinfo)
4421 optional int32 node = 1;
4422
4423 // Zone these pages are in (as per /proc/pagetypeinfo)
4424 optional string zone = 2;
4425
4426 // Label for the type of these pages (as per /proc/pagetypeinfo)
4427 optional string label = 3;
4428
4429 // Distribution of number of pages available by order size. First entry in array is
4430 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4431 repeated int32 pages_per_order = 4;
4432}
4433
Chenjie Yu12e5e672018-09-14 15:54:59 -07004434/**
4435 * Pulled from ProcessStatsService.java
4436 */
4437message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004438 optional ProcessStatsSectionProto proc_stats_section = 1;
4439}
4440
Chenjie Yuf910b7802019-01-11 16:08:20 -08004441/**
4442 * Pulled from ProcessStatsService.java
4443 */
4444message ProcStatsPkgProc {
4445 optional ProcessStatsSectionProto proc_stats_section = 1;
4446}
4447
Yangsteraf9aee72018-10-12 09:26:16 -07004448message PowerProfileProto {
4449 optional double cpu_suspend = 1;
4450
4451 optional double cpu_idle = 2;
4452
4453 optional double cpu_active = 3;
4454
4455 message CpuCluster {
4456 optional int32 id = 1;
4457 optional double cluster_power = 2;
4458 optional int32 cores = 3;
4459 repeated int64 speed = 4;
4460 repeated double core_power = 5;
4461 }
4462
4463 repeated CpuCluster cpu_cluster = 40;
4464
4465 optional double wifi_scan = 4;
4466
4467 optional double wifi_on = 5;
4468
4469 optional double wifi_active = 6;
4470
4471 optional double wifi_controller_idle = 7;
4472
4473 optional double wifi_controller_rx = 8;
4474
4475 optional double wifi_controller_tx = 9;
4476
4477 repeated double wifi_controller_tx_levels = 10;
4478
4479 optional double wifi_controller_operating_voltage = 11;
4480
4481 optional double bluetooth_controller_idle = 12;
4482
4483 optional double bluetooth_controller_rx = 13;
4484
4485 optional double bluetooth_controller_tx = 14;
4486
4487 optional double bluetooth_controller_operating_voltage = 15;
4488
4489 optional double modem_controller_sleep = 16;
4490
4491 optional double modem_controller_idle = 17;
4492
4493 optional double modem_controller_rx = 18;
4494
4495 repeated double modem_controller_tx = 19;
4496
4497 optional double modem_controller_operating_voltage = 20;
4498
4499 optional double gps_on = 21;
4500
4501 repeated double gps_signal_quality_based = 22;
4502
4503 optional double gps_operating_voltage = 23;
4504
4505 optional double bluetooth_on = 24;
4506
4507 optional double bluetooth_active = 25;
4508
4509 optional double bluetooth_at_cmd = 26;
4510
4511 optional double ambient_display = 27;
4512
4513 optional double screen_on = 28;
4514
4515 optional double radio_on = 29;
4516
4517 optional double radio_scanning = 30;
4518
4519 optional double radio_active = 31;
4520
4521 optional double screen_full = 32;
4522
4523 optional double audio = 33;
4524
4525 optional double video = 34;
4526
4527 optional double flashlight = 35;
4528
4529 optional double memory = 36;
4530
4531 optional double camera = 37;
4532
4533 optional double wifi_batched_scan = 38;
4534
4535 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004536}
Chenjie Yuab530202018-09-26 12:39:20 -07004537
4538/**
4539 * power_profile.xml and other constants for power model calculations.
4540 * Pulled from PowerProfile.java
4541 */
4542message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004543 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004544}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004545
4546/**
arangelovd5db50e2018-10-12 20:24:39 +01004547 * Logs when a user restriction was added or removed.
4548 *
4549 * Logged from:
4550 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4551 */
4552message UserRestrictionChanged {
4553 // The raw string of the user restriction as defined in UserManager.
4554 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4555 optional string restriction = 1;
4556 // Whether the restriction is enabled or disabled.
4557 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004558}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004559
4560/**
4561 * Pulls process user time and system time. Puller takes a snapshot of all pids
4562 * in the system and returns cpu stats for those that are working at the time.
4563 * Dead pids will be dropped. Kernel processes are excluded.
4564 * Min cool-down is 5 sec.
4565 */
4566message ProcessCpuTime {
4567 optional int32 uid = 1 [(is_uid) = true];
4568
4569 optional string process_name = 2;
4570 // Process cpu time in user space, cumulative from boot/process start
4571 optional int64 user_time_millis = 3;
4572 // Process cpu time in system space, cumulative from boot/process start
4573 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004574}
Misha Wagner5a51e002018-10-03 15:04:09 +01004575
4576/**
4577 * Pulls the CPU usage for each thread.
4578 *
4579 * Read from /proc/$PID/task/$TID/time_in_state files.
4580 *
4581 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4582 * time_in_state files not being present on some phones, have not been addressed. These should be
4583 * considered before a public release.
4584 */
4585message CpuTimePerThreadFreq {
4586 // UID that owns the process.
4587 optional int32 uid = 1 [(is_uid) = true];
4588 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004589 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004590 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004591 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004592 // Name of the process taken from `/proc/$PID/cmdline`.
4593 optional string process_name = 4;
4594 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4595 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004596
4597 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4598 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4599 // frequencies are given here as the alternative is sending eight separate atoms. This method
4600 // significantly reduces the amount of data created
4601 optional int32 frequency1_khz = 6;
4602 optional int32 time1_millis = 7;
4603 optional int32 frequency2_khz = 8;
4604 optional int32 time2_millis = 9;
4605 optional int32 frequency3_khz = 10;
4606 optional int32 time3_millis = 11;
4607 optional int32 frequency4_khz = 12;
4608 optional int32 time4_millis = 13;
4609 optional int32 frequency5_khz = 14;
4610 optional int32 time5_millis = 15;
4611 optional int32 frequency6_khz = 16;
4612 optional int32 time6_millis = 17;
4613 optional int32 frequency7_khz = 18;
4614 optional int32 time7_millis = 19;
4615 optional int32 frequency8_khz = 20;
4616 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004617}
Bookatz75ee60422018-11-09 12:27:37 -08004618
4619/**
Bookatz366a4432018-11-20 09:42:33 -08004620 * Pulls information about the device's build.
4621 */
4622message BuildInformation {
4623 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4624 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4625 optional string fingerprint = 1;
4626
4627 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4628 optional string brand = 2;
4629
4630 // Build.PRODUCT. The name of the overall product.
4631 optional string product = 3;
4632
4633 // Build.DEVICE. The name of the industrial design.
4634 optional string device = 4;
4635
4636 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4637 optional string version_release = 5;
4638
4639 // Build.ID. E.g. a label like "M4-rc20".
4640 optional string id = 6;
4641
4642 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4643 // represent this build.
4644 optional string version_incremental = 7;
4645
4646 // Build.TYPE. The type of build, like "user" or "eng".
4647 optional string type = 8;
4648
4649 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4650 optional string tags = 9;
4651}
4652
4653/**
Bookatz75ee60422018-11-09 12:27:37 -08004654 * Pulls on-device BatteryStats power use calculations for the overall device.
4655 */
4656message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004657 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4658 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4659 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4660 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08004661}
4662
4663/**
4664 * Pulls on-device BatteryStats power use calculations broken down by uid.
4665 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4666 * that is attributed to non-uid items. They must all be included to get the total power use.
4667 */
4668message DeviceCalculatedPowerBlameUid {
4669 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4670 optional int32 uid = 1 [(is_uid) = true];
4671
Bookatz3dbc13a2018-12-21 12:16:51 -08004672 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4673 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4674 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08004675}
4676
4677/**
4678 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4679 * drain type.
4680 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4681 * is attributed uids. They must all be included to get the total power use.
4682 */
4683message DeviceCalculatedPowerBlameOther {
4684 // The type of item whose power use is being reported.
4685 enum DrainType {
4686 AMBIENT_DISPLAY = 0;
4687 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4688 BLUETOOTH = 2;
4689 CAMERA = 3;
4690 // Cell-standby
4691 CELL = 4;
4692 FLASHLIGHT = 5;
4693 IDLE = 6;
4694 MEMORY = 7;
4695 // Amount that total computed drain exceeded the drain estimated using the
4696 // battery level changes and capacity.
4697 OVERCOUNTED = 8;
4698 PHONE = 9;
4699 SCREEN = 10;
4700 // Amount that total computed drain was below the drain estimated using the
4701 // battery level changes and capacity.
4702 UNACCOUNTED = 11;
4703 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4704 WIFI = 13;
4705 }
4706 optional DrainType drain_type = 1;
4707
Bookatz3dbc13a2018-12-21 12:16:51 -08004708 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4709 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4710 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004711}
arangelov4e994062018-11-13 16:12:38 +00004712
4713/**
4714 * Logs device policy features.
4715 *
4716 * Logged from:
4717 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4718 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4719 */
4720message DevicePolicyEvent {
4721 // The event id - unique for each event.
4722 optional android.stats.devicepolicy.EventId event_id = 1;
4723 // The admin package name.
4724 optional string admin_package_name = 2;
4725 // A generic integer parameter.
4726 optional int32 integer_value = 3;
4727 // A generic boolean parameter.
4728 optional bool boolean_value = 4;
4729 // A parameter specifying a time period in milliseconds.
4730 optional uint64 time_period_millis = 5;
4731 // A parameter specifying a list of package names, bundle extras or string parameters.
4732 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4733}
shawnlinea5b66b2018-11-13 15:05:29 +08004734
4735/**
4736 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4737 *
4738 * Logged from:
4739 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4740 */
4741message DocsUILaunchReported {
4742 optional android.stats.docsui.LaunchAction launch_action = 1;
4743 optional bool has_initial_uri = 2;
4744 optional android.stats.docsui.MimeType mime_type = 3;
4745 optional android.stats.docsui.Root initial_root = 4;
4746}
4747
4748/**
4749 * Logs root/app visited event in file managers/picker. Call this when the user
4750 * taps on root/app in hamburger menu.
4751 *
4752 * Logged from:
4753 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4754 */
4755message DocsUIRootVisitedReported {
4756 optional android.stats.docsui.ContextScope scope = 1;
4757 optional android.stats.docsui.Root root = 2;
4758}
4759
4760/**
4761 * Logs file operation stats. Call this when a file operation has completed.
4762 *
4763 * Logged from:
4764 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4765 */
4766message DocsUIFileOperationReported {
4767 optional android.stats.docsui.Provider provider = 1;
4768 optional android.stats.docsui.FileOperation file_op = 2;
4769}
4770
4771/**
4772 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4773 * mode.
4774 *
4775 * Logged from:
4776 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4777 */
4778message DocsUIFileOperationCopyMoveModeReported {
4779 optional android.stats.docsui.FileOperation file_op = 1;
4780 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4781}
4782
4783
4784/**
4785 * Logs file sub operation stats. Call this when a file operation has failed.
4786 *
4787 * Logged from:
4788 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4789 */
4790message DocsUIFileOperationFailureReported {
4791 optional android.stats.docsui.Authority authority = 1;
4792 optional android.stats.docsui.SubFileOperation sub_op = 2;
4793}
4794
4795/**
4796* Logs the cancellation of a file operation. Call this when a job is canceled
4797*
4798* Logged from:
4799* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4800*/
4801message DocsUIFileOperationCanceledReported {
4802 optional android.stats.docsui.FileOperation file_op = 1;
4803}
4804
4805/**
4806 * Logs startup time in milliseconds.
4807 *
4808 * Logged from:
4809 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4810 */
4811message DocsUIStartupMsReported {
4812 optional int32 startup_millis = 1;
4813}
4814
4815/**
4816 * Logs the action that was started by user.
4817 *
4818 * Logged from:
4819 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4820 */
4821message DocsUIUserActionReported {
4822 optional android.stats.docsui.UserAction action = 1;
4823}
4824
4825/**
4826 * Logs the invalid type when invalid scoped access is requested.
4827 *
4828 * Logged from:
4829 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4830 */
4831message DocsUIInvalidScopedAccessRequestReported {
4832 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004833}
Ben Murdochbab399f62018-12-06 11:01:38 +00004834
4835/**
shawnlina75e82d2019-01-07 10:31:12 +08004836 * Logs the package name that launches docsui picker mode.
4837 *
4838 * Logged from:
4839 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4840 */
4841message DocsUIPickerLaunchedFromReported {
4842 optional string package_name = 1;
4843}
4844
4845/**
4846 * Logs the search type.
4847 *
4848 * Logged from:
4849 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4850 */
4851message DocsUISearchTypeReported {
4852 optional android.stats.docsui.SearchType search_type = 1;
4853}
4854
4855/**
4856 * Logs the search mode.
4857 *
4858 * Logged from:
4859 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4860 */
4861message DocsUISearchModeReported {
4862 optional android.stats.docsui.SearchMode search_mode = 1;
4863}
4864
4865/**
4866 * Logs the pick result information.
4867 *
4868 * Logged from:
4869 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4870 */
4871message DocsUIPickResultReported {
4872 optional int32 total_action_count = 1;
4873 optional int64 duration_millis = 2;
4874 optional int32 file_count= 3;
4875 optional bool is_searching = 4;
4876 optional android.stats.docsui.Root picked_from = 5;
4877 optional android.stats.docsui.MimeType mime_type = 6;
4878 optional int32 repeatedly_pick_times = 7;
4879}
4880
4881/**
Ben Murdochbab399f62018-12-06 11:01:38 +00004882 * Logs when an app's memory is compacted.
4883 *
4884 * Logged from:
4885 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4886 */
4887message AppCompacted {
4888 // The pid of the process being compacted.
4889 optional int32 pid = 1;
4890
4891 // The name of the process being compacted.
4892 optional string process_name = 2;
4893
4894 // The type of compaction.
4895 enum Action {
4896 UNKNOWN = 0;
4897 SOME = 1;
4898 FULL = 2;
4899 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004900 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00004901
4902 // Total RSS in kilobytes consumed by the process prior to compaction.
4903 optional int64 before_rss_total_kilobytes = 4;
4904
4905 // File RSS in kilobytes consumed by the process prior to compaction.
4906 optional int64 before_rss_file_kilobytes = 5;
4907
4908 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4909 optional int64 before_rss_anon_kilobytes = 6;
4910
4911 // Swap in kilobytes consumed by the process prior to compaction.
4912 optional int64 before_swap_kilobytes = 7;
4913
4914 // Total RSS in kilobytes consumed by the process after compaction.
4915 optional int64 after_rss_total_kilobytes = 8;
4916
4917 // File RSS in kilobytes consumed by the process after compaction.
4918 optional int64 after_rss_file_kilobytes = 9;
4919
4920 // Anonymous RSS in kilobytes consumed by the process after compaction.
4921 optional int64 after_rss_anon_kilobytes = 10;
4922
4923 // Swap in kilobytes consumed by the process after compaction.
4924 optional int64 after_swap_kilobytes = 11;
4925
4926 // The time taken to perform compaction in milliseconds.
4927 optional int64 time_to_compact_millis = 12;
4928
4929 // The last compaction action performed for this app.
4930 optional Action last_action = 13;
4931
Ben Murdoch01720b82018-12-19 18:03:44 +00004932 // The last time that compaction was attempted on this process in milliseconds
4933 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4934 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00004935
Ben Murdoch885c21b2019-03-15 18:02:04 +00004936 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00004937 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00004938
4939 // The process state at the time of compaction.
4940 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00004941
4942 // Free ZRAM in kilobytes before compaction.
4943 optional int64 before_zram_free_kilobytes = 17;
4944
4945 // Free ZRAM in kilobytes after compaction.
4946 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00004947}
lifr157fc552018-12-12 16:38:04 +08004948
4949/**
4950 * Logs the latency period(in microseconds) and the return code of
4951 * the DNS(Domain Name System) lookups.
4952 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4953 * to get info(address or hostname) from DNS server(or DNS cache).
4954 * Logged from:
4955 * /system/netd/server/DnsProxyListener.cpp
4956 */
4957message NetworkDnsEventReported {
4958 // The types of the DNS lookups, as defined in
4959 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4960 enum EventType {
4961 EVENT_UNKNOWN = 0;
4962 EVENT_GETADDRINFO = 1;
4963 EVENT_GETHOSTBYNAME = 2;
4964 EVENT_GETHOSTBYADDR = 3;
4965 EVENT_RES_NSEND = 4;
4966 }
4967 optional EventType event_type = 1;
4968
4969 // The return value of the DNS resolver for each DNS lookups.
4970 //bionic/libc/include/netdb.h
4971 //system/netd/resolv/include/netd_resolv/resolv.h
4972 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08004973 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08004974 EAI_ADDRFAMILY = 1;
4975 EAI_AGAIN = 2;
4976 EAI_BADFLAGS = 3;
4977 EAI_FAIL = 4;
4978 EAI_FAMILY = 5;
4979 EAI_MEMORY = 6;
4980 EAI_NODATA = 7;
4981 EAI_NONAME = 8;
4982 EAI_SERVICE = 9;
4983 EAI_SOCKTYPE = 10;
4984 EAI_SYSTEM = 11;
4985 EAI_BADHINTS = 12;
4986 EAI_PROTOCOL = 13;
4987 EAI_OVERFLOW = 14;
4988 RESOLV_TIMEOUT = 255;
4989 EAI_MAX = 256;
4990 }
4991 optional ReturnCode return_code = 2;
4992
4993 // The latency period(in microseconds) it took for this DNS lookup to complete.
4994 optional int32 latency_micros = 3;
4995}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08004996
4997/**
4998 * Logs when a data stall event occurs.
4999 *
5000 * Log from:
5001 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5002 */
5003message DataStallEvent {
5004 // Data stall evaluation type.
5005 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5006 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5007 optional int32 evaluation_type = 1;
5008 // See definition in data_stall_event.proto.
5009 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5010 // See definition in data_stall_event.proto.
5011 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5012 // See definition in data_stall_event.proto.
5013 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5014 // See definition in data_stall_event.proto.
5015 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5016 // See definition in data_stall_event.proto.
5017 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5018}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005019
5020/*
5021 * Logs when RescueParty resets some set of experiment flags.
5022 *
5023 * Logged from:
5024 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5025 */
5026message RescuePartyResetReported {
5027 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5028 optional int32 rescue_level = 1;
5029}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005030
5031/**
5032 * Logs when signed config is received from an APK, and if that config was applied successfully.
5033 * Logged from:
5034 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5035 */
5036message SignedConfigReported {
5037 enum Type {
5038 UNKNOWN_TYPE = 0;
5039 GLOBAL_SETTINGS = 1;
5040 }
5041 optional Type type = 1;
5042
5043 // The final status of the signed config received.
5044 enum Status {
5045 UNKNOWN_STATUS = 0;
5046 APPLIED = 1;
5047 BASE64_FAILURE_CONFIG = 2;
5048 BASE64_FAILURE_SIGNATURE = 3;
5049 SECURITY_EXCEPTION = 4;
5050 INVALID_CONFIG = 5;
5051 OLD_CONFIG = 6;
5052 SIGNATURE_CHECK_FAILED = 7;
5053 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005054 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005055 }
5056 optional Status status = 2;
5057
5058 // The version of the signed config processed.
5059 optional int32 version = 3;
5060
5061 // The package name that the config was extracted from.
5062 optional string from_package = 4;
5063
5064 enum Key {
5065 NO_KEY = 0;
5066 DEBUG = 1;
5067 PRODUCTION = 2;
5068 }
5069 // Which key was used to verify the config.
5070 optional Key verified_with = 5;
5071}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005072
5073/*
5074 * Logs GNSS Network-Initiated (NI) location events.
5075 *
5076 * Logged from:
5077 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5078 */
5079message GnssNiEventReported {
5080 // The type of GnssNiEvent.
5081 enum EventType {
5082 UNKNOWN = 0;
5083 NI_REQUEST = 1;
5084 NI_RESPONSE = 2;
5085 }
5086 optional EventType event_type = 1;
5087
5088 // An ID generated by HAL to associate NI notifications and UI responses.
5089 optional int32 notification_id = 2;
5090
5091 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005092 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005093
5094 // NI requires notification.
5095 optional bool need_notify = 4;
5096
5097 // NI requires verification.
5098 optional bool need_verify = 5;
5099
5100 // NI requires privacy override, no notification/minimal trace.
5101 optional bool privacy_override = 6;
5102
5103 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5104 // seconds.
5105 optional int32 timeout = 7;
5106
5107 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005108 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005109
5110 // String representing the requester of the network inititated location request.
5111 optional string requestor_id = 9;
5112
5113 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5114 // network initiated location request.
5115 optional string text = 10;
5116
5117 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005118 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005119
5120 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005121 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005122
5123 // True if SUPL ES is enabled.
5124 optional bool is_supl_es_enabled = 13;
5125
5126 // True if GNSS location is enabled.
5127 optional bool is_location_enabled = 14;
5128
5129 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005130 optional android.server.location.GnssUserResponseType user_response = 15;
5131}
5132
5133/**
5134 * Logs GNSS non-framework (NFW) location notification.
5135 *
5136 * Logged from:
5137 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5138 */
5139message GnssNfwNotificationReported {
5140 // Package name of the Android proxy application representing the non-framework entity that
5141 // requested location. Set to empty string if unknown.
5142 optional string proxy_app_package_name = 1;
5143
5144 // Protocol stack that initiated the non-framework location request.
5145 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5146
5147 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5148 // set to empty string. This field is opaque to the framework and used for logging purposes.
5149 optional string other_protocol_stack_name = 3;
5150
5151 // Source initiating/receiving the location information.
5152 optional android.server.location.NfwRequestor requestor = 4;
5153
5154 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5155 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5156 // and used for logging purposes.
5157 optional string requestor_id = 5;
5158
5159 // Indicates whether location information was provided for this request.
5160 optional android.server.location.NfwResponseType response_type = 6;
5161
5162 // True if the device is in user initiated emergency session.
5163 optional bool in_emergency_mode = 7;
5164
5165 // True if cached location is provided.
5166 optional bool is_cached_location = 8;
5167
5168 // True if proxy app permission mismatch between framework and GNSS HAL.
5169 optional bool is_permission_mismatched = 9;
5170}
5171
5172/**
5173 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5174 *
5175 * Logged from:
5176 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5177 */
5178message GnssConfigurationReported {
5179 // SUPL host name.
5180 optional string supl_host = 1;
5181
5182 // SUPL port number.
5183 optional int32 supl_port = 2;
5184
5185 // C2K host name.
5186 optional string c2k_host = 3;
5187
5188 // C2K port number.
5189 optional int32 c2k_port = 4;
5190
5191 // The SUPL version requested by Carrier.
5192 optional int32 supl_ver = 5;
5193
5194 // The SUPL mode.
5195 optional android.server.location.SuplMode supl_mode = 6;
5196
5197 // True if NI emergency SUPL restrictions is enabled.
5198 optional bool supl_es = 7;
5199
5200 // LTE Positioning Profile settings
5201 optional android.server.location.LppProfile lpp_profile = 8;
5202
5203 // Positioning protocol on A-Glonass system.
5204 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5205
5206 // True if emergency PDN is used. Otherwise, regular PDN is used.
5207 optional bool use_emergency_pdn_for_emergency_supl= 10;
5208
5209 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5210 optional android.server.location.GpsLock gps_lock = 11;
5211
5212 // Number of seconds to extend the emergency session duration post emergency call.
5213 optional int32 es_extension_sec = 12;
5214
5215 // The full list of package names of proxy Android applications representing the non-framework
5216 // location access entities (on/off the device) for which the framework user has granted
5217 // non-framework location access permission. The package names are concatenated in one string
5218 // with spaces as separators.
5219 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005220}
Jack Yu95b64f32018-12-13 18:26:11 +08005221
5222/**
5223 * Logs when a NFC device's error occurred.
5224 * Logged from:
5225 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5226 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5227 */
5228message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005229 enum Type {
5230 UNKNOWN = 0;
5231 CMD_TIMEOUT = 1;
5232 ERROR_NOTIFICATION = 2;
5233 AID_OVERFLOW = 3;
5234 }
5235 optional Type type = 1;
5236 // If it's nci cmd timeout, log the timeout command.
5237 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005238
Alex Salod7c3eef2019-01-25 14:43:27 -08005239 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005240}
5241
5242/**
5243 * Logs when a NFC device's state changed event
5244 * Logged from:
5245 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5246 */
5247message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005248 enum State {
5249 UNKNOWN = 0;
5250 OFF = 1;
5251 ON = 2;
5252 ON_LOCKED = 3; // Secure Nfc enabled.
5253 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5254 }
5255 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005256}
5257
5258/**
5259 * Logs when a NFC Beam Transaction occurred.
5260 * Logged from:
5261 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5262 */
5263message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005264 enum Operation {
5265 UNKNOWN = 0;
5266 SEND = 1;
5267 RECEIVE = 2;
5268 }
5269 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005270}
5271
5272/**
5273 * Logs when a NFC Card Emulation Transaction occurred.
5274 * Logged from:
5275 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5276 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5277 */
5278message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005279 enum Category {
5280 UNKNOWN = 0;
5281 HCE_PAYMENT = 1;
5282 HCE_OTHER = 2;
5283 OFFHOST = 3;
5284 }
5285 // Transaction belongs to HCE payment or HCE other category, or offhost.
5286 optional Category category = 1;
5287 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5288 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005289}
5290
5291/**
5292 * Logs when a NFC Tag event occurred.
5293 * Logged from:
5294 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5295 */
5296message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005297 enum Type {
5298 UNKNOWN = 0;
5299 URL = 1;
5300 BT_PAIRING = 2;
5301 PROVISION = 3;
5302 WIFI_CONNECT = 4;
5303 APP_LAUNCH = 5;
5304 OTHERS = 6;
5305 }
5306 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005307}
5308
5309/**
5310 * Logs when Hce transaction triggered
5311 * Logged from:
5312 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5313 */
5314message NfcHceTransactionOccurred {
5315 // The latency period(in microseconds) it took for the first HCE data
5316 // exchange.
5317 optional uint32 latency_micros = 1;
5318}
5319
5320/**
5321 * Logs when SecureElement state event changed
5322 * Logged from:
5323 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5324 */
5325message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005326 enum State {
5327 UNKNOWN = 0;
5328 INITIALIZED = 1;
5329 DISCONNECTED = 2;
5330 CONNECTED = 3;
5331 HALCRASH = 4;
5332 }
5333 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005334
Alex Salod7c3eef2019-01-25 14:43:27 -08005335 optional string state_change_reason = 2;
5336 // SIMx or eSEx.
5337 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005338}
5339
5340/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005341 * Information about a permission grant request
5342 */
5343message PermissionGrantRequestResultReported {
5344 // unique value identifying an API call. A API call might result in multiple of these atoms
5345 optional int64 request_id = 1;
5346
5347 // UID of package requesting the permission grant
5348 optional int32 requesting_uid = 2 [(is_uid) = true];
5349
5350 // Name of package requesting the permission grant
5351 optional string requesting_package_name = 3;
5352
5353 // The permission to be granted
5354 optional string permission_name = 4;
5355
5356 // If the permission was explicitly requested via the API or added by the system
5357 optional bool is_implicit = 5;
5358
5359 enum Result {
5360 UNDEFINED = 0;
5361 // permission request was ignored
5362 IGNORED = 1;
5363 // permission request was ignored because it was user fixed
5364 IGNORED_USER_FIXED = 2;
5365 // permission request was ignored because it was policy fixed
5366 IGNORED_POLICY_FIXED = 3;
5367 // permission was granted by user action
5368 USER_GRANTED = 4;
5369 // permission was automatically granted
5370 AUTO_GRANTED = 5;
5371 // permission was denied by user action
5372 USER_DENIED = 6;
5373 // permission was denied with prejudice by the user
5374 USER_DENIED_WITH_PREJUDICE = 7;
5375 // permission was automatically denied
5376 AUTO_DENIED = 8;
5377 }
5378 // The result of the permission grant
5379 optional Result result = 6;
5380}
5381
5382/**
Jack Yu95b64f32018-12-13 18:26:11 +08005383 * Logs when Omapi API used
5384 * Logged from:
5385 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5386 */
5387message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005388 enum Operation {
5389 UNKNOWN = 0;
5390 OPEN_CHANNEL = 1;
5391 }
5392 optional Operation operation = 1;
5393 // SIMx or eSEx.
5394 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005395
Alex Salod7c3eef2019-01-25 14:43:27 -08005396 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005397}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005398
5399/**
Alex Saloa060aee2019-01-21 14:36:41 -08005400 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5401 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005402 * Logged from:
5403 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5404 */
5405message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005406 optional int64 dispatch_latency_millis = 1;
5407}
5408
5409/**
5410 * Logs AttentionManagerService attention check result.
5411 *
5412 * Logged from:
5413 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5414 */
5415message AttentionManagerServiceResultReported {
5416 // See core/java/android/service/attention/AttentionService.java
5417 enum AttentionCheckResult {
5418 UNKNOWN = 20;
5419 ATTENTION_SUCCESS_ABSENT = 0;
5420 ATTENTION_SUCCESS_PRESENT = 1;
5421 ATTENTION_FAILURE_PREEMPTED = 2;
5422 ATTENTION_FAILURE_TIMED_OUT = 3;
5423 ATTENTION_FAILURE_UNKNOWN = 4;
5424 }
5425 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005426}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005427
5428/**
5429 * Logs when an adb connection changes state.
5430 *
5431 * Logged from:
5432 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5433 */
5434message AdbConnectionChanged {
5435 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5436 // previously selected for this system.
5437 optional int64 last_connection_time_millis = 1;
5438
5439 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5440 // to reconnect via adb without user interaction.
5441 optional int64 auth_window_millis = 2;
5442
5443 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5444 optional android.debug.AdbConnectionStateEnum state = 3;
5445
5446 // True if the 'always allow' option was selected for this system.
5447 optional bool always_allow = 4;
5448}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005449
5450/*
5451 * Logs the reported speech DSP status.
5452 *
5453 * Logged from:
5454 * Vendor audio implementation.
5455 */
5456message SpeechDspStatReported {
5457 // The total Speech DSP uptime in milliseconds.
5458 optional int32 total_uptime_millis = 1;
5459 // The total Speech DSP downtime in milliseconds.
5460 optional int32 total_downtime_millis = 2;
5461 optional int32 total_crash_count = 3;
5462 optional int32 total_recover_count = 4;
5463}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005464
5465/**
5466 * Logs USB connector contaminant status.
5467 *
5468 * Logged from: USB Service.
5469 */
5470message UsbContaminantReported {
5471 optional string id = 1;
5472 optional android.service.usb.ContaminantPresenceStatus status = 2;
5473}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005474
5475/**
5476 * This atom is for debugging purpose.
5477 */
5478message DebugElapsedClock {
5479 // Monotically increasing value for each pull.
5480 optional int64 pull_count = 1;
5481 // Time from System.elapsedRealtime.
5482 optional int64 elapsed_clock_millis = 2;
5483 // Time from System.elapsedRealtime.
5484 optional int64 same_elapsed_clock_millis = 3;
5485 // Diff between current elapsed time and elapsed time from previous pull.
5486 optional int64 elapsed_clock_diff_millis = 4;
5487
5488 enum Type {
5489 TYPE_UNKNOWN = 0;
5490 ALWAYS_PRESENT = 1;
5491 PRESENT_ON_ODD_PULLS = 2;
5492 }
5493 // Type of behavior for the pulled data.
5494 optional Type type = 5;
5495}
5496
5497/**
5498 * This atom is for debugging purpose.
5499 */
5500message DebugFailingElapsedClock {
5501 // Monotically increasing value for each pull.
5502 optional int64 pull_count = 1;
5503 // Time from System.elapsedRealtime.
5504 optional int64 elapsed_clock_millis = 2;
5505 // Time from System.elapsedRealtime.
5506 optional int64 same_elapsed_clock_millis = 3;
5507 // Diff between current elapsed time and elapsed time from previous pull.
5508 optional int64 elapsed_clock_diff_millis = 4;
5509}
Steven Wuacef6bb2019-01-23 14:21:17 -05005510
5511/** Logs System UI bubbles event changed.
5512 *
5513 * Logged from:
5514 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5515 */
5516message BubbleUIChanged {
5517
5518 // The app package that is posting the bubble.
5519 optional string package_name = 1;
5520
5521 // The notification channel that is posting the bubble.
5522 optional string notification_channel = 2;
5523
5524 // The notification id associated with the posted bubble.
5525 optional int32 notification_id = 3;
5526
5527 // The position of the bubble within the bubble stack.
5528 optional int32 position = 4;
5529
5530 // The total number of bubbles within the bubble stack.
5531 optional int32 total_number = 5;
5532
5533 // User interactions with the bubble.
5534 enum Action {
5535 UNKNOWN = 0;
5536 POSTED = 1;
5537 UPDATED = 2;
5538 EXPANDED = 3;
5539 COLLAPSED = 4;
5540 DISMISSED = 5;
5541 STACK_DISMISSED = 6;
5542 STACK_MOVED = 7;
5543 HEADER_GO_TO_APP = 8;
5544 HEADER_GO_TO_SETTINGS = 9;
5545 PERMISSION_OPT_IN = 10;
5546 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005547 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005548 SWIPE_LEFT = 13;
5549 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005550 STACK_EXPANDED = 15;
Steven Wuacef6bb2019-01-23 14:21:17 -05005551 }
5552 optional Action action = 6;
5553
5554 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5555 optional float normalized_x_position = 7;
5556 optional float normalized_y_position = 8;
5557}
Kweku Adams8845d012018-12-11 20:06:45 -08005558
5559/**
Steven Wu552f63f2019-02-05 13:41:36 -05005560 * Logs System UI bubbles developer errors.
5561 *
5562 * Logged from:
5563 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5564 */
5565message BubbleDeveloperErrorReported {
5566
5567 // The app package that is posting the bubble.
5568 optional string package_name = 1;
5569
5570 // Bubble developer error type enums.
5571 enum Error {
5572 UNKNOWN = 0;
5573 ACTIVITY_INFO_MISSING = 1;
5574 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5575 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5576 }
5577 optional Error error = 2 [default = UNKNOWN];
5578}
5579
5580/**
Kweku Adams8845d012018-12-11 20:06:45 -08005581 * Logs that a constraint for a scheduled job has changed.
5582 *
5583 * Logged from:
5584 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5585 */
5586message ScheduledJobConstraintChanged {
5587 repeated AttributionNode attribution_node = 1;
5588
5589 // Name of the job.
5590 optional string job_name = 2;
5591
5592 optional com.android.server.job.ConstraintEnum constraint = 3;
5593
5594 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08005595 UNKNOWN = 0;
5596 UNSATISFIED = 1;
5597 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08005598 }
5599 optional State state = 4;
5600}
Alex Salod7c3eef2019-01-25 14:43:27 -08005601
5602/**
5603 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5604 * returns true.
5605 *
5606 * Logged from:
5607 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5608 */
5609message ScreenTimeoutExtensionReported {
5610 // Describes how many times in a row did the power manager reset the screen off timeout.
5611 optional uint32 consecutive_timeout_extended_count = 1;
5612}
Hui Yu885aca12019-01-10 17:11:34 -08005613
5614/*
5615* Logs number of milliseconds it takes to start a process.
5616* The definition of app process start time is from the app launch time to
5617* the time that Zygote finished forking the app process and loaded the
5618* application package's java classes.
5619
5620* This metric is different from AppStartOccurred which is for foreground
5621* activity only.
5622
5623* ProcessStartTime can report all processes (both foreground and background)
5624* start time.
5625*
5626* Logged from:
5627* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5628*/
5629message ProcessStartTime {
5630 // The uid of the ProcessRecord.
5631 optional int32 uid = 1 [(is_uid) = true];
5632
5633 // The process pid.
5634 optional int32 pid = 2;
5635
5636 // The process name.
5637 // Usually package name, "system" for system server.
5638 // Provided by ActivityManagerService.
5639 optional string process_name = 3;
5640
5641 enum StartType {
5642 UNKNOWN = 0;
5643 WARM = 1;
5644 HOT = 2;
5645 COLD = 3;
5646 }
5647
5648 // The start type.
5649 optional StartType type = 4;
5650
5651 // The elapsed realtime at the start of the process.
5652 optional int64 process_start_time_millis = 5;
5653
5654 // Number of milliseconds it takes to reach bind application.
5655 optional int32 bind_application_delay_millis = 6;
5656
5657 // Number of milliseconds it takes to finish start of the process.
5658 optional int32 process_start_delay_millis = 7;
5659
5660 // hostingType field in ProcessRecord, the component type such as "activity",
5661 // "service", "content provider", "broadcast" or other strings.
5662 optional string hosting_type = 8;
5663
5664 // hostingNameStr field in ProcessRecord. The component class name that runs
5665 // in this process.
5666 optional string hosting_name = 9;
5667}
5668
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005669/**
5670 * State of a dangerous permission requested by a package
5671 */
5672message DangerousPermissionState {
5673 // Name of the permission
5674 optional string permission_name = 1;
5675
5676 // Uid of the package
5677 optional int32 uid = 2 [(is_uid) = true];
5678
5679 // Package requesting the permission
5680 optional string package_name = 3;
5681
5682 // If the permission is granted to the uid
5683 optional bool is_granted = 4;
5684}
5685
Michael Groover4a0ca942019-01-24 17:41:25 -08005686/**
5687 * Logs when a package is denied access to a device identifier based on the new access requirements.
5688 *
5689 * Logged from:
5690 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
5691 */
5692message DeviceIdentifierAccessDenied {
5693 // The name of the package denied access to the requested device identifier.
5694 optional string package_name = 1;
5695
5696 // The name of the device identifier method the package attempted to invoke.
5697 optional string method_name = 2;
5698
5699 // True if the package is preinstalled.
5700 optional bool is_preinstalled = 3;
5701
5702 // True if the package is privileged.
5703 optional bool is_priv_app = 4;
5704}
Chenjie Yue13f44a2019-02-07 17:51:38 -08005705
5706/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08005707 * Pulls the ongoing mainline install train version code.
5708 * Pulled from StatsCompanionService
5709 */
5710message TrainInfo {
5711 optional int64 train_version_code = 1;
5712
5713 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08005714
5715 optional string train_name = 3;
5716
5717 enum Status {
5718 UNKNOWN = 0;
5719 INSTALL_REQUESTED = 1;
5720 INSTALL_STARTED = 2;
5721 INSTALL_STAGED_NOT_READY = 3;
5722 INSTALL_STAGED_READY = 4;
5723 INSTALL_SUCCESS = 5;
5724 INSTALL_FAILURE = 6;
5725 INSTALL_CANCELLED = 7;
5726 INSTALLER_ROLLBACK_REQUESTED = 8;
5727 INSTALLER_ROLLBACK_INITIATED = 9;
5728 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
5729 INSTALLER_ROLLBACK_STAGED = 11;
5730 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
5731 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
5732 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
5733 INSTALLER_ROLLBACK_SUCCESS = 15;
5734 INSTALLER_ROLLBACK_FAILURE = 16;
5735 INSTALLER_ROLLBACK_CANCEL_STAGED_REMOVE_FROM_QUEUE = 17;
5736 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_INITIATED = 18;
5737 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_SUCCESS = 19;
5738 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_FAILURE = 20;
5739 }
5740 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08005741}
joshmccloskey8c3322e2019-01-09 18:25:57 -08005742
5743/**
5744 * Logs the gesture stage changed event.
5745 *
5746 * Logged from:
5747 * frameworks/base/packages/SystemUI/
5748 */
5749message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005750 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005751}
5752
5753/**
5754 * Logs the feedback type.
5755 *
5756 * Logged from:
5757 * frameworks/base/packages/SystemUI/
5758 */
5759message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005760 // Whether or not the gesture was used.
5761 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005762}
5763
5764/**
5765 * Logs the progress.
5766 *
5767 * Logged from:
5768 * frameworks/base/packages/SystemUI/
5769 */
5770message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005771 // [0,100] progress for the assist gesture.
5772 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005773}
Neil Fullerdb14b482019-02-05 19:44:44 +00005774
5775/*
5776 * Information about the time zone data on a device.
5777 */
5778message TimeZoneDataInfo {
5779 // A version identifier for the data set on device. e.g. "2018i"
5780 optional string tzdb_version = 1;
5781}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005782
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005783/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005784 * Logs the GPU stats global health information.
5785 *
5786 * Logged from:
5787 * frameworks/native/services/gpuservice/gpustats/
5788 */
5789message GpuStatsGlobalInfo {
5790 // Package name of the gpu driver.
5791 optional string driver_package_name = 1;
5792
5793 // Version name of the gpu driver.
5794 optional string driver_version_name = 2;
5795
5796 // Version code of the gpu driver.
5797 optional int64 driver_version_code = 3;
5798
5799 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
5800 optional int64 driver_build_time = 4;
5801
5802 // Total count of the gl driver gets loaded.
5803 optional int64 gl_loading_count = 5;
5804
5805 // Total count of the gl driver fails to be loaded.
5806 optional int64 gl_loading_failure_count = 6;
5807
5808 // Total count of the Vulkan driver gets loaded.
5809 optional int64 vk_loading_count = 7;
5810
5811 // Total count of the Vulkan driver fails to be loaded.
5812 optional int64 vk_loading_failure_count = 8;
5813}
5814
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005815/**
5816 * GPU driver loading time info.
5817 */
5818message GpuDriverLoadingTime {
5819 // List of all the driver loading times for this app. The list size is
5820 // capped at 50.
5821 repeated int64 driver_loading_time = 1;
5822}
5823
5824/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005825 * Logs the GPU stats per app health information.
5826 *
5827 * Logged from:
5828 * frameworks/native/services/gpuservice/gpustats/
5829 */
5830message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005831 // Package name of the application that loads the gpu driver. Total number
5832 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005833 optional string app_package_name = 1;
5834
5835 // Version code of the gpu driver this app loads.
5836 optional int64 driver_version_code = 2;
5837
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005838 // gl driver loading time info.
5839 optional GpuDriverLoadingTime gl_driver_loading_time = 3
5840 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005841
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005842 // Vulkan driver loading time info.
5843 optional GpuDriverLoadingTime vk_driver_loading_time = 4
5844 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005845}
Rafal Slawikd4e87572019-03-12 13:08:38 +00005846
5847/*
5848 * Logs the size of the system ion heap.
5849 *
5850 * Pulled from StatsCompanionService.
5851 */
5852message SystemIonHeapSize {
5853 // Size of the system ion heap in bytes.
5854 optional int64 size_in_bytes = 1;
5855}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08005856
5857/**
5858 * Push network stack events.
5859 *
5860 * Log from:
5861 * frameworks/base/packages/NetworkStack/
5862 */
5863message NetworkStackReported {
5864 optional int32 eventId = 1;
5865 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
5866}