blob: c707d8f4c35a565a4c2c4e8e7b63c4f1ec6b1786 [file] [log] [blame]
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070018
19package android.os.statsd;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070020option java_package = "com.android.os";
Stefan Lafonae2df012017-11-14 09:17:21 -080021option java_outer_classname = "AtomsProto";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070022
Yao Chen9c1debe2018-02-19 14:39:19 -080023import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
Bookatzdb026a22018-01-10 19:01:56 -080024import "frameworks/base/core/proto/android/app/enums.proto";
Fan Zhangf837b8e2018-10-23 12:38:30 -070025import "frameworks/base/core/proto/android/app/settings_enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070026import "frameworks/base/core/proto/android/app/job/enums.proto";
Jack Hec27040a2019-01-09 20:54:41 -080027import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080028import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack Heab86dbd22018-12-18 15:43:27 -080029import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080030import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Jack He1021a612019-01-20 21:22:46 -080031import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto";
Michael Groover9e7b06e2018-12-28 19:55:51 -080032import "frameworks/base/core/proto/android/debug/enums.proto";
Kevin Chyn1741a072019-01-17 11:54:40 -080033import "frameworks/base/core/proto/android/hardware/biometrics/enums.proto";
joshmccloskey8c3322e2019-01-09 18:25:57 -080034import "frameworks/base/core/proto/android/hardware/sensor/assist/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080035import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080036import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080037import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080038import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080039import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080040import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070041import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080042import "frameworks/base/core/proto/android/service/usb.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070043import "frameworks/base/core/proto/android/stats/enums.proto";
shawnlinea5b66b2018-11-13 15:05:29 +080044import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080045import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
46import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070047import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080048import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080049import "frameworks/base/core/proto/android/telephony/enums.proto";
50import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080051import "frameworks/base/core/proto/android/wifi/enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080052
Yao Chend54f9dd2017-10-17 17:37:48 +000053/**
Stefan Lafonae2df012017-11-14 09:17:21 -080054 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000055 * raw stats log events from the Android system, also known as "atoms."
56 *
57 * This field contains a single oneof with all of the available messages.
58 * The stats-log-api-gen tool runs as part of the Android build and
59 * generates the android.util.StatsLog class, which contains the constants
60 * and methods that Android uses to log.
61 *
Stefan Lafonae2df012017-11-14 09:17:21 -080062 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000063 * Instead, statsd on Android constructs these messages synthetically,
64 * in the format defined here and in stats_log.proto.
65 */
Stefan Lafonae2df012017-11-14 09:17:21 -080066message Atom {
67 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070068 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070069 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
70 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070071 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070072 BleScanResultReceived ble_scan_result_received = 4;
73 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080074 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070075 SyncStateChanged sync_state_changed = 7;
76 ScheduledJobStateChanged scheduled_job_state_changed = 8;
77 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070078 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080079 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
80 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
81 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070082 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
83 MemoryFactorStateChanged memory_factor_state_changed = 15;
84 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
85 CachedKillReported cached_kill_reported = 17;
86 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070087 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080088 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
89 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
90 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070091 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080092 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070093 CameraStateChanged camera_state_changed = 25;
94 FlashlightStateChanged flashlight_state_changed = 26;
95 UidProcessStateChanged uid_process_state_changed = 27;
96 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
97 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070098 BatteryLevelChanged battery_level_changed = 30;
99 ChargingStateChanged charging_state_changed = 31;
100 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -0700101 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800102 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -0700103 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
104 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -0700105 WifiLockStateChanged wifi_lock_state_changed = 37;
106 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
107 WifiScanStateChanged wifi_scan_state_changed = 39;
108 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700109 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700110 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700111 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900112 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700113 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800114 AnomalyDetected anomaly_detected = 46;
Andrei Oneada01ea52019-01-30 15:28:36 +0000115 AppBreadcrumbReported app_breadcrumb_reported = 47 [(allow_from_any_uid) = true];
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800116 AppStartOccurred app_start_occurred = 48;
117 AppStartCanceled app_start_canceled = 49;
118 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800119 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800120 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800121 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800122 LmkStateChanged lmk_state_changed = 54;
123 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800124 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800125 BootSequenceReported boot_sequence_reported = 57;
Andrei Oneada01ea52019-01-30 15:28:36 +0000126 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -0800127 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800128 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800129 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800130 KeyguardStateChanged keyguard_state_changed = 62;
131 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
132 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800133 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800134 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800135 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
136 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800137 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700138 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800139 SpeakerImpedanceReported speaker_impedance_reported = 71;
140 HardwareFailed hardware_failed = 72;
141 PhysicalDropDetected physical_drop_detected = 73;
142 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800143 MobileConnectionStateChanged mobile_connection_state_changed = 75;
144 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700145 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800146 AppCrashOccurred app_crash_occurred = 78;
147 ANROccurred anr_occurred = 79;
148 WTFOccurred wtf_occurred = 80;
149 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700150 GenericAtom generic_atom = 82;
Yangster-mac48b3d622018-08-18 12:38:11 -0700151 KeyValuePairsAtom key_value_pairs_atom = 83;
Bookatza7020bd2018-08-28 16:29:35 -0700152 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700153 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700154 ThermalThrottlingStateChanged thermal_throttling = 86;
Kevin Chyn1741a072019-01-17 11:54:40 -0800155 BiometricAcquired biometric_acquired = 87;
156 BiometricAuthenticated biometric_authenticated = 88;
157 BiometricErrorOccurred biometric_error_occurred = 89;
Howard Ro688ae182018-09-25 00:09:36 -0700158 Notification notification = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700159 BatteryHealthSnapshot battery_health_snapshot = 91;
160 SlowIo slow_io = 92;
161 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700162 PhoneServiceStateChanged phone_service_state_changed = 94;
163 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100164 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700165 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700166 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700167 // TODO: service state change is very noisy shortly after boot, as well
168 // as at other transitions - coming out of doze, device plugged in, etc.
169 // Consider removing this if it becomes a problem
170 ServiceStateChanged service_state_changed = 99;
171 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800172 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800173 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000174 DevicePolicyEvent device_policy_event = 103;
shawnlinea5b66b2018-11-13 15:05:29 +0800175 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104;
176 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported = 105;
177 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106;
178 DocsUIFileOperationReported docs_ui_provider_file_op = 107;
179 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request = 108;
180 DocsUILaunchReported docs_ui_launch_reported = 109;
181 DocsUIRootVisitedReported docs_ui_root_visited = 110;
182 DocsUIStartupMsReported docs_ui_startup_ms = 111;
183 DocsUIUserActionReported docs_ui_user_action_reported = 112;
Bookatzda1798c2018-12-13 14:16:00 -0800184 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
185 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f2018-12-06 11:01:38 +0000186 AppCompacted app_compacted = 115;
lifr030d23a2019-01-11 16:54:51 +0800187 NetworkDnsEventReported network_dns_event_reported = 116;
shawnlina75e82d2019-01-07 10:31:12 +0800188 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported = 117;
189 DocsUIPickResultReported docs_ui_pick_result_reported = 118;
190 DocsUISearchModeReported docs_ui_search_mode_reported = 119;
191 DocsUISearchTypeReported docs_ui_search_type_reported = 120;
Chiachang Wangf6bedc22019-01-14 11:54:32 +0800192 DataStallEvent data_stall_event = 121;
Christian Brunschenf86039e2018-12-21 12:26:14 +0000193 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000194 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800195 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800196 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800197 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
198 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000199 AppDowngraded app_downgraded = 128;
200 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
201 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800202 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
203 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800204 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800205 NfcErrorOccurred nfc_error_occurred = 134;
206 NfcStateChanged nfc_state_changed = 135;
207 NfcBeamOccurred nfc_beam_occurred = 136;
208 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
209 NfcTagOccurred nfc_tag_occurred = 138;
210 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
211 SeStateChanged se_state_changed = 140;
212 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800213 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800214 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800215 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800216 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800217 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800218 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyne5a37fb2019-02-08 13:10:36 -0800219 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500220 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800221 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Jack Hec27040a2019-01-09 20:54:41 -0800222 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
223 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
224 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
225 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
226 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
227 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
228 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
229 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
230 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He1021a612019-01-20 21:22:46 -0800231 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
232 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
233 BluetoothManufacturerInfoReported bluetooth_device_info_reported = 162;
234 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
235 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
236 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
237 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
238 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Alex Salod7c3eef2019-01-25 14:43:27 -0800239 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800240 ProcessStartTime process_start_time = 169;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -0800241 PermissionGrantRequestResultReported permission_grant_request_result_reported = 170;
Jack He815cdba2019-01-30 17:24:55 -0800242 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Michael Groover4a0ca942019-01-24 17:41:25 -0800243 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Steven Wu552f63f2019-02-05 13:41:36 -0500244 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
joshmccloskey8c3322e2019-01-09 18:25:57 -0800245 AssistGestureStageReported assist_gesture_stage_reported = 174;
246 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
247 AssistGestureProgressReported assist_gesture_progress_reported = 176;
Philip Quinn0eded622019-01-29 12:46:28 -0800248 TouchGestureClassified touch_gesture_classified = 177;
Yao Chend54f9dd2017-10-17 17:37:48 +0000249 }
David Chenc8a43242017-10-17 16:23:28 -0700250
David Chen6e3e6cb2018-01-03 16:14:06 -0800251 // Pulled events will start at field 10000.
Olivier Gaillard18d452202019-01-22 15:03:41 +0000252 // Next: 10048
David Chenc8a43242017-10-17 16:23:28 -0700253 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800254 WifiBytesTransfer wifi_bytes_transfer = 10000;
255 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
256 MobileBytesTransfer mobile_bytes_transfer = 10002;
257 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800258 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800259 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800260 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800261 CpuTimePerFreq cpu_time_per_freq = 10008;
262 CpuTimePerUid cpu_time_per_uid = 10009;
263 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800264 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800265 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800266 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800267 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800268 SystemElapsedRealtime system_elapsed_realtime = 10014;
269 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800270 CpuActiveTime cpu_active_time = 10016;
271 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000272 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800273 RemainingBatteryCapacity remaining_battery_capacity = 10019;
274 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800275 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100276 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100277 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100278 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000279 DiskStats disk_stats = 10025;
280 DirectoryUsage directory_usage = 10026;
281 AppSize app_size = 10027;
282 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700283 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700284 BatteryVoltage battery_voltage = 10030;
Kevin Chyn1741a072019-01-17 11:54:40 -0800285 NumBiometricsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700286 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700287 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800288 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700289 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100290 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100291 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700292 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800293 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
294 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
295 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000296 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800297 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800298 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800299 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000300 DebugElapsedClock debug_elapsed_clock = 10046;
301 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
Kevin Chyn1741a072019-01-17 11:54:40 -0800302 NumBiometricsEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800303 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800304 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800305 TrainInfo train_info = 10051;
David Chenc8a43242017-10-17 16:23:28 -0700306 }
yroa1fe77c2018-02-26 14:22:54 -0800307
Bookatz76aafcf2018-09-17 16:17:10 -0700308 // DO NOT USE field numbers above 100,000 in AOSP.
309 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
310 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700311}
312
Yao Chend54f9dd2017-10-17 17:37:48 +0000313/**
Yangster-mac20877162017-12-22 17:19:39 -0800314 * This proto represents a node of an attribution chain.
315 * Note: All attribution chains are represented as a repeated field of type
316 * AttributionNode. It is understood that in such arrays, the order is that
317 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000318 */
Yangster-mac20877162017-12-22 17:19:39 -0800319message AttributionNode {
320 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800321 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800322
Yangster-mac20877162017-12-22 17:19:39 -0800323 // The (optional) string tag for an element in the attribution chain. If the
324 // element has no tag, it is encoded as an empty string.
325 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700326}
327
Yangster-mac48b3d622018-08-18 12:38:11 -0700328message KeyValuePair {
329 optional int32 key = 1;
330 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700331 int32 value_int = 2;
332 int64 value_long = 3;
333 string value_str = 4;
334 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700335 }
336}
337
338message KeyValuePairsAtom {
339 optional int32 uid = 1;
340 repeated KeyValuePair pairs = 2;
341}
342
Yao Chend54f9dd2017-10-17 17:37:48 +0000343/*
344 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800345 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000346 *
347 * RULES:
348 * - The field ids for each atom must start at 1, and count upwards by 1.
349 * Skipping field ids is not allowed.
350 * - These form an API, so renaming, renumbering or removing fields is
351 * not allowed between android releases. (This is not currently enforced,
352 * but there will be a tool to enforce this restriction).
353 * - The types must be built-in protocol buffer types, namely, no sub-messages
354 * are allowed (yet). The bytes type is also not allowed.
355 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800356 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000357 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800358 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000359 * - A field that is a uid should be a string field, tagged with the [xxx]
360 * annotation. The generated code on android will be represented by UIDs,
361 * and those UIDs will be translated in xxx to those strings.
362 *
363 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700364 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000365 * - If there is a UID, it goes first. Think in an object-oriented fashion.
366 * *****************************************************************************
367 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700368
Yao Chend54f9dd2017-10-17 17:37:48 +0000369/**
Yangster-mace16189a2018-08-26 12:20:16 -0700370 * Logs when the Thermal service HAL notifies the throttling start/stop events.
371 *
372 * Logged from:
373 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
374 */
375message ThermalThrottlingStateChanged {
376 optional android.os.TemperatureTypeEnum sensor_type = 1;
377
378 enum State {
379 UNKNOWN = 0;
380 START = 1;
381 STOP = 2;
382 }
383
384 optional State state = 2;
385
386 optional float temperature = 3;
387}
388
389/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000390 * Logs when the screen state changes.
391 *
392 * Logged from:
393 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
394 */
395message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800396 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700397 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700398}
Yao Chend54f9dd2017-10-17 17:37:48 +0000399
400/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700401 * Logs that the process state of the uid, as determined by ActivityManager
402 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000403 *
404 * Logged from:
405 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
406 */
Bookatzc1a050a2017-10-10 15:49:28 -0700407message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700408 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000409
Bookatzdb026a22018-01-10 19:01:56 -0800410 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700411 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000412}
413
414/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700415 * Logs process state change of a process, as per the activity manager.
416 *
417 * Logged from:
418 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
419 */
420message ProcessStateChanged {
421 optional int32 uid = 1;
422 optional string process_name = 2;
423 optional string package_name = 3;
424 // TODO: remove this when validation is done
425 optional int64 version = 5;
426 // The state, from frameworks/base/core/proto/android/app/enums.proto.
427 optional android.app.ProcessStateEnum state = 4;
428}
429
430/**
431 * Logs when ActivityManagerService sleep state is changed.
432 *
433 * Logged from:
434 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
435 */
436message ActivityManagerSleepStateChanged {
437 // TODO: import frameworks proto
438 enum State {
439 UNKNOWN = 0;
440 ASLEEP = 1;
441 AWAKE = 2;
442 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700443 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700444}
445
446/**
447 * Logs when system memory state changes.
448 *
449 * Logged from:
450 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
451 */
452message MemoryFactorStateChanged {
453 // TODO: import frameworks proto
454 enum State {
455 MEMORY_UNKNOWN = 0;
456 NORMAL = 1; // normal.
457 MODERATE = 2; // moderate memory pressure.
458 LOW = 3; // low memory.
459 CRITICAL = 4; // critical memory.
460
461 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700462 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700463}
464
465/**
466 * Logs when app is using too much cpu, according to ActivityManagerService.
467 *
468 * Logged from:
469 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
470 */
471message ExcessiveCpuUsageReported {
472 optional int32 uid = 1;
473 optional string process_name = 2;
474 optional string package_name = 3;
475 // package version. TODO: remove this when validation is done
476 optional int64 version = 4;
477}
478
479/**
480 * Logs when a cached process is killed, along with its pss.
481 *
482 * Logged from:
483 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
484 */
485message CachedKillReported {
486 optional int32 uid = 1;
487 optional string process_name = 2;
488 optional string package_name = 3;
489 // TODO: remove this when validation is done
490 optional int64 version = 5;
491 optional int64 pss = 4;
492}
493
494/**
495 * Logs when memory stats of a process is reported.
496 *
497 * Logged from:
498 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
499 */
500message ProcessMemoryStatReported {
501 optional int32 uid = 1;
502 optional string process_name = 2;
503 optional string package_name = 3;
504 //TODO: remove this when validation is done
505 optional int64 version = 9;
506 optional int64 pss = 4;
507 optional int64 uss = 5;
508 optional int64 rss = 6;
509 enum Type {
510 ADD_PSS_INTERNAL_SINGLE = 0;
511 ADD_PSS_INTERNAL_ALL_MEM = 1;
512 ADD_PSS_INTERNAL_ALL_POLL = 2;
513 ADD_PSS_EXTERNAL = 3;
514 ADD_PSS_EXTERNAL_SLOW = 4;
515 }
516 optional Type type = 7;
517 optional int64 duration = 8;
518}
519
520/**
Bookatzc1a050a2017-10-10 15:49:28 -0700521 * Logs that a process started, finished, crashed, or ANRed.
522 *
523 * Logged from:
524 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
525 */
526message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700527 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700528
David Chen0b5c90c2018-01-25 16:51:49 -0800529 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800530 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700531
Bookatzddccf0a2017-11-28 16:48:14 -0800532 // What lifecycle state the process changed to.
533 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800534 enum State {
535 FINISHED = 0;
536 STARTED = 1;
537 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800538 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800539 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700540}
541
Bookatzc1a050a2017-10-10 15:49:28 -0700542/**
543 * Logs when the ble scan state changes.
544 *
545 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700546 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700547 */
548message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800549 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700550
551 enum State {
552 OFF = 0;
553 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700554 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
555 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700556 }
557 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700558
Bookatze5ec0b42018-03-26 13:34:56 -0700559 // Does the scan have a filter.
560 optional bool is_filtered = 3;
561 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
562 optional bool is_first_match = 4;
563 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
564 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700565}
566
567/**
568 * Logs reporting of a ble scan finding results.
569 *
570 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700571 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700572 */
Bookatzae6738e2018-09-13 11:38:56 -0700573// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700574message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800575 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700576
577 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800578 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700579}
580
581/**
582 * Logs when a sensor state changes.
583 *
584 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700585 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700586 */
587message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800588 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700589
Bookatzc1a050a2017-10-10 15:49:28 -0700590 // The id (int) of the sensor.
591 optional int32 sensor_id = 2;
592
593 enum State {
594 OFF = 0;
595 ON = 1;
596 }
597 optional State state = 3;
598}
599
Bookatzc1a050a2017-10-10 15:49:28 -0700600/**
601 * Logs when GPS state changes.
602 *
603 * Logged from:
604 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
605 */
606message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800607 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700608
609 enum State {
610 OFF = 0;
611 ON = 1;
612 }
613 optional State state = 2;
614}
615
Bookatz48d362e2018-11-06 15:49:08 -0800616/**
617 * Logs when GPS signal quality.
618 *
619 * Logged from:
620 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
621 */
622message GpsSignalQualityChanged {
623 optional android.server.location.GpsSignalQualityEnum level = 1;
624}
625
Bookatzc1a050a2017-10-10 15:49:28 -0700626
627/**
628 * Logs when a sync manager sync state changes.
629 *
630 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700631 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700632 */
633message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800634 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700635
David Chen0b5c90c2018-01-25 16:51:49 -0800636 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800637 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700638
639 enum State {
640 OFF = 0;
641 ON = 1;
642 }
643 optional State state = 3;
644}
645
Yangster-mac96353002018-09-05 11:18:55 -0700646/*
647 * Deferred job stats.
648 *
649 * Logged from:
650 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
651*/
652message DeferredJobStatsReported {
653 repeated AttributionNode attribution_node = 1;
654
655 // Number of jobs deferred.
656 optional int32 num_jobs_deferred = 2;
657
658 // Time since the last job runs.
659 optional int64 time_since_last_job_millis = 3;
660}
661
Bookatzc1a050a2017-10-10 15:49:28 -0700662/**
663 * Logs when a job scheduler job state changes.
664 *
665 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700666 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700667 */
668message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800669 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700670
671 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800672 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700673
674 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800675 FINISHED = 0;
676 STARTED = 1;
677 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700678 }
679 optional State state = 3;
680
Tej Singh33a412b2018-03-16 18:43:59 -0700681 // The reason a job has stopped.
682 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700683 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700684 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700685}
686
687/**
688 * Logs when the audio state changes.
689 *
690 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700691 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700692 */
693message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800694 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700695
696 enum State {
697 OFF = 0;
698 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700699 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
700 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700701 }
702 optional State state = 2;
703}
704
705/**
706 * Logs when the video codec state changes.
707 *
708 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700709 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700710 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800711message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800712 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700713
714 enum State {
715 OFF = 0;
716 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700717 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
718 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700719 }
720 optional State state = 2;
721}
722
723/**
724 * Logs when the flashlight state changes.
725 *
726 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700727 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700728 */
729message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800730 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700731
732 enum State {
733 OFF = 0;
734 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700735 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
736 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700737 }
738 optional State state = 2;
739}
740
741/**
742 * Logs when the camera state changes.
743 *
744 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700745 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700746 */
747message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800748 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700749
750 enum State {
751 OFF = 0;
752 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700753 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
754 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700755 }
756 optional State state = 2;
757}
758
759/**
760 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000761 *
762 * Logged from:
763 * TODO
764 */
Bookatzd6746242017-10-24 18:39:35 -0700765message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800766 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000767
Bookatz1a1b0462018-01-12 11:47:03 -0800768 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
769 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700770 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700771
772 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
773 optional string tag = 3;
774
775 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800776 RELEASE = 0;
777 ACQUIRE = 1;
778 CHANGE_RELEASE = 2;
779 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700780 }
781 optional State state = 4;
782}
783
784/**
Bookatzc1a050a2017-10-10 15:49:28 -0700785 * Logs when a partial wakelock is considered 'long' (over 1 min).
786 *
787 * Logged from:
788 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
789 */
790message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800791 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700792
Yao Chend54f9dd2017-10-17 17:37:48 +0000793 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
794 optional string tag = 2;
795
Bookatzc1a050a2017-10-10 15:49:28 -0700796 // TODO: I have no idea what this is.
797 optional string history_tag = 3;
798
799 enum State {
800 OFF = 0;
801 ON = 1;
802 }
803 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000804}
805
Bookatzc1a050a2017-10-10 15:49:28 -0700806/**
Bookatza66083f2018-09-20 17:24:00 -0700807 * Logs when the device is interactive, according to the PowerManager Notifier.
808 *
809 * Logged from:
810 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
811 */
812message InteractiveStateChanged {
813 enum State {
814 OFF = 0;
815 ON = 1;
816 }
817 optional State state = 1;
818}
819
820/**
Bookatzc1a050a2017-10-10 15:49:28 -0700821 * Logs Battery Saver state change.
822 *
823 * Logged from:
824 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
825 */
826message BatterySaverModeStateChanged {
827 enum State {
828 OFF = 0;
829 ON = 1;
830 }
831 optional State state = 1;
832}
833
834/**
835 * Logs Doze mode state change.
836 *
837 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800838 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700839 */
840message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800841 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800842}
843
844
845/**
846 * Logs state change of Doze mode including maintenance windows.
847 *
848 * Logged from:
849 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
850 */
851message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800852 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700853}
854
855/**
856 * Logs screen brightness level.
857 *
858 * Logged from:
859 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
860 */
861message ScreenBrightnessChanged {
862 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
863 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700864}
865
866/**
867 * Logs battery level (percent full, from 0 to 100).
868 *
869 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700870 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700871 */
872message BatteryLevelChanged {
873 // Battery level. Should be in [0, 100].
874 optional int32 battery_level = 1;
875}
876
877/**
878 * Logs change in charging status of the device.
879 *
880 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700881 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700882 */
883message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800884 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
885 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700886}
887
888/**
889 * Logs whether the device is plugged in, and what power source it is using.
890 *
891 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700892 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700893 */
894message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800895 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
896 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700897}
898
Bookatz8c6571b2017-10-24 15:04:41 -0700899/**
900 * Logs when an app's wakeup alarm fires.
901 *
902 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700903 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700904 */
905message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800906 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800907
908 // Name of the wakeup alarm.
909 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700910
911 // Name of source package (for historical reasons, since BatteryStats tracked it).
912 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800913}
914
915/**
916 * Logs when an an app causes the mobile radio to change state.
917 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
918 *
919 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700920 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800921 */
922message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800923 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800924
Bookatz1a1b0462018-01-12 11:47:03 -0800925 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
926 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800927}
928
929/**
930 * Logs when an an app causes the wifi radio to change state.
931 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
932 *
933 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700934 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800935 */
936message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800937 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800938
Bookatz1a1b0462018-01-12 11:47:03 -0800939 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
940 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700941}
942
943/**
944 * Logs kernel wakeup reasons and aborts.
945 *
946 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700947 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700948 */
949message KernelWakeupReported {
950 // Name of the kernel wakeup reason (or abort).
951 optional string wakeup_reason_name = 1;
952
953 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800954 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700955}
956
957/**
Bookatzda1798c2018-12-13 14:16:00 -0800958 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800959 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800960 *
961 * Logged from:
962 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
963 */
964message WifiEnabledStateChanged {
965 enum State {
966 OFF = 0;
967 ON = 1;
968 }
969 optional State state = 1;
970}
971
972/**
973 * 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 -0800974 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
975 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800976 *
977 * Logged from:
978 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
979 */
980message WifiRunningStateChanged {
981 repeated AttributionNode attribution_node = 1;
982
983 enum State {
984 OFF = 0;
985 ON = 1;
986 }
987 optional State state = 2;
988}
989
990/**
Bookatze5885242017-10-24 20:10:31 -0700991 * Logs wifi locks held by an app.
992 *
993 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700994 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -0700995 */
996message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800997 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -0700998
999 enum State {
1000 OFF = 0;
1001 ON = 1;
1002 }
1003 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001004
1005 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1006 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001007}
1008
1009/**
1010 * Logs wifi signal strength changes.
1011 *
1012 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001013 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001014 */
1015message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001016 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1017 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001018}
1019
1020/**
1021 * Logs wifi scans performed by an app.
1022 *
1023 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001024 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001025 */
1026message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001027 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001028
1029 enum State {
1030 OFF = 0;
1031 ON = 1;
1032 }
1033 optional State state = 2;
1034}
1035
1036/**
Tej Singh4503e102018-01-04 14:35:01 -08001037 * Logs wifi multicast locks held by an app
1038 *
1039 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001040 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001041 */
1042message WifiMulticastLockStateChanged {
1043 repeated AttributionNode attribution_node = 1;
1044
1045 enum State {
1046 OFF = 0;
1047 ON = 1;
1048 }
1049 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001050
1051 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001052}
1053
1054/**
Tej Singh1ea42892018-01-19 09:27:00 -08001055 * Logs shutdown reason and duration on next boot.
1056 *
1057 * Logged from:
1058 * frameworks/base/core/java/com/android/server/BootReceiver.java
1059 */
1060message ShutdownSequenceReported {
1061 // True if shutdown is for a reboot. Default: false if we do not know.
1062 optional bool reboot = 1;
1063
1064 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1065 optional string reason = 2;
1066
1067 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1068 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001069 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001070
1071 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001072 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001073}
1074
Tej Singh6483ea42018-01-25 17:45:49 -08001075
1076/**
1077 * Logs boot reason and duration.
1078 *
1079 * Logged from:
1080 * system/core/bootstat/bootstat.cpp
1081 */
1082message BootSequenceReported {
1083 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1084 // Default: "<EMPTY>" if not available.
1085 optional string bootloader_reason = 1;
1086
1087 // Reason for system boot. Eg. bootloader, reboot,userrequested
1088 // Default: "<EMPTY>" if not available.
1089 optional string system_reason = 2;
1090
1091 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001092 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001093
1094 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001095 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001096
1097 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001098 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001099
1100 // Time since last boot in ms. Default: 0 if not available.
1101 optional int64 time_since_last_boot = 6;
1102}
1103
Tej Singhc477d9c2018-02-05 18:31:39 -08001104
1105/**
1106 * Logs call state and disconnect cause (if applicable).
1107 *
1108 * Logged from:
1109 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1110 */
1111message CallStateChanged {
1112 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1113 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1114 optional android.telecom.CallStateEnum call_state = 1;
1115
1116 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1117 // This value is only applicable when the call_state is DISCONNECTED, and
1118 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1119 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1120 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1121
1122 // True if the call is self-managed, which are apps that use the
1123 // telecom infrastructure to make their own calls.
1124 optional bool self_managed = 3;
1125
1126 // True if call is external. External calls are calls on connected Wear
1127 // devices but show up in Telecom so the user can pull them onto the device.
1128 optional bool external_call = 4;
1129}
1130
Tej Singh1ea42892018-01-19 09:27:00 -08001131/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001132 * Logs keyguard state. The keyguard is the lock screen.
1133 *
1134 * Logged from:
1135 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1136 */
1137message KeyguardStateChanged {
1138 enum State {
1139 UNKNOWN = 0;
1140 // The keyguard is hidden when the phone is unlocked.
1141 HIDDEN = 1;
1142 // The keyguard is shown when the phone is locked (screen turns off).
1143 SHOWN= 2;
1144 // The keyguard is occluded when something is overlaying the keyguard.
1145 // Eg. Opening the camera while on the lock screen.
1146 OCCLUDED = 3;
1147 }
1148 optional State state = 1;
1149}
1150
1151/**
1152 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1153 * prompts the user to enter a password (pattern, pin, etc).
1154 *
1155 * Logged from:
1156 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1157 */
1158
1159message KeyguardBouncerStateChanged {
1160 enum State {
1161 UNKNOWN = 0;
1162 // Bouncer is hidden, either as a result of successfully entering the
1163 // password, screen timing out, or user going back to lock screen.
1164 HIDDEN = 1;
1165 // This is when the user is being prompted to enter the password.
1166 SHOWN = 2;
1167 }
1168 optional State state = 1;
1169}
1170
1171/**
1172 * Logs the result of entering a password into the keyguard bouncer.
1173 *
1174 * Logged from:
1175 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1176 */
1177message KeyguardBouncerPasswordEntered {
1178 enum BouncerResult {
1179 UNKNOWN = 0;
1180 // The password entered was incorrect.
1181 FAILURE = 1;
1182 // The password entered was correct.
1183 SUCCESS = 2;
1184 }
1185 optional BouncerResult result = 1;
1186}
1187
Tej Singha883b372018-02-15 11:30:01 -08001188/*
1189 * Logs changes to the configuration of the device. The configuration is defined
1190 * in frameworks/base/core/java/android/content/res/Configuration.java
1191 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1192 * Please go there to interpret the possible values each field can be.
1193 *
1194 * Logged from:
1195 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1196 */
1197message ResourceConfigurationChanged {
1198 // Bit mask of color capabilities of the screen.
1199 // Contains information about the color gamut and hdr mode of the screen.
1200 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001201 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001202
1203 // The target screen density being rendered to.
1204 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001205 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001206
1207 // Current user preference for the scaling factor for fonts,
1208 // relative to the base density scaling.
1209 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001210 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001211
1212 // Flag indicating whether the hard keyboard is hidden.
1213 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001214 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001215
1216 // The type of keyboard attached to the device.
1217 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1218 optional int32 keyboard = 5;
1219
1220 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1221 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001222 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001223
1224 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1225 // 0 if undefined.
1226 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1227 optional int32 mcc = 7;
1228
1229 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1230 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1231 // MNC_ZERO symbol defined in Configuration.java.
1232 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1233 optional int32 mnc = 8;
1234
1235 // The kind of navigation available on the device.
1236 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1237 optional int32 navigation = 9;
1238
1239 // Flag indicating whether the navigation is available.
1240 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001241 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001242
1243 // Overall orientation of the screen.
1244 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1245 optional int32 orientation = 11;
1246
1247 // The current height of the available screen space, in dp units.
1248 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001249 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001250
1251 // Bit mask of overall layout of the screen.
1252 // Contains information about screen size, whether the screen is wider/taller
1253 // than normal, whether the screen layout is right-tl-left or left-to-right,
1254 // and whether the screen has a rounded shape.
1255 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001256 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001257
1258 // Current width of the available screen space, in dp units.
1259 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001260 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001261
1262 // The smallest screen size an application will see in normal operation.
1263 // This is the smallest value of both screenWidthDp and screenHeightDp
1264 // in portrait and landscape.
1265 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001266 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001267
1268 // The type of touch screen attached to the device.
1269 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1270 optional int32 touchscreen = 16;
1271
1272 // Bit mask of the ui mode.
1273 // Contains information about the overall ui mode of the device.
1274 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1275 // Also contains information about whether the device is in night mode.
1276 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001277 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001278}
1279
Tej Singheee317b2018-03-07 19:28:05 -08001280
1281/**
1282 * Logs changes in the connection state of the mobile radio.
1283 *
1284 * Logged from:
1285 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1286 */
1287message MobileConnectionStateChanged {
1288 // States are from the state machine DataConnection.java.
1289 enum State {
1290 UNKNOWN = 0;
1291 // The connection is inactive, or disconnected.
1292 INACTIVE = 1;
1293 // The connection is being activated, or connecting.
1294 ACTIVATING = 2;
1295 // The connection is active, or connected.
1296 ACTIVE = 3;
1297 // The connection is disconnecting.
1298 DISCONNECTING = 4;
1299 // The connection is disconnecting after creating a connection.
1300 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1301 }
1302 optional State state = 1;
1303 // For multi-sim phones, this distinguishes between the sim cards.
1304 optional int32 sim_slot_index = 2;
1305 // Used to identify the connection. Starts at 0 and increments by 1 for
1306 // every new network created. Resets whenever the device reboots.
1307 optional int32 data_connection_id = 3;
1308 // A bitmask for the capabilities of this connection.
1309 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1310 // Default value (if we have no information): 0
1311 optional int64 capabilities = 4;
1312 // If this connection has internet.
1313 // This just checks if the DEFAULT bit of capabilities is set.
1314 optional bool has_internet = 5;
1315}
1316
1317/**
1318 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1319 *
1320 * Logged from:
1321 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1322 */
1323message MobileRadioTechnologyChanged {
1324 optional android.telephony.NetworkTypeEnum state = 1;
1325 // For multi-sim phones, this distinguishes between the sim cards.
1326 optional int32 sim_slot_index = 2;
1327}
1328
Andrew Chantb56388b2018-03-22 21:07:33 -07001329/**
1330 * Logs the VID and PID of any connected USB devices.
1331 *
1332 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1333 *
1334 * Logged by Vendor.
1335 */
1336message UsbDeviceAttached {
1337 optional int32 vid = 1;
1338 optional int32 pid = 2;
1339 optional bool has_audio = 3;
1340 optional bool has_hid = 4;
1341 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001342 enum State {
1343 STATE_DISCONNECTED = 0;
1344 STATE_CONNECTED = 1;
1345 }
1346 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001347 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001348}
1349
Tej Singheee317b2018-03-07 19:28:05 -08001350
Tej Singhdd7bd352018-02-09 19:33:15 -08001351/**
Tej Singh5d991e12018-03-09 19:48:11 -08001352 * Logs when Bluetooth is enabled and disabled.
1353 *
1354 * Logged from:
1355 * services/core/java/com/android/server/BluetoothManagerService.java
1356 */
1357message BluetoothEnabledStateChanged {
1358 repeated AttributionNode attribution_node = 1;
1359 // Whether or not bluetooth is enabled on the device.
1360 enum State {
1361 UNKNOWN = 0;
1362 ENABLED = 1;
1363 DISABLED = 2;
1364 }
1365 optional State state = 2;
1366 // The reason for being enabled/disabled.
1367 // Eg. Airplane mode, crash, application request.
1368 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1369 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001370 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001371}
1372
1373/**
Jack Hed9837c82019-01-09 01:19:13 -08001374 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001375 *
1376 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001377 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1378 *
1379 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001380 */
1381message BluetoothConnectionStateChanged {
1382 // The state of the connection.
1383 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1384 optional android.bluetooth.ConnectionStateEnum state = 1;
1385 // An identifier that can be used to match connect and disconnect events.
1386 // Currently is last two bytes of a hash of a device level ID and
1387 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001388 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1389 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001390 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1391 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001392 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001393 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001394 // An identifier that can be used to match events for this device.
1395 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1396 // Salt: Randomly generated 256 bit value
1397 // Hash algorithm: HMAC-SHA256
1398 // Size: 32 byte
1399 // Default: null or empty if the device identifier is not known
1400 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1401}
1402
1403/**
1404 * Logs when a Bluetooth device connects and disconnects over ACL
1405 *
1406 * Logged from:
1407 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1408 *
1409 * Next Tag: 3
1410 */
1411message BluetoothAclConnectionStateChanged {
1412 // An identifier that can be used to match events for this device.
1413 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1414 // Salt: Randomly generated 256 bit value
1415 // Hash algorithm: HMAC-SHA256
1416 // Size: 32 byte
1417 // Default: null or empty if the device identifier is not known
1418 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1419 // The state of the connection.
1420 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1421 optional android.bluetooth.ConnectionStateEnum state = 2;
1422}
1423
1424/**
1425 * Logs when a Bluetooth device connects and disconnects over SCO
1426 *
1427 * Logged from:
1428 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1429 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1430 *
1431 * Next Tag: 4
1432 */
1433message BluetoothScoConnectionStateChanged {
1434 // An identifier that can be used to match events for this device.
1435 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1436 // Salt: Randomly generated 256 bit value
1437 // Hash algorithm: HMAC-SHA256
1438 // Size: 32 byte
1439 // Default: null or empty if the device identifier is not known
1440 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1441 // The state of the connection.
1442 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1443 optional android.bluetooth.ConnectionStateEnum state = 2;
1444 // Codec used for this SCO connection
1445 // Default: UNKNOWN
1446 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001447}
1448
Jack Hec27040a2019-01-09 20:54:41 -08001449/**
1450 * Logged when active device of a profile changes
1451 *
1452 * Logged from:
1453 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1454 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1455 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1456 */
1457message BluetoothActiveDeviceChanged {
1458 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1459 // From android.bluetooth.BluetoothProfile
1460 optional int32 bt_profile = 1;
1461 // An identifier that can be used to match events for this new active device.
1462 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1463 // Salt: Randomly generated 256 bit value
1464 // Hash algorithm: HMAC-SHA256
1465 // Size: 32 byte
1466 // Default: null or empty if there is no active device for this profile
1467 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1468}
1469
Jack Heab86dbd22018-12-18 15:43:27 -08001470// Logs when there is an event affecting Bluetooth device's link layer connection.
1471// - This event is triggered when there is a related HCI command or event
1472// - Users of this metrics can deduce Bluetooth device's connection state from these events
1473// - HCI commands are logged before the command is sent, after receiving command status, and after
1474// receiving command complete
1475// - HCI events are logged when they arrive
1476//
1477// Low level log from system/bt
1478//
1479// Bluetooth classic commands:
1480// - CMD_CREATE_CONNECTION
1481// - CMD_DISCONNECT
1482// - CMD_CREATE_CONNECTION_CANCEL
1483// - CMD_ACCEPT_CONNECTION_REQUEST
1484// - CMD_REJECT_CONNECTION_REQUEST
1485// - CMD_SETUP_ESCO_CONNECTION
1486// - CMD_ACCEPT_ESCO_CONNECTION
1487// - CMD_REJECT_ESCO_CONNECTION
1488// - CMD_ENH_SETUP_ESCO_CONNECTION
1489// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1490//
1491// Bluetooth low energy commands:
1492// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1493// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1494// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1495// - CMD_BLE_CLEAR_WHITE_LIST
1496// - CMD_BLE_ADD_WHITE_LIST
1497// - CMD_BLE_REMOVE_WHITE_LIST
1498//
1499// Bluetooth classic events:
1500// - EVT_CONNECTION_COMP
1501// - EVT_CONNECTION_REQUEST
1502// - EVT_DISCONNECTION_COMP
1503// - EVT_ESCO_CONNECTION_COMP
1504// - EVT_ESCO_CONNECTION_CHANGED
1505//
1506// Bluetooth low energy meta events:
1507// - BLE_EVT_CONN_COMPLETE_EVT
1508// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1509//
1510// Next tag: 10
1511message BluetoothLinkLayerConnectionEvent {
1512 // An identifier that can be used to match events for this device.
1513 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1514 // Salt: Randomly generated 256 bit value
1515 // Hash algorithm: HMAC-SHA256
1516 // Size: 32 byte
1517 // Default: null or empty if the device identifier is not known
1518 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1519 // Connection handle of this connection if available
1520 // Range: 0x0000 - 0x0EFF (12 bits)
1521 // Default: 0xFFFF if the handle is unknown
1522 optional int32 connection_handle = 2;
1523 // Direction of the link
1524 // Default: DIRECTION_UNKNOWN
1525 optional android.bluetooth.DirectionEnum direction = 3;
1526 // Type of this link
1527 // Default: LINK_TYPE_UNKNOWN
1528 optional android.bluetooth.LinkTypeEnum type = 4;
1529
1530 // Reason metadata for this link layer connection event, rules for interpretation:
1531 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1532 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1533 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1534 // set and valid, ignore hci_ble_event
1535
1536 // HCI command associated with this event
1537 // Default: CMD_UNKNOWN
1538 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1539 // HCI event associated with this event
1540 // Default: EVT_UNKNOWN
1541 optional android.bluetooth.hci.EventEnum hci_event = 6;
1542 // HCI BLE meta event associated with this event
1543 // Default: BLE_EVT_UNKNOWN
1544 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1545 // HCI command status code if this is triggerred by hci_cmd
1546 // Default: STATUS_UNKNOWN
1547 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1548 // HCI reason code associated with this event
1549 // Default: STATUS_UNKNOWN
1550 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1551}
1552
Howard Roe103fe22019-01-17 16:52:16 -08001553/**
1554 * Logs when a module is rolled back by Watchdog.
1555 *
1556 * Logged from: Rollback Manager
1557 */
1558message WatchdogRollbackOccurred {
1559 enum RollbackType {
1560 UNKNOWN = 0;
1561 ROLLBACK_INITIATE = 1;
1562 ROLLBACK_SUCCESS = 2;
1563 ROLLBACK_FAILURE = 3;
1564 }
1565 optional RollbackType rollback_type = 1;
1566
1567 optional string package_name = 2;
1568
1569 optional int32 package_version_code = 3;
1570}
1571
Jack Hec27040a2019-01-09 20:54:41 -08001572/**
1573 * Logs when there is a change in Bluetooth A2DP playback state
1574 *
1575 * Logged from:
1576 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1577 */
1578message BluetoothA2dpPlaybackStateChanged {
1579 // An identifier that can be used to match events for this device.
1580 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1581 // Salt: Randomly generated 256 bit value
1582 // Hash algorithm: HMAC-SHA256
1583 // Size: 32 byte
1584 // Default: null or empty if the device identifier is not known
1585 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1586 // Current playback state
1587 // Default: PLAYBACK_STATE_UNKNOWN
1588 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1589 // Current audio coding mode
1590 // Default: AUDIO_CODING_MODE_UNKNOWN
1591 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1592}
1593
1594/**
1595 * Logs when there is a change in A2DP codec config for a particular remote device
1596 *
1597 * Logged from:
1598 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1599 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1600 */
1601message BluetoothA2dpCodecConfigChanged {
1602 // An identifier that can be used to match events for this device.
1603 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1604 // Salt: Randomly generated 256 bit value
1605 // Hash algorithm: HMAC-SHA256
1606 // Size: 32 byte
1607 // Default: null or empty if the device identifier is not known
1608 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1609 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1610 // Default SOURCE_CODEC_TYPE_INVALID
1611 optional int32 codec_type = 2;
1612 // Codec priroity, the higher the more preferred, -1 for disabled
1613 // Default: CODEC_PRIORITY_DEFAULT
1614 optional int32 codec_priority = 3;
1615 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1616 // Default: SAMPLE_RATE_NONE
1617 optional int32 sample_rate = 4;
1618 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1619 // Default: BITS_PER_SAMPLE_NONE
1620 optional int32 bits_per_sample = 5;
1621 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1622 // Default: CHANNEL_MODE_NONE
1623 optional int32 channel_mode = 6;
1624 // Codec specific values
1625 // Default 0
1626 optional int64 codec_specific_1 = 7;
1627 optional int64 codec_specific_2 = 8;
1628 optional int64 codec_specific_3 = 9;
1629 optional int64 codec_specific_4 = 10;
1630}
1631
1632/**
1633 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1634 * Each codec's capability is logged separately due to statsd restriction
1635 *
1636 * Logged from:
1637 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1638 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1639 */
1640message BluetoothA2dpCodecCapabilityChanged {
1641 // An identifier that can be used to match events for this device.
1642 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1643 // Salt: Randomly generated 256 bit value
1644 // Hash algorithm: HMAC-SHA256
1645 // Size: 32 byte
1646 // Default: null or empty if the device identifier is not known
1647 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1648 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1649 // Default SOURCE_CODEC_TYPE_INVALID
1650 optional int32 codec_type = 2;
1651 // Codec priroity, the higher the more preferred, -1 for disabled
1652 // Default: CODEC_PRIORITY_DEFAULT
1653 optional int32 codec_priority = 3;
1654 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1655 // in BluetoothCodecConfig
1656 // Default: empty and SAMPLE_RATE_NONE for individual item
1657 optional int32 sample_rate = 4;
1658 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1659 // in BluetoothCodecConfig
1660 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1661 optional int32 bits_per_sample = 5;
1662 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1663 // BluetoothCodecConfig
1664 // Default: empty and CHANNEL_MODE_NONE for individual item
1665 optional int32 channel_mode = 6;
1666 // Codec specific values
1667 // Default 0
1668 optional int64 codec_specific_1 = 7;
1669 optional int64 codec_specific_2 = 8;
1670 optional int64 codec_specific_3 = 9;
1671 optional int64 codec_specific_4 = 10;
1672}
1673
1674/**
1675 * Logs when A2DP failed to read from PCM source.
1676 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1677 *
1678 * Logged from:
1679 * system/bt
1680 */
1681message BluetoothA2dpAudioUnderrunReported {
1682 // An identifier that can be used to match events for this device.
1683 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1684 // Salt: Randomly generated 256 bit value
1685 // Hash algorithm: HMAC-SHA256
1686 // Size: 32 byte
1687 // Default: null or empty if the device identifier is not known
1688 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1689 // Encoding interval in nanoseconds
1690 // Default: 0
1691 optional int64 encoding_interval_nanos = 2;
1692 // Number of bytes of PCM data that could not be read from the source
1693 // Default: 0
1694 optional int32 num_missing_pcm_bytes = 3;
1695}
1696
1697/**
1698 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1699 * buffer queue is full and we have to drop data
1700 *
1701 * Logged from:
1702 * system/bt
1703 */
1704message BluetoothA2dpAudioOverrunReported {
1705 // An identifier that can be used to match events for this device.
1706 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1707 // Salt: Randomly generated 256 bit value
1708 // Hash algorithm: HMAC-SHA256
1709 // Size: 32 byte
1710 // Default: null or empty if the device identifier is not known
1711 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1712 // Encoding interval in nanoseconds
1713 // Default: 0
1714 optional int64 encoding_interval_nanos = 2;
1715 // Number of buffers dropped in this event
1716 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1717 // Default: 0
1718 optional int32 num_dropped_buffers = 3;
1719 // Number of encoded buffers dropped in this event
1720 // Default 0
1721 optional int32 num_dropped_encoded_frames = 4;
1722 // Number of encoded bytes dropped in this event
1723 // Default: 0
1724 optional int32 num_dropped_encoded_bytes = 5;
1725}
1726
1727/**
1728 * Logs when we receive reports regarding a device's RSSI value
1729 *
1730 * Logged from:
1731 * system/bt
1732 */
1733message BluetoothDeviceRssiReported {
1734 // An identifier that can be used to match events for this device.
1735 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1736 // Salt: Randomly generated 256 bit value
1737 // Hash algorithm: HMAC-SHA256
1738 // Size: 32 byte
1739 // Default: null or empty if the device identifier is not known
1740 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1741 // Connection handle of this connection if available
1742 // Range: 0x0000 - 0x0EFF (12 bits)
1743 // Default: 0xFFFF if the handle is unknown
1744 optional int32 connection_handle = 2;
1745 // HCI command status code if this is triggerred by hci_cmd
1746 // Default: STATUS_UNKNOWN
1747 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1748 // BR/EDR
1749 // Range: -128 ≤ N ≤ 127 (signed integer)
1750 // Units: dB
1751 // LE:
1752 // Range: -127 to 20, 127 (signed integer)
1753 // Units: dBm
1754 // Invalid when an out of range value is reported
1755 optional int32 rssi = 4;
1756}
1757
1758/**
1759 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1760 *
1761 * Logged from:
1762 * system/bt
1763 */
1764message BluetoothDeviceFailedContactCounterReported {
1765 // An identifier that can be used to match events for this device.
1766 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1767 // Salt: Randomly generated 256 bit value
1768 // Hash algorithm: HMAC-SHA256
1769 // Size: 32 byte
1770 // Default: null or empty if the device identifier is not known
1771 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1772 // Connection handle of this connection if available
1773 // Range: 0x0000 - 0x0EFF (12 bits)
1774 // Default: 0xFFFF if the handle is unknown
1775 optional int32 connection_handle = 2;
1776 // HCI command status code if this is triggerred by hci_cmd
1777 // Default: STATUS_UNKNOWN
1778 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1779 // Number of consecutive failed contacts for a connection corresponding to the Handle
1780 // Range: uint16_t, 0-0xFFFF
1781 // Default: 0xFFFFF
1782 optional int32 failed_contact_counter = 4;
1783}
1784
1785/**
1786 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1787 *
1788 * Logged from:
1789 * system/bt
1790 */
1791message BluetoothDeviceTxPowerLevelReported {
1792 // An identifier that can be used to match events for this device.
1793 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1794 // Salt: Randomly generated 256 bit value
1795 // Hash algorithm: HMAC-SHA256
1796 // Size: 32 byte
1797 // Default: null or empty if the device identifier is not known
1798 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1799 // Connection handle of this connection if available
1800 // Range: 0x0000 - 0x0EFF (12 bits)
1801 // Default: 0xFFFF if the handle is unknown
1802 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001803 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001804 // Default: STATUS_UNKNOWN
1805 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1806 // Range: -30 ≤ N ≤ 20
1807 // Units: dBm
1808 // Invalid when an out of range value is reported
1809 optional int32 transmit_power_level = 4;
1810}
Jack Heab86dbd22018-12-18 15:43:27 -08001811
Tej Singh5d991e12018-03-09 19:48:11 -08001812/**
Jack He1021a612019-01-20 21:22:46 -08001813 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1814 * receiving an HCI command from the host
1815 *
1816 * Logged from: system/bt
1817 */
1818message BluetoothHciTimeoutReported {
1819 // HCI command associated with this event
1820 // Default: CMD_UNKNOWN
1821 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1822}
1823
1824/**
1825 * Logs when we receive Bluetooth Link Quality Report event from the controller
1826 * See Android Bluetooth HCI specification for more details
1827 *
1828 * Note: all count and bytes field are counted since last event
1829 *
1830 * Logged from: system/bt
1831 */
1832message BluetoothQualityReportReported {
1833 // Quality report ID
1834 // Original type: uint8_t
1835 // Default: BQR_ID_UNKNOWN
1836 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1837 // Packet type of the connection
1838 // Original type: uint8_t
1839 // Default: BQR_PACKET_TYPE_UNKNOWN
1840 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1841 // Connection handle of the connection
1842 // Original type: uint16_t
1843 optional int32 connection_handle = 3;
1844 // Performing Role for the connection
1845 // Original type: uint8_t
1846 optional int32 connection_role = 4;
1847 // Current Transmit Power Level for the connection. This value is the same as the controller's
1848 // response to the HCI_Read_Transmit_Power_Level HCI command
1849 // Original type: uint8_t
1850 optional int32 tx_power_level = 5;
1851 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1852 // absolute receiver signal strength value
1853 // Original type: int8_t
1854 optional int32 rssi = 6;
1855 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1856 // channels used by the link currently
1857 // Original type: uint8_t
1858 optional int32 snr = 7;
1859 // Indicates the number of unused channels in AFH_channel_map
1860 // Original type: uint8_t
1861 optional int32 unused_afh_channel_count = 8;
1862 // Indicates the number of the channels which are interfered and quality is bad but are still
1863 // selected for AFH
1864 // Original type: uint8_t
1865 optional int32 afh_select_unideal_channel_count = 9;
1866 // Current Link Supervision Timeout Setting
1867 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1868 // Original type: uint16_t
1869 optional int32 lsto = 10;
1870 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1871 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1872 // 0x01 (Piconet Clock)
1873 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1874 // Original type: uint32_t
1875 optional int64 connection_piconet_clock = 11;
1876 // The count of retransmission
1877 // Original type: uint32_t
1878 optional int64 retransmission_count = 12;
1879 // The count of no RX
1880 // Original type: uint32_t
1881 optional int64 no_rx_count = 13;
1882 // The count of NAK (Negative Acknowledge)
1883 // Original type: uint32_t
1884 optional int64 nak_count = 14;
1885 // Controller timestamp of last TX ACK
1886 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1887 // Original type: uint32_t
1888 optional int64 last_tx_ack_timestamp = 15;
1889 // The count of Flow-off (STOP)
1890 // Original type: uint32_t
1891 optional int64 flow_off_count = 16;
1892 // Controller timestamp of last Flow-on (GO)
1893 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1894 // Original type: uint32_t
1895 optional int64 last_flow_on_timestamp = 17;
1896 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1897 // Original type: uint32_t
1898 optional int64 buffer_overflow_bytes = 18;
1899 // Buffer underflow count (in byte) since last event
1900 // Original type: uint32_t
1901 optional int64 buffer_underflow_bytes = 19;
1902}
1903
1904/**
1905 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1906 *
1907 * Notes:
1908 * - Each event can be partially filled as we might learn different pieces of device
1909 * information at different time
1910 * - Multiple device info events can be combined to give more complete picture
1911 * - When multiple device info events tries to describe the same information, the
1912 * later one wins
1913 *
1914 * Logged from:
1915 * packages/apps/Bluetooth
1916 */
1917message BluetoothManufacturerInfoReported {
1918 // An identifier that can be used to match events for this device.
1919 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1920 // Salt: Randomly generated 256 bit value
1921 // Hash algorithm: HMAC-SHA256
1922 // Size: 32 byte
1923 // Default: null or empty if the device identifier is not known
1924 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1925 // Where is this device info obtained from
1926 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1927 // Name of the data source
1928 // For EXTERNAL: package name of the data source
1929 // For INTERNAL: null for general case, component name otherwise
1930 optional string source_name = 3;
1931 // Name of the manufacturer of this device
1932 optional string manufacturer = 4;
1933 // Model of this device
1934 optional string model = 5;
1935 // Hardware version of this device
1936 optional string hardware_version = 6;
1937 // Software version of this device
1938 optional string software_version = 7;
1939}
1940
1941/**
1942 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1943 * device, as documented by the Bluetooth Core HCI specification
1944 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1945 * Vol 2, Part E, Page 1118
1946 *
1947 * Logged from:
1948 * system/bt
1949 */
1950message BluetoothRemoteVersionInfoReported {
1951 // Connection handle of the connection
1952 // Original type: uint16_t
1953 optional int32 connection_handle = 1;
1954 // HCI command status code
1955 // Default: STATUS_UNKNOWN
1956 optional android.bluetooth.hci.StatusEnum hci_status = 2;
1957 // 1 byte Version of current LMP in the remote controller
1958 optional int32 lmp_version = 3;
1959 // 2 bytes LMP manufacturer code of the remote controller
1960 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
1961 optional int32 lmp_manufacturer_code = 4;
1962 // 4 bytes subversion of the LMP in the remote controller
1963 optional int32 lmp_subversion = 5;
1964}
1965
1966/**
1967 * Logs when certain Bluetooth SDP attributes are discovered
1968 * Constant definitions are from:
1969 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
1970 *
1971 * Current logged attributes:
1972 * - BluetoothProfileDescriptorList
1973 * - Supported Features Bitmask
1974 *
1975 * Logged from:
1976 * system/bt
1977 */
1978message BluetoothSdpAttributeReported {
1979 // An identifier that can be used to match events for this device.
1980 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1981 // Salt: Randomly generated 256 bit value
1982 // Hash algorithm: HMAC-SHA256
1983 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1984 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
1985 // Original type: uint16_t
1986 optional int32 protocol_uuid = 2;
1987 // Short form UUIDs used to identify Bluetooth SDP attribute types
1988 // Original type: uint16_t
1989 optional int32 attribute_id = 3;
1990 // Attribute value for the particular attribute
1991 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1992}
1993
1994/**
1995 * Logs when bond state of a Bluetooth device changes
1996 *
1997 * Logged from:
1998 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
1999 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2000 */
2001message BluetoothBondStateChanged {
2002 // An identifier that can be used to match events for this device.
2003 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2004 // Salt: Randomly generated 256 bit value
2005 // Hash algorithm: HMAC-SHA256
2006 // Size: 32 byte
2007 // Default: null or empty if the device identifier is not known
2008 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2009 // Preferred transport type to remote dual mode device
2010 // Default: TRANSPORT_AUTO means no preference
2011 optional android.bluetooth.TransportTypeEnum transport = 2;
2012 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2013 // Default: UNKNOWN
2014 optional android.bluetooth.DeviceTypeEnum type = 3;
2015 // Current bond state (NONE, BONDING, BONDED)
2016 // Default: BOND_STATE_UNKNOWN
2017 optional android.bluetooth.BondStateEnum bond_state = 4;
2018 // Bonding sub state
2019 // Default: BOND_SUB_STATE_UNKNOWN
2020 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2021 // Unbond Reason
2022 // Default: UNBOND_REASON_UNKNOWN
2023 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2024}
2025
2026/**
2027 * Logs there is an event related Bluetooth classic pairing
2028 *
2029 * Logged from:
2030 * system/bt
2031 */
2032message BluetoothClassicPairingEventReported {
2033 // An identifier that can be used to match events for this device.
2034 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2035 // Salt: Randomly generated 256 bit value
2036 // Hash algorithm: HMAC-SHA256
2037 // Size: 32 byte
2038 // Default: null or empty if the device identifier is not known
2039 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2040 // Connection handle of this connection if available
2041 // Range: 0x0000 - 0x0EFF (12 bits)
2042 // Default: 0xFFFF if the handle is unknown
2043 optional int32 connection_handle = 2;
2044 // HCI command associated with this event
2045 // Default: CMD_UNKNOWN
2046 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2047 // HCI event associated with this event
2048 // Default: EVT_UNKNOWN
2049 optional android.bluetooth.hci.EventEnum hci_event = 4;
2050 // HCI command status code if this is triggerred by hci_cmd
2051 // Default: STATUS_UNKNOWN
2052 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2053 // HCI reason code associated with this event
2054 // Default: STATUS_UNKNOWN
2055 optional android.bluetooth.hci.StatusEnum reason_code = 6;
2056}
2057
2058/**
2059 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2060 *
2061 * Logged from:
2062 * system/bt
2063 */
2064message BluetoothSmpPairingEventReported {
2065 // An identifier that can be used to match events for this device.
2066 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2067 // Salt: Randomly generated 256 bit value
2068 // Hash algorithm: HMAC-SHA256
2069 // Size: 32 byte
2070 // Default: null or empty if the device identifier is not known
2071 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2072 // SMP command sent or received over L2CAP
2073 // Default: CMD_UNKNOWN
2074 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2075 // Whether this command is sent or received
2076 // Default: DIRECTION_UNKNOWN
2077 optional android.bluetooth.DirectionEnum direction = 3;
2078 // SMP failure reason code
2079 // Default: PAIRING_FAIL_REASON_DEFAULT
2080 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2081}
2082
2083/**
Jack He815cdba2019-01-30 17:24:55 -08002084 * Logs when a Bluetooth socket’s connection state changed
2085 *
2086 * Logged from:
2087 * system/bt
2088 */
2089message BluetoothSocketConnectionStateChanged {
2090 // An identifier that can be used to match events for this device.
2091 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2092 // Salt: Randomly generated 256 bit value
2093 // Hash algorithm: HMAC-SHA256
2094 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002095 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002096 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002097 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002098 // Default 0 when unknown or don't care
2099 optional int32 port = 2;
2100 // Socket type as mentioned in
2101 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2102 // Default: SOCKET_TYPE_UNKNOWN
2103 optional android.bluetooth.SocketTypeEnum type = 3;
2104 // Socket connection state
2105 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2106 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2107 // Number of bytes sent to remote device during this connection
2108 optional int64 tx_bytes = 5;
2109 // Number of bytes received from remote device during this connection
2110 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002111 // Socket owner's UID
2112 optional int32 uid = 7 [(is_uid) = true];
2113 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2114 // |port| must be spawned by |server_port|
2115 // Default 0 when unknown or don't care
2116 optional int32 server_port = 8;
2117 // Whether this is a server listener socket
2118 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002119}
2120
2121/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002122 * Logs when something is plugged into or removed from the USB-C connector.
2123 *
2124 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002125 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002126 */
2127message UsbConnectorStateChanged {
2128 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002129 STATE_DISCONNECTED = 0;
2130 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002131 }
2132 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002133 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002134 // Last active session in ms.
2135 // 0 when the port is in connected state.
2136 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002137}
2138
2139/**
2140 * Logs the reported speaker impedance.
2141 *
2142 * Logged from:
2143 * Vendor audio implementation.
2144 */
2145message SpeakerImpedanceReported {
2146 optional int32 speaker_location = 1;
2147 optional int32 impedance = 2;
2148}
2149
2150/**
2151 * Logs the report of a failed hardware.
2152 *
2153 * Logged from:
2154 * Vendor HALs.
2155 *
2156 */
2157message HardwareFailed {
2158 enum HardwareType {
2159 HARDWARE_FAILED_UNKNOWN = 0;
2160 HARDWARE_FAILED_MICROPHONE = 1;
2161 HARDWARE_FAILED_CODEC = 2;
2162 HARDWARE_FAILED_SPEAKER = 3;
2163 HARDWARE_FAILED_FINGERPRINT = 4;
2164 }
2165 optional HardwareType hardware_type = 1;
2166
Maggie White6dcd8572019-01-31 14:11:50 -08002167 /**
2168 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002169 * the same hardware_type. The specific locations are vendor defined integers,
2170 * referring to board-specific numbering schemes.
2171 */
2172 optional int32 hardware_location = 2;
2173
Maggie White6dcd8572019-01-31 14:11:50 -08002174 /**
2175 * failure_code is specific to the HardwareType of the failed hardware.
2176 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002177 */
Maggie White6dcd8572019-01-31 14:11:50 -08002178 enum HardwareErrorCode {
2179 UNKNOWN = 0;
2180 COMPLETE = 1;
2181 SPEAKER_HIGH_Z = 2;
2182 SPEAKER_SHORT = 3;
2183 FINGERPRINT_SENSOR_BROKEN = 4;
2184 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002185 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002186 }
2187 optional int32 failure_code = 3;
2188}
2189
2190/**
2191 * Log an event when the device has been physically dropped.
2192 * Reported from the /vendor partition.
2193 */
2194message PhysicalDropDetected {
2195 // Confidence that the event was actually a drop, 0 -> 100
2196 optional int32 confidence_pctg = 1;
2197 // Peak acceleration of the drop, in 1/1000s of a g.
2198 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002199 // Duration of freefall in ms
2200 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002201}
2202
2203/**
2204 * Log bucketed battery charge cycles.
2205 *
2206 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002207 * a given charge point. For example, if 10 cycle buckets are
2208 * initialized, bucket 1 is the lowest 1/10th of the battery,
2209 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002210 *
2211 * Logged from:
2212 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2213 */
2214message ChargeCyclesReported {
2215 optional int32 cycle_bucket_1 = 1;
2216 optional int32 cycle_bucket_2 = 2;
2217 optional int32 cycle_bucket_3 = 3;
2218 optional int32 cycle_bucket_4 = 4;
2219 optional int32 cycle_bucket_5 = 5;
2220 optional int32 cycle_bucket_6 = 6;
2221 optional int32 cycle_bucket_7 = 7;
2222 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002223 optional int32 cycle_bucket_9 = 9;
2224 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002225}
2226
2227/**
Howard Roa46b6582018-09-18 16:45:02 -07002228 * Log battery health snapshot.
2229 *
2230 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2231 * are snapshotted periodically over 24hrs.
2232 */
2233message BatteryHealthSnapshot {
2234 enum BatterySnapshotType {
2235 UNKNOWN = 0;
2236 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2237 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2238 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2239 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2240 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2241 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2242 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2243 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2244 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2245 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2246 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2247 }
2248 optional BatterySnapshotType type = 1;
2249 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002250 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002251 // Voltage Battery Voltage, in microVolts.
2252 optional int32 voltage_micro_volt = 3;
2253 // Current Battery current, in microAmps.
2254 optional int32 current_micro_amps = 4;
2255 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2256 optional int32 open_circuit_micro_volt = 5;
2257 // Resistance Battery Resistance, in microOhms.
2258 optional int32 resistance_micro_ohm = 6;
2259 // Level Battery Level, as % of full.
2260 optional int32 level_percent = 7;
2261}
2262
2263/**
2264 * Log slow I/O operations on the primary storage.
2265 */
2266message SlowIo {
2267 // Classifications of IO Operations.
2268 enum IoOperation {
2269 UNKNOWN = 0;
2270 READ = 1;
2271 WRITE = 2;
2272 UNMAP = 3;
2273 SYNC = 4;
2274 }
2275 optional IoOperation operation = 1;
2276
2277 // The number of slow IO operations of this type over 24 hours.
2278 optional int32 count = 2;
2279}
2280
2281/**
2282 * Log battery caused shutdown with the last recorded voltage.
2283 */
2284message BatteryCausedShutdown {
2285 // The last recorded battery voltage prior to shutdown.
2286 optional int32 last_recorded_micro_volt = 1;
2287}
2288
2289/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002290 * Logs the duration of a davey (jank of >=700ms) when it occurs
2291 *
2292 * Logged from:
2293 * frameworks/base/libs/hwui/JankTracker.cpp
2294 */
2295message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002296 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002297 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002298
Tej Singhbb8554a2018-01-26 11:59:14 -08002299 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002300 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002301}
2302
2303/**
Bookatze5885242017-10-24 20:10:31 -07002304 * Logs phone signal strength changes.
2305 *
2306 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002307 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002308 */
2309message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002310 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2311 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002312}
2313
Yangster4ccebea2018-10-09 17:09:02 -07002314
2315/**
2316 * Logs when the phone state, sim state or signal strength changes
2317 *
2318 * Logged from:
2319 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2320 */
2321message PhoneServiceStateChanged {
2322 optional android.telephony.ServiceStateEnum state = 1;
2323 optional android.telephony.SimStateEnum sim_state = 2;
2324 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2325}
2326
2327/**
2328 * Logs when the phone becomes on or off.
2329 *
2330 * Logged from:
2331 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2332 */
2333message PhoneStateChanged {
2334 enum State {
2335 OFF = 0;
2336 ON = 1;
2337 }
2338 optional State state = 1;
2339}
2340
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002341message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002342 optional android.stats.launcher.LauncherAction action = 1;
2343 optional android.stats.launcher.LauncherState src_state = 2;
2344 optional android.stats.launcher.LauncherState dst_state = 3;
2345 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002346 optional bool is_swipe_up_enabled = 5;
2347}
2348
David Chenc28b2bb2017-10-24 12:52:52 -07002349/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002350 * Logs when Settings UI has changed.
2351 *
2352 * Logged from:
2353 * packages/apps/Settings
2354 */
2355message SettingsUIChanged {
2356 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002357 * Where this SettingsUIChange event comes from. For example, if
2358 * it's a PAGE_VISIBLE event, where the page is opened from.
2359 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002360 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002361
2362 /**
2363 * What the UI action is.
2364 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002365 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002366
2367 /**
2368 * Where the action is happening
2369 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002370 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002371
2372 /**
2373 * What preference changed in this event.
2374 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002375 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002376
2377 /**
2378 * The new value of the changed preference.
2379 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002380 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002381}
2382
2383/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002384 * Logs basic timing information about touch events.
2385 * Reported at most every 5 minutes while device is being interacted with.
2386 *
2387 * Logged from:
2388 * frameworks/native/services/inputflinger
2389 */
2390message TouchEventReported {
2391 /**
2392 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2393 * and the standard deviation of latency between the kernel and framework
2394 * for touchscreen events. The units are microseconds.
2395 *
2396 * The number is measured as the difference between the time at which
2397 * the input event was received in the evdev driver,
2398 * and the time at which the input event was received in EventHub.
2399 */
2400 // Minimum value
2401 optional float latency_min_micros = 1;
2402 // Maximum value
2403 optional float latency_max_micros = 2;
2404 // Average value
2405 optional float latency_mean_micros = 3;
2406 // Standard deviation
2407 optional float latency_stdev_micros = 4;
2408}
2409
2410/**
Philip Quinn0eded622019-01-29 12:46:28 -08002411 * Logs gesture classification and timing information for touch events.
2412 *
2413 * Logged from:
2414 * frameworks/base/core/java/android/view/GestureDetector.java
2415 * frameworks/base/core/java/android/view/View.java
2416 */
2417message TouchGestureClassified {
2418 // The source of the classification (e.g. Java class name).
2419 optional string source = 1;
2420
2421 enum Classification {
2422 UNKNOWN_CLASSIFICATION = 0;
2423 SINGLE_TAP = 1;
2424 DOUBLE_TAP = 2;
2425 LONG_PRESS = 3;
2426 DEEP_PRESS = 4;
2427 SCROLL = 5;
2428 }
2429 // The classification of the gesture.
2430 optional Classification classification = 2;
2431
2432 // The interval from the start of a touch event stream until the
2433 // classification was made.
2434 optional int32 latency_millis = 3;
2435
2436 // The distance from the location of the first touch event to the
2437 // location of the touch event when the classification was made.
2438 optional float displacement_px = 4;
2439}
2440
2441/**
David Chenc28b2bb2017-10-24 12:52:52 -07002442 * Logs that a setting was updated.
2443 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002444 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002445 * The tag and is_default allow resetting of settings to default values based on the specified
2446 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2447 */
2448message SettingChanged {
2449 // The name of the setting.
2450 optional string setting = 1;
2451
2452 // The change being imposed on this setting. May represent a number, eg "3".
2453 optional string value = 2;
2454
2455 // The new value of this setting. For most settings, this is same as value. For some settings,
2456 // value is +X or -X where X represents an element in a set. For example, if the previous value
2457 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2458 // The +/- feature is currently only used for location_providers_allowed.
2459 optional string new_value = 3;
2460
2461 // The previous value of this setting.
2462 optional string prev_value = 4;
2463
2464 // The tag used with the is_default for resetting sets of settings. This is generally null.
2465 optional string tag = 5;
2466
Bookatz90867622018-01-31 15:05:57 -08002467 // True if this setting with tag should be resettable.
2468 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002469
David Chenbd789912018-03-16 17:19:55 -07002470 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002471 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002472
2473 enum ChangeReason {
2474 UPDATED = 1; // Updated can be an insertion or an update.
2475 DELETED = 2;
2476 }
2477 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002478}
Chenjie Yub3dda412017-10-24 13:41:59 -07002479
Chenjie Yu05013b32017-11-21 10:21:41 -08002480/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002481 * Logs activity going to foreground or background
2482 *
2483 * Logged from:
2484 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2485 */
2486message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002487 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002488 optional string pkg_name = 2;
2489 optional string class_name = 3;
2490
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002491 enum State {
2492 BACKGROUND = 0;
2493 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002494 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002495 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002496}
David Chenc8a43242017-10-17 16:23:28 -07002497
2498/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002499 * Logs when a volume entered low Storage state.
2500 * Logged from:
2501 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2502 */
2503message LowStorageStateChanged {
2504 // Volume that ran out of storage.
2505 optional string volume_description = 1;
2506
2507 enum State {
2508 UNKNOWN = 0;
2509 OFF = 1;
2510 ON = 2;
2511 }
2512 optional State state = 2;
2513}
2514
2515/**
2516 * Logs when an app is downgraded.
2517 * Logged from:
2518 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2519 */
2520message AppDowngraded {
2521 optional string package_name = 1;
2522 // Size of the package (all data) before being downgraded.
2523 optional int64 size_in_bytes_before = 2;
2524 // Size of the package (all data) after being downgraded.
2525 optional int64 size_in_bytes_after = 3;
2526
2527 optional bool aggressive = 4;
2528}
2529
2530/**
2531 * Logs when an app is optimized after being downgraded.
2532 * Logged from:
2533 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2534 */
2535message AppOptimizedAfterDowngraded {
2536 optional string package_name = 1;
2537}
2538
2539/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002540 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002541 * Logged from:
2542 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2543 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002544message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002545 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002546
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002547 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002548
2549 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002550 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002551 optional string process_name = 3;
2552
2553 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002554 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002555
2556 optional string package_name = 5;
2557
2558 enum InstantApp {
2559 UNAVAILABLE = 0;
2560 FALSE = 1;
2561 TRUE = 2;
2562 }
2563 optional InstantApp is_instant_app = 6;
2564
2565 enum ForegroundState {
2566 UNKNOWN = 0;
2567 BACKGROUND = 1;
2568 FOREGROUND = 2;
2569 }
2570 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002571
2572 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002573}
David Chen9e3808c2017-11-20 17:25:34 -08002574
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002575/**
2576 * Logs when a WTF (What a Terrible Failure) happened.
2577 * Logged from:
2578 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2579 */
2580message WTFOccurred {
2581 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002582
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002583 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002584
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002585 // The name of the process.
2586 // system_server if it is not by an app
2587 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002588
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002589 // The pid if available. -1 means not available.
2590 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002591
2592 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002593}
2594
2595/**
2596 * Logs when system server reports low memory.
2597 * Logged from:
2598 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2599 */
2600message LowMemReported {
2601}
2602
2603/**
2604 * Logs when an app ANR (App Not Responding) occurs.
2605 * Logged from:
2606 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2607 */
2608message ANROccurred {
2609 optional int32 uid = 1 [(is_uid) = true];
2610
2611 optional string process_name = 2;
2612
2613 optional string short_component_name = 3;
2614
2615 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002616
2617 enum InstantApp {
2618 UNAVAILABLE = 0;
2619 FALSE = 1;
2620 TRUE = 2;
2621 }
2622 optional InstantApp is_instant_app = 5;
2623
2624 enum ForegroundState {
2625 UNKNOWN = 0;
2626 BACKGROUND = 1;
2627 FOREGROUND = 2;
2628 }
2629 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002630
2631 optional android.server.ErrorSource error_source = 7;
2632
2633 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002634}
2635
Bookatza7020bd2018-08-28 16:29:35 -07002636/**
2637 * Logs when the vibrator state changes.
2638 * Logged from:
2639 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2640 */
2641message VibratorStateChanged {
2642 repeated AttributionNode attribution_node = 1;
2643
2644 enum State {
2645 OFF = 0;
2646 ON = 1;
2647 }
2648 optional State state = 2;
2649
2650 // Duration (in milliseconds) requested to keep the vibrator on.
2651 // Only applicable for State == ON.
2652 optional int64 duration_millis = 3;
2653}
2654
David Chen0a368b22017-12-06 16:28:16 -08002655/*
2656 * Allows other apps to push events into statsd.
2657 * Logged from:
2658 * frameworks/base/core/java/android/util/StatsLog.java
2659 */
David Chen0b5c90c2018-01-25 16:51:49 -08002660message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002661 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002662 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002663
2664 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2665 optional int32 label = 2;
2666
2667 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2668 // predicates for the metrics).
2669 enum State {
2670 UNKNOWN = 0;
2671 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2672 STOP = 2;
2673 START = 3;
2674 }
2675 optional State state = 3;
2676}
2677
David Chen9e3808c2017-11-20 17:25:34 -08002678/**
Bookatz7948c872018-09-04 12:58:33 -07002679 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2680 * For example, this could be due to the user manually changing the time.
2681 *
2682 * Logged from:
2683 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2684 */
2685message WallClockTimeShifted {
2686 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2687 optional int64 wall_clock_timestamp_millis = 1;
2688}
2689
2690/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002691 * Logs when statsd detects an anomaly.
2692 *
2693 * Logged from:
2694 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2695 */
2696message AnomalyDetected {
2697 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002698 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002699
Yangster-mac94e197c2018-01-02 16:03:03 -08002700 // Id of the config whose anomaly detection alert fired.
2701 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002702
Yangster-mac94e197c2018-01-02 16:03:03 -08002703 // Id of the alert (i.e. name of the anomaly that was detected).
2704 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002705}
2706
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002707message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002708 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002709 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002710
2711 // The app package name.
2712 optional string pkg_name = 2;
2713
2714 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002715 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002716 WARM = 1;
2717 HOT = 2;
2718 COLD = 3;
2719 }
2720 // The transition type.
2721 optional TransitionType type = 3;
2722
2723 // The activity name.
2724 optional string activity_name = 4;
2725
2726 // The name of the calling app. Empty if not set.
2727 optional string calling_pkg_name = 5;
2728
2729 // Whether the app is an instant app.
2730 optional bool is_instant_app = 6;
2731
2732 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002733 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002734
Bookatz80d11a02018-01-16 10:46:35 -08002735 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002736
David Chen0b5c90c2018-01-25 16:51:49 -08002737 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002738 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002739 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002740 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002741 optional int32 bind_application_delay_millis = 11;
2742 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002743
2744 // Empty if not set.
2745 optional string launch_token = 13;
2746
Calin Juravle759fbda2018-02-20 19:52:30 +00002747 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002748 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002749
2750 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002751 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002752}
2753
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002754message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002755 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002756 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002757
2758 // The app package name.
2759 optional string pkg_name = 2;
2760
2761 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002762 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002763 WARM = 1;
2764 HOT = 2;
2765 COLD = 3;
2766 }
2767 // The transition type.
2768 optional TransitionType type = 3;
2769
2770 // The activity name.
2771 optional string activity_name = 4;
2772}
2773
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002774message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002775 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002776 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002777
2778 // The app package name.
2779 optional string pkg_name = 2;
2780
2781 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002782 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002783 WITH_BUNDLE = 1;
2784 WITHOUT_BUNDLE = 2;
2785 }
2786 // The transition type.
2787 optional TransitionType type = 3;
2788
2789 // The activity name.
2790 optional string activity_name = 4;
2791
2792 optional bool transition_process_running = 5;
2793
2794 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002795 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002796}
2797
Bookatz8fcd09a2017-12-18 13:01:10 -08002798/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002799 * Logs a picture-in-picture action
2800 * Logged from:
2801 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2802 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2803 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2804 */
2805message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002806 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002807 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002808
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002809 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002810
Chenjie Yu52cacc62017-12-08 18:11:45 -08002811 enum State {
2812 ENTERED = 1;
2813 EXPANDED_TO_FULL_SCREEN = 2;
2814 MINIMIZED = 3;
2815 DISMISSED = 4;
2816 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002817 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002818}
2819
2820/**
Chenjie Yue8904192017-12-08 19:12:57 -08002821 * Logs overlay action
2822 * Logged from:
2823 * services/core/java/com/android/server/wm/Session.java
2824 */
2825message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002826 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002827
2828 optional string package_name = 2;
2829
2830 optional bool using_alert_window = 3;
2831
2832 enum State {
2833 ENTERED = 1;
2834 EXITED = 2;
2835 }
2836 optional State state = 4;
2837}
2838
Chenjie Yuccfe6452018-01-30 11:33:21 -08002839/*
2840 * Logs foreground service starts and stops.
2841 * Note that this is not when a service starts or stops, but when it is
2842 * considered foreground.
2843 * Logged from
2844 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2845 */
2846message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002847 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002848 // package_name + "/" + class_name
2849 optional string short_name = 2;
2850
2851 enum State {
2852 ENTER = 1;
2853 EXIT = 2;
2854 }
2855 optional State state = 3;
2856}
2857
Chenjie Yue8904192017-12-08 19:12:57 -08002858/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002859 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2860 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2861 * attributed back to the parent (host) uid. One example is Chrome.
2862 *
2863 * Logged from:
2864 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2865 */
2866message IsolatedUidChanged {
2867 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002868 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002869 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002870 optional int32 parent_uid = 1;
2871
2872 optional int32 isolated_uid = 2;
2873
2874 // We expect an isolated uid to be removed before if it's used for another parent uid.
2875 enum Event {
2876 REMOVED = 0;
2877 CREATED = 1;
2878 }
2879 optional Event event = 3;
2880}
2881
2882/*
2883 * Logs the reception of an incoming network packet causing the main system to wake up for
2884 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2885 * and processed by WakeupController.cpp.
2886 */
2887message PacketWakeupOccurred {
2888 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2889 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002890 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002891 // The interface name on which the packet was received.
2892 optional string iface = 2;
2893 // The ethertype value of the packet.
2894 optional int32 ethertype = 3;
2895 // String representation of the destination MAC address of the packet.
2896 optional string destination_hardware_address = 4;
2897 // String representation of the source address of the packet if this was an IP packet.
2898 optional string source_ip = 5;
2899 // String representation of the destination address of the packet if this was an IP packet.
2900 optional string destination_ip = 6;
2901 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2902 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2903 // families.
2904 optional int32 ip_next_header = 7;
2905 // The source port if this was a TCP or UDP packet.
2906 optional int32 source_port = 8;
2907 // The destination port if this was a TCP or UDP packet.
2908 optional int32 destination_port = 9;
2909}
2910
2911/*
2912 * Logs the memory stats for an app on startup.
2913 * Logged from:
2914 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2915 */
2916message AppStartMemoryStateCaptured {
2917 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002918 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002919
2920 // The process name.
2921 optional string process_name = 2;
2922
2923 // The activity name.
2924 optional string activity_name = 3;
2925
2926 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002927 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002928
2929 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002930 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002931
2932 // RSS
2933 optional int64 rss_in_bytes = 6;
2934
2935 // CACHE
2936 optional int64 cache_in_bytes = 7;
2937
2938 // SWAP
2939 optional int64 swap_in_bytes = 8;
2940}
2941
2942/*
2943 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2944 * for LMK event.
2945 * Logged from:
2946 * system/core/lmkd/lmkd.c
2947 */
2948message LmkStateChanged {
2949 enum State {
2950 UNKNOWN = 0;
2951 START = 1;
2952 STOP = 2;
2953 }
2954 optional State state = 1;
2955}
2956
2957/*
2958 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2959 * Logged from:
2960 * system/core/lmkd/lmkd.c
2961 */
2962message LmkKillOccurred {
2963 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002964 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002965
2966 // The process name.
2967 optional string process_name = 2;
2968
2969 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002970 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002971
2972 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002973 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002974
2975 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002976 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002977
2978 // RSS
2979 optional int64 rss_in_bytes = 6;
2980
2981 // CACHE
2982 optional int64 cache_in_bytes = 7;
2983
2984 // SWAP
2985 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00002986
2987 // The elapsed real time of start of the process.
2988 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002989}
2990
Rajeev Kumar51b54602018-03-01 12:18:26 -08002991/*
2992 * Logs when the ActivityManagerService detects that an app died.
2993 *
2994 * Logged from:
2995 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2996 */
2997message AppDied {
2998 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07002999 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003000}
3001
Howard Ro21a039c2018-08-06 14:55:47 -07003002/**
3003 * An atom for generic metrics logging. Available from Android Q.
3004 */
3005message GenericAtom {
3006 // The uid of the application that sent this custom atom.
3007 optional int32 uid = 1 [(is_uid) = true];
3008
3009 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003010 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003011}
3012
Tej Singhd6d6d772018-09-05 17:41:25 -07003013/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003014 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003015 *
3016 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003017 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003018 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003019message BiometricAcquired {
3020 // Biometric modality that was acquired.
3021 optional android.hardware.biometrics.ModalityEnum modality = 1;
3022 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3023 optional int32 user = 2;
3024 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3025 optional bool is_crypto = 3;
3026 // Action that the device is performing. Acquired messages are only expected for enroll and
3027 // authenticate. Other actions may indicate an error.
3028 optional android.hardware.biometrics.ActionEnum action = 4;
3029 // The client that this acquisition was received for.
3030 optional android.hardware.biometrics.ClientEnum client = 5;
3031 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3032 optional int32 acquire_info = 6;
3033 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3034 optional int32 acquire_info_vendor = 7;
Tej Singhd6d6d772018-09-05 17:41:25 -07003035}
3036
3037/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003038 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003039 *
3040 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003041 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003042 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003043message BiometricAuthenticated {
3044 // Biometric modality that was used.
3045 optional android.hardware.biometrics.ModalityEnum modality = 1;
3046 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3047 optional int32 user = 2;
3048 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3049 // storage.
3050 optional bool is_crypto = 3;
3051 // The client that this acquisition was received for.
3052 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003053 // If authentication requires user confirmation. See BiometricPrompt's
3054 // setRequireConfirmation(bool) method.
3055 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003056
Kevin Chyn1741a072019-01-17 11:54:40 -08003057 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003058 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003059 REJECTED = 1;
3060 PENDING_CONFIRMATION = 2;
3061 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003062 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003063
3064 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003065 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003066 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3067 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3068 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3069 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003070 optional int64 latency_millis = 7;
Kevin Chyn1741a072019-01-17 11:54:40 -08003071}
3072
3073/**
3074 * Logs when a biometric error occurs.
3075 *
3076 * Logged from:
3077 * frameworks/base/services/core/java/com/android/server/biometrics
3078 */
3079message BiometricErrorOccurred {
3080 // Biometric modality that was used.
3081 optional android.hardware.biometrics.ModalityEnum modality = 1;
3082 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3083 optional int32 user = 2;
3084 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3085 optional bool is_crypto = 3;
3086 // Action that the device is performing.
3087 optional android.hardware.biometrics.ActionEnum action = 4;
3088 // The client that this acquisition was received for.
3089 optional android.hardware.biometrics.ClientEnum client = 5;
3090 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3091 // are unique to modality.
3092 optional int32 error_info = 6;
3093 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3094 // by the vendor and not specified by the HIDL interface.
3095 optional int32 error_info_vendor = 7;
3096}
3097
3098/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003099 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003100 * Logged from:
3101 * frameworks/base/services/core/java/com/android/server/biometrics
3102 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003103message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003104 // Biometric modality.
3105 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003106 // Type of issue detected.
3107 optional android.hardware.biometrics.IssueEnum issue = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07003108}
Howard Ro688ae182018-09-25 00:09:36 -07003109
3110message Notification {
3111
3112 // Type of notification event.
3113 enum Type {
3114 TYPE_UNKNOWN = 0;
3115 // Notification became visible to the user.
3116 TYPE_OPEN = 1;
3117 // Notification became hidden.
3118 TYPE_CLOSE = 2;
3119 // Notification switched to detail mode.
3120 TYPE_DETAIL = 3;
3121 // Notification was clicked.
3122 TYPE_ACTION = 4;
3123 // Notification was dismissed.
3124 TYPE_DISMISS = 5;
3125 // Notification switched to summary mode. The enum value of 14 is to
3126 // match that of metrics_constants.
3127 TYPE_COLLAPSE = 14;
3128 }
3129 optional Type type = 1;
3130
3131 // Package name associated with the notification.
3132 optional string package_name = 2;
3133
3134 // Tag associated with notification.
3135 optional string tag = 3;
3136
3137 // Application-supplied ID associated with the notification.
3138 optional int32 id = 4;
3139
3140 // Index of notification in the notification panel.
3141 optional int32 shade_index = 5;
3142
3143 // The number of notifications in the notification panel.
3144 optional int32 shade_count = 6;
3145
3146 // Importance for the notification.
3147 optional int32 importance = 7;
3148
3149 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07003150 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07003151
3152 // Importance for the notification channel.
3153 optional int32 channel_importance = 9;
3154
Howard Ro183c2bd2018-10-18 13:52:10 -07003155 // Application-supplied ID associated with the notifications group.
3156 optional string group_id = 10;
3157
Howard Ro688ae182018-09-25 00:09:36 -07003158 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07003159 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07003160
Howard Ro183c2bd2018-10-18 13:52:10 -07003161 // Reason for dismissal of a notification. This field is only meaningful for
3162 // TYPE_DISMISS events.
3163 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07003164
Howard Ro183c2bd2018-10-18 13:52:10 -07003165 // The first post time of notification, stable across updates.
3166 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07003167
Howard Ro183c2bd2018-10-18 13:52:10 -07003168 // The most recent interruption time, or the creation time if no updates.
3169 // Differs from update_millis because updates are filtered based on whether
3170 // they actually interrupted the user.
3171 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07003172
Howard Ro183c2bd2018-10-18 13:52:10 -07003173 // The most recent update time, or the creation time if no updates.
3174 optional int64 update_millis = 15;
3175
3176 // The most recent visibility event.
3177 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07003178}
3179
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003180/*
Tej Singh0d176952019-01-16 19:10:54 -08003181 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003182 */
Tej Singh0d176952019-01-16 19:10:54 -08003183message FlagFlipUpdateOccurred {
3184 // If the event is from a flag config package, specify the package name.
3185 optional string flag_flip_package_name = 1;
3186
3187 // The order id of the package
3188 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003189}
3190
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003191/**
3192 * Potential experiment ids that goes with a train install.
3193 */
3194message TrainExperimentIds {
3195 repeated int64 experiment_id = 1;
3196}
3197
Yangster-macb89807e2018-11-15 21:10:57 -08003198/*
3199 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003200 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003201 */
3202message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003203 // Name of the train.
3204 optional string train_name = 1;
3205 // Version code for a "train" of packages that need to be installed atomically
3206 optional int64 train_version_code = 2;
3207 // After installation of this package, device requires a restart.
3208 optional bool requires_staging = 3;
3209 // Rollback should be enabled for this install.
3210 optional bool rollback_enabled = 4;
3211 // Requires low latency monitoring if possible.
3212 optional bool requires_low_latency_monitor = 5;
3213
Yangster-macb89807e2018-11-15 21:10:57 -08003214 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003215 UNKNOWN = 0;
3216 INSTALL_REQUESTED = 1;
3217 INSTALL_STARTED = 2;
3218 INSTALL_STAGED_NOT_READY = 3;
3219 INSTALL_STAGED_READY = 4;
3220 INSTALL_SUCCESS = 5;
3221 INSTALL_FAILURE = 6;
3222 INSTALL_CANCELLED = 7;
3223 INSTALLER_ROLLBACK_REQUESTED = 8;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003224 INSTALLER_ROLLBACK_SUCCESS = 9;
3225 INSTALLER_ROLLBACK_FAILURE = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08003226 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003227 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003228 // Possible experiment ids for monitoring this push.
3229 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3230 // user id
3231 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003232}
3233
Maggie Whitefc1aa592018-11-28 21:55:23 -08003234/** Represents USB port overheat event. */
3235message UsbPortOverheatEvent {
3236 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3237 optional int32 plug_temperature_deci_c = 1;
3238
3239 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3240 optional int32 max_temperature_deci_c = 2;
3241
3242 /* Time between USB plug event and overheat threshold trip, in seconds. */
3243 optional int32 time_to_overheat_secs = 3;
3244
3245 /* Time between overheat threshold trip and hysteresis, in seconds. */
3246 optional int32 time_to_hysteresis_secs = 4;
3247
3248 /* Time between hysteresis and active mitigation ending, in seconds. */
3249 optional int32 time_to_inactive_secs = 5;
3250};
3251
Maggie White8735b852019-01-18 11:40:49 -08003252/**
3253 * Logs total effective full charge and discharge cycles on a battery.
3254 * Here are some examples of one effective cycle:
3255 * 1) the battery charges from 0% to 100% and drains back to 0%,
3256 * 2) charging from 50% to 100% and draining back to 50% twice.
3257 * Pulled from:
3258 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3259 */
3260message BatteryCycleCount {
3261 /* Number of total charge and discharge cycles on the system battery. */
3262 optional int32 cycle_count = 1;
3263}
3264
Yangster-macb89807e2018-11-15 21:10:57 -08003265/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003266 * Logs when a connection becomes available and lost.
3267 * Logged in StatsCompanionService.java
3268 */
3269message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003270 // Id of the network.
3271 optional int32 net_id = 1;
3272
3273 enum State {
3274 UNKNOWN = 0;
3275 CONNECTED = 1;
3276 DISCONNECTED = 2;
3277 }
3278 // Connected state of a network.
3279 optional State state = 2;
3280}
3281
3282/**
3283 * Logs when a service starts and stops.
3284 * Logged from:
3285 * services/core/java/com/android/server/am/ActiveServices.java
3286 */
3287message ServiceStateChanged {
3288
3289 optional int32 uid = 1 [(is_uid) = true];
3290
3291 optional string package_name = 2;
3292
3293 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003294
3295 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003296 START = 1;
3297 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003298 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003299
3300 optional State state = 4;
3301}
3302
3303/**
3304 * Logs when a service is launched.
3305 * Logged from:
3306 * services/core/java/com/android/server/am/ActiveServices.java
3307 */
3308message ServiceLaunchReported {
3309
3310 optional int32 uid = 1 [(is_uid) = true];
3311
3312 optional string package_name = 2;
3313
3314 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003315}
Howard Ro688ae182018-09-25 00:09:36 -07003316
Chenjie Yubbcbc602018-02-05 16:51:52 -08003317//////////////////////////////////////////////////////////////////////
3318// Pulled atoms below this line //
3319//////////////////////////////////////////////////////////////////////
3320
3321/**
David Chenc8a43242017-10-17 16:23:28 -07003322 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3323 *
3324 * Pulled from:
3325 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3326 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003327message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003328 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003329
3330 optional int64 rx_bytes = 2;
3331
3332 optional int64 rx_packets = 3;
3333
3334 optional int64 tx_bytes = 4;
3335
3336 optional int64 tx_packets = 5;
3337}
3338
3339/**
3340 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3341 *
3342 * Pulled from:
3343 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3344 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003345message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003346 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003347
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003348 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3349 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003350
3351 optional int64 rx_bytes = 3;
3352
3353 optional int64 rx_packets = 4;
3354
3355 optional int64 tx_bytes = 5;
3356
3357 optional int64 tx_packets = 6;
3358}
3359
3360/**
3361 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3362 *
3363 * Pulled from:
3364 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3365 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003366message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003367 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003368
3369 optional int64 rx_bytes = 2;
3370
3371 optional int64 rx_packets = 3;
3372
3373 optional int64 tx_bytes = 4;
3374
3375 optional int64 tx_packets = 5;
3376}
3377
3378/**
3379 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3380 *
3381 * Pulled from:
3382 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3383 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003384message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003385 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003386
Yao Chenc40a19d2018-03-15 16:48:25 -07003387 // 1 denotes foreground and 0 denotes background. This is called Set in
3388 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003389 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003390
3391 optional int64 rx_bytes = 3;
3392
3393 optional int64 rx_packets = 4;
3394
3395 optional int64 tx_bytes = 5;
3396
3397 optional int64 tx_packets = 6;
3398}
3399
3400/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003401 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3402 *
3403 * Pulled from:
3404 * StatsCompanionService
3405 */
3406message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003407 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003408
3409 optional int64 rx_bytes = 2;
3410
3411 optional int64 tx_bytes = 3;
3412}
3413
3414/**
David Chenc8a43242017-10-17 16:23:28 -07003415 * Pulls the kernel wakelock durations. This atom is adapted from
3416 * android/internal/os/KernelWakelockStats.java
3417 *
3418 * Pulled from:
3419 * StatsCompanionService using KernelWakelockReader.
3420 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003421message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003422 optional string name = 1;
3423
3424 optional int32 count = 2;
3425
3426 optional int32 version = 3;
3427
Yangster-maca8a30442018-10-13 23:46:34 -07003428 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003429}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003430
Chenjie Yu05013b32017-11-21 10:21:41 -08003431/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003432 * Pulls low power state information. If power.stats HAL is not available, this
3433 * includes platform and subsystem sleep state information,
3434 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3435 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003436 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003437 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003438 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3439 * as defined in:
3440 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003441 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003442message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003443 // Subsystem name
3444 optional string subsystem_name = 1;
3445 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3446 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003447 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3448 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003449 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003450 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003451 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003452 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003453 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003454}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003455
Chenjie Yu05013b32017-11-21 10:21:41 -08003456/**
Bookatz92da2832018-11-01 18:10:03 -07003457 * Pulls on-device power measurement information.
3458 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3459 * Pulled from:
3460 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3461 */
3462message OnDevicePowerMeasurement {
3463 // Name of the subsystem (to which the rail belongs).
3464 optional string subsystem_name = 1;
3465
3466 // Rail name. The rail lies within the subsystem.
3467 optional string rail_name = 2;
3468
3469 // Time (in ms since boot) at which the rail energy value was measured.
3470 // This may differ slightly from the time that statsd logs this information.
3471 optional uint64 measurement_timestamp_millis = 3;
3472
3473 // Accumulated energy used via the rail since device boot in uWs.
3474 optional uint64 energy_microwatt_secs = 4;
3475}
3476
3477/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003478 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003479 * Pulls the time the cpu spend on the frequency index. Frequency index
3480 * starts from highest to lowest. The value should be monotonically
3481 * increasing since boot. However, if there is a cpu
3482 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003483 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003484message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003485 optional uint32 cluster = 1;
3486 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003487 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003488}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003489
Chenjie Yu05013b32017-11-21 10:21:41 -08003490/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003491 * Pulls Cpu Time Per Uid.
3492 * Note that isolated process uid time should be attributed to host uids.
3493 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003494message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003495 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003496 optional uint64 user_time_micros = 2;
3497 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003498}
3499
3500/**
3501 * Pulls Cpu Time Per Uid per frequency.
3502 * Note that isolated process uid time should be attributed to host uids.
3503 * For each uid, we order the time by descending frequencies.
3504 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003505message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003506 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003507 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003508 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003509}
Hugo Benichi884970e2017-11-14 22:42:46 +09003510
Chenjie Yu05013b32017-11-21 10:21:41 -08003511/**
3512 * Pulls Wifi Controller Activity Energy Info
3513 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003514message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003515 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003516 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003517 // stack reported state
3518 // TODO: replace this with proto enum
3519 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003520 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003521 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003522 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003523 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003524 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003525 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003526 // product of current(mA), voltage(V) and time(ms)
3527 optional uint64 controller_energy_used = 6;
3528}
3529
3530/**
3531 * Pulls Modem Activity Energy Info
3532 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003533message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003534 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003535 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003536 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003537 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003538 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003539 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003540 /**
3541 * Tx power index
3542 * index 0 = tx_power < 0dBm
3543 * index 1 = 0dBm < tx_power < 5dBm
3544 * index 2 = 5dBm < tx_power < 15dBm
3545 * index 3 = 15dBm < tx_power < 20dBm
3546 * index 4 = tx_power > 20dBm
3547 */
3548 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003549 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003550 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003551 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003552 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003553 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003554 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003555 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003556 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003557 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003558 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003559 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003560 // product of current(mA), voltage(V) and time(ms)
3561 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003562}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003563
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003564/**
3565 * Pulls Bluetooth Activity Energy Info
3566 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3567 */
3568message BluetoothActivityInfo {
3569 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003570 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003571 // bluetooth stack state
3572 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003573 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003574 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003575 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003576 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003577 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003578 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003579 // product of current(mA), voltage(V) and time(ms)
3580 optional uint64 energy_used = 6;
3581}
3582
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003583/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003584 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003585 *
3586 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003587 */
3588message ProcessMemoryState {
3589 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003590 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003591
3592 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003593 // Usually package name, "system" for system server.
3594 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003595 optional string process_name = 2;
3596
Rafal Slawikda51b932018-12-13 16:31:33 +00003597 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003598 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003599
3600 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003601 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003602
3603 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003604 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003605
Rajeev Kumar90235992018-01-29 11:06:48 -08003606 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003607 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3608 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003609 optional int64 rss_in_bytes = 6;
3610
3611 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003612 // Value is read from memory.stat, field total_cache if per-app memory
3613 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003614 optional int64 cache_in_bytes = 7;
3615
3616 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003617 // Value is read from memory.stat, field total_swap if per-app memory
3618 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003619 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003620
Rafal Slawikd03ae422018-11-20 11:27:45 +00003621 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003622 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003623
3624 // Elapsed real time when the process started.
3625 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3626 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003627}
3628
3629/*
Rafal Slawik08621582018-10-15 14:53:07 +01003630 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003631 *
3632 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003633 */
3634message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003635 // The uid if available. -1 means not available.
3636 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003637
Rafal Slawikbf67d072018-10-23 11:07:54 +01003638 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003639 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003640 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003641
Rafal Slawikbf67d072018-10-23 11:07:54 +01003642 // # of page-faults
3643 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003644
Rafal Slawikbf67d072018-10-23 11:07:54 +01003645 // # of major page-faults
3646 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003647
Rafal Slawikbf67d072018-10-23 11:07:54 +01003648 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003649 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003650 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003651
Rafal Slawikd03ae422018-11-20 11:27:45 +00003652 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003653 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003654
3655 // Elapsed real time when the process started.
3656 // Value is read from /proc/PID/stat, field 22.
3657 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01003658}
3659
3660/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003661 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003662 *
3663 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3664 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003665 *
3666 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003667 */
3668message ProcessMemoryHighWaterMark {
3669 // The uid if available. -1 means not available.
3670 optional int32 uid = 1 [(is_uid) = true];
3671
Rafal Slawikda51b932018-12-13 16:31:33 +00003672 // The process name.
3673 // Usually package name or process cmdline.
3674 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003675 optional string process_name = 2;
3676
3677 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3678 // /proc/PID/status.
3679 optional int64 rss_high_water_mark_in_bytes = 3;
3680}
3681
3682/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003683 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003684 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003685message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003686 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003687}
3688
3689/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003690 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003691 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003692message SystemUptime {
3693 // Milliseconds since the system was booted.
3694 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3695 // for external input).
3696 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003697 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003698}
3699
3700/*
3701 * Reads from /proc/uid_concurrent_active_time which has the format:
3702 * active: X (X is # cores)
3703 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3704 * [uid1]: [time-0] [time-1] [time-2] ... ...
3705 * ...
3706 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3707 * The file contains a monotonically increasing count of time for a single boot.
3708 */
3709message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003710 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003711 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003712}
3713
3714/**
3715 * Reads from /proc/uid_concurrent_policy_time which has the format:
3716 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3717 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3718 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3719 * ...
3720 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3721 * The file contains a monotonically increasing count of time for a single boot.
3722 */
3723message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003724 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003725 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003726 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003727}
3728
3729/*
3730 * Pulls free disk space, for data, system partition and temporary directory.
3731 */
3732message DiskSpace {
3733 // available bytes in data partition
3734 optional uint64 data_available_bytes = 1;
3735 // available bytes in system partition
3736 optional uint64 system_available_bytes = 2;
3737 // available bytes in download cache or temp directories
3738 optional uint64 temp_available_bytes = 3;
3739}
Tej Singhbf972d92018-01-10 20:51:13 -08003740
3741/**
3742 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003743 *
3744 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003745 */
3746message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003747 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003748}
3749
3750/**
3751 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003752 * Pulled from:
3753 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003754 */
3755message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003756 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003757}
3758
3759/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003760 * Pulls battery voltage.
3761 * Pulled from:
3762 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3763 */
3764message BatteryVoltage {
3765 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003766 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003767}
3768
3769/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003770 * Pulls battery level (percent full, from 0 to 100).
3771 *
3772 * Pulled from:
3773 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3774 */
3775message BatteryLevel {
3776 // Battery level. Should be in [0, 100].
3777 optional int32 battery_level = 1;
3778}
3779
3780/**
Tej Singhd89137e2018-03-26 14:51:40 -07003781 * Pulls the temperature of various parts of the device.
3782 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003783 *
3784 * Pulled from:
3785 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3786 */
3787message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003788 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003789 optional android.os.TemperatureTypeEnum sensor_location = 1;
3790
3791 // The name of the temperature source. Eg. CPU0
3792 optional string sensor_name = 2;
3793
Tej Singhd89137e2018-03-26 14:51:40 -07003794 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003795 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003796 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003797}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003798
3799/**
3800 * Pulls the statistics of calls to Binder.
3801 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003802 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3803 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003804 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003805 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003806 */
3807message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003808 // UID of the process responsible for the binder transaction. It will be set if the process
3809 // executing the binder transaction attribute the transaction to another uid using
3810 // Binder.setThreadWorkSource().
3811 //
3812 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003813 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003814 // UID of the process executing the binder transaction.
3815 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003816 // Fully qualified class name of the API call.
3817 //
3818 // This is a system server class name.
3819 //
3820 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3821 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3822 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3823 // commonly used APIs.
3824 optional string service_class_name = 2;
3825 // Method name of the API call. It can also be a transaction code if we cannot
3826 // resolve it to a name. See Binder#getTransactionName.
3827 //
3828 // This is a system server method name.
3829 optional string service_method_name = 3;
3830 // Total number of API calls.
3831 optional int64 call_count = 4;
3832 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3833 optional bool screen_interactive = 13;
3834 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3835 // call_count will be equal to recorded_call_count.
3836 //
3837 // If recorded_call_count is different than call_count, it means data collection has been
3838 // sampled. All the fields below will be sampled in this case.
3839 optional int64 recorded_call_count = 12;
3840 // Number of exceptions thrown by the API.
3841 optional int64 recorded_exception_count = 5;
3842 // Total latency of all API calls.
3843 // Average can be computed using total_latency_micros / recorded_call_count.
3844 optional int64 recorded_total_latency_micros = 6;
3845 // Maximum latency of one API call.
3846 optional int64 recorded_max_latency_micros = 7;
3847 // Total CPU usage of all API calls.
3848 // Average can be computed using total_cpu_micros / recorded_call_count.
3849 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3850 optional int64 recorded_total_cpu_micros = 8;
3851 // Maximum CPU usage of one API call.
3852 optional int64 recorded_max_cpu_micros = 9;
3853 // Maximum parcel reply size of one API call.
3854 optional int64 recorded_max_reply_size_bytes = 10;
3855 // Maximum parcel request size of one API call.
3856 optional int64 recorded_max_request_size_bytes = 11;
3857}
3858
3859/**
3860 * Pulls the statistics of exceptions during calls to Binder.
3861 *
3862 * Binder stats are cumulative from boot unless somebody reset the data using
3863 * > adb shell dumpsys binder_calls_stats --reset
3864 */
3865message BinderCallsExceptions {
3866 // Exception class name, e.g. java.lang.IllegalArgumentException.
3867 //
3868 // This is an exception class name thrown by the system server.
3869 optional string exception_class_name = 1;
3870 // Total number of exceptions.
3871 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003872}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003873
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003874/**
3875 * Pulls the statistics of message dispatching on HandlerThreads.
3876 *
3877 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
3878 * config on the device.
3879 *
3880 * Next tag: 11
3881 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003882message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01003883 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003884 optional int32 uid = 1 [(is_uid) = true];
3885
3886 // Fully qualified class name of the handler target class.
3887 //
3888 // This field does not contain PII. This is a system server class name.
3889 optional string handler_class_name = 2;
3890
3891 // The name of the thread that runs the Looper.
3892 //
3893 // This field does not contain PII. This is a system server thread name.
3894 optional string looper_thread_name = 3;
3895
3896 // The name of the dispatched message.
3897 //
3898 // This field does not contain PII. This is a system server constant or class
3899 // name.
3900 optional string message_name = 4;
3901
3902 // Total number of successfully dispatched messages.
3903 optional int64 message_count = 5;
3904
3905 // Total number of messages that failed dispatching.
3906 optional int64 exception_count = 6;
3907
3908 // Total number of processed messages we have data recorded for. If we
3909 // collected data for all the messages, message_count will be equal to
3910 // recorded_message_count.
3911 //
3912 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003913 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003914 optional int64 recorded_message_count = 7;
3915
3916 // Total latency of all processed messages.
3917 // Average can be computed using recorded_total_latency_micros /
3918 // recorded_message_count.
3919 optional int64 recorded_total_latency_micros = 8;
3920
3921 // Total CPU usage of all processed message.
3922 // Average can be computed using recorded_total_cpu_micros /
3923 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003924 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003925 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003926
3927 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3928 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003929
3930 // Max recorded CPU usage of all processed messages.
3931 optional int64 recorded_max_cpu_micros = 11;
3932
3933 // Max recorded latency of all processed messages.
3934 optional int64 recorded_max_latency_micros = 12;
3935
3936 // Total number of messages we tracked the dispatching delay for. If we
3937 // collected data for all the messages, message_count will be equal to
3938 // recorded_delay_message_count.
3939 //
3940 // If recorded_delay_message_count is different than message_count, it means data
3941 // collection has been sampled or/and not all messages specified the target dispatch time.
3942 // The fields below will be sampled in this case.
3943 optional int64 recorded_delay_message_count = 13;
3944
3945 // Total dispatching delay of all processed messages.
3946 // Calculated as a difference between the target dispatching time (Message.when)
3947 // and the actual dispatching time.
3948 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
3949 optional int64 recorded_total_delay_millis = 14;
3950
3951 // Max dispatching delay of all processed messages.
3952 // Calculated as a difference between the target dispatching time (Message.when)
3953 // and the actual dispatching time.
3954 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003955}
Tej Singh86dc9db2018-09-06 00:39:57 +00003956
3957/**
3958 * Pulls disk information, such as write speed and latency.
3959 */
3960message DiskStats {
3961 // Time taken to open, write 512B to, and close a file.
3962 // -1 if error performing the check.
3963 optional int64 data_write_latency_millis = 1;
3964
3965 optional bool file_based_encryption = 2;
3966
3967 // Recent disk write speed in kB/s.
3968 // -1 if error querying storageed.
3969 // 0 if data is unavailable.
3970 optional int32 recent_disk_write_speed = 3;
3971}
3972
3973
3974/**
3975 * Free and total bytes of the Data, Cache, and System partition.
3976 */
3977message DirectoryUsage {
3978 enum Directory {
3979 UNKNOWN = 0;
3980 DATA = 1;
3981 CACHE = 2;
3982 SYSTEM = 3;
3983 }
3984 optional Directory directory = 1;
3985 optional int64 free_bytes = 2;
3986 optional int64 total_bytes = 3;
3987}
3988
3989
3990/**
3991 * Size of an application: apk size, data size, and cache size.
3992 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
3993 * Information is only reported for apps with the primary user (user 0).
3994 * Sizes are aggregated by package name.
3995 */
3996message AppSize {
3997 // Including uids will involve modifying diskstats logic.
3998 optional string package_name = 1;
3999 // App size in bytes. -1 if unavailable.
4000 optional int64 app_size_bytes = 2;
4001 // App data size in bytes. -1 if unavailable.
4002 optional int64 app_data_size_bytes = 3;
4003 // App cache size in bytes. -1 if unavailable.
4004 optional int64 app_cache_size_bytes = 4;
4005 // Time that the cache file was produced.
4006 // Uses System.currentTimeMillis(), which is wall clock time.
4007 optional int64 cache_time_millis = 5;
4008}
4009
4010
4011/**
4012 * Size of a particular category. Eg: photos, videos.
4013 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4014 */
4015message CategorySize {
4016 enum Category {
4017 UNKNOWN = 0;
4018 APP_SIZE = 1;
4019 APP_DATA_SIZE = 2;
4020 APP_CACHE_SIZE = 3;
4021 PHOTOS = 4;
4022 VIDEOS = 5;
4023 AUDIO = 6;
4024 DOWNLOADS = 7;
4025 SYSTEM = 8;
4026 OTHER = 9;
4027 }
4028 optional Category category = 1;
4029 // Category size in bytes.
4030 optional int64 size_bytes = 2;
4031 // Time that the cache file was produced.
4032 // Uses System.currentTimeMillis(), which is wall clock time.
4033 optional int64 cache_time_millis = 3;
4034}
Tej Singhd6d6d772018-09-05 17:41:25 -07004035
4036/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004037 * Pulls per uid I/O stats. The stats are cumulative since boot.
4038 *
4039 * Read/write bytes are I/O events from a storage device
4040 * Read/write chars are data requested by read/write syscalls, and can be
4041 * satisfied by caching.
4042 *
4043 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4044 */
4045message DiskIo {
4046 optional int32 uid = 1 [(is_uid) = true];
4047 optional int64 fg_chars_read = 2;
4048 optional int64 fg_chars_write = 3;
4049 optional int64 fg_bytes_read = 4;
4050 optional int64 fg_bytes_write = 5;
4051 optional int64 bg_chars_read = 6;
4052 optional int64 bg_chars_write = 7;
4053 optional int64 bg_bytes_read = 8;
4054 optional int64 bg_bytes_write = 9;
4055 optional int64 fg_fsync = 10;
4056 optional int64 bg_fsync= 11;
4057}
4058
4059
4060/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004061 * Pulls the number of fingerprints for each user.
4062 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004063 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004064 */
Kevin Chyn1741a072019-01-17 11:54:40 -08004065message NumBiometricsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004066 // The associated user. Eg: 0 for owners, 10+ for others.
4067 // Defined in android/os/UserHandle.java
4068 optional int32 user = 1;
4069 // Number of fingerprints registered to that user.
Kevin Chyn1741a072019-01-17 11:54:40 -08004070 optional int32 num_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004071}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004072
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004073/**
4074 * A mapping of role holder -> role
4075 */
4076message RoleHolder {
4077 // uid of the role holder
4078 optional int32 uid = 1 [(is_uid) = true];
4079
4080 // package name of the role holder
4081 optional string package_name = 2;
4082
4083 // the role held
4084 optional string role = 3;
4085}
4086
Yangsteraf9aee72018-10-12 09:26:16 -07004087message AggStats {
4088 optional int64 min = 1;
4089
4090 optional int64 average = 2;
4091
4092 optional int64 max = 3;
4093}
4094
4095message ProcessStatsStateProto {
4096 optional android.service.procstats.ScreenState screen_state = 1;
4097
4098 optional android.service.procstats.MemoryState memory_state = 2;
4099
4100 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4101 // and not frameworks/base/core/java/android/app/ActivityManager.java
4102 optional android.service.procstats.ProcessState process_state = 3;
4103
4104 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004105 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004106
4107 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004108 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004109
4110 // # of samples taken
4111 optional int32 sample_size = 5;
4112
4113 // PSS is memory reserved for this process
4114 optional AggStats pss = 6;
4115
4116 // USS is memory shared between processes, divided evenly for accounting
4117 optional AggStats uss = 7;
4118
4119 // RSS is memory resident for this process
4120 optional AggStats rss = 8;
4121}
4122
4123// Next Tag: 7
4124message ProcessStatsProto {
4125 // Name of process.
4126 optional string process = 1;
4127
4128 // Uid of the process.
4129 optional int32 uid = 2;
4130
4131 // Information about how often kills occurred
4132 message Kill {
4133 // Count of excessive CPU kills
4134 optional int32 cpu = 1;
4135
4136 // Count of kills when cached
4137 optional int32 cached = 2;
4138
4139 // PSS stats during cached kill
4140 optional AggStats cached_pss = 3;
4141 }
4142 optional Kill kill = 3;
4143
4144 // Time and memory spent in various states.
4145 repeated ProcessStatsStateProto states = 5;
4146
4147 // Total time process has been running... screen_state, memory_state, and process_state
4148 // will not be set.
4149 optional ProcessStatsStateProto total_running_state = 6;
4150}
4151
4152message PackageServiceOperationStatsProto {
4153 // Operate enum: Started, Foreground, Bound, Executing
4154 optional android.service.procstats.ServiceOperationState operation = 1;
4155
4156 // Number of times the service was in this operation.
4157 optional int32 count = 2;
4158
4159 // Information about a state the service can be in.
4160 message StateStats {
4161 // Screen state enum.
4162 optional android.service.procstats.ScreenState screen_state = 1;
4163 // Memory state enum.
4164 optional android.service.procstats.MemoryState memory_state = 2;
4165
4166 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004167 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004168 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004169 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004170 }
4171 repeated StateStats state_stats = 3;
4172}
4173
4174message PackageServiceStatsProto {
4175 // Name of service component.
4176 optional string service_name = 1;
4177
4178 // The operation stats.
4179 // The package_name, package_uid, package_version, service_name will not be set to save space.
4180 repeated PackageServiceOperationStatsProto operation_stats = 2;
4181}
4182
4183message PackageAssociationSourceProcessStatsProto {
4184 // Uid of the process.
4185 optional int32 process_uid = 1;
4186 // Process name.
4187 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004188 // Package name.
4189 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004190 // Total count of the times this association appeared.
4191 optional int32 total_count = 3;
4192
4193 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004194 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004195
4196 // Total count of the times this association became actively impacting its target process.
4197 optional int32 active_count = 5;
4198
4199 // Information on one source in this association.
4200 message StateStats {
4201 // Process state enum.
4202 optional android.service.procstats.ProcessState process_state = 1;
4203 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004204 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004205 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004206 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004207 }
4208 repeated StateStats active_state_stats = 6;
4209}
4210
4211message PackageAssociationProcessStatsProto {
4212 // Name of the target component.
4213 optional string component_name = 1;
4214 // Information on one source in this association.
4215 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4216}
4217
4218
4219message ProcessStatsPackageProto {
4220 // Name of package.
4221 optional string package = 1;
4222
4223 // Uid of the package.
4224 optional int32 uid = 2;
4225
4226 // Version of the package.
4227 optional int64 version = 3;
4228
4229 // Stats for each process running with the package loaded in to it.
4230 repeated ProcessStatsProto process_stats = 4;
4231
4232 // Stats for each of the package's services.
4233 repeated PackageServiceStatsProto service_stats = 5;
4234
4235 // Stats for each association with the package.
4236 repeated PackageAssociationProcessStatsProto association_stats = 6;
4237}
4238
4239message ProcessStatsSectionProto {
4240 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004241 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004242
4243 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004244 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004245
4246 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004247 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004248
4249 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004250 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004251
4252 // System runtime library. e.g. "libdvm.so", "libart.so".
4253 optional string runtime = 5;
4254
4255 // whether kernel reports swapped pss.
4256 optional bool has_swapped_pss = 6;
4257
4258 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4259 enum Status {
4260 STATUS_UNKNOWN = 0;
4261 STATUS_COMPLETE = 1;
4262 STATUS_PARTIAL = 2;
4263 STATUS_SHUTDOWN = 3;
4264 STATUS_SYSPROPS = 4;
4265 }
4266 repeated Status status = 7;
4267
Chenjie Yub2ecc792019-01-17 10:27:26 -08004268 // Number of pages available of various types and sizes, representation fragmentation.
4269 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4270
Yangsteraf9aee72018-10-12 09:26:16 -07004271 // Stats for each process.
4272 repeated ProcessStatsProto process_stats = 8;
4273
4274 // Stats for each package.
4275 repeated ProcessStatsPackageProto package_stats = 9;
4276}
4277
Chenjie Yub2ecc792019-01-17 10:27:26 -08004278message ProcessStatsAvailablePagesProto {
4279 // Node these pages are in (as per /proc/pagetypeinfo)
4280 optional int32 node = 1;
4281
4282 // Zone these pages are in (as per /proc/pagetypeinfo)
4283 optional string zone = 2;
4284
4285 // Label for the type of these pages (as per /proc/pagetypeinfo)
4286 optional string label = 3;
4287
4288 // Distribution of number of pages available by order size. First entry in array is
4289 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4290 repeated int32 pages_per_order = 4;
4291}
4292
Chenjie Yu12e5e672018-09-14 15:54:59 -07004293/**
4294 * Pulled from ProcessStatsService.java
4295 */
4296message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004297 optional ProcessStatsSectionProto proc_stats_section = 1;
4298}
4299
Chenjie Yuf910b7802019-01-11 16:08:20 -08004300/**
4301 * Pulled from ProcessStatsService.java
4302 */
4303message ProcStatsPkgProc {
4304 optional ProcessStatsSectionProto proc_stats_section = 1;
4305}
4306
Yangsteraf9aee72018-10-12 09:26:16 -07004307message PowerProfileProto {
4308 optional double cpu_suspend = 1;
4309
4310 optional double cpu_idle = 2;
4311
4312 optional double cpu_active = 3;
4313
4314 message CpuCluster {
4315 optional int32 id = 1;
4316 optional double cluster_power = 2;
4317 optional int32 cores = 3;
4318 repeated int64 speed = 4;
4319 repeated double core_power = 5;
4320 }
4321
4322 repeated CpuCluster cpu_cluster = 40;
4323
4324 optional double wifi_scan = 4;
4325
4326 optional double wifi_on = 5;
4327
4328 optional double wifi_active = 6;
4329
4330 optional double wifi_controller_idle = 7;
4331
4332 optional double wifi_controller_rx = 8;
4333
4334 optional double wifi_controller_tx = 9;
4335
4336 repeated double wifi_controller_tx_levels = 10;
4337
4338 optional double wifi_controller_operating_voltage = 11;
4339
4340 optional double bluetooth_controller_idle = 12;
4341
4342 optional double bluetooth_controller_rx = 13;
4343
4344 optional double bluetooth_controller_tx = 14;
4345
4346 optional double bluetooth_controller_operating_voltage = 15;
4347
4348 optional double modem_controller_sleep = 16;
4349
4350 optional double modem_controller_idle = 17;
4351
4352 optional double modem_controller_rx = 18;
4353
4354 repeated double modem_controller_tx = 19;
4355
4356 optional double modem_controller_operating_voltage = 20;
4357
4358 optional double gps_on = 21;
4359
4360 repeated double gps_signal_quality_based = 22;
4361
4362 optional double gps_operating_voltage = 23;
4363
4364 optional double bluetooth_on = 24;
4365
4366 optional double bluetooth_active = 25;
4367
4368 optional double bluetooth_at_cmd = 26;
4369
4370 optional double ambient_display = 27;
4371
4372 optional double screen_on = 28;
4373
4374 optional double radio_on = 29;
4375
4376 optional double radio_scanning = 30;
4377
4378 optional double radio_active = 31;
4379
4380 optional double screen_full = 32;
4381
4382 optional double audio = 33;
4383
4384 optional double video = 34;
4385
4386 optional double flashlight = 35;
4387
4388 optional double memory = 36;
4389
4390 optional double camera = 37;
4391
4392 optional double wifi_batched_scan = 38;
4393
4394 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004395}
Chenjie Yuab530202018-09-26 12:39:20 -07004396
4397/**
4398 * power_profile.xml and other constants for power model calculations.
4399 * Pulled from PowerProfile.java
4400 */
4401message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004402 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004403}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004404
4405/**
arangelovd5db50e2018-10-12 20:24:39 +01004406 * Logs when a user restriction was added or removed.
4407 *
4408 * Logged from:
4409 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4410 */
4411message UserRestrictionChanged {
4412 // The raw string of the user restriction as defined in UserManager.
4413 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4414 optional string restriction = 1;
4415 // Whether the restriction is enabled or disabled.
4416 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004417}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004418
4419/**
4420 * Pulls process user time and system time. Puller takes a snapshot of all pids
4421 * in the system and returns cpu stats for those that are working at the time.
4422 * Dead pids will be dropped. Kernel processes are excluded.
4423 * Min cool-down is 5 sec.
4424 */
4425message ProcessCpuTime {
4426 optional int32 uid = 1 [(is_uid) = true];
4427
4428 optional string process_name = 2;
4429 // Process cpu time in user space, cumulative from boot/process start
4430 optional int64 user_time_millis = 3;
4431 // Process cpu time in system space, cumulative from boot/process start
4432 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004433}
Misha Wagner5a51e002018-10-03 15:04:09 +01004434
4435/**
4436 * Pulls the CPU usage for each thread.
4437 *
4438 * Read from /proc/$PID/task/$TID/time_in_state files.
4439 *
4440 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4441 * time_in_state files not being present on some phones, have not been addressed. These should be
4442 * considered before a public release.
4443 */
4444message CpuTimePerThreadFreq {
4445 // UID that owns the process.
4446 optional int32 uid = 1 [(is_uid) = true];
4447 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004448 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004449 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004450 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004451 // Name of the process taken from `/proc/$PID/cmdline`.
4452 optional string process_name = 4;
4453 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4454 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004455
4456 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4457 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4458 // frequencies are given here as the alternative is sending eight separate atoms. This method
4459 // significantly reduces the amount of data created
4460 optional int32 frequency1_khz = 6;
4461 optional int32 time1_millis = 7;
4462 optional int32 frequency2_khz = 8;
4463 optional int32 time2_millis = 9;
4464 optional int32 frequency3_khz = 10;
4465 optional int32 time3_millis = 11;
4466 optional int32 frequency4_khz = 12;
4467 optional int32 time4_millis = 13;
4468 optional int32 frequency5_khz = 14;
4469 optional int32 time5_millis = 15;
4470 optional int32 frequency6_khz = 16;
4471 optional int32 time6_millis = 17;
4472 optional int32 frequency7_khz = 18;
4473 optional int32 time7_millis = 19;
4474 optional int32 frequency8_khz = 20;
4475 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004476}
Bookatz75ee6042018-11-09 12:27:37 -08004477
4478/**
Bookatz366a4432018-11-20 09:42:33 -08004479 * Pulls information about the device's build.
4480 */
4481message BuildInformation {
4482 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4483 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4484 optional string fingerprint = 1;
4485
4486 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4487 optional string brand = 2;
4488
4489 // Build.PRODUCT. The name of the overall product.
4490 optional string product = 3;
4491
4492 // Build.DEVICE. The name of the industrial design.
4493 optional string device = 4;
4494
4495 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4496 optional string version_release = 5;
4497
4498 // Build.ID. E.g. a label like "M4-rc20".
4499 optional string id = 6;
4500
4501 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4502 // represent this build.
4503 optional string version_incremental = 7;
4504
4505 // Build.TYPE. The type of build, like "user" or "eng".
4506 optional string type = 8;
4507
4508 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4509 optional string tags = 9;
4510}
4511
4512/**
Bookatz75ee6042018-11-09 12:27:37 -08004513 * Pulls on-device BatteryStats power use calculations for the overall device.
4514 */
4515message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004516 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4517 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4518 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4519 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08004520}
4521
4522/**
4523 * Pulls on-device BatteryStats power use calculations broken down by uid.
4524 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4525 * that is attributed to non-uid items. They must all be included to get the total power use.
4526 */
4527message DeviceCalculatedPowerBlameUid {
4528 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4529 optional int32 uid = 1 [(is_uid) = true];
4530
Bookatz3dbc13a2018-12-21 12:16:51 -08004531 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4532 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4533 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08004534}
4535
4536/**
4537 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4538 * drain type.
4539 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4540 * is attributed uids. They must all be included to get the total power use.
4541 */
4542message DeviceCalculatedPowerBlameOther {
4543 // The type of item whose power use is being reported.
4544 enum DrainType {
4545 AMBIENT_DISPLAY = 0;
4546 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4547 BLUETOOTH = 2;
4548 CAMERA = 3;
4549 // Cell-standby
4550 CELL = 4;
4551 FLASHLIGHT = 5;
4552 IDLE = 6;
4553 MEMORY = 7;
4554 // Amount that total computed drain exceeded the drain estimated using the
4555 // battery level changes and capacity.
4556 OVERCOUNTED = 8;
4557 PHONE = 9;
4558 SCREEN = 10;
4559 // Amount that total computed drain was below the drain estimated using the
4560 // battery level changes and capacity.
4561 UNACCOUNTED = 11;
4562 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4563 WIFI = 13;
4564 }
4565 optional DrainType drain_type = 1;
4566
Bookatz3dbc13a2018-12-21 12:16:51 -08004567 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4568 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4569 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004570}
arangelov4e994062018-11-13 16:12:38 +00004571
4572/**
4573 * Logs device policy features.
4574 *
4575 * Logged from:
4576 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4577 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4578 */
4579message DevicePolicyEvent {
4580 // The event id - unique for each event.
4581 optional android.stats.devicepolicy.EventId event_id = 1;
4582 // The admin package name.
4583 optional string admin_package_name = 2;
4584 // A generic integer parameter.
4585 optional int32 integer_value = 3;
4586 // A generic boolean parameter.
4587 optional bool boolean_value = 4;
4588 // A parameter specifying a time period in milliseconds.
4589 optional uint64 time_period_millis = 5;
4590 // A parameter specifying a list of package names, bundle extras or string parameters.
4591 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4592}
shawnlinea5b66b2018-11-13 15:05:29 +08004593
4594/**
4595 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4596 *
4597 * Logged from:
4598 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4599 */
4600message DocsUILaunchReported {
4601 optional android.stats.docsui.LaunchAction launch_action = 1;
4602 optional bool has_initial_uri = 2;
4603 optional android.stats.docsui.MimeType mime_type = 3;
4604 optional android.stats.docsui.Root initial_root = 4;
4605}
4606
4607/**
4608 * Logs root/app visited event in file managers/picker. Call this when the user
4609 * taps on root/app in hamburger menu.
4610 *
4611 * Logged from:
4612 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4613 */
4614message DocsUIRootVisitedReported {
4615 optional android.stats.docsui.ContextScope scope = 1;
4616 optional android.stats.docsui.Root root = 2;
4617}
4618
4619/**
4620 * Logs file operation stats. Call this when a file operation has completed.
4621 *
4622 * Logged from:
4623 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4624 */
4625message DocsUIFileOperationReported {
4626 optional android.stats.docsui.Provider provider = 1;
4627 optional android.stats.docsui.FileOperation file_op = 2;
4628}
4629
4630/**
4631 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4632 * mode.
4633 *
4634 * Logged from:
4635 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4636 */
4637message DocsUIFileOperationCopyMoveModeReported {
4638 optional android.stats.docsui.FileOperation file_op = 1;
4639 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4640}
4641
4642
4643/**
4644 * Logs file sub operation stats. Call this when a file operation has failed.
4645 *
4646 * Logged from:
4647 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4648 */
4649message DocsUIFileOperationFailureReported {
4650 optional android.stats.docsui.Authority authority = 1;
4651 optional android.stats.docsui.SubFileOperation sub_op = 2;
4652}
4653
4654/**
4655* Logs the cancellation of a file operation. Call this when a job is canceled
4656*
4657* Logged from:
4658* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4659*/
4660message DocsUIFileOperationCanceledReported {
4661 optional android.stats.docsui.FileOperation file_op = 1;
4662}
4663
4664/**
4665 * Logs startup time in milliseconds.
4666 *
4667 * Logged from:
4668 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4669 */
4670message DocsUIStartupMsReported {
4671 optional int32 startup_millis = 1;
4672}
4673
4674/**
4675 * Logs the action that was started by user.
4676 *
4677 * Logged from:
4678 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4679 */
4680message DocsUIUserActionReported {
4681 optional android.stats.docsui.UserAction action = 1;
4682}
4683
4684/**
4685 * Logs the invalid type when invalid scoped access is requested.
4686 *
4687 * Logged from:
4688 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4689 */
4690message DocsUIInvalidScopedAccessRequestReported {
4691 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004692}
Ben Murdochbab399f2018-12-06 11:01:38 +00004693
4694/**
shawnlina75e82d2019-01-07 10:31:12 +08004695 * Logs the package name that launches docsui picker mode.
4696 *
4697 * Logged from:
4698 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4699 */
4700message DocsUIPickerLaunchedFromReported {
4701 optional string package_name = 1;
4702}
4703
4704/**
4705 * Logs the search type.
4706 *
4707 * Logged from:
4708 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4709 */
4710message DocsUISearchTypeReported {
4711 optional android.stats.docsui.SearchType search_type = 1;
4712}
4713
4714/**
4715 * Logs the search mode.
4716 *
4717 * Logged from:
4718 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4719 */
4720message DocsUISearchModeReported {
4721 optional android.stats.docsui.SearchMode search_mode = 1;
4722}
4723
4724/**
4725 * Logs the pick result information.
4726 *
4727 * Logged from:
4728 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4729 */
4730message DocsUIPickResultReported {
4731 optional int32 total_action_count = 1;
4732 optional int64 duration_millis = 2;
4733 optional int32 file_count= 3;
4734 optional bool is_searching = 4;
4735 optional android.stats.docsui.Root picked_from = 5;
4736 optional android.stats.docsui.MimeType mime_type = 6;
4737 optional int32 repeatedly_pick_times = 7;
4738}
4739
4740/**
Ben Murdochbab399f2018-12-06 11:01:38 +00004741 * Logs when an app's memory is compacted.
4742 *
4743 * Logged from:
4744 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4745 */
4746message AppCompacted {
4747 // The pid of the process being compacted.
4748 optional int32 pid = 1;
4749
4750 // The name of the process being compacted.
4751 optional string process_name = 2;
4752
4753 // The type of compaction.
4754 enum Action {
4755 UNKNOWN = 0;
4756 SOME = 1;
4757 FULL = 2;
4758 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004759 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00004760
4761 // Total RSS in kilobytes consumed by the process prior to compaction.
4762 optional int64 before_rss_total_kilobytes = 4;
4763
4764 // File RSS in kilobytes consumed by the process prior to compaction.
4765 optional int64 before_rss_file_kilobytes = 5;
4766
4767 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4768 optional int64 before_rss_anon_kilobytes = 6;
4769
4770 // Swap in kilobytes consumed by the process prior to compaction.
4771 optional int64 before_swap_kilobytes = 7;
4772
4773 // Total RSS in kilobytes consumed by the process after compaction.
4774 optional int64 after_rss_total_kilobytes = 8;
4775
4776 // File RSS in kilobytes consumed by the process after compaction.
4777 optional int64 after_rss_file_kilobytes = 9;
4778
4779 // Anonymous RSS in kilobytes consumed by the process after compaction.
4780 optional int64 after_rss_anon_kilobytes = 10;
4781
4782 // Swap in kilobytes consumed by the process after compaction.
4783 optional int64 after_swap_kilobytes = 11;
4784
4785 // The time taken to perform compaction in milliseconds.
4786 optional int64 time_to_compact_millis = 12;
4787
4788 // The last compaction action performed for this app.
4789 optional Action last_action = 13;
4790
Ben Murdoch01720b82018-12-19 18:03:44 +00004791 // The last time that compaction was attempted on this process in milliseconds
4792 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4793 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00004794
Ben Murdoch01720b82018-12-19 18:03:44 +00004795 // The oom_score_adj at the time of compaction.
4796 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00004797
4798 // The process state at the time of compaction.
4799 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
4800}
lifr157fc552018-12-12 16:38:04 +08004801
4802/**
4803 * Logs the latency period(in microseconds) and the return code of
4804 * the DNS(Domain Name System) lookups.
4805 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4806 * to get info(address or hostname) from DNS server(or DNS cache).
4807 * Logged from:
4808 * /system/netd/server/DnsProxyListener.cpp
4809 */
4810message NetworkDnsEventReported {
4811 // The types of the DNS lookups, as defined in
4812 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4813 enum EventType {
4814 EVENT_UNKNOWN = 0;
4815 EVENT_GETADDRINFO = 1;
4816 EVENT_GETHOSTBYNAME = 2;
4817 EVENT_GETHOSTBYADDR = 3;
4818 EVENT_RES_NSEND = 4;
4819 }
4820 optional EventType event_type = 1;
4821
4822 // The return value of the DNS resolver for each DNS lookups.
4823 //bionic/libc/include/netdb.h
4824 //system/netd/resolv/include/netd_resolv/resolv.h
4825 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08004826 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08004827 EAI_ADDRFAMILY = 1;
4828 EAI_AGAIN = 2;
4829 EAI_BADFLAGS = 3;
4830 EAI_FAIL = 4;
4831 EAI_FAMILY = 5;
4832 EAI_MEMORY = 6;
4833 EAI_NODATA = 7;
4834 EAI_NONAME = 8;
4835 EAI_SERVICE = 9;
4836 EAI_SOCKTYPE = 10;
4837 EAI_SYSTEM = 11;
4838 EAI_BADHINTS = 12;
4839 EAI_PROTOCOL = 13;
4840 EAI_OVERFLOW = 14;
4841 RESOLV_TIMEOUT = 255;
4842 EAI_MAX = 256;
4843 }
4844 optional ReturnCode return_code = 2;
4845
4846 // The latency period(in microseconds) it took for this DNS lookup to complete.
4847 optional int32 latency_micros = 3;
4848}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08004849
4850/**
4851 * Logs when a data stall event occurs.
4852 *
4853 * Log from:
4854 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4855 */
4856message DataStallEvent {
4857 // Data stall evaluation type.
4858 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4859 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
4860 optional int32 evaluation_type = 1;
4861 // See definition in data_stall_event.proto.
4862 optional com.android.server.connectivity.ProbeResult validation_result = 2;
4863 // See definition in data_stall_event.proto.
4864 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
4865 // See definition in data_stall_event.proto.
4866 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
4867 // See definition in data_stall_event.proto.
4868 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
4869 // See definition in data_stall_event.proto.
4870 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
4871}
Christian Brunschenf86039e2018-12-21 12:26:14 +00004872
4873/*
4874 * Logs when RescueParty resets some set of experiment flags.
4875 *
4876 * Logged from:
4877 * frameworks/base/services/core/java/com/android/server/RescueParty.java
4878 */
4879message RescuePartyResetReported {
4880 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
4881 optional int32 rescue_level = 1;
4882}
Mathew Inwoodb375be52019-01-04 11:36:25 +00004883
4884/**
4885 * Logs when signed config is received from an APK, and if that config was applied successfully.
4886 * Logged from:
4887 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
4888 */
4889message SignedConfigReported {
4890 enum Type {
4891 UNKNOWN_TYPE = 0;
4892 GLOBAL_SETTINGS = 1;
4893 }
4894 optional Type type = 1;
4895
4896 // The final status of the signed config received.
4897 enum Status {
4898 UNKNOWN_STATUS = 0;
4899 APPLIED = 1;
4900 BASE64_FAILURE_CONFIG = 2;
4901 BASE64_FAILURE_SIGNATURE = 3;
4902 SECURITY_EXCEPTION = 4;
4903 INVALID_CONFIG = 5;
4904 OLD_CONFIG = 6;
4905 SIGNATURE_CHECK_FAILED = 7;
4906 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00004907 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00004908 }
4909 optional Status status = 2;
4910
4911 // The version of the signed config processed.
4912 optional int32 version = 3;
4913
4914 // The package name that the config was extracted from.
4915 optional string from_package = 4;
4916
4917 enum Key {
4918 NO_KEY = 0;
4919 DEBUG = 1;
4920 PRODUCTION = 2;
4921 }
4922 // Which key was used to verify the config.
4923 optional Key verified_with = 5;
4924}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004925
4926/*
4927 * Logs GNSS Network-Initiated (NI) location events.
4928 *
4929 * Logged from:
4930 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4931 */
4932message GnssNiEventReported {
4933 // The type of GnssNiEvent.
4934 enum EventType {
4935 UNKNOWN = 0;
4936 NI_REQUEST = 1;
4937 NI_RESPONSE = 2;
4938 }
4939 optional EventType event_type = 1;
4940
4941 // An ID generated by HAL to associate NI notifications and UI responses.
4942 optional int32 notification_id = 2;
4943
4944 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004945 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004946
4947 // NI requires notification.
4948 optional bool need_notify = 4;
4949
4950 // NI requires verification.
4951 optional bool need_verify = 5;
4952
4953 // NI requires privacy override, no notification/minimal trace.
4954 optional bool privacy_override = 6;
4955
4956 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
4957 // seconds.
4958 optional int32 timeout = 7;
4959
4960 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004961 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004962
4963 // String representing the requester of the network inititated location request.
4964 optional string requestor_id = 9;
4965
4966 // Notification message text string representing the service(for eg. SUPL-service) who sent the
4967 // network initiated location request.
4968 optional string text = 10;
4969
4970 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004971 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004972
4973 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004974 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08004975
4976 // True if SUPL ES is enabled.
4977 optional bool is_supl_es_enabled = 13;
4978
4979 // True if GNSS location is enabled.
4980 optional bool is_location_enabled = 14;
4981
4982 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08004983 optional android.server.location.GnssUserResponseType user_response = 15;
4984}
4985
4986/**
4987 * Logs GNSS non-framework (NFW) location notification.
4988 *
4989 * Logged from:
4990 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
4991 */
4992message GnssNfwNotificationReported {
4993 // Package name of the Android proxy application representing the non-framework entity that
4994 // requested location. Set to empty string if unknown.
4995 optional string proxy_app_package_name = 1;
4996
4997 // Protocol stack that initiated the non-framework location request.
4998 optional android.server.location.NfwProtocolStack protocol_stack = 2;
4999
5000 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5001 // set to empty string. This field is opaque to the framework and used for logging purposes.
5002 optional string other_protocol_stack_name = 3;
5003
5004 // Source initiating/receiving the location information.
5005 optional android.server.location.NfwRequestor requestor = 4;
5006
5007 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5008 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5009 // and used for logging purposes.
5010 optional string requestor_id = 5;
5011
5012 // Indicates whether location information was provided for this request.
5013 optional android.server.location.NfwResponseType response_type = 6;
5014
5015 // True if the device is in user initiated emergency session.
5016 optional bool in_emergency_mode = 7;
5017
5018 // True if cached location is provided.
5019 optional bool is_cached_location = 8;
5020
5021 // True if proxy app permission mismatch between framework and GNSS HAL.
5022 optional bool is_permission_mismatched = 9;
5023}
5024
5025/**
5026 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5027 *
5028 * Logged from:
5029 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5030 */
5031message GnssConfigurationReported {
5032 // SUPL host name.
5033 optional string supl_host = 1;
5034
5035 // SUPL port number.
5036 optional int32 supl_port = 2;
5037
5038 // C2K host name.
5039 optional string c2k_host = 3;
5040
5041 // C2K port number.
5042 optional int32 c2k_port = 4;
5043
5044 // The SUPL version requested by Carrier.
5045 optional int32 supl_ver = 5;
5046
5047 // The SUPL mode.
5048 optional android.server.location.SuplMode supl_mode = 6;
5049
5050 // True if NI emergency SUPL restrictions is enabled.
5051 optional bool supl_es = 7;
5052
5053 // LTE Positioning Profile settings
5054 optional android.server.location.LppProfile lpp_profile = 8;
5055
5056 // Positioning protocol on A-Glonass system.
5057 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5058
5059 // True if emergency PDN is used. Otherwise, regular PDN is used.
5060 optional bool use_emergency_pdn_for_emergency_supl= 10;
5061
5062 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5063 optional android.server.location.GpsLock gps_lock = 11;
5064
5065 // Number of seconds to extend the emergency session duration post emergency call.
5066 optional int32 es_extension_sec = 12;
5067
5068 // The full list of package names of proxy Android applications representing the non-framework
5069 // location access entities (on/off the device) for which the framework user has granted
5070 // non-framework location access permission. The package names are concatenated in one string
5071 // with spaces as separators.
5072 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005073}
Jack Yu95b64f32018-12-13 18:26:11 +08005074
5075/**
5076 * Logs when a NFC device's error occurred.
5077 * Logged from:
5078 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5079 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5080 */
5081message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005082 enum Type {
5083 UNKNOWN = 0;
5084 CMD_TIMEOUT = 1;
5085 ERROR_NOTIFICATION = 2;
5086 AID_OVERFLOW = 3;
5087 }
5088 optional Type type = 1;
5089 // If it's nci cmd timeout, log the timeout command.
5090 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005091
Alex Salod7c3eef2019-01-25 14:43:27 -08005092 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005093}
5094
5095/**
5096 * Logs when a NFC device's state changed event
5097 * Logged from:
5098 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5099 */
5100message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005101 enum State {
5102 UNKNOWN = 0;
5103 OFF = 1;
5104 ON = 2;
5105 ON_LOCKED = 3; // Secure Nfc enabled.
5106 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5107 }
5108 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005109}
5110
5111/**
5112 * Logs when a NFC Beam Transaction occurred.
5113 * Logged from:
5114 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5115 */
5116message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005117 enum Operation {
5118 UNKNOWN = 0;
5119 SEND = 1;
5120 RECEIVE = 2;
5121 }
5122 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005123}
5124
5125/**
5126 * Logs when a NFC Card Emulation Transaction occurred.
5127 * Logged from:
5128 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5129 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5130 */
5131message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005132 enum Category {
5133 UNKNOWN = 0;
5134 HCE_PAYMENT = 1;
5135 HCE_OTHER = 2;
5136 OFFHOST = 3;
5137 }
5138 // Transaction belongs to HCE payment or HCE other category, or offhost.
5139 optional Category category = 1;
5140 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5141 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005142}
5143
5144/**
5145 * Logs when a NFC Tag event occurred.
5146 * Logged from:
5147 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5148 */
5149message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005150 enum Type {
5151 UNKNOWN = 0;
5152 URL = 1;
5153 BT_PAIRING = 2;
5154 PROVISION = 3;
5155 WIFI_CONNECT = 4;
5156 APP_LAUNCH = 5;
5157 OTHERS = 6;
5158 }
5159 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005160}
5161
5162/**
5163 * Logs when Hce transaction triggered
5164 * Logged from:
5165 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5166 */
5167message NfcHceTransactionOccurred {
5168 // The latency period(in microseconds) it took for the first HCE data
5169 // exchange.
5170 optional uint32 latency_micros = 1;
5171}
5172
5173/**
5174 * Logs when SecureElement state event changed
5175 * Logged from:
5176 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5177 */
5178message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005179 enum State {
5180 UNKNOWN = 0;
5181 INITIALIZED = 1;
5182 DISCONNECTED = 2;
5183 CONNECTED = 3;
5184 HALCRASH = 4;
5185 }
5186 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005187
Alex Salod7c3eef2019-01-25 14:43:27 -08005188 optional string state_change_reason = 2;
5189 // SIMx or eSEx.
5190 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005191}
5192
5193/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005194 * Information about a permission grant request
5195 */
5196message PermissionGrantRequestResultReported {
5197 // unique value identifying an API call. A API call might result in multiple of these atoms
5198 optional int64 request_id = 1;
5199
5200 // UID of package requesting the permission grant
5201 optional int32 requesting_uid = 2 [(is_uid) = true];
5202
5203 // Name of package requesting the permission grant
5204 optional string requesting_package_name = 3;
5205
5206 // The permission to be granted
5207 optional string permission_name = 4;
5208
5209 // If the permission was explicitly requested via the API or added by the system
5210 optional bool is_implicit = 5;
5211
5212 enum Result {
5213 UNDEFINED = 0;
5214 // permission request was ignored
5215 IGNORED = 1;
5216 // permission request was ignored because it was user fixed
5217 IGNORED_USER_FIXED = 2;
5218 // permission request was ignored because it was policy fixed
5219 IGNORED_POLICY_FIXED = 3;
5220 // permission was granted by user action
5221 USER_GRANTED = 4;
5222 // permission was automatically granted
5223 AUTO_GRANTED = 5;
5224 // permission was denied by user action
5225 USER_DENIED = 6;
5226 // permission was denied with prejudice by the user
5227 USER_DENIED_WITH_PREJUDICE = 7;
5228 // permission was automatically denied
5229 AUTO_DENIED = 8;
5230 }
5231 // The result of the permission grant
5232 optional Result result = 6;
5233}
5234
5235/**
Jack Yu95b64f32018-12-13 18:26:11 +08005236 * Logs when Omapi API used
5237 * Logged from:
5238 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5239 */
5240message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005241 enum Operation {
5242 UNKNOWN = 0;
5243 OPEN_CHANNEL = 1;
5244 }
5245 optional Operation operation = 1;
5246 // SIMx or eSEx.
5247 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005248
Alex Salod7c3eef2019-01-25 14:43:27 -08005249 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005250}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005251
5252/**
Alex Saloa060aee2019-01-21 14:36:41 -08005253 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5254 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005255 * Logged from:
5256 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5257 */
5258message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005259 optional int64 dispatch_latency_millis = 1;
5260}
5261
5262/**
5263 * Logs AttentionManagerService attention check result.
5264 *
5265 * Logged from:
5266 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5267 */
5268message AttentionManagerServiceResultReported {
5269 // See core/java/android/service/attention/AttentionService.java
5270 enum AttentionCheckResult {
5271 UNKNOWN = 20;
5272 ATTENTION_SUCCESS_ABSENT = 0;
5273 ATTENTION_SUCCESS_PRESENT = 1;
5274 ATTENTION_FAILURE_PREEMPTED = 2;
5275 ATTENTION_FAILURE_TIMED_OUT = 3;
5276 ATTENTION_FAILURE_UNKNOWN = 4;
5277 }
5278 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005279}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005280
5281/**
5282 * Logs when an adb connection changes state.
5283 *
5284 * Logged from:
5285 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5286 */
5287message AdbConnectionChanged {
5288 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5289 // previously selected for this system.
5290 optional int64 last_connection_time_millis = 1;
5291
5292 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5293 // to reconnect via adb without user interaction.
5294 optional int64 auth_window_millis = 2;
5295
5296 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5297 optional android.debug.AdbConnectionStateEnum state = 3;
5298
5299 // True if the 'always allow' option was selected for this system.
5300 optional bool always_allow = 4;
5301}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005302
5303/*
5304 * Logs the reported speech DSP status.
5305 *
5306 * Logged from:
5307 * Vendor audio implementation.
5308 */
5309message SpeechDspStatReported {
5310 // The total Speech DSP uptime in milliseconds.
5311 optional int32 total_uptime_millis = 1;
5312 // The total Speech DSP downtime in milliseconds.
5313 optional int32 total_downtime_millis = 2;
5314 optional int32 total_crash_count = 3;
5315 optional int32 total_recover_count = 4;
5316}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005317
5318/**
5319 * Logs USB connector contaminant status.
5320 *
5321 * Logged from: USB Service.
5322 */
5323message UsbContaminantReported {
5324 optional string id = 1;
5325 optional android.service.usb.ContaminantPresenceStatus status = 2;
5326}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005327
5328/**
5329 * This atom is for debugging purpose.
5330 */
5331message DebugElapsedClock {
5332 // Monotically increasing value for each pull.
5333 optional int64 pull_count = 1;
5334 // Time from System.elapsedRealtime.
5335 optional int64 elapsed_clock_millis = 2;
5336 // Time from System.elapsedRealtime.
5337 optional int64 same_elapsed_clock_millis = 3;
5338 // Diff between current elapsed time and elapsed time from previous pull.
5339 optional int64 elapsed_clock_diff_millis = 4;
5340
5341 enum Type {
5342 TYPE_UNKNOWN = 0;
5343 ALWAYS_PRESENT = 1;
5344 PRESENT_ON_ODD_PULLS = 2;
5345 }
5346 // Type of behavior for the pulled data.
5347 optional Type type = 5;
5348}
5349
5350/**
5351 * This atom is for debugging purpose.
5352 */
5353message DebugFailingElapsedClock {
5354 // Monotically increasing value for each pull.
5355 optional int64 pull_count = 1;
5356 // Time from System.elapsedRealtime.
5357 optional int64 elapsed_clock_millis = 2;
5358 // Time from System.elapsedRealtime.
5359 optional int64 same_elapsed_clock_millis = 3;
5360 // Diff between current elapsed time and elapsed time from previous pull.
5361 optional int64 elapsed_clock_diff_millis = 4;
5362}
Steven Wuacef6bb2019-01-23 14:21:17 -05005363
5364/** Logs System UI bubbles event changed.
5365 *
5366 * Logged from:
5367 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5368 */
5369message BubbleUIChanged {
5370
5371 // The app package that is posting the bubble.
5372 optional string package_name = 1;
5373
5374 // The notification channel that is posting the bubble.
5375 optional string notification_channel = 2;
5376
5377 // The notification id associated with the posted bubble.
5378 optional int32 notification_id = 3;
5379
5380 // The position of the bubble within the bubble stack.
5381 optional int32 position = 4;
5382
5383 // The total number of bubbles within the bubble stack.
5384 optional int32 total_number = 5;
5385
5386 // User interactions with the bubble.
5387 enum Action {
5388 UNKNOWN = 0;
5389 POSTED = 1;
5390 UPDATED = 2;
5391 EXPANDED = 3;
5392 COLLAPSED = 4;
5393 DISMISSED = 5;
5394 STACK_DISMISSED = 6;
5395 STACK_MOVED = 7;
5396 HEADER_GO_TO_APP = 8;
5397 HEADER_GO_TO_SETTINGS = 9;
5398 PERMISSION_OPT_IN = 10;
5399 PERMISSION_OPT_OUT = 11;
5400 PERMISSION_IGNORED = 12;
5401 SWIPE_LEFT = 13;
5402 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005403 STACK_EXPANDED = 15;
Steven Wuacef6bb2019-01-23 14:21:17 -05005404 }
5405 optional Action action = 6;
5406
5407 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5408 optional float normalized_x_position = 7;
5409 optional float normalized_y_position = 8;
5410}
Kweku Adams8845d012018-12-11 20:06:45 -08005411
5412/**
Steven Wu552f63f2019-02-05 13:41:36 -05005413 * Logs System UI bubbles developer errors.
5414 *
5415 * Logged from:
5416 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5417 */
5418message BubbleDeveloperErrorReported {
5419
5420 // The app package that is posting the bubble.
5421 optional string package_name = 1;
5422
5423 // Bubble developer error type enums.
5424 enum Error {
5425 UNKNOWN = 0;
5426 ACTIVITY_INFO_MISSING = 1;
5427 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5428 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5429 }
5430 optional Error error = 2 [default = UNKNOWN];
5431}
5432
5433/**
Kweku Adams8845d012018-12-11 20:06:45 -08005434 * Logs that a constraint for a scheduled job has changed.
5435 *
5436 * Logged from:
5437 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5438 */
5439message ScheduledJobConstraintChanged {
5440 repeated AttributionNode attribution_node = 1;
5441
5442 // Name of the job.
5443 optional string job_name = 2;
5444
5445 optional com.android.server.job.ConstraintEnum constraint = 3;
5446
5447 enum State {
5448 UNSATISFIED = 0;
5449 SATISFIED = 1;
5450 }
5451 optional State state = 4;
5452}
Alex Salod7c3eef2019-01-25 14:43:27 -08005453
5454/**
5455 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5456 * returns true.
5457 *
5458 * Logged from:
5459 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5460 */
5461message ScreenTimeoutExtensionReported {
5462 // Describes how many times in a row did the power manager reset the screen off timeout.
5463 optional uint32 consecutive_timeout_extended_count = 1;
5464}
Hui Yu885aca12019-01-10 17:11:34 -08005465
5466/*
5467* Logs number of milliseconds it takes to start a process.
5468* The definition of app process start time is from the app launch time to
5469* the time that Zygote finished forking the app process and loaded the
5470* application package's java classes.
5471
5472* This metric is different from AppStartOccurred which is for foreground
5473* activity only.
5474
5475* ProcessStartTime can report all processes (both foreground and background)
5476* start time.
5477*
5478* Logged from:
5479* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5480*/
5481message ProcessStartTime {
5482 // The uid of the ProcessRecord.
5483 optional int32 uid = 1 [(is_uid) = true];
5484
5485 // The process pid.
5486 optional int32 pid = 2;
5487
5488 // The process name.
5489 // Usually package name, "system" for system server.
5490 // Provided by ActivityManagerService.
5491 optional string process_name = 3;
5492
5493 enum StartType {
5494 UNKNOWN = 0;
5495 WARM = 1;
5496 HOT = 2;
5497 COLD = 3;
5498 }
5499
5500 // The start type.
5501 optional StartType type = 4;
5502
5503 // The elapsed realtime at the start of the process.
5504 optional int64 process_start_time_millis = 5;
5505
5506 // Number of milliseconds it takes to reach bind application.
5507 optional int32 bind_application_delay_millis = 6;
5508
5509 // Number of milliseconds it takes to finish start of the process.
5510 optional int32 process_start_delay_millis = 7;
5511
5512 // hostingType field in ProcessRecord, the component type such as "activity",
5513 // "service", "content provider", "broadcast" or other strings.
5514 optional string hosting_type = 8;
5515
5516 // hostingNameStr field in ProcessRecord. The component class name that runs
5517 // in this process.
5518 optional string hosting_name = 9;
5519}
5520
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005521/**
5522 * State of a dangerous permission requested by a package
5523 */
5524message DangerousPermissionState {
5525 // Name of the permission
5526 optional string permission_name = 1;
5527
5528 // Uid of the package
5529 optional int32 uid = 2 [(is_uid) = true];
5530
5531 // Package requesting the permission
5532 optional string package_name = 3;
5533
5534 // If the permission is granted to the uid
5535 optional bool is_granted = 4;
5536}
5537
Michael Groover4a0ca942019-01-24 17:41:25 -08005538/**
5539 * Logs when a package is denied access to a device identifier based on the new access requirements.
5540 *
5541 * Logged from:
5542 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
5543 */
5544message DeviceIdentifierAccessDenied {
5545 // The name of the package denied access to the requested device identifier.
5546 optional string package_name = 1;
5547
5548 // The name of the device identifier method the package attempted to invoke.
5549 optional string method_name = 2;
5550
5551 // True if the package is preinstalled.
5552 optional bool is_preinstalled = 3;
5553
5554 // True if the package is privileged.
5555 optional bool is_priv_app = 4;
5556}
Chenjie Yue13f44a2019-02-07 17:51:38 -08005557
5558/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08005559 * Pulls the ongoing mainline install train version code.
5560 * Pulled from StatsCompanionService
5561 */
5562message TrainInfo {
5563 optional int64 train_version_code = 1;
5564
5565 optional TrainExperimentIds train_experiment_id = 2;
5566}
joshmccloskey8c3322e2019-01-09 18:25:57 -08005567
5568/**
5569 * Logs the gesture stage changed event.
5570 *
5571 * Logged from:
5572 * frameworks/base/packages/SystemUI/
5573 */
5574message AssistGestureStageReported {
5575 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
5576}
5577
5578/**
5579 * Logs the feedback type.
5580 *
5581 * Logged from:
5582 * frameworks/base/packages/SystemUI/
5583 */
5584message AssistGestureFeedbackReported {
5585 // Whether or not the gesture was used.
5586 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
5587}
5588
5589/**
5590 * Logs the progress.
5591 *
5592 * Logged from:
5593 * frameworks/base/packages/SystemUI/
5594 */
5595message AssistGestureProgressReported {
5596 // [0,100] progress for the assist gesture.
5597 optional int32 progress = 1;
5598}