blob: 2632294d92328ce9dee0d165686ad19f5a0e7c6f [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;
Yao Chend54f9dd2017-10-17 17:37:48 +0000248 }
David Chenc8a43242017-10-17 16:23:28 -0700249
David Chen6e3e6cb2018-01-03 16:14:06 -0800250 // Pulled events will start at field 10000.
Olivier Gaillard18d452202019-01-22 15:03:41 +0000251 // Next: 10048
David Chenc8a43242017-10-17 16:23:28 -0700252 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800253 WifiBytesTransfer wifi_bytes_transfer = 10000;
254 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
255 MobileBytesTransfer mobile_bytes_transfer = 10002;
256 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800257 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800258 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800259 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800260 CpuTimePerFreq cpu_time_per_freq = 10008;
261 CpuTimePerUid cpu_time_per_uid = 10009;
262 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800263 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800264 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800265 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800266 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800267 SystemElapsedRealtime system_elapsed_realtime = 10014;
268 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800269 CpuActiveTime cpu_active_time = 10016;
270 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000271 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800272 RemainingBatteryCapacity remaining_battery_capacity = 10019;
273 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800274 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100275 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100276 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100277 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000278 DiskStats disk_stats = 10025;
279 DirectoryUsage directory_usage = 10026;
280 AppSize app_size = 10027;
281 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700282 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700283 BatteryVoltage battery_voltage = 10030;
Kevin Chyn1741a072019-01-17 11:54:40 -0800284 NumBiometricsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700285 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700286 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800287 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700288 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100289 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100290 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700291 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800292 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
293 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
294 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000295 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800296 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800297 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800298 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000299 DebugElapsedClock debug_elapsed_clock = 10046;
300 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
Kevin Chyn1741a072019-01-17 11:54:40 -0800301 NumBiometricsEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800302 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800303 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800304 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000305 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +0000306 SDCardInfo sdcard_info = 10053;
David Chenc8a43242017-10-17 16:23:28 -0700307 }
yroa1fe77c2018-02-26 14:22:54 -0800308
Bookatz76aafcf2018-09-17 16:17:10 -0700309 // DO NOT USE field numbers above 100,000 in AOSP.
310 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
311 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700312}
313
Yao Chend54f9dd2017-10-17 17:37:48 +0000314/**
Yangster-mac20877162017-12-22 17:19:39 -0800315 * This proto represents a node of an attribution chain.
316 * Note: All attribution chains are represented as a repeated field of type
317 * AttributionNode. It is understood that in such arrays, the order is that
318 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000319 */
Yangster-mac20877162017-12-22 17:19:39 -0800320message AttributionNode {
321 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800322 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800323
Yangster-mac20877162017-12-22 17:19:39 -0800324 // The (optional) string tag for an element in the attribution chain. If the
325 // element has no tag, it is encoded as an empty string.
326 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700327}
328
Yangster-mac48b3d622018-08-18 12:38:11 -0700329message KeyValuePair {
330 optional int32 key = 1;
331 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700332 int32 value_int = 2;
333 int64 value_long = 3;
334 string value_str = 4;
335 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700336 }
337}
338
339message KeyValuePairsAtom {
340 optional int32 uid = 1;
341 repeated KeyValuePair pairs = 2;
342}
343
Yao Chend54f9dd2017-10-17 17:37:48 +0000344/*
345 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800346 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000347 *
348 * RULES:
349 * - The field ids for each atom must start at 1, and count upwards by 1.
350 * Skipping field ids is not allowed.
351 * - These form an API, so renaming, renumbering or removing fields is
352 * not allowed between android releases. (This is not currently enforced,
353 * but there will be a tool to enforce this restriction).
354 * - The types must be built-in protocol buffer types, namely, no sub-messages
355 * are allowed (yet). The bytes type is also not allowed.
356 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800357 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000358 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800359 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000360 * - A field that is a uid should be a string field, tagged with the [xxx]
361 * annotation. The generated code on android will be represented by UIDs,
362 * and those UIDs will be translated in xxx to those strings.
363 *
364 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700365 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000366 * - If there is a UID, it goes first. Think in an object-oriented fashion.
367 * *****************************************************************************
368 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700369
Yao Chend54f9dd2017-10-17 17:37:48 +0000370/**
Yangster-mace16189a2018-08-26 12:20:16 -0700371 * Logs when the Thermal service HAL notifies the throttling start/stop events.
372 *
373 * Logged from:
374 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
375 */
376message ThermalThrottlingStateChanged {
377 optional android.os.TemperatureTypeEnum sensor_type = 1;
378
379 enum State {
380 UNKNOWN = 0;
381 START = 1;
382 STOP = 2;
383 }
384
385 optional State state = 2;
386
387 optional float temperature = 3;
388}
389
390/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000391 * Logs when the screen state changes.
392 *
393 * Logged from:
394 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
395 */
396message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800397 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700398 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700399}
Yao Chend54f9dd2017-10-17 17:37:48 +0000400
401/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700402 * Logs that the process state of the uid, as determined by ActivityManager
403 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000404 *
405 * Logged from:
406 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
407 */
Bookatzc1a050a2017-10-10 15:49:28 -0700408message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700409 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000410
Bookatzdb026a22018-01-10 19:01:56 -0800411 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700412 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000413}
414
415/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700416 * Logs process state change of a process, as per the activity manager.
417 *
418 * Logged from:
419 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
420 */
421message ProcessStateChanged {
422 optional int32 uid = 1;
423 optional string process_name = 2;
424 optional string package_name = 3;
425 // TODO: remove this when validation is done
426 optional int64 version = 5;
427 // The state, from frameworks/base/core/proto/android/app/enums.proto.
428 optional android.app.ProcessStateEnum state = 4;
429}
430
431/**
432 * Logs when ActivityManagerService sleep state is changed.
433 *
434 * Logged from:
435 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
436 */
437message ActivityManagerSleepStateChanged {
438 // TODO: import frameworks proto
439 enum State {
440 UNKNOWN = 0;
441 ASLEEP = 1;
442 AWAKE = 2;
443 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700444 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700445}
446
447/**
448 * Logs when system memory state changes.
449 *
450 * Logged from:
451 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
452 */
453message MemoryFactorStateChanged {
454 // TODO: import frameworks proto
455 enum State {
456 MEMORY_UNKNOWN = 0;
457 NORMAL = 1; // normal.
458 MODERATE = 2; // moderate memory pressure.
459 LOW = 3; // low memory.
460 CRITICAL = 4; // critical memory.
461
462 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700463 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700464}
465
466/**
467 * Logs when app is using too much cpu, according to ActivityManagerService.
468 *
469 * Logged from:
470 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
471 */
472message ExcessiveCpuUsageReported {
473 optional int32 uid = 1;
474 optional string process_name = 2;
475 optional string package_name = 3;
476 // package version. TODO: remove this when validation is done
477 optional int64 version = 4;
478}
479
480/**
481 * Logs when a cached process is killed, along with its pss.
482 *
483 * Logged from:
484 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
485 */
486message CachedKillReported {
487 optional int32 uid = 1;
488 optional string process_name = 2;
489 optional string package_name = 3;
490 // TODO: remove this when validation is done
491 optional int64 version = 5;
492 optional int64 pss = 4;
493}
494
495/**
496 * Logs when memory stats of a process is reported.
497 *
498 * Logged from:
499 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
500 */
501message ProcessMemoryStatReported {
502 optional int32 uid = 1;
503 optional string process_name = 2;
504 optional string package_name = 3;
505 //TODO: remove this when validation is done
506 optional int64 version = 9;
507 optional int64 pss = 4;
508 optional int64 uss = 5;
509 optional int64 rss = 6;
510 enum Type {
511 ADD_PSS_INTERNAL_SINGLE = 0;
512 ADD_PSS_INTERNAL_ALL_MEM = 1;
513 ADD_PSS_INTERNAL_ALL_POLL = 2;
514 ADD_PSS_EXTERNAL = 3;
515 ADD_PSS_EXTERNAL_SLOW = 4;
516 }
517 optional Type type = 7;
518 optional int64 duration = 8;
519}
520
521/**
Bookatzc1a050a2017-10-10 15:49:28 -0700522 * Logs that a process started, finished, crashed, or ANRed.
523 *
524 * Logged from:
525 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
526 */
527message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700528 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700529
David Chen0b5c90c2018-01-25 16:51:49 -0800530 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800531 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700532
Bookatzddccf0a2017-11-28 16:48:14 -0800533 // What lifecycle state the process changed to.
534 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800535 enum State {
536 FINISHED = 0;
537 STARTED = 1;
538 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800539 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800540 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700541}
542
Bookatzc1a050a2017-10-10 15:49:28 -0700543/**
544 * Logs when the ble scan state changes.
545 *
546 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700547 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700548 */
549message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800550 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700551
552 enum State {
553 OFF = 0;
554 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700555 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
556 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700557 }
558 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700559
Bookatze5ec0b42018-03-26 13:34:56 -0700560 // Does the scan have a filter.
561 optional bool is_filtered = 3;
562 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
563 optional bool is_first_match = 4;
564 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
565 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700566}
567
568/**
569 * Logs reporting of a ble scan finding results.
570 *
571 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700572 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700573 */
Bookatzae6738e2018-09-13 11:38:56 -0700574// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700575message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800576 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700577
578 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800579 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700580}
581
582/**
583 * Logs when a sensor state changes.
584 *
585 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700586 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700587 */
588message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800589 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700590
Bookatzc1a050a2017-10-10 15:49:28 -0700591 // The id (int) of the sensor.
592 optional int32 sensor_id = 2;
593
594 enum State {
595 OFF = 0;
596 ON = 1;
597 }
598 optional State state = 3;
599}
600
Bookatzc1a050a2017-10-10 15:49:28 -0700601/**
602 * Logs when GPS state changes.
603 *
604 * Logged from:
605 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
606 */
607message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800608 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700609
610 enum State {
611 OFF = 0;
612 ON = 1;
613 }
614 optional State state = 2;
615}
616
Bookatz48d362e2018-11-06 15:49:08 -0800617/**
618 * Logs when GPS signal quality.
619 *
620 * Logged from:
621 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
622 */
623message GpsSignalQualityChanged {
624 optional android.server.location.GpsSignalQualityEnum level = 1;
625}
626
Bookatzc1a050a2017-10-10 15:49:28 -0700627
628/**
629 * Logs when a sync manager sync state changes.
630 *
631 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700632 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700633 */
634message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800635 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700636
David Chen0b5c90c2018-01-25 16:51:49 -0800637 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800638 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700639
640 enum State {
641 OFF = 0;
642 ON = 1;
643 }
644 optional State state = 3;
645}
646
Yangster-mac96353002018-09-05 11:18:55 -0700647/*
648 * Deferred job stats.
649 *
650 * Logged from:
651 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
652*/
653message DeferredJobStatsReported {
654 repeated AttributionNode attribution_node = 1;
655
656 // Number of jobs deferred.
657 optional int32 num_jobs_deferred = 2;
658
659 // Time since the last job runs.
660 optional int64 time_since_last_job_millis = 3;
661}
662
Bookatzc1a050a2017-10-10 15:49:28 -0700663/**
664 * Logs when a job scheduler job state changes.
665 *
666 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700667 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700668 */
669message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800670 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700671
672 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800673 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700674
675 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800676 FINISHED = 0;
677 STARTED = 1;
678 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700679 }
680 optional State state = 3;
681
Tej Singh33a412b2018-03-16 18:43:59 -0700682 // The reason a job has stopped.
683 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700684 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700685 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700686}
687
688/**
689 * Logs when the audio state changes.
690 *
691 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700692 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700693 */
694message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800695 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700696
697 enum State {
698 OFF = 0;
699 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700700 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
701 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700702 }
703 optional State state = 2;
704}
705
706/**
707 * Logs when the video codec state changes.
708 *
709 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700710 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700711 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800712message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800713 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700714
715 enum State {
716 OFF = 0;
717 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700718 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
719 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700720 }
721 optional State state = 2;
722}
723
724/**
725 * Logs when the flashlight state changes.
726 *
727 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700728 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700729 */
730message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800731 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700732
733 enum State {
734 OFF = 0;
735 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700736 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
737 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700738 }
739 optional State state = 2;
740}
741
742/**
743 * Logs when the camera state changes.
744 *
745 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700746 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700747 */
748message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800749 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700750
751 enum State {
752 OFF = 0;
753 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700754 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
755 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700756 }
757 optional State state = 2;
758}
759
760/**
761 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000762 *
763 * Logged from:
764 * TODO
765 */
Bookatzd6746242017-10-24 18:39:35 -0700766message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800767 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000768
Bookatz1a1b0462018-01-12 11:47:03 -0800769 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
770 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700771 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700772
773 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
774 optional string tag = 3;
775
776 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800777 RELEASE = 0;
778 ACQUIRE = 1;
779 CHANGE_RELEASE = 2;
780 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700781 }
782 optional State state = 4;
783}
784
785/**
Bookatzc1a050a2017-10-10 15:49:28 -0700786 * Logs when a partial wakelock is considered 'long' (over 1 min).
787 *
788 * Logged from:
789 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
790 */
791message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800792 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700793
Yao Chend54f9dd2017-10-17 17:37:48 +0000794 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
795 optional string tag = 2;
796
Bookatzc1a050a2017-10-10 15:49:28 -0700797 // TODO: I have no idea what this is.
798 optional string history_tag = 3;
799
800 enum State {
801 OFF = 0;
802 ON = 1;
803 }
804 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000805}
806
Bookatzc1a050a2017-10-10 15:49:28 -0700807/**
Bookatza66083f2018-09-20 17:24:00 -0700808 * Logs when the device is interactive, according to the PowerManager Notifier.
809 *
810 * Logged from:
811 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
812 */
813message InteractiveStateChanged {
814 enum State {
815 OFF = 0;
816 ON = 1;
817 }
818 optional State state = 1;
819}
820
821/**
Bookatzc1a050a2017-10-10 15:49:28 -0700822 * Logs Battery Saver state change.
823 *
824 * Logged from:
825 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
826 */
827message BatterySaverModeStateChanged {
828 enum State {
829 OFF = 0;
830 ON = 1;
831 }
832 optional State state = 1;
833}
834
835/**
836 * Logs Doze mode state change.
837 *
838 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800839 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700840 */
841message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800842 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800843}
844
845
846/**
847 * Logs state change of Doze mode including maintenance windows.
848 *
849 * Logged from:
850 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
851 */
852message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800853 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700854}
855
856/**
857 * Logs screen brightness level.
858 *
859 * Logged from:
860 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
861 */
862message ScreenBrightnessChanged {
863 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
864 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700865}
866
867/**
868 * Logs battery level (percent full, from 0 to 100).
869 *
870 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700871 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700872 */
873message BatteryLevelChanged {
874 // Battery level. Should be in [0, 100].
875 optional int32 battery_level = 1;
876}
877
878/**
879 * Logs change in charging status of the device.
880 *
881 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700882 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700883 */
884message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800885 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
886 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700887}
888
889/**
890 * Logs whether the device is plugged in, and what power source it is using.
891 *
892 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700893 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700894 */
895message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800896 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
897 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700898}
899
Bookatz8c6571b2017-10-24 15:04:41 -0700900/**
901 * Logs when an app's wakeup alarm fires.
902 *
903 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700904 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700905 */
906message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800907 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800908
909 // Name of the wakeup alarm.
910 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700911
912 // Name of source package (for historical reasons, since BatteryStats tracked it).
913 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800914}
915
916/**
917 * Logs when an an app causes the mobile radio to change state.
918 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
919 *
920 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700921 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800922 */
923message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800924 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800925
Bookatz1a1b0462018-01-12 11:47:03 -0800926 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
927 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800928}
929
930/**
931 * Logs when an an app causes the wifi radio to change state.
932 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
933 *
934 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700935 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800936 */
937message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800938 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800939
Bookatz1a1b0462018-01-12 11:47:03 -0800940 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
941 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700942}
943
944/**
945 * Logs kernel wakeup reasons and aborts.
946 *
947 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700948 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700949 */
950message KernelWakeupReported {
951 // Name of the kernel wakeup reason (or abort).
952 optional string wakeup_reason_name = 1;
953
954 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800955 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700956}
957
958/**
Bookatzda1798c2018-12-13 14:16:00 -0800959 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800960 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800961 *
962 * Logged from:
963 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
964 */
965message WifiEnabledStateChanged {
966 enum State {
967 OFF = 0;
968 ON = 1;
969 }
970 optional State state = 1;
971}
972
973/**
974 * 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 -0800975 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
976 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800977 *
978 * Logged from:
979 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
980 */
981message WifiRunningStateChanged {
982 repeated AttributionNode attribution_node = 1;
983
984 enum State {
985 OFF = 0;
986 ON = 1;
987 }
988 optional State state = 2;
989}
990
991/**
Bookatze5885242017-10-24 20:10:31 -0700992 * Logs wifi locks held by an app.
993 *
994 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700995 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700996 */
997message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800998 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700999
1000 enum State {
1001 OFF = 0;
1002 ON = 1;
1003 }
1004 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001005
1006 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1007 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001008}
1009
1010/**
1011 * Logs wifi signal strength changes.
1012 *
1013 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001014 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001015 */
1016message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001017 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1018 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001019}
1020
1021/**
1022 * Logs wifi scans performed by an app.
1023 *
1024 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001025 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001026 */
1027message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001028 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001029
1030 enum State {
1031 OFF = 0;
1032 ON = 1;
1033 }
1034 optional State state = 2;
1035}
1036
1037/**
Tej Singh4503e102018-01-04 14:35:01 -08001038 * Logs wifi multicast locks held by an app
1039 *
1040 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001041 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001042 */
1043message WifiMulticastLockStateChanged {
1044 repeated AttributionNode attribution_node = 1;
1045
1046 enum State {
1047 OFF = 0;
1048 ON = 1;
1049 }
1050 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001051
1052 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001053}
1054
1055/**
Tej Singh1ea42892018-01-19 09:27:00 -08001056 * Logs shutdown reason and duration on next boot.
1057 *
1058 * Logged from:
1059 * frameworks/base/core/java/com/android/server/BootReceiver.java
1060 */
1061message ShutdownSequenceReported {
1062 // True if shutdown is for a reboot. Default: false if we do not know.
1063 optional bool reboot = 1;
1064
1065 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1066 optional string reason = 2;
1067
1068 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1069 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001070 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001071
1072 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001073 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001074}
1075
Tej Singh6483ea42018-01-25 17:45:49 -08001076
1077/**
1078 * Logs boot reason and duration.
1079 *
1080 * Logged from:
1081 * system/core/bootstat/bootstat.cpp
1082 */
1083message BootSequenceReported {
1084 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1085 // Default: "<EMPTY>" if not available.
1086 optional string bootloader_reason = 1;
1087
1088 // Reason for system boot. Eg. bootloader, reboot,userrequested
1089 // Default: "<EMPTY>" if not available.
1090 optional string system_reason = 2;
1091
1092 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001093 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001094
1095 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001096 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001097
1098 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001099 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001100
1101 // Time since last boot in ms. Default: 0 if not available.
1102 optional int64 time_since_last_boot = 6;
1103}
1104
Tej Singhc477d9c2018-02-05 18:31:39 -08001105
1106/**
1107 * Logs call state and disconnect cause (if applicable).
1108 *
1109 * Logged from:
1110 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1111 */
1112message CallStateChanged {
1113 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1114 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1115 optional android.telecom.CallStateEnum call_state = 1;
1116
1117 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1118 // This value is only applicable when the call_state is DISCONNECTED, and
1119 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1120 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1121 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1122
1123 // True if the call is self-managed, which are apps that use the
1124 // telecom infrastructure to make their own calls.
1125 optional bool self_managed = 3;
1126
1127 // True if call is external. External calls are calls on connected Wear
1128 // devices but show up in Telecom so the user can pull them onto the device.
1129 optional bool external_call = 4;
1130}
1131
Tej Singh1ea42892018-01-19 09:27:00 -08001132/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001133 * Logs keyguard state. The keyguard is the lock screen.
1134 *
1135 * Logged from:
1136 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1137 */
1138message KeyguardStateChanged {
1139 enum State {
1140 UNKNOWN = 0;
1141 // The keyguard is hidden when the phone is unlocked.
1142 HIDDEN = 1;
1143 // The keyguard is shown when the phone is locked (screen turns off).
1144 SHOWN= 2;
1145 // The keyguard is occluded when something is overlaying the keyguard.
1146 // Eg. Opening the camera while on the lock screen.
1147 OCCLUDED = 3;
1148 }
1149 optional State state = 1;
1150}
1151
1152/**
1153 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1154 * prompts the user to enter a password (pattern, pin, etc).
1155 *
1156 * Logged from:
1157 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1158 */
1159
1160message KeyguardBouncerStateChanged {
1161 enum State {
1162 UNKNOWN = 0;
1163 // Bouncer is hidden, either as a result of successfully entering the
1164 // password, screen timing out, or user going back to lock screen.
1165 HIDDEN = 1;
1166 // This is when the user is being prompted to enter the password.
1167 SHOWN = 2;
1168 }
1169 optional State state = 1;
1170}
1171
1172/**
1173 * Logs the result of entering a password into the keyguard bouncer.
1174 *
1175 * Logged from:
1176 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1177 */
1178message KeyguardBouncerPasswordEntered {
1179 enum BouncerResult {
1180 UNKNOWN = 0;
1181 // The password entered was incorrect.
1182 FAILURE = 1;
1183 // The password entered was correct.
1184 SUCCESS = 2;
1185 }
1186 optional BouncerResult result = 1;
1187}
1188
Tej Singha883b372018-02-15 11:30:01 -08001189/*
1190 * Logs changes to the configuration of the device. The configuration is defined
1191 * in frameworks/base/core/java/android/content/res/Configuration.java
1192 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1193 * Please go there to interpret the possible values each field can be.
1194 *
1195 * Logged from:
1196 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1197 */
1198message ResourceConfigurationChanged {
1199 // Bit mask of color capabilities of the screen.
1200 // Contains information about the color gamut and hdr mode of the screen.
1201 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001202 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001203
1204 // The target screen density being rendered to.
1205 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001206 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001207
1208 // Current user preference for the scaling factor for fonts,
1209 // relative to the base density scaling.
1210 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001211 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001212
1213 // Flag indicating whether the hard keyboard is hidden.
1214 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001215 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001216
1217 // The type of keyboard attached to the device.
1218 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1219 optional int32 keyboard = 5;
1220
1221 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1222 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001223 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001224
1225 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1226 // 0 if undefined.
1227 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1228 optional int32 mcc = 7;
1229
1230 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1231 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1232 // MNC_ZERO symbol defined in Configuration.java.
1233 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1234 optional int32 mnc = 8;
1235
1236 // The kind of navigation available on the device.
1237 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1238 optional int32 navigation = 9;
1239
1240 // Flag indicating whether the navigation is available.
1241 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001242 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001243
1244 // Overall orientation of the screen.
1245 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1246 optional int32 orientation = 11;
1247
1248 // The current height of the available screen space, in dp units.
1249 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001250 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001251
1252 // Bit mask of overall layout of the screen.
1253 // Contains information about screen size, whether the screen is wider/taller
1254 // than normal, whether the screen layout is right-tl-left or left-to-right,
1255 // and whether the screen has a rounded shape.
1256 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001257 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001258
1259 // Current width of the available screen space, in dp units.
1260 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001261 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001262
1263 // The smallest screen size an application will see in normal operation.
1264 // This is the smallest value of both screenWidthDp and screenHeightDp
1265 // in portrait and landscape.
1266 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001267 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001268
1269 // The type of touch screen attached to the device.
1270 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1271 optional int32 touchscreen = 16;
1272
1273 // Bit mask of the ui mode.
1274 // Contains information about the overall ui mode of the device.
1275 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1276 // Also contains information about whether the device is in night mode.
1277 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001278 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001279}
1280
Tej Singheee317b2018-03-07 19:28:05 -08001281
1282/**
1283 * Logs changes in the connection state of the mobile radio.
1284 *
1285 * Logged from:
1286 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1287 */
1288message MobileConnectionStateChanged {
1289 // States are from the state machine DataConnection.java.
1290 enum State {
1291 UNKNOWN = 0;
1292 // The connection is inactive, or disconnected.
1293 INACTIVE = 1;
1294 // The connection is being activated, or connecting.
1295 ACTIVATING = 2;
1296 // The connection is active, or connected.
1297 ACTIVE = 3;
1298 // The connection is disconnecting.
1299 DISCONNECTING = 4;
1300 // The connection is disconnecting after creating a connection.
1301 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1302 }
1303 optional State state = 1;
1304 // For multi-sim phones, this distinguishes between the sim cards.
1305 optional int32 sim_slot_index = 2;
1306 // Used to identify the connection. Starts at 0 and increments by 1 for
1307 // every new network created. Resets whenever the device reboots.
1308 optional int32 data_connection_id = 3;
1309 // A bitmask for the capabilities of this connection.
1310 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1311 // Default value (if we have no information): 0
1312 optional int64 capabilities = 4;
1313 // If this connection has internet.
1314 // This just checks if the DEFAULT bit of capabilities is set.
1315 optional bool has_internet = 5;
1316}
1317
1318/**
1319 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1320 *
1321 * Logged from:
1322 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1323 */
1324message MobileRadioTechnologyChanged {
1325 optional android.telephony.NetworkTypeEnum state = 1;
1326 // For multi-sim phones, this distinguishes between the sim cards.
1327 optional int32 sim_slot_index = 2;
1328}
1329
Andrew Chantb56388b2018-03-22 21:07:33 -07001330/**
1331 * Logs the VID and PID of any connected USB devices.
1332 *
1333 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1334 *
1335 * Logged by Vendor.
1336 */
1337message UsbDeviceAttached {
1338 optional int32 vid = 1;
1339 optional int32 pid = 2;
1340 optional bool has_audio = 3;
1341 optional bool has_hid = 4;
1342 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001343 enum State {
1344 STATE_DISCONNECTED = 0;
1345 STATE_CONNECTED = 1;
1346 }
1347 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001348 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001349}
1350
Tej Singheee317b2018-03-07 19:28:05 -08001351
Tej Singhdd7bd352018-02-09 19:33:15 -08001352/**
Tej Singh5d991e12018-03-09 19:48:11 -08001353 * Logs when Bluetooth is enabled and disabled.
1354 *
1355 * Logged from:
1356 * services/core/java/com/android/server/BluetoothManagerService.java
1357 */
1358message BluetoothEnabledStateChanged {
1359 repeated AttributionNode attribution_node = 1;
1360 // Whether or not bluetooth is enabled on the device.
1361 enum State {
1362 UNKNOWN = 0;
1363 ENABLED = 1;
1364 DISABLED = 2;
1365 }
1366 optional State state = 2;
1367 // The reason for being enabled/disabled.
1368 // Eg. Airplane mode, crash, application request.
1369 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1370 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001371 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001372}
1373
1374/**
Jack Hed9837c82019-01-09 01:19:13 -08001375 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001376 *
1377 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001378 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1379 *
1380 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001381 */
1382message BluetoothConnectionStateChanged {
1383 // The state of the connection.
1384 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1385 optional android.bluetooth.ConnectionStateEnum state = 1;
1386 // An identifier that can be used to match connect and disconnect events.
1387 // Currently is last two bytes of a hash of a device level ID and
1388 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001389 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1390 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001391 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1392 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001393 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001394 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001395 // An identifier that can be used to match events for this device.
1396 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1397 // Salt: Randomly generated 256 bit value
1398 // Hash algorithm: HMAC-SHA256
1399 // Size: 32 byte
1400 // Default: null or empty if the device identifier is not known
1401 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1402}
1403
1404/**
1405 * Logs when a Bluetooth device connects and disconnects over ACL
1406 *
1407 * Logged from:
1408 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1409 *
1410 * Next Tag: 3
1411 */
1412message BluetoothAclConnectionStateChanged {
1413 // An identifier that can be used to match events for this device.
1414 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1415 // Salt: Randomly generated 256 bit value
1416 // Hash algorithm: HMAC-SHA256
1417 // Size: 32 byte
1418 // Default: null or empty if the device identifier is not known
1419 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1420 // The state of the connection.
1421 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1422 optional android.bluetooth.ConnectionStateEnum state = 2;
1423}
1424
1425/**
1426 * Logs when a Bluetooth device connects and disconnects over SCO
1427 *
1428 * Logged from:
1429 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1430 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1431 *
1432 * Next Tag: 4
1433 */
1434message BluetoothScoConnectionStateChanged {
1435 // An identifier that can be used to match events for this device.
1436 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1437 // Salt: Randomly generated 256 bit value
1438 // Hash algorithm: HMAC-SHA256
1439 // Size: 32 byte
1440 // Default: null or empty if the device identifier is not known
1441 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1442 // The state of the connection.
1443 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1444 optional android.bluetooth.ConnectionStateEnum state = 2;
1445 // Codec used for this SCO connection
1446 // Default: UNKNOWN
1447 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001448}
1449
Jack Hec27040a2019-01-09 20:54:41 -08001450/**
1451 * Logged when active device of a profile changes
1452 *
1453 * Logged from:
1454 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1455 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1456 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1457 */
1458message BluetoothActiveDeviceChanged {
1459 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1460 // From android.bluetooth.BluetoothProfile
1461 optional int32 bt_profile = 1;
1462 // An identifier that can be used to match events for this new active device.
1463 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1464 // Salt: Randomly generated 256 bit value
1465 // Hash algorithm: HMAC-SHA256
1466 // Size: 32 byte
1467 // Default: null or empty if there is no active device for this profile
1468 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1469}
1470
Jack Heab86dbd22018-12-18 15:43:27 -08001471// Logs when there is an event affecting Bluetooth device's link layer connection.
1472// - This event is triggered when there is a related HCI command or event
1473// - Users of this metrics can deduce Bluetooth device's connection state from these events
1474// - HCI commands are logged before the command is sent, after receiving command status, and after
1475// receiving command complete
1476// - HCI events are logged when they arrive
1477//
1478// Low level log from system/bt
1479//
1480// Bluetooth classic commands:
1481// - CMD_CREATE_CONNECTION
1482// - CMD_DISCONNECT
1483// - CMD_CREATE_CONNECTION_CANCEL
1484// - CMD_ACCEPT_CONNECTION_REQUEST
1485// - CMD_REJECT_CONNECTION_REQUEST
1486// - CMD_SETUP_ESCO_CONNECTION
1487// - CMD_ACCEPT_ESCO_CONNECTION
1488// - CMD_REJECT_ESCO_CONNECTION
1489// - CMD_ENH_SETUP_ESCO_CONNECTION
1490// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1491//
1492// Bluetooth low energy commands:
1493// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1494// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1495// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1496// - CMD_BLE_CLEAR_WHITE_LIST
1497// - CMD_BLE_ADD_WHITE_LIST
1498// - CMD_BLE_REMOVE_WHITE_LIST
1499//
1500// Bluetooth classic events:
1501// - EVT_CONNECTION_COMP
1502// - EVT_CONNECTION_REQUEST
1503// - EVT_DISCONNECTION_COMP
1504// - EVT_ESCO_CONNECTION_COMP
1505// - EVT_ESCO_CONNECTION_CHANGED
1506//
1507// Bluetooth low energy meta events:
1508// - BLE_EVT_CONN_COMPLETE_EVT
1509// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1510//
1511// Next tag: 10
1512message BluetoothLinkLayerConnectionEvent {
1513 // An identifier that can be used to match events for this device.
1514 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1515 // Salt: Randomly generated 256 bit value
1516 // Hash algorithm: HMAC-SHA256
1517 // Size: 32 byte
1518 // Default: null or empty if the device identifier is not known
1519 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1520 // Connection handle of this connection if available
1521 // Range: 0x0000 - 0x0EFF (12 bits)
1522 // Default: 0xFFFF if the handle is unknown
1523 optional int32 connection_handle = 2;
1524 // Direction of the link
1525 // Default: DIRECTION_UNKNOWN
1526 optional android.bluetooth.DirectionEnum direction = 3;
1527 // Type of this link
1528 // Default: LINK_TYPE_UNKNOWN
1529 optional android.bluetooth.LinkTypeEnum type = 4;
1530
1531 // Reason metadata for this link layer connection event, rules for interpretation:
1532 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1533 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1534 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1535 // set and valid, ignore hci_ble_event
1536
1537 // HCI command associated with this event
1538 // Default: CMD_UNKNOWN
1539 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1540 // HCI event associated with this event
1541 // Default: EVT_UNKNOWN
1542 optional android.bluetooth.hci.EventEnum hci_event = 6;
1543 // HCI BLE meta event associated with this event
1544 // Default: BLE_EVT_UNKNOWN
1545 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1546 // HCI command status code if this is triggerred by hci_cmd
1547 // Default: STATUS_UNKNOWN
1548 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1549 // HCI reason code associated with this event
1550 // Default: STATUS_UNKNOWN
1551 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1552}
1553
Howard Roe103fe22019-01-17 16:52:16 -08001554/**
1555 * Logs when a module is rolled back by Watchdog.
1556 *
1557 * Logged from: Rollback Manager
1558 */
1559message WatchdogRollbackOccurred {
1560 enum RollbackType {
1561 UNKNOWN = 0;
1562 ROLLBACK_INITIATE = 1;
1563 ROLLBACK_SUCCESS = 2;
1564 ROLLBACK_FAILURE = 3;
1565 }
1566 optional RollbackType rollback_type = 1;
1567
1568 optional string package_name = 2;
1569
1570 optional int32 package_version_code = 3;
1571}
1572
Jack Hec27040a2019-01-09 20:54:41 -08001573/**
1574 * Logs when there is a change in Bluetooth A2DP playback state
1575 *
1576 * Logged from:
1577 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1578 */
1579message BluetoothA2dpPlaybackStateChanged {
1580 // An identifier that can be used to match events for this device.
1581 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1582 // Salt: Randomly generated 256 bit value
1583 // Hash algorithm: HMAC-SHA256
1584 // Size: 32 byte
1585 // Default: null or empty if the device identifier is not known
1586 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1587 // Current playback state
1588 // Default: PLAYBACK_STATE_UNKNOWN
1589 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1590 // Current audio coding mode
1591 // Default: AUDIO_CODING_MODE_UNKNOWN
1592 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1593}
1594
1595/**
1596 * Logs when there is a change in A2DP codec config for a particular remote device
1597 *
1598 * Logged from:
1599 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1600 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1601 */
1602message BluetoothA2dpCodecConfigChanged {
1603 // An identifier that can be used to match events for this device.
1604 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1605 // Salt: Randomly generated 256 bit value
1606 // Hash algorithm: HMAC-SHA256
1607 // Size: 32 byte
1608 // Default: null or empty if the device identifier is not known
1609 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1610 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1611 // Default SOURCE_CODEC_TYPE_INVALID
1612 optional int32 codec_type = 2;
1613 // Codec priroity, the higher the more preferred, -1 for disabled
1614 // Default: CODEC_PRIORITY_DEFAULT
1615 optional int32 codec_priority = 3;
1616 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1617 // Default: SAMPLE_RATE_NONE
1618 optional int32 sample_rate = 4;
1619 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1620 // Default: BITS_PER_SAMPLE_NONE
1621 optional int32 bits_per_sample = 5;
1622 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1623 // Default: CHANNEL_MODE_NONE
1624 optional int32 channel_mode = 6;
1625 // Codec specific values
1626 // Default 0
1627 optional int64 codec_specific_1 = 7;
1628 optional int64 codec_specific_2 = 8;
1629 optional int64 codec_specific_3 = 9;
1630 optional int64 codec_specific_4 = 10;
1631}
1632
1633/**
1634 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1635 * Each codec's capability is logged separately due to statsd restriction
1636 *
1637 * Logged from:
1638 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1639 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1640 */
1641message BluetoothA2dpCodecCapabilityChanged {
1642 // An identifier that can be used to match events for this device.
1643 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1644 // Salt: Randomly generated 256 bit value
1645 // Hash algorithm: HMAC-SHA256
1646 // Size: 32 byte
1647 // Default: null or empty if the device identifier is not known
1648 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1649 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1650 // Default SOURCE_CODEC_TYPE_INVALID
1651 optional int32 codec_type = 2;
1652 // Codec priroity, the higher the more preferred, -1 for disabled
1653 // Default: CODEC_PRIORITY_DEFAULT
1654 optional int32 codec_priority = 3;
1655 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1656 // in BluetoothCodecConfig
1657 // Default: empty and SAMPLE_RATE_NONE for individual item
1658 optional int32 sample_rate = 4;
1659 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1660 // in BluetoothCodecConfig
1661 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1662 optional int32 bits_per_sample = 5;
1663 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1664 // BluetoothCodecConfig
1665 // Default: empty and CHANNEL_MODE_NONE for individual item
1666 optional int32 channel_mode = 6;
1667 // Codec specific values
1668 // Default 0
1669 optional int64 codec_specific_1 = 7;
1670 optional int64 codec_specific_2 = 8;
1671 optional int64 codec_specific_3 = 9;
1672 optional int64 codec_specific_4 = 10;
1673}
1674
1675/**
1676 * Logs when A2DP failed to read from PCM source.
1677 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1678 *
1679 * Logged from:
1680 * system/bt
1681 */
1682message BluetoothA2dpAudioUnderrunReported {
1683 // An identifier that can be used to match events for this device.
1684 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1685 // Salt: Randomly generated 256 bit value
1686 // Hash algorithm: HMAC-SHA256
1687 // Size: 32 byte
1688 // Default: null or empty if the device identifier is not known
1689 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1690 // Encoding interval in nanoseconds
1691 // Default: 0
1692 optional int64 encoding_interval_nanos = 2;
1693 // Number of bytes of PCM data that could not be read from the source
1694 // Default: 0
1695 optional int32 num_missing_pcm_bytes = 3;
1696}
1697
1698/**
1699 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1700 * buffer queue is full and we have to drop data
1701 *
1702 * Logged from:
1703 * system/bt
1704 */
1705message BluetoothA2dpAudioOverrunReported {
1706 // An identifier that can be used to match events for this device.
1707 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1708 // Salt: Randomly generated 256 bit value
1709 // Hash algorithm: HMAC-SHA256
1710 // Size: 32 byte
1711 // Default: null or empty if the device identifier is not known
1712 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1713 // Encoding interval in nanoseconds
1714 // Default: 0
1715 optional int64 encoding_interval_nanos = 2;
1716 // Number of buffers dropped in this event
1717 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1718 // Default: 0
1719 optional int32 num_dropped_buffers = 3;
1720 // Number of encoded buffers dropped in this event
1721 // Default 0
1722 optional int32 num_dropped_encoded_frames = 4;
1723 // Number of encoded bytes dropped in this event
1724 // Default: 0
1725 optional int32 num_dropped_encoded_bytes = 5;
1726}
1727
1728/**
1729 * Logs when we receive reports regarding a device's RSSI value
1730 *
1731 * Logged from:
1732 * system/bt
1733 */
1734message BluetoothDeviceRssiReported {
1735 // An identifier that can be used to match events for this device.
1736 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1737 // Salt: Randomly generated 256 bit value
1738 // Hash algorithm: HMAC-SHA256
1739 // Size: 32 byte
1740 // Default: null or empty if the device identifier is not known
1741 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1742 // Connection handle of this connection if available
1743 // Range: 0x0000 - 0x0EFF (12 bits)
1744 // Default: 0xFFFF if the handle is unknown
1745 optional int32 connection_handle = 2;
1746 // HCI command status code if this is triggerred by hci_cmd
1747 // Default: STATUS_UNKNOWN
1748 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1749 // BR/EDR
1750 // Range: -128 ≤ N ≤ 127 (signed integer)
1751 // Units: dB
1752 // LE:
1753 // Range: -127 to 20, 127 (signed integer)
1754 // Units: dBm
1755 // Invalid when an out of range value is reported
1756 optional int32 rssi = 4;
1757}
1758
1759/**
1760 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1761 *
1762 * Logged from:
1763 * system/bt
1764 */
1765message BluetoothDeviceFailedContactCounterReported {
1766 // An identifier that can be used to match events for this device.
1767 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1768 // Salt: Randomly generated 256 bit value
1769 // Hash algorithm: HMAC-SHA256
1770 // Size: 32 byte
1771 // Default: null or empty if the device identifier is not known
1772 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1773 // Connection handle of this connection if available
1774 // Range: 0x0000 - 0x0EFF (12 bits)
1775 // Default: 0xFFFF if the handle is unknown
1776 optional int32 connection_handle = 2;
1777 // HCI command status code if this is triggerred by hci_cmd
1778 // Default: STATUS_UNKNOWN
1779 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1780 // Number of consecutive failed contacts for a connection corresponding to the Handle
1781 // Range: uint16_t, 0-0xFFFF
1782 // Default: 0xFFFFF
1783 optional int32 failed_contact_counter = 4;
1784}
1785
1786/**
1787 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1788 *
1789 * Logged from:
1790 * system/bt
1791 */
1792message BluetoothDeviceTxPowerLevelReported {
1793 // An identifier that can be used to match events for this device.
1794 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1795 // Salt: Randomly generated 256 bit value
1796 // Hash algorithm: HMAC-SHA256
1797 // Size: 32 byte
1798 // Default: null or empty if the device identifier is not known
1799 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1800 // Connection handle of this connection if available
1801 // Range: 0x0000 - 0x0EFF (12 bits)
1802 // Default: 0xFFFF if the handle is unknown
1803 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001804 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001805 // Default: STATUS_UNKNOWN
1806 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1807 // Range: -30 ≤ N ≤ 20
1808 // Units: dBm
1809 // Invalid when an out of range value is reported
1810 optional int32 transmit_power_level = 4;
1811}
Jack Heab86dbd22018-12-18 15:43:27 -08001812
Tej Singh5d991e12018-03-09 19:48:11 -08001813/**
Jack He1021a612019-01-20 21:22:46 -08001814 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1815 * receiving an HCI command from the host
1816 *
1817 * Logged from: system/bt
1818 */
1819message BluetoothHciTimeoutReported {
1820 // HCI command associated with this event
1821 // Default: CMD_UNKNOWN
1822 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1823}
1824
1825/**
1826 * Logs when we receive Bluetooth Link Quality Report event from the controller
1827 * See Android Bluetooth HCI specification for more details
1828 *
1829 * Note: all count and bytes field are counted since last event
1830 *
1831 * Logged from: system/bt
1832 */
1833message BluetoothQualityReportReported {
1834 // Quality report ID
1835 // Original type: uint8_t
1836 // Default: BQR_ID_UNKNOWN
1837 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1838 // Packet type of the connection
1839 // Original type: uint8_t
1840 // Default: BQR_PACKET_TYPE_UNKNOWN
1841 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1842 // Connection handle of the connection
1843 // Original type: uint16_t
1844 optional int32 connection_handle = 3;
1845 // Performing Role for the connection
1846 // Original type: uint8_t
1847 optional int32 connection_role = 4;
1848 // Current Transmit Power Level for the connection. This value is the same as the controller's
1849 // response to the HCI_Read_Transmit_Power_Level HCI command
1850 // Original type: uint8_t
1851 optional int32 tx_power_level = 5;
1852 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1853 // absolute receiver signal strength value
1854 // Original type: int8_t
1855 optional int32 rssi = 6;
1856 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1857 // channels used by the link currently
1858 // Original type: uint8_t
1859 optional int32 snr = 7;
1860 // Indicates the number of unused channels in AFH_channel_map
1861 // Original type: uint8_t
1862 optional int32 unused_afh_channel_count = 8;
1863 // Indicates the number of the channels which are interfered and quality is bad but are still
1864 // selected for AFH
1865 // Original type: uint8_t
1866 optional int32 afh_select_unideal_channel_count = 9;
1867 // Current Link Supervision Timeout Setting
1868 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1869 // Original type: uint16_t
1870 optional int32 lsto = 10;
1871 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1872 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1873 // 0x01 (Piconet Clock)
1874 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1875 // Original type: uint32_t
1876 optional int64 connection_piconet_clock = 11;
1877 // The count of retransmission
1878 // Original type: uint32_t
1879 optional int64 retransmission_count = 12;
1880 // The count of no RX
1881 // Original type: uint32_t
1882 optional int64 no_rx_count = 13;
1883 // The count of NAK (Negative Acknowledge)
1884 // Original type: uint32_t
1885 optional int64 nak_count = 14;
1886 // Controller timestamp of last TX ACK
1887 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1888 // Original type: uint32_t
1889 optional int64 last_tx_ack_timestamp = 15;
1890 // The count of Flow-off (STOP)
1891 // Original type: uint32_t
1892 optional int64 flow_off_count = 16;
1893 // Controller timestamp of last Flow-on (GO)
1894 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1895 // Original type: uint32_t
1896 optional int64 last_flow_on_timestamp = 17;
1897 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1898 // Original type: uint32_t
1899 optional int64 buffer_overflow_bytes = 18;
1900 // Buffer underflow count (in byte) since last event
1901 // Original type: uint32_t
1902 optional int64 buffer_underflow_bytes = 19;
1903}
1904
1905/**
1906 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1907 *
1908 * Notes:
1909 * - Each event can be partially filled as we might learn different pieces of device
1910 * information at different time
1911 * - Multiple device info events can be combined to give more complete picture
1912 * - When multiple device info events tries to describe the same information, the
1913 * later one wins
1914 *
1915 * Logged from:
1916 * packages/apps/Bluetooth
1917 */
1918message BluetoothManufacturerInfoReported {
1919 // An identifier that can be used to match events for this device.
1920 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1921 // Salt: Randomly generated 256 bit value
1922 // Hash algorithm: HMAC-SHA256
1923 // Size: 32 byte
1924 // Default: null or empty if the device identifier is not known
1925 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1926 // Where is this device info obtained from
1927 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1928 // Name of the data source
1929 // For EXTERNAL: package name of the data source
1930 // For INTERNAL: null for general case, component name otherwise
1931 optional string source_name = 3;
1932 // Name of the manufacturer of this device
1933 optional string manufacturer = 4;
1934 // Model of this device
1935 optional string model = 5;
1936 // Hardware version of this device
1937 optional string hardware_version = 6;
1938 // Software version of this device
1939 optional string software_version = 7;
1940}
1941
1942/**
1943 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1944 * device, as documented by the Bluetooth Core HCI specification
1945 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1946 * Vol 2, Part E, Page 1118
1947 *
1948 * Logged from:
1949 * system/bt
1950 */
1951message BluetoothRemoteVersionInfoReported {
1952 // Connection handle of the connection
1953 // Original type: uint16_t
1954 optional int32 connection_handle = 1;
1955 // HCI command status code
1956 // Default: STATUS_UNKNOWN
1957 optional android.bluetooth.hci.StatusEnum hci_status = 2;
1958 // 1 byte Version of current LMP in the remote controller
1959 optional int32 lmp_version = 3;
1960 // 2 bytes LMP manufacturer code of the remote controller
1961 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
1962 optional int32 lmp_manufacturer_code = 4;
1963 // 4 bytes subversion of the LMP in the remote controller
1964 optional int32 lmp_subversion = 5;
1965}
1966
1967/**
1968 * Logs when certain Bluetooth SDP attributes are discovered
1969 * Constant definitions are from:
1970 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
1971 *
1972 * Current logged attributes:
1973 * - BluetoothProfileDescriptorList
1974 * - Supported Features Bitmask
1975 *
1976 * Logged from:
1977 * system/bt
1978 */
1979message BluetoothSdpAttributeReported {
1980 // An identifier that can be used to match events for this device.
1981 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1982 // Salt: Randomly generated 256 bit value
1983 // Hash algorithm: HMAC-SHA256
1984 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1985 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
1986 // Original type: uint16_t
1987 optional int32 protocol_uuid = 2;
1988 // Short form UUIDs used to identify Bluetooth SDP attribute types
1989 // Original type: uint16_t
1990 optional int32 attribute_id = 3;
1991 // Attribute value for the particular attribute
1992 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1993}
1994
1995/**
1996 * Logs when bond state of a Bluetooth device changes
1997 *
1998 * Logged from:
1999 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2000 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2001 */
2002message BluetoothBondStateChanged {
2003 // An identifier that can be used to match events for this device.
2004 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2005 // Salt: Randomly generated 256 bit value
2006 // Hash algorithm: HMAC-SHA256
2007 // Size: 32 byte
2008 // Default: null or empty if the device identifier is not known
2009 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2010 // Preferred transport type to remote dual mode device
2011 // Default: TRANSPORT_AUTO means no preference
2012 optional android.bluetooth.TransportTypeEnum transport = 2;
2013 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2014 // Default: UNKNOWN
2015 optional android.bluetooth.DeviceTypeEnum type = 3;
2016 // Current bond state (NONE, BONDING, BONDED)
2017 // Default: BOND_STATE_UNKNOWN
2018 optional android.bluetooth.BondStateEnum bond_state = 4;
2019 // Bonding sub state
2020 // Default: BOND_SUB_STATE_UNKNOWN
2021 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2022 // Unbond Reason
2023 // Default: UNBOND_REASON_UNKNOWN
2024 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2025}
2026
2027/**
2028 * Logs there is an event related Bluetooth classic pairing
2029 *
2030 * Logged from:
2031 * system/bt
2032 */
2033message BluetoothClassicPairingEventReported {
2034 // An identifier that can be used to match events for this device.
2035 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2036 // Salt: Randomly generated 256 bit value
2037 // Hash algorithm: HMAC-SHA256
2038 // Size: 32 byte
2039 // Default: null or empty if the device identifier is not known
2040 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2041 // Connection handle of this connection if available
2042 // Range: 0x0000 - 0x0EFF (12 bits)
2043 // Default: 0xFFFF if the handle is unknown
2044 optional int32 connection_handle = 2;
2045 // HCI command associated with this event
2046 // Default: CMD_UNKNOWN
2047 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2048 // HCI event associated with this event
2049 // Default: EVT_UNKNOWN
2050 optional android.bluetooth.hci.EventEnum hci_event = 4;
2051 // HCI command status code if this is triggerred by hci_cmd
2052 // Default: STATUS_UNKNOWN
2053 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2054 // HCI reason code associated with this event
2055 // Default: STATUS_UNKNOWN
2056 optional android.bluetooth.hci.StatusEnum reason_code = 6;
2057}
2058
2059/**
2060 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2061 *
2062 * Logged from:
2063 * system/bt
2064 */
2065message BluetoothSmpPairingEventReported {
2066 // An identifier that can be used to match events for this device.
2067 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2068 // Salt: Randomly generated 256 bit value
2069 // Hash algorithm: HMAC-SHA256
2070 // Size: 32 byte
2071 // Default: null or empty if the device identifier is not known
2072 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2073 // SMP command sent or received over L2CAP
2074 // Default: CMD_UNKNOWN
2075 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2076 // Whether this command is sent or received
2077 // Default: DIRECTION_UNKNOWN
2078 optional android.bluetooth.DirectionEnum direction = 3;
2079 // SMP failure reason code
2080 // Default: PAIRING_FAIL_REASON_DEFAULT
2081 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2082}
2083
2084/**
Jack He815cdba2019-01-30 17:24:55 -08002085 * Logs when a Bluetooth socket’s connection state changed
2086 *
2087 * Logged from:
2088 * system/bt
2089 */
2090message BluetoothSocketConnectionStateChanged {
2091 // An identifier that can be used to match events for this device.
2092 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2093 // Salt: Randomly generated 256 bit value
2094 // Hash algorithm: HMAC-SHA256
2095 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002096 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002097 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002098 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002099 // Default 0 when unknown or don't care
2100 optional int32 port = 2;
2101 // Socket type as mentioned in
2102 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2103 // Default: SOCKET_TYPE_UNKNOWN
2104 optional android.bluetooth.SocketTypeEnum type = 3;
2105 // Socket connection state
2106 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2107 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2108 // Number of bytes sent to remote device during this connection
2109 optional int64 tx_bytes = 5;
2110 // Number of bytes received from remote device during this connection
2111 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002112 // Socket owner's UID
2113 optional int32 uid = 7 [(is_uid) = true];
2114 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2115 // |port| must be spawned by |server_port|
2116 // Default 0 when unknown or don't care
2117 optional int32 server_port = 8;
2118 // Whether this is a server listener socket
2119 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002120}
2121
2122/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002123 * Logs when something is plugged into or removed from the USB-C connector.
2124 *
2125 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002126 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002127 */
2128message UsbConnectorStateChanged {
2129 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002130 STATE_DISCONNECTED = 0;
2131 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002132 }
2133 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002134 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002135 // Last active session in ms.
2136 // 0 when the port is in connected state.
2137 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002138}
2139
2140/**
2141 * Logs the reported speaker impedance.
2142 *
2143 * Logged from:
2144 * Vendor audio implementation.
2145 */
2146message SpeakerImpedanceReported {
2147 optional int32 speaker_location = 1;
2148 optional int32 impedance = 2;
2149}
2150
2151/**
2152 * Logs the report of a failed hardware.
2153 *
2154 * Logged from:
2155 * Vendor HALs.
2156 *
2157 */
2158message HardwareFailed {
2159 enum HardwareType {
2160 HARDWARE_FAILED_UNKNOWN = 0;
2161 HARDWARE_FAILED_MICROPHONE = 1;
2162 HARDWARE_FAILED_CODEC = 2;
2163 HARDWARE_FAILED_SPEAKER = 3;
2164 HARDWARE_FAILED_FINGERPRINT = 4;
2165 }
2166 optional HardwareType hardware_type = 1;
2167
Maggie White6dcd8572019-01-31 14:11:50 -08002168 /**
2169 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002170 * the same hardware_type. The specific locations are vendor defined integers,
2171 * referring to board-specific numbering schemes.
2172 */
2173 optional int32 hardware_location = 2;
2174
Maggie White6dcd8572019-01-31 14:11:50 -08002175 /**
2176 * failure_code is specific to the HardwareType of the failed hardware.
2177 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002178 */
Maggie White6dcd8572019-01-31 14:11:50 -08002179 enum HardwareErrorCode {
2180 UNKNOWN = 0;
2181 COMPLETE = 1;
2182 SPEAKER_HIGH_Z = 2;
2183 SPEAKER_SHORT = 3;
2184 FINGERPRINT_SENSOR_BROKEN = 4;
2185 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002186 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002187 }
2188 optional int32 failure_code = 3;
2189}
2190
2191/**
2192 * Log an event when the device has been physically dropped.
2193 * Reported from the /vendor partition.
2194 */
2195message PhysicalDropDetected {
2196 // Confidence that the event was actually a drop, 0 -> 100
2197 optional int32 confidence_pctg = 1;
2198 // Peak acceleration of the drop, in 1/1000s of a g.
2199 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002200 // Duration of freefall in ms
2201 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002202}
2203
2204/**
2205 * Log bucketed battery charge cycles.
2206 *
2207 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002208 * a given charge point. For example, if 10 cycle buckets are
2209 * initialized, bucket 1 is the lowest 1/10th of the battery,
2210 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002211 *
2212 * Logged from:
2213 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2214 */
2215message ChargeCyclesReported {
2216 optional int32 cycle_bucket_1 = 1;
2217 optional int32 cycle_bucket_2 = 2;
2218 optional int32 cycle_bucket_3 = 3;
2219 optional int32 cycle_bucket_4 = 4;
2220 optional int32 cycle_bucket_5 = 5;
2221 optional int32 cycle_bucket_6 = 6;
2222 optional int32 cycle_bucket_7 = 7;
2223 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002224 optional int32 cycle_bucket_9 = 9;
2225 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002226}
2227
2228/**
Howard Roa46b6582018-09-18 16:45:02 -07002229 * Log battery health snapshot.
2230 *
2231 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2232 * are snapshotted periodically over 24hrs.
2233 */
2234message BatteryHealthSnapshot {
2235 enum BatterySnapshotType {
2236 UNKNOWN = 0;
2237 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2238 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2239 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2240 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2241 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2242 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2243 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2244 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2245 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2246 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2247 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2248 }
2249 optional BatterySnapshotType type = 1;
2250 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002251 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002252 // Voltage Battery Voltage, in microVolts.
2253 optional int32 voltage_micro_volt = 3;
2254 // Current Battery current, in microAmps.
2255 optional int32 current_micro_amps = 4;
2256 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2257 optional int32 open_circuit_micro_volt = 5;
2258 // Resistance Battery Resistance, in microOhms.
2259 optional int32 resistance_micro_ohm = 6;
2260 // Level Battery Level, as % of full.
2261 optional int32 level_percent = 7;
2262}
2263
2264/**
2265 * Log slow I/O operations on the primary storage.
2266 */
2267message SlowIo {
2268 // Classifications of IO Operations.
2269 enum IoOperation {
2270 UNKNOWN = 0;
2271 READ = 1;
2272 WRITE = 2;
2273 UNMAP = 3;
2274 SYNC = 4;
2275 }
2276 optional IoOperation operation = 1;
2277
2278 // The number of slow IO operations of this type over 24 hours.
2279 optional int32 count = 2;
2280}
2281
2282/**
2283 * Log battery caused shutdown with the last recorded voltage.
2284 */
2285message BatteryCausedShutdown {
2286 // The last recorded battery voltage prior to shutdown.
2287 optional int32 last_recorded_micro_volt = 1;
2288}
2289
2290/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002291 * Logs the duration of a davey (jank of >=700ms) when it occurs
2292 *
2293 * Logged from:
2294 * frameworks/base/libs/hwui/JankTracker.cpp
2295 */
2296message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002297 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002298 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002299
Tej Singhbb8554a2018-01-26 11:59:14 -08002300 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002301 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002302}
2303
2304/**
Bookatze5885242017-10-24 20:10:31 -07002305 * Logs phone signal strength changes.
2306 *
2307 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002308 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002309 */
2310message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002311 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2312 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002313}
2314
Yangster4ccebea2018-10-09 17:09:02 -07002315
2316/**
2317 * Logs when the phone state, sim state or signal strength changes
2318 *
2319 * Logged from:
2320 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2321 */
2322message PhoneServiceStateChanged {
2323 optional android.telephony.ServiceStateEnum state = 1;
2324 optional android.telephony.SimStateEnum sim_state = 2;
2325 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2326}
2327
2328/**
2329 * Logs when the phone becomes on or off.
2330 *
2331 * Logged from:
2332 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2333 */
2334message PhoneStateChanged {
2335 enum State {
2336 OFF = 0;
2337 ON = 1;
2338 }
2339 optional State state = 1;
2340}
2341
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002342message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002343 optional android.stats.launcher.LauncherAction action = 1;
2344 optional android.stats.launcher.LauncherState src_state = 2;
2345 optional android.stats.launcher.LauncherState dst_state = 3;
2346 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002347 optional bool is_swipe_up_enabled = 5;
2348}
2349
David Chenc28b2bb2017-10-24 12:52:52 -07002350/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002351 * Logs when Settings UI has changed.
2352 *
2353 * Logged from:
2354 * packages/apps/Settings
2355 */
2356message SettingsUIChanged {
2357 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002358 * Where this SettingsUIChange event comes from. For example, if
2359 * it's a PAGE_VISIBLE event, where the page is opened from.
2360 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002361 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002362
2363 /**
2364 * What the UI action is.
2365 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002366 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002367
2368 /**
2369 * Where the action is happening
2370 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002371 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002372
2373 /**
2374 * What preference changed in this event.
2375 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002376 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002377
2378 /**
2379 * The new value of the changed preference.
2380 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002381 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002382}
2383
2384/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002385 * Logs basic timing information about touch events.
2386 * Reported at most every 5 minutes while device is being interacted with.
2387 *
2388 * Logged from:
2389 * frameworks/native/services/inputflinger
2390 */
2391message TouchEventReported {
2392 /**
2393 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2394 * and the standard deviation of latency between the kernel and framework
2395 * for touchscreen events. The units are microseconds.
2396 *
2397 * The number is measured as the difference between the time at which
2398 * the input event was received in the evdev driver,
2399 * and the time at which the input event was received in EventHub.
2400 */
2401 // Minimum value
2402 optional float latency_min_micros = 1;
2403 // Maximum value
2404 optional float latency_max_micros = 2;
2405 // Average value
2406 optional float latency_mean_micros = 3;
2407 // Standard deviation
2408 optional float latency_stdev_micros = 4;
2409}
2410
2411/**
David Chenc28b2bb2017-10-24 12:52:52 -07002412 * Logs that a setting was updated.
2413 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002414 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002415 * The tag and is_default allow resetting of settings to default values based on the specified
2416 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2417 */
2418message SettingChanged {
2419 // The name of the setting.
2420 optional string setting = 1;
2421
2422 // The change being imposed on this setting. May represent a number, eg "3".
2423 optional string value = 2;
2424
2425 // The new value of this setting. For most settings, this is same as value. For some settings,
2426 // value is +X or -X where X represents an element in a set. For example, if the previous value
2427 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2428 // The +/- feature is currently only used for location_providers_allowed.
2429 optional string new_value = 3;
2430
2431 // The previous value of this setting.
2432 optional string prev_value = 4;
2433
2434 // The tag used with the is_default for resetting sets of settings. This is generally null.
2435 optional string tag = 5;
2436
Bookatz90867622018-01-31 15:05:57 -08002437 // True if this setting with tag should be resettable.
2438 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002439
David Chenbd789912018-03-16 17:19:55 -07002440 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002441 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002442
2443 enum ChangeReason {
2444 UPDATED = 1; // Updated can be an insertion or an update.
2445 DELETED = 2;
2446 }
2447 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002448}
Chenjie Yub3dda412017-10-24 13:41:59 -07002449
Chenjie Yu05013b32017-11-21 10:21:41 -08002450/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002451 * Logs activity going to foreground or background
2452 *
2453 * Logged from:
2454 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2455 */
2456message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002457 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002458 optional string pkg_name = 2;
2459 optional string class_name = 3;
2460
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002461 enum State {
2462 BACKGROUND = 0;
2463 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002464 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002465 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002466}
David Chenc8a43242017-10-17 16:23:28 -07002467
2468/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002469 * Logs when a volume entered low Storage state.
2470 * Logged from:
2471 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2472 */
2473message LowStorageStateChanged {
2474 // Volume that ran out of storage.
2475 optional string volume_description = 1;
2476
2477 enum State {
2478 UNKNOWN = 0;
2479 OFF = 1;
2480 ON = 2;
2481 }
2482 optional State state = 2;
2483}
2484
2485/**
2486 * Logs when an app is downgraded.
2487 * Logged from:
2488 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2489 */
2490message AppDowngraded {
2491 optional string package_name = 1;
2492 // Size of the package (all data) before being downgraded.
2493 optional int64 size_in_bytes_before = 2;
2494 // Size of the package (all data) after being downgraded.
2495 optional int64 size_in_bytes_after = 3;
2496
2497 optional bool aggressive = 4;
2498}
2499
2500/**
2501 * Logs when an app is optimized after being downgraded.
2502 * Logged from:
2503 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2504 */
2505message AppOptimizedAfterDowngraded {
2506 optional string package_name = 1;
2507}
2508
2509/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002510 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002511 * Logged from:
2512 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2513 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002514message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002515 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002516
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002517 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002518
2519 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002520 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002521 optional string process_name = 3;
2522
2523 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002524 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002525
2526 optional string package_name = 5;
2527
2528 enum InstantApp {
2529 UNAVAILABLE = 0;
2530 FALSE = 1;
2531 TRUE = 2;
2532 }
2533 optional InstantApp is_instant_app = 6;
2534
2535 enum ForegroundState {
2536 UNKNOWN = 0;
2537 BACKGROUND = 1;
2538 FOREGROUND = 2;
2539 }
2540 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002541
2542 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002543}
David Chen9e3808c2017-11-20 17:25:34 -08002544
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002545/**
2546 * Logs when a WTF (What a Terrible Failure) happened.
2547 * Logged from:
2548 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2549 */
2550message WTFOccurred {
2551 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002552
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002553 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002554
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002555 // The name of the process.
2556 // system_server if it is not by an app
2557 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002558
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002559 // The pid if available. -1 means not available.
2560 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002561
2562 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002563}
2564
2565/**
2566 * Logs when system server reports low memory.
2567 * Logged from:
2568 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2569 */
2570message LowMemReported {
2571}
2572
2573/**
2574 * Logs when an app ANR (App Not Responding) occurs.
2575 * Logged from:
2576 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2577 */
2578message ANROccurred {
2579 optional int32 uid = 1 [(is_uid) = true];
2580
2581 optional string process_name = 2;
2582
2583 optional string short_component_name = 3;
2584
2585 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002586
2587 enum InstantApp {
2588 UNAVAILABLE = 0;
2589 FALSE = 1;
2590 TRUE = 2;
2591 }
2592 optional InstantApp is_instant_app = 5;
2593
2594 enum ForegroundState {
2595 UNKNOWN = 0;
2596 BACKGROUND = 1;
2597 FOREGROUND = 2;
2598 }
2599 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002600
2601 optional android.server.ErrorSource error_source = 7;
2602
2603 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002604}
2605
Bookatza7020bd2018-08-28 16:29:35 -07002606/**
2607 * Logs when the vibrator state changes.
2608 * Logged from:
2609 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2610 */
2611message VibratorStateChanged {
2612 repeated AttributionNode attribution_node = 1;
2613
2614 enum State {
2615 OFF = 0;
2616 ON = 1;
2617 }
2618 optional State state = 2;
2619
2620 // Duration (in milliseconds) requested to keep the vibrator on.
2621 // Only applicable for State == ON.
2622 optional int64 duration_millis = 3;
2623}
2624
David Chen0a368b22017-12-06 16:28:16 -08002625/*
2626 * Allows other apps to push events into statsd.
2627 * Logged from:
2628 * frameworks/base/core/java/android/util/StatsLog.java
2629 */
David Chen0b5c90c2018-01-25 16:51:49 -08002630message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002631 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002632 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002633
2634 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2635 optional int32 label = 2;
2636
2637 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2638 // predicates for the metrics).
2639 enum State {
2640 UNKNOWN = 0;
2641 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2642 STOP = 2;
2643 START = 3;
2644 }
2645 optional State state = 3;
2646}
2647
David Chen9e3808c2017-11-20 17:25:34 -08002648/**
Bookatz7948c872018-09-04 12:58:33 -07002649 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2650 * For example, this could be due to the user manually changing the time.
2651 *
2652 * Logged from:
2653 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2654 */
2655message WallClockTimeShifted {
2656 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2657 optional int64 wall_clock_timestamp_millis = 1;
2658}
2659
2660/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002661 * Logs when statsd detects an anomaly.
2662 *
2663 * Logged from:
2664 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2665 */
2666message AnomalyDetected {
2667 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002668 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002669
Yangster-mac94e197c2018-01-02 16:03:03 -08002670 // Id of the config whose anomaly detection alert fired.
2671 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002672
Yangster-mac94e197c2018-01-02 16:03:03 -08002673 // Id of the alert (i.e. name of the anomaly that was detected).
2674 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002675}
2676
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002677message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002678 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002679 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002680
2681 // The app package name.
2682 optional string pkg_name = 2;
2683
2684 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002685 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002686 WARM = 1;
2687 HOT = 2;
2688 COLD = 3;
2689 }
2690 // The transition type.
2691 optional TransitionType type = 3;
2692
2693 // The activity name.
2694 optional string activity_name = 4;
2695
2696 // The name of the calling app. Empty if not set.
2697 optional string calling_pkg_name = 5;
2698
2699 // Whether the app is an instant app.
2700 optional bool is_instant_app = 6;
2701
2702 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002703 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002704
Bookatz80d11a02018-01-16 10:46:35 -08002705 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002706
David Chen0b5c90c2018-01-25 16:51:49 -08002707 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002708 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002709 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002710 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002711 optional int32 bind_application_delay_millis = 11;
2712 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002713
2714 // Empty if not set.
2715 optional string launch_token = 13;
2716
Calin Juravle759fbda2018-02-20 19:52:30 +00002717 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002718 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002719
2720 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002721 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002722}
2723
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002724message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002725 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002726 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002727
2728 // The app package name.
2729 optional string pkg_name = 2;
2730
2731 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002732 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002733 WARM = 1;
2734 HOT = 2;
2735 COLD = 3;
2736 }
2737 // The transition type.
2738 optional TransitionType type = 3;
2739
2740 // The activity name.
2741 optional string activity_name = 4;
2742}
2743
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002744message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002745 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002746 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002747
2748 // The app package name.
2749 optional string pkg_name = 2;
2750
2751 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002752 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002753 WITH_BUNDLE = 1;
2754 WITHOUT_BUNDLE = 2;
2755 }
2756 // The transition type.
2757 optional TransitionType type = 3;
2758
2759 // The activity name.
2760 optional string activity_name = 4;
2761
2762 optional bool transition_process_running = 5;
2763
2764 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002765 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002766}
2767
Bookatz8fcd09a2017-12-18 13:01:10 -08002768/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002769 * Logs a picture-in-picture action
2770 * Logged from:
2771 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2772 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2773 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2774 */
2775message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002776 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002777 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002778
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002779 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002780
Chenjie Yu52cacc62017-12-08 18:11:45 -08002781 enum State {
2782 ENTERED = 1;
2783 EXPANDED_TO_FULL_SCREEN = 2;
2784 MINIMIZED = 3;
2785 DISMISSED = 4;
2786 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002787 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002788}
2789
2790/**
Chenjie Yue8904192017-12-08 19:12:57 -08002791 * Logs overlay action
2792 * Logged from:
2793 * services/core/java/com/android/server/wm/Session.java
2794 */
2795message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002796 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002797
2798 optional string package_name = 2;
2799
2800 optional bool using_alert_window = 3;
2801
2802 enum State {
2803 ENTERED = 1;
2804 EXITED = 2;
2805 }
2806 optional State state = 4;
2807}
2808
Chenjie Yuccfe6452018-01-30 11:33:21 -08002809/*
2810 * Logs foreground service starts and stops.
2811 * Note that this is not when a service starts or stops, but when it is
2812 * considered foreground.
2813 * Logged from
2814 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2815 */
2816message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002817 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002818 // package_name + "/" + class_name
2819 optional string short_name = 2;
2820
2821 enum State {
2822 ENTER = 1;
2823 EXIT = 2;
2824 }
2825 optional State state = 3;
2826}
2827
Chenjie Yue8904192017-12-08 19:12:57 -08002828/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002829 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2830 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2831 * attributed back to the parent (host) uid. One example is Chrome.
2832 *
2833 * Logged from:
2834 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2835 */
2836message IsolatedUidChanged {
2837 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002838 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002839 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002840 optional int32 parent_uid = 1;
2841
2842 optional int32 isolated_uid = 2;
2843
2844 // We expect an isolated uid to be removed before if it's used for another parent uid.
2845 enum Event {
2846 REMOVED = 0;
2847 CREATED = 1;
2848 }
2849 optional Event event = 3;
2850}
2851
2852/*
2853 * Logs the reception of an incoming network packet causing the main system to wake up for
2854 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2855 * and processed by WakeupController.cpp.
2856 */
2857message PacketWakeupOccurred {
2858 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2859 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002860 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002861 // The interface name on which the packet was received.
2862 optional string iface = 2;
2863 // The ethertype value of the packet.
2864 optional int32 ethertype = 3;
2865 // String representation of the destination MAC address of the packet.
2866 optional string destination_hardware_address = 4;
2867 // String representation of the source address of the packet if this was an IP packet.
2868 optional string source_ip = 5;
2869 // String representation of the destination address of the packet if this was an IP packet.
2870 optional string destination_ip = 6;
2871 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2872 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2873 // families.
2874 optional int32 ip_next_header = 7;
2875 // The source port if this was a TCP or UDP packet.
2876 optional int32 source_port = 8;
2877 // The destination port if this was a TCP or UDP packet.
2878 optional int32 destination_port = 9;
2879}
2880
2881/*
2882 * Logs the memory stats for an app on startup.
2883 * Logged from:
2884 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2885 */
2886message AppStartMemoryStateCaptured {
2887 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002888 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002889
2890 // The process name.
2891 optional string process_name = 2;
2892
2893 // The activity name.
2894 optional string activity_name = 3;
2895
2896 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002897 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002898
2899 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002900 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002901
2902 // RSS
2903 optional int64 rss_in_bytes = 6;
2904
2905 // CACHE
2906 optional int64 cache_in_bytes = 7;
2907
2908 // SWAP
2909 optional int64 swap_in_bytes = 8;
2910}
2911
2912/*
2913 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2914 * for LMK event.
2915 * Logged from:
2916 * system/core/lmkd/lmkd.c
2917 */
2918message LmkStateChanged {
2919 enum State {
2920 UNKNOWN = 0;
2921 START = 1;
2922 STOP = 2;
2923 }
2924 optional State state = 1;
2925}
2926
2927/*
2928 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2929 * Logged from:
2930 * system/core/lmkd/lmkd.c
2931 */
2932message LmkKillOccurred {
2933 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002934 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002935
2936 // The process name.
2937 optional string process_name = 2;
2938
2939 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002940 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002941
2942 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002943 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002944
2945 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002946 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002947
2948 // RSS
2949 optional int64 rss_in_bytes = 6;
2950
2951 // CACHE
2952 optional int64 cache_in_bytes = 7;
2953
2954 // SWAP
2955 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002956
2957 // The elapsed real time of start of the process.
2958 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002959}
2960
Rajeev Kumar51b54602018-03-01 12:18:26 -08002961/*
2962 * Logs when the ActivityManagerService detects that an app died.
2963 *
2964 * Logged from:
2965 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2966 */
2967message AppDied {
2968 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002969 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08002970}
2971
Howard Ro21a039c2018-08-06 14:55:47 -07002972/**
2973 * An atom for generic metrics logging. Available from Android Q.
2974 */
2975message GenericAtom {
2976 // The uid of the application that sent this custom atom.
2977 optional int32 uid = 1 [(is_uid) = true];
2978
2979 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07002980 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07002981}
2982
Tej Singhd6d6d772018-09-05 17:41:25 -07002983/**
Kevin Chyn1741a072019-01-17 11:54:40 -08002984 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07002985 *
2986 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08002987 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07002988 */
Kevin Chyn1741a072019-01-17 11:54:40 -08002989message BiometricAcquired {
2990 // Biometric modality that was acquired.
2991 optional android.hardware.biometrics.ModalityEnum modality = 1;
2992 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
2993 optional int32 user = 2;
2994 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
2995 optional bool is_crypto = 3;
2996 // Action that the device is performing. Acquired messages are only expected for enroll and
2997 // authenticate. Other actions may indicate an error.
2998 optional android.hardware.biometrics.ActionEnum action = 4;
2999 // The client that this acquisition was received for.
3000 optional android.hardware.biometrics.ClientEnum client = 5;
3001 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3002 optional int32 acquire_info = 6;
3003 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3004 optional int32 acquire_info_vendor = 7;
Tej Singhd6d6d772018-09-05 17:41:25 -07003005}
3006
3007/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003008 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003009 *
3010 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003011 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003012 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003013message BiometricAuthenticated {
3014 // Biometric modality that was used.
3015 optional android.hardware.biometrics.ModalityEnum modality = 1;
3016 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3017 optional int32 user = 2;
3018 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3019 // storage.
3020 optional bool is_crypto = 3;
3021 // The client that this acquisition was received for.
3022 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003023 // If authentication requires user confirmation. See BiometricPrompt's
3024 // setRequireConfirmation(bool) method.
3025 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003026
Kevin Chyn1741a072019-01-17 11:54:40 -08003027 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003028 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003029 REJECTED = 1;
3030 PENDING_CONFIRMATION = 2;
3031 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003032 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003033
3034 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003035 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003036 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3037 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3038 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3039 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003040 optional int64 latency_millis = 7;
Kevin Chyn1741a072019-01-17 11:54:40 -08003041}
3042
3043/**
3044 * Logs when a biometric error occurs.
3045 *
3046 * Logged from:
3047 * frameworks/base/services/core/java/com/android/server/biometrics
3048 */
3049message BiometricErrorOccurred {
3050 // Biometric modality that was used.
3051 optional android.hardware.biometrics.ModalityEnum modality = 1;
3052 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3053 optional int32 user = 2;
3054 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3055 optional bool is_crypto = 3;
3056 // Action that the device is performing.
3057 optional android.hardware.biometrics.ActionEnum action = 4;
3058 // The client that this acquisition was received for.
3059 optional android.hardware.biometrics.ClientEnum client = 5;
3060 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3061 // are unique to modality.
3062 optional int32 error_info = 6;
3063 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3064 // by the vendor and not specified by the HIDL interface.
3065 optional int32 error_info_vendor = 7;
3066}
3067
3068/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003069 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003070 * Logged from:
3071 * frameworks/base/services/core/java/com/android/server/biometrics
3072 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003073message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003074 // Biometric modality.
3075 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003076 // Type of issue detected.
3077 optional android.hardware.biometrics.IssueEnum issue = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07003078}
Howard Ro688ae182018-09-25 00:09:36 -07003079
3080message Notification {
3081
3082 // Type of notification event.
3083 enum Type {
3084 TYPE_UNKNOWN = 0;
3085 // Notification became visible to the user.
3086 TYPE_OPEN = 1;
3087 // Notification became hidden.
3088 TYPE_CLOSE = 2;
3089 // Notification switched to detail mode.
3090 TYPE_DETAIL = 3;
3091 // Notification was clicked.
3092 TYPE_ACTION = 4;
3093 // Notification was dismissed.
3094 TYPE_DISMISS = 5;
3095 // Notification switched to summary mode. The enum value of 14 is to
3096 // match that of metrics_constants.
3097 TYPE_COLLAPSE = 14;
3098 }
3099 optional Type type = 1;
3100
3101 // Package name associated with the notification.
3102 optional string package_name = 2;
3103
3104 // Tag associated with notification.
3105 optional string tag = 3;
3106
3107 // Application-supplied ID associated with the notification.
3108 optional int32 id = 4;
3109
3110 // Index of notification in the notification panel.
3111 optional int32 shade_index = 5;
3112
3113 // The number of notifications in the notification panel.
3114 optional int32 shade_count = 6;
3115
3116 // Importance for the notification.
3117 optional int32 importance = 7;
3118
3119 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07003120 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07003121
3122 // Importance for the notification channel.
3123 optional int32 channel_importance = 9;
3124
Howard Ro183c2bd2018-10-18 13:52:10 -07003125 // Application-supplied ID associated with the notifications group.
3126 optional string group_id = 10;
3127
Howard Ro688ae182018-09-25 00:09:36 -07003128 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07003129 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07003130
Howard Ro183c2bd2018-10-18 13:52:10 -07003131 // Reason for dismissal of a notification. This field is only meaningful for
3132 // TYPE_DISMISS events.
3133 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07003134
Howard Ro183c2bd2018-10-18 13:52:10 -07003135 // The first post time of notification, stable across updates.
3136 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07003137
Howard Ro183c2bd2018-10-18 13:52:10 -07003138 // The most recent interruption time, or the creation time if no updates.
3139 // Differs from update_millis because updates are filtered based on whether
3140 // they actually interrupted the user.
3141 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07003142
Howard Ro183c2bd2018-10-18 13:52:10 -07003143 // The most recent update time, or the creation time if no updates.
3144 optional int64 update_millis = 15;
3145
3146 // The most recent visibility event.
3147 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07003148}
3149
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003150/*
Tej Singh0d176952019-01-16 19:10:54 -08003151 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003152 */
Tej Singh0d176952019-01-16 19:10:54 -08003153message FlagFlipUpdateOccurred {
3154 // If the event is from a flag config package, specify the package name.
3155 optional string flag_flip_package_name = 1;
3156
3157 // The order id of the package
3158 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003159}
3160
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003161/**
3162 * Potential experiment ids that goes with a train install.
3163 */
3164message TrainExperimentIds {
3165 repeated int64 experiment_id = 1;
3166}
3167
Yangster-macb89807e2018-11-15 21:10:57 -08003168/*
3169 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003170 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003171 */
3172message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003173 // Name of the train.
3174 optional string train_name = 1;
3175 // Version code for a "train" of packages that need to be installed atomically
3176 optional int64 train_version_code = 2;
3177 // After installation of this package, device requires a restart.
3178 optional bool requires_staging = 3;
3179 // Rollback should be enabled for this install.
3180 optional bool rollback_enabled = 4;
3181 // Requires low latency monitoring if possible.
3182 optional bool requires_low_latency_monitor = 5;
3183
Yangster-macb89807e2018-11-15 21:10:57 -08003184 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003185 UNKNOWN = 0;
3186 INSTALL_REQUESTED = 1;
3187 INSTALL_STARTED = 2;
3188 INSTALL_STAGED_NOT_READY = 3;
3189 INSTALL_STAGED_READY = 4;
3190 INSTALL_SUCCESS = 5;
3191 INSTALL_FAILURE = 6;
3192 INSTALL_CANCELLED = 7;
3193 INSTALLER_ROLLBACK_REQUESTED = 8;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003194 INSTALLER_ROLLBACK_SUCCESS = 9;
3195 INSTALLER_ROLLBACK_FAILURE = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08003196 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003197 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003198 // Possible experiment ids for monitoring this push.
3199 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3200 // user id
3201 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003202}
3203
Maggie Whitefc1aa592018-11-28 21:55:23 -08003204/** Represents USB port overheat event. */
3205message UsbPortOverheatEvent {
3206 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3207 optional int32 plug_temperature_deci_c = 1;
3208
3209 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3210 optional int32 max_temperature_deci_c = 2;
3211
3212 /* Time between USB plug event and overheat threshold trip, in seconds. */
3213 optional int32 time_to_overheat_secs = 3;
3214
3215 /* Time between overheat threshold trip and hysteresis, in seconds. */
3216 optional int32 time_to_hysteresis_secs = 4;
3217
3218 /* Time between hysteresis and active mitigation ending, in seconds. */
3219 optional int32 time_to_inactive_secs = 5;
3220};
3221
Maggie White8735b852019-01-18 11:40:49 -08003222/**
3223 * Logs total effective full charge and discharge cycles on a battery.
3224 * Here are some examples of one effective cycle:
3225 * 1) the battery charges from 0% to 100% and drains back to 0%,
3226 * 2) charging from 50% to 100% and draining back to 50% twice.
3227 * Pulled from:
3228 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3229 */
3230message BatteryCycleCount {
3231 /* Number of total charge and discharge cycles on the system battery. */
3232 optional int32 cycle_count = 1;
3233}
3234
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003235/**
3236 * Logs that an SD card is mounted and information about it, its type (public or private) and the
3237 * size in bytes.
3238 * Pulled from:
3239 * StatsCompanionService
3240 */
3241
3242message SDCardInfo {
3243
3244 enum Type {
3245 UNKNOWN = 0;
3246 TYPE_PUBLIC = 1;
3247 TYPE_PRIVATE = 2;
3248 OTHERS = 3;
3249 }
3250
3251 // Type of the SD card: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3252 optional Type type = 1;
3253 // Total size of the sd card in bytes.
3254 optional int64 size_bytes = 2;
3255}
3256
Yangster-macb89807e2018-11-15 21:10:57 -08003257/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003258 * Logs when a connection becomes available and lost.
3259 * Logged in StatsCompanionService.java
3260 */
3261message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003262 // Id of the network.
3263 optional int32 net_id = 1;
3264
3265 enum State {
3266 UNKNOWN = 0;
3267 CONNECTED = 1;
3268 DISCONNECTED = 2;
3269 }
3270 // Connected state of a network.
3271 optional State state = 2;
3272}
3273
3274/**
3275 * Logs when a service starts and stops.
3276 * Logged from:
3277 * services/core/java/com/android/server/am/ActiveServices.java
3278 */
3279message ServiceStateChanged {
3280
3281 optional int32 uid = 1 [(is_uid) = true];
3282
3283 optional string package_name = 2;
3284
3285 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003286
3287 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003288 START = 1;
3289 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003290 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003291
3292 optional State state = 4;
3293}
3294
3295/**
3296 * Logs when a service is launched.
3297 * Logged from:
3298 * services/core/java/com/android/server/am/ActiveServices.java
3299 */
3300message ServiceLaunchReported {
3301
3302 optional int32 uid = 1 [(is_uid) = true];
3303
3304 optional string package_name = 2;
3305
3306 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003307}
Howard Ro688ae182018-09-25 00:09:36 -07003308
Chenjie Yubbcbc602018-02-05 16:51:52 -08003309//////////////////////////////////////////////////////////////////////
3310// Pulled atoms below this line //
3311//////////////////////////////////////////////////////////////////////
3312
3313/**
David Chenc8a43242017-10-17 16:23:28 -07003314 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3315 *
3316 * Pulled from:
3317 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3318 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003319message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003320 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003321
3322 optional int64 rx_bytes = 2;
3323
3324 optional int64 rx_packets = 3;
3325
3326 optional int64 tx_bytes = 4;
3327
3328 optional int64 tx_packets = 5;
3329}
3330
3331/**
3332 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3333 *
3334 * Pulled from:
3335 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3336 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003337message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003338 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003339
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003340 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3341 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003342
3343 optional int64 rx_bytes = 3;
3344
3345 optional int64 rx_packets = 4;
3346
3347 optional int64 tx_bytes = 5;
3348
3349 optional int64 tx_packets = 6;
3350}
3351
3352/**
3353 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3354 *
3355 * Pulled from:
3356 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3357 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003358message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003359 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003360
3361 optional int64 rx_bytes = 2;
3362
3363 optional int64 rx_packets = 3;
3364
3365 optional int64 tx_bytes = 4;
3366
3367 optional int64 tx_packets = 5;
3368}
3369
3370/**
3371 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3372 *
3373 * Pulled from:
3374 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3375 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003376message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003377 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003378
Yao Chenc40a19d2018-03-15 16:48:25 -07003379 // 1 denotes foreground and 0 denotes background. This is called Set in
3380 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003381 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003382
3383 optional int64 rx_bytes = 3;
3384
3385 optional int64 rx_packets = 4;
3386
3387 optional int64 tx_bytes = 5;
3388
3389 optional int64 tx_packets = 6;
3390}
3391
3392/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003393 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3394 *
3395 * Pulled from:
3396 * StatsCompanionService
3397 */
3398message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003399 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003400
3401 optional int64 rx_bytes = 2;
3402
3403 optional int64 tx_bytes = 3;
3404}
3405
3406/**
David Chenc8a43242017-10-17 16:23:28 -07003407 * Pulls the kernel wakelock durations. This atom is adapted from
3408 * android/internal/os/KernelWakelockStats.java
3409 *
3410 * Pulled from:
3411 * StatsCompanionService using KernelWakelockReader.
3412 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003413message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003414 optional string name = 1;
3415
3416 optional int32 count = 2;
3417
3418 optional int32 version = 3;
3419
Yangster-maca8a30442018-10-13 23:46:34 -07003420 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003421}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003422
Chenjie Yu05013b32017-11-21 10:21:41 -08003423/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003424 * Pulls low power state information. If power.stats HAL is not available, this
3425 * includes platform and subsystem sleep state information,
3426 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3427 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003428 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003429 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003430 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3431 * as defined in:
3432 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003433 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003434message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003435 // Subsystem name
3436 optional string subsystem_name = 1;
3437 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3438 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003439 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3440 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003441 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003442 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003443 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003444 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003445 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003446}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003447
Chenjie Yu05013b32017-11-21 10:21:41 -08003448/**
Bookatz92da2832018-11-01 18:10:03 -07003449 * Pulls on-device power measurement information.
3450 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3451 * Pulled from:
3452 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3453 */
3454message OnDevicePowerMeasurement {
3455 // Name of the subsystem (to which the rail belongs).
3456 optional string subsystem_name = 1;
3457
3458 // Rail name. The rail lies within the subsystem.
3459 optional string rail_name = 2;
3460
3461 // Time (in ms since boot) at which the rail energy value was measured.
3462 // This may differ slightly from the time that statsd logs this information.
3463 optional uint64 measurement_timestamp_millis = 3;
3464
3465 // Accumulated energy used via the rail since device boot in uWs.
3466 optional uint64 energy_microwatt_secs = 4;
3467}
3468
3469/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003470 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003471 * Pulls the time the cpu spend on the frequency index. Frequency index
3472 * starts from highest to lowest. The value should be monotonically
3473 * increasing since boot. However, if there is a cpu
3474 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003475 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003476message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003477 optional uint32 cluster = 1;
3478 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003479 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003480}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003481
Chenjie Yu05013b32017-11-21 10:21:41 -08003482/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003483 * Pulls Cpu Time Per Uid.
3484 * Note that isolated process uid time should be attributed to host uids.
3485 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003486message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003487 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003488 optional uint64 user_time_micros = 2;
3489 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003490}
3491
3492/**
3493 * Pulls Cpu Time Per Uid per frequency.
3494 * Note that isolated process uid time should be attributed to host uids.
3495 * For each uid, we order the time by descending frequencies.
3496 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003497message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003498 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003499 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003500 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003501}
Hugo Benichi884970e2017-11-14 22:42:46 +09003502
Chenjie Yu05013b32017-11-21 10:21:41 -08003503/**
3504 * Pulls Wifi Controller Activity Energy Info
3505 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003506message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003507 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003508 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003509 // stack reported state
3510 // TODO: replace this with proto enum
3511 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003512 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003513 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003514 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003515 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003516 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003517 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003518 // product of current(mA), voltage(V) and time(ms)
3519 optional uint64 controller_energy_used = 6;
3520}
3521
3522/**
3523 * Pulls Modem Activity Energy Info
3524 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003525message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003526 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003527 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003528 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003529 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003530 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003531 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003532 /**
3533 * Tx power index
3534 * index 0 = tx_power < 0dBm
3535 * index 1 = 0dBm < tx_power < 5dBm
3536 * index 2 = 5dBm < tx_power < 15dBm
3537 * index 3 = 15dBm < tx_power < 20dBm
3538 * index 4 = tx_power > 20dBm
3539 */
3540 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003541 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003542 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003543 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003544 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003545 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003546 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003547 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003548 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003549 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003550 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003551 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003552 // product of current(mA), voltage(V) and time(ms)
3553 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003554}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003555
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003556/**
3557 * Pulls Bluetooth Activity Energy Info
3558 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3559 */
3560message BluetoothActivityInfo {
3561 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003562 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003563 // bluetooth stack state
3564 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003565 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003566 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003567 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003568 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003569 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003570 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003571 // product of current(mA), voltage(V) and time(ms)
3572 optional uint64 energy_used = 6;
3573}
3574
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003575/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003576 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003577 *
3578 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003579 */
3580message ProcessMemoryState {
3581 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003582 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003583
3584 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003585 // Usually package name, "system" for system server.
3586 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003587 optional string process_name = 2;
3588
Rafal Slawikda51b932018-12-13 16:31:33 +00003589 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003590 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003591
3592 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003593 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003594
3595 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003596 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003597
Rajeev Kumar90235992018-01-29 11:06:48 -08003598 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003599 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3600 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003601 optional int64 rss_in_bytes = 6;
3602
3603 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003604 // Value is read from memory.stat, field total_cache if per-app memory
3605 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003606 optional int64 cache_in_bytes = 7;
3607
3608 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003609 // Value is read from memory.stat, field total_swap if per-app memory
3610 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003611 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003612
Rafal Slawikd03ae422018-11-20 11:27:45 +00003613 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003614 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003615
3616 // Elapsed real time when the process started.
3617 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3618 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003619}
3620
3621/*
Rafal Slawik08621582018-10-15 14:53:07 +01003622 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003623 *
3624 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003625 */
3626message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003627 // The uid if available. -1 means not available.
3628 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003629
Rafal Slawikbf67d072018-10-23 11:07:54 +01003630 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003631 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003632 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003633
Rafal Slawikbf67d072018-10-23 11:07:54 +01003634 // # of page-faults
3635 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003636
Rafal Slawikbf67d072018-10-23 11:07:54 +01003637 // # of major page-faults
3638 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003639
Rafal Slawikbf67d072018-10-23 11:07:54 +01003640 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003641 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003642 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003643
Rafal Slawikd03ae422018-11-20 11:27:45 +00003644 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003645 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003646
3647 // Elapsed real time when the process started.
3648 // Value is read from /proc/PID/stat, field 22.
3649 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01003650}
3651
3652/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003653 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003654 *
3655 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3656 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003657 *
3658 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003659 */
3660message ProcessMemoryHighWaterMark {
3661 // The uid if available. -1 means not available.
3662 optional int32 uid = 1 [(is_uid) = true];
3663
Rafal Slawikda51b932018-12-13 16:31:33 +00003664 // The process name.
3665 // Usually package name or process cmdline.
3666 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003667 optional string process_name = 2;
3668
3669 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3670 // /proc/PID/status.
3671 optional int64 rss_high_water_mark_in_bytes = 3;
3672}
3673
3674/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003675 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003676 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003677message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003678 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003679}
3680
3681/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003682 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003683 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003684message SystemUptime {
3685 // Milliseconds since the system was booted.
3686 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3687 // for external input).
3688 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003689 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003690}
3691
3692/*
3693 * Reads from /proc/uid_concurrent_active_time which has the format:
3694 * active: X (X is # cores)
3695 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3696 * [uid1]: [time-0] [time-1] [time-2] ... ...
3697 * ...
3698 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3699 * The file contains a monotonically increasing count of time for a single boot.
3700 */
3701message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003702 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003703 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003704}
3705
3706/**
3707 * Reads from /proc/uid_concurrent_policy_time which has the format:
3708 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3709 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3710 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3711 * ...
3712 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3713 * The file contains a monotonically increasing count of time for a single boot.
3714 */
3715message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003716 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003717 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003718 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003719}
3720
3721/*
3722 * Pulls free disk space, for data, system partition and temporary directory.
3723 */
3724message DiskSpace {
3725 // available bytes in data partition
3726 optional uint64 data_available_bytes = 1;
3727 // available bytes in system partition
3728 optional uint64 system_available_bytes = 2;
3729 // available bytes in download cache or temp directories
3730 optional uint64 temp_available_bytes = 3;
3731}
Tej Singhbf972d92018-01-10 20:51:13 -08003732
3733/**
3734 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003735 *
3736 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003737 */
3738message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003739 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003740}
3741
3742/**
3743 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003744 * Pulled from:
3745 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003746 */
3747message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003748 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003749}
3750
3751/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003752 * Pulls battery voltage.
3753 * Pulled from:
3754 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3755 */
3756message BatteryVoltage {
3757 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003758 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003759}
3760
3761/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003762 * Pulls battery level (percent full, from 0 to 100).
3763 *
3764 * Pulled from:
3765 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3766 */
3767message BatteryLevel {
3768 // Battery level. Should be in [0, 100].
3769 optional int32 battery_level = 1;
3770}
3771
3772/**
Tej Singhd89137e2018-03-26 14:51:40 -07003773 * Pulls the temperature of various parts of the device.
3774 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003775 *
3776 * Pulled from:
3777 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3778 */
3779message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003780 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003781 optional android.os.TemperatureTypeEnum sensor_location = 1;
3782
3783 // The name of the temperature source. Eg. CPU0
3784 optional string sensor_name = 2;
3785
Tej Singhd89137e2018-03-26 14:51:40 -07003786 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003787 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003788 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003789}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003790
3791/**
3792 * Pulls the statistics of calls to Binder.
3793 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003794 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3795 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003796 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003797 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003798 */
3799message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003800 // UID of the process responsible for the binder transaction. It will be set if the process
3801 // executing the binder transaction attribute the transaction to another uid using
3802 // Binder.setThreadWorkSource().
3803 //
3804 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003805 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003806 // UID of the process executing the binder transaction.
3807 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003808 // Fully qualified class name of the API call.
3809 //
3810 // This is a system server class name.
3811 //
3812 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3813 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3814 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3815 // commonly used APIs.
3816 optional string service_class_name = 2;
3817 // Method name of the API call. It can also be a transaction code if we cannot
3818 // resolve it to a name. See Binder#getTransactionName.
3819 //
3820 // This is a system server method name.
3821 optional string service_method_name = 3;
3822 // Total number of API calls.
3823 optional int64 call_count = 4;
3824 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3825 optional bool screen_interactive = 13;
3826 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3827 // call_count will be equal to recorded_call_count.
3828 //
3829 // If recorded_call_count is different than call_count, it means data collection has been
3830 // sampled. All the fields below will be sampled in this case.
3831 optional int64 recorded_call_count = 12;
3832 // Number of exceptions thrown by the API.
3833 optional int64 recorded_exception_count = 5;
3834 // Total latency of all API calls.
3835 // Average can be computed using total_latency_micros / recorded_call_count.
3836 optional int64 recorded_total_latency_micros = 6;
3837 // Maximum latency of one API call.
3838 optional int64 recorded_max_latency_micros = 7;
3839 // Total CPU usage of all API calls.
3840 // Average can be computed using total_cpu_micros / recorded_call_count.
3841 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3842 optional int64 recorded_total_cpu_micros = 8;
3843 // Maximum CPU usage of one API call.
3844 optional int64 recorded_max_cpu_micros = 9;
3845 // Maximum parcel reply size of one API call.
3846 optional int64 recorded_max_reply_size_bytes = 10;
3847 // Maximum parcel request size of one API call.
3848 optional int64 recorded_max_request_size_bytes = 11;
3849}
3850
3851/**
3852 * Pulls the statistics of exceptions during calls to Binder.
3853 *
3854 * Binder stats are cumulative from boot unless somebody reset the data using
3855 * > adb shell dumpsys binder_calls_stats --reset
3856 */
3857message BinderCallsExceptions {
3858 // Exception class name, e.g. java.lang.IllegalArgumentException.
3859 //
3860 // This is an exception class name thrown by the system server.
3861 optional string exception_class_name = 1;
3862 // Total number of exceptions.
3863 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003864}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003865
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003866/**
3867 * Pulls the statistics of message dispatching on HandlerThreads.
3868 *
3869 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
3870 * config on the device.
3871 *
3872 * Next tag: 11
3873 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003874message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01003875 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003876 optional int32 uid = 1 [(is_uid) = true];
3877
3878 // Fully qualified class name of the handler target class.
3879 //
3880 // This field does not contain PII. This is a system server class name.
3881 optional string handler_class_name = 2;
3882
3883 // The name of the thread that runs the Looper.
3884 //
3885 // This field does not contain PII. This is a system server thread name.
3886 optional string looper_thread_name = 3;
3887
3888 // The name of the dispatched message.
3889 //
3890 // This field does not contain PII. This is a system server constant or class
3891 // name.
3892 optional string message_name = 4;
3893
3894 // Total number of successfully dispatched messages.
3895 optional int64 message_count = 5;
3896
3897 // Total number of messages that failed dispatching.
3898 optional int64 exception_count = 6;
3899
3900 // Total number of processed messages we have data recorded for. If we
3901 // collected data for all the messages, message_count will be equal to
3902 // recorded_message_count.
3903 //
3904 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003905 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003906 optional int64 recorded_message_count = 7;
3907
3908 // Total latency of all processed messages.
3909 // Average can be computed using recorded_total_latency_micros /
3910 // recorded_message_count.
3911 optional int64 recorded_total_latency_micros = 8;
3912
3913 // Total CPU usage of all processed message.
3914 // Average can be computed using recorded_total_cpu_micros /
3915 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003916 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003917 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003918
3919 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3920 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003921
3922 // Max recorded CPU usage of all processed messages.
3923 optional int64 recorded_max_cpu_micros = 11;
3924
3925 // Max recorded latency of all processed messages.
3926 optional int64 recorded_max_latency_micros = 12;
3927
3928 // Total number of messages we tracked the dispatching delay for. If we
3929 // collected data for all the messages, message_count will be equal to
3930 // recorded_delay_message_count.
3931 //
3932 // If recorded_delay_message_count is different than message_count, it means data
3933 // collection has been sampled or/and not all messages specified the target dispatch time.
3934 // The fields below will be sampled in this case.
3935 optional int64 recorded_delay_message_count = 13;
3936
3937 // Total dispatching delay of all processed messages.
3938 // Calculated as a difference between the target dispatching time (Message.when)
3939 // and the actual dispatching time.
3940 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
3941 optional int64 recorded_total_delay_millis = 14;
3942
3943 // Max dispatching delay of all processed messages.
3944 // Calculated as a difference between the target dispatching time (Message.when)
3945 // and the actual dispatching time.
3946 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003947}
Tej Singh86dc9db2018-09-06 00:39:57 +00003948
3949/**
3950 * Pulls disk information, such as write speed and latency.
3951 */
3952message DiskStats {
3953 // Time taken to open, write 512B to, and close a file.
3954 // -1 if error performing the check.
3955 optional int64 data_write_latency_millis = 1;
3956
3957 optional bool file_based_encryption = 2;
3958
3959 // Recent disk write speed in kB/s.
3960 // -1 if error querying storageed.
3961 // 0 if data is unavailable.
3962 optional int32 recent_disk_write_speed = 3;
3963}
3964
3965
3966/**
3967 * Free and total bytes of the Data, Cache, and System partition.
3968 */
3969message DirectoryUsage {
3970 enum Directory {
3971 UNKNOWN = 0;
3972 DATA = 1;
3973 CACHE = 2;
3974 SYSTEM = 3;
3975 }
3976 optional Directory directory = 1;
3977 optional int64 free_bytes = 2;
3978 optional int64 total_bytes = 3;
3979}
3980
3981
3982/**
3983 * Size of an application: apk size, data size, and cache size.
3984 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3985 * Information is only reported for apps with the primary user (user 0).
3986 * Sizes are aggregated by package name.
3987 */
3988message AppSize {
3989 // Including uids will involve modifying diskstats logic.
3990 optional string package_name = 1;
3991 // App size in bytes. -1 if unavailable.
3992 optional int64 app_size_bytes = 2;
3993 // App data size in bytes. -1 if unavailable.
3994 optional int64 app_data_size_bytes = 3;
3995 // App cache size in bytes. -1 if unavailable.
3996 optional int64 app_cache_size_bytes = 4;
3997 // Time that the cache file was produced.
3998 // Uses System.currentTimeMillis(), which is wall clock time.
3999 optional int64 cache_time_millis = 5;
4000}
4001
4002
4003/**
4004 * Size of a particular category. Eg: photos, videos.
4005 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4006 */
4007message CategorySize {
4008 enum Category {
4009 UNKNOWN = 0;
4010 APP_SIZE = 1;
4011 APP_DATA_SIZE = 2;
4012 APP_CACHE_SIZE = 3;
4013 PHOTOS = 4;
4014 VIDEOS = 5;
4015 AUDIO = 6;
4016 DOWNLOADS = 7;
4017 SYSTEM = 8;
4018 OTHER = 9;
4019 }
4020 optional Category category = 1;
4021 // Category size in bytes.
4022 optional int64 size_bytes = 2;
4023 // Time that the cache file was produced.
4024 // Uses System.currentTimeMillis(), which is wall clock time.
4025 optional int64 cache_time_millis = 3;
4026}
Tej Singhd6d6d772018-09-05 17:41:25 -07004027
4028/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004029 * Pulls per uid I/O stats. The stats are cumulative since boot.
4030 *
4031 * Read/write bytes are I/O events from a storage device
4032 * Read/write chars are data requested by read/write syscalls, and can be
4033 * satisfied by caching.
4034 *
4035 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4036 */
4037message DiskIo {
4038 optional int32 uid = 1 [(is_uid) = true];
4039 optional int64 fg_chars_read = 2;
4040 optional int64 fg_chars_write = 3;
4041 optional int64 fg_bytes_read = 4;
4042 optional int64 fg_bytes_write = 5;
4043 optional int64 bg_chars_read = 6;
4044 optional int64 bg_chars_write = 7;
4045 optional int64 bg_bytes_read = 8;
4046 optional int64 bg_bytes_write = 9;
4047 optional int64 fg_fsync = 10;
4048 optional int64 bg_fsync= 11;
4049}
4050
4051
4052/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004053 * Pulls the number of fingerprints for each user.
4054 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004055 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004056 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004057message NumBiometricsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004058 // The associated user. Eg: 0 for owners, 10+ for others.
4059 // Defined in android/os/UserHandle.java
4060 optional int32 user = 1;
4061 // Number of fingerprints registered to that user.
Kevin Chyn1741a072019-01-17 11:54:40 -08004062 optional int32 num_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004063}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004064
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004065/**
4066 * A mapping of role holder -> role
4067 */
4068message RoleHolder {
4069 // uid of the role holder
4070 optional int32 uid = 1 [(is_uid) = true];
4071
4072 // package name of the role holder
4073 optional string package_name = 2;
4074
4075 // the role held
4076 optional string role = 3;
4077}
4078
Yangsteraf9aee72018-10-12 09:26:16 -07004079message AggStats {
4080 optional int64 min = 1;
4081
4082 optional int64 average = 2;
4083
4084 optional int64 max = 3;
4085}
4086
4087message ProcessStatsStateProto {
4088 optional android.service.procstats.ScreenState screen_state = 1;
4089
4090 optional android.service.procstats.MemoryState memory_state = 2;
4091
4092 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4093 // and not frameworks/base/core/java/android/app/ActivityManager.java
4094 optional android.service.procstats.ProcessState process_state = 3;
4095
4096 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004097 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004098
4099 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004100 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004101
4102 // # of samples taken
4103 optional int32 sample_size = 5;
4104
4105 // PSS is memory reserved for this process
4106 optional AggStats pss = 6;
4107
4108 // USS is memory shared between processes, divided evenly for accounting
4109 optional AggStats uss = 7;
4110
4111 // RSS is memory resident for this process
4112 optional AggStats rss = 8;
4113}
4114
4115// Next Tag: 7
4116message ProcessStatsProto {
4117 // Name of process.
4118 optional string process = 1;
4119
4120 // Uid of the process.
4121 optional int32 uid = 2;
4122
4123 // Information about how often kills occurred
4124 message Kill {
4125 // Count of excessive CPU kills
4126 optional int32 cpu = 1;
4127
4128 // Count of kills when cached
4129 optional int32 cached = 2;
4130
4131 // PSS stats during cached kill
4132 optional AggStats cached_pss = 3;
4133 }
4134 optional Kill kill = 3;
4135
4136 // Time and memory spent in various states.
4137 repeated ProcessStatsStateProto states = 5;
4138
4139 // Total time process has been running... screen_state, memory_state, and process_state
4140 // will not be set.
4141 optional ProcessStatsStateProto total_running_state = 6;
4142}
4143
4144message PackageServiceOperationStatsProto {
4145 // Operate enum: Started, Foreground, Bound, Executing
4146 optional android.service.procstats.ServiceOperationState operation = 1;
4147
4148 // Number of times the service was in this operation.
4149 optional int32 count = 2;
4150
4151 // Information about a state the service can be in.
4152 message StateStats {
4153 // Screen state enum.
4154 optional android.service.procstats.ScreenState screen_state = 1;
4155 // Memory state enum.
4156 optional android.service.procstats.MemoryState memory_state = 2;
4157
4158 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004159 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004160 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004161 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004162 }
4163 repeated StateStats state_stats = 3;
4164}
4165
4166message PackageServiceStatsProto {
4167 // Name of service component.
4168 optional string service_name = 1;
4169
4170 // The operation stats.
4171 // The package_name, package_uid, package_version, service_name will not be set to save space.
4172 repeated PackageServiceOperationStatsProto operation_stats = 2;
4173}
4174
4175message PackageAssociationSourceProcessStatsProto {
4176 // Uid of the process.
4177 optional int32 process_uid = 1;
4178 // Process name.
4179 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004180 // Package name.
4181 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004182 // Total count of the times this association appeared.
4183 optional int32 total_count = 3;
4184
4185 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004186 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004187
4188 // Total count of the times this association became actively impacting its target process.
4189 optional int32 active_count = 5;
4190
4191 // Information on one source in this association.
4192 message StateStats {
4193 // Process state enum.
4194 optional android.service.procstats.ProcessState process_state = 1;
4195 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004196 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004197 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004198 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004199 }
4200 repeated StateStats active_state_stats = 6;
4201}
4202
4203message PackageAssociationProcessStatsProto {
4204 // Name of the target component.
4205 optional string component_name = 1;
4206 // Information on one source in this association.
4207 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4208}
4209
4210
4211message ProcessStatsPackageProto {
4212 // Name of package.
4213 optional string package = 1;
4214
4215 // Uid of the package.
4216 optional int32 uid = 2;
4217
4218 // Version of the package.
4219 optional int64 version = 3;
4220
4221 // Stats for each process running with the package loaded in to it.
4222 repeated ProcessStatsProto process_stats = 4;
4223
4224 // Stats for each of the package's services.
4225 repeated PackageServiceStatsProto service_stats = 5;
4226
4227 // Stats for each association with the package.
4228 repeated PackageAssociationProcessStatsProto association_stats = 6;
4229}
4230
4231message ProcessStatsSectionProto {
4232 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004233 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004234
4235 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004236 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004237
4238 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004239 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004240
4241 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004242 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004243
4244 // System runtime library. e.g. "libdvm.so", "libart.so".
4245 optional string runtime = 5;
4246
4247 // whether kernel reports swapped pss.
4248 optional bool has_swapped_pss = 6;
4249
4250 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4251 enum Status {
4252 STATUS_UNKNOWN = 0;
4253 STATUS_COMPLETE = 1;
4254 STATUS_PARTIAL = 2;
4255 STATUS_SHUTDOWN = 3;
4256 STATUS_SYSPROPS = 4;
4257 }
4258 repeated Status status = 7;
4259
Chenjie Yub2ecc792019-01-17 10:27:26 -08004260 // Number of pages available of various types and sizes, representation fragmentation.
4261 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4262
Yangsteraf9aee72018-10-12 09:26:16 -07004263 // Stats for each process.
4264 repeated ProcessStatsProto process_stats = 8;
4265
4266 // Stats for each package.
4267 repeated ProcessStatsPackageProto package_stats = 9;
4268}
4269
Chenjie Yub2ecc792019-01-17 10:27:26 -08004270message ProcessStatsAvailablePagesProto {
4271 // Node these pages are in (as per /proc/pagetypeinfo)
4272 optional int32 node = 1;
4273
4274 // Zone these pages are in (as per /proc/pagetypeinfo)
4275 optional string zone = 2;
4276
4277 // Label for the type of these pages (as per /proc/pagetypeinfo)
4278 optional string label = 3;
4279
4280 // Distribution of number of pages available by order size. First entry in array is
4281 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4282 repeated int32 pages_per_order = 4;
4283}
4284
Chenjie Yu12e5e672018-09-14 15:54:59 -07004285/**
4286 * Pulled from ProcessStatsService.java
4287 */
4288message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004289 optional ProcessStatsSectionProto proc_stats_section = 1;
4290}
4291
Chenjie Yuf910b7802019-01-11 16:08:20 -08004292/**
4293 * Pulled from ProcessStatsService.java
4294 */
4295message ProcStatsPkgProc {
4296 optional ProcessStatsSectionProto proc_stats_section = 1;
4297}
4298
Yangsteraf9aee72018-10-12 09:26:16 -07004299message PowerProfileProto {
4300 optional double cpu_suspend = 1;
4301
4302 optional double cpu_idle = 2;
4303
4304 optional double cpu_active = 3;
4305
4306 message CpuCluster {
4307 optional int32 id = 1;
4308 optional double cluster_power = 2;
4309 optional int32 cores = 3;
4310 repeated int64 speed = 4;
4311 repeated double core_power = 5;
4312 }
4313
4314 repeated CpuCluster cpu_cluster = 40;
4315
4316 optional double wifi_scan = 4;
4317
4318 optional double wifi_on = 5;
4319
4320 optional double wifi_active = 6;
4321
4322 optional double wifi_controller_idle = 7;
4323
4324 optional double wifi_controller_rx = 8;
4325
4326 optional double wifi_controller_tx = 9;
4327
4328 repeated double wifi_controller_tx_levels = 10;
4329
4330 optional double wifi_controller_operating_voltage = 11;
4331
4332 optional double bluetooth_controller_idle = 12;
4333
4334 optional double bluetooth_controller_rx = 13;
4335
4336 optional double bluetooth_controller_tx = 14;
4337
4338 optional double bluetooth_controller_operating_voltage = 15;
4339
4340 optional double modem_controller_sleep = 16;
4341
4342 optional double modem_controller_idle = 17;
4343
4344 optional double modem_controller_rx = 18;
4345
4346 repeated double modem_controller_tx = 19;
4347
4348 optional double modem_controller_operating_voltage = 20;
4349
4350 optional double gps_on = 21;
4351
4352 repeated double gps_signal_quality_based = 22;
4353
4354 optional double gps_operating_voltage = 23;
4355
4356 optional double bluetooth_on = 24;
4357
4358 optional double bluetooth_active = 25;
4359
4360 optional double bluetooth_at_cmd = 26;
4361
4362 optional double ambient_display = 27;
4363
4364 optional double screen_on = 28;
4365
4366 optional double radio_on = 29;
4367
4368 optional double radio_scanning = 30;
4369
4370 optional double radio_active = 31;
4371
4372 optional double screen_full = 32;
4373
4374 optional double audio = 33;
4375
4376 optional double video = 34;
4377
4378 optional double flashlight = 35;
4379
4380 optional double memory = 36;
4381
4382 optional double camera = 37;
4383
4384 optional double wifi_batched_scan = 38;
4385
4386 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004387}
Chenjie Yuab530202018-09-26 12:39:20 -07004388
4389/**
4390 * power_profile.xml and other constants for power model calculations.
4391 * Pulled from PowerProfile.java
4392 */
4393message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004394 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004395}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004396
4397/**
arangelovd5db50e2018-10-12 20:24:39 +01004398 * Logs when a user restriction was added or removed.
4399 *
4400 * Logged from:
4401 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4402 */
4403message UserRestrictionChanged {
4404 // The raw string of the user restriction as defined in UserManager.
4405 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4406 optional string restriction = 1;
4407 // Whether the restriction is enabled or disabled.
4408 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004409}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004410
4411/**
4412 * Pulls process user time and system time. Puller takes a snapshot of all pids
4413 * in the system and returns cpu stats for those that are working at the time.
4414 * Dead pids will be dropped. Kernel processes are excluded.
4415 * Min cool-down is 5 sec.
4416 */
4417message ProcessCpuTime {
4418 optional int32 uid = 1 [(is_uid) = true];
4419
4420 optional string process_name = 2;
4421 // Process cpu time in user space, cumulative from boot/process start
4422 optional int64 user_time_millis = 3;
4423 // Process cpu time in system space, cumulative from boot/process start
4424 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004425}
Misha Wagner5a51e002018-10-03 15:04:09 +01004426
4427/**
4428 * Pulls the CPU usage for each thread.
4429 *
4430 * Read from /proc/$PID/task/$TID/time_in_state files.
4431 *
4432 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4433 * time_in_state files not being present on some phones, have not been addressed. These should be
4434 * considered before a public release.
4435 */
4436message CpuTimePerThreadFreq {
4437 // UID that owns the process.
4438 optional int32 uid = 1 [(is_uid) = true];
4439 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004440 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004441 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004442 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004443 // Name of the process taken from `/proc/$PID/cmdline`.
4444 optional string process_name = 4;
4445 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4446 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004447
4448 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4449 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4450 // frequencies are given here as the alternative is sending eight separate atoms. This method
4451 // significantly reduces the amount of data created
4452 optional int32 frequency1_khz = 6;
4453 optional int32 time1_millis = 7;
4454 optional int32 frequency2_khz = 8;
4455 optional int32 time2_millis = 9;
4456 optional int32 frequency3_khz = 10;
4457 optional int32 time3_millis = 11;
4458 optional int32 frequency4_khz = 12;
4459 optional int32 time4_millis = 13;
4460 optional int32 frequency5_khz = 14;
4461 optional int32 time5_millis = 15;
4462 optional int32 frequency6_khz = 16;
4463 optional int32 time6_millis = 17;
4464 optional int32 frequency7_khz = 18;
4465 optional int32 time7_millis = 19;
4466 optional int32 frequency8_khz = 20;
4467 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004468}
Bookatz75ee6042018-11-09 12:27:37 -08004469
4470/**
Bookatz366a4432018-11-20 09:42:33 -08004471 * Pulls information about the device's build.
4472 */
4473message BuildInformation {
4474 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4475 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4476 optional string fingerprint = 1;
4477
4478 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4479 optional string brand = 2;
4480
4481 // Build.PRODUCT. The name of the overall product.
4482 optional string product = 3;
4483
4484 // Build.DEVICE. The name of the industrial design.
4485 optional string device = 4;
4486
4487 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4488 optional string version_release = 5;
4489
4490 // Build.ID. E.g. a label like "M4-rc20".
4491 optional string id = 6;
4492
4493 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4494 // represent this build.
4495 optional string version_incremental = 7;
4496
4497 // Build.TYPE. The type of build, like "user" or "eng".
4498 optional string type = 8;
4499
4500 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4501 optional string tags = 9;
4502}
4503
4504/**
Bookatz75ee6042018-11-09 12:27:37 -08004505 * Pulls on-device BatteryStats power use calculations for the overall device.
4506 */
4507message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004508 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4509 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4510 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4511 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08004512}
4513
4514/**
4515 * Pulls on-device BatteryStats power use calculations broken down by uid.
4516 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4517 * that is attributed to non-uid items. They must all be included to get the total power use.
4518 */
4519message DeviceCalculatedPowerBlameUid {
4520 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4521 optional int32 uid = 1 [(is_uid) = true];
4522
Bookatz3dbc13a2018-12-21 12:16:51 -08004523 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4524 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4525 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08004526}
4527
4528/**
4529 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4530 * drain type.
4531 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4532 * is attributed uids. They must all be included to get the total power use.
4533 */
4534message DeviceCalculatedPowerBlameOther {
4535 // The type of item whose power use is being reported.
4536 enum DrainType {
4537 AMBIENT_DISPLAY = 0;
4538 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4539 BLUETOOTH = 2;
4540 CAMERA = 3;
4541 // Cell-standby
4542 CELL = 4;
4543 FLASHLIGHT = 5;
4544 IDLE = 6;
4545 MEMORY = 7;
4546 // Amount that total computed drain exceeded the drain estimated using the
4547 // battery level changes and capacity.
4548 OVERCOUNTED = 8;
4549 PHONE = 9;
4550 SCREEN = 10;
4551 // Amount that total computed drain was below the drain estimated using the
4552 // battery level changes and capacity.
4553 UNACCOUNTED = 11;
4554 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4555 WIFI = 13;
4556 }
4557 optional DrainType drain_type = 1;
4558
Bookatz3dbc13a2018-12-21 12:16:51 -08004559 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4560 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4561 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004562}
arangelov4e994062018-11-13 16:12:38 +00004563
4564/**
4565 * Logs device policy features.
4566 *
4567 * Logged from:
4568 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4569 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4570 */
4571message DevicePolicyEvent {
4572 // The event id - unique for each event.
4573 optional android.stats.devicepolicy.EventId event_id = 1;
4574 // The admin package name.
4575 optional string admin_package_name = 2;
4576 // A generic integer parameter.
4577 optional int32 integer_value = 3;
4578 // A generic boolean parameter.
4579 optional bool boolean_value = 4;
4580 // A parameter specifying a time period in milliseconds.
4581 optional uint64 time_period_millis = 5;
4582 // A parameter specifying a list of package names, bundle extras or string parameters.
4583 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4584}
shawnlinea5b66b2018-11-13 15:05:29 +08004585
4586/**
4587 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4588 *
4589 * Logged from:
4590 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4591 */
4592message DocsUILaunchReported {
4593 optional android.stats.docsui.LaunchAction launch_action = 1;
4594 optional bool has_initial_uri = 2;
4595 optional android.stats.docsui.MimeType mime_type = 3;
4596 optional android.stats.docsui.Root initial_root = 4;
4597}
4598
4599/**
4600 * Logs root/app visited event in file managers/picker. Call this when the user
4601 * taps on root/app in hamburger menu.
4602 *
4603 * Logged from:
4604 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4605 */
4606message DocsUIRootVisitedReported {
4607 optional android.stats.docsui.ContextScope scope = 1;
4608 optional android.stats.docsui.Root root = 2;
4609}
4610
4611/**
4612 * Logs file operation stats. Call this when a file operation has completed.
4613 *
4614 * Logged from:
4615 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4616 */
4617message DocsUIFileOperationReported {
4618 optional android.stats.docsui.Provider provider = 1;
4619 optional android.stats.docsui.FileOperation file_op = 2;
4620}
4621
4622/**
4623 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4624 * mode.
4625 *
4626 * Logged from:
4627 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4628 */
4629message DocsUIFileOperationCopyMoveModeReported {
4630 optional android.stats.docsui.FileOperation file_op = 1;
4631 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4632}
4633
4634
4635/**
4636 * Logs file sub operation stats. Call this when a file operation has failed.
4637 *
4638 * Logged from:
4639 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4640 */
4641message DocsUIFileOperationFailureReported {
4642 optional android.stats.docsui.Authority authority = 1;
4643 optional android.stats.docsui.SubFileOperation sub_op = 2;
4644}
4645
4646/**
4647* Logs the cancellation of a file operation. Call this when a job is canceled
4648*
4649* Logged from:
4650* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4651*/
4652message DocsUIFileOperationCanceledReported {
4653 optional android.stats.docsui.FileOperation file_op = 1;
4654}
4655
4656/**
4657 * Logs startup time in milliseconds.
4658 *
4659 * Logged from:
4660 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4661 */
4662message DocsUIStartupMsReported {
4663 optional int32 startup_millis = 1;
4664}
4665
4666/**
4667 * Logs the action that was started by user.
4668 *
4669 * Logged from:
4670 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4671 */
4672message DocsUIUserActionReported {
4673 optional android.stats.docsui.UserAction action = 1;
4674}
4675
4676/**
4677 * Logs the invalid type when invalid scoped access is requested.
4678 *
4679 * Logged from:
4680 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4681 */
4682message DocsUIInvalidScopedAccessRequestReported {
4683 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004684}
Ben Murdochbab399f2018-12-06 11:01:38 +00004685
4686/**
shawnlina75e82d2019-01-07 10:31:12 +08004687 * Logs the package name that launches docsui picker mode.
4688 *
4689 * Logged from:
4690 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4691 */
4692message DocsUIPickerLaunchedFromReported {
4693 optional string package_name = 1;
4694}
4695
4696/**
4697 * Logs the search type.
4698 *
4699 * Logged from:
4700 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4701 */
4702message DocsUISearchTypeReported {
4703 optional android.stats.docsui.SearchType search_type = 1;
4704}
4705
4706/**
4707 * Logs the search mode.
4708 *
4709 * Logged from:
4710 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4711 */
4712message DocsUISearchModeReported {
4713 optional android.stats.docsui.SearchMode search_mode = 1;
4714}
4715
4716/**
4717 * Logs the pick result information.
4718 *
4719 * Logged from:
4720 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4721 */
4722message DocsUIPickResultReported {
4723 optional int32 total_action_count = 1;
4724 optional int64 duration_millis = 2;
4725 optional int32 file_count= 3;
4726 optional bool is_searching = 4;
4727 optional android.stats.docsui.Root picked_from = 5;
4728 optional android.stats.docsui.MimeType mime_type = 6;
4729 optional int32 repeatedly_pick_times = 7;
4730}
4731
4732/**
Ben Murdochbab399f2018-12-06 11:01:38 +00004733 * Logs when an app's memory is compacted.
4734 *
4735 * Logged from:
4736 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4737 */
4738message AppCompacted {
4739 // The pid of the process being compacted.
4740 optional int32 pid = 1;
4741
4742 // The name of the process being compacted.
4743 optional string process_name = 2;
4744
4745 // The type of compaction.
4746 enum Action {
4747 UNKNOWN = 0;
4748 SOME = 1;
4749 FULL = 2;
4750 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004751 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00004752
4753 // Total RSS in kilobytes consumed by the process prior to compaction.
4754 optional int64 before_rss_total_kilobytes = 4;
4755
4756 // File RSS in kilobytes consumed by the process prior to compaction.
4757 optional int64 before_rss_file_kilobytes = 5;
4758
4759 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4760 optional int64 before_rss_anon_kilobytes = 6;
4761
4762 // Swap in kilobytes consumed by the process prior to compaction.
4763 optional int64 before_swap_kilobytes = 7;
4764
4765 // Total RSS in kilobytes consumed by the process after compaction.
4766 optional int64 after_rss_total_kilobytes = 8;
4767
4768 // File RSS in kilobytes consumed by the process after compaction.
4769 optional int64 after_rss_file_kilobytes = 9;
4770
4771 // Anonymous RSS in kilobytes consumed by the process after compaction.
4772 optional int64 after_rss_anon_kilobytes = 10;
4773
4774 // Swap in kilobytes consumed by the process after compaction.
4775 optional int64 after_swap_kilobytes = 11;
4776
4777 // The time taken to perform compaction in milliseconds.
4778 optional int64 time_to_compact_millis = 12;
4779
4780 // The last compaction action performed for this app.
4781 optional Action last_action = 13;
4782
Ben Murdoch01720b82018-12-19 18:03:44 +00004783 // The last time that compaction was attempted on this process in milliseconds
4784 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4785 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00004786
Ben Murdoch01720b82018-12-19 18:03:44 +00004787 // The oom_score_adj at the time of compaction.
4788 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00004789
4790 // The process state at the time of compaction.
4791 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
4792}
lifr157fc552018-12-12 16:38:04 +08004793
4794/**
4795 * Logs the latency period(in microseconds) and the return code of
4796 * the DNS(Domain Name System) lookups.
4797 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4798 * to get info(address or hostname) from DNS server(or DNS cache).
4799 * Logged from:
4800 * /system/netd/server/DnsProxyListener.cpp
4801 */
4802message NetworkDnsEventReported {
4803 // The types of the DNS lookups, as defined in
4804 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4805 enum EventType {
4806 EVENT_UNKNOWN = 0;
4807 EVENT_GETADDRINFO = 1;
4808 EVENT_GETHOSTBYNAME = 2;
4809 EVENT_GETHOSTBYADDR = 3;
4810 EVENT_RES_NSEND = 4;
4811 }
4812 optional EventType event_type = 1;
4813
4814 // The return value of the DNS resolver for each DNS lookups.
4815 //bionic/libc/include/netdb.h
4816 //system/netd/resolv/include/netd_resolv/resolv.h
4817 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08004818 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08004819 EAI_ADDRFAMILY = 1;
4820 EAI_AGAIN = 2;
4821 EAI_BADFLAGS = 3;
4822 EAI_FAIL = 4;
4823 EAI_FAMILY = 5;
4824 EAI_MEMORY = 6;
4825 EAI_NODATA = 7;
4826 EAI_NONAME = 8;
4827 EAI_SERVICE = 9;
4828 EAI_SOCKTYPE = 10;
4829 EAI_SYSTEM = 11;
4830 EAI_BADHINTS = 12;
4831 EAI_PROTOCOL = 13;
4832 EAI_OVERFLOW = 14;
4833 RESOLV_TIMEOUT = 255;
4834 EAI_MAX = 256;
4835 }
4836 optional ReturnCode return_code = 2;
4837
4838 // The latency period(in microseconds) it took for this DNS lookup to complete.
4839 optional int32 latency_micros = 3;
4840}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08004841
4842/**
4843 * Logs when a data stall event occurs.
4844 *
4845 * Log from:
4846 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4847 */
4848message DataStallEvent {
4849 // Data stall evaluation type.
4850 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4851 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
4852 optional int32 evaluation_type = 1;
4853 // See definition in data_stall_event.proto.
4854 optional com.android.server.connectivity.ProbeResult validation_result = 2;
4855 // See definition in data_stall_event.proto.
4856 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
4857 // See definition in data_stall_event.proto.
4858 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
4859 // See definition in data_stall_event.proto.
4860 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
4861 // See definition in data_stall_event.proto.
4862 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
4863}
Christian Brunschenf86039e2018-12-21 12:26:14 +00004864
4865/*
4866 * Logs when RescueParty resets some set of experiment flags.
4867 *
4868 * Logged from:
4869 * frameworks/base/services/core/java/com/android/server/RescueParty.java
4870 */
4871message RescuePartyResetReported {
4872 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
4873 optional int32 rescue_level = 1;
4874}
Mathew Inwoodb375be52019-01-04 11:36:25 +00004875
4876/**
4877 * Logs when signed config is received from an APK, and if that config was applied successfully.
4878 * Logged from:
4879 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
4880 */
4881message SignedConfigReported {
4882 enum Type {
4883 UNKNOWN_TYPE = 0;
4884 GLOBAL_SETTINGS = 1;
4885 }
4886 optional Type type = 1;
4887
4888 // The final status of the signed config received.
4889 enum Status {
4890 UNKNOWN_STATUS = 0;
4891 APPLIED = 1;
4892 BASE64_FAILURE_CONFIG = 2;
4893 BASE64_FAILURE_SIGNATURE = 3;
4894 SECURITY_EXCEPTION = 4;
4895 INVALID_CONFIG = 5;
4896 OLD_CONFIG = 6;
4897 SIGNATURE_CHECK_FAILED = 7;
4898 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00004899 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00004900 }
4901 optional Status status = 2;
4902
4903 // The version of the signed config processed.
4904 optional int32 version = 3;
4905
4906 // The package name that the config was extracted from.
4907 optional string from_package = 4;
4908
4909 enum Key {
4910 NO_KEY = 0;
4911 DEBUG = 1;
4912 PRODUCTION = 2;
4913 }
4914 // Which key was used to verify the config.
4915 optional Key verified_with = 5;
4916}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004917
4918/*
4919 * Logs GNSS Network-Initiated (NI) location events.
4920 *
4921 * Logged from:
4922 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4923 */
4924message GnssNiEventReported {
4925 // The type of GnssNiEvent.
4926 enum EventType {
4927 UNKNOWN = 0;
4928 NI_REQUEST = 1;
4929 NI_RESPONSE = 2;
4930 }
4931 optional EventType event_type = 1;
4932
4933 // An ID generated by HAL to associate NI notifications and UI responses.
4934 optional int32 notification_id = 2;
4935
4936 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004937 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004938
4939 // NI requires notification.
4940 optional bool need_notify = 4;
4941
4942 // NI requires verification.
4943 optional bool need_verify = 5;
4944
4945 // NI requires privacy override, no notification/minimal trace.
4946 optional bool privacy_override = 6;
4947
4948 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
4949 // seconds.
4950 optional int32 timeout = 7;
4951
4952 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004953 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004954
4955 // String representing the requester of the network inititated location request.
4956 optional string requestor_id = 9;
4957
4958 // Notification message text string representing the service(for eg. SUPL-service) who sent the
4959 // network initiated location request.
4960 optional string text = 10;
4961
4962 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004963 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004964
4965 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004966 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004967
4968 // True if SUPL ES is enabled.
4969 optional bool is_supl_es_enabled = 13;
4970
4971 // True if GNSS location is enabled.
4972 optional bool is_location_enabled = 14;
4973
4974 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004975 optional android.server.location.GnssUserResponseType user_response = 15;
4976}
4977
4978/**
4979 * Logs GNSS non-framework (NFW) location notification.
4980 *
4981 * Logged from:
4982 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4983 */
4984message GnssNfwNotificationReported {
4985 // Package name of the Android proxy application representing the non-framework entity that
4986 // requested location. Set to empty string if unknown.
4987 optional string proxy_app_package_name = 1;
4988
4989 // Protocol stack that initiated the non-framework location request.
4990 optional android.server.location.NfwProtocolStack protocol_stack = 2;
4991
4992 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
4993 // set to empty string. This field is opaque to the framework and used for logging purposes.
4994 optional string other_protocol_stack_name = 3;
4995
4996 // Source initiating/receiving the location information.
4997 optional android.server.location.NfwRequestor requestor = 4;
4998
4999 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5000 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5001 // and used for logging purposes.
5002 optional string requestor_id = 5;
5003
5004 // Indicates whether location information was provided for this request.
5005 optional android.server.location.NfwResponseType response_type = 6;
5006
5007 // True if the device is in user initiated emergency session.
5008 optional bool in_emergency_mode = 7;
5009
5010 // True if cached location is provided.
5011 optional bool is_cached_location = 8;
5012
5013 // True if proxy app permission mismatch between framework and GNSS HAL.
5014 optional bool is_permission_mismatched = 9;
5015}
5016
5017/**
5018 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5019 *
5020 * Logged from:
5021 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5022 */
5023message GnssConfigurationReported {
5024 // SUPL host name.
5025 optional string supl_host = 1;
5026
5027 // SUPL port number.
5028 optional int32 supl_port = 2;
5029
5030 // C2K host name.
5031 optional string c2k_host = 3;
5032
5033 // C2K port number.
5034 optional int32 c2k_port = 4;
5035
5036 // The SUPL version requested by Carrier.
5037 optional int32 supl_ver = 5;
5038
5039 // The SUPL mode.
5040 optional android.server.location.SuplMode supl_mode = 6;
5041
5042 // True if NI emergency SUPL restrictions is enabled.
5043 optional bool supl_es = 7;
5044
5045 // LTE Positioning Profile settings
5046 optional android.server.location.LppProfile lpp_profile = 8;
5047
5048 // Positioning protocol on A-Glonass system.
5049 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5050
5051 // True if emergency PDN is used. Otherwise, regular PDN is used.
5052 optional bool use_emergency_pdn_for_emergency_supl= 10;
5053
5054 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5055 optional android.server.location.GpsLock gps_lock = 11;
5056
5057 // Number of seconds to extend the emergency session duration post emergency call.
5058 optional int32 es_extension_sec = 12;
5059
5060 // The full list of package names of proxy Android applications representing the non-framework
5061 // location access entities (on/off the device) for which the framework user has granted
5062 // non-framework location access permission. The package names are concatenated in one string
5063 // with spaces as separators.
5064 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005065}
Jack Yu95b64f32018-12-13 18:26:11 +08005066
5067/**
5068 * Logs when a NFC device's error occurred.
5069 * Logged from:
5070 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5071 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5072 */
5073message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005074 enum Type {
5075 UNKNOWN = 0;
5076 CMD_TIMEOUT = 1;
5077 ERROR_NOTIFICATION = 2;
5078 AID_OVERFLOW = 3;
5079 }
5080 optional Type type = 1;
5081 // If it's nci cmd timeout, log the timeout command.
5082 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005083
Alex Salod7c3eef2019-01-25 14:43:27 -08005084 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005085}
5086
5087/**
5088 * Logs when a NFC device's state changed event
5089 * Logged from:
5090 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5091 */
5092message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005093 enum State {
5094 UNKNOWN = 0;
5095 OFF = 1;
5096 ON = 2;
5097 ON_LOCKED = 3; // Secure Nfc enabled.
5098 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5099 }
5100 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005101}
5102
5103/**
5104 * Logs when a NFC Beam Transaction occurred.
5105 * Logged from:
5106 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5107 */
5108message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005109 enum Operation {
5110 UNKNOWN = 0;
5111 SEND = 1;
5112 RECEIVE = 2;
5113 }
5114 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005115}
5116
5117/**
5118 * Logs when a NFC Card Emulation Transaction occurred.
5119 * Logged from:
5120 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5121 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5122 */
5123message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005124 enum Category {
5125 UNKNOWN = 0;
5126 HCE_PAYMENT = 1;
5127 HCE_OTHER = 2;
5128 OFFHOST = 3;
5129 }
5130 // Transaction belongs to HCE payment or HCE other category, or offhost.
5131 optional Category category = 1;
5132 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5133 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005134}
5135
5136/**
5137 * Logs when a NFC Tag event occurred.
5138 * Logged from:
5139 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5140 */
5141message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005142 enum Type {
5143 UNKNOWN = 0;
5144 URL = 1;
5145 BT_PAIRING = 2;
5146 PROVISION = 3;
5147 WIFI_CONNECT = 4;
5148 APP_LAUNCH = 5;
5149 OTHERS = 6;
5150 }
5151 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005152}
5153
5154/**
5155 * Logs when Hce transaction triggered
5156 * Logged from:
5157 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5158 */
5159message NfcHceTransactionOccurred {
5160 // The latency period(in microseconds) it took for the first HCE data
5161 // exchange.
5162 optional uint32 latency_micros = 1;
5163}
5164
5165/**
5166 * Logs when SecureElement state event changed
5167 * Logged from:
5168 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5169 */
5170message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005171 enum State {
5172 UNKNOWN = 0;
5173 INITIALIZED = 1;
5174 DISCONNECTED = 2;
5175 CONNECTED = 3;
5176 HALCRASH = 4;
5177 }
5178 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005179
Alex Salod7c3eef2019-01-25 14:43:27 -08005180 optional string state_change_reason = 2;
5181 // SIMx or eSEx.
5182 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005183}
5184
5185/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005186 * Information about a permission grant request
5187 */
5188message PermissionGrantRequestResultReported {
5189 // unique value identifying an API call. A API call might result in multiple of these atoms
5190 optional int64 request_id = 1;
5191
5192 // UID of package requesting the permission grant
5193 optional int32 requesting_uid = 2 [(is_uid) = true];
5194
5195 // Name of package requesting the permission grant
5196 optional string requesting_package_name = 3;
5197
5198 // The permission to be granted
5199 optional string permission_name = 4;
5200
5201 // If the permission was explicitly requested via the API or added by the system
5202 optional bool is_implicit = 5;
5203
5204 enum Result {
5205 UNDEFINED = 0;
5206 // permission request was ignored
5207 IGNORED = 1;
5208 // permission request was ignored because it was user fixed
5209 IGNORED_USER_FIXED = 2;
5210 // permission request was ignored because it was policy fixed
5211 IGNORED_POLICY_FIXED = 3;
5212 // permission was granted by user action
5213 USER_GRANTED = 4;
5214 // permission was automatically granted
5215 AUTO_GRANTED = 5;
5216 // permission was denied by user action
5217 USER_DENIED = 6;
5218 // permission was denied with prejudice by the user
5219 USER_DENIED_WITH_PREJUDICE = 7;
5220 // permission was automatically denied
5221 AUTO_DENIED = 8;
5222 }
5223 // The result of the permission grant
5224 optional Result result = 6;
5225}
5226
5227/**
Jack Yu95b64f32018-12-13 18:26:11 +08005228 * Logs when Omapi API used
5229 * Logged from:
5230 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5231 */
5232message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005233 enum Operation {
5234 UNKNOWN = 0;
5235 OPEN_CHANNEL = 1;
5236 }
5237 optional Operation operation = 1;
5238 // SIMx or eSEx.
5239 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005240
Alex Salod7c3eef2019-01-25 14:43:27 -08005241 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005242}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005243
5244/**
Alex Saloa060aee2019-01-21 14:36:41 -08005245 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5246 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005247 * Logged from:
5248 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5249 */
5250message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005251 optional int64 dispatch_latency_millis = 1;
5252}
5253
5254/**
5255 * Logs AttentionManagerService attention check result.
5256 *
5257 * Logged from:
5258 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5259 */
5260message AttentionManagerServiceResultReported {
5261 // See core/java/android/service/attention/AttentionService.java
5262 enum AttentionCheckResult {
5263 UNKNOWN = 20;
5264 ATTENTION_SUCCESS_ABSENT = 0;
5265 ATTENTION_SUCCESS_PRESENT = 1;
5266 ATTENTION_FAILURE_PREEMPTED = 2;
5267 ATTENTION_FAILURE_TIMED_OUT = 3;
5268 ATTENTION_FAILURE_UNKNOWN = 4;
5269 }
5270 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005271}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005272
5273/**
5274 * Logs when an adb connection changes state.
5275 *
5276 * Logged from:
5277 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5278 */
5279message AdbConnectionChanged {
5280 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5281 // previously selected for this system.
5282 optional int64 last_connection_time_millis = 1;
5283
5284 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5285 // to reconnect via adb without user interaction.
5286 optional int64 auth_window_millis = 2;
5287
5288 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5289 optional android.debug.AdbConnectionStateEnum state = 3;
5290
5291 // True if the 'always allow' option was selected for this system.
5292 optional bool always_allow = 4;
5293}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005294
5295/*
5296 * Logs the reported speech DSP status.
5297 *
5298 * Logged from:
5299 * Vendor audio implementation.
5300 */
5301message SpeechDspStatReported {
5302 // The total Speech DSP uptime in milliseconds.
5303 optional int32 total_uptime_millis = 1;
5304 // The total Speech DSP downtime in milliseconds.
5305 optional int32 total_downtime_millis = 2;
5306 optional int32 total_crash_count = 3;
5307 optional int32 total_recover_count = 4;
5308}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005309
5310/**
5311 * Logs USB connector contaminant status.
5312 *
5313 * Logged from: USB Service.
5314 */
5315message UsbContaminantReported {
5316 optional string id = 1;
5317 optional android.service.usb.ContaminantPresenceStatus status = 2;
5318}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005319
5320/**
5321 * This atom is for debugging purpose.
5322 */
5323message DebugElapsedClock {
5324 // Monotically increasing value for each pull.
5325 optional int64 pull_count = 1;
5326 // Time from System.elapsedRealtime.
5327 optional int64 elapsed_clock_millis = 2;
5328 // Time from System.elapsedRealtime.
5329 optional int64 same_elapsed_clock_millis = 3;
5330 // Diff between current elapsed time and elapsed time from previous pull.
5331 optional int64 elapsed_clock_diff_millis = 4;
5332
5333 enum Type {
5334 TYPE_UNKNOWN = 0;
5335 ALWAYS_PRESENT = 1;
5336 PRESENT_ON_ODD_PULLS = 2;
5337 }
5338 // Type of behavior for the pulled data.
5339 optional Type type = 5;
5340}
5341
5342/**
5343 * This atom is for debugging purpose.
5344 */
5345message DebugFailingElapsedClock {
5346 // Monotically increasing value for each pull.
5347 optional int64 pull_count = 1;
5348 // Time from System.elapsedRealtime.
5349 optional int64 elapsed_clock_millis = 2;
5350 // Time from System.elapsedRealtime.
5351 optional int64 same_elapsed_clock_millis = 3;
5352 // Diff between current elapsed time and elapsed time from previous pull.
5353 optional int64 elapsed_clock_diff_millis = 4;
5354}
Steven Wuacef6bb2019-01-23 14:21:17 -05005355
5356/** Logs System UI bubbles event changed.
5357 *
5358 * Logged from:
5359 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5360 */
5361message BubbleUIChanged {
5362
5363 // The app package that is posting the bubble.
5364 optional string package_name = 1;
5365
5366 // The notification channel that is posting the bubble.
5367 optional string notification_channel = 2;
5368
5369 // The notification id associated with the posted bubble.
5370 optional int32 notification_id = 3;
5371
5372 // The position of the bubble within the bubble stack.
5373 optional int32 position = 4;
5374
5375 // The total number of bubbles within the bubble stack.
5376 optional int32 total_number = 5;
5377
5378 // User interactions with the bubble.
5379 enum Action {
5380 UNKNOWN = 0;
5381 POSTED = 1;
5382 UPDATED = 2;
5383 EXPANDED = 3;
5384 COLLAPSED = 4;
5385 DISMISSED = 5;
5386 STACK_DISMISSED = 6;
5387 STACK_MOVED = 7;
5388 HEADER_GO_TO_APP = 8;
5389 HEADER_GO_TO_SETTINGS = 9;
5390 PERMISSION_OPT_IN = 10;
5391 PERMISSION_OPT_OUT = 11;
Alison Cichowlas0b38ec42019-02-15 15:54:33 +00005392 PERMISSION_IGNORED = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005393 SWIPE_LEFT = 13;
5394 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005395 STACK_EXPANDED = 15;
Steven Wuacef6bb2019-01-23 14:21:17 -05005396 }
5397 optional Action action = 6;
5398
5399 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5400 optional float normalized_x_position = 7;
5401 optional float normalized_y_position = 8;
5402}
Kweku Adams8845d012018-12-11 20:06:45 -08005403
5404/**
Steven Wu552f63f2019-02-05 13:41:36 -05005405 * Logs System UI bubbles developer errors.
5406 *
5407 * Logged from:
5408 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5409 */
5410message BubbleDeveloperErrorReported {
5411
5412 // The app package that is posting the bubble.
5413 optional string package_name = 1;
5414
5415 // Bubble developer error type enums.
5416 enum Error {
5417 UNKNOWN = 0;
5418 ACTIVITY_INFO_MISSING = 1;
5419 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5420 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5421 }
5422 optional Error error = 2 [default = UNKNOWN];
5423}
5424
5425/**
Kweku Adams8845d012018-12-11 20:06:45 -08005426 * Logs that a constraint for a scheduled job has changed.
5427 *
5428 * Logged from:
5429 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5430 */
5431message ScheduledJobConstraintChanged {
5432 repeated AttributionNode attribution_node = 1;
5433
5434 // Name of the job.
5435 optional string job_name = 2;
5436
5437 optional com.android.server.job.ConstraintEnum constraint = 3;
5438
5439 enum State {
5440 UNSATISFIED = 0;
5441 SATISFIED = 1;
5442 }
5443 optional State state = 4;
5444}
Alex Salod7c3eef2019-01-25 14:43:27 -08005445
5446/**
5447 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5448 * returns true.
5449 *
5450 * Logged from:
5451 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5452 */
5453message ScreenTimeoutExtensionReported {
5454 // Describes how many times in a row did the power manager reset the screen off timeout.
5455 optional uint32 consecutive_timeout_extended_count = 1;
5456}
Hui Yu885aca12019-01-10 17:11:34 -08005457
5458/*
5459* Logs number of milliseconds it takes to start a process.
5460* The definition of app process start time is from the app launch time to
5461* the time that Zygote finished forking the app process and loaded the
5462* application package's java classes.
5463
5464* This metric is different from AppStartOccurred which is for foreground
5465* activity only.
5466
5467* ProcessStartTime can report all processes (both foreground and background)
5468* start time.
5469*
5470* Logged from:
5471* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5472*/
5473message ProcessStartTime {
5474 // The uid of the ProcessRecord.
5475 optional int32 uid = 1 [(is_uid) = true];
5476
5477 // The process pid.
5478 optional int32 pid = 2;
5479
5480 // The process name.
5481 // Usually package name, "system" for system server.
5482 // Provided by ActivityManagerService.
5483 optional string process_name = 3;
5484
5485 enum StartType {
5486 UNKNOWN = 0;
5487 WARM = 1;
5488 HOT = 2;
5489 COLD = 3;
5490 }
5491
5492 // The start type.
5493 optional StartType type = 4;
5494
5495 // The elapsed realtime at the start of the process.
5496 optional int64 process_start_time_millis = 5;
5497
5498 // Number of milliseconds it takes to reach bind application.
5499 optional int32 bind_application_delay_millis = 6;
5500
5501 // Number of milliseconds it takes to finish start of the process.
5502 optional int32 process_start_delay_millis = 7;
5503
5504 // hostingType field in ProcessRecord, the component type such as "activity",
5505 // "service", "content provider", "broadcast" or other strings.
5506 optional string hosting_type = 8;
5507
5508 // hostingNameStr field in ProcessRecord. The component class name that runs
5509 // in this process.
5510 optional string hosting_name = 9;
5511}
5512
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005513/**
5514 * State of a dangerous permission requested by a package
5515 */
5516message DangerousPermissionState {
5517 // Name of the permission
5518 optional string permission_name = 1;
5519
5520 // Uid of the package
5521 optional int32 uid = 2 [(is_uid) = true];
5522
5523 // Package requesting the permission
5524 optional string package_name = 3;
5525
5526 // If the permission is granted to the uid
5527 optional bool is_granted = 4;
5528}
5529
Michael Groover4a0ca942019-01-24 17:41:25 -08005530/**
5531 * Logs when a package is denied access to a device identifier based on the new access requirements.
5532 *
5533 * Logged from:
5534 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
5535 */
5536message DeviceIdentifierAccessDenied {
5537 // The name of the package denied access to the requested device identifier.
5538 optional string package_name = 1;
5539
5540 // The name of the device identifier method the package attempted to invoke.
5541 optional string method_name = 2;
5542
5543 // True if the package is preinstalled.
5544 optional bool is_preinstalled = 3;
5545
5546 // True if the package is privileged.
5547 optional bool is_priv_app = 4;
5548}
Chenjie Yue13f44a2019-02-07 17:51:38 -08005549
5550/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08005551 * Pulls the ongoing mainline install train version code.
5552 * Pulled from StatsCompanionService
5553 */
5554message TrainInfo {
5555 optional int64 train_version_code = 1;
5556
5557 optional TrainExperimentIds train_experiment_id = 2;
5558}
joshmccloskey8c3322e2019-01-09 18:25:57 -08005559
5560/**
5561 * Logs the gesture stage changed event.
5562 *
5563 * Logged from:
5564 * frameworks/base/packages/SystemUI/
5565 */
5566message AssistGestureStageReported {
5567 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
5568}
5569
5570/**
5571 * Logs the feedback type.
5572 *
5573 * Logged from:
5574 * frameworks/base/packages/SystemUI/
5575 */
5576message AssistGestureFeedbackReported {
5577 // Whether or not the gesture was used.
5578 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
5579}
5580
5581/**
5582 * Logs the progress.
5583 *
5584 * Logged from:
5585 * frameworks/base/packages/SystemUI/
5586 */
5587message AssistGestureProgressReported {
5588 // [0,100] progress for the assist gesture.
5589 optional int32 progress = 1;
5590}
Neil Fullerdb14b482019-02-05 19:44:44 +00005591
5592/*
5593 * Information about the time zone data on a device.
5594 */
5595message TimeZoneDataInfo {
5596 // A version identifier for the data set on device. e.g. "2018i"
5597 optional string tzdb_version = 1;
5598}