blob: b8e8fdc6a9f218f08dfcd893b289665a7ba964ef [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;
Fabian Kozynskibfd6d852019-02-15 15:08:16 -0500252 PrivacyIndicatorsInteracted privacy_indicators_interacted = 180;
Yao Chend54f9dd2017-10-17 17:37:48 +0000253 }
David Chenc8a43242017-10-17 16:23:28 -0700254
David Chen6e3e6cb2018-01-03 16:14:06 -0800255 // Pulled events will start at field 10000.
Rafal Slawikd4e87572019-03-12 13:08:38 +0000256 // Next: 10057
David Chenc8a43242017-10-17 16:23:28 -0700257 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800258 WifiBytesTransfer wifi_bytes_transfer = 10000;
259 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
260 MobileBytesTransfer mobile_bytes_transfer = 10002;
261 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800262 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800263 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800264 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800265 CpuTimePerFreq cpu_time_per_freq = 10008;
266 CpuTimePerUid cpu_time_per_uid = 10009;
267 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800268 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800269 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800270 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800271 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800272 SystemElapsedRealtime system_elapsed_realtime = 10014;
273 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800274 CpuActiveTime cpu_active_time = 10016;
275 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000276 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800277 RemainingBatteryCapacity remaining_battery_capacity = 10019;
278 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800279 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100280 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100281 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100282 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000283 DiskStats disk_stats = 10025;
284 DirectoryUsage directory_usage = 10026;
285 AppSize app_size = 10027;
286 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700287 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700288 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800289 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700290 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700291 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800292 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700293 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100294 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100295 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700296 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800297 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
298 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
299 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000300 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800301 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800302 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800303 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000304 DebugElapsedClock debug_elapsed_clock = 10046;
305 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800306 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800307 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800308 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800309 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000310 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +0000311 SDCardInfo sdcard_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800312 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
313 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000314 SystemIonHeapSize system_ion_heap_size = 10056;
David Chenc8a43242017-10-17 16:23:28 -0700315 }
yroa1fe77c2018-02-26 14:22:54 -0800316
Bookatz76aafcf2018-09-17 16:17:10 -0700317 // DO NOT USE field numbers above 100,000 in AOSP.
318 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
319 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700320}
321
Yao Chend54f9dd2017-10-17 17:37:48 +0000322/**
Yangster-mac20877162017-12-22 17:19:39 -0800323 * This proto represents a node of an attribution chain.
324 * Note: All attribution chains are represented as a repeated field of type
325 * AttributionNode. It is understood that in such arrays, the order is that
326 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000327 */
Yangster-mac20877162017-12-22 17:19:39 -0800328message AttributionNode {
329 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800330 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800331
Yangster-mac20877162017-12-22 17:19:39 -0800332 // The (optional) string tag for an element in the attribution chain. If the
333 // element has no tag, it is encoded as an empty string.
334 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700335}
336
Yangster-mac48b3d622018-08-18 12:38:11 -0700337message KeyValuePair {
338 optional int32 key = 1;
339 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700340 int32 value_int = 2;
341 int64 value_long = 3;
342 string value_str = 4;
343 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700344 }
345}
346
347message KeyValuePairsAtom {
348 optional int32 uid = 1;
349 repeated KeyValuePair pairs = 2;
350}
351
Yao Chend54f9dd2017-10-17 17:37:48 +0000352/*
353 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800354 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000355 *
356 * RULES:
357 * - The field ids for each atom must start at 1, and count upwards by 1.
358 * Skipping field ids is not allowed.
359 * - These form an API, so renaming, renumbering or removing fields is
360 * not allowed between android releases. (This is not currently enforced,
361 * but there will be a tool to enforce this restriction).
362 * - The types must be built-in protocol buffer types, namely, no sub-messages
363 * are allowed (yet). The bytes type is also not allowed.
364 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800365 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000366 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800367 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000368 * - A field that is a uid should be a string field, tagged with the [xxx]
369 * annotation. The generated code on android will be represented by UIDs,
370 * and those UIDs will be translated in xxx to those strings.
371 *
372 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700373 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000374 * - If there is a UID, it goes first. Think in an object-oriented fashion.
375 * *****************************************************************************
376 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700377
Yao Chend54f9dd2017-10-17 17:37:48 +0000378/**
Yangster-mace16189a2018-08-26 12:20:16 -0700379 * Logs when the Thermal service HAL notifies the throttling start/stop events.
380 *
381 * Logged from:
382 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
383 */
384message ThermalThrottlingStateChanged {
385 optional android.os.TemperatureTypeEnum sensor_type = 1;
386
387 enum State {
388 UNKNOWN = 0;
389 START = 1;
390 STOP = 2;
391 }
392
393 optional State state = 2;
394
395 optional float temperature = 3;
396}
397
398/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000399 * Logs when the screen state changes.
400 *
401 * Logged from:
402 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
403 */
404message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800405 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700406 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700407}
Yao Chend54f9dd2017-10-17 17:37:48 +0000408
409/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700410 * Logs that the process state of the uid, as determined by ActivityManager
411 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000412 *
413 * Logged from:
414 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
415 */
Bookatzc1a050a2017-10-10 15:49:28 -0700416message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700417 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000418
Bookatzdb026a22018-01-10 19:01:56 -0800419 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700420 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000421}
422
423/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700424 * Logs process state change of a process, as per the activity manager.
425 *
426 * Logged from:
427 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
428 */
429message ProcessStateChanged {
430 optional int32 uid = 1;
431 optional string process_name = 2;
432 optional string package_name = 3;
433 // TODO: remove this when validation is done
434 optional int64 version = 5;
435 // The state, from frameworks/base/core/proto/android/app/enums.proto.
436 optional android.app.ProcessStateEnum state = 4;
437}
438
439/**
440 * Logs when ActivityManagerService sleep state is changed.
441 *
442 * Logged from:
443 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
444 */
445message ActivityManagerSleepStateChanged {
446 // TODO: import frameworks proto
447 enum State {
448 UNKNOWN = 0;
449 ASLEEP = 1;
450 AWAKE = 2;
451 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700452 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700453}
454
455/**
456 * Logs when system memory state changes.
457 *
458 * Logged from:
459 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
460 */
461message MemoryFactorStateChanged {
462 // TODO: import frameworks proto
463 enum State {
464 MEMORY_UNKNOWN = 0;
465 NORMAL = 1; // normal.
466 MODERATE = 2; // moderate memory pressure.
467 LOW = 3; // low memory.
468 CRITICAL = 4; // critical memory.
469
470 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700471 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700472}
473
474/**
475 * Logs when app is using too much cpu, according to ActivityManagerService.
476 *
477 * Logged from:
478 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
479 */
480message ExcessiveCpuUsageReported {
481 optional int32 uid = 1;
482 optional string process_name = 2;
483 optional string package_name = 3;
484 // package version. TODO: remove this when validation is done
485 optional int64 version = 4;
486}
487
488/**
489 * Logs when a cached process is killed, along with its pss.
490 *
491 * Logged from:
492 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
493 */
494message CachedKillReported {
495 optional int32 uid = 1;
496 optional string process_name = 2;
497 optional string package_name = 3;
498 // TODO: remove this when validation is done
499 optional int64 version = 5;
500 optional int64 pss = 4;
501}
502
503/**
504 * Logs when memory stats of a process is reported.
505 *
506 * Logged from:
507 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
508 */
509message ProcessMemoryStatReported {
510 optional int32 uid = 1;
511 optional string process_name = 2;
512 optional string package_name = 3;
513 //TODO: remove this when validation is done
514 optional int64 version = 9;
515 optional int64 pss = 4;
516 optional int64 uss = 5;
517 optional int64 rss = 6;
518 enum Type {
519 ADD_PSS_INTERNAL_SINGLE = 0;
520 ADD_PSS_INTERNAL_ALL_MEM = 1;
521 ADD_PSS_INTERNAL_ALL_POLL = 2;
522 ADD_PSS_EXTERNAL = 3;
523 ADD_PSS_EXTERNAL_SLOW = 4;
524 }
525 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800526 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700527}
528
529/**
Bookatzc1a050a2017-10-10 15:49:28 -0700530 * Logs that a process started, finished, crashed, or ANRed.
531 *
532 * Logged from:
533 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
534 */
535message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700536 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700537
David Chen0b5c90c2018-01-25 16:51:49 -0800538 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800539 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700540
Bookatzddccf0a2017-11-28 16:48:14 -0800541 // What lifecycle state the process changed to.
542 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800543 enum State {
544 FINISHED = 0;
545 STARTED = 1;
546 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800547 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800548 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700549}
550
Bookatzc1a050a2017-10-10 15:49:28 -0700551/**
552 * Logs when the ble scan state changes.
553 *
554 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700555 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700556 */
557message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800558 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700559
560 enum State {
561 OFF = 0;
562 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700563 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
564 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700565 }
566 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700567
Bookatze5ec0b42018-03-26 13:34:56 -0700568 // Does the scan have a filter.
569 optional bool is_filtered = 3;
570 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
571 optional bool is_first_match = 4;
572 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
573 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700574}
575
576/**
577 * Logs reporting of a ble scan finding results.
578 *
579 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700580 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700581 */
Bookatzae6738e2018-09-13 11:38:56 -0700582// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700583message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800584 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700585
586 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800587 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700588}
589
590/**
591 * Logs when a sensor state changes.
592 *
593 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700594 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700595 */
596message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800597 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700598
Bookatzc1a050a2017-10-10 15:49:28 -0700599 // The id (int) of the sensor.
600 optional int32 sensor_id = 2;
601
602 enum State {
603 OFF = 0;
604 ON = 1;
605 }
606 optional State state = 3;
607}
608
Bookatzc1a050a2017-10-10 15:49:28 -0700609/**
610 * Logs when GPS state changes.
611 *
612 * Logged from:
613 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
614 */
615message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800616 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700617
618 enum State {
619 OFF = 0;
620 ON = 1;
621 }
622 optional State state = 2;
623}
624
Bookatz48d362e2018-11-06 15:49:08 -0800625/**
626 * Logs when GPS signal quality.
627 *
628 * Logged from:
629 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
630 */
631message GpsSignalQualityChanged {
632 optional android.server.location.GpsSignalQualityEnum level = 1;
633}
634
Bookatzc1a050a2017-10-10 15:49:28 -0700635
636/**
637 * Logs when a sync manager sync state changes.
638 *
639 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700640 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700641 */
642message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800643 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700644
David Chen0b5c90c2018-01-25 16:51:49 -0800645 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800646 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700647
648 enum State {
649 OFF = 0;
650 ON = 1;
651 }
652 optional State state = 3;
653}
654
Yangster-mac96353002018-09-05 11:18:55 -0700655/*
656 * Deferred job stats.
657 *
658 * Logged from:
659 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
660*/
661message DeferredJobStatsReported {
662 repeated AttributionNode attribution_node = 1;
663
664 // Number of jobs deferred.
665 optional int32 num_jobs_deferred = 2;
666
667 // Time since the last job runs.
668 optional int64 time_since_last_job_millis = 3;
669}
670
Bookatzc1a050a2017-10-10 15:49:28 -0700671/**
672 * Logs when a job scheduler job state changes.
673 *
674 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700675 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700676 */
677message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800678 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700679
680 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800681 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700682
683 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800684 FINISHED = 0;
685 STARTED = 1;
686 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700687 }
688 optional State state = 3;
689
Tej Singh33a412b2018-03-16 18:43:59 -0700690 // The reason a job has stopped.
691 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700692 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700693 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700694}
695
696/**
697 * Logs when the audio state changes.
698 *
699 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700700 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700701 */
702message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800703 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700704
705 enum State {
706 OFF = 0;
707 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700708 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
709 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700710 }
711 optional State state = 2;
712}
713
714/**
715 * Logs when the video codec state changes.
716 *
717 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700718 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700719 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800720message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800721 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700722
723 enum State {
724 OFF = 0;
725 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700726 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
727 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700728 }
729 optional State state = 2;
730}
731
732/**
733 * Logs when the flashlight state changes.
734 *
735 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700736 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700737 */
738message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800739 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700740
741 enum State {
742 OFF = 0;
743 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700744 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
745 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700746 }
747 optional State state = 2;
748}
749
750/**
751 * Logs when the camera state changes.
752 *
753 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700754 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700755 */
756message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800757 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700758
759 enum State {
760 OFF = 0;
761 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700762 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
763 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700764 }
765 optional State state = 2;
766}
767
768/**
769 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000770 *
771 * Logged from:
772 * TODO
773 */
Bookatzd6746242017-10-24 18:39:35 -0700774message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800775 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000776
Bookatz1a1b0462018-01-12 11:47:03 -0800777 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
778 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700779 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700780
781 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
782 optional string tag = 3;
783
784 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800785 RELEASE = 0;
786 ACQUIRE = 1;
787 CHANGE_RELEASE = 2;
788 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700789 }
790 optional State state = 4;
791}
792
793/**
Bookatzc1a050a2017-10-10 15:49:28 -0700794 * Logs when a partial wakelock is considered 'long' (over 1 min).
795 *
796 * Logged from:
797 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
798 */
799message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800800 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700801
Yao Chend54f9dd2017-10-17 17:37:48 +0000802 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
803 optional string tag = 2;
804
Bookatzc1a050a2017-10-10 15:49:28 -0700805 // TODO: I have no idea what this is.
806 optional string history_tag = 3;
807
808 enum State {
809 OFF = 0;
810 ON = 1;
811 }
812 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000813}
814
Bookatzc1a050a2017-10-10 15:49:28 -0700815/**
Bookatza66083f2018-09-20 17:24:00 -0700816 * Logs when the device is interactive, according to the PowerManager Notifier.
817 *
818 * Logged from:
819 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
820 */
821message InteractiveStateChanged {
822 enum State {
823 OFF = 0;
824 ON = 1;
825 }
826 optional State state = 1;
827}
828
829/**
Bookatzc1a050a2017-10-10 15:49:28 -0700830 * Logs Battery Saver state change.
831 *
832 * Logged from:
833 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
834 */
835message BatterySaverModeStateChanged {
836 enum State {
837 OFF = 0;
838 ON = 1;
839 }
840 optional State state = 1;
841}
842
843/**
844 * Logs Doze mode state change.
845 *
846 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800847 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700848 */
849message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800850 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800851}
852
853
854/**
855 * Logs state change of Doze mode including maintenance windows.
856 *
857 * Logged from:
858 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
859 */
860message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800861 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700862}
863
864/**
865 * Logs screen brightness level.
866 *
867 * Logged from:
868 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
869 */
870message ScreenBrightnessChanged {
871 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
872 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700873}
874
875/**
876 * Logs battery level (percent full, from 0 to 100).
877 *
878 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700879 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700880 */
881message BatteryLevelChanged {
882 // Battery level. Should be in [0, 100].
883 optional int32 battery_level = 1;
884}
885
886/**
887 * Logs change in charging status of the device.
888 *
889 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700890 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700891 */
892message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800893 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
894 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700895}
896
897/**
898 * Logs whether the device is plugged in, and what power source it is using.
899 *
900 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700901 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700902 */
903message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800904 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
905 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700906}
907
Bookatz8c6571b2017-10-24 15:04:41 -0700908/**
909 * Logs when an app's wakeup alarm fires.
910 *
911 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700912 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700913 */
914message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800915 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800916
917 // Name of the wakeup alarm.
918 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700919
920 // Name of source package (for historical reasons, since BatteryStats tracked it).
921 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800922}
923
924/**
925 * Logs when an an app causes the mobile radio to change state.
926 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
927 *
928 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700929 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800930 */
931message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800932 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800933
Bookatz1a1b0462018-01-12 11:47:03 -0800934 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
935 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800936}
937
938/**
939 * Logs when an an app causes the wifi radio to change state.
940 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
941 *
942 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700943 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800944 */
945message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800946 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800947
Bookatz1a1b0462018-01-12 11:47:03 -0800948 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
949 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700950}
951
952/**
953 * Logs kernel wakeup reasons and aborts.
954 *
955 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700956 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700957 */
958message KernelWakeupReported {
959 // Name of the kernel wakeup reason (or abort).
960 optional string wakeup_reason_name = 1;
961
962 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800963 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700964}
965
966/**
Bookatzda1798c2018-12-13 14:16:00 -0800967 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800968 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800969 *
970 * Logged from:
971 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
972 */
973message WifiEnabledStateChanged {
974 enum State {
975 OFF = 0;
976 ON = 1;
977 }
978 optional State state = 1;
979}
980
981/**
982 * 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 -0800983 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
984 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800985 *
986 * Logged from:
987 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
988 */
989message WifiRunningStateChanged {
990 repeated AttributionNode attribution_node = 1;
991
992 enum State {
993 OFF = 0;
994 ON = 1;
995 }
996 optional State state = 2;
997}
998
999/**
Bookatze5885242017-10-24 20:10:31 -07001000 * Logs wifi locks held by an app.
1001 *
1002 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001003 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001004 */
1005message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001006 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001007
1008 enum State {
1009 OFF = 0;
1010 ON = 1;
1011 }
1012 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001013
1014 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1015 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001016}
1017
1018/**
1019 * Logs wifi signal strength changes.
1020 *
1021 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001022 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001023 */
1024message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001025 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1026 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001027}
1028
1029/**
1030 * Logs wifi scans performed by an app.
1031 *
1032 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001033 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001034 */
1035message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001036 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001037
1038 enum State {
1039 OFF = 0;
1040 ON = 1;
1041 }
1042 optional State state = 2;
1043}
1044
1045/**
Tej Singh4503e102018-01-04 14:35:01 -08001046 * Logs wifi multicast locks held by an app
1047 *
1048 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001049 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001050 */
1051message WifiMulticastLockStateChanged {
1052 repeated AttributionNode attribution_node = 1;
1053
1054 enum State {
1055 OFF = 0;
1056 ON = 1;
1057 }
1058 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001059
1060 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001061}
1062
1063/**
Tej Singh1ea42892018-01-19 09:27:00 -08001064 * Logs shutdown reason and duration on next boot.
1065 *
1066 * Logged from:
1067 * frameworks/base/core/java/com/android/server/BootReceiver.java
1068 */
1069message ShutdownSequenceReported {
1070 // True if shutdown is for a reboot. Default: false if we do not know.
1071 optional bool reboot = 1;
1072
1073 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1074 optional string reason = 2;
1075
1076 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1077 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001078 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001079
1080 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001081 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001082}
1083
Tej Singh6483ea42018-01-25 17:45:49 -08001084
1085/**
1086 * Logs boot reason and duration.
1087 *
1088 * Logged from:
1089 * system/core/bootstat/bootstat.cpp
1090 */
1091message BootSequenceReported {
1092 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1093 // Default: "<EMPTY>" if not available.
1094 optional string bootloader_reason = 1;
1095
1096 // Reason for system boot. Eg. bootloader, reboot,userrequested
1097 // Default: "<EMPTY>" if not available.
1098 optional string system_reason = 2;
1099
1100 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001101 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001102
1103 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001104 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001105
1106 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001107 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001108
1109 // Time since last boot in ms. Default: 0 if not available.
1110 optional int64 time_since_last_boot = 6;
1111}
1112
Tej Singhc477d9c2018-02-05 18:31:39 -08001113
1114/**
1115 * Logs call state and disconnect cause (if applicable).
1116 *
1117 * Logged from:
1118 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1119 */
1120message CallStateChanged {
1121 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1122 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1123 optional android.telecom.CallStateEnum call_state = 1;
1124
1125 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1126 // This value is only applicable when the call_state is DISCONNECTED, and
1127 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1128 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1129 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1130
1131 // True if the call is self-managed, which are apps that use the
1132 // telecom infrastructure to make their own calls.
1133 optional bool self_managed = 3;
1134
1135 // True if call is external. External calls are calls on connected Wear
1136 // devices but show up in Telecom so the user can pull them onto the device.
1137 optional bool external_call = 4;
1138}
1139
Tej Singh1ea42892018-01-19 09:27:00 -08001140/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001141 * Logs keyguard state. The keyguard is the lock screen.
1142 *
1143 * Logged from:
1144 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1145 */
1146message KeyguardStateChanged {
1147 enum State {
1148 UNKNOWN = 0;
1149 // The keyguard is hidden when the phone is unlocked.
1150 HIDDEN = 1;
1151 // The keyguard is shown when the phone is locked (screen turns off).
1152 SHOWN= 2;
1153 // The keyguard is occluded when something is overlaying the keyguard.
1154 // Eg. Opening the camera while on the lock screen.
1155 OCCLUDED = 3;
1156 }
1157 optional State state = 1;
1158}
1159
1160/**
1161 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1162 * prompts the user to enter a password (pattern, pin, etc).
1163 *
1164 * Logged from:
1165 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1166 */
1167
1168message KeyguardBouncerStateChanged {
1169 enum State {
1170 UNKNOWN = 0;
1171 // Bouncer is hidden, either as a result of successfully entering the
1172 // password, screen timing out, or user going back to lock screen.
1173 HIDDEN = 1;
1174 // This is when the user is being prompted to enter the password.
1175 SHOWN = 2;
1176 }
1177 optional State state = 1;
1178}
1179
1180/**
1181 * Logs the result of entering a password into the keyguard bouncer.
1182 *
1183 * Logged from:
1184 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1185 */
1186message KeyguardBouncerPasswordEntered {
1187 enum BouncerResult {
1188 UNKNOWN = 0;
1189 // The password entered was incorrect.
1190 FAILURE = 1;
1191 // The password entered was correct.
1192 SUCCESS = 2;
1193 }
1194 optional BouncerResult result = 1;
1195}
1196
Tej Singha883b372018-02-15 11:30:01 -08001197/*
1198 * Logs changes to the configuration of the device. The configuration is defined
1199 * in frameworks/base/core/java/android/content/res/Configuration.java
1200 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1201 * Please go there to interpret the possible values each field can be.
1202 *
1203 * Logged from:
1204 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1205 */
1206message ResourceConfigurationChanged {
1207 // Bit mask of color capabilities of the screen.
1208 // Contains information about the color gamut and hdr mode of the screen.
1209 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001210 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001211
1212 // The target screen density being rendered to.
1213 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001214 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001215
1216 // Current user preference for the scaling factor for fonts,
1217 // relative to the base density scaling.
1218 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001219 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001220
1221 // Flag indicating whether the hard keyboard is hidden.
1222 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001223 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001224
1225 // The type of keyboard attached to the device.
1226 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1227 optional int32 keyboard = 5;
1228
1229 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1230 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001231 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001232
1233 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1234 // 0 if undefined.
1235 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1236 optional int32 mcc = 7;
1237
1238 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1239 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1240 // MNC_ZERO symbol defined in Configuration.java.
1241 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1242 optional int32 mnc = 8;
1243
1244 // The kind of navigation available on the device.
1245 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1246 optional int32 navigation = 9;
1247
1248 // Flag indicating whether the navigation is available.
1249 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001250 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001251
1252 // Overall orientation of the screen.
1253 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1254 optional int32 orientation = 11;
1255
1256 // The current height of the available screen space, in dp units.
1257 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001258 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001259
1260 // Bit mask of overall layout of the screen.
1261 // Contains information about screen size, whether the screen is wider/taller
1262 // than normal, whether the screen layout is right-tl-left or left-to-right,
1263 // and whether the screen has a rounded shape.
1264 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001265 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001266
1267 // Current width of the available screen space, in dp units.
1268 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001269 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001270
1271 // The smallest screen size an application will see in normal operation.
1272 // This is the smallest value of both screenWidthDp and screenHeightDp
1273 // in portrait and landscape.
1274 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001275 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001276
1277 // The type of touch screen attached to the device.
1278 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1279 optional int32 touchscreen = 16;
1280
1281 // Bit mask of the ui mode.
1282 // Contains information about the overall ui mode of the device.
1283 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1284 // Also contains information about whether the device is in night mode.
1285 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001286 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001287}
1288
Tej Singheee317b2018-03-07 19:28:05 -08001289
1290/**
1291 * Logs changes in the connection state of the mobile radio.
1292 *
1293 * Logged from:
1294 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1295 */
1296message MobileConnectionStateChanged {
1297 // States are from the state machine DataConnection.java.
1298 enum State {
1299 UNKNOWN = 0;
1300 // The connection is inactive, or disconnected.
1301 INACTIVE = 1;
1302 // The connection is being activated, or connecting.
1303 ACTIVATING = 2;
1304 // The connection is active, or connected.
1305 ACTIVE = 3;
1306 // The connection is disconnecting.
1307 DISCONNECTING = 4;
1308 // The connection is disconnecting after creating a connection.
1309 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1310 }
1311 optional State state = 1;
1312 // For multi-sim phones, this distinguishes between the sim cards.
1313 optional int32 sim_slot_index = 2;
1314 // Used to identify the connection. Starts at 0 and increments by 1 for
1315 // every new network created. Resets whenever the device reboots.
1316 optional int32 data_connection_id = 3;
1317 // A bitmask for the capabilities of this connection.
1318 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1319 // Default value (if we have no information): 0
1320 optional int64 capabilities = 4;
1321 // If this connection has internet.
1322 // This just checks if the DEFAULT bit of capabilities is set.
1323 optional bool has_internet = 5;
1324}
1325
1326/**
1327 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1328 *
1329 * Logged from:
1330 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1331 */
1332message MobileRadioTechnologyChanged {
1333 optional android.telephony.NetworkTypeEnum state = 1;
1334 // For multi-sim phones, this distinguishes between the sim cards.
1335 optional int32 sim_slot_index = 2;
1336}
1337
Andrew Chantb56388b2018-03-22 21:07:33 -07001338/**
1339 * Logs the VID and PID of any connected USB devices.
1340 *
1341 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1342 *
1343 * Logged by Vendor.
1344 */
1345message UsbDeviceAttached {
1346 optional int32 vid = 1;
1347 optional int32 pid = 2;
1348 optional bool has_audio = 3;
1349 optional bool has_hid = 4;
1350 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001351 enum State {
1352 STATE_DISCONNECTED = 0;
1353 STATE_CONNECTED = 1;
1354 }
1355 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001356 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001357}
1358
Tej Singheee317b2018-03-07 19:28:05 -08001359
Tej Singhdd7bd352018-02-09 19:33:15 -08001360/**
Tej Singh5d991e12018-03-09 19:48:11 -08001361 * Logs when Bluetooth is enabled and disabled.
1362 *
1363 * Logged from:
1364 * services/core/java/com/android/server/BluetoothManagerService.java
1365 */
1366message BluetoothEnabledStateChanged {
1367 repeated AttributionNode attribution_node = 1;
1368 // Whether or not bluetooth is enabled on the device.
1369 enum State {
1370 UNKNOWN = 0;
1371 ENABLED = 1;
1372 DISABLED = 2;
1373 }
1374 optional State state = 2;
1375 // The reason for being enabled/disabled.
1376 // Eg. Airplane mode, crash, application request.
1377 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1378 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001379 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001380}
1381
1382/**
Jack Hed9837c82019-01-09 01:19:13 -08001383 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001384 *
1385 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001386 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1387 *
1388 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001389 */
1390message BluetoothConnectionStateChanged {
1391 // The state of the connection.
1392 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1393 optional android.bluetooth.ConnectionStateEnum state = 1;
1394 // An identifier that can be used to match connect and disconnect events.
1395 // Currently is last two bytes of a hash of a device level ID and
1396 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001397 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1398 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001399 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1400 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001401 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001402 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001403 // An identifier that can be used to match events for this device.
1404 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1405 // Salt: Randomly generated 256 bit value
1406 // Hash algorithm: HMAC-SHA256
1407 // Size: 32 byte
1408 // Default: null or empty if the device identifier is not known
1409 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1410}
1411
1412/**
1413 * Logs when a Bluetooth device connects and disconnects over ACL
1414 *
1415 * Logged from:
1416 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1417 *
1418 * Next Tag: 3
1419 */
1420message BluetoothAclConnectionStateChanged {
1421 // An identifier that can be used to match events for this device.
1422 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1423 // Salt: Randomly generated 256 bit value
1424 // Hash algorithm: HMAC-SHA256
1425 // Size: 32 byte
1426 // Default: null or empty if the device identifier is not known
1427 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1428 // The state of the connection.
1429 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1430 optional android.bluetooth.ConnectionStateEnum state = 2;
1431}
1432
1433/**
1434 * Logs when a Bluetooth device connects and disconnects over SCO
1435 *
1436 * Logged from:
1437 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1438 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1439 *
1440 * Next Tag: 4
1441 */
1442message BluetoothScoConnectionStateChanged {
1443 // An identifier that can be used to match events for this device.
1444 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1445 // Salt: Randomly generated 256 bit value
1446 // Hash algorithm: HMAC-SHA256
1447 // Size: 32 byte
1448 // Default: null or empty if the device identifier is not known
1449 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1450 // The state of the connection.
1451 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1452 optional android.bluetooth.ConnectionStateEnum state = 2;
1453 // Codec used for this SCO connection
1454 // Default: UNKNOWN
1455 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001456}
1457
Jack Hec27040a2019-01-09 20:54:41 -08001458/**
1459 * Logged when active device of a profile changes
1460 *
1461 * Logged from:
1462 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1463 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1464 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1465 */
1466message BluetoothActiveDeviceChanged {
1467 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1468 // From android.bluetooth.BluetoothProfile
1469 optional int32 bt_profile = 1;
1470 // An identifier that can be used to match events for this new active device.
1471 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1472 // Salt: Randomly generated 256 bit value
1473 // Hash algorithm: HMAC-SHA256
1474 // Size: 32 byte
1475 // Default: null or empty if there is no active device for this profile
1476 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1477}
1478
Jack Heab86dbd22018-12-18 15:43:27 -08001479// Logs when there is an event affecting Bluetooth device's link layer connection.
1480// - This event is triggered when there is a related HCI command or event
1481// - Users of this metrics can deduce Bluetooth device's connection state from these events
1482// - HCI commands are logged before the command is sent, after receiving command status, and after
1483// receiving command complete
1484// - HCI events are logged when they arrive
1485//
1486// Low level log from system/bt
1487//
1488// Bluetooth classic commands:
1489// - CMD_CREATE_CONNECTION
1490// - CMD_DISCONNECT
1491// - CMD_CREATE_CONNECTION_CANCEL
1492// - CMD_ACCEPT_CONNECTION_REQUEST
1493// - CMD_REJECT_CONNECTION_REQUEST
1494// - CMD_SETUP_ESCO_CONNECTION
1495// - CMD_ACCEPT_ESCO_CONNECTION
1496// - CMD_REJECT_ESCO_CONNECTION
1497// - CMD_ENH_SETUP_ESCO_CONNECTION
1498// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1499//
1500// Bluetooth low energy commands:
1501// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1502// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1503// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1504// - CMD_BLE_CLEAR_WHITE_LIST
1505// - CMD_BLE_ADD_WHITE_LIST
1506// - CMD_BLE_REMOVE_WHITE_LIST
1507//
1508// Bluetooth classic events:
1509// - EVT_CONNECTION_COMP
1510// - EVT_CONNECTION_REQUEST
1511// - EVT_DISCONNECTION_COMP
1512// - EVT_ESCO_CONNECTION_COMP
1513// - EVT_ESCO_CONNECTION_CHANGED
1514//
1515// Bluetooth low energy meta events:
1516// - BLE_EVT_CONN_COMPLETE_EVT
1517// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1518//
1519// Next tag: 10
1520message BluetoothLinkLayerConnectionEvent {
1521 // An identifier that can be used to match events for this device.
1522 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1523 // Salt: Randomly generated 256 bit value
1524 // Hash algorithm: HMAC-SHA256
1525 // Size: 32 byte
1526 // Default: null or empty if the device identifier is not known
1527 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1528 // Connection handle of this connection if available
1529 // Range: 0x0000 - 0x0EFF (12 bits)
1530 // Default: 0xFFFF if the handle is unknown
1531 optional int32 connection_handle = 2;
1532 // Direction of the link
1533 // Default: DIRECTION_UNKNOWN
1534 optional android.bluetooth.DirectionEnum direction = 3;
1535 // Type of this link
1536 // Default: LINK_TYPE_UNKNOWN
1537 optional android.bluetooth.LinkTypeEnum type = 4;
1538
1539 // Reason metadata for this link layer connection event, rules for interpretation:
1540 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1541 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1542 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1543 // set and valid, ignore hci_ble_event
1544
1545 // HCI command associated with this event
1546 // Default: CMD_UNKNOWN
1547 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1548 // HCI event associated with this event
1549 // Default: EVT_UNKNOWN
1550 optional android.bluetooth.hci.EventEnum hci_event = 6;
1551 // HCI BLE meta event associated with this event
1552 // Default: BLE_EVT_UNKNOWN
1553 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1554 // HCI command status code if this is triggerred by hci_cmd
1555 // Default: STATUS_UNKNOWN
1556 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1557 // HCI reason code associated with this event
1558 // Default: STATUS_UNKNOWN
1559 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1560}
1561
Howard Roe103fe22019-01-17 16:52:16 -08001562/**
1563 * Logs when a module is rolled back by Watchdog.
1564 *
1565 * Logged from: Rollback Manager
1566 */
1567message WatchdogRollbackOccurred {
1568 enum RollbackType {
1569 UNKNOWN = 0;
1570 ROLLBACK_INITIATE = 1;
1571 ROLLBACK_SUCCESS = 2;
1572 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001573 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001574 }
1575 optional RollbackType rollback_type = 1;
1576
1577 optional string package_name = 2;
1578
1579 optional int32 package_version_code = 3;
1580}
1581
Jack Hec27040a2019-01-09 20:54:41 -08001582/**
1583 * Logs when there is a change in Bluetooth A2DP playback state
1584 *
1585 * Logged from:
1586 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1587 */
1588message BluetoothA2dpPlaybackStateChanged {
1589 // An identifier that can be used to match events for this device.
1590 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1591 // Salt: Randomly generated 256 bit value
1592 // Hash algorithm: HMAC-SHA256
1593 // Size: 32 byte
1594 // Default: null or empty if the device identifier is not known
1595 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1596 // Current playback state
1597 // Default: PLAYBACK_STATE_UNKNOWN
1598 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1599 // Current audio coding mode
1600 // Default: AUDIO_CODING_MODE_UNKNOWN
1601 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1602}
1603
1604/**
1605 * Logs when there is a change in A2DP codec config for a particular remote device
1606 *
1607 * Logged from:
1608 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1609 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1610 */
1611message BluetoothA2dpCodecConfigChanged {
1612 // An identifier that can be used to match events for this device.
1613 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1614 // Salt: Randomly generated 256 bit value
1615 // Hash algorithm: HMAC-SHA256
1616 // Size: 32 byte
1617 // Default: null or empty if the device identifier is not known
1618 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1619 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1620 // Default SOURCE_CODEC_TYPE_INVALID
1621 optional int32 codec_type = 2;
1622 // Codec priroity, the higher the more preferred, -1 for disabled
1623 // Default: CODEC_PRIORITY_DEFAULT
1624 optional int32 codec_priority = 3;
1625 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1626 // Default: SAMPLE_RATE_NONE
1627 optional int32 sample_rate = 4;
1628 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1629 // Default: BITS_PER_SAMPLE_NONE
1630 optional int32 bits_per_sample = 5;
1631 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1632 // Default: CHANNEL_MODE_NONE
1633 optional int32 channel_mode = 6;
1634 // Codec specific values
1635 // Default 0
1636 optional int64 codec_specific_1 = 7;
1637 optional int64 codec_specific_2 = 8;
1638 optional int64 codec_specific_3 = 9;
1639 optional int64 codec_specific_4 = 10;
1640}
1641
1642/**
1643 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1644 * Each codec's capability is logged separately due to statsd restriction
1645 *
1646 * Logged from:
1647 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1648 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1649 */
1650message BluetoothA2dpCodecCapabilityChanged {
1651 // An identifier that can be used to match events for this device.
1652 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1653 // Salt: Randomly generated 256 bit value
1654 // Hash algorithm: HMAC-SHA256
1655 // Size: 32 byte
1656 // Default: null or empty if the device identifier is not known
1657 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1658 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1659 // Default SOURCE_CODEC_TYPE_INVALID
1660 optional int32 codec_type = 2;
1661 // Codec priroity, the higher the more preferred, -1 for disabled
1662 // Default: CODEC_PRIORITY_DEFAULT
1663 optional int32 codec_priority = 3;
1664 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1665 // in BluetoothCodecConfig
1666 // Default: empty and SAMPLE_RATE_NONE for individual item
1667 optional int32 sample_rate = 4;
1668 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1669 // in BluetoothCodecConfig
1670 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1671 optional int32 bits_per_sample = 5;
1672 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1673 // BluetoothCodecConfig
1674 // Default: empty and CHANNEL_MODE_NONE for individual item
1675 optional int32 channel_mode = 6;
1676 // Codec specific values
1677 // Default 0
1678 optional int64 codec_specific_1 = 7;
1679 optional int64 codec_specific_2 = 8;
1680 optional int64 codec_specific_3 = 9;
1681 optional int64 codec_specific_4 = 10;
1682}
1683
1684/**
1685 * Logs when A2DP failed to read from PCM source.
1686 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1687 *
1688 * Logged from:
1689 * system/bt
1690 */
1691message BluetoothA2dpAudioUnderrunReported {
1692 // An identifier that can be used to match events for this device.
1693 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1694 // Salt: Randomly generated 256 bit value
1695 // Hash algorithm: HMAC-SHA256
1696 // Size: 32 byte
1697 // Default: null or empty if the device identifier is not known
1698 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1699 // Encoding interval in nanoseconds
1700 // Default: 0
1701 optional int64 encoding_interval_nanos = 2;
1702 // Number of bytes of PCM data that could not be read from the source
1703 // Default: 0
1704 optional int32 num_missing_pcm_bytes = 3;
1705}
1706
1707/**
1708 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1709 * buffer queue is full and we have to drop data
1710 *
1711 * Logged from:
1712 * system/bt
1713 */
1714message BluetoothA2dpAudioOverrunReported {
1715 // An identifier that can be used to match events for this device.
1716 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1717 // Salt: Randomly generated 256 bit value
1718 // Hash algorithm: HMAC-SHA256
1719 // Size: 32 byte
1720 // Default: null or empty if the device identifier is not known
1721 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1722 // Encoding interval in nanoseconds
1723 // Default: 0
1724 optional int64 encoding_interval_nanos = 2;
1725 // Number of buffers dropped in this event
1726 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1727 // Default: 0
1728 optional int32 num_dropped_buffers = 3;
1729 // Number of encoded buffers dropped in this event
1730 // Default 0
1731 optional int32 num_dropped_encoded_frames = 4;
1732 // Number of encoded bytes dropped in this event
1733 // Default: 0
1734 optional int32 num_dropped_encoded_bytes = 5;
1735}
1736
1737/**
1738 * Logs when we receive reports regarding a device's RSSI value
1739 *
1740 * Logged from:
1741 * system/bt
1742 */
1743message BluetoothDeviceRssiReported {
1744 // An identifier that can be used to match events for this device.
1745 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1746 // Salt: Randomly generated 256 bit value
1747 // Hash algorithm: HMAC-SHA256
1748 // Size: 32 byte
1749 // Default: null or empty if the device identifier is not known
1750 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1751 // Connection handle of this connection if available
1752 // Range: 0x0000 - 0x0EFF (12 bits)
1753 // Default: 0xFFFF if the handle is unknown
1754 optional int32 connection_handle = 2;
1755 // HCI command status code if this is triggerred by hci_cmd
1756 // Default: STATUS_UNKNOWN
1757 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1758 // BR/EDR
1759 // Range: -128 ≤ N ≤ 127 (signed integer)
1760 // Units: dB
1761 // LE:
1762 // Range: -127 to 20, 127 (signed integer)
1763 // Units: dBm
1764 // Invalid when an out of range value is reported
1765 optional int32 rssi = 4;
1766}
1767
1768/**
1769 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1770 *
1771 * Logged from:
1772 * system/bt
1773 */
1774message BluetoothDeviceFailedContactCounterReported {
1775 // An identifier that can be used to match events for this device.
1776 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1777 // Salt: Randomly generated 256 bit value
1778 // Hash algorithm: HMAC-SHA256
1779 // Size: 32 byte
1780 // Default: null or empty if the device identifier is not known
1781 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1782 // Connection handle of this connection if available
1783 // Range: 0x0000 - 0x0EFF (12 bits)
1784 // Default: 0xFFFF if the handle is unknown
1785 optional int32 connection_handle = 2;
1786 // HCI command status code if this is triggerred by hci_cmd
1787 // Default: STATUS_UNKNOWN
1788 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1789 // Number of consecutive failed contacts for a connection corresponding to the Handle
1790 // Range: uint16_t, 0-0xFFFF
1791 // Default: 0xFFFFF
1792 optional int32 failed_contact_counter = 4;
1793}
1794
1795/**
1796 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1797 *
1798 * Logged from:
1799 * system/bt
1800 */
1801message BluetoothDeviceTxPowerLevelReported {
1802 // An identifier that can be used to match events for this device.
1803 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1804 // Salt: Randomly generated 256 bit value
1805 // Hash algorithm: HMAC-SHA256
1806 // Size: 32 byte
1807 // Default: null or empty if the device identifier is not known
1808 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1809 // Connection handle of this connection if available
1810 // Range: 0x0000 - 0x0EFF (12 bits)
1811 // Default: 0xFFFF if the handle is unknown
1812 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001813 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001814 // Default: STATUS_UNKNOWN
1815 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1816 // Range: -30 ≤ N ≤ 20
1817 // Units: dBm
1818 // Invalid when an out of range value is reported
1819 optional int32 transmit_power_level = 4;
1820}
Jack Heab86dbd22018-12-18 15:43:27 -08001821
Tej Singh5d991e12018-03-09 19:48:11 -08001822/**
Jack He1021a612019-01-20 21:22:46 -08001823 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1824 * receiving an HCI command from the host
1825 *
1826 * Logged from: system/bt
1827 */
1828message BluetoothHciTimeoutReported {
1829 // HCI command associated with this event
1830 // Default: CMD_UNKNOWN
1831 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1832}
1833
1834/**
1835 * Logs when we receive Bluetooth Link Quality Report event from the controller
1836 * See Android Bluetooth HCI specification for more details
1837 *
1838 * Note: all count and bytes field are counted since last event
1839 *
1840 * Logged from: system/bt
1841 */
1842message BluetoothQualityReportReported {
1843 // Quality report ID
1844 // Original type: uint8_t
1845 // Default: BQR_ID_UNKNOWN
1846 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1847 // Packet type of the connection
1848 // Original type: uint8_t
1849 // Default: BQR_PACKET_TYPE_UNKNOWN
1850 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1851 // Connection handle of the connection
1852 // Original type: uint16_t
1853 optional int32 connection_handle = 3;
1854 // Performing Role for the connection
1855 // Original type: uint8_t
1856 optional int32 connection_role = 4;
1857 // Current Transmit Power Level for the connection. This value is the same as the controller's
1858 // response to the HCI_Read_Transmit_Power_Level HCI command
1859 // Original type: uint8_t
1860 optional int32 tx_power_level = 5;
1861 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1862 // absolute receiver signal strength value
1863 // Original type: int8_t
1864 optional int32 rssi = 6;
1865 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1866 // channels used by the link currently
1867 // Original type: uint8_t
1868 optional int32 snr = 7;
1869 // Indicates the number of unused channels in AFH_channel_map
1870 // Original type: uint8_t
1871 optional int32 unused_afh_channel_count = 8;
1872 // Indicates the number of the channels which are interfered and quality is bad but are still
1873 // selected for AFH
1874 // Original type: uint8_t
1875 optional int32 afh_select_unideal_channel_count = 9;
1876 // Current Link Supervision Timeout Setting
1877 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1878 // Original type: uint16_t
1879 optional int32 lsto = 10;
1880 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1881 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1882 // 0x01 (Piconet Clock)
1883 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1884 // Original type: uint32_t
1885 optional int64 connection_piconet_clock = 11;
1886 // The count of retransmission
1887 // Original type: uint32_t
1888 optional int64 retransmission_count = 12;
1889 // The count of no RX
1890 // Original type: uint32_t
1891 optional int64 no_rx_count = 13;
1892 // The count of NAK (Negative Acknowledge)
1893 // Original type: uint32_t
1894 optional int64 nak_count = 14;
1895 // Controller timestamp of last TX ACK
1896 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1897 // Original type: uint32_t
1898 optional int64 last_tx_ack_timestamp = 15;
1899 // The count of Flow-off (STOP)
1900 // Original type: uint32_t
1901 optional int64 flow_off_count = 16;
1902 // Controller timestamp of last Flow-on (GO)
1903 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1904 // Original type: uint32_t
1905 optional int64 last_flow_on_timestamp = 17;
1906 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1907 // Original type: uint32_t
1908 optional int64 buffer_overflow_bytes = 18;
1909 // Buffer underflow count (in byte) since last event
1910 // Original type: uint32_t
1911 optional int64 buffer_underflow_bytes = 19;
1912}
1913
1914/**
1915 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1916 *
1917 * Notes:
1918 * - Each event can be partially filled as we might learn different pieces of device
1919 * information at different time
1920 * - Multiple device info events can be combined to give more complete picture
1921 * - When multiple device info events tries to describe the same information, the
1922 * later one wins
1923 *
1924 * Logged from:
1925 * packages/apps/Bluetooth
1926 */
1927message BluetoothManufacturerInfoReported {
1928 // An identifier that can be used to match events for this device.
1929 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1930 // Salt: Randomly generated 256 bit value
1931 // Hash algorithm: HMAC-SHA256
1932 // Size: 32 byte
1933 // Default: null or empty if the device identifier is not known
1934 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1935 // Where is this device info obtained from
1936 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1937 // Name of the data source
1938 // For EXTERNAL: package name of the data source
1939 // For INTERNAL: null for general case, component name otherwise
1940 optional string source_name = 3;
1941 // Name of the manufacturer of this device
1942 optional string manufacturer = 4;
1943 // Model of this device
1944 optional string model = 5;
1945 // Hardware version of this device
1946 optional string hardware_version = 6;
1947 // Software version of this device
1948 optional string software_version = 7;
1949}
1950
1951/**
1952 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1953 * device, as documented by the Bluetooth Core HCI specification
1954 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1955 * Vol 2, Part E, Page 1118
1956 *
1957 * Logged from:
1958 * system/bt
1959 */
1960message BluetoothRemoteVersionInfoReported {
1961 // Connection handle of the connection
1962 // Original type: uint16_t
1963 optional int32 connection_handle = 1;
1964 // HCI command status code
1965 // Default: STATUS_UNKNOWN
1966 optional android.bluetooth.hci.StatusEnum hci_status = 2;
1967 // 1 byte Version of current LMP in the remote controller
1968 optional int32 lmp_version = 3;
1969 // 2 bytes LMP manufacturer code of the remote controller
1970 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
1971 optional int32 lmp_manufacturer_code = 4;
1972 // 4 bytes subversion of the LMP in the remote controller
1973 optional int32 lmp_subversion = 5;
1974}
1975
1976/**
1977 * Logs when certain Bluetooth SDP attributes are discovered
1978 * Constant definitions are from:
1979 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
1980 *
1981 * Current logged attributes:
1982 * - BluetoothProfileDescriptorList
1983 * - Supported Features Bitmask
1984 *
1985 * Logged from:
1986 * system/bt
1987 */
1988message BluetoothSdpAttributeReported {
1989 // An identifier that can be used to match events for this device.
1990 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1991 // Salt: Randomly generated 256 bit value
1992 // Hash algorithm: HMAC-SHA256
1993 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1994 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
1995 // Original type: uint16_t
1996 optional int32 protocol_uuid = 2;
1997 // Short form UUIDs used to identify Bluetooth SDP attribute types
1998 // Original type: uint16_t
1999 optional int32 attribute_id = 3;
2000 // Attribute value for the particular attribute
2001 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2002}
2003
2004/**
2005 * Logs when bond state of a Bluetooth device changes
2006 *
2007 * Logged from:
2008 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2009 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2010 */
2011message BluetoothBondStateChanged {
2012 // An identifier that can be used to match events for this device.
2013 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2014 // Salt: Randomly generated 256 bit value
2015 // Hash algorithm: HMAC-SHA256
2016 // Size: 32 byte
2017 // Default: null or empty if the device identifier is not known
2018 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2019 // Preferred transport type to remote dual mode device
2020 // Default: TRANSPORT_AUTO means no preference
2021 optional android.bluetooth.TransportTypeEnum transport = 2;
2022 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2023 // Default: UNKNOWN
2024 optional android.bluetooth.DeviceTypeEnum type = 3;
2025 // Current bond state (NONE, BONDING, BONDED)
2026 // Default: BOND_STATE_UNKNOWN
2027 optional android.bluetooth.BondStateEnum bond_state = 4;
2028 // Bonding sub state
2029 // Default: BOND_SUB_STATE_UNKNOWN
2030 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2031 // Unbond Reason
2032 // Default: UNBOND_REASON_UNKNOWN
2033 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2034}
2035
2036/**
2037 * Logs there is an event related Bluetooth classic pairing
2038 *
2039 * Logged from:
2040 * system/bt
2041 */
2042message BluetoothClassicPairingEventReported {
2043 // An identifier that can be used to match events for this device.
2044 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2045 // Salt: Randomly generated 256 bit value
2046 // Hash algorithm: HMAC-SHA256
2047 // Size: 32 byte
2048 // Default: null or empty if the device identifier is not known
2049 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2050 // Connection handle of this connection if available
2051 // Range: 0x0000 - 0x0EFF (12 bits)
2052 // Default: 0xFFFF if the handle is unknown
2053 optional int32 connection_handle = 2;
2054 // HCI command associated with this event
2055 // Default: CMD_UNKNOWN
2056 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2057 // HCI event associated with this event
2058 // Default: EVT_UNKNOWN
2059 optional android.bluetooth.hci.EventEnum hci_event = 4;
2060 // HCI command status code if this is triggerred by hci_cmd
2061 // Default: STATUS_UNKNOWN
2062 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2063 // HCI reason code associated with this event
2064 // Default: STATUS_UNKNOWN
2065 optional android.bluetooth.hci.StatusEnum reason_code = 6;
2066}
2067
2068/**
2069 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2070 *
2071 * Logged from:
2072 * system/bt
2073 */
2074message BluetoothSmpPairingEventReported {
2075 // An identifier that can be used to match events for this device.
2076 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2077 // Salt: Randomly generated 256 bit value
2078 // Hash algorithm: HMAC-SHA256
2079 // Size: 32 byte
2080 // Default: null or empty if the device identifier is not known
2081 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2082 // SMP command sent or received over L2CAP
2083 // Default: CMD_UNKNOWN
2084 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2085 // Whether this command is sent or received
2086 // Default: DIRECTION_UNKNOWN
2087 optional android.bluetooth.DirectionEnum direction = 3;
2088 // SMP failure reason code
2089 // Default: PAIRING_FAIL_REASON_DEFAULT
2090 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2091}
2092
2093/**
Jack He815cdba2019-01-30 17:24:55 -08002094 * Logs when a Bluetooth socket’s connection state changed
2095 *
2096 * Logged from:
2097 * system/bt
2098 */
2099message BluetoothSocketConnectionStateChanged {
2100 // An identifier that can be used to match events for this device.
2101 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2102 // Salt: Randomly generated 256 bit value
2103 // Hash algorithm: HMAC-SHA256
2104 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002105 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002106 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002107 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002108 // Default 0 when unknown or don't care
2109 optional int32 port = 2;
2110 // Socket type as mentioned in
2111 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2112 // Default: SOCKET_TYPE_UNKNOWN
2113 optional android.bluetooth.SocketTypeEnum type = 3;
2114 // Socket connection state
2115 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2116 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2117 // Number of bytes sent to remote device during this connection
2118 optional int64 tx_bytes = 5;
2119 // Number of bytes received from remote device during this connection
2120 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002121 // Socket owner's UID
2122 optional int32 uid = 7 [(is_uid) = true];
2123 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2124 // |port| must be spawned by |server_port|
2125 // Default 0 when unknown or don't care
2126 optional int32 server_port = 8;
2127 // Whether this is a server listener socket
2128 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002129}
2130
2131/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002132 * Logs when something is plugged into or removed from the USB-C connector.
2133 *
2134 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002135 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002136 */
2137message UsbConnectorStateChanged {
2138 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002139 STATE_DISCONNECTED = 0;
2140 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002141 }
2142 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002143 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002144 // Last active session in ms.
2145 // 0 when the port is in connected state.
2146 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002147}
2148
2149/**
2150 * Logs the reported speaker impedance.
2151 *
2152 * Logged from:
2153 * Vendor audio implementation.
2154 */
2155message SpeakerImpedanceReported {
2156 optional int32 speaker_location = 1;
2157 optional int32 impedance = 2;
2158}
2159
2160/**
2161 * Logs the report of a failed hardware.
2162 *
2163 * Logged from:
2164 * Vendor HALs.
2165 *
2166 */
2167message HardwareFailed {
2168 enum HardwareType {
2169 HARDWARE_FAILED_UNKNOWN = 0;
2170 HARDWARE_FAILED_MICROPHONE = 1;
2171 HARDWARE_FAILED_CODEC = 2;
2172 HARDWARE_FAILED_SPEAKER = 3;
2173 HARDWARE_FAILED_FINGERPRINT = 4;
2174 }
2175 optional HardwareType hardware_type = 1;
2176
Maggie White6dcd8572019-01-31 14:11:50 -08002177 /**
2178 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002179 * the same hardware_type. The specific locations are vendor defined integers,
2180 * referring to board-specific numbering schemes.
2181 */
2182 optional int32 hardware_location = 2;
2183
Maggie White6dcd8572019-01-31 14:11:50 -08002184 /**
2185 * failure_code is specific to the HardwareType of the failed hardware.
2186 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002187 */
Maggie White6dcd8572019-01-31 14:11:50 -08002188 enum HardwareErrorCode {
2189 UNKNOWN = 0;
2190 COMPLETE = 1;
2191 SPEAKER_HIGH_Z = 2;
2192 SPEAKER_SHORT = 3;
2193 FINGERPRINT_SENSOR_BROKEN = 4;
2194 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002195 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002196 }
2197 optional int32 failure_code = 3;
2198}
2199
2200/**
2201 * Log an event when the device has been physically dropped.
2202 * Reported from the /vendor partition.
2203 */
2204message PhysicalDropDetected {
2205 // Confidence that the event was actually a drop, 0 -> 100
2206 optional int32 confidence_pctg = 1;
2207 // Peak acceleration of the drop, in 1/1000s of a g.
2208 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002209 // Duration of freefall in ms
2210 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002211}
2212
2213/**
2214 * Log bucketed battery charge cycles.
2215 *
2216 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002217 * a given charge point. For example, if 10 cycle buckets are
2218 * initialized, bucket 1 is the lowest 1/10th of the battery,
2219 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002220 *
2221 * Logged from:
2222 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2223 */
2224message ChargeCyclesReported {
2225 optional int32 cycle_bucket_1 = 1;
2226 optional int32 cycle_bucket_2 = 2;
2227 optional int32 cycle_bucket_3 = 3;
2228 optional int32 cycle_bucket_4 = 4;
2229 optional int32 cycle_bucket_5 = 5;
2230 optional int32 cycle_bucket_6 = 6;
2231 optional int32 cycle_bucket_7 = 7;
2232 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002233 optional int32 cycle_bucket_9 = 9;
2234 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002235}
2236
2237/**
Howard Roa46b6582018-09-18 16:45:02 -07002238 * Log battery health snapshot.
2239 *
2240 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2241 * are snapshotted periodically over 24hrs.
2242 */
2243message BatteryHealthSnapshot {
2244 enum BatterySnapshotType {
2245 UNKNOWN = 0;
2246 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2247 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2248 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2249 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2250 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2251 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2252 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2253 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2254 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2255 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2256 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2257 }
2258 optional BatterySnapshotType type = 1;
2259 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002260 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002261 // Voltage Battery Voltage, in microVolts.
2262 optional int32 voltage_micro_volt = 3;
2263 // Current Battery current, in microAmps.
2264 optional int32 current_micro_amps = 4;
2265 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2266 optional int32 open_circuit_micro_volt = 5;
2267 // Resistance Battery Resistance, in microOhms.
2268 optional int32 resistance_micro_ohm = 6;
2269 // Level Battery Level, as % of full.
2270 optional int32 level_percent = 7;
2271}
2272
2273/**
2274 * Log slow I/O operations on the primary storage.
2275 */
2276message SlowIo {
2277 // Classifications of IO Operations.
2278 enum IoOperation {
2279 UNKNOWN = 0;
2280 READ = 1;
2281 WRITE = 2;
2282 UNMAP = 3;
2283 SYNC = 4;
2284 }
2285 optional IoOperation operation = 1;
2286
2287 // The number of slow IO operations of this type over 24 hours.
2288 optional int32 count = 2;
2289}
2290
2291/**
2292 * Log battery caused shutdown with the last recorded voltage.
2293 */
2294message BatteryCausedShutdown {
2295 // The last recorded battery voltage prior to shutdown.
2296 optional int32 last_recorded_micro_volt = 1;
2297}
2298
2299/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002300 * Logs the duration of a davey (jank of >=700ms) when it occurs
2301 *
2302 * Logged from:
2303 * frameworks/base/libs/hwui/JankTracker.cpp
2304 */
2305message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002306 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002307 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002308
Tej Singhbb8554a2018-01-26 11:59:14 -08002309 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002310 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002311}
2312
2313/**
Bookatze5885242017-10-24 20:10:31 -07002314 * Logs phone signal strength changes.
2315 *
2316 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002317 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002318 */
2319message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002320 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2321 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002322}
2323
Yangster4ccebea2018-10-09 17:09:02 -07002324
2325/**
2326 * Logs when the phone state, sim state or signal strength changes
2327 *
2328 * Logged from:
2329 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2330 */
2331message PhoneServiceStateChanged {
2332 optional android.telephony.ServiceStateEnum state = 1;
2333 optional android.telephony.SimStateEnum sim_state = 2;
2334 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2335}
2336
2337/**
2338 * Logs when the phone becomes on or off.
2339 *
2340 * Logged from:
2341 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2342 */
2343message PhoneStateChanged {
2344 enum State {
2345 OFF = 0;
2346 ON = 1;
2347 }
2348 optional State state = 1;
2349}
2350
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002351message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002352 optional android.stats.launcher.LauncherAction action = 1;
2353 optional android.stats.launcher.LauncherState src_state = 2;
2354 optional android.stats.launcher.LauncherState dst_state = 3;
2355 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002356 optional bool is_swipe_up_enabled = 5;
2357}
2358
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002359message StyleUIChanged {
2360 optional android.stats.style.Action action = 1;
2361 optional int32 color_package_hash = 2;
2362 optional int32 font_package_hash = 3;
2363 optional int32 shape_package_hash = 4;
2364 optional int32 clock_package_hash = 5;
2365 optional int32 launcher_grid = 6;
2366 optional int32 wallpaper_category_hash = 7;
2367 optional int32 wallpaper_id_hash = 8;
2368}
2369
David Chenc28b2bb2017-10-24 12:52:52 -07002370/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002371 * Logs when Settings UI has changed.
2372 *
2373 * Logged from:
2374 * packages/apps/Settings
2375 */
2376message SettingsUIChanged {
2377 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002378 * Where this SettingsUIChange event comes from. For example, if
2379 * it's a PAGE_VISIBLE event, where the page is opened from.
2380 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002381 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002382
2383 /**
2384 * What the UI action is.
2385 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002386 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002387
2388 /**
2389 * Where the action is happening
2390 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002391 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002392
2393 /**
2394 * What preference changed in this event.
2395 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002396 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002397
2398 /**
2399 * The new value of the changed preference.
2400 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002401 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002402}
2403
2404/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002405 * Logs basic timing information about touch events.
2406 * Reported at most every 5 minutes while device is being interacted with.
2407 *
2408 * Logged from:
2409 * frameworks/native/services/inputflinger
2410 */
2411message TouchEventReported {
2412 /**
2413 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2414 * and the standard deviation of latency between the kernel and framework
2415 * for touchscreen events. The units are microseconds.
2416 *
2417 * The number is measured as the difference between the time at which
2418 * the input event was received in the evdev driver,
2419 * and the time at which the input event was received in EventHub.
2420 */
2421 // Minimum value
2422 optional float latency_min_micros = 1;
2423 // Maximum value
2424 optional float latency_max_micros = 2;
2425 // Average value
2426 optional float latency_mean_micros = 3;
2427 // Standard deviation
2428 optional float latency_stdev_micros = 4;
2429}
2430
2431/**
Philip Quinn0eded622019-01-29 12:46:28 -08002432 * Logs gesture classification and timing information for touch events.
2433 *
2434 * Logged from:
2435 * frameworks/base/core/java/android/view/GestureDetector.java
2436 * frameworks/base/core/java/android/view/View.java
2437 */
2438message TouchGestureClassified {
2439 // The source of the classification (e.g. Java class name).
2440 optional string source = 1;
2441
2442 enum Classification {
2443 UNKNOWN_CLASSIFICATION = 0;
2444 SINGLE_TAP = 1;
2445 DOUBLE_TAP = 2;
2446 LONG_PRESS = 3;
2447 DEEP_PRESS = 4;
2448 SCROLL = 5;
2449 }
2450 // The classification of the gesture.
2451 optional Classification classification = 2;
2452
2453 // The interval from the start of a touch event stream until the
2454 // classification was made.
2455 optional int32 latency_millis = 3;
2456
2457 // The distance from the location of the first touch event to the
2458 // location of the touch event when the classification was made.
2459 optional float displacement_px = 4;
2460}
2461
2462/**
David Chenc28b2bb2017-10-24 12:52:52 -07002463 * Logs that a setting was updated.
2464 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002465 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002466 * The tag and is_default allow resetting of settings to default values based on the specified
2467 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2468 */
2469message SettingChanged {
2470 // The name of the setting.
2471 optional string setting = 1;
2472
2473 // The change being imposed on this setting. May represent a number, eg "3".
2474 optional string value = 2;
2475
2476 // The new value of this setting. For most settings, this is same as value. For some settings,
2477 // value is +X or -X where X represents an element in a set. For example, if the previous value
2478 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2479 // The +/- feature is currently only used for location_providers_allowed.
2480 optional string new_value = 3;
2481
2482 // The previous value of this setting.
2483 optional string prev_value = 4;
2484
2485 // The tag used with the is_default for resetting sets of settings. This is generally null.
2486 optional string tag = 5;
2487
Bookatz90867622018-01-31 15:05:57 -08002488 // True if this setting with tag should be resettable.
2489 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002490
David Chenbd789912018-03-16 17:19:55 -07002491 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002492 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002493
2494 enum ChangeReason {
2495 UPDATED = 1; // Updated can be an insertion or an update.
2496 DELETED = 2;
2497 }
2498 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002499}
Chenjie Yub3dda412017-10-24 13:41:59 -07002500
Chenjie Yu05013b32017-11-21 10:21:41 -08002501/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002502 * Logs activity going to foreground or background
2503 *
2504 * Logged from:
2505 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2506 */
2507message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002508 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002509 optional string pkg_name = 2;
2510 optional string class_name = 3;
2511
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002512 enum State {
2513 BACKGROUND = 0;
2514 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002515 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002516 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002517}
David Chenc8a43242017-10-17 16:23:28 -07002518
2519/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002520 * Logs when a volume entered low Storage state.
2521 * Logged from:
2522 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2523 */
2524message LowStorageStateChanged {
2525 // Volume that ran out of storage.
2526 optional string volume_description = 1;
2527
2528 enum State {
2529 UNKNOWN = 0;
2530 OFF = 1;
2531 ON = 2;
2532 }
2533 optional State state = 2;
2534}
2535
2536/**
2537 * Logs when an app is downgraded.
2538 * Logged from:
2539 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2540 */
2541message AppDowngraded {
2542 optional string package_name = 1;
2543 // Size of the package (all data) before being downgraded.
2544 optional int64 size_in_bytes_before = 2;
2545 // Size of the package (all data) after being downgraded.
2546 optional int64 size_in_bytes_after = 3;
2547
2548 optional bool aggressive = 4;
2549}
2550
2551/**
2552 * Logs when an app is optimized after being downgraded.
2553 * Logged from:
2554 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2555 */
2556message AppOptimizedAfterDowngraded {
2557 optional string package_name = 1;
2558}
2559
2560/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002561 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002562 * Logged from:
2563 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2564 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002565message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002566 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002567
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002568 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002569
2570 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002571 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002572 optional string process_name = 3;
2573
2574 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002575 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002576
2577 optional string package_name = 5;
2578
2579 enum InstantApp {
2580 UNAVAILABLE = 0;
2581 FALSE = 1;
2582 TRUE = 2;
2583 }
2584 optional InstantApp is_instant_app = 6;
2585
2586 enum ForegroundState {
2587 UNKNOWN = 0;
2588 BACKGROUND = 1;
2589 FOREGROUND = 2;
2590 }
2591 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002592
2593 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002594}
David Chen9e3808c2017-11-20 17:25:34 -08002595
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002596/**
2597 * Logs when a WTF (What a Terrible Failure) happened.
2598 * Logged from:
2599 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2600 */
2601message WTFOccurred {
2602 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002603
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002604 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002605
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002606 // The name of the process.
2607 // system_server if it is not by an app
2608 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002609
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002610 // The pid if available. -1 means not available.
2611 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002612
2613 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002614}
2615
2616/**
2617 * Logs when system server reports low memory.
2618 * Logged from:
2619 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2620 */
2621message LowMemReported {
2622}
2623
2624/**
2625 * Logs when an app ANR (App Not Responding) occurs.
2626 * Logged from:
2627 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2628 */
2629message ANROccurred {
2630 optional int32 uid = 1 [(is_uid) = true];
2631
2632 optional string process_name = 2;
2633
2634 optional string short_component_name = 3;
2635
2636 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002637
2638 enum InstantApp {
2639 UNAVAILABLE = 0;
2640 FALSE = 1;
2641 TRUE = 2;
2642 }
2643 optional InstantApp is_instant_app = 5;
2644
2645 enum ForegroundState {
2646 UNKNOWN = 0;
2647 BACKGROUND = 1;
2648 FOREGROUND = 2;
2649 }
2650 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002651
2652 optional android.server.ErrorSource error_source = 7;
2653
2654 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002655}
2656
Bookatza7020bd2018-08-28 16:29:35 -07002657/**
2658 * Logs when the vibrator state changes.
2659 * Logged from:
2660 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2661 */
2662message VibratorStateChanged {
2663 repeated AttributionNode attribution_node = 1;
2664
2665 enum State {
2666 OFF = 0;
2667 ON = 1;
2668 }
2669 optional State state = 2;
2670
2671 // Duration (in milliseconds) requested to keep the vibrator on.
2672 // Only applicable for State == ON.
2673 optional int64 duration_millis = 3;
2674}
2675
David Chen0a368b22017-12-06 16:28:16 -08002676/*
2677 * Allows other apps to push events into statsd.
2678 * Logged from:
2679 * frameworks/base/core/java/android/util/StatsLog.java
2680 */
David Chen0b5c90c2018-01-25 16:51:49 -08002681message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002682 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002683 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002684
2685 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2686 optional int32 label = 2;
2687
2688 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2689 // predicates for the metrics).
2690 enum State {
2691 UNKNOWN = 0;
2692 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2693 STOP = 2;
2694 START = 3;
2695 }
2696 optional State state = 3;
2697}
2698
David Chen9e3808c2017-11-20 17:25:34 -08002699/**
Bookatz7948c872018-09-04 12:58:33 -07002700 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2701 * For example, this could be due to the user manually changing the time.
2702 *
2703 * Logged from:
2704 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2705 */
2706message WallClockTimeShifted {
2707 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2708 optional int64 wall_clock_timestamp_millis = 1;
2709}
2710
2711/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002712 * Logs when statsd detects an anomaly.
2713 *
2714 * Logged from:
2715 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2716 */
2717message AnomalyDetected {
2718 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002719 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002720
Yangster-mac94e197c2018-01-02 16:03:03 -08002721 // Id of the config whose anomaly detection alert fired.
2722 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002723
Yangster-mac94e197c2018-01-02 16:03:03 -08002724 // Id of the alert (i.e. name of the anomaly that was detected).
2725 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002726}
2727
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002728message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002729 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002730 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002731
2732 // The app package name.
2733 optional string pkg_name = 2;
2734
2735 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002736 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002737 WARM = 1;
2738 HOT = 2;
2739 COLD = 3;
2740 }
2741 // The transition type.
2742 optional TransitionType type = 3;
2743
2744 // The activity name.
2745 optional string activity_name = 4;
2746
2747 // The name of the calling app. Empty if not set.
2748 optional string calling_pkg_name = 5;
2749
2750 // Whether the app is an instant app.
2751 optional bool is_instant_app = 6;
2752
2753 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002754 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002755
Bookatz80d11a02018-01-16 10:46:35 -08002756 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002757
David Chen0b5c90c2018-01-25 16:51:49 -08002758 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002759 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002760 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002761 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002762 optional int32 bind_application_delay_millis = 11;
2763 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002764
2765 // Empty if not set.
2766 optional string launch_token = 13;
2767
Calin Juravle759fbda2018-02-20 19:52:30 +00002768 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002769 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002770
2771 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002772 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002773}
2774
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002775message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002776 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002777 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002778
2779 // The app package name.
2780 optional string pkg_name = 2;
2781
2782 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002783 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002784 WARM = 1;
2785 HOT = 2;
2786 COLD = 3;
2787 }
2788 // The transition type.
2789 optional TransitionType type = 3;
2790
2791 // The activity name.
2792 optional string activity_name = 4;
2793}
2794
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002795message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002796 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002797 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002798
2799 // The app package name.
2800 optional string pkg_name = 2;
2801
2802 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002803 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002804 WITH_BUNDLE = 1;
2805 WITHOUT_BUNDLE = 2;
2806 }
2807 // The transition type.
2808 optional TransitionType type = 3;
2809
2810 // The activity name.
2811 optional string activity_name = 4;
2812
2813 optional bool transition_process_running = 5;
2814
2815 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002816 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002817}
2818
Bookatz8fcd09a2017-12-18 13:01:10 -08002819/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002820 * Logs a picture-in-picture action
2821 * Logged from:
2822 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2823 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2824 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2825 */
2826message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002827 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002828 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002829
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002830 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002831
Chenjie Yu52cacc62017-12-08 18:11:45 -08002832 enum State {
2833 ENTERED = 1;
2834 EXPANDED_TO_FULL_SCREEN = 2;
2835 MINIMIZED = 3;
2836 DISMISSED = 4;
2837 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002838 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002839}
2840
2841/**
Chenjie Yue8904192017-12-08 19:12:57 -08002842 * Logs overlay action
2843 * Logged from:
2844 * services/core/java/com/android/server/wm/Session.java
2845 */
2846message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002847 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002848
2849 optional string package_name = 2;
2850
2851 optional bool using_alert_window = 3;
2852
2853 enum State {
2854 ENTERED = 1;
2855 EXITED = 2;
2856 }
2857 optional State state = 4;
2858}
2859
Chenjie Yuccfe6452018-01-30 11:33:21 -08002860/*
2861 * Logs foreground service starts and stops.
2862 * Note that this is not when a service starts or stops, but when it is
2863 * considered foreground.
2864 * Logged from
2865 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2866 */
2867message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002868 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002869 // package_name + "/" + class_name
2870 optional string short_name = 2;
2871
2872 enum State {
2873 ENTER = 1;
2874 EXIT = 2;
2875 }
2876 optional State state = 3;
2877}
2878
Chenjie Yue8904192017-12-08 19:12:57 -08002879/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002880 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2881 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2882 * attributed back to the parent (host) uid. One example is Chrome.
2883 *
2884 * Logged from:
2885 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2886 */
2887message IsolatedUidChanged {
2888 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002889 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002890 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002891 optional int32 parent_uid = 1;
2892
2893 optional int32 isolated_uid = 2;
2894
2895 // We expect an isolated uid to be removed before if it's used for another parent uid.
2896 enum Event {
2897 REMOVED = 0;
2898 CREATED = 1;
2899 }
2900 optional Event event = 3;
2901}
2902
2903/*
2904 * Logs the reception of an incoming network packet causing the main system to wake up for
2905 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2906 * and processed by WakeupController.cpp.
2907 */
2908message PacketWakeupOccurred {
2909 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2910 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002911 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002912 // The interface name on which the packet was received.
2913 optional string iface = 2;
2914 // The ethertype value of the packet.
2915 optional int32 ethertype = 3;
2916 // String representation of the destination MAC address of the packet.
2917 optional string destination_hardware_address = 4;
2918 // String representation of the source address of the packet if this was an IP packet.
2919 optional string source_ip = 5;
2920 // String representation of the destination address of the packet if this was an IP packet.
2921 optional string destination_ip = 6;
2922 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2923 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2924 // families.
2925 optional int32 ip_next_header = 7;
2926 // The source port if this was a TCP or UDP packet.
2927 optional int32 source_port = 8;
2928 // The destination port if this was a TCP or UDP packet.
2929 optional int32 destination_port = 9;
2930}
2931
2932/*
2933 * Logs the memory stats for an app on startup.
2934 * Logged from:
2935 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2936 */
2937message AppStartMemoryStateCaptured {
2938 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002939 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002940
2941 // The process name.
2942 optional string process_name = 2;
2943
2944 // The activity name.
2945 optional string activity_name = 3;
2946
2947 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002948 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002949
2950 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002951 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002952
2953 // RSS
2954 optional int64 rss_in_bytes = 6;
2955
2956 // CACHE
2957 optional int64 cache_in_bytes = 7;
2958
2959 // SWAP
2960 optional int64 swap_in_bytes = 8;
2961}
2962
2963/*
2964 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2965 * for LMK event.
2966 * Logged from:
2967 * system/core/lmkd/lmkd.c
2968 */
2969message LmkStateChanged {
2970 enum State {
2971 UNKNOWN = 0;
2972 START = 1;
2973 STOP = 2;
2974 }
2975 optional State state = 1;
2976}
2977
2978/*
2979 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2980 * Logged from:
2981 * system/core/lmkd/lmkd.c
2982 */
2983message LmkKillOccurred {
2984 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002985 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002986
2987 // The process name.
2988 optional string process_name = 2;
2989
2990 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002991 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002992
2993 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002994 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002995
2996 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002997 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002998
2999 // RSS
3000 optional int64 rss_in_bytes = 6;
3001
3002 // CACHE
3003 optional int64 cache_in_bytes = 7;
3004
3005 // SWAP
3006 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003007
3008 // The elapsed real time of start of the process.
3009 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003010
3011 // Min oom adj score considered by lmkd.
3012 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003013}
3014
Rajeev Kumar51b54602018-03-01 12:18:26 -08003015/*
3016 * Logs when the ActivityManagerService detects that an app died.
3017 *
3018 * Logged from:
3019 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3020 */
3021message AppDied {
3022 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003023 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003024}
3025
Howard Ro21a039c2018-08-06 14:55:47 -07003026/**
3027 * An atom for generic metrics logging. Available from Android Q.
3028 */
3029message GenericAtom {
3030 // The uid of the application that sent this custom atom.
3031 optional int32 uid = 1 [(is_uid) = true];
3032
3033 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003034 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003035}
3036
Tej Singhd6d6d772018-09-05 17:41:25 -07003037/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003038 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003039 *
3040 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003041 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003042 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003043message BiometricAcquired {
3044 // Biometric modality that was acquired.
3045 optional android.hardware.biometrics.ModalityEnum modality = 1;
3046 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3047 optional int32 user = 2;
3048 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3049 optional bool is_crypto = 3;
3050 // Action that the device is performing. Acquired messages are only expected for enroll and
3051 // authenticate. Other actions may indicate an error.
3052 optional android.hardware.biometrics.ActionEnum action = 4;
3053 // The client that this acquisition was received for.
3054 optional android.hardware.biometrics.ClientEnum client = 5;
3055 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3056 optional int32 acquire_info = 6;
3057 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3058 optional int32 acquire_info_vendor = 7;
Tej Singhd6d6d772018-09-05 17:41:25 -07003059}
3060
3061/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003062 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003063 *
3064 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003065 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003066 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003067message BiometricAuthenticated {
3068 // Biometric modality that was used.
3069 optional android.hardware.biometrics.ModalityEnum modality = 1;
3070 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3071 optional int32 user = 2;
3072 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3073 // storage.
3074 optional bool is_crypto = 3;
3075 // The client that this acquisition was received for.
3076 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003077 // If authentication requires user confirmation. See BiometricPrompt's
3078 // setRequireConfirmation(bool) method.
3079 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003080
Kevin Chyn1741a072019-01-17 11:54:40 -08003081 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003082 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003083 REJECTED = 1;
3084 PENDING_CONFIRMATION = 2;
3085 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003086 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003087
3088 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003089 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003090 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3091 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3092 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3093 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003094 optional int64 latency_millis = 7;
Kevin Chyn1741a072019-01-17 11:54:40 -08003095}
3096
3097/**
3098 * Logs when a biometric error occurs.
3099 *
3100 * Logged from:
3101 * frameworks/base/services/core/java/com/android/server/biometrics
3102 */
3103message BiometricErrorOccurred {
3104 // Biometric modality that was used.
3105 optional android.hardware.biometrics.ModalityEnum modality = 1;
3106 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3107 optional int32 user = 2;
3108 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3109 optional bool is_crypto = 3;
3110 // Action that the device is performing.
3111 optional android.hardware.biometrics.ActionEnum action = 4;
3112 // The client that this acquisition was received for.
3113 optional android.hardware.biometrics.ClientEnum client = 5;
3114 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3115 // are unique to modality.
3116 optional int32 error_info = 6;
3117 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3118 // by the vendor and not specified by the HIDL interface.
3119 optional int32 error_info_vendor = 7;
3120}
3121
3122/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003123 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003124 * Logged from:
3125 * frameworks/base/services/core/java/com/android/server/biometrics
3126 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003127message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003128 // Biometric modality.
3129 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003130 // Type of issue detected.
3131 optional android.hardware.biometrics.IssueEnum issue = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07003132}
Howard Ro688ae182018-09-25 00:09:36 -07003133
3134message Notification {
3135
3136 // Type of notification event.
3137 enum Type {
3138 TYPE_UNKNOWN = 0;
3139 // Notification became visible to the user.
3140 TYPE_OPEN = 1;
3141 // Notification became hidden.
3142 TYPE_CLOSE = 2;
3143 // Notification switched to detail mode.
3144 TYPE_DETAIL = 3;
3145 // Notification was clicked.
3146 TYPE_ACTION = 4;
3147 // Notification was dismissed.
3148 TYPE_DISMISS = 5;
3149 // Notification switched to summary mode. The enum value of 14 is to
3150 // match that of metrics_constants.
3151 TYPE_COLLAPSE = 14;
3152 }
3153 optional Type type = 1;
3154
3155 // Package name associated with the notification.
3156 optional string package_name = 2;
3157
3158 // Tag associated with notification.
3159 optional string tag = 3;
3160
3161 // Application-supplied ID associated with the notification.
3162 optional int32 id = 4;
3163
3164 // Index of notification in the notification panel.
3165 optional int32 shade_index = 5;
3166
3167 // The number of notifications in the notification panel.
3168 optional int32 shade_count = 6;
3169
3170 // Importance for the notification.
3171 optional int32 importance = 7;
3172
3173 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07003174 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07003175
3176 // Importance for the notification channel.
3177 optional int32 channel_importance = 9;
3178
Howard Ro183c2bd2018-10-18 13:52:10 -07003179 // Application-supplied ID associated with the notifications group.
3180 optional string group_id = 10;
3181
Howard Ro688ae182018-09-25 00:09:36 -07003182 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07003183 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07003184
Howard Ro183c2bd2018-10-18 13:52:10 -07003185 // Reason for dismissal of a notification. This field is only meaningful for
3186 // TYPE_DISMISS events.
3187 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07003188
Howard Ro183c2bd2018-10-18 13:52:10 -07003189 // The first post time of notification, stable across updates.
3190 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07003191
Howard Ro183c2bd2018-10-18 13:52:10 -07003192 // The most recent interruption time, or the creation time if no updates.
3193 // Differs from update_millis because updates are filtered based on whether
3194 // they actually interrupted the user.
3195 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07003196
Howard Ro183c2bd2018-10-18 13:52:10 -07003197 // The most recent update time, or the creation time if no updates.
3198 optional int64 update_millis = 15;
3199
3200 // The most recent visibility event.
3201 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07003202}
3203
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003204/*
Tej Singh0d176952019-01-16 19:10:54 -08003205 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003206 */
Tej Singh0d176952019-01-16 19:10:54 -08003207message FlagFlipUpdateOccurred {
3208 // If the event is from a flag config package, specify the package name.
3209 optional string flag_flip_package_name = 1;
3210
3211 // The order id of the package
3212 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003213}
3214
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003215/**
3216 * Potential experiment ids that goes with a train install.
3217 */
3218message TrainExperimentIds {
3219 repeated int64 experiment_id = 1;
3220}
3221
Yangster-macb89807e2018-11-15 21:10:57 -08003222/*
3223 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003224 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003225 */
3226message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003227 // Name of the train.
3228 optional string train_name = 1;
3229 // Version code for a "train" of packages that need to be installed atomically
3230 optional int64 train_version_code = 2;
3231 // After installation of this package, device requires a restart.
3232 optional bool requires_staging = 3;
3233 // Rollback should be enabled for this install.
3234 optional bool rollback_enabled = 4;
3235 // Requires low latency monitoring if possible.
3236 optional bool requires_low_latency_monitor = 5;
3237
Yangster-macb89807e2018-11-15 21:10:57 -08003238 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003239 UNKNOWN = 0;
3240 INSTALL_REQUESTED = 1;
3241 INSTALL_STARTED = 2;
3242 INSTALL_STAGED_NOT_READY = 3;
3243 INSTALL_STAGED_READY = 4;
3244 INSTALL_SUCCESS = 5;
3245 INSTALL_FAILURE = 6;
3246 INSTALL_CANCELLED = 7;
3247 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003248 INSTALLER_ROLLBACK_INITIATED = 9;
3249 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3250 INSTALLER_ROLLBACK_STAGED = 11;
3251 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3252 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3253 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3254 INSTALLER_ROLLBACK_SUCCESS = 15;
3255 INSTALLER_ROLLBACK_FAILURE = 16;
3256 INSTALLER_ROLLBACK_CANCEL_STAGED_REMOVE_FROM_QUEUE = 17;
3257 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_INITIATED = 18;
3258 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_SUCCESS = 19;
3259 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_FAILURE = 20;
Yangster-macb89807e2018-11-15 21:10:57 -08003260 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003261 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003262 // Possible experiment ids for monitoring this push.
3263 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3264 // user id
3265 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003266}
3267
Maggie Whitefc1aa592018-11-28 21:55:23 -08003268/** Represents USB port overheat event. */
3269message UsbPortOverheatEvent {
3270 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3271 optional int32 plug_temperature_deci_c = 1;
3272
3273 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3274 optional int32 max_temperature_deci_c = 2;
3275
3276 /* Time between USB plug event and overheat threshold trip, in seconds. */
3277 optional int32 time_to_overheat_secs = 3;
3278
3279 /* Time between overheat threshold trip and hysteresis, in seconds. */
3280 optional int32 time_to_hysteresis_secs = 4;
3281
3282 /* Time between hysteresis and active mitigation ending, in seconds. */
3283 optional int32 time_to_inactive_secs = 5;
3284};
3285
Maggie White8735b852019-01-18 11:40:49 -08003286/**
3287 * Logs total effective full charge and discharge cycles on a battery.
3288 * Here are some examples of one effective cycle:
3289 * 1) the battery charges from 0% to 100% and drains back to 0%,
3290 * 2) charging from 50% to 100% and draining back to 50% twice.
3291 * Pulled from:
3292 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3293 */
3294message BatteryCycleCount {
3295 /* Number of total charge and discharge cycles on the system battery. */
3296 optional int32 cycle_count = 1;
3297}
3298
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003299/**
3300 * Logs that an SD card is mounted and information about it, its type (public or private) and the
3301 * size in bytes.
3302 * Pulled from:
3303 * StatsCompanionService
3304 */
3305
3306message SDCardInfo {
3307
3308 enum Type {
3309 UNKNOWN = 0;
3310 TYPE_PUBLIC = 1;
3311 TYPE_PRIVATE = 2;
3312 OTHERS = 3;
3313 }
3314
3315 // Type of the SD card: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3316 optional Type type = 1;
3317 // Total size of the sd card in bytes.
3318 optional int64 size_bytes = 2;
3319}
3320
Yangster-macb89807e2018-11-15 21:10:57 -08003321/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003322 * Logs when a connection becomes available and lost.
3323 * Logged in StatsCompanionService.java
3324 */
3325message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003326 // Id of the network.
3327 optional int32 net_id = 1;
3328
3329 enum State {
3330 UNKNOWN = 0;
3331 CONNECTED = 1;
3332 DISCONNECTED = 2;
3333 }
3334 // Connected state of a network.
3335 optional State state = 2;
3336}
3337
3338/**
3339 * Logs when a service starts and stops.
3340 * Logged from:
3341 * services/core/java/com/android/server/am/ActiveServices.java
3342 */
3343message ServiceStateChanged {
3344
3345 optional int32 uid = 1 [(is_uid) = true];
3346
3347 optional string package_name = 2;
3348
3349 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003350
3351 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003352 START = 1;
3353 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003354 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003355
3356 optional State state = 4;
3357}
3358
3359/**
3360 * Logs when a service is launched.
3361 * Logged from:
3362 * services/core/java/com/android/server/am/ActiveServices.java
3363 */
3364message ServiceLaunchReported {
3365
3366 optional int32 uid = 1 [(is_uid) = true];
3367
3368 optional string package_name = 2;
3369
3370 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003371}
Howard Ro688ae182018-09-25 00:09:36 -07003372
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003373/**
3374 * Logs when a hidden API is used.
3375 *
3376 * Logged from:
3377 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3378 */
3379message HiddenApiUsed {
3380 // The uid of the app making the hidden access.
3381 optional int32 uid = 1 [(is_uid) = true];
3382
3383 // Signature of the method or field accessed.
3384 optional string signature = 2;
3385
3386 enum AccessMethod {
3387 NONE = 0;
3388 REFLECTION = 1;
3389 JNI = 2;
3390 LINKING = 3;
3391 }
3392
3393 // Type of access.
3394 optional AccessMethod access_method = 3;
3395
3396 // Whether the access was prevented or not.
3397 optional bool access_denied = 4;
3398}
3399
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003400/**
3401 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3402 * - When user sees privacy chip
3403 * - When user clicks privacy chip
3404 * - How does the user exit the Privacy Dialog
3405 * Logged from:
3406 * packages/SystemUI/src/com/android/systemui/privacy/OngoingPrivacyDialog.kt
3407 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3408 */
3409message PrivacyIndicatorsInteracted {
3410
3411 enum Type {
3412 UNKNOWN = 0;
3413 CHIP_VIEWED = 1;
3414 CHIP_CLICKED = 2;
3415 DIALOG_PRIVACY_SETTINGS = 3;
3416 DIALOG_DISMISS = 4;
3417 DIALOG_LINE_ITEM = 5;
3418 }
3419
3420 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3421
3422 // Used if the type is LINE_ITEM
3423 optional string package_name = 2;
3424}
3425
Chenjie Yubbcbc602018-02-05 16:51:52 -08003426//////////////////////////////////////////////////////////////////////
3427// Pulled atoms below this line //
3428//////////////////////////////////////////////////////////////////////
3429
3430/**
David Chenc8a43242017-10-17 16:23:28 -07003431 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3432 *
3433 * Pulled from:
3434 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3435 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003436message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003437 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003438
3439 optional int64 rx_bytes = 2;
3440
3441 optional int64 rx_packets = 3;
3442
3443 optional int64 tx_bytes = 4;
3444
3445 optional int64 tx_packets = 5;
3446}
3447
3448/**
3449 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3450 *
3451 * Pulled from:
3452 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3453 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003454message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003455 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003456
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003457 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3458 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003459
3460 optional int64 rx_bytes = 3;
3461
3462 optional int64 rx_packets = 4;
3463
3464 optional int64 tx_bytes = 5;
3465
3466 optional int64 tx_packets = 6;
3467}
3468
3469/**
3470 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3471 *
3472 * Pulled from:
3473 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3474 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003475message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003476 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003477
3478 optional int64 rx_bytes = 2;
3479
3480 optional int64 rx_packets = 3;
3481
3482 optional int64 tx_bytes = 4;
3483
3484 optional int64 tx_packets = 5;
3485}
3486
3487/**
3488 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3489 *
3490 * Pulled from:
3491 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3492 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003493message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003494 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003495
Yao Chenc40a19d2018-03-15 16:48:25 -07003496 // 1 denotes foreground and 0 denotes background. This is called Set in
3497 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003498 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003499
3500 optional int64 rx_bytes = 3;
3501
3502 optional int64 rx_packets = 4;
3503
3504 optional int64 tx_bytes = 5;
3505
3506 optional int64 tx_packets = 6;
3507}
3508
3509/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003510 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3511 *
3512 * Pulled from:
3513 * StatsCompanionService
3514 */
3515message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003516 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003517
3518 optional int64 rx_bytes = 2;
3519
3520 optional int64 tx_bytes = 3;
3521}
3522
3523/**
David Chenc8a43242017-10-17 16:23:28 -07003524 * Pulls the kernel wakelock durations. This atom is adapted from
3525 * android/internal/os/KernelWakelockStats.java
3526 *
3527 * Pulled from:
3528 * StatsCompanionService using KernelWakelockReader.
3529 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003530message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003531 optional string name = 1;
3532
3533 optional int32 count = 2;
3534
3535 optional int32 version = 3;
3536
Yangster-maca8a30442018-10-13 23:46:34 -07003537 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003538}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003539
Chenjie Yu05013b32017-11-21 10:21:41 -08003540/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003541 * Pulls low power state information. If power.stats HAL is not available, this
3542 * includes platform and subsystem sleep state information,
3543 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3544 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003545 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003546 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003547 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3548 * as defined in:
3549 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003550 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003551message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003552 // Subsystem name
3553 optional string subsystem_name = 1;
3554 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3555 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003556 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3557 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003558 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003559 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003560 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003561 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003562 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003563}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003564
Chenjie Yu05013b32017-11-21 10:21:41 -08003565/**
Bookatz92da2832018-11-01 18:10:03 -07003566 * Pulls on-device power measurement information.
3567 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3568 * Pulled from:
3569 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3570 */
3571message OnDevicePowerMeasurement {
3572 // Name of the subsystem (to which the rail belongs).
3573 optional string subsystem_name = 1;
3574
3575 // Rail name. The rail lies within the subsystem.
3576 optional string rail_name = 2;
3577
3578 // Time (in ms since boot) at which the rail energy value was measured.
3579 // This may differ slightly from the time that statsd logs this information.
3580 optional uint64 measurement_timestamp_millis = 3;
3581
3582 // Accumulated energy used via the rail since device boot in uWs.
3583 optional uint64 energy_microwatt_secs = 4;
3584}
3585
3586/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003587 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003588 * Pulls the time the cpu spend on the frequency index. Frequency index
3589 * starts from highest to lowest. The value should be monotonically
3590 * increasing since boot. However, if there is a cpu
3591 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003592 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003593message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003594 optional uint32 cluster = 1;
3595 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003596 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003597}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003598
Chenjie Yu05013b32017-11-21 10:21:41 -08003599/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003600 * Pulls Cpu Time Per Uid.
3601 * Note that isolated process uid time should be attributed to host uids.
3602 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003603message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003604 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003605 optional uint64 user_time_micros = 2;
3606 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003607}
3608
3609/**
3610 * Pulls Cpu Time Per Uid per frequency.
3611 * Note that isolated process uid time should be attributed to host uids.
3612 * For each uid, we order the time by descending frequencies.
3613 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003614message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003615 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003616 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003617 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003618}
Hugo Benichi884970e2017-11-14 22:42:46 +09003619
Chenjie Yu05013b32017-11-21 10:21:41 -08003620/**
3621 * Pulls Wifi Controller Activity Energy Info
3622 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003623message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003624 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003625 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003626 // stack reported state
3627 // TODO: replace this with proto enum
3628 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003629 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003630 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003631 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003632 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003633 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003634 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003635 // product of current(mA), voltage(V) and time(ms)
3636 optional uint64 controller_energy_used = 6;
3637}
3638
3639/**
3640 * Pulls Modem Activity Energy Info
3641 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003642message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003643 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003644 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003645 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003646 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003647 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003648 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003649 /**
3650 * Tx power index
3651 * index 0 = tx_power < 0dBm
3652 * index 1 = 0dBm < tx_power < 5dBm
3653 * index 2 = 5dBm < tx_power < 15dBm
3654 * index 3 = 15dBm < tx_power < 20dBm
3655 * index 4 = tx_power > 20dBm
3656 */
3657 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003658 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003659 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003660 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003661 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003662 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003663 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003664 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003665 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003666 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003667 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003668 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003669 // product of current(mA), voltage(V) and time(ms)
3670 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003671}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003672
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003673/**
3674 * Pulls Bluetooth Activity Energy Info
3675 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3676 */
3677message BluetoothActivityInfo {
3678 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003679 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003680 // bluetooth stack state
3681 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003682 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003683 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003684 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003685 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003686 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003687 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003688 // product of current(mA), voltage(V) and time(ms)
3689 optional uint64 energy_used = 6;
3690}
3691
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003692/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003693 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003694 *
3695 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003696 */
3697message ProcessMemoryState {
3698 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003699 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003700
3701 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003702 // Usually package name, "system" for system server.
3703 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003704 optional string process_name = 2;
3705
Rafal Slawikda51b932018-12-13 16:31:33 +00003706 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003707 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003708
3709 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003710 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003711
3712 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003713 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003714
Rajeev Kumar90235992018-01-29 11:06:48 -08003715 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003716 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3717 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003718 optional int64 rss_in_bytes = 6;
3719
3720 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003721 // Value is read from memory.stat, field total_cache if per-app memory
3722 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003723 optional int64 cache_in_bytes = 7;
3724
3725 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003726 // Value is read from memory.stat, field total_swap if per-app memory
3727 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003728 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +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 = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003732
3733 // Elapsed real time when the process started.
3734 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3735 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003736}
3737
3738/*
Rafal Slawik08621582018-10-15 14:53:07 +01003739 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003740 *
3741 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003742 */
3743message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003744 // The uid if available. -1 means not available.
3745 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003746
Rafal Slawikbf67d072018-10-23 11:07:54 +01003747 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003748 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003749 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003750
Rafal Slawikbf67d072018-10-23 11:07:54 +01003751 // # of page-faults
3752 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003753
Rafal Slawikbf67d072018-10-23 11:07:54 +01003754 // # of major page-faults
3755 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003756
Rafal Slawikbf67d072018-10-23 11:07:54 +01003757 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003758 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003759 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003760
Rafal Slawikd03ae422018-11-20 11:27:45 +00003761 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003762 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003763
3764 // Elapsed real time when the process started.
3765 // Value is read from /proc/PID/stat, field 22.
3766 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01003767}
3768
3769/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003770 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003771 *
3772 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3773 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003774 *
3775 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003776 */
3777message ProcessMemoryHighWaterMark {
3778 // The uid if available. -1 means not available.
3779 optional int32 uid = 1 [(is_uid) = true];
3780
Rafal Slawikda51b932018-12-13 16:31:33 +00003781 // The process name.
3782 // Usually package name or process cmdline.
3783 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003784 optional string process_name = 2;
3785
3786 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3787 // /proc/PID/status.
3788 optional int64 rss_high_water_mark_in_bytes = 3;
3789}
3790
3791/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003792 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003793 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003794message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003795 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003796}
3797
3798/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003799 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003800 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003801message SystemUptime {
3802 // Milliseconds since the system was booted.
3803 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3804 // for external input).
3805 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003806 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003807}
3808
3809/*
3810 * Reads from /proc/uid_concurrent_active_time which has the format:
3811 * active: X (X is # cores)
3812 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3813 * [uid1]: [time-0] [time-1] [time-2] ... ...
3814 * ...
3815 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3816 * The file contains a monotonically increasing count of time for a single boot.
3817 */
3818message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003819 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003820 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003821}
3822
3823/**
3824 * Reads from /proc/uid_concurrent_policy_time which has the format:
3825 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3826 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3827 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3828 * ...
3829 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3830 * The file contains a monotonically increasing count of time for a single boot.
3831 */
3832message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003833 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003834 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003835 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003836}
3837
3838/*
3839 * Pulls free disk space, for data, system partition and temporary directory.
3840 */
3841message DiskSpace {
3842 // available bytes in data partition
3843 optional uint64 data_available_bytes = 1;
3844 // available bytes in system partition
3845 optional uint64 system_available_bytes = 2;
3846 // available bytes in download cache or temp directories
3847 optional uint64 temp_available_bytes = 3;
3848}
Tej Singhbf972d92018-01-10 20:51:13 -08003849
3850/**
3851 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003852 *
3853 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003854 */
3855message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003856 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003857}
3858
3859/**
3860 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003861 * Pulled from:
3862 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003863 */
3864message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003865 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003866}
3867
3868/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003869 * Pulls battery voltage.
3870 * Pulled from:
3871 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3872 */
3873message BatteryVoltage {
3874 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003875 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003876}
3877
3878/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003879 * Pulls battery level (percent full, from 0 to 100).
3880 *
3881 * Pulled from:
3882 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3883 */
3884message BatteryLevel {
3885 // Battery level. Should be in [0, 100].
3886 optional int32 battery_level = 1;
3887}
3888
3889/**
Tej Singhd89137e2018-03-26 14:51:40 -07003890 * Pulls the temperature of various parts of the device.
3891 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003892 *
3893 * Pulled from:
3894 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3895 */
3896message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003897 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003898 optional android.os.TemperatureTypeEnum sensor_location = 1;
3899
3900 // The name of the temperature source. Eg. CPU0
3901 optional string sensor_name = 2;
3902
Tej Singhd89137e2018-03-26 14:51:40 -07003903 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003904 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003905 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003906}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003907
3908/**
3909 * Pulls the statistics of calls to Binder.
3910 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003911 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3912 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003913 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003914 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003915 */
3916message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003917 // UID of the process responsible for the binder transaction. It will be set if the process
3918 // executing the binder transaction attribute the transaction to another uid using
3919 // Binder.setThreadWorkSource().
3920 //
3921 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003922 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003923 // UID of the process executing the binder transaction.
3924 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003925 // Fully qualified class name of the API call.
3926 //
3927 // This is a system server class name.
3928 //
3929 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3930 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3931 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3932 // commonly used APIs.
3933 optional string service_class_name = 2;
3934 // Method name of the API call. It can also be a transaction code if we cannot
3935 // resolve it to a name. See Binder#getTransactionName.
3936 //
3937 // This is a system server method name.
3938 optional string service_method_name = 3;
3939 // Total number of API calls.
3940 optional int64 call_count = 4;
3941 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3942 optional bool screen_interactive = 13;
3943 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3944 // call_count will be equal to recorded_call_count.
3945 //
3946 // If recorded_call_count is different than call_count, it means data collection has been
3947 // sampled. All the fields below will be sampled in this case.
3948 optional int64 recorded_call_count = 12;
3949 // Number of exceptions thrown by the API.
3950 optional int64 recorded_exception_count = 5;
3951 // Total latency of all API calls.
3952 // Average can be computed using total_latency_micros / recorded_call_count.
3953 optional int64 recorded_total_latency_micros = 6;
3954 // Maximum latency of one API call.
3955 optional int64 recorded_max_latency_micros = 7;
3956 // Total CPU usage of all API calls.
3957 // Average can be computed using total_cpu_micros / recorded_call_count.
3958 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3959 optional int64 recorded_total_cpu_micros = 8;
3960 // Maximum CPU usage of one API call.
3961 optional int64 recorded_max_cpu_micros = 9;
3962 // Maximum parcel reply size of one API call.
3963 optional int64 recorded_max_reply_size_bytes = 10;
3964 // Maximum parcel request size of one API call.
3965 optional int64 recorded_max_request_size_bytes = 11;
3966}
3967
3968/**
3969 * Pulls the statistics of exceptions during calls to Binder.
3970 *
3971 * Binder stats are cumulative from boot unless somebody reset the data using
3972 * > adb shell dumpsys binder_calls_stats --reset
3973 */
3974message BinderCallsExceptions {
3975 // Exception class name, e.g. java.lang.IllegalArgumentException.
3976 //
3977 // This is an exception class name thrown by the system server.
3978 optional string exception_class_name = 1;
3979 // Total number of exceptions.
3980 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003981}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003982
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003983/**
3984 * Pulls the statistics of message dispatching on HandlerThreads.
3985 *
3986 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
3987 * config on the device.
3988 *
3989 * Next tag: 11
3990 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003991message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01003992 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003993 optional int32 uid = 1 [(is_uid) = true];
3994
3995 // Fully qualified class name of the handler target class.
3996 //
3997 // This field does not contain PII. This is a system server class name.
3998 optional string handler_class_name = 2;
3999
4000 // The name of the thread that runs the Looper.
4001 //
4002 // This field does not contain PII. This is a system server thread name.
4003 optional string looper_thread_name = 3;
4004
4005 // The name of the dispatched message.
4006 //
4007 // This field does not contain PII. This is a system server constant or class
4008 // name.
4009 optional string message_name = 4;
4010
4011 // Total number of successfully dispatched messages.
4012 optional int64 message_count = 5;
4013
4014 // Total number of messages that failed dispatching.
4015 optional int64 exception_count = 6;
4016
4017 // Total number of processed messages we have data recorded for. If we
4018 // collected data for all the messages, message_count will be equal to
4019 // recorded_message_count.
4020 //
4021 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004022 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004023 optional int64 recorded_message_count = 7;
4024
4025 // Total latency of all processed messages.
4026 // Average can be computed using recorded_total_latency_micros /
4027 // recorded_message_count.
4028 optional int64 recorded_total_latency_micros = 8;
4029
4030 // Total CPU usage of all processed message.
4031 // Average can be computed using recorded_total_cpu_micros /
4032 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004033 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004034 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004035
4036 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4037 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004038
4039 // Max recorded CPU usage of all processed messages.
4040 optional int64 recorded_max_cpu_micros = 11;
4041
4042 // Max recorded latency of all processed messages.
4043 optional int64 recorded_max_latency_micros = 12;
4044
4045 // Total number of messages we tracked the dispatching delay for. If we
4046 // collected data for all the messages, message_count will be equal to
4047 // recorded_delay_message_count.
4048 //
4049 // If recorded_delay_message_count is different than message_count, it means data
4050 // collection has been sampled or/and not all messages specified the target dispatch time.
4051 // The fields below will be sampled in this case.
4052 optional int64 recorded_delay_message_count = 13;
4053
4054 // Total dispatching delay of all processed messages.
4055 // Calculated as a difference between the target dispatching time (Message.when)
4056 // and the actual dispatching time.
4057 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4058 optional int64 recorded_total_delay_millis = 14;
4059
4060 // Max dispatching delay of all processed messages.
4061 // Calculated as a difference between the target dispatching time (Message.when)
4062 // and the actual dispatching time.
4063 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004064}
Tej Singh86dc9db2018-09-06 00:39:57 +00004065
4066/**
4067 * Pulls disk information, such as write speed and latency.
4068 */
4069message DiskStats {
4070 // Time taken to open, write 512B to, and close a file.
4071 // -1 if error performing the check.
4072 optional int64 data_write_latency_millis = 1;
4073
4074 optional bool file_based_encryption = 2;
4075
4076 // Recent disk write speed in kB/s.
4077 // -1 if error querying storageed.
4078 // 0 if data is unavailable.
4079 optional int32 recent_disk_write_speed = 3;
4080}
4081
4082
4083/**
4084 * Free and total bytes of the Data, Cache, and System partition.
4085 */
4086message DirectoryUsage {
4087 enum Directory {
4088 UNKNOWN = 0;
4089 DATA = 1;
4090 CACHE = 2;
4091 SYSTEM = 3;
4092 }
4093 optional Directory directory = 1;
4094 optional int64 free_bytes = 2;
4095 optional int64 total_bytes = 3;
4096}
4097
4098
4099/**
4100 * Size of an application: apk size, data size, and cache size.
4101 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4102 * Information is only reported for apps with the primary user (user 0).
4103 * Sizes are aggregated by package name.
4104 */
4105message AppSize {
4106 // Including uids will involve modifying diskstats logic.
4107 optional string package_name = 1;
4108 // App size in bytes. -1 if unavailable.
4109 optional int64 app_size_bytes = 2;
4110 // App data size in bytes. -1 if unavailable.
4111 optional int64 app_data_size_bytes = 3;
4112 // App cache size in bytes. -1 if unavailable.
4113 optional int64 app_cache_size_bytes = 4;
4114 // Time that the cache file was produced.
4115 // Uses System.currentTimeMillis(), which is wall clock time.
4116 optional int64 cache_time_millis = 5;
4117}
4118
4119
4120/**
4121 * Size of a particular category. Eg: photos, videos.
4122 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4123 */
4124message CategorySize {
4125 enum Category {
4126 UNKNOWN = 0;
4127 APP_SIZE = 1;
4128 APP_DATA_SIZE = 2;
4129 APP_CACHE_SIZE = 3;
4130 PHOTOS = 4;
4131 VIDEOS = 5;
4132 AUDIO = 6;
4133 DOWNLOADS = 7;
4134 SYSTEM = 8;
4135 OTHER = 9;
4136 }
4137 optional Category category = 1;
4138 // Category size in bytes.
4139 optional int64 size_bytes = 2;
4140 // Time that the cache file was produced.
4141 // Uses System.currentTimeMillis(), which is wall clock time.
4142 optional int64 cache_time_millis = 3;
4143}
Tej Singhd6d6d772018-09-05 17:41:25 -07004144
4145/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004146 * Pulls per uid I/O stats. The stats are cumulative since boot.
4147 *
4148 * Read/write bytes are I/O events from a storage device
4149 * Read/write chars are data requested by read/write syscalls, and can be
4150 * satisfied by caching.
4151 *
4152 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4153 */
4154message DiskIo {
4155 optional int32 uid = 1 [(is_uid) = true];
4156 optional int64 fg_chars_read = 2;
4157 optional int64 fg_chars_write = 3;
4158 optional int64 fg_bytes_read = 4;
4159 optional int64 fg_bytes_write = 5;
4160 optional int64 bg_chars_read = 6;
4161 optional int64 bg_chars_write = 7;
4162 optional int64 bg_bytes_read = 8;
4163 optional int64 bg_bytes_write = 9;
4164 optional int64 fg_fsync = 10;
4165 optional int64 bg_fsync= 11;
4166}
4167
4168
4169/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004170 * Pulls the number of fingerprints for each user.
4171 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004172 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004173 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004174message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004175 // The associated user. Eg: 0 for owners, 10+ for others.
4176 // Defined in android/os/UserHandle.java
4177 optional int32 user = 1;
4178 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004179 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004180}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004181
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004182/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004183 * Pulls the number of faces for each user.
4184 *
4185 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4186 */
4187message NumFacesEnrolled {
4188 // The associated user. Eg: 0 for owners, 10+ for others.
4189 // Defined in android/os/UserHandle.java
4190 optional int32 user = 1;
4191 // Number of faces registered to that user.
4192 optional int32 num_faces_enrolled = 2;
4193}
4194/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004195 * A mapping of role holder -> role
4196 */
4197message RoleHolder {
4198 // uid of the role holder
4199 optional int32 uid = 1 [(is_uid) = true];
4200
4201 // package name of the role holder
4202 optional string package_name = 2;
4203
4204 // the role held
4205 optional string role = 3;
4206}
4207
Yangsteraf9aee72018-10-12 09:26:16 -07004208message AggStats {
4209 optional int64 min = 1;
4210
4211 optional int64 average = 2;
4212
4213 optional int64 max = 3;
4214}
4215
4216message ProcessStatsStateProto {
4217 optional android.service.procstats.ScreenState screen_state = 1;
4218
4219 optional android.service.procstats.MemoryState memory_state = 2;
4220
4221 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4222 // and not frameworks/base/core/java/android/app/ActivityManager.java
4223 optional android.service.procstats.ProcessState process_state = 3;
4224
4225 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004226 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004227
4228 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004229 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004230
4231 // # of samples taken
4232 optional int32 sample_size = 5;
4233
4234 // PSS is memory reserved for this process
4235 optional AggStats pss = 6;
4236
4237 // USS is memory shared between processes, divided evenly for accounting
4238 optional AggStats uss = 7;
4239
4240 // RSS is memory resident for this process
4241 optional AggStats rss = 8;
4242}
4243
4244// Next Tag: 7
4245message ProcessStatsProto {
4246 // Name of process.
4247 optional string process = 1;
4248
4249 // Uid of the process.
4250 optional int32 uid = 2;
4251
4252 // Information about how often kills occurred
4253 message Kill {
4254 // Count of excessive CPU kills
4255 optional int32 cpu = 1;
4256
4257 // Count of kills when cached
4258 optional int32 cached = 2;
4259
4260 // PSS stats during cached kill
4261 optional AggStats cached_pss = 3;
4262 }
4263 optional Kill kill = 3;
4264
4265 // Time and memory spent in various states.
4266 repeated ProcessStatsStateProto states = 5;
4267
4268 // Total time process has been running... screen_state, memory_state, and process_state
4269 // will not be set.
4270 optional ProcessStatsStateProto total_running_state = 6;
4271}
4272
4273message PackageServiceOperationStatsProto {
4274 // Operate enum: Started, Foreground, Bound, Executing
4275 optional android.service.procstats.ServiceOperationState operation = 1;
4276
4277 // Number of times the service was in this operation.
4278 optional int32 count = 2;
4279
4280 // Information about a state the service can be in.
4281 message StateStats {
4282 // Screen state enum.
4283 optional android.service.procstats.ScreenState screen_state = 1;
4284 // Memory state enum.
4285 optional android.service.procstats.MemoryState memory_state = 2;
4286
4287 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004288 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004289 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004290 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004291 }
4292 repeated StateStats state_stats = 3;
4293}
4294
4295message PackageServiceStatsProto {
4296 // Name of service component.
4297 optional string service_name = 1;
4298
4299 // The operation stats.
4300 // The package_name, package_uid, package_version, service_name will not be set to save space.
4301 repeated PackageServiceOperationStatsProto operation_stats = 2;
4302}
4303
4304message PackageAssociationSourceProcessStatsProto {
4305 // Uid of the process.
4306 optional int32 process_uid = 1;
4307 // Process name.
4308 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004309 // Package name.
4310 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004311 // Total count of the times this association appeared.
4312 optional int32 total_count = 3;
4313
4314 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004315 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004316
4317 // Total count of the times this association became actively impacting its target process.
4318 optional int32 active_count = 5;
4319
4320 // Information on one source in this association.
4321 message StateStats {
4322 // Process state enum.
4323 optional android.service.procstats.ProcessState process_state = 1;
4324 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004325 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004326 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004327 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004328 }
4329 repeated StateStats active_state_stats = 6;
4330}
4331
4332message PackageAssociationProcessStatsProto {
4333 // Name of the target component.
4334 optional string component_name = 1;
4335 // Information on one source in this association.
4336 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4337}
4338
4339
4340message ProcessStatsPackageProto {
4341 // Name of package.
4342 optional string package = 1;
4343
4344 // Uid of the package.
4345 optional int32 uid = 2;
4346
4347 // Version of the package.
4348 optional int64 version = 3;
4349
4350 // Stats for each process running with the package loaded in to it.
4351 repeated ProcessStatsProto process_stats = 4;
4352
4353 // Stats for each of the package's services.
4354 repeated PackageServiceStatsProto service_stats = 5;
4355
4356 // Stats for each association with the package.
4357 repeated PackageAssociationProcessStatsProto association_stats = 6;
4358}
4359
4360message ProcessStatsSectionProto {
4361 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004362 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004363
4364 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004365 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004366
4367 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004368 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004369
4370 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004371 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004372
4373 // System runtime library. e.g. "libdvm.so", "libart.so".
4374 optional string runtime = 5;
4375
4376 // whether kernel reports swapped pss.
4377 optional bool has_swapped_pss = 6;
4378
4379 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4380 enum Status {
4381 STATUS_UNKNOWN = 0;
4382 STATUS_COMPLETE = 1;
4383 STATUS_PARTIAL = 2;
4384 STATUS_SHUTDOWN = 3;
4385 STATUS_SYSPROPS = 4;
4386 }
4387 repeated Status status = 7;
4388
Chenjie Yub2ecc792019-01-17 10:27:26 -08004389 // Number of pages available of various types and sizes, representation fragmentation.
4390 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4391
Yangsteraf9aee72018-10-12 09:26:16 -07004392 // Stats for each process.
4393 repeated ProcessStatsProto process_stats = 8;
4394
4395 // Stats for each package.
4396 repeated ProcessStatsPackageProto package_stats = 9;
4397}
4398
Chenjie Yub2ecc792019-01-17 10:27:26 -08004399message ProcessStatsAvailablePagesProto {
4400 // Node these pages are in (as per /proc/pagetypeinfo)
4401 optional int32 node = 1;
4402
4403 // Zone these pages are in (as per /proc/pagetypeinfo)
4404 optional string zone = 2;
4405
4406 // Label for the type of these pages (as per /proc/pagetypeinfo)
4407 optional string label = 3;
4408
4409 // Distribution of number of pages available by order size. First entry in array is
4410 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4411 repeated int32 pages_per_order = 4;
4412}
4413
Chenjie Yu12e5e672018-09-14 15:54:59 -07004414/**
4415 * Pulled from ProcessStatsService.java
4416 */
4417message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004418 optional ProcessStatsSectionProto proc_stats_section = 1;
4419}
4420
Chenjie Yuf910b7802019-01-11 16:08:20 -08004421/**
4422 * Pulled from ProcessStatsService.java
4423 */
4424message ProcStatsPkgProc {
4425 optional ProcessStatsSectionProto proc_stats_section = 1;
4426}
4427
Yangsteraf9aee72018-10-12 09:26:16 -07004428message PowerProfileProto {
4429 optional double cpu_suspend = 1;
4430
4431 optional double cpu_idle = 2;
4432
4433 optional double cpu_active = 3;
4434
4435 message CpuCluster {
4436 optional int32 id = 1;
4437 optional double cluster_power = 2;
4438 optional int32 cores = 3;
4439 repeated int64 speed = 4;
4440 repeated double core_power = 5;
4441 }
4442
4443 repeated CpuCluster cpu_cluster = 40;
4444
4445 optional double wifi_scan = 4;
4446
4447 optional double wifi_on = 5;
4448
4449 optional double wifi_active = 6;
4450
4451 optional double wifi_controller_idle = 7;
4452
4453 optional double wifi_controller_rx = 8;
4454
4455 optional double wifi_controller_tx = 9;
4456
4457 repeated double wifi_controller_tx_levels = 10;
4458
4459 optional double wifi_controller_operating_voltage = 11;
4460
4461 optional double bluetooth_controller_idle = 12;
4462
4463 optional double bluetooth_controller_rx = 13;
4464
4465 optional double bluetooth_controller_tx = 14;
4466
4467 optional double bluetooth_controller_operating_voltage = 15;
4468
4469 optional double modem_controller_sleep = 16;
4470
4471 optional double modem_controller_idle = 17;
4472
4473 optional double modem_controller_rx = 18;
4474
4475 repeated double modem_controller_tx = 19;
4476
4477 optional double modem_controller_operating_voltage = 20;
4478
4479 optional double gps_on = 21;
4480
4481 repeated double gps_signal_quality_based = 22;
4482
4483 optional double gps_operating_voltage = 23;
4484
4485 optional double bluetooth_on = 24;
4486
4487 optional double bluetooth_active = 25;
4488
4489 optional double bluetooth_at_cmd = 26;
4490
4491 optional double ambient_display = 27;
4492
4493 optional double screen_on = 28;
4494
4495 optional double radio_on = 29;
4496
4497 optional double radio_scanning = 30;
4498
4499 optional double radio_active = 31;
4500
4501 optional double screen_full = 32;
4502
4503 optional double audio = 33;
4504
4505 optional double video = 34;
4506
4507 optional double flashlight = 35;
4508
4509 optional double memory = 36;
4510
4511 optional double camera = 37;
4512
4513 optional double wifi_batched_scan = 38;
4514
4515 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004516}
Chenjie Yuab530202018-09-26 12:39:20 -07004517
4518/**
4519 * power_profile.xml and other constants for power model calculations.
4520 * Pulled from PowerProfile.java
4521 */
4522message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004523 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004524}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004525
4526/**
arangelovd5db50e2018-10-12 20:24:39 +01004527 * Logs when a user restriction was added or removed.
4528 *
4529 * Logged from:
4530 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4531 */
4532message UserRestrictionChanged {
4533 // The raw string of the user restriction as defined in UserManager.
4534 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4535 optional string restriction = 1;
4536 // Whether the restriction is enabled or disabled.
4537 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004538}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004539
4540/**
4541 * Pulls process user time and system time. Puller takes a snapshot of all pids
4542 * in the system and returns cpu stats for those that are working at the time.
4543 * Dead pids will be dropped. Kernel processes are excluded.
4544 * Min cool-down is 5 sec.
4545 */
4546message ProcessCpuTime {
4547 optional int32 uid = 1 [(is_uid) = true];
4548
4549 optional string process_name = 2;
4550 // Process cpu time in user space, cumulative from boot/process start
4551 optional int64 user_time_millis = 3;
4552 // Process cpu time in system space, cumulative from boot/process start
4553 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004554}
Misha Wagner5a51e002018-10-03 15:04:09 +01004555
4556/**
4557 * Pulls the CPU usage for each thread.
4558 *
4559 * Read from /proc/$PID/task/$TID/time_in_state files.
4560 *
4561 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4562 * time_in_state files not being present on some phones, have not been addressed. These should be
4563 * considered before a public release.
4564 */
4565message CpuTimePerThreadFreq {
4566 // UID that owns the process.
4567 optional int32 uid = 1 [(is_uid) = true];
4568 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004569 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004570 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004571 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004572 // Name of the process taken from `/proc/$PID/cmdline`.
4573 optional string process_name = 4;
4574 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4575 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004576
4577 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4578 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4579 // frequencies are given here as the alternative is sending eight separate atoms. This method
4580 // significantly reduces the amount of data created
4581 optional int32 frequency1_khz = 6;
4582 optional int32 time1_millis = 7;
4583 optional int32 frequency2_khz = 8;
4584 optional int32 time2_millis = 9;
4585 optional int32 frequency3_khz = 10;
4586 optional int32 time3_millis = 11;
4587 optional int32 frequency4_khz = 12;
4588 optional int32 time4_millis = 13;
4589 optional int32 frequency5_khz = 14;
4590 optional int32 time5_millis = 15;
4591 optional int32 frequency6_khz = 16;
4592 optional int32 time6_millis = 17;
4593 optional int32 frequency7_khz = 18;
4594 optional int32 time7_millis = 19;
4595 optional int32 frequency8_khz = 20;
4596 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004597}
Bookatz75ee6042018-11-09 12:27:37 -08004598
4599/**
Bookatz366a4432018-11-20 09:42:33 -08004600 * Pulls information about the device's build.
4601 */
4602message BuildInformation {
4603 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4604 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4605 optional string fingerprint = 1;
4606
4607 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4608 optional string brand = 2;
4609
4610 // Build.PRODUCT. The name of the overall product.
4611 optional string product = 3;
4612
4613 // Build.DEVICE. The name of the industrial design.
4614 optional string device = 4;
4615
4616 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4617 optional string version_release = 5;
4618
4619 // Build.ID. E.g. a label like "M4-rc20".
4620 optional string id = 6;
4621
4622 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4623 // represent this build.
4624 optional string version_incremental = 7;
4625
4626 // Build.TYPE. The type of build, like "user" or "eng".
4627 optional string type = 8;
4628
4629 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4630 optional string tags = 9;
4631}
4632
4633/**
Bookatz75ee6042018-11-09 12:27:37 -08004634 * Pulls on-device BatteryStats power use calculations for the overall device.
4635 */
4636message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004637 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4638 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4639 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4640 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08004641}
4642
4643/**
4644 * Pulls on-device BatteryStats power use calculations broken down by uid.
4645 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4646 * that is attributed to non-uid items. They must all be included to get the total power use.
4647 */
4648message DeviceCalculatedPowerBlameUid {
4649 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4650 optional int32 uid = 1 [(is_uid) = true];
4651
Bookatz3dbc13a2018-12-21 12:16:51 -08004652 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4653 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4654 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08004655}
4656
4657/**
4658 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4659 * drain type.
4660 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4661 * is attributed uids. They must all be included to get the total power use.
4662 */
4663message DeviceCalculatedPowerBlameOther {
4664 // The type of item whose power use is being reported.
4665 enum DrainType {
4666 AMBIENT_DISPLAY = 0;
4667 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4668 BLUETOOTH = 2;
4669 CAMERA = 3;
4670 // Cell-standby
4671 CELL = 4;
4672 FLASHLIGHT = 5;
4673 IDLE = 6;
4674 MEMORY = 7;
4675 // Amount that total computed drain exceeded the drain estimated using the
4676 // battery level changes and capacity.
4677 OVERCOUNTED = 8;
4678 PHONE = 9;
4679 SCREEN = 10;
4680 // Amount that total computed drain was below the drain estimated using the
4681 // battery level changes and capacity.
4682 UNACCOUNTED = 11;
4683 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4684 WIFI = 13;
4685 }
4686 optional DrainType drain_type = 1;
4687
Bookatz3dbc13a2018-12-21 12:16:51 -08004688 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4689 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4690 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004691}
arangelov4e994062018-11-13 16:12:38 +00004692
4693/**
4694 * Logs device policy features.
4695 *
4696 * Logged from:
4697 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4698 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4699 */
4700message DevicePolicyEvent {
4701 // The event id - unique for each event.
4702 optional android.stats.devicepolicy.EventId event_id = 1;
4703 // The admin package name.
4704 optional string admin_package_name = 2;
4705 // A generic integer parameter.
4706 optional int32 integer_value = 3;
4707 // A generic boolean parameter.
4708 optional bool boolean_value = 4;
4709 // A parameter specifying a time period in milliseconds.
4710 optional uint64 time_period_millis = 5;
4711 // A parameter specifying a list of package names, bundle extras or string parameters.
4712 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4713}
shawnlinea5b66b2018-11-13 15:05:29 +08004714
4715/**
4716 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4717 *
4718 * Logged from:
4719 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4720 */
4721message DocsUILaunchReported {
4722 optional android.stats.docsui.LaunchAction launch_action = 1;
4723 optional bool has_initial_uri = 2;
4724 optional android.stats.docsui.MimeType mime_type = 3;
4725 optional android.stats.docsui.Root initial_root = 4;
4726}
4727
4728/**
4729 * Logs root/app visited event in file managers/picker. Call this when the user
4730 * taps on root/app in hamburger menu.
4731 *
4732 * Logged from:
4733 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4734 */
4735message DocsUIRootVisitedReported {
4736 optional android.stats.docsui.ContextScope scope = 1;
4737 optional android.stats.docsui.Root root = 2;
4738}
4739
4740/**
4741 * Logs file operation stats. Call this when a file operation has completed.
4742 *
4743 * Logged from:
4744 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4745 */
4746message DocsUIFileOperationReported {
4747 optional android.stats.docsui.Provider provider = 1;
4748 optional android.stats.docsui.FileOperation file_op = 2;
4749}
4750
4751/**
4752 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4753 * mode.
4754 *
4755 * Logged from:
4756 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4757 */
4758message DocsUIFileOperationCopyMoveModeReported {
4759 optional android.stats.docsui.FileOperation file_op = 1;
4760 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4761}
4762
4763
4764/**
4765 * Logs file sub operation stats. Call this when a file operation has failed.
4766 *
4767 * Logged from:
4768 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4769 */
4770message DocsUIFileOperationFailureReported {
4771 optional android.stats.docsui.Authority authority = 1;
4772 optional android.stats.docsui.SubFileOperation sub_op = 2;
4773}
4774
4775/**
4776* Logs the cancellation of a file operation. Call this when a job is canceled
4777*
4778* Logged from:
4779* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4780*/
4781message DocsUIFileOperationCanceledReported {
4782 optional android.stats.docsui.FileOperation file_op = 1;
4783}
4784
4785/**
4786 * Logs startup time in milliseconds.
4787 *
4788 * Logged from:
4789 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4790 */
4791message DocsUIStartupMsReported {
4792 optional int32 startup_millis = 1;
4793}
4794
4795/**
4796 * Logs the action that was started by user.
4797 *
4798 * Logged from:
4799 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4800 */
4801message DocsUIUserActionReported {
4802 optional android.stats.docsui.UserAction action = 1;
4803}
4804
4805/**
4806 * Logs the invalid type when invalid scoped access is requested.
4807 *
4808 * Logged from:
4809 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4810 */
4811message DocsUIInvalidScopedAccessRequestReported {
4812 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004813}
Ben Murdochbab399f2018-12-06 11:01:38 +00004814
4815/**
shawnlina75e82d2019-01-07 10:31:12 +08004816 * Logs the package name that launches docsui picker mode.
4817 *
4818 * Logged from:
4819 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4820 */
4821message DocsUIPickerLaunchedFromReported {
4822 optional string package_name = 1;
4823}
4824
4825/**
4826 * Logs the search type.
4827 *
4828 * Logged from:
4829 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4830 */
4831message DocsUISearchTypeReported {
4832 optional android.stats.docsui.SearchType search_type = 1;
4833}
4834
4835/**
4836 * Logs the search mode.
4837 *
4838 * Logged from:
4839 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4840 */
4841message DocsUISearchModeReported {
4842 optional android.stats.docsui.SearchMode search_mode = 1;
4843}
4844
4845/**
4846 * Logs the pick result information.
4847 *
4848 * Logged from:
4849 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4850 */
4851message DocsUIPickResultReported {
4852 optional int32 total_action_count = 1;
4853 optional int64 duration_millis = 2;
4854 optional int32 file_count= 3;
4855 optional bool is_searching = 4;
4856 optional android.stats.docsui.Root picked_from = 5;
4857 optional android.stats.docsui.MimeType mime_type = 6;
4858 optional int32 repeatedly_pick_times = 7;
4859}
4860
4861/**
Ben Murdochbab399f2018-12-06 11:01:38 +00004862 * Logs when an app's memory is compacted.
4863 *
4864 * Logged from:
4865 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4866 */
4867message AppCompacted {
4868 // The pid of the process being compacted.
4869 optional int32 pid = 1;
4870
4871 // The name of the process being compacted.
4872 optional string process_name = 2;
4873
4874 // The type of compaction.
4875 enum Action {
4876 UNKNOWN = 0;
4877 SOME = 1;
4878 FULL = 2;
4879 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004880 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00004881
4882 // Total RSS in kilobytes consumed by the process prior to compaction.
4883 optional int64 before_rss_total_kilobytes = 4;
4884
4885 // File RSS in kilobytes consumed by the process prior to compaction.
4886 optional int64 before_rss_file_kilobytes = 5;
4887
4888 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4889 optional int64 before_rss_anon_kilobytes = 6;
4890
4891 // Swap in kilobytes consumed by the process prior to compaction.
4892 optional int64 before_swap_kilobytes = 7;
4893
4894 // Total RSS in kilobytes consumed by the process after compaction.
4895 optional int64 after_rss_total_kilobytes = 8;
4896
4897 // File RSS in kilobytes consumed by the process after compaction.
4898 optional int64 after_rss_file_kilobytes = 9;
4899
4900 // Anonymous RSS in kilobytes consumed by the process after compaction.
4901 optional int64 after_rss_anon_kilobytes = 10;
4902
4903 // Swap in kilobytes consumed by the process after compaction.
4904 optional int64 after_swap_kilobytes = 11;
4905
4906 // The time taken to perform compaction in milliseconds.
4907 optional int64 time_to_compact_millis = 12;
4908
4909 // The last compaction action performed for this app.
4910 optional Action last_action = 13;
4911
Ben Murdoch01720b82018-12-19 18:03:44 +00004912 // The last time that compaction was attempted on this process in milliseconds
4913 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4914 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00004915
Ben Murdoch885c21b2019-03-15 18:02:04 +00004916 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00004917 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00004918
4919 // The process state at the time of compaction.
4920 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00004921
4922 // Free ZRAM in kilobytes before compaction.
4923 optional int64 before_zram_free_kilobytes = 17;
4924
4925 // Free ZRAM in kilobytes after compaction.
4926 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00004927}
lifr157fc552018-12-12 16:38:04 +08004928
4929/**
4930 * Logs the latency period(in microseconds) and the return code of
4931 * the DNS(Domain Name System) lookups.
4932 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4933 * to get info(address or hostname) from DNS server(or DNS cache).
4934 * Logged from:
4935 * /system/netd/server/DnsProxyListener.cpp
4936 */
4937message NetworkDnsEventReported {
4938 // The types of the DNS lookups, as defined in
4939 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4940 enum EventType {
4941 EVENT_UNKNOWN = 0;
4942 EVENT_GETADDRINFO = 1;
4943 EVENT_GETHOSTBYNAME = 2;
4944 EVENT_GETHOSTBYADDR = 3;
4945 EVENT_RES_NSEND = 4;
4946 }
4947 optional EventType event_type = 1;
4948
4949 // The return value of the DNS resolver for each DNS lookups.
4950 //bionic/libc/include/netdb.h
4951 //system/netd/resolv/include/netd_resolv/resolv.h
4952 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08004953 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08004954 EAI_ADDRFAMILY = 1;
4955 EAI_AGAIN = 2;
4956 EAI_BADFLAGS = 3;
4957 EAI_FAIL = 4;
4958 EAI_FAMILY = 5;
4959 EAI_MEMORY = 6;
4960 EAI_NODATA = 7;
4961 EAI_NONAME = 8;
4962 EAI_SERVICE = 9;
4963 EAI_SOCKTYPE = 10;
4964 EAI_SYSTEM = 11;
4965 EAI_BADHINTS = 12;
4966 EAI_PROTOCOL = 13;
4967 EAI_OVERFLOW = 14;
4968 RESOLV_TIMEOUT = 255;
4969 EAI_MAX = 256;
4970 }
4971 optional ReturnCode return_code = 2;
4972
4973 // The latency period(in microseconds) it took for this DNS lookup to complete.
4974 optional int32 latency_micros = 3;
4975}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08004976
4977/**
4978 * Logs when a data stall event occurs.
4979 *
4980 * Log from:
4981 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4982 */
4983message DataStallEvent {
4984 // Data stall evaluation type.
4985 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4986 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
4987 optional int32 evaluation_type = 1;
4988 // See definition in data_stall_event.proto.
4989 optional com.android.server.connectivity.ProbeResult validation_result = 2;
4990 // See definition in data_stall_event.proto.
4991 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
4992 // See definition in data_stall_event.proto.
4993 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
4994 // See definition in data_stall_event.proto.
4995 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
4996 // See definition in data_stall_event.proto.
4997 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
4998}
Christian Brunschenf86039e2018-12-21 12:26:14 +00004999
5000/*
5001 * Logs when RescueParty resets some set of experiment flags.
5002 *
5003 * Logged from:
5004 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5005 */
5006message RescuePartyResetReported {
5007 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5008 optional int32 rescue_level = 1;
5009}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005010
5011/**
5012 * Logs when signed config is received from an APK, and if that config was applied successfully.
5013 * Logged from:
5014 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5015 */
5016message SignedConfigReported {
5017 enum Type {
5018 UNKNOWN_TYPE = 0;
5019 GLOBAL_SETTINGS = 1;
5020 }
5021 optional Type type = 1;
5022
5023 // The final status of the signed config received.
5024 enum Status {
5025 UNKNOWN_STATUS = 0;
5026 APPLIED = 1;
5027 BASE64_FAILURE_CONFIG = 2;
5028 BASE64_FAILURE_SIGNATURE = 3;
5029 SECURITY_EXCEPTION = 4;
5030 INVALID_CONFIG = 5;
5031 OLD_CONFIG = 6;
5032 SIGNATURE_CHECK_FAILED = 7;
5033 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005034 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005035 }
5036 optional Status status = 2;
5037
5038 // The version of the signed config processed.
5039 optional int32 version = 3;
5040
5041 // The package name that the config was extracted from.
5042 optional string from_package = 4;
5043
5044 enum Key {
5045 NO_KEY = 0;
5046 DEBUG = 1;
5047 PRODUCTION = 2;
5048 }
5049 // Which key was used to verify the config.
5050 optional Key verified_with = 5;
5051}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005052
5053/*
5054 * Logs GNSS Network-Initiated (NI) location events.
5055 *
5056 * Logged from:
5057 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5058 */
5059message GnssNiEventReported {
5060 // The type of GnssNiEvent.
5061 enum EventType {
5062 UNKNOWN = 0;
5063 NI_REQUEST = 1;
5064 NI_RESPONSE = 2;
5065 }
5066 optional EventType event_type = 1;
5067
5068 // An ID generated by HAL to associate NI notifications and UI responses.
5069 optional int32 notification_id = 2;
5070
5071 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005072 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005073
5074 // NI requires notification.
5075 optional bool need_notify = 4;
5076
5077 // NI requires verification.
5078 optional bool need_verify = 5;
5079
5080 // NI requires privacy override, no notification/minimal trace.
5081 optional bool privacy_override = 6;
5082
5083 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5084 // seconds.
5085 optional int32 timeout = 7;
5086
5087 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005088 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005089
5090 // String representing the requester of the network inititated location request.
5091 optional string requestor_id = 9;
5092
5093 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5094 // network initiated location request.
5095 optional string text = 10;
5096
5097 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005098 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005099
5100 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005101 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005102
5103 // True if SUPL ES is enabled.
5104 optional bool is_supl_es_enabled = 13;
5105
5106 // True if GNSS location is enabled.
5107 optional bool is_location_enabled = 14;
5108
5109 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005110 optional android.server.location.GnssUserResponseType user_response = 15;
5111}
5112
5113/**
5114 * Logs GNSS non-framework (NFW) location notification.
5115 *
5116 * Logged from:
5117 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5118 */
5119message GnssNfwNotificationReported {
5120 // Package name of the Android proxy application representing the non-framework entity that
5121 // requested location. Set to empty string if unknown.
5122 optional string proxy_app_package_name = 1;
5123
5124 // Protocol stack that initiated the non-framework location request.
5125 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5126
5127 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5128 // set to empty string. This field is opaque to the framework and used for logging purposes.
5129 optional string other_protocol_stack_name = 3;
5130
5131 // Source initiating/receiving the location information.
5132 optional android.server.location.NfwRequestor requestor = 4;
5133
5134 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5135 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5136 // and used for logging purposes.
5137 optional string requestor_id = 5;
5138
5139 // Indicates whether location information was provided for this request.
5140 optional android.server.location.NfwResponseType response_type = 6;
5141
5142 // True if the device is in user initiated emergency session.
5143 optional bool in_emergency_mode = 7;
5144
5145 // True if cached location is provided.
5146 optional bool is_cached_location = 8;
5147
5148 // True if proxy app permission mismatch between framework and GNSS HAL.
5149 optional bool is_permission_mismatched = 9;
5150}
5151
5152/**
5153 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5154 *
5155 * Logged from:
5156 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5157 */
5158message GnssConfigurationReported {
5159 // SUPL host name.
5160 optional string supl_host = 1;
5161
5162 // SUPL port number.
5163 optional int32 supl_port = 2;
5164
5165 // C2K host name.
5166 optional string c2k_host = 3;
5167
5168 // C2K port number.
5169 optional int32 c2k_port = 4;
5170
5171 // The SUPL version requested by Carrier.
5172 optional int32 supl_ver = 5;
5173
5174 // The SUPL mode.
5175 optional android.server.location.SuplMode supl_mode = 6;
5176
5177 // True if NI emergency SUPL restrictions is enabled.
5178 optional bool supl_es = 7;
5179
5180 // LTE Positioning Profile settings
5181 optional android.server.location.LppProfile lpp_profile = 8;
5182
5183 // Positioning protocol on A-Glonass system.
5184 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5185
5186 // True if emergency PDN is used. Otherwise, regular PDN is used.
5187 optional bool use_emergency_pdn_for_emergency_supl= 10;
5188
5189 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5190 optional android.server.location.GpsLock gps_lock = 11;
5191
5192 // Number of seconds to extend the emergency session duration post emergency call.
5193 optional int32 es_extension_sec = 12;
5194
5195 // The full list of package names of proxy Android applications representing the non-framework
5196 // location access entities (on/off the device) for which the framework user has granted
5197 // non-framework location access permission. The package names are concatenated in one string
5198 // with spaces as separators.
5199 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005200}
Jack Yu95b64f32018-12-13 18:26:11 +08005201
5202/**
5203 * Logs when a NFC device's error occurred.
5204 * Logged from:
5205 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5206 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5207 */
5208message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005209 enum Type {
5210 UNKNOWN = 0;
5211 CMD_TIMEOUT = 1;
5212 ERROR_NOTIFICATION = 2;
5213 AID_OVERFLOW = 3;
5214 }
5215 optional Type type = 1;
5216 // If it's nci cmd timeout, log the timeout command.
5217 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005218
Alex Salod7c3eef2019-01-25 14:43:27 -08005219 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005220}
5221
5222/**
5223 * Logs when a NFC device's state changed event
5224 * Logged from:
5225 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5226 */
5227message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005228 enum State {
5229 UNKNOWN = 0;
5230 OFF = 1;
5231 ON = 2;
5232 ON_LOCKED = 3; // Secure Nfc enabled.
5233 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5234 }
5235 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005236}
5237
5238/**
5239 * Logs when a NFC Beam Transaction occurred.
5240 * Logged from:
5241 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5242 */
5243message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005244 enum Operation {
5245 UNKNOWN = 0;
5246 SEND = 1;
5247 RECEIVE = 2;
5248 }
5249 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005250}
5251
5252/**
5253 * Logs when a NFC Card Emulation Transaction occurred.
5254 * Logged from:
5255 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5256 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5257 */
5258message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005259 enum Category {
5260 UNKNOWN = 0;
5261 HCE_PAYMENT = 1;
5262 HCE_OTHER = 2;
5263 OFFHOST = 3;
5264 }
5265 // Transaction belongs to HCE payment or HCE other category, or offhost.
5266 optional Category category = 1;
5267 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5268 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005269}
5270
5271/**
5272 * Logs when a NFC Tag event occurred.
5273 * Logged from:
5274 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5275 */
5276message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005277 enum Type {
5278 UNKNOWN = 0;
5279 URL = 1;
5280 BT_PAIRING = 2;
5281 PROVISION = 3;
5282 WIFI_CONNECT = 4;
5283 APP_LAUNCH = 5;
5284 OTHERS = 6;
5285 }
5286 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005287}
5288
5289/**
5290 * Logs when Hce transaction triggered
5291 * Logged from:
5292 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5293 */
5294message NfcHceTransactionOccurred {
5295 // The latency period(in microseconds) it took for the first HCE data
5296 // exchange.
5297 optional uint32 latency_micros = 1;
5298}
5299
5300/**
5301 * Logs when SecureElement state event changed
5302 * Logged from:
5303 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5304 */
5305message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005306 enum State {
5307 UNKNOWN = 0;
5308 INITIALIZED = 1;
5309 DISCONNECTED = 2;
5310 CONNECTED = 3;
5311 HALCRASH = 4;
5312 }
5313 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005314
Alex Salod7c3eef2019-01-25 14:43:27 -08005315 optional string state_change_reason = 2;
5316 // SIMx or eSEx.
5317 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005318}
5319
5320/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005321 * Information about a permission grant request
5322 */
5323message PermissionGrantRequestResultReported {
5324 // unique value identifying an API call. A API call might result in multiple of these atoms
5325 optional int64 request_id = 1;
5326
5327 // UID of package requesting the permission grant
5328 optional int32 requesting_uid = 2 [(is_uid) = true];
5329
5330 // Name of package requesting the permission grant
5331 optional string requesting_package_name = 3;
5332
5333 // The permission to be granted
5334 optional string permission_name = 4;
5335
5336 // If the permission was explicitly requested via the API or added by the system
5337 optional bool is_implicit = 5;
5338
5339 enum Result {
5340 UNDEFINED = 0;
5341 // permission request was ignored
5342 IGNORED = 1;
5343 // permission request was ignored because it was user fixed
5344 IGNORED_USER_FIXED = 2;
5345 // permission request was ignored because it was policy fixed
5346 IGNORED_POLICY_FIXED = 3;
5347 // permission was granted by user action
5348 USER_GRANTED = 4;
5349 // permission was automatically granted
5350 AUTO_GRANTED = 5;
5351 // permission was denied by user action
5352 USER_DENIED = 6;
5353 // permission was denied with prejudice by the user
5354 USER_DENIED_WITH_PREJUDICE = 7;
5355 // permission was automatically denied
5356 AUTO_DENIED = 8;
5357 }
5358 // The result of the permission grant
5359 optional Result result = 6;
5360}
5361
5362/**
Jack Yu95b64f32018-12-13 18:26:11 +08005363 * Logs when Omapi API used
5364 * Logged from:
5365 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5366 */
5367message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005368 enum Operation {
5369 UNKNOWN = 0;
5370 OPEN_CHANNEL = 1;
5371 }
5372 optional Operation operation = 1;
5373 // SIMx or eSEx.
5374 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005375
Alex Salod7c3eef2019-01-25 14:43:27 -08005376 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005377}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005378
5379/**
Alex Saloa060aee2019-01-21 14:36:41 -08005380 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5381 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005382 * Logged from:
5383 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5384 */
5385message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005386 optional int64 dispatch_latency_millis = 1;
5387}
5388
5389/**
5390 * Logs AttentionManagerService attention check result.
5391 *
5392 * Logged from:
5393 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5394 */
5395message AttentionManagerServiceResultReported {
5396 // See core/java/android/service/attention/AttentionService.java
5397 enum AttentionCheckResult {
5398 UNKNOWN = 20;
5399 ATTENTION_SUCCESS_ABSENT = 0;
5400 ATTENTION_SUCCESS_PRESENT = 1;
5401 ATTENTION_FAILURE_PREEMPTED = 2;
5402 ATTENTION_FAILURE_TIMED_OUT = 3;
5403 ATTENTION_FAILURE_UNKNOWN = 4;
5404 }
5405 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005406}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005407
5408/**
5409 * Logs when an adb connection changes state.
5410 *
5411 * Logged from:
5412 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5413 */
5414message AdbConnectionChanged {
5415 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5416 // previously selected for this system.
5417 optional int64 last_connection_time_millis = 1;
5418
5419 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5420 // to reconnect via adb without user interaction.
5421 optional int64 auth_window_millis = 2;
5422
5423 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5424 optional android.debug.AdbConnectionStateEnum state = 3;
5425
5426 // True if the 'always allow' option was selected for this system.
5427 optional bool always_allow = 4;
5428}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005429
5430/*
5431 * Logs the reported speech DSP status.
5432 *
5433 * Logged from:
5434 * Vendor audio implementation.
5435 */
5436message SpeechDspStatReported {
5437 // The total Speech DSP uptime in milliseconds.
5438 optional int32 total_uptime_millis = 1;
5439 // The total Speech DSP downtime in milliseconds.
5440 optional int32 total_downtime_millis = 2;
5441 optional int32 total_crash_count = 3;
5442 optional int32 total_recover_count = 4;
5443}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005444
5445/**
5446 * Logs USB connector contaminant status.
5447 *
5448 * Logged from: USB Service.
5449 */
5450message UsbContaminantReported {
5451 optional string id = 1;
5452 optional android.service.usb.ContaminantPresenceStatus status = 2;
5453}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005454
5455/**
5456 * This atom is for debugging purpose.
5457 */
5458message DebugElapsedClock {
5459 // Monotically increasing value for each pull.
5460 optional int64 pull_count = 1;
5461 // Time from System.elapsedRealtime.
5462 optional int64 elapsed_clock_millis = 2;
5463 // Time from System.elapsedRealtime.
5464 optional int64 same_elapsed_clock_millis = 3;
5465 // Diff between current elapsed time and elapsed time from previous pull.
5466 optional int64 elapsed_clock_diff_millis = 4;
5467
5468 enum Type {
5469 TYPE_UNKNOWN = 0;
5470 ALWAYS_PRESENT = 1;
5471 PRESENT_ON_ODD_PULLS = 2;
5472 }
5473 // Type of behavior for the pulled data.
5474 optional Type type = 5;
5475}
5476
5477/**
5478 * This atom is for debugging purpose.
5479 */
5480message DebugFailingElapsedClock {
5481 // Monotically increasing value for each pull.
5482 optional int64 pull_count = 1;
5483 // Time from System.elapsedRealtime.
5484 optional int64 elapsed_clock_millis = 2;
5485 // Time from System.elapsedRealtime.
5486 optional int64 same_elapsed_clock_millis = 3;
5487 // Diff between current elapsed time and elapsed time from previous pull.
5488 optional int64 elapsed_clock_diff_millis = 4;
5489}
Steven Wuacef6bb2019-01-23 14:21:17 -05005490
5491/** Logs System UI bubbles event changed.
5492 *
5493 * Logged from:
5494 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5495 */
5496message BubbleUIChanged {
5497
5498 // The app package that is posting the bubble.
5499 optional string package_name = 1;
5500
5501 // The notification channel that is posting the bubble.
5502 optional string notification_channel = 2;
5503
5504 // The notification id associated with the posted bubble.
5505 optional int32 notification_id = 3;
5506
5507 // The position of the bubble within the bubble stack.
5508 optional int32 position = 4;
5509
5510 // The total number of bubbles within the bubble stack.
5511 optional int32 total_number = 5;
5512
5513 // User interactions with the bubble.
5514 enum Action {
5515 UNKNOWN = 0;
5516 POSTED = 1;
5517 UPDATED = 2;
5518 EXPANDED = 3;
5519 COLLAPSED = 4;
5520 DISMISSED = 5;
5521 STACK_DISMISSED = 6;
5522 STACK_MOVED = 7;
5523 HEADER_GO_TO_APP = 8;
5524 HEADER_GO_TO_SETTINGS = 9;
5525 PERMISSION_OPT_IN = 10;
5526 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005527 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005528 SWIPE_LEFT = 13;
5529 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005530 STACK_EXPANDED = 15;
Steven Wuacef6bb2019-01-23 14:21:17 -05005531 }
5532 optional Action action = 6;
5533
5534 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5535 optional float normalized_x_position = 7;
5536 optional float normalized_y_position = 8;
5537}
Kweku Adams8845d012018-12-11 20:06:45 -08005538
5539/**
Steven Wu552f63f2019-02-05 13:41:36 -05005540 * Logs System UI bubbles developer errors.
5541 *
5542 * Logged from:
5543 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5544 */
5545message BubbleDeveloperErrorReported {
5546
5547 // The app package that is posting the bubble.
5548 optional string package_name = 1;
5549
5550 // Bubble developer error type enums.
5551 enum Error {
5552 UNKNOWN = 0;
5553 ACTIVITY_INFO_MISSING = 1;
5554 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5555 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5556 }
5557 optional Error error = 2 [default = UNKNOWN];
5558}
5559
5560/**
Kweku Adams8845d012018-12-11 20:06:45 -08005561 * Logs that a constraint for a scheduled job has changed.
5562 *
5563 * Logged from:
5564 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5565 */
5566message ScheduledJobConstraintChanged {
5567 repeated AttributionNode attribution_node = 1;
5568
5569 // Name of the job.
5570 optional string job_name = 2;
5571
5572 optional com.android.server.job.ConstraintEnum constraint = 3;
5573
5574 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08005575 UNKNOWN = 0;
5576 UNSATISFIED = 1;
5577 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08005578 }
5579 optional State state = 4;
5580}
Alex Salod7c3eef2019-01-25 14:43:27 -08005581
5582/**
5583 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5584 * returns true.
5585 *
5586 * Logged from:
5587 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5588 */
5589message ScreenTimeoutExtensionReported {
5590 // Describes how many times in a row did the power manager reset the screen off timeout.
5591 optional uint32 consecutive_timeout_extended_count = 1;
5592}
Hui Yu885aca12019-01-10 17:11:34 -08005593
5594/*
5595* Logs number of milliseconds it takes to start a process.
5596* The definition of app process start time is from the app launch time to
5597* the time that Zygote finished forking the app process and loaded the
5598* application package's java classes.
5599
5600* This metric is different from AppStartOccurred which is for foreground
5601* activity only.
5602
5603* ProcessStartTime can report all processes (both foreground and background)
5604* start time.
5605*
5606* Logged from:
5607* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5608*/
5609message ProcessStartTime {
5610 // The uid of the ProcessRecord.
5611 optional int32 uid = 1 [(is_uid) = true];
5612
5613 // The process pid.
5614 optional int32 pid = 2;
5615
5616 // The process name.
5617 // Usually package name, "system" for system server.
5618 // Provided by ActivityManagerService.
5619 optional string process_name = 3;
5620
5621 enum StartType {
5622 UNKNOWN = 0;
5623 WARM = 1;
5624 HOT = 2;
5625 COLD = 3;
5626 }
5627
5628 // The start type.
5629 optional StartType type = 4;
5630
5631 // The elapsed realtime at the start of the process.
5632 optional int64 process_start_time_millis = 5;
5633
5634 // Number of milliseconds it takes to reach bind application.
5635 optional int32 bind_application_delay_millis = 6;
5636
5637 // Number of milliseconds it takes to finish start of the process.
5638 optional int32 process_start_delay_millis = 7;
5639
5640 // hostingType field in ProcessRecord, the component type such as "activity",
5641 // "service", "content provider", "broadcast" or other strings.
5642 optional string hosting_type = 8;
5643
5644 // hostingNameStr field in ProcessRecord. The component class name that runs
5645 // in this process.
5646 optional string hosting_name = 9;
5647}
5648
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005649/**
5650 * State of a dangerous permission requested by a package
5651 */
5652message DangerousPermissionState {
5653 // Name of the permission
5654 optional string permission_name = 1;
5655
5656 // Uid of the package
5657 optional int32 uid = 2 [(is_uid) = true];
5658
5659 // Package requesting the permission
5660 optional string package_name = 3;
5661
5662 // If the permission is granted to the uid
5663 optional bool is_granted = 4;
5664}
5665
Michael Groover4a0ca942019-01-24 17:41:25 -08005666/**
5667 * Logs when a package is denied access to a device identifier based on the new access requirements.
5668 *
5669 * Logged from:
5670 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
5671 */
5672message DeviceIdentifierAccessDenied {
5673 // The name of the package denied access to the requested device identifier.
5674 optional string package_name = 1;
5675
5676 // The name of the device identifier method the package attempted to invoke.
5677 optional string method_name = 2;
5678
5679 // True if the package is preinstalled.
5680 optional bool is_preinstalled = 3;
5681
5682 // True if the package is privileged.
5683 optional bool is_priv_app = 4;
5684}
Chenjie Yue13f44a2019-02-07 17:51:38 -08005685
5686/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08005687 * Pulls the ongoing mainline install train version code.
5688 * Pulled from StatsCompanionService
5689 */
5690message TrainInfo {
5691 optional int64 train_version_code = 1;
5692
5693 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08005694
5695 optional string train_name = 3;
5696
5697 enum Status {
5698 UNKNOWN = 0;
5699 INSTALL_REQUESTED = 1;
5700 INSTALL_STARTED = 2;
5701 INSTALL_STAGED_NOT_READY = 3;
5702 INSTALL_STAGED_READY = 4;
5703 INSTALL_SUCCESS = 5;
5704 INSTALL_FAILURE = 6;
5705 INSTALL_CANCELLED = 7;
5706 INSTALLER_ROLLBACK_REQUESTED = 8;
5707 INSTALLER_ROLLBACK_INITIATED = 9;
5708 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
5709 INSTALLER_ROLLBACK_STAGED = 11;
5710 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
5711 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
5712 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
5713 INSTALLER_ROLLBACK_SUCCESS = 15;
5714 INSTALLER_ROLLBACK_FAILURE = 16;
5715 INSTALLER_ROLLBACK_CANCEL_STAGED_REMOVE_FROM_QUEUE = 17;
5716 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_INITIATED = 18;
5717 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_SUCCESS = 19;
5718 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_FAILURE = 20;
5719 }
5720 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08005721}
joshmccloskey8c3322e2019-01-09 18:25:57 -08005722
5723/**
5724 * Logs the gesture stage changed event.
5725 *
5726 * Logged from:
5727 * frameworks/base/packages/SystemUI/
5728 */
5729message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005730 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005731}
5732
5733/**
5734 * Logs the feedback type.
5735 *
5736 * Logged from:
5737 * frameworks/base/packages/SystemUI/
5738 */
5739message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005740 // Whether or not the gesture was used.
5741 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005742}
5743
5744/**
5745 * Logs the progress.
5746 *
5747 * Logged from:
5748 * frameworks/base/packages/SystemUI/
5749 */
5750message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005751 // [0,100] progress for the assist gesture.
5752 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005753}
Neil Fullerdb14b482019-02-05 19:44:44 +00005754
5755/*
5756 * Information about the time zone data on a device.
5757 */
5758message TimeZoneDataInfo {
5759 // A version identifier for the data set on device. e.g. "2018i"
5760 optional string tzdb_version = 1;
5761}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005762
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005763/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005764 * Logs the GPU stats global health information.
5765 *
5766 * Logged from:
5767 * frameworks/native/services/gpuservice/gpustats/
5768 */
5769message GpuStatsGlobalInfo {
5770 // Package name of the gpu driver.
5771 optional string driver_package_name = 1;
5772
5773 // Version name of the gpu driver.
5774 optional string driver_version_name = 2;
5775
5776 // Version code of the gpu driver.
5777 optional int64 driver_version_code = 3;
5778
5779 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
5780 optional int64 driver_build_time = 4;
5781
5782 // Total count of the gl driver gets loaded.
5783 optional int64 gl_loading_count = 5;
5784
5785 // Total count of the gl driver fails to be loaded.
5786 optional int64 gl_loading_failure_count = 6;
5787
5788 // Total count of the Vulkan driver gets loaded.
5789 optional int64 vk_loading_count = 7;
5790
5791 // Total count of the Vulkan driver fails to be loaded.
5792 optional int64 vk_loading_failure_count = 8;
5793}
5794
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005795/**
5796 * GPU driver loading time info.
5797 */
5798message GpuDriverLoadingTime {
5799 // List of all the driver loading times for this app. The list size is
5800 // capped at 50.
5801 repeated int64 driver_loading_time = 1;
5802}
5803
5804/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005805 * Logs the GPU stats per app health information.
5806 *
5807 * Logged from:
5808 * frameworks/native/services/gpuservice/gpustats/
5809 */
5810message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005811 // Package name of the application that loads the gpu driver. Total number
5812 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005813 optional string app_package_name = 1;
5814
5815 // Version code of the gpu driver this app loads.
5816 optional int64 driver_version_code = 2;
5817
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005818 // gl driver loading time info.
5819 optional GpuDriverLoadingTime gl_driver_loading_time = 3
5820 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005821
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005822 // Vulkan driver loading time info.
5823 optional GpuDriverLoadingTime vk_driver_loading_time = 4
5824 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005825}
Rafal Slawikd4e87572019-03-12 13:08:38 +00005826
5827/*
5828 * Logs the size of the system ion heap.
5829 *
5830 * Pulled from StatsCompanionService.
5831 */
5832message SystemIonHeapSize {
5833 // Size of the system ion heap in bytes.
5834 optional int64 size_in_bytes = 1;
5835}