blob: 4fd212caebd2106463c541fa24351952022f3bb9 [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";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080048import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080049import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080050import "frameworks/base/core/proto/android/telephony/enums.proto";
51import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080052import "frameworks/base/core/proto/android/wifi/enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080053
Yao Chend54f9dd2017-10-17 17:37:48 +000054/**
Stefan Lafonae2df012017-11-14 09:17:21 -080055 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000056 * raw stats log events from the Android system, also known as "atoms."
57 *
58 * This field contains a single oneof with all of the available messages.
59 * The stats-log-api-gen tool runs as part of the Android build and
60 * generates the android.util.StatsLog class, which contains the constants
61 * and methods that Android uses to log.
62 *
Stefan Lafonae2df012017-11-14 09:17:21 -080063 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000064 * Instead, statsd on Android constructs these messages synthetically,
65 * in the format defined here and in stats_log.proto.
66 */
Stefan Lafonae2df012017-11-14 09:17:21 -080067message Atom {
68 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070069 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070070 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
71 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070072 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070073 BleScanResultReceived ble_scan_result_received = 4;
74 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080075 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070076 SyncStateChanged sync_state_changed = 7;
77 ScheduledJobStateChanged scheduled_job_state_changed = 8;
78 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070079 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080080 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
81 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
82 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070083 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
84 MemoryFactorStateChanged memory_factor_state_changed = 15;
85 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
86 CachedKillReported cached_kill_reported = 17;
87 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070088 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080089 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
90 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
91 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070092 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080093 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -070094 CameraStateChanged camera_state_changed = 25;
95 FlashlightStateChanged flashlight_state_changed = 26;
96 UidProcessStateChanged uid_process_state_changed = 27;
97 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
98 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -070099 BatteryLevelChanged battery_level_changed = 30;
100 ChargingStateChanged charging_state_changed = 31;
101 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -0700102 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800103 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -0700104 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
105 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -0700106 WifiLockStateChanged wifi_lock_state_changed = 37;
107 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
108 WifiScanStateChanged wifi_scan_state_changed = 39;
109 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700110 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700111 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700112 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900113 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700114 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800115 AnomalyDetected anomaly_detected = 46;
Andrei Oneada01ea52019-01-30 15:28:36 +0000116 AppBreadcrumbReported app_breadcrumb_reported = 47 [(allow_from_any_uid) = true];
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800117 AppStartOccurred app_start_occurred = 48;
118 AppStartCanceled app_start_canceled = 49;
119 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800120 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800121 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800122 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800123 LmkStateChanged lmk_state_changed = 54;
124 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800125 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800126 BootSequenceReported boot_sequence_reported = 57;
Andrei Oneada01ea52019-01-30 15:28:36 +0000127 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -0800128 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800129 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800130 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800131 KeyguardStateChanged keyguard_state_changed = 62;
132 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
133 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800134 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800135 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800136 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
137 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800138 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700139 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800140 SpeakerImpedanceReported speaker_impedance_reported = 71;
141 HardwareFailed hardware_failed = 72;
142 PhysicalDropDetected physical_drop_detected = 73;
143 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800144 MobileConnectionStateChanged mobile_connection_state_changed = 75;
145 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700146 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800147 AppCrashOccurred app_crash_occurred = 78;
148 ANROccurred anr_occurred = 79;
149 WTFOccurred wtf_occurred = 80;
150 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700151 GenericAtom generic_atom = 82;
jianjin6eada302019-02-28 11:25:57 -0800152 KeyValuePairsAtom key_value_pairs_atom = 83 [(allow_from_any_uid) = true];
Bookatza7020bd2018-08-28 16:29:35 -0700153 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700154 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700155 ThermalThrottlingStateChanged thermal_throttling = 86;
Kevin Chyn1741a072019-01-17 11:54:40 -0800156 BiometricAcquired biometric_acquired = 87;
157 BiometricAuthenticated biometric_authenticated = 88;
158 BiometricErrorOccurred biometric_error_occurred = 89;
Howard Ro688ae182018-09-25 00:09:36 -0700159 Notification notification = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700160 BatteryHealthSnapshot battery_health_snapshot = 91;
161 SlowIo slow_io = 92;
162 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700163 PhoneServiceStateChanged phone_service_state_changed = 94;
164 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100165 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700166 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700167 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700168 // TODO: service state change is very noisy shortly after boot, as well
169 // as at other transitions - coming out of doze, device plugged in, etc.
170 // Consider removing this if it becomes a problem
171 ServiceStateChanged service_state_changed = 99;
172 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800173 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800174 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000175 DevicePolicyEvent device_policy_event = 103;
shawnlinea5b66b2018-11-13 15:05:29 +0800176 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104;
177 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported = 105;
178 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106;
179 DocsUIFileOperationReported docs_ui_provider_file_op = 107;
180 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request = 108;
181 DocsUILaunchReported docs_ui_launch_reported = 109;
182 DocsUIRootVisitedReported docs_ui_root_visited = 110;
183 DocsUIStartupMsReported docs_ui_startup_ms = 111;
184 DocsUIUserActionReported docs_ui_user_action_reported = 112;
Bookatzda1798c2018-12-13 14:16:00 -0800185 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
186 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f2018-12-06 11:01:38 +0000187 AppCompacted app_compacted = 115;
lifr030d23a2019-01-11 16:54:51 +0800188 NetworkDnsEventReported network_dns_event_reported = 116;
shawnlina75e82d2019-01-07 10:31:12 +0800189 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported = 117;
190 DocsUIPickResultReported docs_ui_pick_result_reported = 118;
191 DocsUISearchModeReported docs_ui_search_mode_reported = 119;
192 DocsUISearchTypeReported docs_ui_search_type_reported = 120;
Chiachang Wangf6bedc22019-01-14 11:54:32 +0800193 DataStallEvent data_stall_event = 121;
Christian Brunschenf86039e2018-12-21 12:26:14 +0000194 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000195 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800196 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800197 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800198 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
199 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000200 AppDowngraded app_downgraded = 128;
201 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
202 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800203 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
204 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800205 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800206 NfcErrorOccurred nfc_error_occurred = 134;
207 NfcStateChanged nfc_state_changed = 135;
208 NfcBeamOccurred nfc_beam_occurred = 136;
209 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
210 NfcTagOccurred nfc_tag_occurred = 138;
211 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
212 SeStateChanged se_state_changed = 140;
213 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800214 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800215 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800216 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800217 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800218 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800219 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyne5a37fb2019-02-08 13:10:36 -0800220 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500221 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800222 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Jack Hec27040a2019-01-09 20:54:41 -0800223 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
224 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
225 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
226 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
227 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
228 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
229 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
230 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
231 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He1021a612019-01-20 21:22:46 -0800232 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
233 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
234 BluetoothManufacturerInfoReported bluetooth_device_info_reported = 162;
235 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
236 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
237 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
238 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
239 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Alex Salod7c3eef2019-01-25 14:43:27 -0800240 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800241 ProcessStartTime process_start_time = 169;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -0800242 PermissionGrantRequestResultReported permission_grant_request_result_reported = 170;
Jack He815cdba2019-01-30 17:24:55 -0800243 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Michael Groover4a0ca942019-01-24 17:41:25 -0800244 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Steven Wu552f63f2019-02-05 13:41:36 -0500245 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
joshmccloskey8c3322e2019-01-09 18:25:57 -0800246 AssistGestureStageReported assist_gesture_stage_reported = 174;
247 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
248 AssistGestureProgressReported assist_gesture_progress_reported = 176;
Philip Quinn0eded622019-01-29 12:46:28 -0800249 TouchGestureClassified touch_gesture_classified = 177;
Andrei Onea4ad6d0c2019-02-08 13:54:12 +0000250 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true];
Hyunyoung Song80adf6be2019-01-30 09:59:30 -0800251 StyleUIChanged style_ui_changed = 179;
Yao Chend54f9dd2017-10-17 17:37:48 +0000252 }
David Chenc8a43242017-10-17 16:23:28 -0700253
David Chen6e3e6cb2018-01-03 16:14:06 -0800254 // Pulled events will start at field 10000.
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800255 // Next: 10056
David Chenc8a43242017-10-17 16:23:28 -0700256 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800257 WifiBytesTransfer wifi_bytes_transfer = 10000;
258 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
259 MobileBytesTransfer mobile_bytes_transfer = 10002;
260 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800261 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800262 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800263 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800264 CpuTimePerFreq cpu_time_per_freq = 10008;
265 CpuTimePerUid cpu_time_per_uid = 10009;
266 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800267 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800268 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800269 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800270 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800271 SystemElapsedRealtime system_elapsed_realtime = 10014;
272 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800273 CpuActiveTime cpu_active_time = 10016;
274 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000275 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800276 RemainingBatteryCapacity remaining_battery_capacity = 10019;
277 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800278 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100279 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100280 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100281 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000282 DiskStats disk_stats = 10025;
283 DirectoryUsage directory_usage = 10026;
284 AppSize app_size = 10027;
285 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700286 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700287 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800288 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700289 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700290 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800291 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700292 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100293 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100294 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700295 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800296 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
297 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
298 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000299 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800300 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800301 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800302 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000303 DebugElapsedClock debug_elapsed_clock = 10046;
304 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800305 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800306 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800307 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800308 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000309 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +0000310 SDCardInfo sdcard_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800311 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
312 GpuStatsAppInfo gpu_stats_app_info = 10055;
David Chenc8a43242017-10-17 16:23:28 -0700313 }
yroa1fe77c2018-02-26 14:22:54 -0800314
Bookatz76aafcf2018-09-17 16:17:10 -0700315 // DO NOT USE field numbers above 100,000 in AOSP.
316 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
317 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700318}
319
Yao Chend54f9dd2017-10-17 17:37:48 +0000320/**
Yangster-mac20877162017-12-22 17:19:39 -0800321 * This proto represents a node of an attribution chain.
322 * Note: All attribution chains are represented as a repeated field of type
323 * AttributionNode. It is understood that in such arrays, the order is that
324 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000325 */
Yangster-mac20877162017-12-22 17:19:39 -0800326message AttributionNode {
327 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800328 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800329
Yangster-mac20877162017-12-22 17:19:39 -0800330 // The (optional) string tag for an element in the attribution chain. If the
331 // element has no tag, it is encoded as an empty string.
332 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700333}
334
Yangster-mac48b3d622018-08-18 12:38:11 -0700335message KeyValuePair {
336 optional int32 key = 1;
337 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700338 int32 value_int = 2;
339 int64 value_long = 3;
340 string value_str = 4;
341 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700342 }
343}
344
345message KeyValuePairsAtom {
346 optional int32 uid = 1;
347 repeated KeyValuePair pairs = 2;
348}
349
Yao Chend54f9dd2017-10-17 17:37:48 +0000350/*
351 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800352 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000353 *
354 * RULES:
355 * - The field ids for each atom must start at 1, and count upwards by 1.
356 * Skipping field ids is not allowed.
357 * - These form an API, so renaming, renumbering or removing fields is
358 * not allowed between android releases. (This is not currently enforced,
359 * but there will be a tool to enforce this restriction).
360 * - The types must be built-in protocol buffer types, namely, no sub-messages
361 * are allowed (yet). The bytes type is also not allowed.
362 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800363 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000364 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800365 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000366 * - A field that is a uid should be a string field, tagged with the [xxx]
367 * annotation. The generated code on android will be represented by UIDs,
368 * and those UIDs will be translated in xxx to those strings.
369 *
370 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700371 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000372 * - If there is a UID, it goes first. Think in an object-oriented fashion.
373 * *****************************************************************************
374 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700375
Yao Chend54f9dd2017-10-17 17:37:48 +0000376/**
Yangster-mace16189a2018-08-26 12:20:16 -0700377 * Logs when the Thermal service HAL notifies the throttling start/stop events.
378 *
379 * Logged from:
380 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
381 */
382message ThermalThrottlingStateChanged {
383 optional android.os.TemperatureTypeEnum sensor_type = 1;
384
385 enum State {
386 UNKNOWN = 0;
387 START = 1;
388 STOP = 2;
389 }
390
391 optional State state = 2;
392
393 optional float temperature = 3;
394}
395
396/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000397 * Logs when the screen state changes.
398 *
399 * Logged from:
400 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
401 */
402message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800403 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700404 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700405}
Yao Chend54f9dd2017-10-17 17:37:48 +0000406
407/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700408 * Logs that the process state of the uid, as determined by ActivityManager
409 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000410 *
411 * Logged from:
412 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
413 */
Bookatzc1a050a2017-10-10 15:49:28 -0700414message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700415 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000416
Bookatzdb026a22018-01-10 19:01:56 -0800417 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700418 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000419}
420
421/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700422 * Logs process state change of a process, as per the activity manager.
423 *
424 * Logged from:
425 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
426 */
427message ProcessStateChanged {
428 optional int32 uid = 1;
429 optional string process_name = 2;
430 optional string package_name = 3;
431 // TODO: remove this when validation is done
432 optional int64 version = 5;
433 // The state, from frameworks/base/core/proto/android/app/enums.proto.
434 optional android.app.ProcessStateEnum state = 4;
435}
436
437/**
438 * Logs when ActivityManagerService sleep state is changed.
439 *
440 * Logged from:
441 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
442 */
443message ActivityManagerSleepStateChanged {
444 // TODO: import frameworks proto
445 enum State {
446 UNKNOWN = 0;
447 ASLEEP = 1;
448 AWAKE = 2;
449 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700450 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700451}
452
453/**
454 * Logs when system memory state changes.
455 *
456 * Logged from:
457 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
458 */
459message MemoryFactorStateChanged {
460 // TODO: import frameworks proto
461 enum State {
462 MEMORY_UNKNOWN = 0;
463 NORMAL = 1; // normal.
464 MODERATE = 2; // moderate memory pressure.
465 LOW = 3; // low memory.
466 CRITICAL = 4; // critical memory.
467
468 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700469 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700470}
471
472/**
473 * Logs when app is using too much cpu, according to ActivityManagerService.
474 *
475 * Logged from:
476 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
477 */
478message ExcessiveCpuUsageReported {
479 optional int32 uid = 1;
480 optional string process_name = 2;
481 optional string package_name = 3;
482 // package version. TODO: remove this when validation is done
483 optional int64 version = 4;
484}
485
486/**
487 * Logs when a cached process is killed, along with its pss.
488 *
489 * Logged from:
490 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
491 */
492message CachedKillReported {
493 optional int32 uid = 1;
494 optional string process_name = 2;
495 optional string package_name = 3;
496 // TODO: remove this when validation is done
497 optional int64 version = 5;
498 optional int64 pss = 4;
499}
500
501/**
502 * Logs when memory stats of a process is reported.
503 *
504 * Logged from:
505 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
506 */
507message ProcessMemoryStatReported {
508 optional int32 uid = 1;
509 optional string process_name = 2;
510 optional string package_name = 3;
511 //TODO: remove this when validation is done
512 optional int64 version = 9;
513 optional int64 pss = 4;
514 optional int64 uss = 5;
515 optional int64 rss = 6;
516 enum Type {
517 ADD_PSS_INTERNAL_SINGLE = 0;
518 ADD_PSS_INTERNAL_ALL_MEM = 1;
519 ADD_PSS_INTERNAL_ALL_POLL = 2;
520 ADD_PSS_EXTERNAL = 3;
521 ADD_PSS_EXTERNAL_SLOW = 4;
522 }
523 optional Type type = 7;
524 optional int64 duration = 8;
525}
526
527/**
Bookatzc1a050a2017-10-10 15:49:28 -0700528 * Logs that a process started, finished, crashed, or ANRed.
529 *
530 * Logged from:
531 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
532 */
533message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700534 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700535
David Chen0b5c90c2018-01-25 16:51:49 -0800536 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800537 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700538
Bookatzddccf0a2017-11-28 16:48:14 -0800539 // What lifecycle state the process changed to.
540 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800541 enum State {
542 FINISHED = 0;
543 STARTED = 1;
544 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800545 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800546 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700547}
548
Bookatzc1a050a2017-10-10 15:49:28 -0700549/**
550 * Logs when the ble scan state changes.
551 *
552 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700553 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700554 */
555message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800556 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700557
558 enum State {
559 OFF = 0;
560 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700561 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
562 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700563 }
564 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700565
Bookatze5ec0b42018-03-26 13:34:56 -0700566 // Does the scan have a filter.
567 optional bool is_filtered = 3;
568 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
569 optional bool is_first_match = 4;
570 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
571 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700572}
573
574/**
575 * Logs reporting of a ble scan finding results.
576 *
577 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700578 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700579 */
Bookatzae6738e2018-09-13 11:38:56 -0700580// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700581message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800582 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700583
584 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800585 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700586}
587
588/**
589 * Logs when a sensor state changes.
590 *
591 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700592 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700593 */
594message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800595 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700596
Bookatzc1a050a2017-10-10 15:49:28 -0700597 // The id (int) of the sensor.
598 optional int32 sensor_id = 2;
599
600 enum State {
601 OFF = 0;
602 ON = 1;
603 }
604 optional State state = 3;
605}
606
Bookatzc1a050a2017-10-10 15:49:28 -0700607/**
608 * Logs when GPS state changes.
609 *
610 * Logged from:
611 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
612 */
613message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800614 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700615
616 enum State {
617 OFF = 0;
618 ON = 1;
619 }
620 optional State state = 2;
621}
622
Bookatz48d362e2018-11-06 15:49:08 -0800623/**
624 * Logs when GPS signal quality.
625 *
626 * Logged from:
627 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
628 */
629message GpsSignalQualityChanged {
630 optional android.server.location.GpsSignalQualityEnum level = 1;
631}
632
Bookatzc1a050a2017-10-10 15:49:28 -0700633
634/**
635 * Logs when a sync manager sync state changes.
636 *
637 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700638 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700639 */
640message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800641 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700642
David Chen0b5c90c2018-01-25 16:51:49 -0800643 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800644 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700645
646 enum State {
647 OFF = 0;
648 ON = 1;
649 }
650 optional State state = 3;
651}
652
Yangster-mac96353002018-09-05 11:18:55 -0700653/*
654 * Deferred job stats.
655 *
656 * Logged from:
657 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
658*/
659message DeferredJobStatsReported {
660 repeated AttributionNode attribution_node = 1;
661
662 // Number of jobs deferred.
663 optional int32 num_jobs_deferred = 2;
664
665 // Time since the last job runs.
666 optional int64 time_since_last_job_millis = 3;
667}
668
Bookatzc1a050a2017-10-10 15:49:28 -0700669/**
670 * Logs when a job scheduler job state changes.
671 *
672 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700673 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700674 */
675message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800676 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700677
678 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800679 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700680
681 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800682 FINISHED = 0;
683 STARTED = 1;
684 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700685 }
686 optional State state = 3;
687
Tej Singh33a412b2018-03-16 18:43:59 -0700688 // The reason a job has stopped.
689 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700690 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700691 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700692}
693
694/**
695 * Logs when the audio state changes.
696 *
697 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700698 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700699 */
700message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800701 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700702
703 enum State {
704 OFF = 0;
705 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700706 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
707 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700708 }
709 optional State state = 2;
710}
711
712/**
713 * Logs when the video codec state changes.
714 *
715 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700716 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700717 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800718message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800719 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700720
721 enum State {
722 OFF = 0;
723 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700724 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
725 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700726 }
727 optional State state = 2;
728}
729
730/**
731 * Logs when the flashlight state changes.
732 *
733 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700734 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700735 */
736message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800737 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700738
739 enum State {
740 OFF = 0;
741 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700742 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
743 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700744 }
745 optional State state = 2;
746}
747
748/**
749 * Logs when the camera state changes.
750 *
751 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700752 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700753 */
754message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800755 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700756
757 enum State {
758 OFF = 0;
759 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700760 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
761 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700762 }
763 optional State state = 2;
764}
765
766/**
767 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000768 *
769 * Logged from:
770 * TODO
771 */
Bookatzd6746242017-10-24 18:39:35 -0700772message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800773 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000774
Bookatz1a1b0462018-01-12 11:47:03 -0800775 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
776 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700777 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700778
779 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
780 optional string tag = 3;
781
782 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800783 RELEASE = 0;
784 ACQUIRE = 1;
785 CHANGE_RELEASE = 2;
786 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700787 }
788 optional State state = 4;
789}
790
791/**
Bookatzc1a050a2017-10-10 15:49:28 -0700792 * Logs when a partial wakelock is considered 'long' (over 1 min).
793 *
794 * Logged from:
795 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
796 */
797message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800798 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700799
Yao Chend54f9dd2017-10-17 17:37:48 +0000800 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
801 optional string tag = 2;
802
Bookatzc1a050a2017-10-10 15:49:28 -0700803 // TODO: I have no idea what this is.
804 optional string history_tag = 3;
805
806 enum State {
807 OFF = 0;
808 ON = 1;
809 }
810 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000811}
812
Bookatzc1a050a2017-10-10 15:49:28 -0700813/**
Bookatza66083f2018-09-20 17:24:00 -0700814 * Logs when the device is interactive, according to the PowerManager Notifier.
815 *
816 * Logged from:
817 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
818 */
819message InteractiveStateChanged {
820 enum State {
821 OFF = 0;
822 ON = 1;
823 }
824 optional State state = 1;
825}
826
827/**
Bookatzc1a050a2017-10-10 15:49:28 -0700828 * Logs Battery Saver state change.
829 *
830 * Logged from:
831 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
832 */
833message BatterySaverModeStateChanged {
834 enum State {
835 OFF = 0;
836 ON = 1;
837 }
838 optional State state = 1;
839}
840
841/**
842 * Logs Doze mode state change.
843 *
844 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800845 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700846 */
847message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800848 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800849}
850
851
852/**
853 * Logs state change of Doze mode including maintenance windows.
854 *
855 * Logged from:
856 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
857 */
858message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800859 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700860}
861
862/**
863 * Logs screen brightness level.
864 *
865 * Logged from:
866 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
867 */
868message ScreenBrightnessChanged {
869 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
870 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700871}
872
873/**
874 * Logs battery level (percent full, from 0 to 100).
875 *
876 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700877 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700878 */
879message BatteryLevelChanged {
880 // Battery level. Should be in [0, 100].
881 optional int32 battery_level = 1;
882}
883
884/**
885 * Logs change in charging status of the device.
886 *
887 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700888 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700889 */
890message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800891 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
892 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700893}
894
895/**
896 * Logs whether the device is plugged in, and what power source it is using.
897 *
898 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700899 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700900 */
901message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800902 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
903 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700904}
905
Bookatz8c6571b2017-10-24 15:04:41 -0700906/**
907 * Logs when an app's wakeup alarm fires.
908 *
909 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700910 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700911 */
912message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800913 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800914
915 // Name of the wakeup alarm.
916 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700917
918 // Name of source package (for historical reasons, since BatteryStats tracked it).
919 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800920}
921
922/**
923 * Logs when an an app causes the mobile radio to change state.
924 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
925 *
926 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700927 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800928 */
929message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800930 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800931
Bookatz1a1b0462018-01-12 11:47:03 -0800932 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
933 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800934}
935
936/**
937 * Logs when an an app causes the wifi radio to change state.
938 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
939 *
940 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700941 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800942 */
943message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800944 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800945
Bookatz1a1b0462018-01-12 11:47:03 -0800946 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
947 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700948}
949
950/**
951 * Logs kernel wakeup reasons and aborts.
952 *
953 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700954 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700955 */
956message KernelWakeupReported {
957 // Name of the kernel wakeup reason (or abort).
958 optional string wakeup_reason_name = 1;
959
960 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800961 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700962}
963
964/**
Bookatzda1798c2018-12-13 14:16:00 -0800965 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800966 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800967 *
968 * Logged from:
969 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
970 */
971message WifiEnabledStateChanged {
972 enum State {
973 OFF = 0;
974 ON = 1;
975 }
976 optional State state = 1;
977}
978
979/**
980 * 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 -0800981 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
982 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800983 *
984 * Logged from:
985 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
986 */
987message WifiRunningStateChanged {
988 repeated AttributionNode attribution_node = 1;
989
990 enum State {
991 OFF = 0;
992 ON = 1;
993 }
994 optional State state = 2;
995}
996
997/**
Bookatze5885242017-10-24 20:10:31 -0700998 * Logs wifi locks held by an app.
999 *
1000 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001001 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001002 */
1003message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001004 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001005
1006 enum State {
1007 OFF = 0;
1008 ON = 1;
1009 }
1010 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001011
1012 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1013 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001014}
1015
1016/**
1017 * Logs wifi signal strength changes.
1018 *
1019 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001020 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001021 */
1022message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001023 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1024 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001025}
1026
1027/**
1028 * Logs wifi scans performed by an app.
1029 *
1030 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001031 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001032 */
1033message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001034 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001035
1036 enum State {
1037 OFF = 0;
1038 ON = 1;
1039 }
1040 optional State state = 2;
1041}
1042
1043/**
Tej Singh4503e102018-01-04 14:35:01 -08001044 * Logs wifi multicast locks held by an app
1045 *
1046 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001047 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001048 */
1049message WifiMulticastLockStateChanged {
1050 repeated AttributionNode attribution_node = 1;
1051
1052 enum State {
1053 OFF = 0;
1054 ON = 1;
1055 }
1056 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001057
1058 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001059}
1060
1061/**
Tej Singh1ea42892018-01-19 09:27:00 -08001062 * Logs shutdown reason and duration on next boot.
1063 *
1064 * Logged from:
1065 * frameworks/base/core/java/com/android/server/BootReceiver.java
1066 */
1067message ShutdownSequenceReported {
1068 // True if shutdown is for a reboot. Default: false if we do not know.
1069 optional bool reboot = 1;
1070
1071 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1072 optional string reason = 2;
1073
1074 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1075 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001076 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001077
1078 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001079 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001080}
1081
Tej Singh6483ea42018-01-25 17:45:49 -08001082
1083/**
1084 * Logs boot reason and duration.
1085 *
1086 * Logged from:
1087 * system/core/bootstat/bootstat.cpp
1088 */
1089message BootSequenceReported {
1090 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1091 // Default: "<EMPTY>" if not available.
1092 optional string bootloader_reason = 1;
1093
1094 // Reason for system boot. Eg. bootloader, reboot,userrequested
1095 // Default: "<EMPTY>" if not available.
1096 optional string system_reason = 2;
1097
1098 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001099 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001100
1101 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001102 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001103
1104 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001105 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001106
1107 // Time since last boot in ms. Default: 0 if not available.
1108 optional int64 time_since_last_boot = 6;
1109}
1110
Tej Singhc477d9c2018-02-05 18:31:39 -08001111
1112/**
1113 * Logs call state and disconnect cause (if applicable).
1114 *
1115 * Logged from:
1116 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1117 */
1118message CallStateChanged {
1119 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1120 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1121 optional android.telecom.CallStateEnum call_state = 1;
1122
1123 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1124 // This value is only applicable when the call_state is DISCONNECTED, and
1125 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1126 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1127 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1128
1129 // True if the call is self-managed, which are apps that use the
1130 // telecom infrastructure to make their own calls.
1131 optional bool self_managed = 3;
1132
1133 // True if call is external. External calls are calls on connected Wear
1134 // devices but show up in Telecom so the user can pull them onto the device.
1135 optional bool external_call = 4;
1136}
1137
Tej Singh1ea42892018-01-19 09:27:00 -08001138/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001139 * Logs keyguard state. The keyguard is the lock screen.
1140 *
1141 * Logged from:
1142 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1143 */
1144message KeyguardStateChanged {
1145 enum State {
1146 UNKNOWN = 0;
1147 // The keyguard is hidden when the phone is unlocked.
1148 HIDDEN = 1;
1149 // The keyguard is shown when the phone is locked (screen turns off).
1150 SHOWN= 2;
1151 // The keyguard is occluded when something is overlaying the keyguard.
1152 // Eg. Opening the camera while on the lock screen.
1153 OCCLUDED = 3;
1154 }
1155 optional State state = 1;
1156}
1157
1158/**
1159 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1160 * prompts the user to enter a password (pattern, pin, etc).
1161 *
1162 * Logged from:
1163 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1164 */
1165
1166message KeyguardBouncerStateChanged {
1167 enum State {
1168 UNKNOWN = 0;
1169 // Bouncer is hidden, either as a result of successfully entering the
1170 // password, screen timing out, or user going back to lock screen.
1171 HIDDEN = 1;
1172 // This is when the user is being prompted to enter the password.
1173 SHOWN = 2;
1174 }
1175 optional State state = 1;
1176}
1177
1178/**
1179 * Logs the result of entering a password into the keyguard bouncer.
1180 *
1181 * Logged from:
1182 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1183 */
1184message KeyguardBouncerPasswordEntered {
1185 enum BouncerResult {
1186 UNKNOWN = 0;
1187 // The password entered was incorrect.
1188 FAILURE = 1;
1189 // The password entered was correct.
1190 SUCCESS = 2;
1191 }
1192 optional BouncerResult result = 1;
1193}
1194
Tej Singha883b372018-02-15 11:30:01 -08001195/*
1196 * Logs changes to the configuration of the device. The configuration is defined
1197 * in frameworks/base/core/java/android/content/res/Configuration.java
1198 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1199 * Please go there to interpret the possible values each field can be.
1200 *
1201 * Logged from:
1202 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1203 */
1204message ResourceConfigurationChanged {
1205 // Bit mask of color capabilities of the screen.
1206 // Contains information about the color gamut and hdr mode of the screen.
1207 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001208 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001209
1210 // The target screen density being rendered to.
1211 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001212 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001213
1214 // Current user preference for the scaling factor for fonts,
1215 // relative to the base density scaling.
1216 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001217 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001218
1219 // Flag indicating whether the hard keyboard is hidden.
1220 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001221 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001222
1223 // The type of keyboard attached to the device.
1224 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1225 optional int32 keyboard = 5;
1226
1227 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1228 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001229 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001230
1231 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1232 // 0 if undefined.
1233 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1234 optional int32 mcc = 7;
1235
1236 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1237 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1238 // MNC_ZERO symbol defined in Configuration.java.
1239 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1240 optional int32 mnc = 8;
1241
1242 // The kind of navigation available on the device.
1243 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1244 optional int32 navigation = 9;
1245
1246 // Flag indicating whether the navigation is available.
1247 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001248 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001249
1250 // Overall orientation of the screen.
1251 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1252 optional int32 orientation = 11;
1253
1254 // The current height of the available screen space, in dp units.
1255 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001256 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001257
1258 // Bit mask of overall layout of the screen.
1259 // Contains information about screen size, whether the screen is wider/taller
1260 // than normal, whether the screen layout is right-tl-left or left-to-right,
1261 // and whether the screen has a rounded shape.
1262 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001263 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001264
1265 // Current width of the available screen space, in dp units.
1266 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001267 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001268
1269 // The smallest screen size an application will see in normal operation.
1270 // This is the smallest value of both screenWidthDp and screenHeightDp
1271 // in portrait and landscape.
1272 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001273 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001274
1275 // The type of touch screen attached to the device.
1276 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1277 optional int32 touchscreen = 16;
1278
1279 // Bit mask of the ui mode.
1280 // Contains information about the overall ui mode of the device.
1281 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1282 // Also contains information about whether the device is in night mode.
1283 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001284 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001285}
1286
Tej Singheee317b2018-03-07 19:28:05 -08001287
1288/**
1289 * Logs changes in the connection state of the mobile radio.
1290 *
1291 * Logged from:
1292 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1293 */
1294message MobileConnectionStateChanged {
1295 // States are from the state machine DataConnection.java.
1296 enum State {
1297 UNKNOWN = 0;
1298 // The connection is inactive, or disconnected.
1299 INACTIVE = 1;
1300 // The connection is being activated, or connecting.
1301 ACTIVATING = 2;
1302 // The connection is active, or connected.
1303 ACTIVE = 3;
1304 // The connection is disconnecting.
1305 DISCONNECTING = 4;
1306 // The connection is disconnecting after creating a connection.
1307 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1308 }
1309 optional State state = 1;
1310 // For multi-sim phones, this distinguishes between the sim cards.
1311 optional int32 sim_slot_index = 2;
1312 // Used to identify the connection. Starts at 0 and increments by 1 for
1313 // every new network created. Resets whenever the device reboots.
1314 optional int32 data_connection_id = 3;
1315 // A bitmask for the capabilities of this connection.
1316 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1317 // Default value (if we have no information): 0
1318 optional int64 capabilities = 4;
1319 // If this connection has internet.
1320 // This just checks if the DEFAULT bit of capabilities is set.
1321 optional bool has_internet = 5;
1322}
1323
1324/**
1325 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1326 *
1327 * Logged from:
1328 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1329 */
1330message MobileRadioTechnologyChanged {
1331 optional android.telephony.NetworkTypeEnum state = 1;
1332 // For multi-sim phones, this distinguishes between the sim cards.
1333 optional int32 sim_slot_index = 2;
1334}
1335
Andrew Chantb56388b2018-03-22 21:07:33 -07001336/**
1337 * Logs the VID and PID of any connected USB devices.
1338 *
1339 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1340 *
1341 * Logged by Vendor.
1342 */
1343message UsbDeviceAttached {
1344 optional int32 vid = 1;
1345 optional int32 pid = 2;
1346 optional bool has_audio = 3;
1347 optional bool has_hid = 4;
1348 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001349 enum State {
1350 STATE_DISCONNECTED = 0;
1351 STATE_CONNECTED = 1;
1352 }
1353 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001354 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001355}
1356
Tej Singheee317b2018-03-07 19:28:05 -08001357
Tej Singhdd7bd352018-02-09 19:33:15 -08001358/**
Tej Singh5d991e12018-03-09 19:48:11 -08001359 * Logs when Bluetooth is enabled and disabled.
1360 *
1361 * Logged from:
1362 * services/core/java/com/android/server/BluetoothManagerService.java
1363 */
1364message BluetoothEnabledStateChanged {
1365 repeated AttributionNode attribution_node = 1;
1366 // Whether or not bluetooth is enabled on the device.
1367 enum State {
1368 UNKNOWN = 0;
1369 ENABLED = 1;
1370 DISABLED = 2;
1371 }
1372 optional State state = 2;
1373 // The reason for being enabled/disabled.
1374 // Eg. Airplane mode, crash, application request.
1375 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1376 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001377 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001378}
1379
1380/**
Jack Hed9837c82019-01-09 01:19:13 -08001381 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001382 *
1383 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001384 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1385 *
1386 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001387 */
1388message BluetoothConnectionStateChanged {
1389 // The state of the connection.
1390 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1391 optional android.bluetooth.ConnectionStateEnum state = 1;
1392 // An identifier that can be used to match connect and disconnect events.
1393 // Currently is last two bytes of a hash of a device level ID and
1394 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001395 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1396 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001397 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1398 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001399 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001400 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001401 // An identifier that can be used to match events for this device.
1402 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1403 // Salt: Randomly generated 256 bit value
1404 // Hash algorithm: HMAC-SHA256
1405 // Size: 32 byte
1406 // Default: null or empty if the device identifier is not known
1407 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1408}
1409
1410/**
1411 * Logs when a Bluetooth device connects and disconnects over ACL
1412 *
1413 * Logged from:
1414 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1415 *
1416 * Next Tag: 3
1417 */
1418message BluetoothAclConnectionStateChanged {
1419 // An identifier that can be used to match events for this device.
1420 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1421 // Salt: Randomly generated 256 bit value
1422 // Hash algorithm: HMAC-SHA256
1423 // Size: 32 byte
1424 // Default: null or empty if the device identifier is not known
1425 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1426 // The state of the connection.
1427 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1428 optional android.bluetooth.ConnectionStateEnum state = 2;
1429}
1430
1431/**
1432 * Logs when a Bluetooth device connects and disconnects over SCO
1433 *
1434 * Logged from:
1435 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1436 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1437 *
1438 * Next Tag: 4
1439 */
1440message BluetoothScoConnectionStateChanged {
1441 // An identifier that can be used to match events for this device.
1442 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1443 // Salt: Randomly generated 256 bit value
1444 // Hash algorithm: HMAC-SHA256
1445 // Size: 32 byte
1446 // Default: null or empty if the device identifier is not known
1447 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1448 // The state of the connection.
1449 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1450 optional android.bluetooth.ConnectionStateEnum state = 2;
1451 // Codec used for this SCO connection
1452 // Default: UNKNOWN
1453 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001454}
1455
Jack Hec27040a2019-01-09 20:54:41 -08001456/**
1457 * Logged when active device of a profile changes
1458 *
1459 * Logged from:
1460 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1461 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1462 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1463 */
1464message BluetoothActiveDeviceChanged {
1465 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1466 // From android.bluetooth.BluetoothProfile
1467 optional int32 bt_profile = 1;
1468 // An identifier that can be used to match events for this new active device.
1469 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1470 // Salt: Randomly generated 256 bit value
1471 // Hash algorithm: HMAC-SHA256
1472 // Size: 32 byte
1473 // Default: null or empty if there is no active device for this profile
1474 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1475}
1476
Jack Heab86dbd22018-12-18 15:43:27 -08001477// Logs when there is an event affecting Bluetooth device's link layer connection.
1478// - This event is triggered when there is a related HCI command or event
1479// - Users of this metrics can deduce Bluetooth device's connection state from these events
1480// - HCI commands are logged before the command is sent, after receiving command status, and after
1481// receiving command complete
1482// - HCI events are logged when they arrive
1483//
1484// Low level log from system/bt
1485//
1486// Bluetooth classic commands:
1487// - CMD_CREATE_CONNECTION
1488// - CMD_DISCONNECT
1489// - CMD_CREATE_CONNECTION_CANCEL
1490// - CMD_ACCEPT_CONNECTION_REQUEST
1491// - CMD_REJECT_CONNECTION_REQUEST
1492// - CMD_SETUP_ESCO_CONNECTION
1493// - CMD_ACCEPT_ESCO_CONNECTION
1494// - CMD_REJECT_ESCO_CONNECTION
1495// - CMD_ENH_SETUP_ESCO_CONNECTION
1496// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1497//
1498// Bluetooth low energy commands:
1499// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1500// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1501// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1502// - CMD_BLE_CLEAR_WHITE_LIST
1503// - CMD_BLE_ADD_WHITE_LIST
1504// - CMD_BLE_REMOVE_WHITE_LIST
1505//
1506// Bluetooth classic events:
1507// - EVT_CONNECTION_COMP
1508// - EVT_CONNECTION_REQUEST
1509// - EVT_DISCONNECTION_COMP
1510// - EVT_ESCO_CONNECTION_COMP
1511// - EVT_ESCO_CONNECTION_CHANGED
1512//
1513// Bluetooth low energy meta events:
1514// - BLE_EVT_CONN_COMPLETE_EVT
1515// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1516//
1517// Next tag: 10
1518message BluetoothLinkLayerConnectionEvent {
1519 // An identifier that can be used to match events for this device.
1520 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1521 // Salt: Randomly generated 256 bit value
1522 // Hash algorithm: HMAC-SHA256
1523 // Size: 32 byte
1524 // Default: null or empty if the device identifier is not known
1525 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1526 // Connection handle of this connection if available
1527 // Range: 0x0000 - 0x0EFF (12 bits)
1528 // Default: 0xFFFF if the handle is unknown
1529 optional int32 connection_handle = 2;
1530 // Direction of the link
1531 // Default: DIRECTION_UNKNOWN
1532 optional android.bluetooth.DirectionEnum direction = 3;
1533 // Type of this link
1534 // Default: LINK_TYPE_UNKNOWN
1535 optional android.bluetooth.LinkTypeEnum type = 4;
1536
1537 // Reason metadata for this link layer connection event, rules for interpretation:
1538 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1539 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1540 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1541 // set and valid, ignore hci_ble_event
1542
1543 // HCI command associated with this event
1544 // Default: CMD_UNKNOWN
1545 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1546 // HCI event associated with this event
1547 // Default: EVT_UNKNOWN
1548 optional android.bluetooth.hci.EventEnum hci_event = 6;
1549 // HCI BLE meta event associated with this event
1550 // Default: BLE_EVT_UNKNOWN
1551 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1552 // HCI command status code if this is triggerred by hci_cmd
1553 // Default: STATUS_UNKNOWN
1554 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1555 // HCI reason code associated with this event
1556 // Default: STATUS_UNKNOWN
1557 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1558}
1559
Howard Roe103fe22019-01-17 16:52:16 -08001560/**
1561 * Logs when a module is rolled back by Watchdog.
1562 *
1563 * Logged from: Rollback Manager
1564 */
1565message WatchdogRollbackOccurred {
1566 enum RollbackType {
1567 UNKNOWN = 0;
1568 ROLLBACK_INITIATE = 1;
1569 ROLLBACK_SUCCESS = 2;
1570 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001571 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001572 }
1573 optional RollbackType rollback_type = 1;
1574
1575 optional string package_name = 2;
1576
1577 optional int32 package_version_code = 3;
1578}
1579
Jack Hec27040a2019-01-09 20:54:41 -08001580/**
1581 * Logs when there is a change in Bluetooth A2DP playback state
1582 *
1583 * Logged from:
1584 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1585 */
1586message BluetoothA2dpPlaybackStateChanged {
1587 // An identifier that can be used to match events for this device.
1588 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1589 // Salt: Randomly generated 256 bit value
1590 // Hash algorithm: HMAC-SHA256
1591 // Size: 32 byte
1592 // Default: null or empty if the device identifier is not known
1593 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1594 // Current playback state
1595 // Default: PLAYBACK_STATE_UNKNOWN
1596 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1597 // Current audio coding mode
1598 // Default: AUDIO_CODING_MODE_UNKNOWN
1599 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1600}
1601
1602/**
1603 * Logs when there is a change in A2DP codec config for a particular remote device
1604 *
1605 * Logged from:
1606 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1607 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1608 */
1609message BluetoothA2dpCodecConfigChanged {
1610 // An identifier that can be used to match events for this device.
1611 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1612 // Salt: Randomly generated 256 bit value
1613 // Hash algorithm: HMAC-SHA256
1614 // Size: 32 byte
1615 // Default: null or empty if the device identifier is not known
1616 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1617 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1618 // Default SOURCE_CODEC_TYPE_INVALID
1619 optional int32 codec_type = 2;
1620 // Codec priroity, the higher the more preferred, -1 for disabled
1621 // Default: CODEC_PRIORITY_DEFAULT
1622 optional int32 codec_priority = 3;
1623 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1624 // Default: SAMPLE_RATE_NONE
1625 optional int32 sample_rate = 4;
1626 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1627 // Default: BITS_PER_SAMPLE_NONE
1628 optional int32 bits_per_sample = 5;
1629 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1630 // Default: CHANNEL_MODE_NONE
1631 optional int32 channel_mode = 6;
1632 // Codec specific values
1633 // Default 0
1634 optional int64 codec_specific_1 = 7;
1635 optional int64 codec_specific_2 = 8;
1636 optional int64 codec_specific_3 = 9;
1637 optional int64 codec_specific_4 = 10;
1638}
1639
1640/**
1641 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1642 * Each codec's capability is logged separately due to statsd restriction
1643 *
1644 * Logged from:
1645 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1646 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1647 */
1648message BluetoothA2dpCodecCapabilityChanged {
1649 // An identifier that can be used to match events for this device.
1650 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1651 // Salt: Randomly generated 256 bit value
1652 // Hash algorithm: HMAC-SHA256
1653 // Size: 32 byte
1654 // Default: null or empty if the device identifier is not known
1655 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1656 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1657 // Default SOURCE_CODEC_TYPE_INVALID
1658 optional int32 codec_type = 2;
1659 // Codec priroity, the higher the more preferred, -1 for disabled
1660 // Default: CODEC_PRIORITY_DEFAULT
1661 optional int32 codec_priority = 3;
1662 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1663 // in BluetoothCodecConfig
1664 // Default: empty and SAMPLE_RATE_NONE for individual item
1665 optional int32 sample_rate = 4;
1666 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1667 // in BluetoothCodecConfig
1668 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1669 optional int32 bits_per_sample = 5;
1670 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1671 // BluetoothCodecConfig
1672 // Default: empty and CHANNEL_MODE_NONE for individual item
1673 optional int32 channel_mode = 6;
1674 // Codec specific values
1675 // Default 0
1676 optional int64 codec_specific_1 = 7;
1677 optional int64 codec_specific_2 = 8;
1678 optional int64 codec_specific_3 = 9;
1679 optional int64 codec_specific_4 = 10;
1680}
1681
1682/**
1683 * Logs when A2DP failed to read from PCM source.
1684 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1685 *
1686 * Logged from:
1687 * system/bt
1688 */
1689message BluetoothA2dpAudioUnderrunReported {
1690 // An identifier that can be used to match events for this device.
1691 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1692 // Salt: Randomly generated 256 bit value
1693 // Hash algorithm: HMAC-SHA256
1694 // Size: 32 byte
1695 // Default: null or empty if the device identifier is not known
1696 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1697 // Encoding interval in nanoseconds
1698 // Default: 0
1699 optional int64 encoding_interval_nanos = 2;
1700 // Number of bytes of PCM data that could not be read from the source
1701 // Default: 0
1702 optional int32 num_missing_pcm_bytes = 3;
1703}
1704
1705/**
1706 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1707 * buffer queue is full and we have to drop data
1708 *
1709 * Logged from:
1710 * system/bt
1711 */
1712message BluetoothA2dpAudioOverrunReported {
1713 // An identifier that can be used to match events for this device.
1714 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1715 // Salt: Randomly generated 256 bit value
1716 // Hash algorithm: HMAC-SHA256
1717 // Size: 32 byte
1718 // Default: null or empty if the device identifier is not known
1719 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1720 // Encoding interval in nanoseconds
1721 // Default: 0
1722 optional int64 encoding_interval_nanos = 2;
1723 // Number of buffers dropped in this event
1724 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1725 // Default: 0
1726 optional int32 num_dropped_buffers = 3;
1727 // Number of encoded buffers dropped in this event
1728 // Default 0
1729 optional int32 num_dropped_encoded_frames = 4;
1730 // Number of encoded bytes dropped in this event
1731 // Default: 0
1732 optional int32 num_dropped_encoded_bytes = 5;
1733}
1734
1735/**
1736 * Logs when we receive reports regarding a device's RSSI value
1737 *
1738 * Logged from:
1739 * system/bt
1740 */
1741message BluetoothDeviceRssiReported {
1742 // An identifier that can be used to match events for this device.
1743 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1744 // Salt: Randomly generated 256 bit value
1745 // Hash algorithm: HMAC-SHA256
1746 // Size: 32 byte
1747 // Default: null or empty if the device identifier is not known
1748 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1749 // Connection handle of this connection if available
1750 // Range: 0x0000 - 0x0EFF (12 bits)
1751 // Default: 0xFFFF if the handle is unknown
1752 optional int32 connection_handle = 2;
1753 // HCI command status code if this is triggerred by hci_cmd
1754 // Default: STATUS_UNKNOWN
1755 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1756 // BR/EDR
1757 // Range: -128 ≤ N ≤ 127 (signed integer)
1758 // Units: dB
1759 // LE:
1760 // Range: -127 to 20, 127 (signed integer)
1761 // Units: dBm
1762 // Invalid when an out of range value is reported
1763 optional int32 rssi = 4;
1764}
1765
1766/**
1767 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1768 *
1769 * Logged from:
1770 * system/bt
1771 */
1772message BluetoothDeviceFailedContactCounterReported {
1773 // An identifier that can be used to match events for this device.
1774 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1775 // Salt: Randomly generated 256 bit value
1776 // Hash algorithm: HMAC-SHA256
1777 // Size: 32 byte
1778 // Default: null or empty if the device identifier is not known
1779 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1780 // Connection handle of this connection if available
1781 // Range: 0x0000 - 0x0EFF (12 bits)
1782 // Default: 0xFFFF if the handle is unknown
1783 optional int32 connection_handle = 2;
1784 // HCI command status code if this is triggerred by hci_cmd
1785 // Default: STATUS_UNKNOWN
1786 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1787 // Number of consecutive failed contacts for a connection corresponding to the Handle
1788 // Range: uint16_t, 0-0xFFFF
1789 // Default: 0xFFFFF
1790 optional int32 failed_contact_counter = 4;
1791}
1792
1793/**
1794 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1795 *
1796 * Logged from:
1797 * system/bt
1798 */
1799message BluetoothDeviceTxPowerLevelReported {
1800 // An identifier that can be used to match events for this device.
1801 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1802 // Salt: Randomly generated 256 bit value
1803 // Hash algorithm: HMAC-SHA256
1804 // Size: 32 byte
1805 // Default: null or empty if the device identifier is not known
1806 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1807 // Connection handle of this connection if available
1808 // Range: 0x0000 - 0x0EFF (12 bits)
1809 // Default: 0xFFFF if the handle is unknown
1810 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001811 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001812 // Default: STATUS_UNKNOWN
1813 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1814 // Range: -30 ≤ N ≤ 20
1815 // Units: dBm
1816 // Invalid when an out of range value is reported
1817 optional int32 transmit_power_level = 4;
1818}
Jack Heab86dbd22018-12-18 15:43:27 -08001819
Tej Singh5d991e12018-03-09 19:48:11 -08001820/**
Jack He1021a612019-01-20 21:22:46 -08001821 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1822 * receiving an HCI command from the host
1823 *
1824 * Logged from: system/bt
1825 */
1826message BluetoothHciTimeoutReported {
1827 // HCI command associated with this event
1828 // Default: CMD_UNKNOWN
1829 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1830}
1831
1832/**
1833 * Logs when we receive Bluetooth Link Quality Report event from the controller
1834 * See Android Bluetooth HCI specification for more details
1835 *
1836 * Note: all count and bytes field are counted since last event
1837 *
1838 * Logged from: system/bt
1839 */
1840message BluetoothQualityReportReported {
1841 // Quality report ID
1842 // Original type: uint8_t
1843 // Default: BQR_ID_UNKNOWN
1844 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1845 // Packet type of the connection
1846 // Original type: uint8_t
1847 // Default: BQR_PACKET_TYPE_UNKNOWN
1848 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1849 // Connection handle of the connection
1850 // Original type: uint16_t
1851 optional int32 connection_handle = 3;
1852 // Performing Role for the connection
1853 // Original type: uint8_t
1854 optional int32 connection_role = 4;
1855 // Current Transmit Power Level for the connection. This value is the same as the controller's
1856 // response to the HCI_Read_Transmit_Power_Level HCI command
1857 // Original type: uint8_t
1858 optional int32 tx_power_level = 5;
1859 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1860 // absolute receiver signal strength value
1861 // Original type: int8_t
1862 optional int32 rssi = 6;
1863 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1864 // channels used by the link currently
1865 // Original type: uint8_t
1866 optional int32 snr = 7;
1867 // Indicates the number of unused channels in AFH_channel_map
1868 // Original type: uint8_t
1869 optional int32 unused_afh_channel_count = 8;
1870 // Indicates the number of the channels which are interfered and quality is bad but are still
1871 // selected for AFH
1872 // Original type: uint8_t
1873 optional int32 afh_select_unideal_channel_count = 9;
1874 // Current Link Supervision Timeout Setting
1875 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1876 // Original type: uint16_t
1877 optional int32 lsto = 10;
1878 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1879 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1880 // 0x01 (Piconet Clock)
1881 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1882 // Original type: uint32_t
1883 optional int64 connection_piconet_clock = 11;
1884 // The count of retransmission
1885 // Original type: uint32_t
1886 optional int64 retransmission_count = 12;
1887 // The count of no RX
1888 // Original type: uint32_t
1889 optional int64 no_rx_count = 13;
1890 // The count of NAK (Negative Acknowledge)
1891 // Original type: uint32_t
1892 optional int64 nak_count = 14;
1893 // Controller timestamp of last TX ACK
1894 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1895 // Original type: uint32_t
1896 optional int64 last_tx_ack_timestamp = 15;
1897 // The count of Flow-off (STOP)
1898 // Original type: uint32_t
1899 optional int64 flow_off_count = 16;
1900 // Controller timestamp of last Flow-on (GO)
1901 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1902 // Original type: uint32_t
1903 optional int64 last_flow_on_timestamp = 17;
1904 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1905 // Original type: uint32_t
1906 optional int64 buffer_overflow_bytes = 18;
1907 // Buffer underflow count (in byte) since last event
1908 // Original type: uint32_t
1909 optional int64 buffer_underflow_bytes = 19;
1910}
1911
1912/**
1913 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1914 *
1915 * Notes:
1916 * - Each event can be partially filled as we might learn different pieces of device
1917 * information at different time
1918 * - Multiple device info events can be combined to give more complete picture
1919 * - When multiple device info events tries to describe the same information, the
1920 * later one wins
1921 *
1922 * Logged from:
1923 * packages/apps/Bluetooth
1924 */
1925message BluetoothManufacturerInfoReported {
1926 // An identifier that can be used to match events for this device.
1927 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1928 // Salt: Randomly generated 256 bit value
1929 // Hash algorithm: HMAC-SHA256
1930 // Size: 32 byte
1931 // Default: null or empty if the device identifier is not known
1932 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1933 // Where is this device info obtained from
1934 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1935 // Name of the data source
1936 // For EXTERNAL: package name of the data source
1937 // For INTERNAL: null for general case, component name otherwise
1938 optional string source_name = 3;
1939 // Name of the manufacturer of this device
1940 optional string manufacturer = 4;
1941 // Model of this device
1942 optional string model = 5;
1943 // Hardware version of this device
1944 optional string hardware_version = 6;
1945 // Software version of this device
1946 optional string software_version = 7;
1947}
1948
1949/**
1950 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1951 * device, as documented by the Bluetooth Core HCI specification
1952 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1953 * Vol 2, Part E, Page 1118
1954 *
1955 * Logged from:
1956 * system/bt
1957 */
1958message BluetoothRemoteVersionInfoReported {
1959 // Connection handle of the connection
1960 // Original type: uint16_t
1961 optional int32 connection_handle = 1;
1962 // HCI command status code
1963 // Default: STATUS_UNKNOWN
1964 optional android.bluetooth.hci.StatusEnum hci_status = 2;
1965 // 1 byte Version of current LMP in the remote controller
1966 optional int32 lmp_version = 3;
1967 // 2 bytes LMP manufacturer code of the remote controller
1968 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
1969 optional int32 lmp_manufacturer_code = 4;
1970 // 4 bytes subversion of the LMP in the remote controller
1971 optional int32 lmp_subversion = 5;
1972}
1973
1974/**
1975 * Logs when certain Bluetooth SDP attributes are discovered
1976 * Constant definitions are from:
1977 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
1978 *
1979 * Current logged attributes:
1980 * - BluetoothProfileDescriptorList
1981 * - Supported Features Bitmask
1982 *
1983 * Logged from:
1984 * system/bt
1985 */
1986message BluetoothSdpAttributeReported {
1987 // An identifier that can be used to match events for this device.
1988 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1989 // Salt: Randomly generated 256 bit value
1990 // Hash algorithm: HMAC-SHA256
1991 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1992 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
1993 // Original type: uint16_t
1994 optional int32 protocol_uuid = 2;
1995 // Short form UUIDs used to identify Bluetooth SDP attribute types
1996 // Original type: uint16_t
1997 optional int32 attribute_id = 3;
1998 // Attribute value for the particular attribute
1999 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2000}
2001
2002/**
2003 * Logs when bond state of a Bluetooth device changes
2004 *
2005 * Logged from:
2006 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2007 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2008 */
2009message BluetoothBondStateChanged {
2010 // An identifier that can be used to match events for this device.
2011 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2012 // Salt: Randomly generated 256 bit value
2013 // Hash algorithm: HMAC-SHA256
2014 // Size: 32 byte
2015 // Default: null or empty if the device identifier is not known
2016 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2017 // Preferred transport type to remote dual mode device
2018 // Default: TRANSPORT_AUTO means no preference
2019 optional android.bluetooth.TransportTypeEnum transport = 2;
2020 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2021 // Default: UNKNOWN
2022 optional android.bluetooth.DeviceTypeEnum type = 3;
2023 // Current bond state (NONE, BONDING, BONDED)
2024 // Default: BOND_STATE_UNKNOWN
2025 optional android.bluetooth.BondStateEnum bond_state = 4;
2026 // Bonding sub state
2027 // Default: BOND_SUB_STATE_UNKNOWN
2028 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2029 // Unbond Reason
2030 // Default: UNBOND_REASON_UNKNOWN
2031 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2032}
2033
2034/**
2035 * Logs there is an event related Bluetooth classic pairing
2036 *
2037 * Logged from:
2038 * system/bt
2039 */
2040message BluetoothClassicPairingEventReported {
2041 // An identifier that can be used to match events for this device.
2042 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2043 // Salt: Randomly generated 256 bit value
2044 // Hash algorithm: HMAC-SHA256
2045 // Size: 32 byte
2046 // Default: null or empty if the device identifier is not known
2047 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2048 // Connection handle of this connection if available
2049 // Range: 0x0000 - 0x0EFF (12 bits)
2050 // Default: 0xFFFF if the handle is unknown
2051 optional int32 connection_handle = 2;
2052 // HCI command associated with this event
2053 // Default: CMD_UNKNOWN
2054 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2055 // HCI event associated with this event
2056 // Default: EVT_UNKNOWN
2057 optional android.bluetooth.hci.EventEnum hci_event = 4;
2058 // HCI command status code if this is triggerred by hci_cmd
2059 // Default: STATUS_UNKNOWN
2060 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2061 // HCI reason code associated with this event
2062 // Default: STATUS_UNKNOWN
2063 optional android.bluetooth.hci.StatusEnum reason_code = 6;
2064}
2065
2066/**
2067 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2068 *
2069 * Logged from:
2070 * system/bt
2071 */
2072message BluetoothSmpPairingEventReported {
2073 // An identifier that can be used to match events for this device.
2074 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2075 // Salt: Randomly generated 256 bit value
2076 // Hash algorithm: HMAC-SHA256
2077 // Size: 32 byte
2078 // Default: null or empty if the device identifier is not known
2079 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2080 // SMP command sent or received over L2CAP
2081 // Default: CMD_UNKNOWN
2082 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2083 // Whether this command is sent or received
2084 // Default: DIRECTION_UNKNOWN
2085 optional android.bluetooth.DirectionEnum direction = 3;
2086 // SMP failure reason code
2087 // Default: PAIRING_FAIL_REASON_DEFAULT
2088 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2089}
2090
2091/**
Jack He815cdba2019-01-30 17:24:55 -08002092 * Logs when a Bluetooth socket’s connection state changed
2093 *
2094 * Logged from:
2095 * system/bt
2096 */
2097message BluetoothSocketConnectionStateChanged {
2098 // An identifier that can be used to match events for this device.
2099 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2100 // Salt: Randomly generated 256 bit value
2101 // Hash algorithm: HMAC-SHA256
2102 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002103 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002104 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002105 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002106 // Default 0 when unknown or don't care
2107 optional int32 port = 2;
2108 // Socket type as mentioned in
2109 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2110 // Default: SOCKET_TYPE_UNKNOWN
2111 optional android.bluetooth.SocketTypeEnum type = 3;
2112 // Socket connection state
2113 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2114 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2115 // Number of bytes sent to remote device during this connection
2116 optional int64 tx_bytes = 5;
2117 // Number of bytes received from remote device during this connection
2118 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002119 // Socket owner's UID
2120 optional int32 uid = 7 [(is_uid) = true];
2121 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2122 // |port| must be spawned by |server_port|
2123 // Default 0 when unknown or don't care
2124 optional int32 server_port = 8;
2125 // Whether this is a server listener socket
2126 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002127}
2128
2129/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002130 * Logs when something is plugged into or removed from the USB-C connector.
2131 *
2132 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002133 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002134 */
2135message UsbConnectorStateChanged {
2136 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002137 STATE_DISCONNECTED = 0;
2138 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002139 }
2140 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002141 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002142 // Last active session in ms.
2143 // 0 when the port is in connected state.
2144 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002145}
2146
2147/**
2148 * Logs the reported speaker impedance.
2149 *
2150 * Logged from:
2151 * Vendor audio implementation.
2152 */
2153message SpeakerImpedanceReported {
2154 optional int32 speaker_location = 1;
2155 optional int32 impedance = 2;
2156}
2157
2158/**
2159 * Logs the report of a failed hardware.
2160 *
2161 * Logged from:
2162 * Vendor HALs.
2163 *
2164 */
2165message HardwareFailed {
2166 enum HardwareType {
2167 HARDWARE_FAILED_UNKNOWN = 0;
2168 HARDWARE_FAILED_MICROPHONE = 1;
2169 HARDWARE_FAILED_CODEC = 2;
2170 HARDWARE_FAILED_SPEAKER = 3;
2171 HARDWARE_FAILED_FINGERPRINT = 4;
2172 }
2173 optional HardwareType hardware_type = 1;
2174
Maggie White6dcd8572019-01-31 14:11:50 -08002175 /**
2176 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002177 * the same hardware_type. The specific locations are vendor defined integers,
2178 * referring to board-specific numbering schemes.
2179 */
2180 optional int32 hardware_location = 2;
2181
Maggie White6dcd8572019-01-31 14:11:50 -08002182 /**
2183 * failure_code is specific to the HardwareType of the failed hardware.
2184 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002185 */
Maggie White6dcd8572019-01-31 14:11:50 -08002186 enum HardwareErrorCode {
2187 UNKNOWN = 0;
2188 COMPLETE = 1;
2189 SPEAKER_HIGH_Z = 2;
2190 SPEAKER_SHORT = 3;
2191 FINGERPRINT_SENSOR_BROKEN = 4;
2192 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002193 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002194 }
2195 optional int32 failure_code = 3;
2196}
2197
2198/**
2199 * Log an event when the device has been physically dropped.
2200 * Reported from the /vendor partition.
2201 */
2202message PhysicalDropDetected {
2203 // Confidence that the event was actually a drop, 0 -> 100
2204 optional int32 confidence_pctg = 1;
2205 // Peak acceleration of the drop, in 1/1000s of a g.
2206 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002207 // Duration of freefall in ms
2208 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002209}
2210
2211/**
2212 * Log bucketed battery charge cycles.
2213 *
2214 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002215 * a given charge point. For example, if 10 cycle buckets are
2216 * initialized, bucket 1 is the lowest 1/10th of the battery,
2217 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002218 *
2219 * Logged from:
2220 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2221 */
2222message ChargeCyclesReported {
2223 optional int32 cycle_bucket_1 = 1;
2224 optional int32 cycle_bucket_2 = 2;
2225 optional int32 cycle_bucket_3 = 3;
2226 optional int32 cycle_bucket_4 = 4;
2227 optional int32 cycle_bucket_5 = 5;
2228 optional int32 cycle_bucket_6 = 6;
2229 optional int32 cycle_bucket_7 = 7;
2230 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002231 optional int32 cycle_bucket_9 = 9;
2232 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002233}
2234
2235/**
Howard Roa46b6582018-09-18 16:45:02 -07002236 * Log battery health snapshot.
2237 *
2238 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2239 * are snapshotted periodically over 24hrs.
2240 */
2241message BatteryHealthSnapshot {
2242 enum BatterySnapshotType {
2243 UNKNOWN = 0;
2244 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2245 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2246 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2247 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2248 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2249 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2250 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2251 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2252 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2253 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2254 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2255 }
2256 optional BatterySnapshotType type = 1;
2257 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002258 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002259 // Voltage Battery Voltage, in microVolts.
2260 optional int32 voltage_micro_volt = 3;
2261 // Current Battery current, in microAmps.
2262 optional int32 current_micro_amps = 4;
2263 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2264 optional int32 open_circuit_micro_volt = 5;
2265 // Resistance Battery Resistance, in microOhms.
2266 optional int32 resistance_micro_ohm = 6;
2267 // Level Battery Level, as % of full.
2268 optional int32 level_percent = 7;
2269}
2270
2271/**
2272 * Log slow I/O operations on the primary storage.
2273 */
2274message SlowIo {
2275 // Classifications of IO Operations.
2276 enum IoOperation {
2277 UNKNOWN = 0;
2278 READ = 1;
2279 WRITE = 2;
2280 UNMAP = 3;
2281 SYNC = 4;
2282 }
2283 optional IoOperation operation = 1;
2284
2285 // The number of slow IO operations of this type over 24 hours.
2286 optional int32 count = 2;
2287}
2288
2289/**
2290 * Log battery caused shutdown with the last recorded voltage.
2291 */
2292message BatteryCausedShutdown {
2293 // The last recorded battery voltage prior to shutdown.
2294 optional int32 last_recorded_micro_volt = 1;
2295}
2296
2297/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002298 * Logs the duration of a davey (jank of >=700ms) when it occurs
2299 *
2300 * Logged from:
2301 * frameworks/base/libs/hwui/JankTracker.cpp
2302 */
2303message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002304 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002305 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002306
Tej Singhbb8554a2018-01-26 11:59:14 -08002307 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002308 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002309}
2310
2311/**
Bookatze5885242017-10-24 20:10:31 -07002312 * Logs phone signal strength changes.
2313 *
2314 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002315 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002316 */
2317message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002318 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2319 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002320}
2321
Yangster4ccebea2018-10-09 17:09:02 -07002322
2323/**
2324 * Logs when the phone state, sim state or signal strength changes
2325 *
2326 * Logged from:
2327 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2328 */
2329message PhoneServiceStateChanged {
2330 optional android.telephony.ServiceStateEnum state = 1;
2331 optional android.telephony.SimStateEnum sim_state = 2;
2332 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2333}
2334
2335/**
2336 * Logs when the phone becomes on or off.
2337 *
2338 * Logged from:
2339 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2340 */
2341message PhoneStateChanged {
2342 enum State {
2343 OFF = 0;
2344 ON = 1;
2345 }
2346 optional State state = 1;
2347}
2348
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002349message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002350 optional android.stats.launcher.LauncherAction action = 1;
2351 optional android.stats.launcher.LauncherState src_state = 2;
2352 optional android.stats.launcher.LauncherState dst_state = 3;
2353 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002354 optional bool is_swipe_up_enabled = 5;
2355}
2356
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002357message StyleUIChanged {
2358 optional android.stats.style.Action action = 1;
2359 optional int32 color_package_hash = 2;
2360 optional int32 font_package_hash = 3;
2361 optional int32 shape_package_hash = 4;
2362 optional int32 clock_package_hash = 5;
2363 optional int32 launcher_grid = 6;
2364 optional int32 wallpaper_category_hash = 7;
2365 optional int32 wallpaper_id_hash = 8;
2366}
2367
David Chenc28b2bb2017-10-24 12:52:52 -07002368/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002369 * Logs when Settings UI has changed.
2370 *
2371 * Logged from:
2372 * packages/apps/Settings
2373 */
2374message SettingsUIChanged {
2375 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002376 * Where this SettingsUIChange event comes from. For example, if
2377 * it's a PAGE_VISIBLE event, where the page is opened from.
2378 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002379 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002380
2381 /**
2382 * What the UI action is.
2383 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002384 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002385
2386 /**
2387 * Where the action is happening
2388 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002389 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002390
2391 /**
2392 * What preference changed in this event.
2393 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002394 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002395
2396 /**
2397 * The new value of the changed preference.
2398 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002399 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002400}
2401
2402/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002403 * Logs basic timing information about touch events.
2404 * Reported at most every 5 minutes while device is being interacted with.
2405 *
2406 * Logged from:
2407 * frameworks/native/services/inputflinger
2408 */
2409message TouchEventReported {
2410 /**
2411 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2412 * and the standard deviation of latency between the kernel and framework
2413 * for touchscreen events. The units are microseconds.
2414 *
2415 * The number is measured as the difference between the time at which
2416 * the input event was received in the evdev driver,
2417 * and the time at which the input event was received in EventHub.
2418 */
2419 // Minimum value
2420 optional float latency_min_micros = 1;
2421 // Maximum value
2422 optional float latency_max_micros = 2;
2423 // Average value
2424 optional float latency_mean_micros = 3;
2425 // Standard deviation
2426 optional float latency_stdev_micros = 4;
2427}
2428
2429/**
Philip Quinn0eded622019-01-29 12:46:28 -08002430 * Logs gesture classification and timing information for touch events.
2431 *
2432 * Logged from:
2433 * frameworks/base/core/java/android/view/GestureDetector.java
2434 * frameworks/base/core/java/android/view/View.java
2435 */
2436message TouchGestureClassified {
2437 // The source of the classification (e.g. Java class name).
2438 optional string source = 1;
2439
2440 enum Classification {
2441 UNKNOWN_CLASSIFICATION = 0;
2442 SINGLE_TAP = 1;
2443 DOUBLE_TAP = 2;
2444 LONG_PRESS = 3;
2445 DEEP_PRESS = 4;
2446 SCROLL = 5;
2447 }
2448 // The classification of the gesture.
2449 optional Classification classification = 2;
2450
2451 // The interval from the start of a touch event stream until the
2452 // classification was made.
2453 optional int32 latency_millis = 3;
2454
2455 // The distance from the location of the first touch event to the
2456 // location of the touch event when the classification was made.
2457 optional float displacement_px = 4;
2458}
2459
2460/**
David Chenc28b2bb2017-10-24 12:52:52 -07002461 * Logs that a setting was updated.
2462 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002463 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002464 * The tag and is_default allow resetting of settings to default values based on the specified
2465 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2466 */
2467message SettingChanged {
2468 // The name of the setting.
2469 optional string setting = 1;
2470
2471 // The change being imposed on this setting. May represent a number, eg "3".
2472 optional string value = 2;
2473
2474 // The new value of this setting. For most settings, this is same as value. For some settings,
2475 // value is +X or -X where X represents an element in a set. For example, if the previous value
2476 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2477 // The +/- feature is currently only used for location_providers_allowed.
2478 optional string new_value = 3;
2479
2480 // The previous value of this setting.
2481 optional string prev_value = 4;
2482
2483 // The tag used with the is_default for resetting sets of settings. This is generally null.
2484 optional string tag = 5;
2485
Bookatz90867622018-01-31 15:05:57 -08002486 // True if this setting with tag should be resettable.
2487 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002488
David Chenbd789912018-03-16 17:19:55 -07002489 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002490 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002491
2492 enum ChangeReason {
2493 UPDATED = 1; // Updated can be an insertion or an update.
2494 DELETED = 2;
2495 }
2496 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002497}
Chenjie Yub3dda412017-10-24 13:41:59 -07002498
Chenjie Yu05013b32017-11-21 10:21:41 -08002499/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002500 * Logs activity going to foreground or background
2501 *
2502 * Logged from:
2503 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2504 */
2505message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002506 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002507 optional string pkg_name = 2;
2508 optional string class_name = 3;
2509
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002510 enum State {
2511 BACKGROUND = 0;
2512 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002513 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002514 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002515}
David Chenc8a43242017-10-17 16:23:28 -07002516
2517/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002518 * Logs when a volume entered low Storage state.
2519 * Logged from:
2520 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2521 */
2522message LowStorageStateChanged {
2523 // Volume that ran out of storage.
2524 optional string volume_description = 1;
2525
2526 enum State {
2527 UNKNOWN = 0;
2528 OFF = 1;
2529 ON = 2;
2530 }
2531 optional State state = 2;
2532}
2533
2534/**
2535 * Logs when an app is downgraded.
2536 * Logged from:
2537 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2538 */
2539message AppDowngraded {
2540 optional string package_name = 1;
2541 // Size of the package (all data) before being downgraded.
2542 optional int64 size_in_bytes_before = 2;
2543 // Size of the package (all data) after being downgraded.
2544 optional int64 size_in_bytes_after = 3;
2545
2546 optional bool aggressive = 4;
2547}
2548
2549/**
2550 * Logs when an app is optimized after being downgraded.
2551 * Logged from:
2552 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2553 */
2554message AppOptimizedAfterDowngraded {
2555 optional string package_name = 1;
2556}
2557
2558/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002559 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002560 * Logged from:
2561 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2562 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002563message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002564 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002565
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002566 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002567
2568 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002569 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002570 optional string process_name = 3;
2571
2572 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002573 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002574
2575 optional string package_name = 5;
2576
2577 enum InstantApp {
2578 UNAVAILABLE = 0;
2579 FALSE = 1;
2580 TRUE = 2;
2581 }
2582 optional InstantApp is_instant_app = 6;
2583
2584 enum ForegroundState {
2585 UNKNOWN = 0;
2586 BACKGROUND = 1;
2587 FOREGROUND = 2;
2588 }
2589 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002590
2591 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002592}
David Chen9e3808c2017-11-20 17:25:34 -08002593
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002594/**
2595 * Logs when a WTF (What a Terrible Failure) happened.
2596 * Logged from:
2597 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2598 */
2599message WTFOccurred {
2600 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002601
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002602 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002603
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002604 // The name of the process.
2605 // system_server if it is not by an app
2606 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002607
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002608 // The pid if available. -1 means not available.
2609 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002610
2611 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002612}
2613
2614/**
2615 * Logs when system server reports low memory.
2616 * Logged from:
2617 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2618 */
2619message LowMemReported {
2620}
2621
2622/**
2623 * Logs when an app ANR (App Not Responding) occurs.
2624 * Logged from:
2625 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2626 */
2627message ANROccurred {
2628 optional int32 uid = 1 [(is_uid) = true];
2629
2630 optional string process_name = 2;
2631
2632 optional string short_component_name = 3;
2633
2634 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002635
2636 enum InstantApp {
2637 UNAVAILABLE = 0;
2638 FALSE = 1;
2639 TRUE = 2;
2640 }
2641 optional InstantApp is_instant_app = 5;
2642
2643 enum ForegroundState {
2644 UNKNOWN = 0;
2645 BACKGROUND = 1;
2646 FOREGROUND = 2;
2647 }
2648 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002649
2650 optional android.server.ErrorSource error_source = 7;
2651
2652 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002653}
2654
Bookatza7020bd2018-08-28 16:29:35 -07002655/**
2656 * Logs when the vibrator state changes.
2657 * Logged from:
2658 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2659 */
2660message VibratorStateChanged {
2661 repeated AttributionNode attribution_node = 1;
2662
2663 enum State {
2664 OFF = 0;
2665 ON = 1;
2666 }
2667 optional State state = 2;
2668
2669 // Duration (in milliseconds) requested to keep the vibrator on.
2670 // Only applicable for State == ON.
2671 optional int64 duration_millis = 3;
2672}
2673
David Chen0a368b22017-12-06 16:28:16 -08002674/*
2675 * Allows other apps to push events into statsd.
2676 * Logged from:
2677 * frameworks/base/core/java/android/util/StatsLog.java
2678 */
David Chen0b5c90c2018-01-25 16:51:49 -08002679message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002680 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002681 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002682
2683 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2684 optional int32 label = 2;
2685
2686 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2687 // predicates for the metrics).
2688 enum State {
2689 UNKNOWN = 0;
2690 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2691 STOP = 2;
2692 START = 3;
2693 }
2694 optional State state = 3;
2695}
2696
David Chen9e3808c2017-11-20 17:25:34 -08002697/**
Bookatz7948c872018-09-04 12:58:33 -07002698 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2699 * For example, this could be due to the user manually changing the time.
2700 *
2701 * Logged from:
2702 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2703 */
2704message WallClockTimeShifted {
2705 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2706 optional int64 wall_clock_timestamp_millis = 1;
2707}
2708
2709/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002710 * Logs when statsd detects an anomaly.
2711 *
2712 * Logged from:
2713 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2714 */
2715message AnomalyDetected {
2716 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002717 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002718
Yangster-mac94e197c2018-01-02 16:03:03 -08002719 // Id of the config whose anomaly detection alert fired.
2720 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002721
Yangster-mac94e197c2018-01-02 16:03:03 -08002722 // Id of the alert (i.e. name of the anomaly that was detected).
2723 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002724}
2725
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002726message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002727 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002728 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002729
2730 // The app package name.
2731 optional string pkg_name = 2;
2732
2733 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002734 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002735 WARM = 1;
2736 HOT = 2;
2737 COLD = 3;
2738 }
2739 // The transition type.
2740 optional TransitionType type = 3;
2741
2742 // The activity name.
2743 optional string activity_name = 4;
2744
2745 // The name of the calling app. Empty if not set.
2746 optional string calling_pkg_name = 5;
2747
2748 // Whether the app is an instant app.
2749 optional bool is_instant_app = 6;
2750
2751 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002752 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002753
Bookatz80d11a02018-01-16 10:46:35 -08002754 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002755
David Chen0b5c90c2018-01-25 16:51:49 -08002756 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002757 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002758 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002759 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002760 optional int32 bind_application_delay_millis = 11;
2761 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002762
2763 // Empty if not set.
2764 optional string launch_token = 13;
2765
Calin Juravle759fbda2018-02-20 19:52:30 +00002766 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002767 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002768
2769 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002770 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002771}
2772
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002773message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002774 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002775 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002776
2777 // The app package name.
2778 optional string pkg_name = 2;
2779
2780 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002781 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002782 WARM = 1;
2783 HOT = 2;
2784 COLD = 3;
2785 }
2786 // The transition type.
2787 optional TransitionType type = 3;
2788
2789 // The activity name.
2790 optional string activity_name = 4;
2791}
2792
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002793message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002794 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002795 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002796
2797 // The app package name.
2798 optional string pkg_name = 2;
2799
2800 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002801 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002802 WITH_BUNDLE = 1;
2803 WITHOUT_BUNDLE = 2;
2804 }
2805 // The transition type.
2806 optional TransitionType type = 3;
2807
2808 // The activity name.
2809 optional string activity_name = 4;
2810
2811 optional bool transition_process_running = 5;
2812
2813 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002814 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002815}
2816
Bookatz8fcd09a2017-12-18 13:01:10 -08002817/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002818 * Logs a picture-in-picture action
2819 * Logged from:
2820 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2821 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2822 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2823 */
2824message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002825 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002826 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002827
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002828 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002829
Chenjie Yu52cacc62017-12-08 18:11:45 -08002830 enum State {
2831 ENTERED = 1;
2832 EXPANDED_TO_FULL_SCREEN = 2;
2833 MINIMIZED = 3;
2834 DISMISSED = 4;
2835 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002836 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002837}
2838
2839/**
Chenjie Yue8904192017-12-08 19:12:57 -08002840 * Logs overlay action
2841 * Logged from:
2842 * services/core/java/com/android/server/wm/Session.java
2843 */
2844message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002845 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002846
2847 optional string package_name = 2;
2848
2849 optional bool using_alert_window = 3;
2850
2851 enum State {
2852 ENTERED = 1;
2853 EXITED = 2;
2854 }
2855 optional State state = 4;
2856}
2857
Chenjie Yuccfe6452018-01-30 11:33:21 -08002858/*
2859 * Logs foreground service starts and stops.
2860 * Note that this is not when a service starts or stops, but when it is
2861 * considered foreground.
2862 * Logged from
2863 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2864 */
2865message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002866 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002867 // package_name + "/" + class_name
2868 optional string short_name = 2;
2869
2870 enum State {
2871 ENTER = 1;
2872 EXIT = 2;
2873 }
2874 optional State state = 3;
2875}
2876
Chenjie Yue8904192017-12-08 19:12:57 -08002877/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002878 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2879 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2880 * attributed back to the parent (host) uid. One example is Chrome.
2881 *
2882 * Logged from:
2883 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2884 */
2885message IsolatedUidChanged {
2886 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002887 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002888 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002889 optional int32 parent_uid = 1;
2890
2891 optional int32 isolated_uid = 2;
2892
2893 // We expect an isolated uid to be removed before if it's used for another parent uid.
2894 enum Event {
2895 REMOVED = 0;
2896 CREATED = 1;
2897 }
2898 optional Event event = 3;
2899}
2900
2901/*
2902 * Logs the reception of an incoming network packet causing the main system to wake up for
2903 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2904 * and processed by WakeupController.cpp.
2905 */
2906message PacketWakeupOccurred {
2907 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2908 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002909 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002910 // The interface name on which the packet was received.
2911 optional string iface = 2;
2912 // The ethertype value of the packet.
2913 optional int32 ethertype = 3;
2914 // String representation of the destination MAC address of the packet.
2915 optional string destination_hardware_address = 4;
2916 // String representation of the source address of the packet if this was an IP packet.
2917 optional string source_ip = 5;
2918 // String representation of the destination address of the packet if this was an IP packet.
2919 optional string destination_ip = 6;
2920 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2921 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2922 // families.
2923 optional int32 ip_next_header = 7;
2924 // The source port if this was a TCP or UDP packet.
2925 optional int32 source_port = 8;
2926 // The destination port if this was a TCP or UDP packet.
2927 optional int32 destination_port = 9;
2928}
2929
2930/*
2931 * Logs the memory stats for an app on startup.
2932 * Logged from:
2933 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2934 */
2935message AppStartMemoryStateCaptured {
2936 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002937 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002938
2939 // The process name.
2940 optional string process_name = 2;
2941
2942 // The activity name.
2943 optional string activity_name = 3;
2944
2945 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002946 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002947
2948 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002949 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002950
2951 // RSS
2952 optional int64 rss_in_bytes = 6;
2953
2954 // CACHE
2955 optional int64 cache_in_bytes = 7;
2956
2957 // SWAP
2958 optional int64 swap_in_bytes = 8;
2959}
2960
2961/*
2962 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2963 * for LMK event.
2964 * Logged from:
2965 * system/core/lmkd/lmkd.c
2966 */
2967message LmkStateChanged {
2968 enum State {
2969 UNKNOWN = 0;
2970 START = 1;
2971 STOP = 2;
2972 }
2973 optional State state = 1;
2974}
2975
2976/*
2977 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2978 * Logged from:
2979 * system/core/lmkd/lmkd.c
2980 */
2981message LmkKillOccurred {
2982 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002983 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002984
2985 // The process name.
2986 optional string process_name = 2;
2987
2988 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002989 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002990
2991 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002992 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002993
2994 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002995 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002996
2997 // RSS
2998 optional int64 rss_in_bytes = 6;
2999
3000 // CACHE
3001 optional int64 cache_in_bytes = 7;
3002
3003 // SWAP
3004 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003005
3006 // The elapsed real time of start of the process.
3007 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003008}
3009
Rajeev Kumar51b54602018-03-01 12:18:26 -08003010/*
3011 * Logs when the ActivityManagerService detects that an app died.
3012 *
3013 * Logged from:
3014 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3015 */
3016message AppDied {
3017 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003018 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003019}
3020
Howard Ro21a039c2018-08-06 14:55:47 -07003021/**
3022 * An atom for generic metrics logging. Available from Android Q.
3023 */
3024message GenericAtom {
3025 // The uid of the application that sent this custom atom.
3026 optional int32 uid = 1 [(is_uid) = true];
3027
3028 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003029 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003030}
3031
Tej Singhd6d6d772018-09-05 17:41:25 -07003032/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003033 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003034 *
3035 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003036 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003037 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003038message BiometricAcquired {
3039 // Biometric modality that was acquired.
3040 optional android.hardware.biometrics.ModalityEnum modality = 1;
3041 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3042 optional int32 user = 2;
3043 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3044 optional bool is_crypto = 3;
3045 // Action that the device is performing. Acquired messages are only expected for enroll and
3046 // authenticate. Other actions may indicate an error.
3047 optional android.hardware.biometrics.ActionEnum action = 4;
3048 // The client that this acquisition was received for.
3049 optional android.hardware.biometrics.ClientEnum client = 5;
3050 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3051 optional int32 acquire_info = 6;
3052 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3053 optional int32 acquire_info_vendor = 7;
Tej Singhd6d6d772018-09-05 17:41:25 -07003054}
3055
3056/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003057 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003058 *
3059 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003060 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003061 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003062message BiometricAuthenticated {
3063 // Biometric modality that was used.
3064 optional android.hardware.biometrics.ModalityEnum modality = 1;
3065 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3066 optional int32 user = 2;
3067 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3068 // storage.
3069 optional bool is_crypto = 3;
3070 // The client that this acquisition was received for.
3071 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003072 // If authentication requires user confirmation. See BiometricPrompt's
3073 // setRequireConfirmation(bool) method.
3074 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003075
Kevin Chyn1741a072019-01-17 11:54:40 -08003076 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003077 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003078 REJECTED = 1;
3079 PENDING_CONFIRMATION = 2;
3080 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003081 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003082
3083 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003084 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003085 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3086 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3087 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3088 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003089 optional int64 latency_millis = 7;
Kevin Chyn1741a072019-01-17 11:54:40 -08003090}
3091
3092/**
3093 * Logs when a biometric error occurs.
3094 *
3095 * Logged from:
3096 * frameworks/base/services/core/java/com/android/server/biometrics
3097 */
3098message BiometricErrorOccurred {
3099 // Biometric modality that was used.
3100 optional android.hardware.biometrics.ModalityEnum modality = 1;
3101 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3102 optional int32 user = 2;
3103 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3104 optional bool is_crypto = 3;
3105 // Action that the device is performing.
3106 optional android.hardware.biometrics.ActionEnum action = 4;
3107 // The client that this acquisition was received for.
3108 optional android.hardware.biometrics.ClientEnum client = 5;
3109 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3110 // are unique to modality.
3111 optional int32 error_info = 6;
3112 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3113 // by the vendor and not specified by the HIDL interface.
3114 optional int32 error_info_vendor = 7;
3115}
3116
3117/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003118 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003119 * Logged from:
3120 * frameworks/base/services/core/java/com/android/server/biometrics
3121 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003122message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003123 // Biometric modality.
3124 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003125 // Type of issue detected.
3126 optional android.hardware.biometrics.IssueEnum issue = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07003127}
Howard Ro688ae182018-09-25 00:09:36 -07003128
3129message Notification {
3130
3131 // Type of notification event.
3132 enum Type {
3133 TYPE_UNKNOWN = 0;
3134 // Notification became visible to the user.
3135 TYPE_OPEN = 1;
3136 // Notification became hidden.
3137 TYPE_CLOSE = 2;
3138 // Notification switched to detail mode.
3139 TYPE_DETAIL = 3;
3140 // Notification was clicked.
3141 TYPE_ACTION = 4;
3142 // Notification was dismissed.
3143 TYPE_DISMISS = 5;
3144 // Notification switched to summary mode. The enum value of 14 is to
3145 // match that of metrics_constants.
3146 TYPE_COLLAPSE = 14;
3147 }
3148 optional Type type = 1;
3149
3150 // Package name associated with the notification.
3151 optional string package_name = 2;
3152
3153 // Tag associated with notification.
3154 optional string tag = 3;
3155
3156 // Application-supplied ID associated with the notification.
3157 optional int32 id = 4;
3158
3159 // Index of notification in the notification panel.
3160 optional int32 shade_index = 5;
3161
3162 // The number of notifications in the notification panel.
3163 optional int32 shade_count = 6;
3164
3165 // Importance for the notification.
3166 optional int32 importance = 7;
3167
3168 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07003169 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07003170
3171 // Importance for the notification channel.
3172 optional int32 channel_importance = 9;
3173
Howard Ro183c2bd2018-10-18 13:52:10 -07003174 // Application-supplied ID associated with the notifications group.
3175 optional string group_id = 10;
3176
Howard Ro688ae182018-09-25 00:09:36 -07003177 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07003178 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07003179
Howard Ro183c2bd2018-10-18 13:52:10 -07003180 // Reason for dismissal of a notification. This field is only meaningful for
3181 // TYPE_DISMISS events.
3182 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07003183
Howard Ro183c2bd2018-10-18 13:52:10 -07003184 // The first post time of notification, stable across updates.
3185 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07003186
Howard Ro183c2bd2018-10-18 13:52:10 -07003187 // The most recent interruption time, or the creation time if no updates.
3188 // Differs from update_millis because updates are filtered based on whether
3189 // they actually interrupted the user.
3190 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07003191
Howard Ro183c2bd2018-10-18 13:52:10 -07003192 // The most recent update time, or the creation time if no updates.
3193 optional int64 update_millis = 15;
3194
3195 // The most recent visibility event.
3196 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07003197}
3198
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003199/*
Tej Singh0d176952019-01-16 19:10:54 -08003200 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003201 */
Tej Singh0d176952019-01-16 19:10:54 -08003202message FlagFlipUpdateOccurred {
3203 // If the event is from a flag config package, specify the package name.
3204 optional string flag_flip_package_name = 1;
3205
3206 // The order id of the package
3207 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003208}
3209
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003210/**
3211 * Potential experiment ids that goes with a train install.
3212 */
3213message TrainExperimentIds {
3214 repeated int64 experiment_id = 1;
3215}
3216
Yangster-macb89807e2018-11-15 21:10:57 -08003217/*
3218 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003219 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003220 */
3221message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003222 // Name of the train.
3223 optional string train_name = 1;
3224 // Version code for a "train" of packages that need to be installed atomically
3225 optional int64 train_version_code = 2;
3226 // After installation of this package, device requires a restart.
3227 optional bool requires_staging = 3;
3228 // Rollback should be enabled for this install.
3229 optional bool rollback_enabled = 4;
3230 // Requires low latency monitoring if possible.
3231 optional bool requires_low_latency_monitor = 5;
3232
Yangster-macb89807e2018-11-15 21:10:57 -08003233 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003234 UNKNOWN = 0;
3235 INSTALL_REQUESTED = 1;
3236 INSTALL_STARTED = 2;
3237 INSTALL_STAGED_NOT_READY = 3;
3238 INSTALL_STAGED_READY = 4;
3239 INSTALL_SUCCESS = 5;
3240 INSTALL_FAILURE = 6;
3241 INSTALL_CANCELLED = 7;
3242 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003243 INSTALLER_ROLLBACK_INITIATED = 9;
3244 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3245 INSTALLER_ROLLBACK_STAGED = 11;
3246 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3247 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3248 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3249 INSTALLER_ROLLBACK_SUCCESS = 15;
3250 INSTALLER_ROLLBACK_FAILURE = 16;
3251 INSTALLER_ROLLBACK_CANCEL_STAGED_REMOVE_FROM_QUEUE = 17;
3252 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_INITIATED = 18;
3253 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_SUCCESS = 19;
3254 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_FAILURE = 20;
Yangster-macb89807e2018-11-15 21:10:57 -08003255 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003256 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003257 // Possible experiment ids for monitoring this push.
3258 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3259 // user id
3260 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003261}
3262
Maggie Whitefc1aa592018-11-28 21:55:23 -08003263/** Represents USB port overheat event. */
3264message UsbPortOverheatEvent {
3265 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3266 optional int32 plug_temperature_deci_c = 1;
3267
3268 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3269 optional int32 max_temperature_deci_c = 2;
3270
3271 /* Time between USB plug event and overheat threshold trip, in seconds. */
3272 optional int32 time_to_overheat_secs = 3;
3273
3274 /* Time between overheat threshold trip and hysteresis, in seconds. */
3275 optional int32 time_to_hysteresis_secs = 4;
3276
3277 /* Time between hysteresis and active mitigation ending, in seconds. */
3278 optional int32 time_to_inactive_secs = 5;
3279};
3280
Maggie White8735b852019-01-18 11:40:49 -08003281/**
3282 * Logs total effective full charge and discharge cycles on a battery.
3283 * Here are some examples of one effective cycle:
3284 * 1) the battery charges from 0% to 100% and drains back to 0%,
3285 * 2) charging from 50% to 100% and draining back to 50% twice.
3286 * Pulled from:
3287 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3288 */
3289message BatteryCycleCount {
3290 /* Number of total charge and discharge cycles on the system battery. */
3291 optional int32 cycle_count = 1;
3292}
3293
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003294/**
3295 * Logs that an SD card is mounted and information about it, its type (public or private) and the
3296 * size in bytes.
3297 * Pulled from:
3298 * StatsCompanionService
3299 */
3300
3301message SDCardInfo {
3302
3303 enum Type {
3304 UNKNOWN = 0;
3305 TYPE_PUBLIC = 1;
3306 TYPE_PRIVATE = 2;
3307 OTHERS = 3;
3308 }
3309
3310 // Type of the SD card: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3311 optional Type type = 1;
3312 // Total size of the sd card in bytes.
3313 optional int64 size_bytes = 2;
3314}
3315
Yangster-macb89807e2018-11-15 21:10:57 -08003316/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003317 * Logs when a connection becomes available and lost.
3318 * Logged in StatsCompanionService.java
3319 */
3320message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003321 // Id of the network.
3322 optional int32 net_id = 1;
3323
3324 enum State {
3325 UNKNOWN = 0;
3326 CONNECTED = 1;
3327 DISCONNECTED = 2;
3328 }
3329 // Connected state of a network.
3330 optional State state = 2;
3331}
3332
3333/**
3334 * Logs when a service starts and stops.
3335 * Logged from:
3336 * services/core/java/com/android/server/am/ActiveServices.java
3337 */
3338message ServiceStateChanged {
3339
3340 optional int32 uid = 1 [(is_uid) = true];
3341
3342 optional string package_name = 2;
3343
3344 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003345
3346 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003347 START = 1;
3348 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003349 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003350
3351 optional State state = 4;
3352}
3353
3354/**
3355 * Logs when a service is launched.
3356 * Logged from:
3357 * services/core/java/com/android/server/am/ActiveServices.java
3358 */
3359message ServiceLaunchReported {
3360
3361 optional int32 uid = 1 [(is_uid) = true];
3362
3363 optional string package_name = 2;
3364
3365 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003366}
Howard Ro688ae182018-09-25 00:09:36 -07003367
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003368/**
3369 * Logs when a hidden API is used.
3370 *
3371 * Logged from:
3372 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3373 */
3374message HiddenApiUsed {
3375 // The uid of the app making the hidden access.
3376 optional int32 uid = 1 [(is_uid) = true];
3377
3378 // Signature of the method or field accessed.
3379 optional string signature = 2;
3380
3381 enum AccessMethod {
3382 NONE = 0;
3383 REFLECTION = 1;
3384 JNI = 2;
3385 LINKING = 3;
3386 }
3387
3388 // Type of access.
3389 optional AccessMethod access_method = 3;
3390
3391 // Whether the access was prevented or not.
3392 optional bool access_denied = 4;
3393}
3394
Chenjie Yubbcbc602018-02-05 16:51:52 -08003395//////////////////////////////////////////////////////////////////////
3396// Pulled atoms below this line //
3397//////////////////////////////////////////////////////////////////////
3398
3399/**
David Chenc8a43242017-10-17 16:23:28 -07003400 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3401 *
3402 * Pulled from:
3403 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3404 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003405message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003406 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003407
3408 optional int64 rx_bytes = 2;
3409
3410 optional int64 rx_packets = 3;
3411
3412 optional int64 tx_bytes = 4;
3413
3414 optional int64 tx_packets = 5;
3415}
3416
3417/**
3418 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3419 *
3420 * Pulled from:
3421 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3422 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003423message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003424 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003425
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003426 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3427 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003428
3429 optional int64 rx_bytes = 3;
3430
3431 optional int64 rx_packets = 4;
3432
3433 optional int64 tx_bytes = 5;
3434
3435 optional int64 tx_packets = 6;
3436}
3437
3438/**
3439 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3440 *
3441 * Pulled from:
3442 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3443 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003444message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003445 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003446
3447 optional int64 rx_bytes = 2;
3448
3449 optional int64 rx_packets = 3;
3450
3451 optional int64 tx_bytes = 4;
3452
3453 optional int64 tx_packets = 5;
3454}
3455
3456/**
3457 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3458 *
3459 * Pulled from:
3460 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3461 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003462message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003463 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003464
Yao Chenc40a19d2018-03-15 16:48:25 -07003465 // 1 denotes foreground and 0 denotes background. This is called Set in
3466 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003467 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003468
3469 optional int64 rx_bytes = 3;
3470
3471 optional int64 rx_packets = 4;
3472
3473 optional int64 tx_bytes = 5;
3474
3475 optional int64 tx_packets = 6;
3476}
3477
3478/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003479 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3480 *
3481 * Pulled from:
3482 * StatsCompanionService
3483 */
3484message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003485 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003486
3487 optional int64 rx_bytes = 2;
3488
3489 optional int64 tx_bytes = 3;
3490}
3491
3492/**
David Chenc8a43242017-10-17 16:23:28 -07003493 * Pulls the kernel wakelock durations. This atom is adapted from
3494 * android/internal/os/KernelWakelockStats.java
3495 *
3496 * Pulled from:
3497 * StatsCompanionService using KernelWakelockReader.
3498 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003499message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003500 optional string name = 1;
3501
3502 optional int32 count = 2;
3503
3504 optional int32 version = 3;
3505
Yangster-maca8a30442018-10-13 23:46:34 -07003506 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003507}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003508
Chenjie Yu05013b32017-11-21 10:21:41 -08003509/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003510 * Pulls low power state information. If power.stats HAL is not available, this
3511 * includes platform and subsystem sleep state information,
3512 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3513 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003514 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003515 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003516 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3517 * as defined in:
3518 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003519 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003520message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003521 // Subsystem name
3522 optional string subsystem_name = 1;
3523 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3524 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003525 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3526 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003527 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003528 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003529 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003530 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003531 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003532}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003533
Chenjie Yu05013b32017-11-21 10:21:41 -08003534/**
Bookatz92da2832018-11-01 18:10:03 -07003535 * Pulls on-device power measurement information.
3536 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3537 * Pulled from:
3538 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3539 */
3540message OnDevicePowerMeasurement {
3541 // Name of the subsystem (to which the rail belongs).
3542 optional string subsystem_name = 1;
3543
3544 // Rail name. The rail lies within the subsystem.
3545 optional string rail_name = 2;
3546
3547 // Time (in ms since boot) at which the rail energy value was measured.
3548 // This may differ slightly from the time that statsd logs this information.
3549 optional uint64 measurement_timestamp_millis = 3;
3550
3551 // Accumulated energy used via the rail since device boot in uWs.
3552 optional uint64 energy_microwatt_secs = 4;
3553}
3554
3555/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003556 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003557 * Pulls the time the cpu spend on the frequency index. Frequency index
3558 * starts from highest to lowest. The value should be monotonically
3559 * increasing since boot. However, if there is a cpu
3560 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003561 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003562message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003563 optional uint32 cluster = 1;
3564 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003565 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003566}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003567
Chenjie Yu05013b32017-11-21 10:21:41 -08003568/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003569 * Pulls Cpu Time Per Uid.
3570 * Note that isolated process uid time should be attributed to host uids.
3571 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003572message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003573 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003574 optional uint64 user_time_micros = 2;
3575 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003576}
3577
3578/**
3579 * Pulls Cpu Time Per Uid per frequency.
3580 * Note that isolated process uid time should be attributed to host uids.
3581 * For each uid, we order the time by descending frequencies.
3582 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003583message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003584 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003585 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003586 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003587}
Hugo Benichi884970e2017-11-14 22:42:46 +09003588
Chenjie Yu05013b32017-11-21 10:21:41 -08003589/**
3590 * Pulls Wifi Controller Activity Energy Info
3591 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003592message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003593 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003594 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003595 // stack reported state
3596 // TODO: replace this with proto enum
3597 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003598 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003599 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003600 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003601 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003602 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003603 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003604 // product of current(mA), voltage(V) and time(ms)
3605 optional uint64 controller_energy_used = 6;
3606}
3607
3608/**
3609 * Pulls Modem Activity Energy Info
3610 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003611message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003612 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003613 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003614 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003615 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003616 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003617 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003618 /**
3619 * Tx power index
3620 * index 0 = tx_power < 0dBm
3621 * index 1 = 0dBm < tx_power < 5dBm
3622 * index 2 = 5dBm < tx_power < 15dBm
3623 * index 3 = 15dBm < tx_power < 20dBm
3624 * index 4 = tx_power > 20dBm
3625 */
3626 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003627 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003628 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003629 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003630 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003631 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003632 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003633 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003634 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003635 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003636 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003637 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003638 // product of current(mA), voltage(V) and time(ms)
3639 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003640}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003641
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003642/**
3643 * Pulls Bluetooth Activity Energy Info
3644 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3645 */
3646message BluetoothActivityInfo {
3647 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003648 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003649 // bluetooth stack state
3650 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003651 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003652 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003653 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003654 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003655 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003656 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003657 // product of current(mA), voltage(V) and time(ms)
3658 optional uint64 energy_used = 6;
3659}
3660
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003661/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003662 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003663 *
3664 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003665 */
3666message ProcessMemoryState {
3667 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003668 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003669
3670 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003671 // Usually package name, "system" for system server.
3672 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003673 optional string process_name = 2;
3674
Rafal Slawikda51b932018-12-13 16:31:33 +00003675 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003676 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003677
3678 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003679 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003680
3681 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003682 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003683
Rajeev Kumar90235992018-01-29 11:06:48 -08003684 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003685 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3686 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003687 optional int64 rss_in_bytes = 6;
3688
3689 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003690 // Value is read from memory.stat, field total_cache if per-app memory
3691 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003692 optional int64 cache_in_bytes = 7;
3693
3694 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003695 // Value is read from memory.stat, field total_swap if per-app memory
3696 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003697 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003698
Rafal Slawikd03ae422018-11-20 11:27:45 +00003699 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003700 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003701
3702 // Elapsed real time when the process started.
3703 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3704 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003705}
3706
3707/*
Rafal Slawik08621582018-10-15 14:53:07 +01003708 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003709 *
3710 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003711 */
3712message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003713 // The uid if available. -1 means not available.
3714 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003715
Rafal Slawikbf67d072018-10-23 11:07:54 +01003716 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003717 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003718 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003719
Rafal Slawikbf67d072018-10-23 11:07:54 +01003720 // # of page-faults
3721 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003722
Rafal Slawikbf67d072018-10-23 11:07:54 +01003723 // # of major page-faults
3724 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003725
Rafal Slawikbf67d072018-10-23 11:07:54 +01003726 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003727 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003728 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003729
Rafal Slawikd03ae422018-11-20 11:27:45 +00003730 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003731 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003732
3733 // Elapsed real time when the process started.
3734 // Value is read from /proc/PID/stat, field 22.
3735 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01003736}
3737
3738/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003739 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003740 *
3741 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3742 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003743 *
3744 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003745 */
3746message ProcessMemoryHighWaterMark {
3747 // The uid if available. -1 means not available.
3748 optional int32 uid = 1 [(is_uid) = true];
3749
Rafal Slawikda51b932018-12-13 16:31:33 +00003750 // The process name.
3751 // Usually package name or process cmdline.
3752 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003753 optional string process_name = 2;
3754
3755 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3756 // /proc/PID/status.
3757 optional int64 rss_high_water_mark_in_bytes = 3;
3758}
3759
3760/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003761 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003762 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003763message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003764 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003765}
3766
3767/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003768 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003769 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003770message SystemUptime {
3771 // Milliseconds since the system was booted.
3772 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3773 // for external input).
3774 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003775 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003776}
3777
3778/*
3779 * Reads from /proc/uid_concurrent_active_time which has the format:
3780 * active: X (X is # cores)
3781 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3782 * [uid1]: [time-0] [time-1] [time-2] ... ...
3783 * ...
3784 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3785 * The file contains a monotonically increasing count of time for a single boot.
3786 */
3787message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003788 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003789 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003790}
3791
3792/**
3793 * Reads from /proc/uid_concurrent_policy_time which has the format:
3794 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3795 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3796 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3797 * ...
3798 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3799 * The file contains a monotonically increasing count of time for a single boot.
3800 */
3801message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003802 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003803 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003804 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003805}
3806
3807/*
3808 * Pulls free disk space, for data, system partition and temporary directory.
3809 */
3810message DiskSpace {
3811 // available bytes in data partition
3812 optional uint64 data_available_bytes = 1;
3813 // available bytes in system partition
3814 optional uint64 system_available_bytes = 2;
3815 // available bytes in download cache or temp directories
3816 optional uint64 temp_available_bytes = 3;
3817}
Tej Singhbf972d92018-01-10 20:51:13 -08003818
3819/**
3820 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003821 *
3822 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003823 */
3824message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003825 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003826}
3827
3828/**
3829 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003830 * Pulled from:
3831 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003832 */
3833message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003834 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003835}
3836
3837/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003838 * Pulls battery voltage.
3839 * Pulled from:
3840 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3841 */
3842message BatteryVoltage {
3843 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003844 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003845}
3846
3847/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003848 * Pulls battery level (percent full, from 0 to 100).
3849 *
3850 * Pulled from:
3851 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3852 */
3853message BatteryLevel {
3854 // Battery level. Should be in [0, 100].
3855 optional int32 battery_level = 1;
3856}
3857
3858/**
Tej Singhd89137e2018-03-26 14:51:40 -07003859 * Pulls the temperature of various parts of the device.
3860 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003861 *
3862 * Pulled from:
3863 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3864 */
3865message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003866 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003867 optional android.os.TemperatureTypeEnum sensor_location = 1;
3868
3869 // The name of the temperature source. Eg. CPU0
3870 optional string sensor_name = 2;
3871
Tej Singhd89137e2018-03-26 14:51:40 -07003872 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003873 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003874 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003875}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003876
3877/**
3878 * Pulls the statistics of calls to Binder.
3879 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003880 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3881 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003882 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003883 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003884 */
3885message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003886 // UID of the process responsible for the binder transaction. It will be set if the process
3887 // executing the binder transaction attribute the transaction to another uid using
3888 // Binder.setThreadWorkSource().
3889 //
3890 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003891 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003892 // UID of the process executing the binder transaction.
3893 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003894 // Fully qualified class name of the API call.
3895 //
3896 // This is a system server class name.
3897 //
3898 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3899 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3900 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3901 // commonly used APIs.
3902 optional string service_class_name = 2;
3903 // Method name of the API call. It can also be a transaction code if we cannot
3904 // resolve it to a name. See Binder#getTransactionName.
3905 //
3906 // This is a system server method name.
3907 optional string service_method_name = 3;
3908 // Total number of API calls.
3909 optional int64 call_count = 4;
3910 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3911 optional bool screen_interactive = 13;
3912 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3913 // call_count will be equal to recorded_call_count.
3914 //
3915 // If recorded_call_count is different than call_count, it means data collection has been
3916 // sampled. All the fields below will be sampled in this case.
3917 optional int64 recorded_call_count = 12;
3918 // Number of exceptions thrown by the API.
3919 optional int64 recorded_exception_count = 5;
3920 // Total latency of all API calls.
3921 // Average can be computed using total_latency_micros / recorded_call_count.
3922 optional int64 recorded_total_latency_micros = 6;
3923 // Maximum latency of one API call.
3924 optional int64 recorded_max_latency_micros = 7;
3925 // Total CPU usage of all API calls.
3926 // Average can be computed using total_cpu_micros / recorded_call_count.
3927 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3928 optional int64 recorded_total_cpu_micros = 8;
3929 // Maximum CPU usage of one API call.
3930 optional int64 recorded_max_cpu_micros = 9;
3931 // Maximum parcel reply size of one API call.
3932 optional int64 recorded_max_reply_size_bytes = 10;
3933 // Maximum parcel request size of one API call.
3934 optional int64 recorded_max_request_size_bytes = 11;
3935}
3936
3937/**
3938 * Pulls the statistics of exceptions during calls to Binder.
3939 *
3940 * Binder stats are cumulative from boot unless somebody reset the data using
3941 * > adb shell dumpsys binder_calls_stats --reset
3942 */
3943message BinderCallsExceptions {
3944 // Exception class name, e.g. java.lang.IllegalArgumentException.
3945 //
3946 // This is an exception class name thrown by the system server.
3947 optional string exception_class_name = 1;
3948 // Total number of exceptions.
3949 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003950}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003951
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003952/**
3953 * Pulls the statistics of message dispatching on HandlerThreads.
3954 *
3955 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
3956 * config on the device.
3957 *
3958 * Next tag: 11
3959 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003960message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01003961 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003962 optional int32 uid = 1 [(is_uid) = true];
3963
3964 // Fully qualified class name of the handler target class.
3965 //
3966 // This field does not contain PII. This is a system server class name.
3967 optional string handler_class_name = 2;
3968
3969 // The name of the thread that runs the Looper.
3970 //
3971 // This field does not contain PII. This is a system server thread name.
3972 optional string looper_thread_name = 3;
3973
3974 // The name of the dispatched message.
3975 //
3976 // This field does not contain PII. This is a system server constant or class
3977 // name.
3978 optional string message_name = 4;
3979
3980 // Total number of successfully dispatched messages.
3981 optional int64 message_count = 5;
3982
3983 // Total number of messages that failed dispatching.
3984 optional int64 exception_count = 6;
3985
3986 // Total number of processed messages we have data recorded for. If we
3987 // collected data for all the messages, message_count will be equal to
3988 // recorded_message_count.
3989 //
3990 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003991 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003992 optional int64 recorded_message_count = 7;
3993
3994 // Total latency of all processed messages.
3995 // Average can be computed using recorded_total_latency_micros /
3996 // recorded_message_count.
3997 optional int64 recorded_total_latency_micros = 8;
3998
3999 // Total CPU usage of all processed message.
4000 // Average can be computed using recorded_total_cpu_micros /
4001 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004002 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004003 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004004
4005 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4006 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004007
4008 // Max recorded CPU usage of all processed messages.
4009 optional int64 recorded_max_cpu_micros = 11;
4010
4011 // Max recorded latency of all processed messages.
4012 optional int64 recorded_max_latency_micros = 12;
4013
4014 // Total number of messages we tracked the dispatching delay for. If we
4015 // collected data for all the messages, message_count will be equal to
4016 // recorded_delay_message_count.
4017 //
4018 // If recorded_delay_message_count is different than message_count, it means data
4019 // collection has been sampled or/and not all messages specified the target dispatch time.
4020 // The fields below will be sampled in this case.
4021 optional int64 recorded_delay_message_count = 13;
4022
4023 // Total dispatching delay of all processed messages.
4024 // Calculated as a difference between the target dispatching time (Message.when)
4025 // and the actual dispatching time.
4026 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4027 optional int64 recorded_total_delay_millis = 14;
4028
4029 // Max dispatching delay of all processed messages.
4030 // Calculated as a difference between the target dispatching time (Message.when)
4031 // and the actual dispatching time.
4032 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004033}
Tej Singh86dc9db2018-09-06 00:39:57 +00004034
4035/**
4036 * Pulls disk information, such as write speed and latency.
4037 */
4038message DiskStats {
4039 // Time taken to open, write 512B to, and close a file.
4040 // -1 if error performing the check.
4041 optional int64 data_write_latency_millis = 1;
4042
4043 optional bool file_based_encryption = 2;
4044
4045 // Recent disk write speed in kB/s.
4046 // -1 if error querying storageed.
4047 // 0 if data is unavailable.
4048 optional int32 recent_disk_write_speed = 3;
4049}
4050
4051
4052/**
4053 * Free and total bytes of the Data, Cache, and System partition.
4054 */
4055message DirectoryUsage {
4056 enum Directory {
4057 UNKNOWN = 0;
4058 DATA = 1;
4059 CACHE = 2;
4060 SYSTEM = 3;
4061 }
4062 optional Directory directory = 1;
4063 optional int64 free_bytes = 2;
4064 optional int64 total_bytes = 3;
4065}
4066
4067
4068/**
4069 * Size of an application: apk size, data size, and cache size.
4070 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4071 * Information is only reported for apps with the primary user (user 0).
4072 * Sizes are aggregated by package name.
4073 */
4074message AppSize {
4075 // Including uids will involve modifying diskstats logic.
4076 optional string package_name = 1;
4077 // App size in bytes. -1 if unavailable.
4078 optional int64 app_size_bytes = 2;
4079 // App data size in bytes. -1 if unavailable.
4080 optional int64 app_data_size_bytes = 3;
4081 // App cache size in bytes. -1 if unavailable.
4082 optional int64 app_cache_size_bytes = 4;
4083 // Time that the cache file was produced.
4084 // Uses System.currentTimeMillis(), which is wall clock time.
4085 optional int64 cache_time_millis = 5;
4086}
4087
4088
4089/**
4090 * Size of a particular category. Eg: photos, videos.
4091 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4092 */
4093message CategorySize {
4094 enum Category {
4095 UNKNOWN = 0;
4096 APP_SIZE = 1;
4097 APP_DATA_SIZE = 2;
4098 APP_CACHE_SIZE = 3;
4099 PHOTOS = 4;
4100 VIDEOS = 5;
4101 AUDIO = 6;
4102 DOWNLOADS = 7;
4103 SYSTEM = 8;
4104 OTHER = 9;
4105 }
4106 optional Category category = 1;
4107 // Category size in bytes.
4108 optional int64 size_bytes = 2;
4109 // Time that the cache file was produced.
4110 // Uses System.currentTimeMillis(), which is wall clock time.
4111 optional int64 cache_time_millis = 3;
4112}
Tej Singhd6d6d772018-09-05 17:41:25 -07004113
4114/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004115 * Pulls per uid I/O stats. The stats are cumulative since boot.
4116 *
4117 * Read/write bytes are I/O events from a storage device
4118 * Read/write chars are data requested by read/write syscalls, and can be
4119 * satisfied by caching.
4120 *
4121 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4122 */
4123message DiskIo {
4124 optional int32 uid = 1 [(is_uid) = true];
4125 optional int64 fg_chars_read = 2;
4126 optional int64 fg_chars_write = 3;
4127 optional int64 fg_bytes_read = 4;
4128 optional int64 fg_bytes_write = 5;
4129 optional int64 bg_chars_read = 6;
4130 optional int64 bg_chars_write = 7;
4131 optional int64 bg_bytes_read = 8;
4132 optional int64 bg_bytes_write = 9;
4133 optional int64 fg_fsync = 10;
4134 optional int64 bg_fsync= 11;
4135}
4136
4137
4138/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004139 * Pulls the number of fingerprints for each user.
4140 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004141 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004142 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004143message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004144 // The associated user. Eg: 0 for owners, 10+ for others.
4145 // Defined in android/os/UserHandle.java
4146 optional int32 user = 1;
4147 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004148 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004149}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004150
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004151/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004152 * Pulls the number of faces for each user.
4153 *
4154 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4155 */
4156message NumFacesEnrolled {
4157 // The associated user. Eg: 0 for owners, 10+ for others.
4158 // Defined in android/os/UserHandle.java
4159 optional int32 user = 1;
4160 // Number of faces registered to that user.
4161 optional int32 num_faces_enrolled = 2;
4162}
4163/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004164 * A mapping of role holder -> role
4165 */
4166message RoleHolder {
4167 // uid of the role holder
4168 optional int32 uid = 1 [(is_uid) = true];
4169
4170 // package name of the role holder
4171 optional string package_name = 2;
4172
4173 // the role held
4174 optional string role = 3;
4175}
4176
Yangsteraf9aee72018-10-12 09:26:16 -07004177message AggStats {
4178 optional int64 min = 1;
4179
4180 optional int64 average = 2;
4181
4182 optional int64 max = 3;
4183}
4184
4185message ProcessStatsStateProto {
4186 optional android.service.procstats.ScreenState screen_state = 1;
4187
4188 optional android.service.procstats.MemoryState memory_state = 2;
4189
4190 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4191 // and not frameworks/base/core/java/android/app/ActivityManager.java
4192 optional android.service.procstats.ProcessState process_state = 3;
4193
4194 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004195 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004196
4197 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004198 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004199
4200 // # of samples taken
4201 optional int32 sample_size = 5;
4202
4203 // PSS is memory reserved for this process
4204 optional AggStats pss = 6;
4205
4206 // USS is memory shared between processes, divided evenly for accounting
4207 optional AggStats uss = 7;
4208
4209 // RSS is memory resident for this process
4210 optional AggStats rss = 8;
4211}
4212
4213// Next Tag: 7
4214message ProcessStatsProto {
4215 // Name of process.
4216 optional string process = 1;
4217
4218 // Uid of the process.
4219 optional int32 uid = 2;
4220
4221 // Information about how often kills occurred
4222 message Kill {
4223 // Count of excessive CPU kills
4224 optional int32 cpu = 1;
4225
4226 // Count of kills when cached
4227 optional int32 cached = 2;
4228
4229 // PSS stats during cached kill
4230 optional AggStats cached_pss = 3;
4231 }
4232 optional Kill kill = 3;
4233
4234 // Time and memory spent in various states.
4235 repeated ProcessStatsStateProto states = 5;
4236
4237 // Total time process has been running... screen_state, memory_state, and process_state
4238 // will not be set.
4239 optional ProcessStatsStateProto total_running_state = 6;
4240}
4241
4242message PackageServiceOperationStatsProto {
4243 // Operate enum: Started, Foreground, Bound, Executing
4244 optional android.service.procstats.ServiceOperationState operation = 1;
4245
4246 // Number of times the service was in this operation.
4247 optional int32 count = 2;
4248
4249 // Information about a state the service can be in.
4250 message StateStats {
4251 // Screen state enum.
4252 optional android.service.procstats.ScreenState screen_state = 1;
4253 // Memory state enum.
4254 optional android.service.procstats.MemoryState memory_state = 2;
4255
4256 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004257 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004258 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004259 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004260 }
4261 repeated StateStats state_stats = 3;
4262}
4263
4264message PackageServiceStatsProto {
4265 // Name of service component.
4266 optional string service_name = 1;
4267
4268 // The operation stats.
4269 // The package_name, package_uid, package_version, service_name will not be set to save space.
4270 repeated PackageServiceOperationStatsProto operation_stats = 2;
4271}
4272
4273message PackageAssociationSourceProcessStatsProto {
4274 // Uid of the process.
4275 optional int32 process_uid = 1;
4276 // Process name.
4277 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004278 // Package name.
4279 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004280 // Total count of the times this association appeared.
4281 optional int32 total_count = 3;
4282
4283 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004284 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004285
4286 // Total count of the times this association became actively impacting its target process.
4287 optional int32 active_count = 5;
4288
4289 // Information on one source in this association.
4290 message StateStats {
4291 // Process state enum.
4292 optional android.service.procstats.ProcessState process_state = 1;
4293 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004294 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004295 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004296 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004297 }
4298 repeated StateStats active_state_stats = 6;
4299}
4300
4301message PackageAssociationProcessStatsProto {
4302 // Name of the target component.
4303 optional string component_name = 1;
4304 // Information on one source in this association.
4305 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4306}
4307
4308
4309message ProcessStatsPackageProto {
4310 // Name of package.
4311 optional string package = 1;
4312
4313 // Uid of the package.
4314 optional int32 uid = 2;
4315
4316 // Version of the package.
4317 optional int64 version = 3;
4318
4319 // Stats for each process running with the package loaded in to it.
4320 repeated ProcessStatsProto process_stats = 4;
4321
4322 // Stats for each of the package's services.
4323 repeated PackageServiceStatsProto service_stats = 5;
4324
4325 // Stats for each association with the package.
4326 repeated PackageAssociationProcessStatsProto association_stats = 6;
4327}
4328
4329message ProcessStatsSectionProto {
4330 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004331 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004332
4333 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004334 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004335
4336 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004337 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004338
4339 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004340 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004341
4342 // System runtime library. e.g. "libdvm.so", "libart.so".
4343 optional string runtime = 5;
4344
4345 // whether kernel reports swapped pss.
4346 optional bool has_swapped_pss = 6;
4347
4348 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4349 enum Status {
4350 STATUS_UNKNOWN = 0;
4351 STATUS_COMPLETE = 1;
4352 STATUS_PARTIAL = 2;
4353 STATUS_SHUTDOWN = 3;
4354 STATUS_SYSPROPS = 4;
4355 }
4356 repeated Status status = 7;
4357
Chenjie Yub2ecc792019-01-17 10:27:26 -08004358 // Number of pages available of various types and sizes, representation fragmentation.
4359 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4360
Yangsteraf9aee72018-10-12 09:26:16 -07004361 // Stats for each process.
4362 repeated ProcessStatsProto process_stats = 8;
4363
4364 // Stats for each package.
4365 repeated ProcessStatsPackageProto package_stats = 9;
4366}
4367
Chenjie Yub2ecc792019-01-17 10:27:26 -08004368message ProcessStatsAvailablePagesProto {
4369 // Node these pages are in (as per /proc/pagetypeinfo)
4370 optional int32 node = 1;
4371
4372 // Zone these pages are in (as per /proc/pagetypeinfo)
4373 optional string zone = 2;
4374
4375 // Label for the type of these pages (as per /proc/pagetypeinfo)
4376 optional string label = 3;
4377
4378 // Distribution of number of pages available by order size. First entry in array is
4379 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4380 repeated int32 pages_per_order = 4;
4381}
4382
Chenjie Yu12e5e672018-09-14 15:54:59 -07004383/**
4384 * Pulled from ProcessStatsService.java
4385 */
4386message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004387 optional ProcessStatsSectionProto proc_stats_section = 1;
4388}
4389
Chenjie Yuf910b7802019-01-11 16:08:20 -08004390/**
4391 * Pulled from ProcessStatsService.java
4392 */
4393message ProcStatsPkgProc {
4394 optional ProcessStatsSectionProto proc_stats_section = 1;
4395}
4396
Yangsteraf9aee72018-10-12 09:26:16 -07004397message PowerProfileProto {
4398 optional double cpu_suspend = 1;
4399
4400 optional double cpu_idle = 2;
4401
4402 optional double cpu_active = 3;
4403
4404 message CpuCluster {
4405 optional int32 id = 1;
4406 optional double cluster_power = 2;
4407 optional int32 cores = 3;
4408 repeated int64 speed = 4;
4409 repeated double core_power = 5;
4410 }
4411
4412 repeated CpuCluster cpu_cluster = 40;
4413
4414 optional double wifi_scan = 4;
4415
4416 optional double wifi_on = 5;
4417
4418 optional double wifi_active = 6;
4419
4420 optional double wifi_controller_idle = 7;
4421
4422 optional double wifi_controller_rx = 8;
4423
4424 optional double wifi_controller_tx = 9;
4425
4426 repeated double wifi_controller_tx_levels = 10;
4427
4428 optional double wifi_controller_operating_voltage = 11;
4429
4430 optional double bluetooth_controller_idle = 12;
4431
4432 optional double bluetooth_controller_rx = 13;
4433
4434 optional double bluetooth_controller_tx = 14;
4435
4436 optional double bluetooth_controller_operating_voltage = 15;
4437
4438 optional double modem_controller_sleep = 16;
4439
4440 optional double modem_controller_idle = 17;
4441
4442 optional double modem_controller_rx = 18;
4443
4444 repeated double modem_controller_tx = 19;
4445
4446 optional double modem_controller_operating_voltage = 20;
4447
4448 optional double gps_on = 21;
4449
4450 repeated double gps_signal_quality_based = 22;
4451
4452 optional double gps_operating_voltage = 23;
4453
4454 optional double bluetooth_on = 24;
4455
4456 optional double bluetooth_active = 25;
4457
4458 optional double bluetooth_at_cmd = 26;
4459
4460 optional double ambient_display = 27;
4461
4462 optional double screen_on = 28;
4463
4464 optional double radio_on = 29;
4465
4466 optional double radio_scanning = 30;
4467
4468 optional double radio_active = 31;
4469
4470 optional double screen_full = 32;
4471
4472 optional double audio = 33;
4473
4474 optional double video = 34;
4475
4476 optional double flashlight = 35;
4477
4478 optional double memory = 36;
4479
4480 optional double camera = 37;
4481
4482 optional double wifi_batched_scan = 38;
4483
4484 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004485}
Chenjie Yuab530202018-09-26 12:39:20 -07004486
4487/**
4488 * power_profile.xml and other constants for power model calculations.
4489 * Pulled from PowerProfile.java
4490 */
4491message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004492 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004493}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004494
4495/**
arangelovd5db50e2018-10-12 20:24:39 +01004496 * Logs when a user restriction was added or removed.
4497 *
4498 * Logged from:
4499 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4500 */
4501message UserRestrictionChanged {
4502 // The raw string of the user restriction as defined in UserManager.
4503 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4504 optional string restriction = 1;
4505 // Whether the restriction is enabled or disabled.
4506 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004507}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004508
4509/**
4510 * Pulls process user time and system time. Puller takes a snapshot of all pids
4511 * in the system and returns cpu stats for those that are working at the time.
4512 * Dead pids will be dropped. Kernel processes are excluded.
4513 * Min cool-down is 5 sec.
4514 */
4515message ProcessCpuTime {
4516 optional int32 uid = 1 [(is_uid) = true];
4517
4518 optional string process_name = 2;
4519 // Process cpu time in user space, cumulative from boot/process start
4520 optional int64 user_time_millis = 3;
4521 // Process cpu time in system space, cumulative from boot/process start
4522 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004523}
Misha Wagner5a51e002018-10-03 15:04:09 +01004524
4525/**
4526 * Pulls the CPU usage for each thread.
4527 *
4528 * Read from /proc/$PID/task/$TID/time_in_state files.
4529 *
4530 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4531 * time_in_state files not being present on some phones, have not been addressed. These should be
4532 * considered before a public release.
4533 */
4534message CpuTimePerThreadFreq {
4535 // UID that owns the process.
4536 optional int32 uid = 1 [(is_uid) = true];
4537 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004538 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004539 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004540 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004541 // Name of the process taken from `/proc/$PID/cmdline`.
4542 optional string process_name = 4;
4543 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4544 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004545
4546 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4547 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4548 // frequencies are given here as the alternative is sending eight separate atoms. This method
4549 // significantly reduces the amount of data created
4550 optional int32 frequency1_khz = 6;
4551 optional int32 time1_millis = 7;
4552 optional int32 frequency2_khz = 8;
4553 optional int32 time2_millis = 9;
4554 optional int32 frequency3_khz = 10;
4555 optional int32 time3_millis = 11;
4556 optional int32 frequency4_khz = 12;
4557 optional int32 time4_millis = 13;
4558 optional int32 frequency5_khz = 14;
4559 optional int32 time5_millis = 15;
4560 optional int32 frequency6_khz = 16;
4561 optional int32 time6_millis = 17;
4562 optional int32 frequency7_khz = 18;
4563 optional int32 time7_millis = 19;
4564 optional int32 frequency8_khz = 20;
4565 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004566}
Bookatz75ee6042018-11-09 12:27:37 -08004567
4568/**
Bookatz366a4432018-11-20 09:42:33 -08004569 * Pulls information about the device's build.
4570 */
4571message BuildInformation {
4572 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4573 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4574 optional string fingerprint = 1;
4575
4576 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4577 optional string brand = 2;
4578
4579 // Build.PRODUCT. The name of the overall product.
4580 optional string product = 3;
4581
4582 // Build.DEVICE. The name of the industrial design.
4583 optional string device = 4;
4584
4585 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4586 optional string version_release = 5;
4587
4588 // Build.ID. E.g. a label like "M4-rc20".
4589 optional string id = 6;
4590
4591 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4592 // represent this build.
4593 optional string version_incremental = 7;
4594
4595 // Build.TYPE. The type of build, like "user" or "eng".
4596 optional string type = 8;
4597
4598 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4599 optional string tags = 9;
4600}
4601
4602/**
Bookatz75ee6042018-11-09 12:27:37 -08004603 * Pulls on-device BatteryStats power use calculations for the overall device.
4604 */
4605message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004606 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4607 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4608 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4609 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08004610}
4611
4612/**
4613 * Pulls on-device BatteryStats power use calculations broken down by uid.
4614 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4615 * that is attributed to non-uid items. They must all be included to get the total power use.
4616 */
4617message DeviceCalculatedPowerBlameUid {
4618 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4619 optional int32 uid = 1 [(is_uid) = true];
4620
Bookatz3dbc13a2018-12-21 12:16:51 -08004621 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4622 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4623 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08004624}
4625
4626/**
4627 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4628 * drain type.
4629 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4630 * is attributed uids. They must all be included to get the total power use.
4631 */
4632message DeviceCalculatedPowerBlameOther {
4633 // The type of item whose power use is being reported.
4634 enum DrainType {
4635 AMBIENT_DISPLAY = 0;
4636 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4637 BLUETOOTH = 2;
4638 CAMERA = 3;
4639 // Cell-standby
4640 CELL = 4;
4641 FLASHLIGHT = 5;
4642 IDLE = 6;
4643 MEMORY = 7;
4644 // Amount that total computed drain exceeded the drain estimated using the
4645 // battery level changes and capacity.
4646 OVERCOUNTED = 8;
4647 PHONE = 9;
4648 SCREEN = 10;
4649 // Amount that total computed drain was below the drain estimated using the
4650 // battery level changes and capacity.
4651 UNACCOUNTED = 11;
4652 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4653 WIFI = 13;
4654 }
4655 optional DrainType drain_type = 1;
4656
Bookatz3dbc13a2018-12-21 12:16:51 -08004657 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4658 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4659 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004660}
arangelov4e994062018-11-13 16:12:38 +00004661
4662/**
4663 * Logs device policy features.
4664 *
4665 * Logged from:
4666 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4667 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4668 */
4669message DevicePolicyEvent {
4670 // The event id - unique for each event.
4671 optional android.stats.devicepolicy.EventId event_id = 1;
4672 // The admin package name.
4673 optional string admin_package_name = 2;
4674 // A generic integer parameter.
4675 optional int32 integer_value = 3;
4676 // A generic boolean parameter.
4677 optional bool boolean_value = 4;
4678 // A parameter specifying a time period in milliseconds.
4679 optional uint64 time_period_millis = 5;
4680 // A parameter specifying a list of package names, bundle extras or string parameters.
4681 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4682}
shawnlinea5b66b2018-11-13 15:05:29 +08004683
4684/**
4685 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4686 *
4687 * Logged from:
4688 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4689 */
4690message DocsUILaunchReported {
4691 optional android.stats.docsui.LaunchAction launch_action = 1;
4692 optional bool has_initial_uri = 2;
4693 optional android.stats.docsui.MimeType mime_type = 3;
4694 optional android.stats.docsui.Root initial_root = 4;
4695}
4696
4697/**
4698 * Logs root/app visited event in file managers/picker. Call this when the user
4699 * taps on root/app in hamburger menu.
4700 *
4701 * Logged from:
4702 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4703 */
4704message DocsUIRootVisitedReported {
4705 optional android.stats.docsui.ContextScope scope = 1;
4706 optional android.stats.docsui.Root root = 2;
4707}
4708
4709/**
4710 * Logs file operation stats. Call this when a file operation has completed.
4711 *
4712 * Logged from:
4713 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4714 */
4715message DocsUIFileOperationReported {
4716 optional android.stats.docsui.Provider provider = 1;
4717 optional android.stats.docsui.FileOperation file_op = 2;
4718}
4719
4720/**
4721 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4722 * mode.
4723 *
4724 * Logged from:
4725 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4726 */
4727message DocsUIFileOperationCopyMoveModeReported {
4728 optional android.stats.docsui.FileOperation file_op = 1;
4729 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4730}
4731
4732
4733/**
4734 * Logs file sub operation stats. Call this when a file operation has failed.
4735 *
4736 * Logged from:
4737 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4738 */
4739message DocsUIFileOperationFailureReported {
4740 optional android.stats.docsui.Authority authority = 1;
4741 optional android.stats.docsui.SubFileOperation sub_op = 2;
4742}
4743
4744/**
4745* Logs the cancellation of a file operation. Call this when a job is canceled
4746*
4747* Logged from:
4748* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4749*/
4750message DocsUIFileOperationCanceledReported {
4751 optional android.stats.docsui.FileOperation file_op = 1;
4752}
4753
4754/**
4755 * Logs startup time in milliseconds.
4756 *
4757 * Logged from:
4758 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4759 */
4760message DocsUIStartupMsReported {
4761 optional int32 startup_millis = 1;
4762}
4763
4764/**
4765 * Logs the action that was started by user.
4766 *
4767 * Logged from:
4768 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4769 */
4770message DocsUIUserActionReported {
4771 optional android.stats.docsui.UserAction action = 1;
4772}
4773
4774/**
4775 * Logs the invalid type when invalid scoped access is requested.
4776 *
4777 * Logged from:
4778 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4779 */
4780message DocsUIInvalidScopedAccessRequestReported {
4781 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004782}
Ben Murdochbab399f2018-12-06 11:01:38 +00004783
4784/**
shawnlina75e82d2019-01-07 10:31:12 +08004785 * Logs the package name that launches docsui picker mode.
4786 *
4787 * Logged from:
4788 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4789 */
4790message DocsUIPickerLaunchedFromReported {
4791 optional string package_name = 1;
4792}
4793
4794/**
4795 * Logs the search type.
4796 *
4797 * Logged from:
4798 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4799 */
4800message DocsUISearchTypeReported {
4801 optional android.stats.docsui.SearchType search_type = 1;
4802}
4803
4804/**
4805 * Logs the search mode.
4806 *
4807 * Logged from:
4808 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4809 */
4810message DocsUISearchModeReported {
4811 optional android.stats.docsui.SearchMode search_mode = 1;
4812}
4813
4814/**
4815 * Logs the pick result information.
4816 *
4817 * Logged from:
4818 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4819 */
4820message DocsUIPickResultReported {
4821 optional int32 total_action_count = 1;
4822 optional int64 duration_millis = 2;
4823 optional int32 file_count= 3;
4824 optional bool is_searching = 4;
4825 optional android.stats.docsui.Root picked_from = 5;
4826 optional android.stats.docsui.MimeType mime_type = 6;
4827 optional int32 repeatedly_pick_times = 7;
4828}
4829
4830/**
Ben Murdochbab399f2018-12-06 11:01:38 +00004831 * Logs when an app's memory is compacted.
4832 *
4833 * Logged from:
4834 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4835 */
4836message AppCompacted {
4837 // The pid of the process being compacted.
4838 optional int32 pid = 1;
4839
4840 // The name of the process being compacted.
4841 optional string process_name = 2;
4842
4843 // The type of compaction.
4844 enum Action {
4845 UNKNOWN = 0;
4846 SOME = 1;
4847 FULL = 2;
4848 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004849 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00004850
4851 // Total RSS in kilobytes consumed by the process prior to compaction.
4852 optional int64 before_rss_total_kilobytes = 4;
4853
4854 // File RSS in kilobytes consumed by the process prior to compaction.
4855 optional int64 before_rss_file_kilobytes = 5;
4856
4857 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4858 optional int64 before_rss_anon_kilobytes = 6;
4859
4860 // Swap in kilobytes consumed by the process prior to compaction.
4861 optional int64 before_swap_kilobytes = 7;
4862
4863 // Total RSS in kilobytes consumed by the process after compaction.
4864 optional int64 after_rss_total_kilobytes = 8;
4865
4866 // File RSS in kilobytes consumed by the process after compaction.
4867 optional int64 after_rss_file_kilobytes = 9;
4868
4869 // Anonymous RSS in kilobytes consumed by the process after compaction.
4870 optional int64 after_rss_anon_kilobytes = 10;
4871
4872 // Swap in kilobytes consumed by the process after compaction.
4873 optional int64 after_swap_kilobytes = 11;
4874
4875 // The time taken to perform compaction in milliseconds.
4876 optional int64 time_to_compact_millis = 12;
4877
4878 // The last compaction action performed for this app.
4879 optional Action last_action = 13;
4880
Ben Murdoch01720b82018-12-19 18:03:44 +00004881 // The last time that compaction was attempted on this process in milliseconds
4882 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4883 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00004884
Ben Murdoch01720b82018-12-19 18:03:44 +00004885 // The oom_score_adj at the time of compaction.
4886 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00004887
4888 // The process state at the time of compaction.
4889 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00004890
4891 // Free ZRAM in kilobytes before compaction.
4892 optional int64 before_zram_free_kilobytes = 17;
4893
4894 // Free ZRAM in kilobytes after compaction.
4895 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00004896}
lifr157fc552018-12-12 16:38:04 +08004897
4898/**
4899 * Logs the latency period(in microseconds) and the return code of
4900 * the DNS(Domain Name System) lookups.
4901 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4902 * to get info(address or hostname) from DNS server(or DNS cache).
4903 * Logged from:
4904 * /system/netd/server/DnsProxyListener.cpp
4905 */
4906message NetworkDnsEventReported {
4907 // The types of the DNS lookups, as defined in
4908 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4909 enum EventType {
4910 EVENT_UNKNOWN = 0;
4911 EVENT_GETADDRINFO = 1;
4912 EVENT_GETHOSTBYNAME = 2;
4913 EVENT_GETHOSTBYADDR = 3;
4914 EVENT_RES_NSEND = 4;
4915 }
4916 optional EventType event_type = 1;
4917
4918 // The return value of the DNS resolver for each DNS lookups.
4919 //bionic/libc/include/netdb.h
4920 //system/netd/resolv/include/netd_resolv/resolv.h
4921 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08004922 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08004923 EAI_ADDRFAMILY = 1;
4924 EAI_AGAIN = 2;
4925 EAI_BADFLAGS = 3;
4926 EAI_FAIL = 4;
4927 EAI_FAMILY = 5;
4928 EAI_MEMORY = 6;
4929 EAI_NODATA = 7;
4930 EAI_NONAME = 8;
4931 EAI_SERVICE = 9;
4932 EAI_SOCKTYPE = 10;
4933 EAI_SYSTEM = 11;
4934 EAI_BADHINTS = 12;
4935 EAI_PROTOCOL = 13;
4936 EAI_OVERFLOW = 14;
4937 RESOLV_TIMEOUT = 255;
4938 EAI_MAX = 256;
4939 }
4940 optional ReturnCode return_code = 2;
4941
4942 // The latency period(in microseconds) it took for this DNS lookup to complete.
4943 optional int32 latency_micros = 3;
4944}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08004945
4946/**
4947 * Logs when a data stall event occurs.
4948 *
4949 * Log from:
4950 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4951 */
4952message DataStallEvent {
4953 // Data stall evaluation type.
4954 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4955 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
4956 optional int32 evaluation_type = 1;
4957 // See definition in data_stall_event.proto.
4958 optional com.android.server.connectivity.ProbeResult validation_result = 2;
4959 // See definition in data_stall_event.proto.
4960 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
4961 // See definition in data_stall_event.proto.
4962 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
4963 // See definition in data_stall_event.proto.
4964 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
4965 // See definition in data_stall_event.proto.
4966 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
4967}
Christian Brunschenf86039e2018-12-21 12:26:14 +00004968
4969/*
4970 * Logs when RescueParty resets some set of experiment flags.
4971 *
4972 * Logged from:
4973 * frameworks/base/services/core/java/com/android/server/RescueParty.java
4974 */
4975message RescuePartyResetReported {
4976 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
4977 optional int32 rescue_level = 1;
4978}
Mathew Inwoodb375be52019-01-04 11:36:25 +00004979
4980/**
4981 * Logs when signed config is received from an APK, and if that config was applied successfully.
4982 * Logged from:
4983 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
4984 */
4985message SignedConfigReported {
4986 enum Type {
4987 UNKNOWN_TYPE = 0;
4988 GLOBAL_SETTINGS = 1;
4989 }
4990 optional Type type = 1;
4991
4992 // The final status of the signed config received.
4993 enum Status {
4994 UNKNOWN_STATUS = 0;
4995 APPLIED = 1;
4996 BASE64_FAILURE_CONFIG = 2;
4997 BASE64_FAILURE_SIGNATURE = 3;
4998 SECURITY_EXCEPTION = 4;
4999 INVALID_CONFIG = 5;
5000 OLD_CONFIG = 6;
5001 SIGNATURE_CHECK_FAILED = 7;
5002 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005003 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005004 }
5005 optional Status status = 2;
5006
5007 // The version of the signed config processed.
5008 optional int32 version = 3;
5009
5010 // The package name that the config was extracted from.
5011 optional string from_package = 4;
5012
5013 enum Key {
5014 NO_KEY = 0;
5015 DEBUG = 1;
5016 PRODUCTION = 2;
5017 }
5018 // Which key was used to verify the config.
5019 optional Key verified_with = 5;
5020}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005021
5022/*
5023 * Logs GNSS Network-Initiated (NI) location events.
5024 *
5025 * Logged from:
5026 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5027 */
5028message GnssNiEventReported {
5029 // The type of GnssNiEvent.
5030 enum EventType {
5031 UNKNOWN = 0;
5032 NI_REQUEST = 1;
5033 NI_RESPONSE = 2;
5034 }
5035 optional EventType event_type = 1;
5036
5037 // An ID generated by HAL to associate NI notifications and UI responses.
5038 optional int32 notification_id = 2;
5039
5040 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005041 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005042
5043 // NI requires notification.
5044 optional bool need_notify = 4;
5045
5046 // NI requires verification.
5047 optional bool need_verify = 5;
5048
5049 // NI requires privacy override, no notification/minimal trace.
5050 optional bool privacy_override = 6;
5051
5052 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5053 // seconds.
5054 optional int32 timeout = 7;
5055
5056 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005057 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005058
5059 // String representing the requester of the network inititated location request.
5060 optional string requestor_id = 9;
5061
5062 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5063 // network initiated location request.
5064 optional string text = 10;
5065
5066 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005067 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005068
5069 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005070 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005071
5072 // True if SUPL ES is enabled.
5073 optional bool is_supl_es_enabled = 13;
5074
5075 // True if GNSS location is enabled.
5076 optional bool is_location_enabled = 14;
5077
5078 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005079 optional android.server.location.GnssUserResponseType user_response = 15;
5080}
5081
5082/**
5083 * Logs GNSS non-framework (NFW) location notification.
5084 *
5085 * Logged from:
5086 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5087 */
5088message GnssNfwNotificationReported {
5089 // Package name of the Android proxy application representing the non-framework entity that
5090 // requested location. Set to empty string if unknown.
5091 optional string proxy_app_package_name = 1;
5092
5093 // Protocol stack that initiated the non-framework location request.
5094 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5095
5096 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5097 // set to empty string. This field is opaque to the framework and used for logging purposes.
5098 optional string other_protocol_stack_name = 3;
5099
5100 // Source initiating/receiving the location information.
5101 optional android.server.location.NfwRequestor requestor = 4;
5102
5103 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5104 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5105 // and used for logging purposes.
5106 optional string requestor_id = 5;
5107
5108 // Indicates whether location information was provided for this request.
5109 optional android.server.location.NfwResponseType response_type = 6;
5110
5111 // True if the device is in user initiated emergency session.
5112 optional bool in_emergency_mode = 7;
5113
5114 // True if cached location is provided.
5115 optional bool is_cached_location = 8;
5116
5117 // True if proxy app permission mismatch between framework and GNSS HAL.
5118 optional bool is_permission_mismatched = 9;
5119}
5120
5121/**
5122 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5123 *
5124 * Logged from:
5125 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5126 */
5127message GnssConfigurationReported {
5128 // SUPL host name.
5129 optional string supl_host = 1;
5130
5131 // SUPL port number.
5132 optional int32 supl_port = 2;
5133
5134 // C2K host name.
5135 optional string c2k_host = 3;
5136
5137 // C2K port number.
5138 optional int32 c2k_port = 4;
5139
5140 // The SUPL version requested by Carrier.
5141 optional int32 supl_ver = 5;
5142
5143 // The SUPL mode.
5144 optional android.server.location.SuplMode supl_mode = 6;
5145
5146 // True if NI emergency SUPL restrictions is enabled.
5147 optional bool supl_es = 7;
5148
5149 // LTE Positioning Profile settings
5150 optional android.server.location.LppProfile lpp_profile = 8;
5151
5152 // Positioning protocol on A-Glonass system.
5153 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5154
5155 // True if emergency PDN is used. Otherwise, regular PDN is used.
5156 optional bool use_emergency_pdn_for_emergency_supl= 10;
5157
5158 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5159 optional android.server.location.GpsLock gps_lock = 11;
5160
5161 // Number of seconds to extend the emergency session duration post emergency call.
5162 optional int32 es_extension_sec = 12;
5163
5164 // The full list of package names of proxy Android applications representing the non-framework
5165 // location access entities (on/off the device) for which the framework user has granted
5166 // non-framework location access permission. The package names are concatenated in one string
5167 // with spaces as separators.
5168 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005169}
Jack Yu95b64f32018-12-13 18:26:11 +08005170
5171/**
5172 * Logs when a NFC device's error occurred.
5173 * Logged from:
5174 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5175 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5176 */
5177message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005178 enum Type {
5179 UNKNOWN = 0;
5180 CMD_TIMEOUT = 1;
5181 ERROR_NOTIFICATION = 2;
5182 AID_OVERFLOW = 3;
5183 }
5184 optional Type type = 1;
5185 // If it's nci cmd timeout, log the timeout command.
5186 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005187
Alex Salod7c3eef2019-01-25 14:43:27 -08005188 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005189}
5190
5191/**
5192 * Logs when a NFC device's state changed event
5193 * Logged from:
5194 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5195 */
5196message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005197 enum State {
5198 UNKNOWN = 0;
5199 OFF = 1;
5200 ON = 2;
5201 ON_LOCKED = 3; // Secure Nfc enabled.
5202 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5203 }
5204 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005205}
5206
5207/**
5208 * Logs when a NFC Beam Transaction occurred.
5209 * Logged from:
5210 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5211 */
5212message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005213 enum Operation {
5214 UNKNOWN = 0;
5215 SEND = 1;
5216 RECEIVE = 2;
5217 }
5218 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005219}
5220
5221/**
5222 * Logs when a NFC Card Emulation Transaction occurred.
5223 * Logged from:
5224 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5225 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5226 */
5227message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005228 enum Category {
5229 UNKNOWN = 0;
5230 HCE_PAYMENT = 1;
5231 HCE_OTHER = 2;
5232 OFFHOST = 3;
5233 }
5234 // Transaction belongs to HCE payment or HCE other category, or offhost.
5235 optional Category category = 1;
5236 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5237 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005238}
5239
5240/**
5241 * Logs when a NFC Tag event occurred.
5242 * Logged from:
5243 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5244 */
5245message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005246 enum Type {
5247 UNKNOWN = 0;
5248 URL = 1;
5249 BT_PAIRING = 2;
5250 PROVISION = 3;
5251 WIFI_CONNECT = 4;
5252 APP_LAUNCH = 5;
5253 OTHERS = 6;
5254 }
5255 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005256}
5257
5258/**
5259 * Logs when Hce transaction triggered
5260 * Logged from:
5261 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5262 */
5263message NfcHceTransactionOccurred {
5264 // The latency period(in microseconds) it took for the first HCE data
5265 // exchange.
5266 optional uint32 latency_micros = 1;
5267}
5268
5269/**
5270 * Logs when SecureElement state event changed
5271 * Logged from:
5272 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5273 */
5274message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005275 enum State {
5276 UNKNOWN = 0;
5277 INITIALIZED = 1;
5278 DISCONNECTED = 2;
5279 CONNECTED = 3;
5280 HALCRASH = 4;
5281 }
5282 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005283
Alex Salod7c3eef2019-01-25 14:43:27 -08005284 optional string state_change_reason = 2;
5285 // SIMx or eSEx.
5286 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005287}
5288
5289/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005290 * Information about a permission grant request
5291 */
5292message PermissionGrantRequestResultReported {
5293 // unique value identifying an API call. A API call might result in multiple of these atoms
5294 optional int64 request_id = 1;
5295
5296 // UID of package requesting the permission grant
5297 optional int32 requesting_uid = 2 [(is_uid) = true];
5298
5299 // Name of package requesting the permission grant
5300 optional string requesting_package_name = 3;
5301
5302 // The permission to be granted
5303 optional string permission_name = 4;
5304
5305 // If the permission was explicitly requested via the API or added by the system
5306 optional bool is_implicit = 5;
5307
5308 enum Result {
5309 UNDEFINED = 0;
5310 // permission request was ignored
5311 IGNORED = 1;
5312 // permission request was ignored because it was user fixed
5313 IGNORED_USER_FIXED = 2;
5314 // permission request was ignored because it was policy fixed
5315 IGNORED_POLICY_FIXED = 3;
5316 // permission was granted by user action
5317 USER_GRANTED = 4;
5318 // permission was automatically granted
5319 AUTO_GRANTED = 5;
5320 // permission was denied by user action
5321 USER_DENIED = 6;
5322 // permission was denied with prejudice by the user
5323 USER_DENIED_WITH_PREJUDICE = 7;
5324 // permission was automatically denied
5325 AUTO_DENIED = 8;
5326 }
5327 // The result of the permission grant
5328 optional Result result = 6;
5329}
5330
5331/**
Jack Yu95b64f32018-12-13 18:26:11 +08005332 * Logs when Omapi API used
5333 * Logged from:
5334 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5335 */
5336message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005337 enum Operation {
5338 UNKNOWN = 0;
5339 OPEN_CHANNEL = 1;
5340 }
5341 optional Operation operation = 1;
5342 // SIMx or eSEx.
5343 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005344
Alex Salod7c3eef2019-01-25 14:43:27 -08005345 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005346}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005347
5348/**
Alex Saloa060aee2019-01-21 14:36:41 -08005349 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5350 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005351 * Logged from:
5352 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5353 */
5354message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005355 optional int64 dispatch_latency_millis = 1;
5356}
5357
5358/**
5359 * Logs AttentionManagerService attention check result.
5360 *
5361 * Logged from:
5362 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5363 */
5364message AttentionManagerServiceResultReported {
5365 // See core/java/android/service/attention/AttentionService.java
5366 enum AttentionCheckResult {
5367 UNKNOWN = 20;
5368 ATTENTION_SUCCESS_ABSENT = 0;
5369 ATTENTION_SUCCESS_PRESENT = 1;
5370 ATTENTION_FAILURE_PREEMPTED = 2;
5371 ATTENTION_FAILURE_TIMED_OUT = 3;
5372 ATTENTION_FAILURE_UNKNOWN = 4;
5373 }
5374 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005375}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005376
5377/**
5378 * Logs when an adb connection changes state.
5379 *
5380 * Logged from:
5381 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5382 */
5383message AdbConnectionChanged {
5384 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5385 // previously selected for this system.
5386 optional int64 last_connection_time_millis = 1;
5387
5388 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5389 // to reconnect via adb without user interaction.
5390 optional int64 auth_window_millis = 2;
5391
5392 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5393 optional android.debug.AdbConnectionStateEnum state = 3;
5394
5395 // True if the 'always allow' option was selected for this system.
5396 optional bool always_allow = 4;
5397}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005398
5399/*
5400 * Logs the reported speech DSP status.
5401 *
5402 * Logged from:
5403 * Vendor audio implementation.
5404 */
5405message SpeechDspStatReported {
5406 // The total Speech DSP uptime in milliseconds.
5407 optional int32 total_uptime_millis = 1;
5408 // The total Speech DSP downtime in milliseconds.
5409 optional int32 total_downtime_millis = 2;
5410 optional int32 total_crash_count = 3;
5411 optional int32 total_recover_count = 4;
5412}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005413
5414/**
5415 * Logs USB connector contaminant status.
5416 *
5417 * Logged from: USB Service.
5418 */
5419message UsbContaminantReported {
5420 optional string id = 1;
5421 optional android.service.usb.ContaminantPresenceStatus status = 2;
5422}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005423
5424/**
5425 * This atom is for debugging purpose.
5426 */
5427message DebugElapsedClock {
5428 // Monotically increasing value for each pull.
5429 optional int64 pull_count = 1;
5430 // Time from System.elapsedRealtime.
5431 optional int64 elapsed_clock_millis = 2;
5432 // Time from System.elapsedRealtime.
5433 optional int64 same_elapsed_clock_millis = 3;
5434 // Diff between current elapsed time and elapsed time from previous pull.
5435 optional int64 elapsed_clock_diff_millis = 4;
5436
5437 enum Type {
5438 TYPE_UNKNOWN = 0;
5439 ALWAYS_PRESENT = 1;
5440 PRESENT_ON_ODD_PULLS = 2;
5441 }
5442 // Type of behavior for the pulled data.
5443 optional Type type = 5;
5444}
5445
5446/**
5447 * This atom is for debugging purpose.
5448 */
5449message DebugFailingElapsedClock {
5450 // Monotically increasing value for each pull.
5451 optional int64 pull_count = 1;
5452 // Time from System.elapsedRealtime.
5453 optional int64 elapsed_clock_millis = 2;
5454 // Time from System.elapsedRealtime.
5455 optional int64 same_elapsed_clock_millis = 3;
5456 // Diff between current elapsed time and elapsed time from previous pull.
5457 optional int64 elapsed_clock_diff_millis = 4;
5458}
Steven Wuacef6bb2019-01-23 14:21:17 -05005459
5460/** Logs System UI bubbles event changed.
5461 *
5462 * Logged from:
5463 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5464 */
5465message BubbleUIChanged {
5466
5467 // The app package that is posting the bubble.
5468 optional string package_name = 1;
5469
5470 // The notification channel that is posting the bubble.
5471 optional string notification_channel = 2;
5472
5473 // The notification id associated with the posted bubble.
5474 optional int32 notification_id = 3;
5475
5476 // The position of the bubble within the bubble stack.
5477 optional int32 position = 4;
5478
5479 // The total number of bubbles within the bubble stack.
5480 optional int32 total_number = 5;
5481
5482 // User interactions with the bubble.
5483 enum Action {
5484 UNKNOWN = 0;
5485 POSTED = 1;
5486 UPDATED = 2;
5487 EXPANDED = 3;
5488 COLLAPSED = 4;
5489 DISMISSED = 5;
5490 STACK_DISMISSED = 6;
5491 STACK_MOVED = 7;
5492 HEADER_GO_TO_APP = 8;
5493 HEADER_GO_TO_SETTINGS = 9;
5494 PERMISSION_OPT_IN = 10;
5495 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005496 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005497 SWIPE_LEFT = 13;
5498 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005499 STACK_EXPANDED = 15;
Steven Wuacef6bb2019-01-23 14:21:17 -05005500 }
5501 optional Action action = 6;
5502
5503 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5504 optional float normalized_x_position = 7;
5505 optional float normalized_y_position = 8;
5506}
Kweku Adams8845d012018-12-11 20:06:45 -08005507
5508/**
Steven Wu552f63f2019-02-05 13:41:36 -05005509 * Logs System UI bubbles developer errors.
5510 *
5511 * Logged from:
5512 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5513 */
5514message BubbleDeveloperErrorReported {
5515
5516 // The app package that is posting the bubble.
5517 optional string package_name = 1;
5518
5519 // Bubble developer error type enums.
5520 enum Error {
5521 UNKNOWN = 0;
5522 ACTIVITY_INFO_MISSING = 1;
5523 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5524 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5525 }
5526 optional Error error = 2 [default = UNKNOWN];
5527}
5528
5529/**
Kweku Adams8845d012018-12-11 20:06:45 -08005530 * Logs that a constraint for a scheduled job has changed.
5531 *
5532 * Logged from:
5533 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5534 */
5535message ScheduledJobConstraintChanged {
5536 repeated AttributionNode attribution_node = 1;
5537
5538 // Name of the job.
5539 optional string job_name = 2;
5540
5541 optional com.android.server.job.ConstraintEnum constraint = 3;
5542
5543 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08005544 UNKNOWN = 0;
5545 UNSATISFIED = 1;
5546 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08005547 }
5548 optional State state = 4;
5549}
Alex Salod7c3eef2019-01-25 14:43:27 -08005550
5551/**
5552 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5553 * returns true.
5554 *
5555 * Logged from:
5556 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5557 */
5558message ScreenTimeoutExtensionReported {
5559 // Describes how many times in a row did the power manager reset the screen off timeout.
5560 optional uint32 consecutive_timeout_extended_count = 1;
5561}
Hui Yu885aca12019-01-10 17:11:34 -08005562
5563/*
5564* Logs number of milliseconds it takes to start a process.
5565* The definition of app process start time is from the app launch time to
5566* the time that Zygote finished forking the app process and loaded the
5567* application package's java classes.
5568
5569* This metric is different from AppStartOccurred which is for foreground
5570* activity only.
5571
5572* ProcessStartTime can report all processes (both foreground and background)
5573* start time.
5574*
5575* Logged from:
5576* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5577*/
5578message ProcessStartTime {
5579 // The uid of the ProcessRecord.
5580 optional int32 uid = 1 [(is_uid) = true];
5581
5582 // The process pid.
5583 optional int32 pid = 2;
5584
5585 // The process name.
5586 // Usually package name, "system" for system server.
5587 // Provided by ActivityManagerService.
5588 optional string process_name = 3;
5589
5590 enum StartType {
5591 UNKNOWN = 0;
5592 WARM = 1;
5593 HOT = 2;
5594 COLD = 3;
5595 }
5596
5597 // The start type.
5598 optional StartType type = 4;
5599
5600 // The elapsed realtime at the start of the process.
5601 optional int64 process_start_time_millis = 5;
5602
5603 // Number of milliseconds it takes to reach bind application.
5604 optional int32 bind_application_delay_millis = 6;
5605
5606 // Number of milliseconds it takes to finish start of the process.
5607 optional int32 process_start_delay_millis = 7;
5608
5609 // hostingType field in ProcessRecord, the component type such as "activity",
5610 // "service", "content provider", "broadcast" or other strings.
5611 optional string hosting_type = 8;
5612
5613 // hostingNameStr field in ProcessRecord. The component class name that runs
5614 // in this process.
5615 optional string hosting_name = 9;
5616}
5617
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005618/**
5619 * State of a dangerous permission requested by a package
5620 */
5621message DangerousPermissionState {
5622 // Name of the permission
5623 optional string permission_name = 1;
5624
5625 // Uid of the package
5626 optional int32 uid = 2 [(is_uid) = true];
5627
5628 // Package requesting the permission
5629 optional string package_name = 3;
5630
5631 // If the permission is granted to the uid
5632 optional bool is_granted = 4;
5633}
5634
Michael Groover4a0ca942019-01-24 17:41:25 -08005635/**
5636 * Logs when a package is denied access to a device identifier based on the new access requirements.
5637 *
5638 * Logged from:
5639 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
5640 */
5641message DeviceIdentifierAccessDenied {
5642 // The name of the package denied access to the requested device identifier.
5643 optional string package_name = 1;
5644
5645 // The name of the device identifier method the package attempted to invoke.
5646 optional string method_name = 2;
5647
5648 // True if the package is preinstalled.
5649 optional bool is_preinstalled = 3;
5650
5651 // True if the package is privileged.
5652 optional bool is_priv_app = 4;
5653}
Chenjie Yue13f44a2019-02-07 17:51:38 -08005654
5655/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08005656 * Pulls the ongoing mainline install train version code.
5657 * Pulled from StatsCompanionService
5658 */
5659message TrainInfo {
5660 optional int64 train_version_code = 1;
5661
5662 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08005663
5664 optional string train_name = 3;
5665
5666 enum Status {
5667 UNKNOWN = 0;
5668 INSTALL_REQUESTED = 1;
5669 INSTALL_STARTED = 2;
5670 INSTALL_STAGED_NOT_READY = 3;
5671 INSTALL_STAGED_READY = 4;
5672 INSTALL_SUCCESS = 5;
5673 INSTALL_FAILURE = 6;
5674 INSTALL_CANCELLED = 7;
5675 INSTALLER_ROLLBACK_REQUESTED = 8;
5676 INSTALLER_ROLLBACK_INITIATED = 9;
5677 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
5678 INSTALLER_ROLLBACK_STAGED = 11;
5679 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
5680 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
5681 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
5682 INSTALLER_ROLLBACK_SUCCESS = 15;
5683 INSTALLER_ROLLBACK_FAILURE = 16;
5684 INSTALLER_ROLLBACK_CANCEL_STAGED_REMOVE_FROM_QUEUE = 17;
5685 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_INITIATED = 18;
5686 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_SUCCESS = 19;
5687 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_FAILURE = 20;
5688 }
5689 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08005690}
joshmccloskey8c3322e2019-01-09 18:25:57 -08005691
5692/**
5693 * Logs the gesture stage changed event.
5694 *
5695 * Logged from:
5696 * frameworks/base/packages/SystemUI/
5697 */
5698message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005699 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005700}
5701
5702/**
5703 * Logs the feedback type.
5704 *
5705 * Logged from:
5706 * frameworks/base/packages/SystemUI/
5707 */
5708message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005709 // Whether or not the gesture was used.
5710 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005711}
5712
5713/**
5714 * Logs the progress.
5715 *
5716 * Logged from:
5717 * frameworks/base/packages/SystemUI/
5718 */
5719message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005720 // [0,100] progress for the assist gesture.
5721 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005722}
Neil Fullerdb14b482019-02-05 19:44:44 +00005723
5724/*
5725 * Information about the time zone data on a device.
5726 */
5727message TimeZoneDataInfo {
5728 // A version identifier for the data set on device. e.g. "2018i"
5729 optional string tzdb_version = 1;
5730}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005731
5732/*
5733 * Logs the GPU stats global health information.
5734 *
5735 * Logged from:
5736 * frameworks/native/services/gpuservice/gpustats/
5737 */
5738message GpuStatsGlobalInfo {
5739 // Package name of the gpu driver.
5740 optional string driver_package_name = 1;
5741
5742 // Version name of the gpu driver.
5743 optional string driver_version_name = 2;
5744
5745 // Version code of the gpu driver.
5746 optional int64 driver_version_code = 3;
5747
5748 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
5749 optional int64 driver_build_time = 4;
5750
5751 // Total count of the gl driver gets loaded.
5752 optional int64 gl_loading_count = 5;
5753
5754 // Total count of the gl driver fails to be loaded.
5755 optional int64 gl_loading_failure_count = 6;
5756
5757 // Total count of the Vulkan driver gets loaded.
5758 optional int64 vk_loading_count = 7;
5759
5760 // Total count of the Vulkan driver fails to be loaded.
5761 optional int64 vk_loading_failure_count = 8;
5762}
5763
5764/*
5765 * Logs the GPU stats per app health information.
5766 *
5767 * Logged from:
5768 * frameworks/native/services/gpuservice/gpustats/
5769 */
5770message GpuStatsAppInfo {
5771 // Package name of the application that loads the gpu driver.
5772 optional string app_package_name = 1;
5773
5774 // Version code of the gpu driver this app loads.
5775 optional int64 driver_version_code = 2;
5776
5777 // List of all the gl driver loading times for this app.
5778 repeated int64 gl_driver_loading_time = 3;
5779
5780 // List of all the Vulkan driver laoding times for this app.
5781 repeated int64 vk_driver_loading_time = 4;
5782}