blob: 62926cb85687a71949423c89bb92d046e12ea7ae [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";
Yangsteraf9aee72018-10-12 09:26:16 -070043import "frameworks/base/core/proto/android/stats/enums.proto";
shawnlinea5b66b2018-11-13 15:05:29 +080044import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080045import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
46import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070047import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080048import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080049import "frameworks/base/core/proto/android/telephony/enums.proto";
50import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080051import "frameworks/base/core/proto/android/wifi/enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080052
Yao Chend54f9dd2017-10-17 17:37:48 +000053/**
Stefan Lafonae2df012017-11-14 09:17:21 -080054 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000055 * raw stats log events from the Android system, also known as "atoms."
56 *
57 * This field contains a single oneof with all of the available messages.
58 * The stats-log-api-gen tool runs as part of the Android build and
59 * generates the android.util.StatsLog class, which contains the constants
60 * and methods that Android uses to log.
61 *
Stefan Lafonae2df012017-11-14 09:17:21 -080062 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000063 * Instead, statsd on Android constructs these messages synthetically,
64 * in the format defined here and in stats_log.proto.
65 */
Stefan Lafonae2df012017-11-14 09:17:21 -080066message Atom {
67 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070068 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070069 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
70 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070071 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070072 BleScanResultReceived ble_scan_result_received = 4;
73 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080074 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070075 SyncStateChanged sync_state_changed = 7;
76 ScheduledJobStateChanged scheduled_job_state_changed = 8;
77 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070078 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080079 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
80 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
81 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070082 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
83 MemoryFactorStateChanged memory_factor_state_changed = 15;
84 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
85 CachedKillReported cached_kill_reported = 17;
86 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070087 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080088 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
89 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
90 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070091 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080092 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070093 CameraStateChanged camera_state_changed = 25;
94 FlashlightStateChanged flashlight_state_changed = 26;
95 UidProcessStateChanged uid_process_state_changed = 27;
96 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
97 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070098 BatteryLevelChanged battery_level_changed = 30;
99 ChargingStateChanged charging_state_changed = 31;
100 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -0700101 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800102 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -0700103 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
104 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -0700105 WifiLockStateChanged wifi_lock_state_changed = 37;
106 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
107 WifiScanStateChanged wifi_scan_state_changed = 39;
108 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700109 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700110 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700111 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900112 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700113 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800114 AnomalyDetected anomaly_detected = 46;
Andrei Oneada01ea52019-01-30 15:28:36 +0000115 AppBreadcrumbReported app_breadcrumb_reported = 47 [(allow_from_any_uid) = true];
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800116 AppStartOccurred app_start_occurred = 48;
117 AppStartCanceled app_start_canceled = 49;
118 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800119 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800120 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800121 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800122 LmkStateChanged lmk_state_changed = 54;
123 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800124 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800125 BootSequenceReported boot_sequence_reported = 57;
Andrei Oneada01ea52019-01-30 15:28:36 +0000126 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -0800127 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800128 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800129 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800130 KeyguardStateChanged keyguard_state_changed = 62;
131 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
132 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800133 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800134 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800135 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
136 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800137 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700138 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800139 SpeakerImpedanceReported speaker_impedance_reported = 71;
140 HardwareFailed hardware_failed = 72;
141 PhysicalDropDetected physical_drop_detected = 73;
142 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800143 MobileConnectionStateChanged mobile_connection_state_changed = 75;
144 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700145 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800146 AppCrashOccurred app_crash_occurred = 78;
147 ANROccurred anr_occurred = 79;
148 WTFOccurred wtf_occurred = 80;
149 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700150 GenericAtom generic_atom = 82;
Yangster-mac48b3d622018-08-18 12:38:11 -0700151 KeyValuePairsAtom key_value_pairs_atom = 83;
Bookatza7020bd2018-08-28 16:29:35 -0700152 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700153 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700154 ThermalThrottlingStateChanged thermal_throttling = 86;
Kevin Chyn1741a072019-01-17 11:54:40 -0800155 BiometricAcquired biometric_acquired = 87;
156 BiometricAuthenticated biometric_authenticated = 88;
157 BiometricErrorOccurred biometric_error_occurred = 89;
Howard Ro688ae182018-09-25 00:09:36 -0700158 Notification notification = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700159 BatteryHealthSnapshot battery_health_snapshot = 91;
160 SlowIo slow_io = 92;
161 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700162 PhoneServiceStateChanged phone_service_state_changed = 94;
163 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100164 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700165 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700166 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700167 // TODO: service state change is very noisy shortly after boot, as well
168 // as at other transitions - coming out of doze, device plugged in, etc.
169 // Consider removing this if it becomes a problem
170 ServiceStateChanged service_state_changed = 99;
171 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800172 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800173 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000174 DevicePolicyEvent device_policy_event = 103;
shawnlinea5b66b2018-11-13 15:05:29 +0800175 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104;
176 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported = 105;
177 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106;
178 DocsUIFileOperationReported docs_ui_provider_file_op = 107;
179 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request = 108;
180 DocsUILaunchReported docs_ui_launch_reported = 109;
181 DocsUIRootVisitedReported docs_ui_root_visited = 110;
182 DocsUIStartupMsReported docs_ui_startup_ms = 111;
183 DocsUIUserActionReported docs_ui_user_action_reported = 112;
Bookatzda1798c2018-12-13 14:16:00 -0800184 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
185 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f2018-12-06 11:01:38 +0000186 AppCompacted app_compacted = 115;
lifr030d23a2019-01-11 16:54:51 +0800187 NetworkDnsEventReported network_dns_event_reported = 116;
shawnlina75e82d2019-01-07 10:31:12 +0800188 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported = 117;
189 DocsUIPickResultReported docs_ui_pick_result_reported = 118;
190 DocsUISearchModeReported docs_ui_search_mode_reported = 119;
191 DocsUISearchTypeReported docs_ui_search_type_reported = 120;
Chiachang Wangf6bedc22019-01-14 11:54:32 +0800192 DataStallEvent data_stall_event = 121;
Christian Brunschenf86039e2018-12-21 12:26:14 +0000193 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000194 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800195 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800196 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800197 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
198 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000199 AppDowngraded app_downgraded = 128;
200 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
201 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800202 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
203 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800204 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800205 NfcErrorOccurred nfc_error_occurred = 134;
206 NfcStateChanged nfc_state_changed = 135;
207 NfcBeamOccurred nfc_beam_occurred = 136;
208 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
209 NfcTagOccurred nfc_tag_occurred = 138;
210 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
211 SeStateChanged se_state_changed = 140;
212 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800213 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800214 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800215 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800216 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800217 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800218 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyne5a37fb2019-02-08 13:10:36 -0800219 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500220 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800221 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Jack Hec27040a2019-01-09 20:54:41 -0800222 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
223 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
224 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
225 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
226 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
227 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
228 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
229 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
230 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He1021a612019-01-20 21:22:46 -0800231 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
232 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
233 BluetoothManufacturerInfoReported bluetooth_device_info_reported = 162;
234 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
235 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
236 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
237 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
238 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Alex Salod7c3eef2019-01-25 14:43:27 -0800239 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800240 ProcessStartTime process_start_time = 169;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -0800241 PermissionGrantRequestResultReported permission_grant_request_result_reported = 170;
Jack He815cdba2019-01-30 17:24:55 -0800242 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Michael Groover4a0ca942019-01-24 17:41:25 -0800243 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Steven Wu552f63f2019-02-05 13:41:36 -0500244 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
joshmccloskey8c3322e2019-01-09 18:25:57 -0800245 AssistGestureStageReported assist_gesture_stage_reported = 174;
246 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
247 AssistGestureProgressReported assist_gesture_progress_reported = 176;
Philip Quinn0eded622019-01-29 12:46:28 -0800248 TouchGestureClassified touch_gesture_classified = 177;
Andrei Onea4ad6d0c2019-02-08 13:54:12 +0000249 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000250 }
David Chenc8a43242017-10-17 16:23:28 -0700251
David Chen6e3e6cb2018-01-03 16:14:06 -0800252 // Pulled events will start at field 10000.
Olivier Gaillard18d452202019-01-22 15:03:41 +0000253 // Next: 10048
David Chenc8a43242017-10-17 16:23:28 -0700254 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800255 WifiBytesTransfer wifi_bytes_transfer = 10000;
256 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
257 MobileBytesTransfer mobile_bytes_transfer = 10002;
258 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800259 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800260 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800261 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800262 CpuTimePerFreq cpu_time_per_freq = 10008;
263 CpuTimePerUid cpu_time_per_uid = 10009;
264 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800265 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800266 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800267 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800268 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800269 SystemElapsedRealtime system_elapsed_realtime = 10014;
270 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800271 CpuActiveTime cpu_active_time = 10016;
272 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000273 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800274 RemainingBatteryCapacity remaining_battery_capacity = 10019;
275 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800276 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100277 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100278 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100279 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000280 DiskStats disk_stats = 10025;
281 DirectoryUsage directory_usage = 10026;
282 AppSize app_size = 10027;
283 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700284 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700285 BatteryVoltage battery_voltage = 10030;
Kevin Chyn1741a072019-01-17 11:54:40 -0800286 NumBiometricsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700287 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700288 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800289 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700290 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100291 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100292 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700293 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800294 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
295 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
296 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000297 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800298 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800299 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800300 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000301 DebugElapsedClock debug_elapsed_clock = 10046;
302 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
Kevin Chyn1741a072019-01-17 11:54:40 -0800303 NumBiometricsEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800304 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800305 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800306 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000307 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +0000308 SDCardInfo sdcard_info = 10053;
David Chenc8a43242017-10-17 16:23:28 -0700309 }
yroa1fe77c2018-02-26 14:22:54 -0800310
Bookatz76aafcf2018-09-17 16:17:10 -0700311 // DO NOT USE field numbers above 100,000 in AOSP.
312 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
313 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700314}
315
Yao Chend54f9dd2017-10-17 17:37:48 +0000316/**
Yangster-mac20877162017-12-22 17:19:39 -0800317 * This proto represents a node of an attribution chain.
318 * Note: All attribution chains are represented as a repeated field of type
319 * AttributionNode. It is understood that in such arrays, the order is that
320 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000321 */
Yangster-mac20877162017-12-22 17:19:39 -0800322message AttributionNode {
323 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800324 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800325
Yangster-mac20877162017-12-22 17:19:39 -0800326 // The (optional) string tag for an element in the attribution chain. If the
327 // element has no tag, it is encoded as an empty string.
328 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700329}
330
Yangster-mac48b3d622018-08-18 12:38:11 -0700331message KeyValuePair {
332 optional int32 key = 1;
333 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700334 int32 value_int = 2;
335 int64 value_long = 3;
336 string value_str = 4;
337 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700338 }
339}
340
341message KeyValuePairsAtom {
342 optional int32 uid = 1;
343 repeated KeyValuePair pairs = 2;
344}
345
Yao Chend54f9dd2017-10-17 17:37:48 +0000346/*
347 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800348 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000349 *
350 * RULES:
351 * - The field ids for each atom must start at 1, and count upwards by 1.
352 * Skipping field ids is not allowed.
353 * - These form an API, so renaming, renumbering or removing fields is
354 * not allowed between android releases. (This is not currently enforced,
355 * but there will be a tool to enforce this restriction).
356 * - The types must be built-in protocol buffer types, namely, no sub-messages
357 * are allowed (yet). The bytes type is also not allowed.
358 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800359 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000360 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800361 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000362 * - A field that is a uid should be a string field, tagged with the [xxx]
363 * annotation. The generated code on android will be represented by UIDs,
364 * and those UIDs will be translated in xxx to those strings.
365 *
366 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700367 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000368 * - If there is a UID, it goes first. Think in an object-oriented fashion.
369 * *****************************************************************************
370 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700371
Yao Chend54f9dd2017-10-17 17:37:48 +0000372/**
Yangster-mace16189a2018-08-26 12:20:16 -0700373 * Logs when the Thermal service HAL notifies the throttling start/stop events.
374 *
375 * Logged from:
376 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
377 */
378message ThermalThrottlingStateChanged {
379 optional android.os.TemperatureTypeEnum sensor_type = 1;
380
381 enum State {
382 UNKNOWN = 0;
383 START = 1;
384 STOP = 2;
385 }
386
387 optional State state = 2;
388
389 optional float temperature = 3;
390}
391
392/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000393 * Logs when the screen state changes.
394 *
395 * Logged from:
396 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
397 */
398message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800399 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700400 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700401}
Yao Chend54f9dd2017-10-17 17:37:48 +0000402
403/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700404 * Logs that the process state of the uid, as determined by ActivityManager
405 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000406 *
407 * Logged from:
408 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
409 */
Bookatzc1a050a2017-10-10 15:49:28 -0700410message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700411 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000412
Bookatzdb026a22018-01-10 19:01:56 -0800413 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700414 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000415}
416
417/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700418 * Logs process state change of a process, as per the activity manager.
419 *
420 * Logged from:
421 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
422 */
423message ProcessStateChanged {
424 optional int32 uid = 1;
425 optional string process_name = 2;
426 optional string package_name = 3;
427 // TODO: remove this when validation is done
428 optional int64 version = 5;
429 // The state, from frameworks/base/core/proto/android/app/enums.proto.
430 optional android.app.ProcessStateEnum state = 4;
431}
432
433/**
434 * Logs when ActivityManagerService sleep state is changed.
435 *
436 * Logged from:
437 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
438 */
439message ActivityManagerSleepStateChanged {
440 // TODO: import frameworks proto
441 enum State {
442 UNKNOWN = 0;
443 ASLEEP = 1;
444 AWAKE = 2;
445 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700446 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700447}
448
449/**
450 * Logs when system memory state changes.
451 *
452 * Logged from:
453 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
454 */
455message MemoryFactorStateChanged {
456 // TODO: import frameworks proto
457 enum State {
458 MEMORY_UNKNOWN = 0;
459 NORMAL = 1; // normal.
460 MODERATE = 2; // moderate memory pressure.
461 LOW = 3; // low memory.
462 CRITICAL = 4; // critical memory.
463
464 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700465 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700466}
467
468/**
469 * Logs when app is using too much cpu, according to ActivityManagerService.
470 *
471 * Logged from:
472 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
473 */
474message ExcessiveCpuUsageReported {
475 optional int32 uid = 1;
476 optional string process_name = 2;
477 optional string package_name = 3;
478 // package version. TODO: remove this when validation is done
479 optional int64 version = 4;
480}
481
482/**
483 * Logs when a cached process is killed, along with its pss.
484 *
485 * Logged from:
486 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
487 */
488message CachedKillReported {
489 optional int32 uid = 1;
490 optional string process_name = 2;
491 optional string package_name = 3;
492 // TODO: remove this when validation is done
493 optional int64 version = 5;
494 optional int64 pss = 4;
495}
496
497/**
498 * Logs when memory stats of a process is reported.
499 *
500 * Logged from:
501 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
502 */
503message ProcessMemoryStatReported {
504 optional int32 uid = 1;
505 optional string process_name = 2;
506 optional string package_name = 3;
507 //TODO: remove this when validation is done
508 optional int64 version = 9;
509 optional int64 pss = 4;
510 optional int64 uss = 5;
511 optional int64 rss = 6;
512 enum Type {
513 ADD_PSS_INTERNAL_SINGLE = 0;
514 ADD_PSS_INTERNAL_ALL_MEM = 1;
515 ADD_PSS_INTERNAL_ALL_POLL = 2;
516 ADD_PSS_EXTERNAL = 3;
517 ADD_PSS_EXTERNAL_SLOW = 4;
518 }
519 optional Type type = 7;
520 optional int64 duration = 8;
521}
522
523/**
Bookatzc1a050a2017-10-10 15:49:28 -0700524 * Logs that a process started, finished, crashed, or ANRed.
525 *
526 * Logged from:
527 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
528 */
529message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700530 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700531
David Chen0b5c90c2018-01-25 16:51:49 -0800532 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800533 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700534
Bookatzddccf0a2017-11-28 16:48:14 -0800535 // What lifecycle state the process changed to.
536 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800537 enum State {
538 FINISHED = 0;
539 STARTED = 1;
540 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800541 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800542 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700543}
544
Bookatzc1a050a2017-10-10 15:49:28 -0700545/**
546 * Logs when the ble scan state changes.
547 *
548 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700549 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700550 */
551message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800552 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700553
554 enum State {
555 OFF = 0;
556 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700557 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
558 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700559 }
560 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700561
Bookatze5ec0b42018-03-26 13:34:56 -0700562 // Does the scan have a filter.
563 optional bool is_filtered = 3;
564 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
565 optional bool is_first_match = 4;
566 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
567 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700568}
569
570/**
571 * Logs reporting of a ble scan finding results.
572 *
573 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700574 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700575 */
Bookatzae6738e2018-09-13 11:38:56 -0700576// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700577message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800578 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700579
580 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800581 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700582}
583
584/**
585 * Logs when a sensor state changes.
586 *
587 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700588 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700589 */
590message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800591 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700592
Bookatzc1a050a2017-10-10 15:49:28 -0700593 // The id (int) of the sensor.
594 optional int32 sensor_id = 2;
595
596 enum State {
597 OFF = 0;
598 ON = 1;
599 }
600 optional State state = 3;
601}
602
Bookatzc1a050a2017-10-10 15:49:28 -0700603/**
604 * Logs when GPS state changes.
605 *
606 * Logged from:
607 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
608 */
609message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800610 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700611
612 enum State {
613 OFF = 0;
614 ON = 1;
615 }
616 optional State state = 2;
617}
618
Bookatz48d362e2018-11-06 15:49:08 -0800619/**
620 * Logs when GPS signal quality.
621 *
622 * Logged from:
623 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
624 */
625message GpsSignalQualityChanged {
626 optional android.server.location.GpsSignalQualityEnum level = 1;
627}
628
Bookatzc1a050a2017-10-10 15:49:28 -0700629
630/**
631 * Logs when a sync manager sync state changes.
632 *
633 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700634 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700635 */
636message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800637 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700638
David Chen0b5c90c2018-01-25 16:51:49 -0800639 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800640 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700641
642 enum State {
643 OFF = 0;
644 ON = 1;
645 }
646 optional State state = 3;
647}
648
Yangster-mac96353002018-09-05 11:18:55 -0700649/*
650 * Deferred job stats.
651 *
652 * Logged from:
653 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
654*/
655message DeferredJobStatsReported {
656 repeated AttributionNode attribution_node = 1;
657
658 // Number of jobs deferred.
659 optional int32 num_jobs_deferred = 2;
660
661 // Time since the last job runs.
662 optional int64 time_since_last_job_millis = 3;
663}
664
Bookatzc1a050a2017-10-10 15:49:28 -0700665/**
666 * Logs when a job scheduler job state changes.
667 *
668 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700669 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700670 */
671message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800672 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700673
674 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800675 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700676
677 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800678 FINISHED = 0;
679 STARTED = 1;
680 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700681 }
682 optional State state = 3;
683
Tej Singh33a412b2018-03-16 18:43:59 -0700684 // The reason a job has stopped.
685 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700686 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700687 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700688}
689
690/**
691 * Logs when the audio state changes.
692 *
693 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700694 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700695 */
696message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800697 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700698
699 enum State {
700 OFF = 0;
701 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700702 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
703 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700704 }
705 optional State state = 2;
706}
707
708/**
709 * Logs when the video codec state changes.
710 *
711 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700712 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700713 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800714message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800715 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700716
717 enum State {
718 OFF = 0;
719 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700720 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
721 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700722 }
723 optional State state = 2;
724}
725
726/**
727 * Logs when the flashlight state changes.
728 *
729 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700730 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700731 */
732message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800733 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700734
735 enum State {
736 OFF = 0;
737 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700738 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
739 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700740 }
741 optional State state = 2;
742}
743
744/**
745 * Logs when the camera state changes.
746 *
747 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700748 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700749 */
750message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800751 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700752
753 enum State {
754 OFF = 0;
755 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700756 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
757 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700758 }
759 optional State state = 2;
760}
761
762/**
763 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000764 *
765 * Logged from:
766 * TODO
767 */
Bookatzd6746242017-10-24 18:39:35 -0700768message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800769 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000770
Bookatz1a1b0462018-01-12 11:47:03 -0800771 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
772 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700773 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700774
775 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
776 optional string tag = 3;
777
778 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800779 RELEASE = 0;
780 ACQUIRE = 1;
781 CHANGE_RELEASE = 2;
782 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700783 }
784 optional State state = 4;
785}
786
787/**
Bookatzc1a050a2017-10-10 15:49:28 -0700788 * Logs when a partial wakelock is considered 'long' (over 1 min).
789 *
790 * Logged from:
791 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
792 */
793message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800794 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700795
Yao Chend54f9dd2017-10-17 17:37:48 +0000796 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
797 optional string tag = 2;
798
Bookatzc1a050a2017-10-10 15:49:28 -0700799 // TODO: I have no idea what this is.
800 optional string history_tag = 3;
801
802 enum State {
803 OFF = 0;
804 ON = 1;
805 }
806 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000807}
808
Bookatzc1a050a2017-10-10 15:49:28 -0700809/**
Bookatza66083f2018-09-20 17:24:00 -0700810 * Logs when the device is interactive, according to the PowerManager Notifier.
811 *
812 * Logged from:
813 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
814 */
815message InteractiveStateChanged {
816 enum State {
817 OFF = 0;
818 ON = 1;
819 }
820 optional State state = 1;
821}
822
823/**
Bookatzc1a050a2017-10-10 15:49:28 -0700824 * Logs Battery Saver state change.
825 *
826 * Logged from:
827 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
828 */
829message BatterySaverModeStateChanged {
830 enum State {
831 OFF = 0;
832 ON = 1;
833 }
834 optional State state = 1;
835}
836
837/**
838 * Logs Doze mode state change.
839 *
840 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800841 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700842 */
843message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800844 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800845}
846
847
848/**
849 * Logs state change of Doze mode including maintenance windows.
850 *
851 * Logged from:
852 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
853 */
854message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800855 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700856}
857
858/**
859 * Logs screen brightness level.
860 *
861 * Logged from:
862 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
863 */
864message ScreenBrightnessChanged {
865 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
866 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700867}
868
869/**
870 * Logs battery level (percent full, from 0 to 100).
871 *
872 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700873 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700874 */
875message BatteryLevelChanged {
876 // Battery level. Should be in [0, 100].
877 optional int32 battery_level = 1;
878}
879
880/**
881 * Logs change in charging status of the device.
882 *
883 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700884 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700885 */
886message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800887 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
888 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700889}
890
891/**
892 * Logs whether the device is plugged in, and what power source it is using.
893 *
894 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700895 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700896 */
897message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800898 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
899 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700900}
901
Bookatz8c6571b2017-10-24 15:04:41 -0700902/**
903 * Logs when an app's wakeup alarm fires.
904 *
905 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700906 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700907 */
908message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800909 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800910
911 // Name of the wakeup alarm.
912 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700913
914 // Name of source package (for historical reasons, since BatteryStats tracked it).
915 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800916}
917
918/**
919 * Logs when an an app causes the mobile radio to change state.
920 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
921 *
922 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700923 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800924 */
925message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800926 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800927
Bookatz1a1b0462018-01-12 11:47:03 -0800928 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
929 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800930}
931
932/**
933 * Logs when an an app causes the wifi radio to change state.
934 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
935 *
936 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700937 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800938 */
939message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800940 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800941
Bookatz1a1b0462018-01-12 11:47:03 -0800942 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
943 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700944}
945
946/**
947 * Logs kernel wakeup reasons and aborts.
948 *
949 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700950 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700951 */
952message KernelWakeupReported {
953 // Name of the kernel wakeup reason (or abort).
954 optional string wakeup_reason_name = 1;
955
956 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800957 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700958}
959
960/**
Bookatzda1798c2018-12-13 14:16:00 -0800961 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800962 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800963 *
964 * Logged from:
965 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
966 */
967message WifiEnabledStateChanged {
968 enum State {
969 OFF = 0;
970 ON = 1;
971 }
972 optional State state = 1;
973}
974
975/**
976 * 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 -0800977 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
978 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800979 *
980 * Logged from:
981 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
982 */
983message WifiRunningStateChanged {
984 repeated AttributionNode attribution_node = 1;
985
986 enum State {
987 OFF = 0;
988 ON = 1;
989 }
990 optional State state = 2;
991}
992
993/**
Bookatze5885242017-10-24 20:10:31 -0700994 * Logs wifi locks held by an app.
995 *
996 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700997 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700998 */
999message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001000 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001001
1002 enum State {
1003 OFF = 0;
1004 ON = 1;
1005 }
1006 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001007
1008 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1009 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001010}
1011
1012/**
1013 * Logs wifi signal strength changes.
1014 *
1015 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001016 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001017 */
1018message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001019 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1020 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001021}
1022
1023/**
1024 * Logs wifi scans performed by an app.
1025 *
1026 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001027 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001028 */
1029message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001030 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001031
1032 enum State {
1033 OFF = 0;
1034 ON = 1;
1035 }
1036 optional State state = 2;
1037}
1038
1039/**
Tej Singh4503e102018-01-04 14:35:01 -08001040 * Logs wifi multicast locks held by an app
1041 *
1042 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001043 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001044 */
1045message WifiMulticastLockStateChanged {
1046 repeated AttributionNode attribution_node = 1;
1047
1048 enum State {
1049 OFF = 0;
1050 ON = 1;
1051 }
1052 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001053
1054 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001055}
1056
1057/**
Tej Singh1ea42892018-01-19 09:27:00 -08001058 * Logs shutdown reason and duration on next boot.
1059 *
1060 * Logged from:
1061 * frameworks/base/core/java/com/android/server/BootReceiver.java
1062 */
1063message ShutdownSequenceReported {
1064 // True if shutdown is for a reboot. Default: false if we do not know.
1065 optional bool reboot = 1;
1066
1067 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1068 optional string reason = 2;
1069
1070 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1071 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001072 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001073
1074 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001075 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001076}
1077
Tej Singh6483ea42018-01-25 17:45:49 -08001078
1079/**
1080 * Logs boot reason and duration.
1081 *
1082 * Logged from:
1083 * system/core/bootstat/bootstat.cpp
1084 */
1085message BootSequenceReported {
1086 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1087 // Default: "<EMPTY>" if not available.
1088 optional string bootloader_reason = 1;
1089
1090 // Reason for system boot. Eg. bootloader, reboot,userrequested
1091 // Default: "<EMPTY>" if not available.
1092 optional string system_reason = 2;
1093
1094 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001095 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001096
1097 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001098 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001099
1100 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001101 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001102
1103 // Time since last boot in ms. Default: 0 if not available.
1104 optional int64 time_since_last_boot = 6;
1105}
1106
Tej Singhc477d9c2018-02-05 18:31:39 -08001107
1108/**
1109 * Logs call state and disconnect cause (if applicable).
1110 *
1111 * Logged from:
1112 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1113 */
1114message CallStateChanged {
1115 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1116 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1117 optional android.telecom.CallStateEnum call_state = 1;
1118
1119 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1120 // This value is only applicable when the call_state is DISCONNECTED, and
1121 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1122 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1123 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1124
1125 // True if the call is self-managed, which are apps that use the
1126 // telecom infrastructure to make their own calls.
1127 optional bool self_managed = 3;
1128
1129 // True if call is external. External calls are calls on connected Wear
1130 // devices but show up in Telecom so the user can pull them onto the device.
1131 optional bool external_call = 4;
1132}
1133
Tej Singh1ea42892018-01-19 09:27:00 -08001134/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001135 * Logs keyguard state. The keyguard is the lock screen.
1136 *
1137 * Logged from:
1138 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1139 */
1140message KeyguardStateChanged {
1141 enum State {
1142 UNKNOWN = 0;
1143 // The keyguard is hidden when the phone is unlocked.
1144 HIDDEN = 1;
1145 // The keyguard is shown when the phone is locked (screen turns off).
1146 SHOWN= 2;
1147 // The keyguard is occluded when something is overlaying the keyguard.
1148 // Eg. Opening the camera while on the lock screen.
1149 OCCLUDED = 3;
1150 }
1151 optional State state = 1;
1152}
1153
1154/**
1155 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1156 * prompts the user to enter a password (pattern, pin, etc).
1157 *
1158 * Logged from:
1159 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1160 */
1161
1162message KeyguardBouncerStateChanged {
1163 enum State {
1164 UNKNOWN = 0;
1165 // Bouncer is hidden, either as a result of successfully entering the
1166 // password, screen timing out, or user going back to lock screen.
1167 HIDDEN = 1;
1168 // This is when the user is being prompted to enter the password.
1169 SHOWN = 2;
1170 }
1171 optional State state = 1;
1172}
1173
1174/**
1175 * Logs the result of entering a password into the keyguard bouncer.
1176 *
1177 * Logged from:
1178 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1179 */
1180message KeyguardBouncerPasswordEntered {
1181 enum BouncerResult {
1182 UNKNOWN = 0;
1183 // The password entered was incorrect.
1184 FAILURE = 1;
1185 // The password entered was correct.
1186 SUCCESS = 2;
1187 }
1188 optional BouncerResult result = 1;
1189}
1190
Tej Singha883b372018-02-15 11:30:01 -08001191/*
1192 * Logs changes to the configuration of the device. The configuration is defined
1193 * in frameworks/base/core/java/android/content/res/Configuration.java
1194 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1195 * Please go there to interpret the possible values each field can be.
1196 *
1197 * Logged from:
1198 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1199 */
1200message ResourceConfigurationChanged {
1201 // Bit mask of color capabilities of the screen.
1202 // Contains information about the color gamut and hdr mode of the screen.
1203 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001204 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001205
1206 // The target screen density being rendered to.
1207 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001208 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001209
1210 // Current user preference for the scaling factor for fonts,
1211 // relative to the base density scaling.
1212 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001213 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001214
1215 // Flag indicating whether the hard keyboard is hidden.
1216 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001217 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001218
1219 // The type of keyboard attached to the device.
1220 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1221 optional int32 keyboard = 5;
1222
1223 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1224 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001225 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001226
1227 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1228 // 0 if undefined.
1229 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1230 optional int32 mcc = 7;
1231
1232 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1233 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1234 // MNC_ZERO symbol defined in Configuration.java.
1235 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1236 optional int32 mnc = 8;
1237
1238 // The kind of navigation available on the device.
1239 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1240 optional int32 navigation = 9;
1241
1242 // Flag indicating whether the navigation is available.
1243 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001244 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001245
1246 // Overall orientation of the screen.
1247 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1248 optional int32 orientation = 11;
1249
1250 // The current height of the available screen space, in dp units.
1251 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001252 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001253
1254 // Bit mask of overall layout of the screen.
1255 // Contains information about screen size, whether the screen is wider/taller
1256 // than normal, whether the screen layout is right-tl-left or left-to-right,
1257 // and whether the screen has a rounded shape.
1258 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001259 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001260
1261 // Current width of the available screen space, in dp units.
1262 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001263 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001264
1265 // The smallest screen size an application will see in normal operation.
1266 // This is the smallest value of both screenWidthDp and screenHeightDp
1267 // in portrait and landscape.
1268 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001269 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001270
1271 // The type of touch screen attached to the device.
1272 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1273 optional int32 touchscreen = 16;
1274
1275 // Bit mask of the ui mode.
1276 // Contains information about the overall ui mode of the device.
1277 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1278 // Also contains information about whether the device is in night mode.
1279 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001280 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001281}
1282
Tej Singheee317b2018-03-07 19:28:05 -08001283
1284/**
1285 * Logs changes in the connection state of the mobile radio.
1286 *
1287 * Logged from:
1288 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1289 */
1290message MobileConnectionStateChanged {
1291 // States are from the state machine DataConnection.java.
1292 enum State {
1293 UNKNOWN = 0;
1294 // The connection is inactive, or disconnected.
1295 INACTIVE = 1;
1296 // The connection is being activated, or connecting.
1297 ACTIVATING = 2;
1298 // The connection is active, or connected.
1299 ACTIVE = 3;
1300 // The connection is disconnecting.
1301 DISCONNECTING = 4;
1302 // The connection is disconnecting after creating a connection.
1303 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1304 }
1305 optional State state = 1;
1306 // For multi-sim phones, this distinguishes between the sim cards.
1307 optional int32 sim_slot_index = 2;
1308 // Used to identify the connection. Starts at 0 and increments by 1 for
1309 // every new network created. Resets whenever the device reboots.
1310 optional int32 data_connection_id = 3;
1311 // A bitmask for the capabilities of this connection.
1312 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1313 // Default value (if we have no information): 0
1314 optional int64 capabilities = 4;
1315 // If this connection has internet.
1316 // This just checks if the DEFAULT bit of capabilities is set.
1317 optional bool has_internet = 5;
1318}
1319
1320/**
1321 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1322 *
1323 * Logged from:
1324 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1325 */
1326message MobileRadioTechnologyChanged {
1327 optional android.telephony.NetworkTypeEnum state = 1;
1328 // For multi-sim phones, this distinguishes between the sim cards.
1329 optional int32 sim_slot_index = 2;
1330}
1331
Andrew Chantb56388b2018-03-22 21:07:33 -07001332/**
1333 * Logs the VID and PID of any connected USB devices.
1334 *
1335 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1336 *
1337 * Logged by Vendor.
1338 */
1339message UsbDeviceAttached {
1340 optional int32 vid = 1;
1341 optional int32 pid = 2;
1342 optional bool has_audio = 3;
1343 optional bool has_hid = 4;
1344 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001345 enum State {
1346 STATE_DISCONNECTED = 0;
1347 STATE_CONNECTED = 1;
1348 }
1349 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001350 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001351}
1352
Tej Singheee317b2018-03-07 19:28:05 -08001353
Tej Singhdd7bd352018-02-09 19:33:15 -08001354/**
Tej Singh5d991e12018-03-09 19:48:11 -08001355 * Logs when Bluetooth is enabled and disabled.
1356 *
1357 * Logged from:
1358 * services/core/java/com/android/server/BluetoothManagerService.java
1359 */
1360message BluetoothEnabledStateChanged {
1361 repeated AttributionNode attribution_node = 1;
1362 // Whether or not bluetooth is enabled on the device.
1363 enum State {
1364 UNKNOWN = 0;
1365 ENABLED = 1;
1366 DISABLED = 2;
1367 }
1368 optional State state = 2;
1369 // The reason for being enabled/disabled.
1370 // Eg. Airplane mode, crash, application request.
1371 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1372 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001373 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001374}
1375
1376/**
Jack Hed9837c82019-01-09 01:19:13 -08001377 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001378 *
1379 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001380 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1381 *
1382 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001383 */
1384message BluetoothConnectionStateChanged {
1385 // The state of the connection.
1386 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1387 optional android.bluetooth.ConnectionStateEnum state = 1;
1388 // An identifier that can be used to match connect and disconnect events.
1389 // Currently is last two bytes of a hash of a device level ID and
1390 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001391 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1392 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001393 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1394 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001395 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001396 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001397 // An identifier that can be used to match events for this device.
1398 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1399 // Salt: Randomly generated 256 bit value
1400 // Hash algorithm: HMAC-SHA256
1401 // Size: 32 byte
1402 // Default: null or empty if the device identifier is not known
1403 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1404}
1405
1406/**
1407 * Logs when a Bluetooth device connects and disconnects over ACL
1408 *
1409 * Logged from:
1410 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1411 *
1412 * Next Tag: 3
1413 */
1414message BluetoothAclConnectionStateChanged {
1415 // An identifier that can be used to match events for this device.
1416 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1417 // Salt: Randomly generated 256 bit value
1418 // Hash algorithm: HMAC-SHA256
1419 // Size: 32 byte
1420 // Default: null or empty if the device identifier is not known
1421 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1422 // The state of the connection.
1423 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1424 optional android.bluetooth.ConnectionStateEnum state = 2;
1425}
1426
1427/**
1428 * Logs when a Bluetooth device connects and disconnects over SCO
1429 *
1430 * Logged from:
1431 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1432 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1433 *
1434 * Next Tag: 4
1435 */
1436message BluetoothScoConnectionStateChanged {
1437 // An identifier that can be used to match events for this device.
1438 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1439 // Salt: Randomly generated 256 bit value
1440 // Hash algorithm: HMAC-SHA256
1441 // Size: 32 byte
1442 // Default: null or empty if the device identifier is not known
1443 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1444 // The state of the connection.
1445 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1446 optional android.bluetooth.ConnectionStateEnum state = 2;
1447 // Codec used for this SCO connection
1448 // Default: UNKNOWN
1449 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001450}
1451
Jack Hec27040a2019-01-09 20:54:41 -08001452/**
1453 * Logged when active device of a profile changes
1454 *
1455 * Logged from:
1456 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1457 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1458 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1459 */
1460message BluetoothActiveDeviceChanged {
1461 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1462 // From android.bluetooth.BluetoothProfile
1463 optional int32 bt_profile = 1;
1464 // An identifier that can be used to match events for this new active device.
1465 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1466 // Salt: Randomly generated 256 bit value
1467 // Hash algorithm: HMAC-SHA256
1468 // Size: 32 byte
1469 // Default: null or empty if there is no active device for this profile
1470 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1471}
1472
Jack Heab86dbd22018-12-18 15:43:27 -08001473// Logs when there is an event affecting Bluetooth device's link layer connection.
1474// - This event is triggered when there is a related HCI command or event
1475// - Users of this metrics can deduce Bluetooth device's connection state from these events
1476// - HCI commands are logged before the command is sent, after receiving command status, and after
1477// receiving command complete
1478// - HCI events are logged when they arrive
1479//
1480// Low level log from system/bt
1481//
1482// Bluetooth classic commands:
1483// - CMD_CREATE_CONNECTION
1484// - CMD_DISCONNECT
1485// - CMD_CREATE_CONNECTION_CANCEL
1486// - CMD_ACCEPT_CONNECTION_REQUEST
1487// - CMD_REJECT_CONNECTION_REQUEST
1488// - CMD_SETUP_ESCO_CONNECTION
1489// - CMD_ACCEPT_ESCO_CONNECTION
1490// - CMD_REJECT_ESCO_CONNECTION
1491// - CMD_ENH_SETUP_ESCO_CONNECTION
1492// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1493//
1494// Bluetooth low energy commands:
1495// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1496// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1497// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1498// - CMD_BLE_CLEAR_WHITE_LIST
1499// - CMD_BLE_ADD_WHITE_LIST
1500// - CMD_BLE_REMOVE_WHITE_LIST
1501//
1502// Bluetooth classic events:
1503// - EVT_CONNECTION_COMP
1504// - EVT_CONNECTION_REQUEST
1505// - EVT_DISCONNECTION_COMP
1506// - EVT_ESCO_CONNECTION_COMP
1507// - EVT_ESCO_CONNECTION_CHANGED
1508//
1509// Bluetooth low energy meta events:
1510// - BLE_EVT_CONN_COMPLETE_EVT
1511// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1512//
1513// Next tag: 10
1514message BluetoothLinkLayerConnectionEvent {
1515 // An identifier that can be used to match events for this device.
1516 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1517 // Salt: Randomly generated 256 bit value
1518 // Hash algorithm: HMAC-SHA256
1519 // Size: 32 byte
1520 // Default: null or empty if the device identifier is not known
1521 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1522 // Connection handle of this connection if available
1523 // Range: 0x0000 - 0x0EFF (12 bits)
1524 // Default: 0xFFFF if the handle is unknown
1525 optional int32 connection_handle = 2;
1526 // Direction of the link
1527 // Default: DIRECTION_UNKNOWN
1528 optional android.bluetooth.DirectionEnum direction = 3;
1529 // Type of this link
1530 // Default: LINK_TYPE_UNKNOWN
1531 optional android.bluetooth.LinkTypeEnum type = 4;
1532
1533 // Reason metadata for this link layer connection event, rules for interpretation:
1534 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1535 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1536 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1537 // set and valid, ignore hci_ble_event
1538
1539 // HCI command associated with this event
1540 // Default: CMD_UNKNOWN
1541 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1542 // HCI event associated with this event
1543 // Default: EVT_UNKNOWN
1544 optional android.bluetooth.hci.EventEnum hci_event = 6;
1545 // HCI BLE meta event associated with this event
1546 // Default: BLE_EVT_UNKNOWN
1547 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1548 // HCI command status code if this is triggerred by hci_cmd
1549 // Default: STATUS_UNKNOWN
1550 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1551 // HCI reason code associated with this event
1552 // Default: STATUS_UNKNOWN
1553 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1554}
1555
Howard Roe103fe22019-01-17 16:52:16 -08001556/**
1557 * Logs when a module is rolled back by Watchdog.
1558 *
1559 * Logged from: Rollback Manager
1560 */
1561message WatchdogRollbackOccurred {
1562 enum RollbackType {
1563 UNKNOWN = 0;
1564 ROLLBACK_INITIATE = 1;
1565 ROLLBACK_SUCCESS = 2;
1566 ROLLBACK_FAILURE = 3;
1567 }
1568 optional RollbackType rollback_type = 1;
1569
1570 optional string package_name = 2;
1571
1572 optional int32 package_version_code = 3;
1573}
1574
Jack Hec27040a2019-01-09 20:54:41 -08001575/**
1576 * Logs when there is a change in Bluetooth A2DP playback state
1577 *
1578 * Logged from:
1579 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1580 */
1581message BluetoothA2dpPlaybackStateChanged {
1582 // An identifier that can be used to match events for this device.
1583 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1584 // Salt: Randomly generated 256 bit value
1585 // Hash algorithm: HMAC-SHA256
1586 // Size: 32 byte
1587 // Default: null or empty if the device identifier is not known
1588 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1589 // Current playback state
1590 // Default: PLAYBACK_STATE_UNKNOWN
1591 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1592 // Current audio coding mode
1593 // Default: AUDIO_CODING_MODE_UNKNOWN
1594 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1595}
1596
1597/**
1598 * Logs when there is a change in A2DP codec config for a particular remote device
1599 *
1600 * Logged from:
1601 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1602 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1603 */
1604message BluetoothA2dpCodecConfigChanged {
1605 // An identifier that can be used to match events for this device.
1606 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1607 // Salt: Randomly generated 256 bit value
1608 // Hash algorithm: HMAC-SHA256
1609 // Size: 32 byte
1610 // Default: null or empty if the device identifier is not known
1611 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1612 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1613 // Default SOURCE_CODEC_TYPE_INVALID
1614 optional int32 codec_type = 2;
1615 // Codec priroity, the higher the more preferred, -1 for disabled
1616 // Default: CODEC_PRIORITY_DEFAULT
1617 optional int32 codec_priority = 3;
1618 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1619 // Default: SAMPLE_RATE_NONE
1620 optional int32 sample_rate = 4;
1621 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1622 // Default: BITS_PER_SAMPLE_NONE
1623 optional int32 bits_per_sample = 5;
1624 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1625 // Default: CHANNEL_MODE_NONE
1626 optional int32 channel_mode = 6;
1627 // Codec specific values
1628 // Default 0
1629 optional int64 codec_specific_1 = 7;
1630 optional int64 codec_specific_2 = 8;
1631 optional int64 codec_specific_3 = 9;
1632 optional int64 codec_specific_4 = 10;
1633}
1634
1635/**
1636 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1637 * Each codec's capability is logged separately due to statsd restriction
1638 *
1639 * Logged from:
1640 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1641 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1642 */
1643message BluetoothA2dpCodecCapabilityChanged {
1644 // An identifier that can be used to match events for this device.
1645 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1646 // Salt: Randomly generated 256 bit value
1647 // Hash algorithm: HMAC-SHA256
1648 // Size: 32 byte
1649 // Default: null or empty if the device identifier is not known
1650 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1651 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1652 // Default SOURCE_CODEC_TYPE_INVALID
1653 optional int32 codec_type = 2;
1654 // Codec priroity, the higher the more preferred, -1 for disabled
1655 // Default: CODEC_PRIORITY_DEFAULT
1656 optional int32 codec_priority = 3;
1657 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1658 // in BluetoothCodecConfig
1659 // Default: empty and SAMPLE_RATE_NONE for individual item
1660 optional int32 sample_rate = 4;
1661 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1662 // in BluetoothCodecConfig
1663 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1664 optional int32 bits_per_sample = 5;
1665 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1666 // BluetoothCodecConfig
1667 // Default: empty and CHANNEL_MODE_NONE for individual item
1668 optional int32 channel_mode = 6;
1669 // Codec specific values
1670 // Default 0
1671 optional int64 codec_specific_1 = 7;
1672 optional int64 codec_specific_2 = 8;
1673 optional int64 codec_specific_3 = 9;
1674 optional int64 codec_specific_4 = 10;
1675}
1676
1677/**
1678 * Logs when A2DP failed to read from PCM source.
1679 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1680 *
1681 * Logged from:
1682 * system/bt
1683 */
1684message BluetoothA2dpAudioUnderrunReported {
1685 // An identifier that can be used to match events for this device.
1686 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1687 // Salt: Randomly generated 256 bit value
1688 // Hash algorithm: HMAC-SHA256
1689 // Size: 32 byte
1690 // Default: null or empty if the device identifier is not known
1691 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1692 // Encoding interval in nanoseconds
1693 // Default: 0
1694 optional int64 encoding_interval_nanos = 2;
1695 // Number of bytes of PCM data that could not be read from the source
1696 // Default: 0
1697 optional int32 num_missing_pcm_bytes = 3;
1698}
1699
1700/**
1701 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1702 * buffer queue is full and we have to drop data
1703 *
1704 * Logged from:
1705 * system/bt
1706 */
1707message BluetoothA2dpAudioOverrunReported {
1708 // An identifier that can be used to match events for this device.
1709 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1710 // Salt: Randomly generated 256 bit value
1711 // Hash algorithm: HMAC-SHA256
1712 // Size: 32 byte
1713 // Default: null or empty if the device identifier is not known
1714 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1715 // Encoding interval in nanoseconds
1716 // Default: 0
1717 optional int64 encoding_interval_nanos = 2;
1718 // Number of buffers dropped in this event
1719 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1720 // Default: 0
1721 optional int32 num_dropped_buffers = 3;
1722 // Number of encoded buffers dropped in this event
1723 // Default 0
1724 optional int32 num_dropped_encoded_frames = 4;
1725 // Number of encoded bytes dropped in this event
1726 // Default: 0
1727 optional int32 num_dropped_encoded_bytes = 5;
1728}
1729
1730/**
1731 * Logs when we receive reports regarding a device's RSSI value
1732 *
1733 * Logged from:
1734 * system/bt
1735 */
1736message BluetoothDeviceRssiReported {
1737 // An identifier that can be used to match events for this device.
1738 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1739 // Salt: Randomly generated 256 bit value
1740 // Hash algorithm: HMAC-SHA256
1741 // Size: 32 byte
1742 // Default: null or empty if the device identifier is not known
1743 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1744 // Connection handle of this connection if available
1745 // Range: 0x0000 - 0x0EFF (12 bits)
1746 // Default: 0xFFFF if the handle is unknown
1747 optional int32 connection_handle = 2;
1748 // HCI command status code if this is triggerred by hci_cmd
1749 // Default: STATUS_UNKNOWN
1750 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1751 // BR/EDR
1752 // Range: -128 ≤ N ≤ 127 (signed integer)
1753 // Units: dB
1754 // LE:
1755 // Range: -127 to 20, 127 (signed integer)
1756 // Units: dBm
1757 // Invalid when an out of range value is reported
1758 optional int32 rssi = 4;
1759}
1760
1761/**
1762 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1763 *
1764 * Logged from:
1765 * system/bt
1766 */
1767message BluetoothDeviceFailedContactCounterReported {
1768 // An identifier that can be used to match events for this device.
1769 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1770 // Salt: Randomly generated 256 bit value
1771 // Hash algorithm: HMAC-SHA256
1772 // Size: 32 byte
1773 // Default: null or empty if the device identifier is not known
1774 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1775 // Connection handle of this connection if available
1776 // Range: 0x0000 - 0x0EFF (12 bits)
1777 // Default: 0xFFFF if the handle is unknown
1778 optional int32 connection_handle = 2;
1779 // HCI command status code if this is triggerred by hci_cmd
1780 // Default: STATUS_UNKNOWN
1781 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1782 // Number of consecutive failed contacts for a connection corresponding to the Handle
1783 // Range: uint16_t, 0-0xFFFF
1784 // Default: 0xFFFFF
1785 optional int32 failed_contact_counter = 4;
1786}
1787
1788/**
1789 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1790 *
1791 * Logged from:
1792 * system/bt
1793 */
1794message BluetoothDeviceTxPowerLevelReported {
1795 // An identifier that can be used to match events for this device.
1796 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1797 // Salt: Randomly generated 256 bit value
1798 // Hash algorithm: HMAC-SHA256
1799 // Size: 32 byte
1800 // Default: null or empty if the device identifier is not known
1801 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1802 // Connection handle of this connection if available
1803 // Range: 0x0000 - 0x0EFF (12 bits)
1804 // Default: 0xFFFF if the handle is unknown
1805 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001806 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001807 // Default: STATUS_UNKNOWN
1808 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1809 // Range: -30 ≤ N ≤ 20
1810 // Units: dBm
1811 // Invalid when an out of range value is reported
1812 optional int32 transmit_power_level = 4;
1813}
Jack Heab86dbd22018-12-18 15:43:27 -08001814
Tej Singh5d991e12018-03-09 19:48:11 -08001815/**
Jack He1021a612019-01-20 21:22:46 -08001816 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1817 * receiving an HCI command from the host
1818 *
1819 * Logged from: system/bt
1820 */
1821message BluetoothHciTimeoutReported {
1822 // HCI command associated with this event
1823 // Default: CMD_UNKNOWN
1824 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1825}
1826
1827/**
1828 * Logs when we receive Bluetooth Link Quality Report event from the controller
1829 * See Android Bluetooth HCI specification for more details
1830 *
1831 * Note: all count and bytes field are counted since last event
1832 *
1833 * Logged from: system/bt
1834 */
1835message BluetoothQualityReportReported {
1836 // Quality report ID
1837 // Original type: uint8_t
1838 // Default: BQR_ID_UNKNOWN
1839 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1840 // Packet type of the connection
1841 // Original type: uint8_t
1842 // Default: BQR_PACKET_TYPE_UNKNOWN
1843 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1844 // Connection handle of the connection
1845 // Original type: uint16_t
1846 optional int32 connection_handle = 3;
1847 // Performing Role for the connection
1848 // Original type: uint8_t
1849 optional int32 connection_role = 4;
1850 // Current Transmit Power Level for the connection. This value is the same as the controller's
1851 // response to the HCI_Read_Transmit_Power_Level HCI command
1852 // Original type: uint8_t
1853 optional int32 tx_power_level = 5;
1854 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1855 // absolute receiver signal strength value
1856 // Original type: int8_t
1857 optional int32 rssi = 6;
1858 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1859 // channels used by the link currently
1860 // Original type: uint8_t
1861 optional int32 snr = 7;
1862 // Indicates the number of unused channels in AFH_channel_map
1863 // Original type: uint8_t
1864 optional int32 unused_afh_channel_count = 8;
1865 // Indicates the number of the channels which are interfered and quality is bad but are still
1866 // selected for AFH
1867 // Original type: uint8_t
1868 optional int32 afh_select_unideal_channel_count = 9;
1869 // Current Link Supervision Timeout Setting
1870 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1871 // Original type: uint16_t
1872 optional int32 lsto = 10;
1873 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1874 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1875 // 0x01 (Piconet Clock)
1876 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1877 // Original type: uint32_t
1878 optional int64 connection_piconet_clock = 11;
1879 // The count of retransmission
1880 // Original type: uint32_t
1881 optional int64 retransmission_count = 12;
1882 // The count of no RX
1883 // Original type: uint32_t
1884 optional int64 no_rx_count = 13;
1885 // The count of NAK (Negative Acknowledge)
1886 // Original type: uint32_t
1887 optional int64 nak_count = 14;
1888 // Controller timestamp of last TX ACK
1889 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1890 // Original type: uint32_t
1891 optional int64 last_tx_ack_timestamp = 15;
1892 // The count of Flow-off (STOP)
1893 // Original type: uint32_t
1894 optional int64 flow_off_count = 16;
1895 // Controller timestamp of last Flow-on (GO)
1896 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1897 // Original type: uint32_t
1898 optional int64 last_flow_on_timestamp = 17;
1899 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1900 // Original type: uint32_t
1901 optional int64 buffer_overflow_bytes = 18;
1902 // Buffer underflow count (in byte) since last event
1903 // Original type: uint32_t
1904 optional int64 buffer_underflow_bytes = 19;
1905}
1906
1907/**
1908 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1909 *
1910 * Notes:
1911 * - Each event can be partially filled as we might learn different pieces of device
1912 * information at different time
1913 * - Multiple device info events can be combined to give more complete picture
1914 * - When multiple device info events tries to describe the same information, the
1915 * later one wins
1916 *
1917 * Logged from:
1918 * packages/apps/Bluetooth
1919 */
1920message BluetoothManufacturerInfoReported {
1921 // An identifier that can be used to match events for this device.
1922 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1923 // Salt: Randomly generated 256 bit value
1924 // Hash algorithm: HMAC-SHA256
1925 // Size: 32 byte
1926 // Default: null or empty if the device identifier is not known
1927 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1928 // Where is this device info obtained from
1929 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1930 // Name of the data source
1931 // For EXTERNAL: package name of the data source
1932 // For INTERNAL: null for general case, component name otherwise
1933 optional string source_name = 3;
1934 // Name of the manufacturer of this device
1935 optional string manufacturer = 4;
1936 // Model of this device
1937 optional string model = 5;
1938 // Hardware version of this device
1939 optional string hardware_version = 6;
1940 // Software version of this device
1941 optional string software_version = 7;
1942}
1943
1944/**
1945 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1946 * device, as documented by the Bluetooth Core HCI specification
1947 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1948 * Vol 2, Part E, Page 1118
1949 *
1950 * Logged from:
1951 * system/bt
1952 */
1953message BluetoothRemoteVersionInfoReported {
1954 // Connection handle of the connection
1955 // Original type: uint16_t
1956 optional int32 connection_handle = 1;
1957 // HCI command status code
1958 // Default: STATUS_UNKNOWN
1959 optional android.bluetooth.hci.StatusEnum hci_status = 2;
1960 // 1 byte Version of current LMP in the remote controller
1961 optional int32 lmp_version = 3;
1962 // 2 bytes LMP manufacturer code of the remote controller
1963 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
1964 optional int32 lmp_manufacturer_code = 4;
1965 // 4 bytes subversion of the LMP in the remote controller
1966 optional int32 lmp_subversion = 5;
1967}
1968
1969/**
1970 * Logs when certain Bluetooth SDP attributes are discovered
1971 * Constant definitions are from:
1972 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
1973 *
1974 * Current logged attributes:
1975 * - BluetoothProfileDescriptorList
1976 * - Supported Features Bitmask
1977 *
1978 * Logged from:
1979 * system/bt
1980 */
1981message BluetoothSdpAttributeReported {
1982 // An identifier that can be used to match events for this device.
1983 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1984 // Salt: Randomly generated 256 bit value
1985 // Hash algorithm: HMAC-SHA256
1986 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1987 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
1988 // Original type: uint16_t
1989 optional int32 protocol_uuid = 2;
1990 // Short form UUIDs used to identify Bluetooth SDP attribute types
1991 // Original type: uint16_t
1992 optional int32 attribute_id = 3;
1993 // Attribute value for the particular attribute
1994 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1995}
1996
1997/**
1998 * Logs when bond state of a Bluetooth device changes
1999 *
2000 * Logged from:
2001 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2002 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2003 */
2004message BluetoothBondStateChanged {
2005 // An identifier that can be used to match events for this device.
2006 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2007 // Salt: Randomly generated 256 bit value
2008 // Hash algorithm: HMAC-SHA256
2009 // Size: 32 byte
2010 // Default: null or empty if the device identifier is not known
2011 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2012 // Preferred transport type to remote dual mode device
2013 // Default: TRANSPORT_AUTO means no preference
2014 optional android.bluetooth.TransportTypeEnum transport = 2;
2015 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2016 // Default: UNKNOWN
2017 optional android.bluetooth.DeviceTypeEnum type = 3;
2018 // Current bond state (NONE, BONDING, BONDED)
2019 // Default: BOND_STATE_UNKNOWN
2020 optional android.bluetooth.BondStateEnum bond_state = 4;
2021 // Bonding sub state
2022 // Default: BOND_SUB_STATE_UNKNOWN
2023 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2024 // Unbond Reason
2025 // Default: UNBOND_REASON_UNKNOWN
2026 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2027}
2028
2029/**
2030 * Logs there is an event related Bluetooth classic pairing
2031 *
2032 * Logged from:
2033 * system/bt
2034 */
2035message BluetoothClassicPairingEventReported {
2036 // An identifier that can be used to match events for this device.
2037 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2038 // Salt: Randomly generated 256 bit value
2039 // Hash algorithm: HMAC-SHA256
2040 // Size: 32 byte
2041 // Default: null or empty if the device identifier is not known
2042 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2043 // Connection handle of this connection if available
2044 // Range: 0x0000 - 0x0EFF (12 bits)
2045 // Default: 0xFFFF if the handle is unknown
2046 optional int32 connection_handle = 2;
2047 // HCI command associated with this event
2048 // Default: CMD_UNKNOWN
2049 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2050 // HCI event associated with this event
2051 // Default: EVT_UNKNOWN
2052 optional android.bluetooth.hci.EventEnum hci_event = 4;
2053 // HCI command status code if this is triggerred by hci_cmd
2054 // Default: STATUS_UNKNOWN
2055 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2056 // HCI reason code associated with this event
2057 // Default: STATUS_UNKNOWN
2058 optional android.bluetooth.hci.StatusEnum reason_code = 6;
2059}
2060
2061/**
2062 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2063 *
2064 * Logged from:
2065 * system/bt
2066 */
2067message BluetoothSmpPairingEventReported {
2068 // An identifier that can be used to match events for this device.
2069 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2070 // Salt: Randomly generated 256 bit value
2071 // Hash algorithm: HMAC-SHA256
2072 // Size: 32 byte
2073 // Default: null or empty if the device identifier is not known
2074 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2075 // SMP command sent or received over L2CAP
2076 // Default: CMD_UNKNOWN
2077 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2078 // Whether this command is sent or received
2079 // Default: DIRECTION_UNKNOWN
2080 optional android.bluetooth.DirectionEnum direction = 3;
2081 // SMP failure reason code
2082 // Default: PAIRING_FAIL_REASON_DEFAULT
2083 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2084}
2085
2086/**
Jack He815cdba2019-01-30 17:24:55 -08002087 * Logs when a Bluetooth socket’s connection state changed
2088 *
2089 * Logged from:
2090 * system/bt
2091 */
2092message BluetoothSocketConnectionStateChanged {
2093 // An identifier that can be used to match events for this device.
2094 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2095 // Salt: Randomly generated 256 bit value
2096 // Hash algorithm: HMAC-SHA256
2097 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002098 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002099 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002100 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002101 // Default 0 when unknown or don't care
2102 optional int32 port = 2;
2103 // Socket type as mentioned in
2104 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2105 // Default: SOCKET_TYPE_UNKNOWN
2106 optional android.bluetooth.SocketTypeEnum type = 3;
2107 // Socket connection state
2108 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2109 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2110 // Number of bytes sent to remote device during this connection
2111 optional int64 tx_bytes = 5;
2112 // Number of bytes received from remote device during this connection
2113 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002114 // Socket owner's UID
2115 optional int32 uid = 7 [(is_uid) = true];
2116 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2117 // |port| must be spawned by |server_port|
2118 // Default 0 when unknown or don't care
2119 optional int32 server_port = 8;
2120 // Whether this is a server listener socket
2121 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002122}
2123
2124/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002125 * Logs when something is plugged into or removed from the USB-C connector.
2126 *
2127 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002128 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002129 */
2130message UsbConnectorStateChanged {
2131 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002132 STATE_DISCONNECTED = 0;
2133 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002134 }
2135 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002136 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002137 // Last active session in ms.
2138 // 0 when the port is in connected state.
2139 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002140}
2141
2142/**
2143 * Logs the reported speaker impedance.
2144 *
2145 * Logged from:
2146 * Vendor audio implementation.
2147 */
2148message SpeakerImpedanceReported {
2149 optional int32 speaker_location = 1;
2150 optional int32 impedance = 2;
2151}
2152
2153/**
2154 * Logs the report of a failed hardware.
2155 *
2156 * Logged from:
2157 * Vendor HALs.
2158 *
2159 */
2160message HardwareFailed {
2161 enum HardwareType {
2162 HARDWARE_FAILED_UNKNOWN = 0;
2163 HARDWARE_FAILED_MICROPHONE = 1;
2164 HARDWARE_FAILED_CODEC = 2;
2165 HARDWARE_FAILED_SPEAKER = 3;
2166 HARDWARE_FAILED_FINGERPRINT = 4;
2167 }
2168 optional HardwareType hardware_type = 1;
2169
Maggie White6dcd8572019-01-31 14:11:50 -08002170 /**
2171 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002172 * the same hardware_type. The specific locations are vendor defined integers,
2173 * referring to board-specific numbering schemes.
2174 */
2175 optional int32 hardware_location = 2;
2176
Maggie White6dcd8572019-01-31 14:11:50 -08002177 /**
2178 * failure_code is specific to the HardwareType of the failed hardware.
2179 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002180 */
Maggie White6dcd8572019-01-31 14:11:50 -08002181 enum HardwareErrorCode {
2182 UNKNOWN = 0;
2183 COMPLETE = 1;
2184 SPEAKER_HIGH_Z = 2;
2185 SPEAKER_SHORT = 3;
2186 FINGERPRINT_SENSOR_BROKEN = 4;
2187 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002188 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002189 }
2190 optional int32 failure_code = 3;
2191}
2192
2193/**
2194 * Log an event when the device has been physically dropped.
2195 * Reported from the /vendor partition.
2196 */
2197message PhysicalDropDetected {
2198 // Confidence that the event was actually a drop, 0 -> 100
2199 optional int32 confidence_pctg = 1;
2200 // Peak acceleration of the drop, in 1/1000s of a g.
2201 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002202 // Duration of freefall in ms
2203 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002204}
2205
2206/**
2207 * Log bucketed battery charge cycles.
2208 *
2209 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002210 * a given charge point. For example, if 10 cycle buckets are
2211 * initialized, bucket 1 is the lowest 1/10th of the battery,
2212 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002213 *
2214 * Logged from:
2215 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2216 */
2217message ChargeCyclesReported {
2218 optional int32 cycle_bucket_1 = 1;
2219 optional int32 cycle_bucket_2 = 2;
2220 optional int32 cycle_bucket_3 = 3;
2221 optional int32 cycle_bucket_4 = 4;
2222 optional int32 cycle_bucket_5 = 5;
2223 optional int32 cycle_bucket_6 = 6;
2224 optional int32 cycle_bucket_7 = 7;
2225 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002226 optional int32 cycle_bucket_9 = 9;
2227 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002228}
2229
2230/**
Howard Roa46b6582018-09-18 16:45:02 -07002231 * Log battery health snapshot.
2232 *
2233 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2234 * are snapshotted periodically over 24hrs.
2235 */
2236message BatteryHealthSnapshot {
2237 enum BatterySnapshotType {
2238 UNKNOWN = 0;
2239 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2240 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2241 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2242 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2243 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2244 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2245 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2246 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2247 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2248 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2249 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2250 }
2251 optional BatterySnapshotType type = 1;
2252 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002253 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002254 // Voltage Battery Voltage, in microVolts.
2255 optional int32 voltage_micro_volt = 3;
2256 // Current Battery current, in microAmps.
2257 optional int32 current_micro_amps = 4;
2258 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2259 optional int32 open_circuit_micro_volt = 5;
2260 // Resistance Battery Resistance, in microOhms.
2261 optional int32 resistance_micro_ohm = 6;
2262 // Level Battery Level, as % of full.
2263 optional int32 level_percent = 7;
2264}
2265
2266/**
2267 * Log slow I/O operations on the primary storage.
2268 */
2269message SlowIo {
2270 // Classifications of IO Operations.
2271 enum IoOperation {
2272 UNKNOWN = 0;
2273 READ = 1;
2274 WRITE = 2;
2275 UNMAP = 3;
2276 SYNC = 4;
2277 }
2278 optional IoOperation operation = 1;
2279
2280 // The number of slow IO operations of this type over 24 hours.
2281 optional int32 count = 2;
2282}
2283
2284/**
2285 * Log battery caused shutdown with the last recorded voltage.
2286 */
2287message BatteryCausedShutdown {
2288 // The last recorded battery voltage prior to shutdown.
2289 optional int32 last_recorded_micro_volt = 1;
2290}
2291
2292/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002293 * Logs the duration of a davey (jank of >=700ms) when it occurs
2294 *
2295 * Logged from:
2296 * frameworks/base/libs/hwui/JankTracker.cpp
2297 */
2298message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002299 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002300 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002301
Tej Singhbb8554a2018-01-26 11:59:14 -08002302 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002303 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002304}
2305
2306/**
Bookatze5885242017-10-24 20:10:31 -07002307 * Logs phone signal strength changes.
2308 *
2309 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002310 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002311 */
2312message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002313 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2314 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002315}
2316
Yangster4ccebea2018-10-09 17:09:02 -07002317
2318/**
2319 * Logs when the phone state, sim state or signal strength changes
2320 *
2321 * Logged from:
2322 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2323 */
2324message PhoneServiceStateChanged {
2325 optional android.telephony.ServiceStateEnum state = 1;
2326 optional android.telephony.SimStateEnum sim_state = 2;
2327 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2328}
2329
2330/**
2331 * Logs when the phone becomes on or off.
2332 *
2333 * Logged from:
2334 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2335 */
2336message PhoneStateChanged {
2337 enum State {
2338 OFF = 0;
2339 ON = 1;
2340 }
2341 optional State state = 1;
2342}
2343
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002344message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002345 optional android.stats.launcher.LauncherAction action = 1;
2346 optional android.stats.launcher.LauncherState src_state = 2;
2347 optional android.stats.launcher.LauncherState dst_state = 3;
2348 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002349 optional bool is_swipe_up_enabled = 5;
2350}
2351
David Chenc28b2bb2017-10-24 12:52:52 -07002352/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002353 * Logs when Settings UI has changed.
2354 *
2355 * Logged from:
2356 * packages/apps/Settings
2357 */
2358message SettingsUIChanged {
2359 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002360 * Where this SettingsUIChange event comes from. For example, if
2361 * it's a PAGE_VISIBLE event, where the page is opened from.
2362 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002363 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002364
2365 /**
2366 * What the UI action is.
2367 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002368 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002369
2370 /**
2371 * Where the action is happening
2372 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002373 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002374
2375 /**
2376 * What preference changed in this event.
2377 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002378 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002379
2380 /**
2381 * The new value of the changed preference.
2382 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002383 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002384}
2385
2386/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002387 * Logs basic timing information about touch events.
2388 * Reported at most every 5 minutes while device is being interacted with.
2389 *
2390 * Logged from:
2391 * frameworks/native/services/inputflinger
2392 */
2393message TouchEventReported {
2394 /**
2395 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2396 * and the standard deviation of latency between the kernel and framework
2397 * for touchscreen events. The units are microseconds.
2398 *
2399 * The number is measured as the difference between the time at which
2400 * the input event was received in the evdev driver,
2401 * and the time at which the input event was received in EventHub.
2402 */
2403 // Minimum value
2404 optional float latency_min_micros = 1;
2405 // Maximum value
2406 optional float latency_max_micros = 2;
2407 // Average value
2408 optional float latency_mean_micros = 3;
2409 // Standard deviation
2410 optional float latency_stdev_micros = 4;
2411}
2412
2413/**
Philip Quinn0eded622019-01-29 12:46:28 -08002414 * Logs gesture classification and timing information for touch events.
2415 *
2416 * Logged from:
2417 * frameworks/base/core/java/android/view/GestureDetector.java
2418 * frameworks/base/core/java/android/view/View.java
2419 */
2420message TouchGestureClassified {
2421 // The source of the classification (e.g. Java class name).
2422 optional string source = 1;
2423
2424 enum Classification {
2425 UNKNOWN_CLASSIFICATION = 0;
2426 SINGLE_TAP = 1;
2427 DOUBLE_TAP = 2;
2428 LONG_PRESS = 3;
2429 DEEP_PRESS = 4;
2430 SCROLL = 5;
2431 }
2432 // The classification of the gesture.
2433 optional Classification classification = 2;
2434
2435 // The interval from the start of a touch event stream until the
2436 // classification was made.
2437 optional int32 latency_millis = 3;
2438
2439 // The distance from the location of the first touch event to the
2440 // location of the touch event when the classification was made.
2441 optional float displacement_px = 4;
2442}
2443
2444/**
David Chenc28b2bb2017-10-24 12:52:52 -07002445 * Logs that a setting was updated.
2446 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002447 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002448 * The tag and is_default allow resetting of settings to default values based on the specified
2449 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2450 */
2451message SettingChanged {
2452 // The name of the setting.
2453 optional string setting = 1;
2454
2455 // The change being imposed on this setting. May represent a number, eg "3".
2456 optional string value = 2;
2457
2458 // The new value of this setting. For most settings, this is same as value. For some settings,
2459 // value is +X or -X where X represents an element in a set. For example, if the previous value
2460 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2461 // The +/- feature is currently only used for location_providers_allowed.
2462 optional string new_value = 3;
2463
2464 // The previous value of this setting.
2465 optional string prev_value = 4;
2466
2467 // The tag used with the is_default for resetting sets of settings. This is generally null.
2468 optional string tag = 5;
2469
Bookatz90867622018-01-31 15:05:57 -08002470 // True if this setting with tag should be resettable.
2471 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002472
David Chenbd789912018-03-16 17:19:55 -07002473 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002474 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002475
2476 enum ChangeReason {
2477 UPDATED = 1; // Updated can be an insertion or an update.
2478 DELETED = 2;
2479 }
2480 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002481}
Chenjie Yub3dda412017-10-24 13:41:59 -07002482
Chenjie Yu05013b32017-11-21 10:21:41 -08002483/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002484 * Logs activity going to foreground or background
2485 *
2486 * Logged from:
2487 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2488 */
2489message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002490 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002491 optional string pkg_name = 2;
2492 optional string class_name = 3;
2493
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002494 enum State {
2495 BACKGROUND = 0;
2496 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002497 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002498 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002499}
David Chenc8a43242017-10-17 16:23:28 -07002500
2501/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002502 * Logs when a volume entered low Storage state.
2503 * Logged from:
2504 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2505 */
2506message LowStorageStateChanged {
2507 // Volume that ran out of storage.
2508 optional string volume_description = 1;
2509
2510 enum State {
2511 UNKNOWN = 0;
2512 OFF = 1;
2513 ON = 2;
2514 }
2515 optional State state = 2;
2516}
2517
2518/**
2519 * Logs when an app is downgraded.
2520 * Logged from:
2521 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2522 */
2523message AppDowngraded {
2524 optional string package_name = 1;
2525 // Size of the package (all data) before being downgraded.
2526 optional int64 size_in_bytes_before = 2;
2527 // Size of the package (all data) after being downgraded.
2528 optional int64 size_in_bytes_after = 3;
2529
2530 optional bool aggressive = 4;
2531}
2532
2533/**
2534 * Logs when an app is optimized after being downgraded.
2535 * Logged from:
2536 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2537 */
2538message AppOptimizedAfterDowngraded {
2539 optional string package_name = 1;
2540}
2541
2542/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002543 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002544 * Logged from:
2545 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2546 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002547message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002548 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002549
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002550 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002551
2552 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002553 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002554 optional string process_name = 3;
2555
2556 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002557 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002558
2559 optional string package_name = 5;
2560
2561 enum InstantApp {
2562 UNAVAILABLE = 0;
2563 FALSE = 1;
2564 TRUE = 2;
2565 }
2566 optional InstantApp is_instant_app = 6;
2567
2568 enum ForegroundState {
2569 UNKNOWN = 0;
2570 BACKGROUND = 1;
2571 FOREGROUND = 2;
2572 }
2573 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002574
2575 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002576}
David Chen9e3808c2017-11-20 17:25:34 -08002577
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002578/**
2579 * Logs when a WTF (What a Terrible Failure) happened.
2580 * Logged from:
2581 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2582 */
2583message WTFOccurred {
2584 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002585
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002586 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002587
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002588 // The name of the process.
2589 // system_server if it is not by an app
2590 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002591
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002592 // The pid if available. -1 means not available.
2593 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002594
2595 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002596}
2597
2598/**
2599 * Logs when system server reports low memory.
2600 * Logged from:
2601 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2602 */
2603message LowMemReported {
2604}
2605
2606/**
2607 * Logs when an app ANR (App Not Responding) occurs.
2608 * Logged from:
2609 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2610 */
2611message ANROccurred {
2612 optional int32 uid = 1 [(is_uid) = true];
2613
2614 optional string process_name = 2;
2615
2616 optional string short_component_name = 3;
2617
2618 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002619
2620 enum InstantApp {
2621 UNAVAILABLE = 0;
2622 FALSE = 1;
2623 TRUE = 2;
2624 }
2625 optional InstantApp is_instant_app = 5;
2626
2627 enum ForegroundState {
2628 UNKNOWN = 0;
2629 BACKGROUND = 1;
2630 FOREGROUND = 2;
2631 }
2632 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002633
2634 optional android.server.ErrorSource error_source = 7;
2635
2636 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002637}
2638
Bookatza7020bd2018-08-28 16:29:35 -07002639/**
2640 * Logs when the vibrator state changes.
2641 * Logged from:
2642 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2643 */
2644message VibratorStateChanged {
2645 repeated AttributionNode attribution_node = 1;
2646
2647 enum State {
2648 OFF = 0;
2649 ON = 1;
2650 }
2651 optional State state = 2;
2652
2653 // Duration (in milliseconds) requested to keep the vibrator on.
2654 // Only applicable for State == ON.
2655 optional int64 duration_millis = 3;
2656}
2657
David Chen0a368b22017-12-06 16:28:16 -08002658/*
2659 * Allows other apps to push events into statsd.
2660 * Logged from:
2661 * frameworks/base/core/java/android/util/StatsLog.java
2662 */
David Chen0b5c90c2018-01-25 16:51:49 -08002663message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002664 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002665 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002666
2667 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2668 optional int32 label = 2;
2669
2670 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2671 // predicates for the metrics).
2672 enum State {
2673 UNKNOWN = 0;
2674 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2675 STOP = 2;
2676 START = 3;
2677 }
2678 optional State state = 3;
2679}
2680
David Chen9e3808c2017-11-20 17:25:34 -08002681/**
Bookatz7948c872018-09-04 12:58:33 -07002682 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2683 * For example, this could be due to the user manually changing the time.
2684 *
2685 * Logged from:
2686 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2687 */
2688message WallClockTimeShifted {
2689 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2690 optional int64 wall_clock_timestamp_millis = 1;
2691}
2692
2693/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002694 * Logs when statsd detects an anomaly.
2695 *
2696 * Logged from:
2697 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2698 */
2699message AnomalyDetected {
2700 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002701 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002702
Yangster-mac94e197c2018-01-02 16:03:03 -08002703 // Id of the config whose anomaly detection alert fired.
2704 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002705
Yangster-mac94e197c2018-01-02 16:03:03 -08002706 // Id of the alert (i.e. name of the anomaly that was detected).
2707 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002708}
2709
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002710message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002711 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002712 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002713
2714 // The app package name.
2715 optional string pkg_name = 2;
2716
2717 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002718 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002719 WARM = 1;
2720 HOT = 2;
2721 COLD = 3;
2722 }
2723 // The transition type.
2724 optional TransitionType type = 3;
2725
2726 // The activity name.
2727 optional string activity_name = 4;
2728
2729 // The name of the calling app. Empty if not set.
2730 optional string calling_pkg_name = 5;
2731
2732 // Whether the app is an instant app.
2733 optional bool is_instant_app = 6;
2734
2735 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002736 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002737
Bookatz80d11a02018-01-16 10:46:35 -08002738 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002739
David Chen0b5c90c2018-01-25 16:51:49 -08002740 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002741 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002742 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002743 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002744 optional int32 bind_application_delay_millis = 11;
2745 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002746
2747 // Empty if not set.
2748 optional string launch_token = 13;
2749
Calin Juravle759fbda2018-02-20 19:52:30 +00002750 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002751 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002752
2753 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002754 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002755}
2756
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002757message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002758 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002759 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002760
2761 // The app package name.
2762 optional string pkg_name = 2;
2763
2764 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002765 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002766 WARM = 1;
2767 HOT = 2;
2768 COLD = 3;
2769 }
2770 // The transition type.
2771 optional TransitionType type = 3;
2772
2773 // The activity name.
2774 optional string activity_name = 4;
2775}
2776
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002777message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002778 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002779 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002780
2781 // The app package name.
2782 optional string pkg_name = 2;
2783
2784 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002785 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002786 WITH_BUNDLE = 1;
2787 WITHOUT_BUNDLE = 2;
2788 }
2789 // The transition type.
2790 optional TransitionType type = 3;
2791
2792 // The activity name.
2793 optional string activity_name = 4;
2794
2795 optional bool transition_process_running = 5;
2796
2797 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002798 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002799}
2800
Bookatz8fcd09a2017-12-18 13:01:10 -08002801/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002802 * Logs a picture-in-picture action
2803 * Logged from:
2804 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2805 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2806 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2807 */
2808message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002809 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002810 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002811
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002812 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002813
Chenjie Yu52cacc62017-12-08 18:11:45 -08002814 enum State {
2815 ENTERED = 1;
2816 EXPANDED_TO_FULL_SCREEN = 2;
2817 MINIMIZED = 3;
2818 DISMISSED = 4;
2819 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002820 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002821}
2822
2823/**
Chenjie Yue8904192017-12-08 19:12:57 -08002824 * Logs overlay action
2825 * Logged from:
2826 * services/core/java/com/android/server/wm/Session.java
2827 */
2828message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002829 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002830
2831 optional string package_name = 2;
2832
2833 optional bool using_alert_window = 3;
2834
2835 enum State {
2836 ENTERED = 1;
2837 EXITED = 2;
2838 }
2839 optional State state = 4;
2840}
2841
Chenjie Yuccfe6452018-01-30 11:33:21 -08002842/*
2843 * Logs foreground service starts and stops.
2844 * Note that this is not when a service starts or stops, but when it is
2845 * considered foreground.
2846 * Logged from
2847 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2848 */
2849message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002850 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002851 // package_name + "/" + class_name
2852 optional string short_name = 2;
2853
2854 enum State {
2855 ENTER = 1;
2856 EXIT = 2;
2857 }
2858 optional State state = 3;
2859}
2860
Chenjie Yue8904192017-12-08 19:12:57 -08002861/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002862 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2863 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2864 * attributed back to the parent (host) uid. One example is Chrome.
2865 *
2866 * Logged from:
2867 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2868 */
2869message IsolatedUidChanged {
2870 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002871 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002872 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002873 optional int32 parent_uid = 1;
2874
2875 optional int32 isolated_uid = 2;
2876
2877 // We expect an isolated uid to be removed before if it's used for another parent uid.
2878 enum Event {
2879 REMOVED = 0;
2880 CREATED = 1;
2881 }
2882 optional Event event = 3;
2883}
2884
2885/*
2886 * Logs the reception of an incoming network packet causing the main system to wake up for
2887 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2888 * and processed by WakeupController.cpp.
2889 */
2890message PacketWakeupOccurred {
2891 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2892 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002893 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002894 // The interface name on which the packet was received.
2895 optional string iface = 2;
2896 // The ethertype value of the packet.
2897 optional int32 ethertype = 3;
2898 // String representation of the destination MAC address of the packet.
2899 optional string destination_hardware_address = 4;
2900 // String representation of the source address of the packet if this was an IP packet.
2901 optional string source_ip = 5;
2902 // String representation of the destination address of the packet if this was an IP packet.
2903 optional string destination_ip = 6;
2904 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2905 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2906 // families.
2907 optional int32 ip_next_header = 7;
2908 // The source port if this was a TCP or UDP packet.
2909 optional int32 source_port = 8;
2910 // The destination port if this was a TCP or UDP packet.
2911 optional int32 destination_port = 9;
2912}
2913
2914/*
2915 * Logs the memory stats for an app on startup.
2916 * Logged from:
2917 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2918 */
2919message AppStartMemoryStateCaptured {
2920 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002921 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002922
2923 // The process name.
2924 optional string process_name = 2;
2925
2926 // The activity name.
2927 optional string activity_name = 3;
2928
2929 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002930 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002931
2932 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002933 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002934
2935 // RSS
2936 optional int64 rss_in_bytes = 6;
2937
2938 // CACHE
2939 optional int64 cache_in_bytes = 7;
2940
2941 // SWAP
2942 optional int64 swap_in_bytes = 8;
2943}
2944
2945/*
2946 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2947 * for LMK event.
2948 * Logged from:
2949 * system/core/lmkd/lmkd.c
2950 */
2951message LmkStateChanged {
2952 enum State {
2953 UNKNOWN = 0;
2954 START = 1;
2955 STOP = 2;
2956 }
2957 optional State state = 1;
2958}
2959
2960/*
2961 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2962 * Logged from:
2963 * system/core/lmkd/lmkd.c
2964 */
2965message LmkKillOccurred {
2966 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002967 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002968
2969 // The process name.
2970 optional string process_name = 2;
2971
2972 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002973 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002974
2975 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002976 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002977
2978 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002979 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002980
2981 // RSS
2982 optional int64 rss_in_bytes = 6;
2983
2984 // CACHE
2985 optional int64 cache_in_bytes = 7;
2986
2987 // SWAP
2988 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002989
2990 // The elapsed real time of start of the process.
2991 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002992}
2993
Rajeev Kumar51b54602018-03-01 12:18:26 -08002994/*
2995 * Logs when the ActivityManagerService detects that an app died.
2996 *
2997 * Logged from:
2998 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2999 */
3000message AppDied {
3001 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003002 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003003}
3004
Howard Ro21a039c2018-08-06 14:55:47 -07003005/**
3006 * An atom for generic metrics logging. Available from Android Q.
3007 */
3008message GenericAtom {
3009 // The uid of the application that sent this custom atom.
3010 optional int32 uid = 1 [(is_uid) = true];
3011
3012 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003013 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003014}
3015
Tej Singhd6d6d772018-09-05 17:41:25 -07003016/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003017 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003018 *
3019 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003020 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003021 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003022message BiometricAcquired {
3023 // Biometric modality that was acquired.
3024 optional android.hardware.biometrics.ModalityEnum modality = 1;
3025 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3026 optional int32 user = 2;
3027 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3028 optional bool is_crypto = 3;
3029 // Action that the device is performing. Acquired messages are only expected for enroll and
3030 // authenticate. Other actions may indicate an error.
3031 optional android.hardware.biometrics.ActionEnum action = 4;
3032 // The client that this acquisition was received for.
3033 optional android.hardware.biometrics.ClientEnum client = 5;
3034 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3035 optional int32 acquire_info = 6;
3036 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3037 optional int32 acquire_info_vendor = 7;
Tej Singhd6d6d772018-09-05 17:41:25 -07003038}
3039
3040/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003041 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003042 *
3043 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003044 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003045 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003046message BiometricAuthenticated {
3047 // Biometric modality that was used.
3048 optional android.hardware.biometrics.ModalityEnum modality = 1;
3049 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3050 optional int32 user = 2;
3051 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3052 // storage.
3053 optional bool is_crypto = 3;
3054 // The client that this acquisition was received for.
3055 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003056 // If authentication requires user confirmation. See BiometricPrompt's
3057 // setRequireConfirmation(bool) method.
3058 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003059
Kevin Chyn1741a072019-01-17 11:54:40 -08003060 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003061 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003062 REJECTED = 1;
3063 PENDING_CONFIRMATION = 2;
3064 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003065 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003066
3067 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003068 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003069 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3070 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3071 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3072 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003073 optional int64 latency_millis = 7;
Kevin Chyn1741a072019-01-17 11:54:40 -08003074}
3075
3076/**
3077 * Logs when a biometric error occurs.
3078 *
3079 * Logged from:
3080 * frameworks/base/services/core/java/com/android/server/biometrics
3081 */
3082message BiometricErrorOccurred {
3083 // Biometric modality that was used.
3084 optional android.hardware.biometrics.ModalityEnum modality = 1;
3085 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3086 optional int32 user = 2;
3087 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3088 optional bool is_crypto = 3;
3089 // Action that the device is performing.
3090 optional android.hardware.biometrics.ActionEnum action = 4;
3091 // The client that this acquisition was received for.
3092 optional android.hardware.biometrics.ClientEnum client = 5;
3093 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3094 // are unique to modality.
3095 optional int32 error_info = 6;
3096 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3097 // by the vendor and not specified by the HIDL interface.
3098 optional int32 error_info_vendor = 7;
3099}
3100
3101/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003102 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003103 * Logged from:
3104 * frameworks/base/services/core/java/com/android/server/biometrics
3105 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003106message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003107 // Biometric modality.
3108 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003109 // Type of issue detected.
3110 optional android.hardware.biometrics.IssueEnum issue = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07003111}
Howard Ro688ae182018-09-25 00:09:36 -07003112
3113message Notification {
3114
3115 // Type of notification event.
3116 enum Type {
3117 TYPE_UNKNOWN = 0;
3118 // Notification became visible to the user.
3119 TYPE_OPEN = 1;
3120 // Notification became hidden.
3121 TYPE_CLOSE = 2;
3122 // Notification switched to detail mode.
3123 TYPE_DETAIL = 3;
3124 // Notification was clicked.
3125 TYPE_ACTION = 4;
3126 // Notification was dismissed.
3127 TYPE_DISMISS = 5;
3128 // Notification switched to summary mode. The enum value of 14 is to
3129 // match that of metrics_constants.
3130 TYPE_COLLAPSE = 14;
3131 }
3132 optional Type type = 1;
3133
3134 // Package name associated with the notification.
3135 optional string package_name = 2;
3136
3137 // Tag associated with notification.
3138 optional string tag = 3;
3139
3140 // Application-supplied ID associated with the notification.
3141 optional int32 id = 4;
3142
3143 // Index of notification in the notification panel.
3144 optional int32 shade_index = 5;
3145
3146 // The number of notifications in the notification panel.
3147 optional int32 shade_count = 6;
3148
3149 // Importance for the notification.
3150 optional int32 importance = 7;
3151
3152 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07003153 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07003154
3155 // Importance for the notification channel.
3156 optional int32 channel_importance = 9;
3157
Howard Ro183c2bd2018-10-18 13:52:10 -07003158 // Application-supplied ID associated with the notifications group.
3159 optional string group_id = 10;
3160
Howard Ro688ae182018-09-25 00:09:36 -07003161 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07003162 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07003163
Howard Ro183c2bd2018-10-18 13:52:10 -07003164 // Reason for dismissal of a notification. This field is only meaningful for
3165 // TYPE_DISMISS events.
3166 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07003167
Howard Ro183c2bd2018-10-18 13:52:10 -07003168 // The first post time of notification, stable across updates.
3169 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07003170
Howard Ro183c2bd2018-10-18 13:52:10 -07003171 // The most recent interruption time, or the creation time if no updates.
3172 // Differs from update_millis because updates are filtered based on whether
3173 // they actually interrupted the user.
3174 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07003175
Howard Ro183c2bd2018-10-18 13:52:10 -07003176 // The most recent update time, or the creation time if no updates.
3177 optional int64 update_millis = 15;
3178
3179 // The most recent visibility event.
3180 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07003181}
3182
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003183/*
Tej Singh0d176952019-01-16 19:10:54 -08003184 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003185 */
Tej Singh0d176952019-01-16 19:10:54 -08003186message FlagFlipUpdateOccurred {
3187 // If the event is from a flag config package, specify the package name.
3188 optional string flag_flip_package_name = 1;
3189
3190 // The order id of the package
3191 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003192}
3193
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003194/**
3195 * Potential experiment ids that goes with a train install.
3196 */
3197message TrainExperimentIds {
3198 repeated int64 experiment_id = 1;
3199}
3200
Yangster-macb89807e2018-11-15 21:10:57 -08003201/*
3202 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003203 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003204 */
3205message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003206 // Name of the train.
3207 optional string train_name = 1;
3208 // Version code for a "train" of packages that need to be installed atomically
3209 optional int64 train_version_code = 2;
3210 // After installation of this package, device requires a restart.
3211 optional bool requires_staging = 3;
3212 // Rollback should be enabled for this install.
3213 optional bool rollback_enabled = 4;
3214 // Requires low latency monitoring if possible.
3215 optional bool requires_low_latency_monitor = 5;
3216
Yangster-macb89807e2018-11-15 21:10:57 -08003217 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003218 UNKNOWN = 0;
3219 INSTALL_REQUESTED = 1;
3220 INSTALL_STARTED = 2;
3221 INSTALL_STAGED_NOT_READY = 3;
3222 INSTALL_STAGED_READY = 4;
3223 INSTALL_SUCCESS = 5;
3224 INSTALL_FAILURE = 6;
3225 INSTALL_CANCELLED = 7;
3226 INSTALLER_ROLLBACK_REQUESTED = 8;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003227 INSTALLER_ROLLBACK_SUCCESS = 9;
3228 INSTALLER_ROLLBACK_FAILURE = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08003229 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003230 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003231 // Possible experiment ids for monitoring this push.
3232 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3233 // user id
3234 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003235}
3236
Maggie Whitefc1aa592018-11-28 21:55:23 -08003237/** Represents USB port overheat event. */
3238message UsbPortOverheatEvent {
3239 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3240 optional int32 plug_temperature_deci_c = 1;
3241
3242 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3243 optional int32 max_temperature_deci_c = 2;
3244
3245 /* Time between USB plug event and overheat threshold trip, in seconds. */
3246 optional int32 time_to_overheat_secs = 3;
3247
3248 /* Time between overheat threshold trip and hysteresis, in seconds. */
3249 optional int32 time_to_hysteresis_secs = 4;
3250
3251 /* Time between hysteresis and active mitigation ending, in seconds. */
3252 optional int32 time_to_inactive_secs = 5;
3253};
3254
Maggie White8735b852019-01-18 11:40:49 -08003255/**
3256 * Logs total effective full charge and discharge cycles on a battery.
3257 * Here are some examples of one effective cycle:
3258 * 1) the battery charges from 0% to 100% and drains back to 0%,
3259 * 2) charging from 50% to 100% and draining back to 50% twice.
3260 * Pulled from:
3261 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3262 */
3263message BatteryCycleCount {
3264 /* Number of total charge and discharge cycles on the system battery. */
3265 optional int32 cycle_count = 1;
3266}
3267
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003268/**
3269 * Logs that an SD card is mounted and information about it, its type (public or private) and the
3270 * size in bytes.
3271 * Pulled from:
3272 * StatsCompanionService
3273 */
3274
3275message SDCardInfo {
3276
3277 enum Type {
3278 UNKNOWN = 0;
3279 TYPE_PUBLIC = 1;
3280 TYPE_PRIVATE = 2;
3281 OTHERS = 3;
3282 }
3283
3284 // Type of the SD card: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3285 optional Type type = 1;
3286 // Total size of the sd card in bytes.
3287 optional int64 size_bytes = 2;
3288}
3289
Yangster-macb89807e2018-11-15 21:10:57 -08003290/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003291 * Logs when a connection becomes available and lost.
3292 * Logged in StatsCompanionService.java
3293 */
3294message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003295 // Id of the network.
3296 optional int32 net_id = 1;
3297
3298 enum State {
3299 UNKNOWN = 0;
3300 CONNECTED = 1;
3301 DISCONNECTED = 2;
3302 }
3303 // Connected state of a network.
3304 optional State state = 2;
3305}
3306
3307/**
3308 * Logs when a service starts and stops.
3309 * Logged from:
3310 * services/core/java/com/android/server/am/ActiveServices.java
3311 */
3312message ServiceStateChanged {
3313
3314 optional int32 uid = 1 [(is_uid) = true];
3315
3316 optional string package_name = 2;
3317
3318 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003319
3320 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003321 START = 1;
3322 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003323 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003324
3325 optional State state = 4;
3326}
3327
3328/**
3329 * Logs when a service is launched.
3330 * Logged from:
3331 * services/core/java/com/android/server/am/ActiveServices.java
3332 */
3333message ServiceLaunchReported {
3334
3335 optional int32 uid = 1 [(is_uid) = true];
3336
3337 optional string package_name = 2;
3338
3339 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003340}
Howard Ro688ae182018-09-25 00:09:36 -07003341
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003342/**
3343 * Logs when a hidden API is used.
3344 *
3345 * Logged from:
3346 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3347 */
3348message HiddenApiUsed {
3349 // The uid of the app making the hidden access.
3350 optional int32 uid = 1 [(is_uid) = true];
3351
3352 // Signature of the method or field accessed.
3353 optional string signature = 2;
3354
3355 enum AccessMethod {
3356 NONE = 0;
3357 REFLECTION = 1;
3358 JNI = 2;
3359 LINKING = 3;
3360 }
3361
3362 // Type of access.
3363 optional AccessMethod access_method = 3;
3364
3365 // Whether the access was prevented or not.
3366 optional bool access_denied = 4;
3367}
3368
Chenjie Yubbcbc602018-02-05 16:51:52 -08003369//////////////////////////////////////////////////////////////////////
3370// Pulled atoms below this line //
3371//////////////////////////////////////////////////////////////////////
3372
3373/**
David Chenc8a43242017-10-17 16:23:28 -07003374 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3375 *
3376 * Pulled from:
3377 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3378 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003379message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003380 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003381
3382 optional int64 rx_bytes = 2;
3383
3384 optional int64 rx_packets = 3;
3385
3386 optional int64 tx_bytes = 4;
3387
3388 optional int64 tx_packets = 5;
3389}
3390
3391/**
3392 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3393 *
3394 * Pulled from:
3395 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3396 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003397message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003398 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003399
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003400 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3401 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003402
3403 optional int64 rx_bytes = 3;
3404
3405 optional int64 rx_packets = 4;
3406
3407 optional int64 tx_bytes = 5;
3408
3409 optional int64 tx_packets = 6;
3410}
3411
3412/**
3413 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3414 *
3415 * Pulled from:
3416 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3417 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003418message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003419 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003420
3421 optional int64 rx_bytes = 2;
3422
3423 optional int64 rx_packets = 3;
3424
3425 optional int64 tx_bytes = 4;
3426
3427 optional int64 tx_packets = 5;
3428}
3429
3430/**
3431 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3432 *
3433 * Pulled from:
3434 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3435 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003436message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003437 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003438
Yao Chenc40a19d2018-03-15 16:48:25 -07003439 // 1 denotes foreground and 0 denotes background. This is called Set in
3440 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003441 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003442
3443 optional int64 rx_bytes = 3;
3444
3445 optional int64 rx_packets = 4;
3446
3447 optional int64 tx_bytes = 5;
3448
3449 optional int64 tx_packets = 6;
3450}
3451
3452/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003453 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3454 *
3455 * Pulled from:
3456 * StatsCompanionService
3457 */
3458message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003459 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003460
3461 optional int64 rx_bytes = 2;
3462
3463 optional int64 tx_bytes = 3;
3464}
3465
3466/**
David Chenc8a43242017-10-17 16:23:28 -07003467 * Pulls the kernel wakelock durations. This atom is adapted from
3468 * android/internal/os/KernelWakelockStats.java
3469 *
3470 * Pulled from:
3471 * StatsCompanionService using KernelWakelockReader.
3472 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003473message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003474 optional string name = 1;
3475
3476 optional int32 count = 2;
3477
3478 optional int32 version = 3;
3479
Yangster-maca8a30442018-10-13 23:46:34 -07003480 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003481}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003482
Chenjie Yu05013b32017-11-21 10:21:41 -08003483/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003484 * Pulls low power state information. If power.stats HAL is not available, this
3485 * includes platform and subsystem sleep state information,
3486 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3487 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003488 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003489 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003490 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3491 * as defined in:
3492 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003493 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003494message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003495 // Subsystem name
3496 optional string subsystem_name = 1;
3497 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3498 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003499 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3500 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003501 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003502 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003503 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003504 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003505 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003506}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003507
Chenjie Yu05013b32017-11-21 10:21:41 -08003508/**
Bookatz92da2832018-11-01 18:10:03 -07003509 * Pulls on-device power measurement information.
3510 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3511 * Pulled from:
3512 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3513 */
3514message OnDevicePowerMeasurement {
3515 // Name of the subsystem (to which the rail belongs).
3516 optional string subsystem_name = 1;
3517
3518 // Rail name. The rail lies within the subsystem.
3519 optional string rail_name = 2;
3520
3521 // Time (in ms since boot) at which the rail energy value was measured.
3522 // This may differ slightly from the time that statsd logs this information.
3523 optional uint64 measurement_timestamp_millis = 3;
3524
3525 // Accumulated energy used via the rail since device boot in uWs.
3526 optional uint64 energy_microwatt_secs = 4;
3527}
3528
3529/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003530 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003531 * Pulls the time the cpu spend on the frequency index. Frequency index
3532 * starts from highest to lowest. The value should be monotonically
3533 * increasing since boot. However, if there is a cpu
3534 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003535 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003536message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003537 optional uint32 cluster = 1;
3538 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003539 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003540}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003541
Chenjie Yu05013b32017-11-21 10:21:41 -08003542/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003543 * Pulls Cpu Time Per Uid.
3544 * Note that isolated process uid time should be attributed to host uids.
3545 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003546message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003547 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003548 optional uint64 user_time_micros = 2;
3549 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003550}
3551
3552/**
3553 * Pulls Cpu Time Per Uid per frequency.
3554 * Note that isolated process uid time should be attributed to host uids.
3555 * For each uid, we order the time by descending frequencies.
3556 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003557message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003558 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003559 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003560 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003561}
Hugo Benichi884970e2017-11-14 22:42:46 +09003562
Chenjie Yu05013b32017-11-21 10:21:41 -08003563/**
3564 * Pulls Wifi Controller Activity Energy Info
3565 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003566message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003567 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003568 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003569 // stack reported state
3570 // TODO: replace this with proto enum
3571 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003572 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003573 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003574 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003575 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003576 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003577 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003578 // product of current(mA), voltage(V) and time(ms)
3579 optional uint64 controller_energy_used = 6;
3580}
3581
3582/**
3583 * Pulls Modem Activity Energy Info
3584 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003585message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003586 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003587 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003588 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003589 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003590 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003591 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003592 /**
3593 * Tx power index
3594 * index 0 = tx_power < 0dBm
3595 * index 1 = 0dBm < tx_power < 5dBm
3596 * index 2 = 5dBm < tx_power < 15dBm
3597 * index 3 = 15dBm < tx_power < 20dBm
3598 * index 4 = tx_power > 20dBm
3599 */
3600 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003601 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003602 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003603 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003604 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003605 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003606 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003607 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003608 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003609 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003610 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003611 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003612 // product of current(mA), voltage(V) and time(ms)
3613 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003614}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003615
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003616/**
3617 * Pulls Bluetooth Activity Energy Info
3618 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3619 */
3620message BluetoothActivityInfo {
3621 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003622 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003623 // bluetooth stack state
3624 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003625 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003626 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003627 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003628 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003629 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003630 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003631 // product of current(mA), voltage(V) and time(ms)
3632 optional uint64 energy_used = 6;
3633}
3634
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003635/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003636 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003637 *
3638 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003639 */
3640message ProcessMemoryState {
3641 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003642 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003643
3644 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003645 // Usually package name, "system" for system server.
3646 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003647 optional string process_name = 2;
3648
Rafal Slawikda51b932018-12-13 16:31:33 +00003649 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003650 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003651
3652 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003653 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003654
3655 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003656 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003657
Rajeev Kumar90235992018-01-29 11:06:48 -08003658 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003659 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3660 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003661 optional int64 rss_in_bytes = 6;
3662
3663 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003664 // Value is read from memory.stat, field total_cache if per-app memory
3665 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003666 optional int64 cache_in_bytes = 7;
3667
3668 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003669 // Value is read from memory.stat, field total_swap if per-app memory
3670 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003671 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003672
Rafal Slawikd03ae422018-11-20 11:27:45 +00003673 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003674 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003675
3676 // Elapsed real time when the process started.
3677 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3678 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003679}
3680
3681/*
Rafal Slawik08621582018-10-15 14:53:07 +01003682 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003683 *
3684 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003685 */
3686message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003687 // The uid if available. -1 means not available.
3688 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003689
Rafal Slawikbf67d072018-10-23 11:07:54 +01003690 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003691 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003692 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003693
Rafal Slawikbf67d072018-10-23 11:07:54 +01003694 // # of page-faults
3695 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003696
Rafal Slawikbf67d072018-10-23 11:07:54 +01003697 // # of major page-faults
3698 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003699
Rafal Slawikbf67d072018-10-23 11:07:54 +01003700 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003701 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003702 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003703
Rafal Slawikd03ae422018-11-20 11:27:45 +00003704 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003705 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003706
3707 // Elapsed real time when the process started.
3708 // Value is read from /proc/PID/stat, field 22.
3709 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01003710}
3711
3712/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003713 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003714 *
3715 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3716 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003717 *
3718 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003719 */
3720message ProcessMemoryHighWaterMark {
3721 // The uid if available. -1 means not available.
3722 optional int32 uid = 1 [(is_uid) = true];
3723
Rafal Slawikda51b932018-12-13 16:31:33 +00003724 // The process name.
3725 // Usually package name or process cmdline.
3726 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003727 optional string process_name = 2;
3728
3729 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3730 // /proc/PID/status.
3731 optional int64 rss_high_water_mark_in_bytes = 3;
3732}
3733
3734/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003735 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003736 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003737message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003738 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003739}
3740
3741/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003742 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003743 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003744message SystemUptime {
3745 // Milliseconds since the system was booted.
3746 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3747 // for external input).
3748 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003749 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003750}
3751
3752/*
3753 * Reads from /proc/uid_concurrent_active_time which has the format:
3754 * active: X (X is # cores)
3755 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3756 * [uid1]: [time-0] [time-1] [time-2] ... ...
3757 * ...
3758 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3759 * The file contains a monotonically increasing count of time for a single boot.
3760 */
3761message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003762 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003763 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003764}
3765
3766/**
3767 * Reads from /proc/uid_concurrent_policy_time which has the format:
3768 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3769 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3770 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3771 * ...
3772 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3773 * The file contains a monotonically increasing count of time for a single boot.
3774 */
3775message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003776 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003777 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003778 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003779}
3780
3781/*
3782 * Pulls free disk space, for data, system partition and temporary directory.
3783 */
3784message DiskSpace {
3785 // available bytes in data partition
3786 optional uint64 data_available_bytes = 1;
3787 // available bytes in system partition
3788 optional uint64 system_available_bytes = 2;
3789 // available bytes in download cache or temp directories
3790 optional uint64 temp_available_bytes = 3;
3791}
Tej Singhbf972d92018-01-10 20:51:13 -08003792
3793/**
3794 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003795 *
3796 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003797 */
3798message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003799 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003800}
3801
3802/**
3803 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003804 * Pulled from:
3805 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003806 */
3807message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003808 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003809}
3810
3811/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003812 * Pulls battery voltage.
3813 * Pulled from:
3814 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3815 */
3816message BatteryVoltage {
3817 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003818 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003819}
3820
3821/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003822 * Pulls battery level (percent full, from 0 to 100).
3823 *
3824 * Pulled from:
3825 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3826 */
3827message BatteryLevel {
3828 // Battery level. Should be in [0, 100].
3829 optional int32 battery_level = 1;
3830}
3831
3832/**
Tej Singhd89137e2018-03-26 14:51:40 -07003833 * Pulls the temperature of various parts of the device.
3834 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003835 *
3836 * Pulled from:
3837 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3838 */
3839message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003840 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003841 optional android.os.TemperatureTypeEnum sensor_location = 1;
3842
3843 // The name of the temperature source. Eg. CPU0
3844 optional string sensor_name = 2;
3845
Tej Singhd89137e2018-03-26 14:51:40 -07003846 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003847 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003848 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003849}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003850
3851/**
3852 * Pulls the statistics of calls to Binder.
3853 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003854 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3855 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003856 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003857 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003858 */
3859message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003860 // UID of the process responsible for the binder transaction. It will be set if the process
3861 // executing the binder transaction attribute the transaction to another uid using
3862 // Binder.setThreadWorkSource().
3863 //
3864 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003865 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003866 // UID of the process executing the binder transaction.
3867 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003868 // Fully qualified class name of the API call.
3869 //
3870 // This is a system server class name.
3871 //
3872 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3873 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3874 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3875 // commonly used APIs.
3876 optional string service_class_name = 2;
3877 // Method name of the API call. It can also be a transaction code if we cannot
3878 // resolve it to a name. See Binder#getTransactionName.
3879 //
3880 // This is a system server method name.
3881 optional string service_method_name = 3;
3882 // Total number of API calls.
3883 optional int64 call_count = 4;
3884 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3885 optional bool screen_interactive = 13;
3886 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3887 // call_count will be equal to recorded_call_count.
3888 //
3889 // If recorded_call_count is different than call_count, it means data collection has been
3890 // sampled. All the fields below will be sampled in this case.
3891 optional int64 recorded_call_count = 12;
3892 // Number of exceptions thrown by the API.
3893 optional int64 recorded_exception_count = 5;
3894 // Total latency of all API calls.
3895 // Average can be computed using total_latency_micros / recorded_call_count.
3896 optional int64 recorded_total_latency_micros = 6;
3897 // Maximum latency of one API call.
3898 optional int64 recorded_max_latency_micros = 7;
3899 // Total CPU usage of all API calls.
3900 // Average can be computed using total_cpu_micros / recorded_call_count.
3901 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3902 optional int64 recorded_total_cpu_micros = 8;
3903 // Maximum CPU usage of one API call.
3904 optional int64 recorded_max_cpu_micros = 9;
3905 // Maximum parcel reply size of one API call.
3906 optional int64 recorded_max_reply_size_bytes = 10;
3907 // Maximum parcel request size of one API call.
3908 optional int64 recorded_max_request_size_bytes = 11;
3909}
3910
3911/**
3912 * Pulls the statistics of exceptions during calls to Binder.
3913 *
3914 * Binder stats are cumulative from boot unless somebody reset the data using
3915 * > adb shell dumpsys binder_calls_stats --reset
3916 */
3917message BinderCallsExceptions {
3918 // Exception class name, e.g. java.lang.IllegalArgumentException.
3919 //
3920 // This is an exception class name thrown by the system server.
3921 optional string exception_class_name = 1;
3922 // Total number of exceptions.
3923 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003924}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003925
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003926/**
3927 * Pulls the statistics of message dispatching on HandlerThreads.
3928 *
3929 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
3930 * config on the device.
3931 *
3932 * Next tag: 11
3933 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003934message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01003935 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003936 optional int32 uid = 1 [(is_uid) = true];
3937
3938 // Fully qualified class name of the handler target class.
3939 //
3940 // This field does not contain PII. This is a system server class name.
3941 optional string handler_class_name = 2;
3942
3943 // The name of the thread that runs the Looper.
3944 //
3945 // This field does not contain PII. This is a system server thread name.
3946 optional string looper_thread_name = 3;
3947
3948 // The name of the dispatched message.
3949 //
3950 // This field does not contain PII. This is a system server constant or class
3951 // name.
3952 optional string message_name = 4;
3953
3954 // Total number of successfully dispatched messages.
3955 optional int64 message_count = 5;
3956
3957 // Total number of messages that failed dispatching.
3958 optional int64 exception_count = 6;
3959
3960 // Total number of processed messages we have data recorded for. If we
3961 // collected data for all the messages, message_count will be equal to
3962 // recorded_message_count.
3963 //
3964 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003965 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003966 optional int64 recorded_message_count = 7;
3967
3968 // Total latency of all processed messages.
3969 // Average can be computed using recorded_total_latency_micros /
3970 // recorded_message_count.
3971 optional int64 recorded_total_latency_micros = 8;
3972
3973 // Total CPU usage of all processed message.
3974 // Average can be computed using recorded_total_cpu_micros /
3975 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003976 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003977 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003978
3979 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3980 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003981
3982 // Max recorded CPU usage of all processed messages.
3983 optional int64 recorded_max_cpu_micros = 11;
3984
3985 // Max recorded latency of all processed messages.
3986 optional int64 recorded_max_latency_micros = 12;
3987
3988 // Total number of messages we tracked the dispatching delay for. If we
3989 // collected data for all the messages, message_count will be equal to
3990 // recorded_delay_message_count.
3991 //
3992 // If recorded_delay_message_count is different than message_count, it means data
3993 // collection has been sampled or/and not all messages specified the target dispatch time.
3994 // The fields below will be sampled in this case.
3995 optional int64 recorded_delay_message_count = 13;
3996
3997 // Total dispatching delay of all processed messages.
3998 // Calculated as a difference between the target dispatching time (Message.when)
3999 // and the actual dispatching time.
4000 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4001 optional int64 recorded_total_delay_millis = 14;
4002
4003 // Max dispatching delay of all processed messages.
4004 // Calculated as a difference between the target dispatching time (Message.when)
4005 // and the actual dispatching time.
4006 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004007}
Tej Singh86dc9db2018-09-06 00:39:57 +00004008
4009/**
4010 * Pulls disk information, such as write speed and latency.
4011 */
4012message DiskStats {
4013 // Time taken to open, write 512B to, and close a file.
4014 // -1 if error performing the check.
4015 optional int64 data_write_latency_millis = 1;
4016
4017 optional bool file_based_encryption = 2;
4018
4019 // Recent disk write speed in kB/s.
4020 // -1 if error querying storageed.
4021 // 0 if data is unavailable.
4022 optional int32 recent_disk_write_speed = 3;
4023}
4024
4025
4026/**
4027 * Free and total bytes of the Data, Cache, and System partition.
4028 */
4029message DirectoryUsage {
4030 enum Directory {
4031 UNKNOWN = 0;
4032 DATA = 1;
4033 CACHE = 2;
4034 SYSTEM = 3;
4035 }
4036 optional Directory directory = 1;
4037 optional int64 free_bytes = 2;
4038 optional int64 total_bytes = 3;
4039}
4040
4041
4042/**
4043 * Size of an application: apk size, data size, and cache size.
4044 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4045 * Information is only reported for apps with the primary user (user 0).
4046 * Sizes are aggregated by package name.
4047 */
4048message AppSize {
4049 // Including uids will involve modifying diskstats logic.
4050 optional string package_name = 1;
4051 // App size in bytes. -1 if unavailable.
4052 optional int64 app_size_bytes = 2;
4053 // App data size in bytes. -1 if unavailable.
4054 optional int64 app_data_size_bytes = 3;
4055 // App cache size in bytes. -1 if unavailable.
4056 optional int64 app_cache_size_bytes = 4;
4057 // Time that the cache file was produced.
4058 // Uses System.currentTimeMillis(), which is wall clock time.
4059 optional int64 cache_time_millis = 5;
4060}
4061
4062
4063/**
4064 * Size of a particular category. Eg: photos, videos.
4065 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4066 */
4067message CategorySize {
4068 enum Category {
4069 UNKNOWN = 0;
4070 APP_SIZE = 1;
4071 APP_DATA_SIZE = 2;
4072 APP_CACHE_SIZE = 3;
4073 PHOTOS = 4;
4074 VIDEOS = 5;
4075 AUDIO = 6;
4076 DOWNLOADS = 7;
4077 SYSTEM = 8;
4078 OTHER = 9;
4079 }
4080 optional Category category = 1;
4081 // Category size in bytes.
4082 optional int64 size_bytes = 2;
4083 // Time that the cache file was produced.
4084 // Uses System.currentTimeMillis(), which is wall clock time.
4085 optional int64 cache_time_millis = 3;
4086}
Tej Singhd6d6d772018-09-05 17:41:25 -07004087
4088/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004089 * Pulls per uid I/O stats. The stats are cumulative since boot.
4090 *
4091 * Read/write bytes are I/O events from a storage device
4092 * Read/write chars are data requested by read/write syscalls, and can be
4093 * satisfied by caching.
4094 *
4095 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4096 */
4097message DiskIo {
4098 optional int32 uid = 1 [(is_uid) = true];
4099 optional int64 fg_chars_read = 2;
4100 optional int64 fg_chars_write = 3;
4101 optional int64 fg_bytes_read = 4;
4102 optional int64 fg_bytes_write = 5;
4103 optional int64 bg_chars_read = 6;
4104 optional int64 bg_chars_write = 7;
4105 optional int64 bg_bytes_read = 8;
4106 optional int64 bg_bytes_write = 9;
4107 optional int64 fg_fsync = 10;
4108 optional int64 bg_fsync= 11;
4109}
4110
4111
4112/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004113 * Pulls the number of fingerprints for each user.
4114 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004115 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004116 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004117message NumBiometricsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004118 // The associated user. Eg: 0 for owners, 10+ for others.
4119 // Defined in android/os/UserHandle.java
4120 optional int32 user = 1;
4121 // Number of fingerprints registered to that user.
Kevin Chyn1741a072019-01-17 11:54:40 -08004122 optional int32 num_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004123}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004124
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004125/**
4126 * A mapping of role holder -> role
4127 */
4128message RoleHolder {
4129 // uid of the role holder
4130 optional int32 uid = 1 [(is_uid) = true];
4131
4132 // package name of the role holder
4133 optional string package_name = 2;
4134
4135 // the role held
4136 optional string role = 3;
4137}
4138
Yangsteraf9aee72018-10-12 09:26:16 -07004139message AggStats {
4140 optional int64 min = 1;
4141
4142 optional int64 average = 2;
4143
4144 optional int64 max = 3;
4145}
4146
4147message ProcessStatsStateProto {
4148 optional android.service.procstats.ScreenState screen_state = 1;
4149
4150 optional android.service.procstats.MemoryState memory_state = 2;
4151
4152 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4153 // and not frameworks/base/core/java/android/app/ActivityManager.java
4154 optional android.service.procstats.ProcessState process_state = 3;
4155
4156 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004157 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004158
4159 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004160 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004161
4162 // # of samples taken
4163 optional int32 sample_size = 5;
4164
4165 // PSS is memory reserved for this process
4166 optional AggStats pss = 6;
4167
4168 // USS is memory shared between processes, divided evenly for accounting
4169 optional AggStats uss = 7;
4170
4171 // RSS is memory resident for this process
4172 optional AggStats rss = 8;
4173}
4174
4175// Next Tag: 7
4176message ProcessStatsProto {
4177 // Name of process.
4178 optional string process = 1;
4179
4180 // Uid of the process.
4181 optional int32 uid = 2;
4182
4183 // Information about how often kills occurred
4184 message Kill {
4185 // Count of excessive CPU kills
4186 optional int32 cpu = 1;
4187
4188 // Count of kills when cached
4189 optional int32 cached = 2;
4190
4191 // PSS stats during cached kill
4192 optional AggStats cached_pss = 3;
4193 }
4194 optional Kill kill = 3;
4195
4196 // Time and memory spent in various states.
4197 repeated ProcessStatsStateProto states = 5;
4198
4199 // Total time process has been running... screen_state, memory_state, and process_state
4200 // will not be set.
4201 optional ProcessStatsStateProto total_running_state = 6;
4202}
4203
4204message PackageServiceOperationStatsProto {
4205 // Operate enum: Started, Foreground, Bound, Executing
4206 optional android.service.procstats.ServiceOperationState operation = 1;
4207
4208 // Number of times the service was in this operation.
4209 optional int32 count = 2;
4210
4211 // Information about a state the service can be in.
4212 message StateStats {
4213 // Screen state enum.
4214 optional android.service.procstats.ScreenState screen_state = 1;
4215 // Memory state enum.
4216 optional android.service.procstats.MemoryState memory_state = 2;
4217
4218 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004219 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004220 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004221 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004222 }
4223 repeated StateStats state_stats = 3;
4224}
4225
4226message PackageServiceStatsProto {
4227 // Name of service component.
4228 optional string service_name = 1;
4229
4230 // The operation stats.
4231 // The package_name, package_uid, package_version, service_name will not be set to save space.
4232 repeated PackageServiceOperationStatsProto operation_stats = 2;
4233}
4234
4235message PackageAssociationSourceProcessStatsProto {
4236 // Uid of the process.
4237 optional int32 process_uid = 1;
4238 // Process name.
4239 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004240 // Package name.
4241 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004242 // Total count of the times this association appeared.
4243 optional int32 total_count = 3;
4244
4245 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004246 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004247
4248 // Total count of the times this association became actively impacting its target process.
4249 optional int32 active_count = 5;
4250
4251 // Information on one source in this association.
4252 message StateStats {
4253 // Process state enum.
4254 optional android.service.procstats.ProcessState process_state = 1;
4255 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004256 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004257 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004258 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004259 }
4260 repeated StateStats active_state_stats = 6;
4261}
4262
4263message PackageAssociationProcessStatsProto {
4264 // Name of the target component.
4265 optional string component_name = 1;
4266 // Information on one source in this association.
4267 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4268}
4269
4270
4271message ProcessStatsPackageProto {
4272 // Name of package.
4273 optional string package = 1;
4274
4275 // Uid of the package.
4276 optional int32 uid = 2;
4277
4278 // Version of the package.
4279 optional int64 version = 3;
4280
4281 // Stats for each process running with the package loaded in to it.
4282 repeated ProcessStatsProto process_stats = 4;
4283
4284 // Stats for each of the package's services.
4285 repeated PackageServiceStatsProto service_stats = 5;
4286
4287 // Stats for each association with the package.
4288 repeated PackageAssociationProcessStatsProto association_stats = 6;
4289}
4290
4291message ProcessStatsSectionProto {
4292 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004293 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004294
4295 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004296 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004297
4298 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004299 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004300
4301 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004302 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004303
4304 // System runtime library. e.g. "libdvm.so", "libart.so".
4305 optional string runtime = 5;
4306
4307 // whether kernel reports swapped pss.
4308 optional bool has_swapped_pss = 6;
4309
4310 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4311 enum Status {
4312 STATUS_UNKNOWN = 0;
4313 STATUS_COMPLETE = 1;
4314 STATUS_PARTIAL = 2;
4315 STATUS_SHUTDOWN = 3;
4316 STATUS_SYSPROPS = 4;
4317 }
4318 repeated Status status = 7;
4319
Chenjie Yub2ecc792019-01-17 10:27:26 -08004320 // Number of pages available of various types and sizes, representation fragmentation.
4321 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4322
Yangsteraf9aee72018-10-12 09:26:16 -07004323 // Stats for each process.
4324 repeated ProcessStatsProto process_stats = 8;
4325
4326 // Stats for each package.
4327 repeated ProcessStatsPackageProto package_stats = 9;
4328}
4329
Chenjie Yub2ecc792019-01-17 10:27:26 -08004330message ProcessStatsAvailablePagesProto {
4331 // Node these pages are in (as per /proc/pagetypeinfo)
4332 optional int32 node = 1;
4333
4334 // Zone these pages are in (as per /proc/pagetypeinfo)
4335 optional string zone = 2;
4336
4337 // Label for the type of these pages (as per /proc/pagetypeinfo)
4338 optional string label = 3;
4339
4340 // Distribution of number of pages available by order size. First entry in array is
4341 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4342 repeated int32 pages_per_order = 4;
4343}
4344
Chenjie Yu12e5e672018-09-14 15:54:59 -07004345/**
4346 * Pulled from ProcessStatsService.java
4347 */
4348message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004349 optional ProcessStatsSectionProto proc_stats_section = 1;
4350}
4351
Chenjie Yuf910b7802019-01-11 16:08:20 -08004352/**
4353 * Pulled from ProcessStatsService.java
4354 */
4355message ProcStatsPkgProc {
4356 optional ProcessStatsSectionProto proc_stats_section = 1;
4357}
4358
Yangsteraf9aee72018-10-12 09:26:16 -07004359message PowerProfileProto {
4360 optional double cpu_suspend = 1;
4361
4362 optional double cpu_idle = 2;
4363
4364 optional double cpu_active = 3;
4365
4366 message CpuCluster {
4367 optional int32 id = 1;
4368 optional double cluster_power = 2;
4369 optional int32 cores = 3;
4370 repeated int64 speed = 4;
4371 repeated double core_power = 5;
4372 }
4373
4374 repeated CpuCluster cpu_cluster = 40;
4375
4376 optional double wifi_scan = 4;
4377
4378 optional double wifi_on = 5;
4379
4380 optional double wifi_active = 6;
4381
4382 optional double wifi_controller_idle = 7;
4383
4384 optional double wifi_controller_rx = 8;
4385
4386 optional double wifi_controller_tx = 9;
4387
4388 repeated double wifi_controller_tx_levels = 10;
4389
4390 optional double wifi_controller_operating_voltage = 11;
4391
4392 optional double bluetooth_controller_idle = 12;
4393
4394 optional double bluetooth_controller_rx = 13;
4395
4396 optional double bluetooth_controller_tx = 14;
4397
4398 optional double bluetooth_controller_operating_voltage = 15;
4399
4400 optional double modem_controller_sleep = 16;
4401
4402 optional double modem_controller_idle = 17;
4403
4404 optional double modem_controller_rx = 18;
4405
4406 repeated double modem_controller_tx = 19;
4407
4408 optional double modem_controller_operating_voltage = 20;
4409
4410 optional double gps_on = 21;
4411
4412 repeated double gps_signal_quality_based = 22;
4413
4414 optional double gps_operating_voltage = 23;
4415
4416 optional double bluetooth_on = 24;
4417
4418 optional double bluetooth_active = 25;
4419
4420 optional double bluetooth_at_cmd = 26;
4421
4422 optional double ambient_display = 27;
4423
4424 optional double screen_on = 28;
4425
4426 optional double radio_on = 29;
4427
4428 optional double radio_scanning = 30;
4429
4430 optional double radio_active = 31;
4431
4432 optional double screen_full = 32;
4433
4434 optional double audio = 33;
4435
4436 optional double video = 34;
4437
4438 optional double flashlight = 35;
4439
4440 optional double memory = 36;
4441
4442 optional double camera = 37;
4443
4444 optional double wifi_batched_scan = 38;
4445
4446 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004447}
Chenjie Yuab530202018-09-26 12:39:20 -07004448
4449/**
4450 * power_profile.xml and other constants for power model calculations.
4451 * Pulled from PowerProfile.java
4452 */
4453message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004454 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004455}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004456
4457/**
arangelovd5db50e2018-10-12 20:24:39 +01004458 * Logs when a user restriction was added or removed.
4459 *
4460 * Logged from:
4461 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4462 */
4463message UserRestrictionChanged {
4464 // The raw string of the user restriction as defined in UserManager.
4465 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4466 optional string restriction = 1;
4467 // Whether the restriction is enabled or disabled.
4468 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004469}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004470
4471/**
4472 * Pulls process user time and system time. Puller takes a snapshot of all pids
4473 * in the system and returns cpu stats for those that are working at the time.
4474 * Dead pids will be dropped. Kernel processes are excluded.
4475 * Min cool-down is 5 sec.
4476 */
4477message ProcessCpuTime {
4478 optional int32 uid = 1 [(is_uid) = true];
4479
4480 optional string process_name = 2;
4481 // Process cpu time in user space, cumulative from boot/process start
4482 optional int64 user_time_millis = 3;
4483 // Process cpu time in system space, cumulative from boot/process start
4484 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004485}
Misha Wagner5a51e002018-10-03 15:04:09 +01004486
4487/**
4488 * Pulls the CPU usage for each thread.
4489 *
4490 * Read from /proc/$PID/task/$TID/time_in_state files.
4491 *
4492 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4493 * time_in_state files not being present on some phones, have not been addressed. These should be
4494 * considered before a public release.
4495 */
4496message CpuTimePerThreadFreq {
4497 // UID that owns the process.
4498 optional int32 uid = 1 [(is_uid) = true];
4499 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004500 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004501 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004502 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004503 // Name of the process taken from `/proc/$PID/cmdline`.
4504 optional string process_name = 4;
4505 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4506 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004507
4508 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4509 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4510 // frequencies are given here as the alternative is sending eight separate atoms. This method
4511 // significantly reduces the amount of data created
4512 optional int32 frequency1_khz = 6;
4513 optional int32 time1_millis = 7;
4514 optional int32 frequency2_khz = 8;
4515 optional int32 time2_millis = 9;
4516 optional int32 frequency3_khz = 10;
4517 optional int32 time3_millis = 11;
4518 optional int32 frequency4_khz = 12;
4519 optional int32 time4_millis = 13;
4520 optional int32 frequency5_khz = 14;
4521 optional int32 time5_millis = 15;
4522 optional int32 frequency6_khz = 16;
4523 optional int32 time6_millis = 17;
4524 optional int32 frequency7_khz = 18;
4525 optional int32 time7_millis = 19;
4526 optional int32 frequency8_khz = 20;
4527 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004528}
Bookatz75ee6042018-11-09 12:27:37 -08004529
4530/**
Bookatz366a4432018-11-20 09:42:33 -08004531 * Pulls information about the device's build.
4532 */
4533message BuildInformation {
4534 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4535 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4536 optional string fingerprint = 1;
4537
4538 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4539 optional string brand = 2;
4540
4541 // Build.PRODUCT. The name of the overall product.
4542 optional string product = 3;
4543
4544 // Build.DEVICE. The name of the industrial design.
4545 optional string device = 4;
4546
4547 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4548 optional string version_release = 5;
4549
4550 // Build.ID. E.g. a label like "M4-rc20".
4551 optional string id = 6;
4552
4553 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4554 // represent this build.
4555 optional string version_incremental = 7;
4556
4557 // Build.TYPE. The type of build, like "user" or "eng".
4558 optional string type = 8;
4559
4560 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4561 optional string tags = 9;
4562}
4563
4564/**
Bookatz75ee6042018-11-09 12:27:37 -08004565 * Pulls on-device BatteryStats power use calculations for the overall device.
4566 */
4567message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004568 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4569 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4570 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4571 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08004572}
4573
4574/**
4575 * Pulls on-device BatteryStats power use calculations broken down by uid.
4576 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4577 * that is attributed to non-uid items. They must all be included to get the total power use.
4578 */
4579message DeviceCalculatedPowerBlameUid {
4580 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4581 optional int32 uid = 1 [(is_uid) = true];
4582
Bookatz3dbc13a2018-12-21 12:16:51 -08004583 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4584 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4585 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08004586}
4587
4588/**
4589 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4590 * drain type.
4591 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4592 * is attributed uids. They must all be included to get the total power use.
4593 */
4594message DeviceCalculatedPowerBlameOther {
4595 // The type of item whose power use is being reported.
4596 enum DrainType {
4597 AMBIENT_DISPLAY = 0;
4598 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4599 BLUETOOTH = 2;
4600 CAMERA = 3;
4601 // Cell-standby
4602 CELL = 4;
4603 FLASHLIGHT = 5;
4604 IDLE = 6;
4605 MEMORY = 7;
4606 // Amount that total computed drain exceeded the drain estimated using the
4607 // battery level changes and capacity.
4608 OVERCOUNTED = 8;
4609 PHONE = 9;
4610 SCREEN = 10;
4611 // Amount that total computed drain was below the drain estimated using the
4612 // battery level changes and capacity.
4613 UNACCOUNTED = 11;
4614 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4615 WIFI = 13;
4616 }
4617 optional DrainType drain_type = 1;
4618
Bookatz3dbc13a2018-12-21 12:16:51 -08004619 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4620 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4621 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004622}
arangelov4e994062018-11-13 16:12:38 +00004623
4624/**
4625 * Logs device policy features.
4626 *
4627 * Logged from:
4628 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4629 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4630 */
4631message DevicePolicyEvent {
4632 // The event id - unique for each event.
4633 optional android.stats.devicepolicy.EventId event_id = 1;
4634 // The admin package name.
4635 optional string admin_package_name = 2;
4636 // A generic integer parameter.
4637 optional int32 integer_value = 3;
4638 // A generic boolean parameter.
4639 optional bool boolean_value = 4;
4640 // A parameter specifying a time period in milliseconds.
4641 optional uint64 time_period_millis = 5;
4642 // A parameter specifying a list of package names, bundle extras or string parameters.
4643 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4644}
shawnlinea5b66b2018-11-13 15:05:29 +08004645
4646/**
4647 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4648 *
4649 * Logged from:
4650 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4651 */
4652message DocsUILaunchReported {
4653 optional android.stats.docsui.LaunchAction launch_action = 1;
4654 optional bool has_initial_uri = 2;
4655 optional android.stats.docsui.MimeType mime_type = 3;
4656 optional android.stats.docsui.Root initial_root = 4;
4657}
4658
4659/**
4660 * Logs root/app visited event in file managers/picker. Call this when the user
4661 * taps on root/app in hamburger menu.
4662 *
4663 * Logged from:
4664 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4665 */
4666message DocsUIRootVisitedReported {
4667 optional android.stats.docsui.ContextScope scope = 1;
4668 optional android.stats.docsui.Root root = 2;
4669}
4670
4671/**
4672 * Logs file operation stats. Call this when a file operation has completed.
4673 *
4674 * Logged from:
4675 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4676 */
4677message DocsUIFileOperationReported {
4678 optional android.stats.docsui.Provider provider = 1;
4679 optional android.stats.docsui.FileOperation file_op = 2;
4680}
4681
4682/**
4683 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4684 * mode.
4685 *
4686 * Logged from:
4687 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4688 */
4689message DocsUIFileOperationCopyMoveModeReported {
4690 optional android.stats.docsui.FileOperation file_op = 1;
4691 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4692}
4693
4694
4695/**
4696 * Logs file sub operation stats. Call this when a file operation has failed.
4697 *
4698 * Logged from:
4699 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4700 */
4701message DocsUIFileOperationFailureReported {
4702 optional android.stats.docsui.Authority authority = 1;
4703 optional android.stats.docsui.SubFileOperation sub_op = 2;
4704}
4705
4706/**
4707* Logs the cancellation of a file operation. Call this when a job is canceled
4708*
4709* Logged from:
4710* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4711*/
4712message DocsUIFileOperationCanceledReported {
4713 optional android.stats.docsui.FileOperation file_op = 1;
4714}
4715
4716/**
4717 * Logs startup time in milliseconds.
4718 *
4719 * Logged from:
4720 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4721 */
4722message DocsUIStartupMsReported {
4723 optional int32 startup_millis = 1;
4724}
4725
4726/**
4727 * Logs the action that was started by user.
4728 *
4729 * Logged from:
4730 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4731 */
4732message DocsUIUserActionReported {
4733 optional android.stats.docsui.UserAction action = 1;
4734}
4735
4736/**
4737 * Logs the invalid type when invalid scoped access is requested.
4738 *
4739 * Logged from:
4740 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4741 */
4742message DocsUIInvalidScopedAccessRequestReported {
4743 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004744}
Ben Murdochbab399f2018-12-06 11:01:38 +00004745
4746/**
shawnlina75e82d2019-01-07 10:31:12 +08004747 * Logs the package name that launches docsui picker mode.
4748 *
4749 * Logged from:
4750 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4751 */
4752message DocsUIPickerLaunchedFromReported {
4753 optional string package_name = 1;
4754}
4755
4756/**
4757 * Logs the search type.
4758 *
4759 * Logged from:
4760 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4761 */
4762message DocsUISearchTypeReported {
4763 optional android.stats.docsui.SearchType search_type = 1;
4764}
4765
4766/**
4767 * Logs the search mode.
4768 *
4769 * Logged from:
4770 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4771 */
4772message DocsUISearchModeReported {
4773 optional android.stats.docsui.SearchMode search_mode = 1;
4774}
4775
4776/**
4777 * Logs the pick result information.
4778 *
4779 * Logged from:
4780 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4781 */
4782message DocsUIPickResultReported {
4783 optional int32 total_action_count = 1;
4784 optional int64 duration_millis = 2;
4785 optional int32 file_count= 3;
4786 optional bool is_searching = 4;
4787 optional android.stats.docsui.Root picked_from = 5;
4788 optional android.stats.docsui.MimeType mime_type = 6;
4789 optional int32 repeatedly_pick_times = 7;
4790}
4791
4792/**
Ben Murdochbab399f2018-12-06 11:01:38 +00004793 * Logs when an app's memory is compacted.
4794 *
4795 * Logged from:
4796 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4797 */
4798message AppCompacted {
4799 // The pid of the process being compacted.
4800 optional int32 pid = 1;
4801
4802 // The name of the process being compacted.
4803 optional string process_name = 2;
4804
4805 // The type of compaction.
4806 enum Action {
4807 UNKNOWN = 0;
4808 SOME = 1;
4809 FULL = 2;
4810 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004811 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00004812
4813 // Total RSS in kilobytes consumed by the process prior to compaction.
4814 optional int64 before_rss_total_kilobytes = 4;
4815
4816 // File RSS in kilobytes consumed by the process prior to compaction.
4817 optional int64 before_rss_file_kilobytes = 5;
4818
4819 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4820 optional int64 before_rss_anon_kilobytes = 6;
4821
4822 // Swap in kilobytes consumed by the process prior to compaction.
4823 optional int64 before_swap_kilobytes = 7;
4824
4825 // Total RSS in kilobytes consumed by the process after compaction.
4826 optional int64 after_rss_total_kilobytes = 8;
4827
4828 // File RSS in kilobytes consumed by the process after compaction.
4829 optional int64 after_rss_file_kilobytes = 9;
4830
4831 // Anonymous RSS in kilobytes consumed by the process after compaction.
4832 optional int64 after_rss_anon_kilobytes = 10;
4833
4834 // Swap in kilobytes consumed by the process after compaction.
4835 optional int64 after_swap_kilobytes = 11;
4836
4837 // The time taken to perform compaction in milliseconds.
4838 optional int64 time_to_compact_millis = 12;
4839
4840 // The last compaction action performed for this app.
4841 optional Action last_action = 13;
4842
Ben Murdoch01720b82018-12-19 18:03:44 +00004843 // The last time that compaction was attempted on this process in milliseconds
4844 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4845 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00004846
Ben Murdoch01720b82018-12-19 18:03:44 +00004847 // The oom_score_adj at the time of compaction.
4848 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00004849
4850 // The process state at the time of compaction.
4851 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00004852
4853 // Free ZRAM in kilobytes before compaction.
4854 optional int64 before_zram_free_kilobytes = 17;
4855
4856 // Free ZRAM in kilobytes after compaction.
4857 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00004858}
lifr157fc552018-12-12 16:38:04 +08004859
4860/**
4861 * Logs the latency period(in microseconds) and the return code of
4862 * the DNS(Domain Name System) lookups.
4863 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4864 * to get info(address or hostname) from DNS server(or DNS cache).
4865 * Logged from:
4866 * /system/netd/server/DnsProxyListener.cpp
4867 */
4868message NetworkDnsEventReported {
4869 // The types of the DNS lookups, as defined in
4870 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4871 enum EventType {
4872 EVENT_UNKNOWN = 0;
4873 EVENT_GETADDRINFO = 1;
4874 EVENT_GETHOSTBYNAME = 2;
4875 EVENT_GETHOSTBYADDR = 3;
4876 EVENT_RES_NSEND = 4;
4877 }
4878 optional EventType event_type = 1;
4879
4880 // The return value of the DNS resolver for each DNS lookups.
4881 //bionic/libc/include/netdb.h
4882 //system/netd/resolv/include/netd_resolv/resolv.h
4883 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08004884 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08004885 EAI_ADDRFAMILY = 1;
4886 EAI_AGAIN = 2;
4887 EAI_BADFLAGS = 3;
4888 EAI_FAIL = 4;
4889 EAI_FAMILY = 5;
4890 EAI_MEMORY = 6;
4891 EAI_NODATA = 7;
4892 EAI_NONAME = 8;
4893 EAI_SERVICE = 9;
4894 EAI_SOCKTYPE = 10;
4895 EAI_SYSTEM = 11;
4896 EAI_BADHINTS = 12;
4897 EAI_PROTOCOL = 13;
4898 EAI_OVERFLOW = 14;
4899 RESOLV_TIMEOUT = 255;
4900 EAI_MAX = 256;
4901 }
4902 optional ReturnCode return_code = 2;
4903
4904 // The latency period(in microseconds) it took for this DNS lookup to complete.
4905 optional int32 latency_micros = 3;
4906}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08004907
4908/**
4909 * Logs when a data stall event occurs.
4910 *
4911 * Log from:
4912 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4913 */
4914message DataStallEvent {
4915 // Data stall evaluation type.
4916 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4917 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
4918 optional int32 evaluation_type = 1;
4919 // See definition in data_stall_event.proto.
4920 optional com.android.server.connectivity.ProbeResult validation_result = 2;
4921 // See definition in data_stall_event.proto.
4922 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
4923 // See definition in data_stall_event.proto.
4924 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
4925 // See definition in data_stall_event.proto.
4926 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
4927 // See definition in data_stall_event.proto.
4928 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
4929}
Christian Brunschenf86039e2018-12-21 12:26:14 +00004930
4931/*
4932 * Logs when RescueParty resets some set of experiment flags.
4933 *
4934 * Logged from:
4935 * frameworks/base/services/core/java/com/android/server/RescueParty.java
4936 */
4937message RescuePartyResetReported {
4938 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
4939 optional int32 rescue_level = 1;
4940}
Mathew Inwoodb375be52019-01-04 11:36:25 +00004941
4942/**
4943 * Logs when signed config is received from an APK, and if that config was applied successfully.
4944 * Logged from:
4945 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
4946 */
4947message SignedConfigReported {
4948 enum Type {
4949 UNKNOWN_TYPE = 0;
4950 GLOBAL_SETTINGS = 1;
4951 }
4952 optional Type type = 1;
4953
4954 // The final status of the signed config received.
4955 enum Status {
4956 UNKNOWN_STATUS = 0;
4957 APPLIED = 1;
4958 BASE64_FAILURE_CONFIG = 2;
4959 BASE64_FAILURE_SIGNATURE = 3;
4960 SECURITY_EXCEPTION = 4;
4961 INVALID_CONFIG = 5;
4962 OLD_CONFIG = 6;
4963 SIGNATURE_CHECK_FAILED = 7;
4964 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00004965 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00004966 }
4967 optional Status status = 2;
4968
4969 // The version of the signed config processed.
4970 optional int32 version = 3;
4971
4972 // The package name that the config was extracted from.
4973 optional string from_package = 4;
4974
4975 enum Key {
4976 NO_KEY = 0;
4977 DEBUG = 1;
4978 PRODUCTION = 2;
4979 }
4980 // Which key was used to verify the config.
4981 optional Key verified_with = 5;
4982}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004983
4984/*
4985 * Logs GNSS Network-Initiated (NI) location events.
4986 *
4987 * Logged from:
4988 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4989 */
4990message GnssNiEventReported {
4991 // The type of GnssNiEvent.
4992 enum EventType {
4993 UNKNOWN = 0;
4994 NI_REQUEST = 1;
4995 NI_RESPONSE = 2;
4996 }
4997 optional EventType event_type = 1;
4998
4999 // An ID generated by HAL to associate NI notifications and UI responses.
5000 optional int32 notification_id = 2;
5001
5002 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005003 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005004
5005 // NI requires notification.
5006 optional bool need_notify = 4;
5007
5008 // NI requires verification.
5009 optional bool need_verify = 5;
5010
5011 // NI requires privacy override, no notification/minimal trace.
5012 optional bool privacy_override = 6;
5013
5014 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5015 // seconds.
5016 optional int32 timeout = 7;
5017
5018 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005019 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005020
5021 // String representing the requester of the network inititated location request.
5022 optional string requestor_id = 9;
5023
5024 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5025 // network initiated location request.
5026 optional string text = 10;
5027
5028 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005029 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005030
5031 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005032 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005033
5034 // True if SUPL ES is enabled.
5035 optional bool is_supl_es_enabled = 13;
5036
5037 // True if GNSS location is enabled.
5038 optional bool is_location_enabled = 14;
5039
5040 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005041 optional android.server.location.GnssUserResponseType user_response = 15;
5042}
5043
5044/**
5045 * Logs GNSS non-framework (NFW) location notification.
5046 *
5047 * Logged from:
5048 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5049 */
5050message GnssNfwNotificationReported {
5051 // Package name of the Android proxy application representing the non-framework entity that
5052 // requested location. Set to empty string if unknown.
5053 optional string proxy_app_package_name = 1;
5054
5055 // Protocol stack that initiated the non-framework location request.
5056 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5057
5058 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5059 // set to empty string. This field is opaque to the framework and used for logging purposes.
5060 optional string other_protocol_stack_name = 3;
5061
5062 // Source initiating/receiving the location information.
5063 optional android.server.location.NfwRequestor requestor = 4;
5064
5065 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5066 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5067 // and used for logging purposes.
5068 optional string requestor_id = 5;
5069
5070 // Indicates whether location information was provided for this request.
5071 optional android.server.location.NfwResponseType response_type = 6;
5072
5073 // True if the device is in user initiated emergency session.
5074 optional bool in_emergency_mode = 7;
5075
5076 // True if cached location is provided.
5077 optional bool is_cached_location = 8;
5078
5079 // True if proxy app permission mismatch between framework and GNSS HAL.
5080 optional bool is_permission_mismatched = 9;
5081}
5082
5083/**
5084 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5085 *
5086 * Logged from:
5087 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5088 */
5089message GnssConfigurationReported {
5090 // SUPL host name.
5091 optional string supl_host = 1;
5092
5093 // SUPL port number.
5094 optional int32 supl_port = 2;
5095
5096 // C2K host name.
5097 optional string c2k_host = 3;
5098
5099 // C2K port number.
5100 optional int32 c2k_port = 4;
5101
5102 // The SUPL version requested by Carrier.
5103 optional int32 supl_ver = 5;
5104
5105 // The SUPL mode.
5106 optional android.server.location.SuplMode supl_mode = 6;
5107
5108 // True if NI emergency SUPL restrictions is enabled.
5109 optional bool supl_es = 7;
5110
5111 // LTE Positioning Profile settings
5112 optional android.server.location.LppProfile lpp_profile = 8;
5113
5114 // Positioning protocol on A-Glonass system.
5115 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5116
5117 // True if emergency PDN is used. Otherwise, regular PDN is used.
5118 optional bool use_emergency_pdn_for_emergency_supl= 10;
5119
5120 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5121 optional android.server.location.GpsLock gps_lock = 11;
5122
5123 // Number of seconds to extend the emergency session duration post emergency call.
5124 optional int32 es_extension_sec = 12;
5125
5126 // The full list of package names of proxy Android applications representing the non-framework
5127 // location access entities (on/off the device) for which the framework user has granted
5128 // non-framework location access permission. The package names are concatenated in one string
5129 // with spaces as separators.
5130 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005131}
Jack Yu95b64f32018-12-13 18:26:11 +08005132
5133/**
5134 * Logs when a NFC device's error occurred.
5135 * Logged from:
5136 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5137 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5138 */
5139message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005140 enum Type {
5141 UNKNOWN = 0;
5142 CMD_TIMEOUT = 1;
5143 ERROR_NOTIFICATION = 2;
5144 AID_OVERFLOW = 3;
5145 }
5146 optional Type type = 1;
5147 // If it's nci cmd timeout, log the timeout command.
5148 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005149
Alex Salod7c3eef2019-01-25 14:43:27 -08005150 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005151}
5152
5153/**
5154 * Logs when a NFC device's state changed event
5155 * Logged from:
5156 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5157 */
5158message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005159 enum State {
5160 UNKNOWN = 0;
5161 OFF = 1;
5162 ON = 2;
5163 ON_LOCKED = 3; // Secure Nfc enabled.
5164 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5165 }
5166 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005167}
5168
5169/**
5170 * Logs when a NFC Beam Transaction occurred.
5171 * Logged from:
5172 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5173 */
5174message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005175 enum Operation {
5176 UNKNOWN = 0;
5177 SEND = 1;
5178 RECEIVE = 2;
5179 }
5180 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005181}
5182
5183/**
5184 * Logs when a NFC Card Emulation Transaction occurred.
5185 * Logged from:
5186 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5187 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5188 */
5189message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005190 enum Category {
5191 UNKNOWN = 0;
5192 HCE_PAYMENT = 1;
5193 HCE_OTHER = 2;
5194 OFFHOST = 3;
5195 }
5196 // Transaction belongs to HCE payment or HCE other category, or offhost.
5197 optional Category category = 1;
5198 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5199 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005200}
5201
5202/**
5203 * Logs when a NFC Tag event occurred.
5204 * Logged from:
5205 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5206 */
5207message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005208 enum Type {
5209 UNKNOWN = 0;
5210 URL = 1;
5211 BT_PAIRING = 2;
5212 PROVISION = 3;
5213 WIFI_CONNECT = 4;
5214 APP_LAUNCH = 5;
5215 OTHERS = 6;
5216 }
5217 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005218}
5219
5220/**
5221 * Logs when Hce transaction triggered
5222 * Logged from:
5223 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5224 */
5225message NfcHceTransactionOccurred {
5226 // The latency period(in microseconds) it took for the first HCE data
5227 // exchange.
5228 optional uint32 latency_micros = 1;
5229}
5230
5231/**
5232 * Logs when SecureElement state event changed
5233 * Logged from:
5234 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5235 */
5236message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005237 enum State {
5238 UNKNOWN = 0;
5239 INITIALIZED = 1;
5240 DISCONNECTED = 2;
5241 CONNECTED = 3;
5242 HALCRASH = 4;
5243 }
5244 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005245
Alex Salod7c3eef2019-01-25 14:43:27 -08005246 optional string state_change_reason = 2;
5247 // SIMx or eSEx.
5248 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005249}
5250
5251/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005252 * Information about a permission grant request
5253 */
5254message PermissionGrantRequestResultReported {
5255 // unique value identifying an API call. A API call might result in multiple of these atoms
5256 optional int64 request_id = 1;
5257
5258 // UID of package requesting the permission grant
5259 optional int32 requesting_uid = 2 [(is_uid) = true];
5260
5261 // Name of package requesting the permission grant
5262 optional string requesting_package_name = 3;
5263
5264 // The permission to be granted
5265 optional string permission_name = 4;
5266
5267 // If the permission was explicitly requested via the API or added by the system
5268 optional bool is_implicit = 5;
5269
5270 enum Result {
5271 UNDEFINED = 0;
5272 // permission request was ignored
5273 IGNORED = 1;
5274 // permission request was ignored because it was user fixed
5275 IGNORED_USER_FIXED = 2;
5276 // permission request was ignored because it was policy fixed
5277 IGNORED_POLICY_FIXED = 3;
5278 // permission was granted by user action
5279 USER_GRANTED = 4;
5280 // permission was automatically granted
5281 AUTO_GRANTED = 5;
5282 // permission was denied by user action
5283 USER_DENIED = 6;
5284 // permission was denied with prejudice by the user
5285 USER_DENIED_WITH_PREJUDICE = 7;
5286 // permission was automatically denied
5287 AUTO_DENIED = 8;
5288 }
5289 // The result of the permission grant
5290 optional Result result = 6;
5291}
5292
5293/**
Jack Yu95b64f32018-12-13 18:26:11 +08005294 * Logs when Omapi API used
5295 * Logged from:
5296 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5297 */
5298message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005299 enum Operation {
5300 UNKNOWN = 0;
5301 OPEN_CHANNEL = 1;
5302 }
5303 optional Operation operation = 1;
5304 // SIMx or eSEx.
5305 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005306
Alex Salod7c3eef2019-01-25 14:43:27 -08005307 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005308}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005309
5310/**
Alex Saloa060aee2019-01-21 14:36:41 -08005311 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5312 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005313 * Logged from:
5314 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5315 */
5316message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005317 optional int64 dispatch_latency_millis = 1;
5318}
5319
5320/**
5321 * Logs AttentionManagerService attention check result.
5322 *
5323 * Logged from:
5324 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5325 */
5326message AttentionManagerServiceResultReported {
5327 // See core/java/android/service/attention/AttentionService.java
5328 enum AttentionCheckResult {
5329 UNKNOWN = 20;
5330 ATTENTION_SUCCESS_ABSENT = 0;
5331 ATTENTION_SUCCESS_PRESENT = 1;
5332 ATTENTION_FAILURE_PREEMPTED = 2;
5333 ATTENTION_FAILURE_TIMED_OUT = 3;
5334 ATTENTION_FAILURE_UNKNOWN = 4;
5335 }
5336 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005337}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005338
5339/**
5340 * Logs when an adb connection changes state.
5341 *
5342 * Logged from:
5343 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5344 */
5345message AdbConnectionChanged {
5346 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5347 // previously selected for this system.
5348 optional int64 last_connection_time_millis = 1;
5349
5350 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5351 // to reconnect via adb without user interaction.
5352 optional int64 auth_window_millis = 2;
5353
5354 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5355 optional android.debug.AdbConnectionStateEnum state = 3;
5356
5357 // True if the 'always allow' option was selected for this system.
5358 optional bool always_allow = 4;
5359}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005360
5361/*
5362 * Logs the reported speech DSP status.
5363 *
5364 * Logged from:
5365 * Vendor audio implementation.
5366 */
5367message SpeechDspStatReported {
5368 // The total Speech DSP uptime in milliseconds.
5369 optional int32 total_uptime_millis = 1;
5370 // The total Speech DSP downtime in milliseconds.
5371 optional int32 total_downtime_millis = 2;
5372 optional int32 total_crash_count = 3;
5373 optional int32 total_recover_count = 4;
5374}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005375
5376/**
5377 * Logs USB connector contaminant status.
5378 *
5379 * Logged from: USB Service.
5380 */
5381message UsbContaminantReported {
5382 optional string id = 1;
5383 optional android.service.usb.ContaminantPresenceStatus status = 2;
5384}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005385
5386/**
5387 * This atom is for debugging purpose.
5388 */
5389message DebugElapsedClock {
5390 // Monotically increasing value for each pull.
5391 optional int64 pull_count = 1;
5392 // Time from System.elapsedRealtime.
5393 optional int64 elapsed_clock_millis = 2;
5394 // Time from System.elapsedRealtime.
5395 optional int64 same_elapsed_clock_millis = 3;
5396 // Diff between current elapsed time and elapsed time from previous pull.
5397 optional int64 elapsed_clock_diff_millis = 4;
5398
5399 enum Type {
5400 TYPE_UNKNOWN = 0;
5401 ALWAYS_PRESENT = 1;
5402 PRESENT_ON_ODD_PULLS = 2;
5403 }
5404 // Type of behavior for the pulled data.
5405 optional Type type = 5;
5406}
5407
5408/**
5409 * This atom is for debugging purpose.
5410 */
5411message DebugFailingElapsedClock {
5412 // Monotically increasing value for each pull.
5413 optional int64 pull_count = 1;
5414 // Time from System.elapsedRealtime.
5415 optional int64 elapsed_clock_millis = 2;
5416 // Time from System.elapsedRealtime.
5417 optional int64 same_elapsed_clock_millis = 3;
5418 // Diff between current elapsed time and elapsed time from previous pull.
5419 optional int64 elapsed_clock_diff_millis = 4;
5420}
Steven Wuacef6bb2019-01-23 14:21:17 -05005421
5422/** Logs System UI bubbles event changed.
5423 *
5424 * Logged from:
5425 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5426 */
5427message BubbleUIChanged {
5428
5429 // The app package that is posting the bubble.
5430 optional string package_name = 1;
5431
5432 // The notification channel that is posting the bubble.
5433 optional string notification_channel = 2;
5434
5435 // The notification id associated with the posted bubble.
5436 optional int32 notification_id = 3;
5437
5438 // The position of the bubble within the bubble stack.
5439 optional int32 position = 4;
5440
5441 // The total number of bubbles within the bubble stack.
5442 optional int32 total_number = 5;
5443
5444 // User interactions with the bubble.
5445 enum Action {
5446 UNKNOWN = 0;
5447 POSTED = 1;
5448 UPDATED = 2;
5449 EXPANDED = 3;
5450 COLLAPSED = 4;
5451 DISMISSED = 5;
5452 STACK_DISMISSED = 6;
5453 STACK_MOVED = 7;
5454 HEADER_GO_TO_APP = 8;
5455 HEADER_GO_TO_SETTINGS = 9;
5456 PERMISSION_OPT_IN = 10;
5457 PERMISSION_OPT_OUT = 11;
Alison Cichowlas0b38ec42019-02-15 15:54:33 +00005458 PERMISSION_IGNORED = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005459 SWIPE_LEFT = 13;
5460 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005461 STACK_EXPANDED = 15;
Steven Wuacef6bb2019-01-23 14:21:17 -05005462 }
5463 optional Action action = 6;
5464
5465 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5466 optional float normalized_x_position = 7;
5467 optional float normalized_y_position = 8;
5468}
Kweku Adams8845d012018-12-11 20:06:45 -08005469
5470/**
Steven Wu552f63f2019-02-05 13:41:36 -05005471 * Logs System UI bubbles developer errors.
5472 *
5473 * Logged from:
5474 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5475 */
5476message BubbleDeveloperErrorReported {
5477
5478 // The app package that is posting the bubble.
5479 optional string package_name = 1;
5480
5481 // Bubble developer error type enums.
5482 enum Error {
5483 UNKNOWN = 0;
5484 ACTIVITY_INFO_MISSING = 1;
5485 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5486 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5487 }
5488 optional Error error = 2 [default = UNKNOWN];
5489}
5490
5491/**
Kweku Adams8845d012018-12-11 20:06:45 -08005492 * Logs that a constraint for a scheduled job has changed.
5493 *
5494 * Logged from:
5495 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5496 */
5497message ScheduledJobConstraintChanged {
5498 repeated AttributionNode attribution_node = 1;
5499
5500 // Name of the job.
5501 optional string job_name = 2;
5502
5503 optional com.android.server.job.ConstraintEnum constraint = 3;
5504
5505 enum State {
5506 UNSATISFIED = 0;
5507 SATISFIED = 1;
5508 }
5509 optional State state = 4;
5510}
Alex Salod7c3eef2019-01-25 14:43:27 -08005511
5512/**
5513 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5514 * returns true.
5515 *
5516 * Logged from:
5517 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5518 */
5519message ScreenTimeoutExtensionReported {
5520 // Describes how many times in a row did the power manager reset the screen off timeout.
5521 optional uint32 consecutive_timeout_extended_count = 1;
5522}
Hui Yu885aca12019-01-10 17:11:34 -08005523
5524/*
5525* Logs number of milliseconds it takes to start a process.
5526* The definition of app process start time is from the app launch time to
5527* the time that Zygote finished forking the app process and loaded the
5528* application package's java classes.
5529
5530* This metric is different from AppStartOccurred which is for foreground
5531* activity only.
5532
5533* ProcessStartTime can report all processes (both foreground and background)
5534* start time.
5535*
5536* Logged from:
5537* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5538*/
5539message ProcessStartTime {
5540 // The uid of the ProcessRecord.
5541 optional int32 uid = 1 [(is_uid) = true];
5542
5543 // The process pid.
5544 optional int32 pid = 2;
5545
5546 // The process name.
5547 // Usually package name, "system" for system server.
5548 // Provided by ActivityManagerService.
5549 optional string process_name = 3;
5550
5551 enum StartType {
5552 UNKNOWN = 0;
5553 WARM = 1;
5554 HOT = 2;
5555 COLD = 3;
5556 }
5557
5558 // The start type.
5559 optional StartType type = 4;
5560
5561 // The elapsed realtime at the start of the process.
5562 optional int64 process_start_time_millis = 5;
5563
5564 // Number of milliseconds it takes to reach bind application.
5565 optional int32 bind_application_delay_millis = 6;
5566
5567 // Number of milliseconds it takes to finish start of the process.
5568 optional int32 process_start_delay_millis = 7;
5569
5570 // hostingType field in ProcessRecord, the component type such as "activity",
5571 // "service", "content provider", "broadcast" or other strings.
5572 optional string hosting_type = 8;
5573
5574 // hostingNameStr field in ProcessRecord. The component class name that runs
5575 // in this process.
5576 optional string hosting_name = 9;
5577}
5578
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005579/**
5580 * State of a dangerous permission requested by a package
5581 */
5582message DangerousPermissionState {
5583 // Name of the permission
5584 optional string permission_name = 1;
5585
5586 // Uid of the package
5587 optional int32 uid = 2 [(is_uid) = true];
5588
5589 // Package requesting the permission
5590 optional string package_name = 3;
5591
5592 // If the permission is granted to the uid
5593 optional bool is_granted = 4;
5594}
5595
Michael Groover4a0ca942019-01-24 17:41:25 -08005596/**
5597 * Logs when a package is denied access to a device identifier based on the new access requirements.
5598 *
5599 * Logged from:
5600 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
5601 */
5602message DeviceIdentifierAccessDenied {
5603 // The name of the package denied access to the requested device identifier.
5604 optional string package_name = 1;
5605
5606 // The name of the device identifier method the package attempted to invoke.
5607 optional string method_name = 2;
5608
5609 // True if the package is preinstalled.
5610 optional bool is_preinstalled = 3;
5611
5612 // True if the package is privileged.
5613 optional bool is_priv_app = 4;
5614}
Chenjie Yue13f44a2019-02-07 17:51:38 -08005615
5616/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08005617 * Pulls the ongoing mainline install train version code.
5618 * Pulled from StatsCompanionService
5619 */
5620message TrainInfo {
5621 optional int64 train_version_code = 1;
5622
5623 optional TrainExperimentIds train_experiment_id = 2;
5624}
joshmccloskey8c3322e2019-01-09 18:25:57 -08005625
5626/**
5627 * Logs the gesture stage changed event.
5628 *
5629 * Logged from:
5630 * frameworks/base/packages/SystemUI/
5631 */
5632message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005633 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005634}
5635
5636/**
5637 * Logs the feedback type.
5638 *
5639 * Logged from:
5640 * frameworks/base/packages/SystemUI/
5641 */
5642message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005643 // Whether or not the gesture was used.
5644 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005645}
5646
5647/**
5648 * Logs the progress.
5649 *
5650 * Logged from:
5651 * frameworks/base/packages/SystemUI/
5652 */
5653message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005654 // [0,100] progress for the assist gesture.
5655 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005656}
Neil Fullerdb14b482019-02-05 19:44:44 +00005657
5658/*
5659 * Information about the time zone data on a device.
5660 */
5661message TimeZoneDataInfo {
5662 // A version identifier for the data set on device. e.g. "2018i"
5663 optional string tzdb_version = 1;
5664}