blob: 69372cd379ea67b9cd3cfc3dd2e22ba15a260131 [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 Murdochbab399f62018-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.
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800256 // Next: 10056
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;
Bookatz75ee60422018-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;
David Chenc8a43242017-10-17 16:23:28 -0700314 }
yroa1fe77c2018-02-26 14:22:54 -0800315
Bookatz76aafcf2018-09-17 16:17:10 -0700316 // DO NOT USE field numbers above 100,000 in AOSP.
317 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
318 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700319}
320
Yao Chend54f9dd2017-10-17 17:37:48 +0000321/**
Yangster-mac20877162017-12-22 17:19:39 -0800322 * This proto represents a node of an attribution chain.
323 * Note: All attribution chains are represented as a repeated field of type
324 * AttributionNode. It is understood that in such arrays, the order is that
325 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000326 */
Yangster-mac20877162017-12-22 17:19:39 -0800327message AttributionNode {
328 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800329 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800330
Yangster-mac20877162017-12-22 17:19:39 -0800331 // The (optional) string tag for an element in the attribution chain. If the
332 // element has no tag, it is encoded as an empty string.
333 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700334}
335
Yangster-mac48b3d622018-08-18 12:38:11 -0700336message KeyValuePair {
337 optional int32 key = 1;
338 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700339 int32 value_int = 2;
340 int64 value_long = 3;
341 string value_str = 4;
342 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700343 }
344}
345
346message KeyValuePairsAtom {
347 optional int32 uid = 1;
348 repeated KeyValuePair pairs = 2;
349}
350
Yao Chend54f9dd2017-10-17 17:37:48 +0000351/*
352 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800353 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000354 *
355 * RULES:
356 * - The field ids for each atom must start at 1, and count upwards by 1.
357 * Skipping field ids is not allowed.
358 * - These form an API, so renaming, renumbering or removing fields is
359 * not allowed between android releases. (This is not currently enforced,
360 * but there will be a tool to enforce this restriction).
361 * - The types must be built-in protocol buffer types, namely, no sub-messages
362 * are allowed (yet). The bytes type is also not allowed.
363 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800364 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000365 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800366 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000367 * - A field that is a uid should be a string field, tagged with the [xxx]
368 * annotation. The generated code on android will be represented by UIDs,
369 * and those UIDs will be translated in xxx to those strings.
370 *
371 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700372 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000373 * - If there is a UID, it goes first. Think in an object-oriented fashion.
374 * *****************************************************************************
375 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700376
Yao Chend54f9dd2017-10-17 17:37:48 +0000377/**
Yangster-mace16189a2018-08-26 12:20:16 -0700378 * Logs when the Thermal service HAL notifies the throttling start/stop events.
379 *
380 * Logged from:
381 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
382 */
383message ThermalThrottlingStateChanged {
384 optional android.os.TemperatureTypeEnum sensor_type = 1;
385
386 enum State {
387 UNKNOWN = 0;
388 START = 1;
389 STOP = 2;
390 }
391
392 optional State state = 2;
393
394 optional float temperature = 3;
395}
396
397/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000398 * Logs when the screen state changes.
399 *
400 * Logged from:
401 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
402 */
403message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800404 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700405 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700406}
Yao Chend54f9dd2017-10-17 17:37:48 +0000407
408/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700409 * Logs that the process state of the uid, as determined by ActivityManager
410 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000411 *
412 * Logged from:
413 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
414 */
Bookatzc1a050a2017-10-10 15:49:28 -0700415message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700416 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000417
Bookatzdb026a22018-01-10 19:01:56 -0800418 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700419 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000420}
421
422/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700423 * Logs process state change of a process, as per the activity manager.
424 *
425 * Logged from:
426 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
427 */
428message ProcessStateChanged {
429 optional int32 uid = 1;
430 optional string process_name = 2;
431 optional string package_name = 3;
432 // TODO: remove this when validation is done
433 optional int64 version = 5;
434 // The state, from frameworks/base/core/proto/android/app/enums.proto.
435 optional android.app.ProcessStateEnum state = 4;
436}
437
438/**
439 * Logs when ActivityManagerService sleep state is changed.
440 *
441 * Logged from:
442 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
443 */
444message ActivityManagerSleepStateChanged {
445 // TODO: import frameworks proto
446 enum State {
447 UNKNOWN = 0;
448 ASLEEP = 1;
449 AWAKE = 2;
450 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700451 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700452}
453
454/**
455 * Logs when system memory state changes.
456 *
457 * Logged from:
458 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
459 */
460message MemoryFactorStateChanged {
461 // TODO: import frameworks proto
462 enum State {
463 MEMORY_UNKNOWN = 0;
464 NORMAL = 1; // normal.
465 MODERATE = 2; // moderate memory pressure.
466 LOW = 3; // low memory.
467 CRITICAL = 4; // critical memory.
468
469 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700470 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700471}
472
473/**
474 * Logs when app is using too much cpu, according to ActivityManagerService.
475 *
476 * Logged from:
477 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
478 */
479message ExcessiveCpuUsageReported {
480 optional int32 uid = 1;
481 optional string process_name = 2;
482 optional string package_name = 3;
483 // package version. TODO: remove this when validation is done
484 optional int64 version = 4;
485}
486
487/**
488 * Logs when a cached process is killed, along with its pss.
489 *
490 * Logged from:
491 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
492 */
493message CachedKillReported {
494 optional int32 uid = 1;
495 optional string process_name = 2;
496 optional string package_name = 3;
497 // TODO: remove this when validation is done
498 optional int64 version = 5;
499 optional int64 pss = 4;
500}
501
502/**
503 * Logs when memory stats of a process is reported.
504 *
505 * Logged from:
506 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
507 */
508message ProcessMemoryStatReported {
509 optional int32 uid = 1;
510 optional string process_name = 2;
511 optional string package_name = 3;
512 //TODO: remove this when validation is done
513 optional int64 version = 9;
514 optional int64 pss = 4;
515 optional int64 uss = 5;
516 optional int64 rss = 6;
517 enum Type {
518 ADD_PSS_INTERNAL_SINGLE = 0;
519 ADD_PSS_INTERNAL_ALL_MEM = 1;
520 ADD_PSS_INTERNAL_ALL_POLL = 2;
521 ADD_PSS_EXTERNAL = 3;
522 ADD_PSS_EXTERNAL_SLOW = 4;
523 }
524 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800525 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700526}
527
528/**
Bookatzc1a050a2017-10-10 15:49:28 -0700529 * Logs that a process started, finished, crashed, or ANRed.
530 *
531 * Logged from:
532 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
533 */
534message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700535 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700536
David Chen0b5c90c2018-01-25 16:51:49 -0800537 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800538 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700539
Bookatzddccf0a2017-11-28 16:48:14 -0800540 // What lifecycle state the process changed to.
541 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800542 enum State {
543 FINISHED = 0;
544 STARTED = 1;
545 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800546 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800547 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700548}
549
Bookatzc1a050a2017-10-10 15:49:28 -0700550/**
551 * Logs when the ble scan state changes.
552 *
553 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700554 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700555 */
556message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800557 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700558
559 enum State {
560 OFF = 0;
561 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700562 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
563 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700564 }
565 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700566
Bookatze5ec0b42018-03-26 13:34:56 -0700567 // Does the scan have a filter.
568 optional bool is_filtered = 3;
569 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
570 optional bool is_first_match = 4;
571 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
572 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700573}
574
575/**
576 * Logs reporting of a ble scan finding results.
577 *
578 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700579 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700580 */
Bookatzae6738e2018-09-13 11:38:56 -0700581// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700582message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800583 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700584
585 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800586 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700587}
588
589/**
590 * Logs when a sensor state changes.
591 *
592 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700593 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700594 */
595message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800596 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700597
Bookatzc1a050a2017-10-10 15:49:28 -0700598 // The id (int) of the sensor.
599 optional int32 sensor_id = 2;
600
601 enum State {
602 OFF = 0;
603 ON = 1;
604 }
605 optional State state = 3;
606}
607
Bookatzc1a050a2017-10-10 15:49:28 -0700608/**
609 * Logs when GPS state changes.
610 *
611 * Logged from:
612 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
613 */
614message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800615 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700616
617 enum State {
618 OFF = 0;
619 ON = 1;
620 }
621 optional State state = 2;
622}
623
Bookatz48d362e2018-11-06 15:49:08 -0800624/**
625 * Logs when GPS signal quality.
626 *
627 * Logged from:
628 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
629 */
630message GpsSignalQualityChanged {
631 optional android.server.location.GpsSignalQualityEnum level = 1;
632}
633
Bookatzc1a050a2017-10-10 15:49:28 -0700634
635/**
636 * Logs when a sync manager sync state changes.
637 *
638 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700639 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700640 */
641message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800642 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700643
David Chen0b5c90c2018-01-25 16:51:49 -0800644 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800645 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700646
647 enum State {
648 OFF = 0;
649 ON = 1;
650 }
651 optional State state = 3;
652}
653
Yangster-mac96353002018-09-05 11:18:55 -0700654/*
655 * Deferred job stats.
656 *
657 * Logged from:
658 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
659*/
660message DeferredJobStatsReported {
661 repeated AttributionNode attribution_node = 1;
662
663 // Number of jobs deferred.
664 optional int32 num_jobs_deferred = 2;
665
666 // Time since the last job runs.
667 optional int64 time_since_last_job_millis = 3;
668}
669
Bookatzc1a050a2017-10-10 15:49:28 -0700670/**
671 * Logs when a job scheduler job state changes.
672 *
673 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700674 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700675 */
676message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800677 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700678
679 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800680 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700681
682 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800683 FINISHED = 0;
684 STARTED = 1;
685 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700686 }
687 optional State state = 3;
688
Tej Singh33a412b2018-03-16 18:43:59 -0700689 // The reason a job has stopped.
690 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700691 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700692 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700693}
694
695/**
696 * Logs when the audio state changes.
697 *
698 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700699 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700700 */
701message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800702 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700703
704 enum State {
705 OFF = 0;
706 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700707 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
708 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700709 }
710 optional State state = 2;
711}
712
713/**
714 * Logs when the video codec state changes.
715 *
716 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700717 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700718 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800719message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800720 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700721
722 enum State {
723 OFF = 0;
724 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700725 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
726 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700727 }
728 optional State state = 2;
729}
730
731/**
732 * Logs when the flashlight state changes.
733 *
734 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700735 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700736 */
737message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800738 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700739
740 enum State {
741 OFF = 0;
742 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700743 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
744 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700745 }
746 optional State state = 2;
747}
748
749/**
750 * Logs when the camera state changes.
751 *
752 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700753 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700754 */
755message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800756 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700757
758 enum State {
759 OFF = 0;
760 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700761 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
762 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700763 }
764 optional State state = 2;
765}
766
767/**
768 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000769 *
770 * Logged from:
771 * TODO
772 */
Bookatzd6746242017-10-24 18:39:35 -0700773message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800774 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000775
Bookatz1a1b0462018-01-12 11:47:03 -0800776 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
777 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700778 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700779
780 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
781 optional string tag = 3;
782
783 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800784 RELEASE = 0;
785 ACQUIRE = 1;
786 CHANGE_RELEASE = 2;
787 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700788 }
789 optional State state = 4;
790}
791
792/**
Bookatzc1a050a2017-10-10 15:49:28 -0700793 * Logs when a partial wakelock is considered 'long' (over 1 min).
794 *
795 * Logged from:
796 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
797 */
798message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800799 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700800
Yao Chend54f9dd2017-10-17 17:37:48 +0000801 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
802 optional string tag = 2;
803
Bookatzc1a050a2017-10-10 15:49:28 -0700804 // TODO: I have no idea what this is.
805 optional string history_tag = 3;
806
807 enum State {
808 OFF = 0;
809 ON = 1;
810 }
811 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000812}
813
Bookatzc1a050a2017-10-10 15:49:28 -0700814/**
Bookatza66083f2018-09-20 17:24:00 -0700815 * Logs when the device is interactive, according to the PowerManager Notifier.
816 *
817 * Logged from:
818 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
819 */
820message InteractiveStateChanged {
821 enum State {
822 OFF = 0;
823 ON = 1;
824 }
825 optional State state = 1;
826}
827
828/**
Bookatzc1a050a2017-10-10 15:49:28 -0700829 * Logs Battery Saver state change.
830 *
831 * Logged from:
832 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
833 */
834message BatterySaverModeStateChanged {
835 enum State {
836 OFF = 0;
837 ON = 1;
838 }
839 optional State state = 1;
840}
841
842/**
843 * Logs Doze mode state change.
844 *
845 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800846 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700847 */
848message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800849 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800850}
851
852
853/**
854 * Logs state change of Doze mode including maintenance windows.
855 *
856 * Logged from:
857 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
858 */
859message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800860 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700861}
862
863/**
864 * Logs screen brightness level.
865 *
866 * Logged from:
867 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
868 */
869message ScreenBrightnessChanged {
870 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
871 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700872}
873
874/**
875 * Logs battery level (percent full, from 0 to 100).
876 *
877 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700878 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700879 */
880message BatteryLevelChanged {
881 // Battery level. Should be in [0, 100].
882 optional int32 battery_level = 1;
883}
884
885/**
886 * Logs change in charging status of the device.
887 *
888 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700889 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700890 */
891message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800892 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
893 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700894}
895
896/**
897 * Logs whether the device is plugged in, and what power source it is using.
898 *
899 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700900 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700901 */
902message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800903 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
904 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700905}
906
Bookatz8c6571b2017-10-24 15:04:41 -0700907/**
908 * Logs when an app's wakeup alarm fires.
909 *
910 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700911 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700912 */
913message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800914 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800915
916 // Name of the wakeup alarm.
917 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700918
919 // Name of source package (for historical reasons, since BatteryStats tracked it).
920 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800921}
922
923/**
924 * Logs when an an app causes the mobile radio to change state.
925 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
926 *
927 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700928 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800929 */
930message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800931 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800932
Bookatz1a1b0462018-01-12 11:47:03 -0800933 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
934 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800935}
936
937/**
938 * Logs when an an app causes the wifi radio to change state.
939 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
940 *
941 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700942 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800943 */
944message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800945 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800946
Bookatz1a1b0462018-01-12 11:47:03 -0800947 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
948 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700949}
950
951/**
952 * Logs kernel wakeup reasons and aborts.
953 *
954 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700955 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700956 */
957message KernelWakeupReported {
958 // Name of the kernel wakeup reason (or abort).
959 optional string wakeup_reason_name = 1;
960
961 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800962 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700963}
964
965/**
Bookatzda1798c2018-12-13 14:16:00 -0800966 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800967 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800968 *
969 * Logged from:
970 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
971 */
972message WifiEnabledStateChanged {
973 enum State {
974 OFF = 0;
975 ON = 1;
976 }
977 optional State state = 1;
978}
979
980/**
981 * 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 -0800982 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
983 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800984 *
985 * Logged from:
986 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
987 */
988message WifiRunningStateChanged {
989 repeated AttributionNode attribution_node = 1;
990
991 enum State {
992 OFF = 0;
993 ON = 1;
994 }
995 optional State state = 2;
996}
997
998/**
Bookatze5885242017-10-24 20:10:31 -0700999 * Logs wifi locks held by an app.
1000 *
1001 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001002 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001003 */
1004message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001005 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001006
1007 enum State {
1008 OFF = 0;
1009 ON = 1;
1010 }
1011 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001012
1013 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1014 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001015}
1016
1017/**
1018 * Logs wifi signal strength changes.
1019 *
1020 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001021 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001022 */
1023message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001024 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1025 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001026}
1027
1028/**
1029 * Logs wifi scans performed by an app.
1030 *
1031 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001032 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001033 */
1034message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001035 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001036
1037 enum State {
1038 OFF = 0;
1039 ON = 1;
1040 }
1041 optional State state = 2;
1042}
1043
1044/**
Tej Singh4503e102018-01-04 14:35:01 -08001045 * Logs wifi multicast locks held by an app
1046 *
1047 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001048 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001049 */
1050message WifiMulticastLockStateChanged {
1051 repeated AttributionNode attribution_node = 1;
1052
1053 enum State {
1054 OFF = 0;
1055 ON = 1;
1056 }
1057 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001058
1059 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001060}
1061
1062/**
Tej Singh1ea42892018-01-19 09:27:00 -08001063 * Logs shutdown reason and duration on next boot.
1064 *
1065 * Logged from:
1066 * frameworks/base/core/java/com/android/server/BootReceiver.java
1067 */
1068message ShutdownSequenceReported {
1069 // True if shutdown is for a reboot. Default: false if we do not know.
1070 optional bool reboot = 1;
1071
1072 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1073 optional string reason = 2;
1074
1075 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1076 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001077 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001078
1079 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001080 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001081}
1082
Tej Singh6483ea42018-01-25 17:45:49 -08001083
1084/**
1085 * Logs boot reason and duration.
1086 *
1087 * Logged from:
1088 * system/core/bootstat/bootstat.cpp
1089 */
1090message BootSequenceReported {
1091 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1092 // Default: "<EMPTY>" if not available.
1093 optional string bootloader_reason = 1;
1094
1095 // Reason for system boot. Eg. bootloader, reboot,userrequested
1096 // Default: "<EMPTY>" if not available.
1097 optional string system_reason = 2;
1098
1099 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001100 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001101
1102 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001103 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001104
1105 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001106 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001107
1108 // Time since last boot in ms. Default: 0 if not available.
1109 optional int64 time_since_last_boot = 6;
1110}
1111
Tej Singhc477d9c2018-02-05 18:31:39 -08001112
1113/**
1114 * Logs call state and disconnect cause (if applicable).
1115 *
1116 * Logged from:
1117 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1118 */
1119message CallStateChanged {
1120 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1121 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1122 optional android.telecom.CallStateEnum call_state = 1;
1123
1124 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1125 // This value is only applicable when the call_state is DISCONNECTED, and
1126 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1127 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1128 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1129
1130 // True if the call is self-managed, which are apps that use the
1131 // telecom infrastructure to make their own calls.
1132 optional bool self_managed = 3;
1133
1134 // True if call is external. External calls are calls on connected Wear
1135 // devices but show up in Telecom so the user can pull them onto the device.
1136 optional bool external_call = 4;
1137}
1138
Tej Singh1ea42892018-01-19 09:27:00 -08001139/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001140 * Logs keyguard state. The keyguard is the lock screen.
1141 *
1142 * Logged from:
1143 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1144 */
1145message KeyguardStateChanged {
1146 enum State {
1147 UNKNOWN = 0;
1148 // The keyguard is hidden when the phone is unlocked.
1149 HIDDEN = 1;
1150 // The keyguard is shown when the phone is locked (screen turns off).
1151 SHOWN= 2;
1152 // The keyguard is occluded when something is overlaying the keyguard.
1153 // Eg. Opening the camera while on the lock screen.
1154 OCCLUDED = 3;
1155 }
1156 optional State state = 1;
1157}
1158
1159/**
1160 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1161 * prompts the user to enter a password (pattern, pin, etc).
1162 *
1163 * Logged from:
1164 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1165 */
1166
1167message KeyguardBouncerStateChanged {
1168 enum State {
1169 UNKNOWN = 0;
1170 // Bouncer is hidden, either as a result of successfully entering the
1171 // password, screen timing out, or user going back to lock screen.
1172 HIDDEN = 1;
1173 // This is when the user is being prompted to enter the password.
1174 SHOWN = 2;
1175 }
1176 optional State state = 1;
1177}
1178
1179/**
1180 * Logs the result of entering a password into the keyguard bouncer.
1181 *
1182 * Logged from:
1183 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1184 */
1185message KeyguardBouncerPasswordEntered {
1186 enum BouncerResult {
1187 UNKNOWN = 0;
1188 // The password entered was incorrect.
1189 FAILURE = 1;
1190 // The password entered was correct.
1191 SUCCESS = 2;
1192 }
1193 optional BouncerResult result = 1;
1194}
1195
Tej Singha883b372018-02-15 11:30:01 -08001196/*
1197 * Logs changes to the configuration of the device. The configuration is defined
1198 * in frameworks/base/core/java/android/content/res/Configuration.java
1199 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1200 * Please go there to interpret the possible values each field can be.
1201 *
1202 * Logged from:
1203 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1204 */
1205message ResourceConfigurationChanged {
1206 // Bit mask of color capabilities of the screen.
1207 // Contains information about the color gamut and hdr mode of the screen.
1208 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001209 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001210
1211 // The target screen density being rendered to.
1212 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001213 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001214
1215 // Current user preference for the scaling factor for fonts,
1216 // relative to the base density scaling.
1217 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001218 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001219
1220 // Flag indicating whether the hard keyboard is hidden.
1221 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001222 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001223
1224 // The type of keyboard attached to the device.
1225 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1226 optional int32 keyboard = 5;
1227
1228 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1229 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001230 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001231
1232 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1233 // 0 if undefined.
1234 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1235 optional int32 mcc = 7;
1236
1237 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1238 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1239 // MNC_ZERO symbol defined in Configuration.java.
1240 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1241 optional int32 mnc = 8;
1242
1243 // The kind of navigation available on the device.
1244 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1245 optional int32 navigation = 9;
1246
1247 // Flag indicating whether the navigation is available.
1248 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001249 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001250
1251 // Overall orientation of the screen.
1252 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1253 optional int32 orientation = 11;
1254
1255 // The current height of the available screen space, in dp units.
1256 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001257 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001258
1259 // Bit mask of overall layout of the screen.
1260 // Contains information about screen size, whether the screen is wider/taller
1261 // than normal, whether the screen layout is right-tl-left or left-to-right,
1262 // and whether the screen has a rounded shape.
1263 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001264 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001265
1266 // Current width of the available screen space, in dp units.
1267 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001268 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001269
1270 // The smallest screen size an application will see in normal operation.
1271 // This is the smallest value of both screenWidthDp and screenHeightDp
1272 // in portrait and landscape.
1273 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001274 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001275
1276 // The type of touch screen attached to the device.
1277 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1278 optional int32 touchscreen = 16;
1279
1280 // Bit mask of the ui mode.
1281 // Contains information about the overall ui mode of the device.
1282 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1283 // Also contains information about whether the device is in night mode.
1284 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001285 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001286}
1287
Tej Singheee317b2018-03-07 19:28:05 -08001288
1289/**
1290 * Logs changes in the connection state of the mobile radio.
1291 *
1292 * Logged from:
1293 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1294 */
1295message MobileConnectionStateChanged {
1296 // States are from the state machine DataConnection.java.
1297 enum State {
1298 UNKNOWN = 0;
1299 // The connection is inactive, or disconnected.
1300 INACTIVE = 1;
1301 // The connection is being activated, or connecting.
1302 ACTIVATING = 2;
1303 // The connection is active, or connected.
1304 ACTIVE = 3;
1305 // The connection is disconnecting.
1306 DISCONNECTING = 4;
1307 // The connection is disconnecting after creating a connection.
1308 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1309 }
1310 optional State state = 1;
1311 // For multi-sim phones, this distinguishes between the sim cards.
1312 optional int32 sim_slot_index = 2;
1313 // Used to identify the connection. Starts at 0 and increments by 1 for
1314 // every new network created. Resets whenever the device reboots.
1315 optional int32 data_connection_id = 3;
1316 // A bitmask for the capabilities of this connection.
1317 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1318 // Default value (if we have no information): 0
1319 optional int64 capabilities = 4;
1320 // If this connection has internet.
1321 // This just checks if the DEFAULT bit of capabilities is set.
1322 optional bool has_internet = 5;
1323}
1324
1325/**
1326 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1327 *
1328 * Logged from:
1329 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1330 */
1331message MobileRadioTechnologyChanged {
1332 optional android.telephony.NetworkTypeEnum state = 1;
1333 // For multi-sim phones, this distinguishes between the sim cards.
1334 optional int32 sim_slot_index = 2;
1335}
1336
Andrew Chantb56388b2018-03-22 21:07:33 -07001337/**
1338 * Logs the VID and PID of any connected USB devices.
1339 *
1340 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1341 *
1342 * Logged by Vendor.
1343 */
1344message UsbDeviceAttached {
1345 optional int32 vid = 1;
1346 optional int32 pid = 2;
1347 optional bool has_audio = 3;
1348 optional bool has_hid = 4;
1349 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001350 enum State {
1351 STATE_DISCONNECTED = 0;
1352 STATE_CONNECTED = 1;
1353 }
1354 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001355 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001356}
1357
Tej Singheee317b2018-03-07 19:28:05 -08001358
Tej Singhdd7bd352018-02-09 19:33:15 -08001359/**
Tej Singh5d991e12018-03-09 19:48:11 -08001360 * Logs when Bluetooth is enabled and disabled.
1361 *
1362 * Logged from:
1363 * services/core/java/com/android/server/BluetoothManagerService.java
1364 */
1365message BluetoothEnabledStateChanged {
1366 repeated AttributionNode attribution_node = 1;
1367 // Whether or not bluetooth is enabled on the device.
1368 enum State {
1369 UNKNOWN = 0;
1370 ENABLED = 1;
1371 DISABLED = 2;
1372 }
1373 optional State state = 2;
1374 // The reason for being enabled/disabled.
1375 // Eg. Airplane mode, crash, application request.
1376 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1377 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001378 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001379}
1380
1381/**
Jack Hed9837c82019-01-09 01:19:13 -08001382 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001383 *
1384 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001385 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1386 *
1387 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001388 */
1389message BluetoothConnectionStateChanged {
1390 // The state of the connection.
1391 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1392 optional android.bluetooth.ConnectionStateEnum state = 1;
1393 // An identifier that can be used to match connect and disconnect events.
1394 // Currently is last two bytes of a hash of a device level ID and
1395 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001396 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1397 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001398 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1399 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001400 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001401 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001402 // An identifier that can be used to match events for this device.
1403 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1404 // Salt: Randomly generated 256 bit value
1405 // Hash algorithm: HMAC-SHA256
1406 // Size: 32 byte
1407 // Default: null or empty if the device identifier is not known
1408 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1409}
1410
1411/**
1412 * Logs when a Bluetooth device connects and disconnects over ACL
1413 *
1414 * Logged from:
1415 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1416 *
1417 * Next Tag: 3
1418 */
1419message BluetoothAclConnectionStateChanged {
1420 // An identifier that can be used to match events for this device.
1421 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1422 // Salt: Randomly generated 256 bit value
1423 // Hash algorithm: HMAC-SHA256
1424 // Size: 32 byte
1425 // Default: null or empty if the device identifier is not known
1426 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1427 // The state of the connection.
1428 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1429 optional android.bluetooth.ConnectionStateEnum state = 2;
1430}
1431
1432/**
1433 * Logs when a Bluetooth device connects and disconnects over SCO
1434 *
1435 * Logged from:
1436 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1437 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1438 *
1439 * Next Tag: 4
1440 */
1441message BluetoothScoConnectionStateChanged {
1442 // An identifier that can be used to match events for this device.
1443 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1444 // Salt: Randomly generated 256 bit value
1445 // Hash algorithm: HMAC-SHA256
1446 // Size: 32 byte
1447 // Default: null or empty if the device identifier is not known
1448 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1449 // The state of the connection.
1450 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1451 optional android.bluetooth.ConnectionStateEnum state = 2;
1452 // Codec used for this SCO connection
1453 // Default: UNKNOWN
1454 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001455}
1456
Jack Hec27040a2019-01-09 20:54:41 -08001457/**
1458 * Logged when active device of a profile changes
1459 *
1460 * Logged from:
1461 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1462 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1463 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1464 */
1465message BluetoothActiveDeviceChanged {
1466 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1467 // From android.bluetooth.BluetoothProfile
1468 optional int32 bt_profile = 1;
1469 // An identifier that can be used to match events for this new active device.
1470 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1471 // Salt: Randomly generated 256 bit value
1472 // Hash algorithm: HMAC-SHA256
1473 // Size: 32 byte
1474 // Default: null or empty if there is no active device for this profile
1475 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1476}
1477
Jack Heab86dbd22018-12-18 15:43:27 -08001478// Logs when there is an event affecting Bluetooth device's link layer connection.
1479// - This event is triggered when there is a related HCI command or event
1480// - Users of this metrics can deduce Bluetooth device's connection state from these events
1481// - HCI commands are logged before the command is sent, after receiving command status, and after
1482// receiving command complete
1483// - HCI events are logged when they arrive
1484//
1485// Low level log from system/bt
1486//
1487// Bluetooth classic commands:
1488// - CMD_CREATE_CONNECTION
1489// - CMD_DISCONNECT
1490// - CMD_CREATE_CONNECTION_CANCEL
1491// - CMD_ACCEPT_CONNECTION_REQUEST
1492// - CMD_REJECT_CONNECTION_REQUEST
1493// - CMD_SETUP_ESCO_CONNECTION
1494// - CMD_ACCEPT_ESCO_CONNECTION
1495// - CMD_REJECT_ESCO_CONNECTION
1496// - CMD_ENH_SETUP_ESCO_CONNECTION
1497// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1498//
1499// Bluetooth low energy commands:
1500// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1501// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1502// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1503// - CMD_BLE_CLEAR_WHITE_LIST
1504// - CMD_BLE_ADD_WHITE_LIST
1505// - CMD_BLE_REMOVE_WHITE_LIST
1506//
1507// Bluetooth classic events:
1508// - EVT_CONNECTION_COMP
1509// - EVT_CONNECTION_REQUEST
1510// - EVT_DISCONNECTION_COMP
1511// - EVT_ESCO_CONNECTION_COMP
1512// - EVT_ESCO_CONNECTION_CHANGED
1513//
1514// Bluetooth low energy meta events:
1515// - BLE_EVT_CONN_COMPLETE_EVT
1516// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1517//
1518// Next tag: 10
1519message BluetoothLinkLayerConnectionEvent {
1520 // An identifier that can be used to match events for this device.
1521 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1522 // Salt: Randomly generated 256 bit value
1523 // Hash algorithm: HMAC-SHA256
1524 // Size: 32 byte
1525 // Default: null or empty if the device identifier is not known
1526 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1527 // Connection handle of this connection if available
1528 // Range: 0x0000 - 0x0EFF (12 bits)
1529 // Default: 0xFFFF if the handle is unknown
1530 optional int32 connection_handle = 2;
1531 // Direction of the link
1532 // Default: DIRECTION_UNKNOWN
1533 optional android.bluetooth.DirectionEnum direction = 3;
1534 // Type of this link
1535 // Default: LINK_TYPE_UNKNOWN
1536 optional android.bluetooth.LinkTypeEnum type = 4;
1537
1538 // Reason metadata for this link layer connection event, rules for interpretation:
1539 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1540 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1541 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1542 // set and valid, ignore hci_ble_event
1543
1544 // HCI command associated with this event
1545 // Default: CMD_UNKNOWN
1546 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1547 // HCI event associated with this event
1548 // Default: EVT_UNKNOWN
1549 optional android.bluetooth.hci.EventEnum hci_event = 6;
1550 // HCI BLE meta event associated with this event
1551 // Default: BLE_EVT_UNKNOWN
1552 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1553 // HCI command status code if this is triggerred by hci_cmd
1554 // Default: STATUS_UNKNOWN
1555 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1556 // HCI reason code associated with this event
1557 // Default: STATUS_UNKNOWN
1558 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1559}
1560
Howard Roe103fe22019-01-17 16:52:16 -08001561/**
1562 * Logs when a module is rolled back by Watchdog.
1563 *
1564 * Logged from: Rollback Manager
1565 */
1566message WatchdogRollbackOccurred {
1567 enum RollbackType {
1568 UNKNOWN = 0;
1569 ROLLBACK_INITIATE = 1;
1570 ROLLBACK_SUCCESS = 2;
1571 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001572 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001573 }
1574 optional RollbackType rollback_type = 1;
1575
1576 optional string package_name = 2;
1577
1578 optional int32 package_version_code = 3;
1579}
1580
Jack Hec27040a2019-01-09 20:54:41 -08001581/**
1582 * Logs when there is a change in Bluetooth A2DP playback state
1583 *
1584 * Logged from:
1585 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1586 */
1587message BluetoothA2dpPlaybackStateChanged {
1588 // An identifier that can be used to match events for this device.
1589 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1590 // Salt: Randomly generated 256 bit value
1591 // Hash algorithm: HMAC-SHA256
1592 // Size: 32 byte
1593 // Default: null or empty if the device identifier is not known
1594 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1595 // Current playback state
1596 // Default: PLAYBACK_STATE_UNKNOWN
1597 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1598 // Current audio coding mode
1599 // Default: AUDIO_CODING_MODE_UNKNOWN
1600 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1601}
1602
1603/**
1604 * Logs when there is a change in A2DP codec config for a particular remote device
1605 *
1606 * Logged from:
1607 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1608 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1609 */
1610message BluetoothA2dpCodecConfigChanged {
1611 // An identifier that can be used to match events for this device.
1612 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1613 // Salt: Randomly generated 256 bit value
1614 // Hash algorithm: HMAC-SHA256
1615 // Size: 32 byte
1616 // Default: null or empty if the device identifier is not known
1617 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1618 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1619 // Default SOURCE_CODEC_TYPE_INVALID
1620 optional int32 codec_type = 2;
1621 // Codec priroity, the higher the more preferred, -1 for disabled
1622 // Default: CODEC_PRIORITY_DEFAULT
1623 optional int32 codec_priority = 3;
1624 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1625 // Default: SAMPLE_RATE_NONE
1626 optional int32 sample_rate = 4;
1627 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1628 // Default: BITS_PER_SAMPLE_NONE
1629 optional int32 bits_per_sample = 5;
1630 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1631 // Default: CHANNEL_MODE_NONE
1632 optional int32 channel_mode = 6;
1633 // Codec specific values
1634 // Default 0
1635 optional int64 codec_specific_1 = 7;
1636 optional int64 codec_specific_2 = 8;
1637 optional int64 codec_specific_3 = 9;
1638 optional int64 codec_specific_4 = 10;
1639}
1640
1641/**
1642 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1643 * Each codec's capability is logged separately due to statsd restriction
1644 *
1645 * Logged from:
1646 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1647 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1648 */
1649message BluetoothA2dpCodecCapabilityChanged {
1650 // An identifier that can be used to match events for this device.
1651 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1652 // Salt: Randomly generated 256 bit value
1653 // Hash algorithm: HMAC-SHA256
1654 // Size: 32 byte
1655 // Default: null or empty if the device identifier is not known
1656 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1657 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1658 // Default SOURCE_CODEC_TYPE_INVALID
1659 optional int32 codec_type = 2;
1660 // Codec priroity, the higher the more preferred, -1 for disabled
1661 // Default: CODEC_PRIORITY_DEFAULT
1662 optional int32 codec_priority = 3;
1663 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1664 // in BluetoothCodecConfig
1665 // Default: empty and SAMPLE_RATE_NONE for individual item
1666 optional int32 sample_rate = 4;
1667 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1668 // in BluetoothCodecConfig
1669 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1670 optional int32 bits_per_sample = 5;
1671 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1672 // BluetoothCodecConfig
1673 // Default: empty and CHANNEL_MODE_NONE for individual item
1674 optional int32 channel_mode = 6;
1675 // Codec specific values
1676 // Default 0
1677 optional int64 codec_specific_1 = 7;
1678 optional int64 codec_specific_2 = 8;
1679 optional int64 codec_specific_3 = 9;
1680 optional int64 codec_specific_4 = 10;
1681}
1682
1683/**
1684 * Logs when A2DP failed to read from PCM source.
1685 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1686 *
1687 * Logged from:
1688 * system/bt
1689 */
1690message BluetoothA2dpAudioUnderrunReported {
1691 // An identifier that can be used to match events for this device.
1692 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1693 // Salt: Randomly generated 256 bit value
1694 // Hash algorithm: HMAC-SHA256
1695 // Size: 32 byte
1696 // Default: null or empty if the device identifier is not known
1697 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1698 // Encoding interval in nanoseconds
1699 // Default: 0
1700 optional int64 encoding_interval_nanos = 2;
1701 // Number of bytes of PCM data that could not be read from the source
1702 // Default: 0
1703 optional int32 num_missing_pcm_bytes = 3;
1704}
1705
1706/**
1707 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1708 * buffer queue is full and we have to drop data
1709 *
1710 * Logged from:
1711 * system/bt
1712 */
1713message BluetoothA2dpAudioOverrunReported {
1714 // An identifier that can be used to match events for this device.
1715 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1716 // Salt: Randomly generated 256 bit value
1717 // Hash algorithm: HMAC-SHA256
1718 // Size: 32 byte
1719 // Default: null or empty if the device identifier is not known
1720 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1721 // Encoding interval in nanoseconds
1722 // Default: 0
1723 optional int64 encoding_interval_nanos = 2;
1724 // Number of buffers dropped in this event
1725 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1726 // Default: 0
1727 optional int32 num_dropped_buffers = 3;
1728 // Number of encoded buffers dropped in this event
1729 // Default 0
1730 optional int32 num_dropped_encoded_frames = 4;
1731 // Number of encoded bytes dropped in this event
1732 // Default: 0
1733 optional int32 num_dropped_encoded_bytes = 5;
1734}
1735
1736/**
1737 * Logs when we receive reports regarding a device's RSSI value
1738 *
1739 * Logged from:
1740 * system/bt
1741 */
1742message BluetoothDeviceRssiReported {
1743 // An identifier that can be used to match events for this device.
1744 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1745 // Salt: Randomly generated 256 bit value
1746 // Hash algorithm: HMAC-SHA256
1747 // Size: 32 byte
1748 // Default: null or empty if the device identifier is not known
1749 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1750 // Connection handle of this connection if available
1751 // Range: 0x0000 - 0x0EFF (12 bits)
1752 // Default: 0xFFFF if the handle is unknown
1753 optional int32 connection_handle = 2;
1754 // HCI command status code if this is triggerred by hci_cmd
1755 // Default: STATUS_UNKNOWN
1756 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1757 // BR/EDR
1758 // Range: -128 ≤ N ≤ 127 (signed integer)
1759 // Units: dB
1760 // LE:
1761 // Range: -127 to 20, 127 (signed integer)
1762 // Units: dBm
1763 // Invalid when an out of range value is reported
1764 optional int32 rssi = 4;
1765}
1766
1767/**
1768 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1769 *
1770 * Logged from:
1771 * system/bt
1772 */
1773message BluetoothDeviceFailedContactCounterReported {
1774 // An identifier that can be used to match events for this device.
1775 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1776 // Salt: Randomly generated 256 bit value
1777 // Hash algorithm: HMAC-SHA256
1778 // Size: 32 byte
1779 // Default: null or empty if the device identifier is not known
1780 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1781 // Connection handle of this connection if available
1782 // Range: 0x0000 - 0x0EFF (12 bits)
1783 // Default: 0xFFFF if the handle is unknown
1784 optional int32 connection_handle = 2;
1785 // HCI command status code if this is triggerred by hci_cmd
1786 // Default: STATUS_UNKNOWN
1787 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1788 // Number of consecutive failed contacts for a connection corresponding to the Handle
1789 // Range: uint16_t, 0-0xFFFF
1790 // Default: 0xFFFFF
1791 optional int32 failed_contact_counter = 4;
1792}
1793
1794/**
1795 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1796 *
1797 * Logged from:
1798 * system/bt
1799 */
1800message BluetoothDeviceTxPowerLevelReported {
1801 // An identifier that can be used to match events for this device.
1802 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1803 // Salt: Randomly generated 256 bit value
1804 // Hash algorithm: HMAC-SHA256
1805 // Size: 32 byte
1806 // Default: null or empty if the device identifier is not known
1807 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1808 // Connection handle of this connection if available
1809 // Range: 0x0000 - 0x0EFF (12 bits)
1810 // Default: 0xFFFF if the handle is unknown
1811 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001812 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001813 // Default: STATUS_UNKNOWN
1814 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1815 // Range: -30 ≤ N ≤ 20
1816 // Units: dBm
1817 // Invalid when an out of range value is reported
1818 optional int32 transmit_power_level = 4;
1819}
Jack Heab86dbd22018-12-18 15:43:27 -08001820
Tej Singh5d991e12018-03-09 19:48:11 -08001821/**
Jack He1021a612019-01-20 21:22:46 -08001822 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1823 * receiving an HCI command from the host
1824 *
1825 * Logged from: system/bt
1826 */
1827message BluetoothHciTimeoutReported {
1828 // HCI command associated with this event
1829 // Default: CMD_UNKNOWN
1830 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1831}
1832
1833/**
1834 * Logs when we receive Bluetooth Link Quality Report event from the controller
1835 * See Android Bluetooth HCI specification for more details
1836 *
1837 * Note: all count and bytes field are counted since last event
1838 *
1839 * Logged from: system/bt
1840 */
1841message BluetoothQualityReportReported {
1842 // Quality report ID
1843 // Original type: uint8_t
1844 // Default: BQR_ID_UNKNOWN
1845 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1846 // Packet type of the connection
1847 // Original type: uint8_t
1848 // Default: BQR_PACKET_TYPE_UNKNOWN
1849 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1850 // Connection handle of the connection
1851 // Original type: uint16_t
1852 optional int32 connection_handle = 3;
1853 // Performing Role for the connection
1854 // Original type: uint8_t
1855 optional int32 connection_role = 4;
1856 // Current Transmit Power Level for the connection. This value is the same as the controller's
1857 // response to the HCI_Read_Transmit_Power_Level HCI command
1858 // Original type: uint8_t
1859 optional int32 tx_power_level = 5;
1860 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1861 // absolute receiver signal strength value
1862 // Original type: int8_t
1863 optional int32 rssi = 6;
1864 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1865 // channels used by the link currently
1866 // Original type: uint8_t
1867 optional int32 snr = 7;
1868 // Indicates the number of unused channels in AFH_channel_map
1869 // Original type: uint8_t
1870 optional int32 unused_afh_channel_count = 8;
1871 // Indicates the number of the channels which are interfered and quality is bad but are still
1872 // selected for AFH
1873 // Original type: uint8_t
1874 optional int32 afh_select_unideal_channel_count = 9;
1875 // Current Link Supervision Timeout Setting
1876 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1877 // Original type: uint16_t
1878 optional int32 lsto = 10;
1879 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1880 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1881 // 0x01 (Piconet Clock)
1882 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1883 // Original type: uint32_t
1884 optional int64 connection_piconet_clock = 11;
1885 // The count of retransmission
1886 // Original type: uint32_t
1887 optional int64 retransmission_count = 12;
1888 // The count of no RX
1889 // Original type: uint32_t
1890 optional int64 no_rx_count = 13;
1891 // The count of NAK (Negative Acknowledge)
1892 // Original type: uint32_t
1893 optional int64 nak_count = 14;
1894 // Controller timestamp of last TX ACK
1895 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1896 // Original type: uint32_t
1897 optional int64 last_tx_ack_timestamp = 15;
1898 // The count of Flow-off (STOP)
1899 // Original type: uint32_t
1900 optional int64 flow_off_count = 16;
1901 // Controller timestamp of last Flow-on (GO)
1902 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1903 // Original type: uint32_t
1904 optional int64 last_flow_on_timestamp = 17;
1905 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1906 // Original type: uint32_t
1907 optional int64 buffer_overflow_bytes = 18;
1908 // Buffer underflow count (in byte) since last event
1909 // Original type: uint32_t
1910 optional int64 buffer_underflow_bytes = 19;
1911}
1912
1913/**
1914 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1915 *
1916 * Notes:
1917 * - Each event can be partially filled as we might learn different pieces of device
1918 * information at different time
1919 * - Multiple device info events can be combined to give more complete picture
1920 * - When multiple device info events tries to describe the same information, the
1921 * later one wins
1922 *
1923 * Logged from:
1924 * packages/apps/Bluetooth
1925 */
1926message BluetoothManufacturerInfoReported {
1927 // An identifier that can be used to match events for this device.
1928 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1929 // Salt: Randomly generated 256 bit value
1930 // Hash algorithm: HMAC-SHA256
1931 // Size: 32 byte
1932 // Default: null or empty if the device identifier is not known
1933 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1934 // Where is this device info obtained from
1935 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1936 // Name of the data source
1937 // For EXTERNAL: package name of the data source
1938 // For INTERNAL: null for general case, component name otherwise
1939 optional string source_name = 3;
1940 // Name of the manufacturer of this device
1941 optional string manufacturer = 4;
1942 // Model of this device
1943 optional string model = 5;
1944 // Hardware version of this device
1945 optional string hardware_version = 6;
1946 // Software version of this device
1947 optional string software_version = 7;
1948}
1949
1950/**
1951 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1952 * device, as documented by the Bluetooth Core HCI specification
1953 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1954 * Vol 2, Part E, Page 1118
1955 *
1956 * Logged from:
1957 * system/bt
1958 */
1959message BluetoothRemoteVersionInfoReported {
1960 // Connection handle of the connection
1961 // Original type: uint16_t
1962 optional int32 connection_handle = 1;
1963 // HCI command status code
1964 // Default: STATUS_UNKNOWN
1965 optional android.bluetooth.hci.StatusEnum hci_status = 2;
1966 // 1 byte Version of current LMP in the remote controller
1967 optional int32 lmp_version = 3;
1968 // 2 bytes LMP manufacturer code of the remote controller
1969 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
1970 optional int32 lmp_manufacturer_code = 4;
1971 // 4 bytes subversion of the LMP in the remote controller
1972 optional int32 lmp_subversion = 5;
1973}
1974
1975/**
1976 * Logs when certain Bluetooth SDP attributes are discovered
1977 * Constant definitions are from:
1978 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
1979 *
1980 * Current logged attributes:
1981 * - BluetoothProfileDescriptorList
1982 * - Supported Features Bitmask
1983 *
1984 * Logged from:
1985 * system/bt
1986 */
1987message BluetoothSdpAttributeReported {
1988 // An identifier that can be used to match events for this device.
1989 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1990 // Salt: Randomly generated 256 bit value
1991 // Hash algorithm: HMAC-SHA256
1992 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1993 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
1994 // Original type: uint16_t
1995 optional int32 protocol_uuid = 2;
1996 // Short form UUIDs used to identify Bluetooth SDP attribute types
1997 // Original type: uint16_t
1998 optional int32 attribute_id = 3;
1999 // Attribute value for the particular attribute
2000 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2001}
2002
2003/**
2004 * Logs when bond state of a Bluetooth device changes
2005 *
2006 * Logged from:
2007 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2008 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2009 */
2010message BluetoothBondStateChanged {
2011 // An identifier that can be used to match events for this device.
2012 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2013 // Salt: Randomly generated 256 bit value
2014 // Hash algorithm: HMAC-SHA256
2015 // Size: 32 byte
2016 // Default: null or empty if the device identifier is not known
2017 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2018 // Preferred transport type to remote dual mode device
2019 // Default: TRANSPORT_AUTO means no preference
2020 optional android.bluetooth.TransportTypeEnum transport = 2;
2021 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2022 // Default: UNKNOWN
2023 optional android.bluetooth.DeviceTypeEnum type = 3;
2024 // Current bond state (NONE, BONDING, BONDED)
2025 // Default: BOND_STATE_UNKNOWN
2026 optional android.bluetooth.BondStateEnum bond_state = 4;
2027 // Bonding sub state
2028 // Default: BOND_SUB_STATE_UNKNOWN
2029 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2030 // Unbond Reason
2031 // Default: UNBOND_REASON_UNKNOWN
2032 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2033}
2034
2035/**
2036 * Logs there is an event related Bluetooth classic pairing
2037 *
2038 * Logged from:
2039 * system/bt
2040 */
2041message BluetoothClassicPairingEventReported {
2042 // An identifier that can be used to match events for this device.
2043 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2044 // Salt: Randomly generated 256 bit value
2045 // Hash algorithm: HMAC-SHA256
2046 // Size: 32 byte
2047 // Default: null or empty if the device identifier is not known
2048 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2049 // Connection handle of this connection if available
2050 // Range: 0x0000 - 0x0EFF (12 bits)
2051 // Default: 0xFFFF if the handle is unknown
2052 optional int32 connection_handle = 2;
2053 // HCI command associated with this event
2054 // Default: CMD_UNKNOWN
2055 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2056 // HCI event associated with this event
2057 // Default: EVT_UNKNOWN
2058 optional android.bluetooth.hci.EventEnum hci_event = 4;
2059 // HCI command status code if this is triggerred by hci_cmd
2060 // Default: STATUS_UNKNOWN
2061 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2062 // HCI reason code associated with this event
2063 // Default: STATUS_UNKNOWN
2064 optional android.bluetooth.hci.StatusEnum reason_code = 6;
2065}
2066
2067/**
2068 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2069 *
2070 * Logged from:
2071 * system/bt
2072 */
2073message BluetoothSmpPairingEventReported {
2074 // An identifier that can be used to match events for this device.
2075 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2076 // Salt: Randomly generated 256 bit value
2077 // Hash algorithm: HMAC-SHA256
2078 // Size: 32 byte
2079 // Default: null or empty if the device identifier is not known
2080 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2081 // SMP command sent or received over L2CAP
2082 // Default: CMD_UNKNOWN
2083 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2084 // Whether this command is sent or received
2085 // Default: DIRECTION_UNKNOWN
2086 optional android.bluetooth.DirectionEnum direction = 3;
2087 // SMP failure reason code
2088 // Default: PAIRING_FAIL_REASON_DEFAULT
2089 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2090}
2091
2092/**
Jack He815cdba2019-01-30 17:24:55 -08002093 * Logs when a Bluetooth socket’s connection state changed
2094 *
2095 * Logged from:
2096 * system/bt
2097 */
2098message BluetoothSocketConnectionStateChanged {
2099 // An identifier that can be used to match events for this device.
2100 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2101 // Salt: Randomly generated 256 bit value
2102 // Hash algorithm: HMAC-SHA256
2103 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002104 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002105 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002106 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002107 // Default 0 when unknown or don't care
2108 optional int32 port = 2;
2109 // Socket type as mentioned in
2110 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2111 // Default: SOCKET_TYPE_UNKNOWN
2112 optional android.bluetooth.SocketTypeEnum type = 3;
2113 // Socket connection state
2114 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2115 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2116 // Number of bytes sent to remote device during this connection
2117 optional int64 tx_bytes = 5;
2118 // Number of bytes received from remote device during this connection
2119 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002120 // Socket owner's UID
2121 optional int32 uid = 7 [(is_uid) = true];
2122 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2123 // |port| must be spawned by |server_port|
2124 // Default 0 when unknown or don't care
2125 optional int32 server_port = 8;
2126 // Whether this is a server listener socket
2127 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002128}
2129
2130/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002131 * Logs when something is plugged into or removed from the USB-C connector.
2132 *
2133 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002134 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002135 */
2136message UsbConnectorStateChanged {
2137 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002138 STATE_DISCONNECTED = 0;
2139 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002140 }
2141 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002142 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002143 // Last active session in ms.
2144 // 0 when the port is in connected state.
2145 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002146}
2147
2148/**
2149 * Logs the reported speaker impedance.
2150 *
2151 * Logged from:
2152 * Vendor audio implementation.
2153 */
2154message SpeakerImpedanceReported {
2155 optional int32 speaker_location = 1;
2156 optional int32 impedance = 2;
2157}
2158
2159/**
2160 * Logs the report of a failed hardware.
2161 *
2162 * Logged from:
2163 * Vendor HALs.
2164 *
2165 */
2166message HardwareFailed {
2167 enum HardwareType {
2168 HARDWARE_FAILED_UNKNOWN = 0;
2169 HARDWARE_FAILED_MICROPHONE = 1;
2170 HARDWARE_FAILED_CODEC = 2;
2171 HARDWARE_FAILED_SPEAKER = 3;
2172 HARDWARE_FAILED_FINGERPRINT = 4;
2173 }
2174 optional HardwareType hardware_type = 1;
2175
Maggie White6dcd8572019-01-31 14:11:50 -08002176 /**
2177 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002178 * the same hardware_type. The specific locations are vendor defined integers,
2179 * referring to board-specific numbering schemes.
2180 */
2181 optional int32 hardware_location = 2;
2182
Maggie White6dcd8572019-01-31 14:11:50 -08002183 /**
2184 * failure_code is specific to the HardwareType of the failed hardware.
2185 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002186 */
Maggie White6dcd8572019-01-31 14:11:50 -08002187 enum HardwareErrorCode {
2188 UNKNOWN = 0;
2189 COMPLETE = 1;
2190 SPEAKER_HIGH_Z = 2;
2191 SPEAKER_SHORT = 3;
2192 FINGERPRINT_SENSOR_BROKEN = 4;
2193 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002194 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002195 }
2196 optional int32 failure_code = 3;
2197}
2198
2199/**
2200 * Log an event when the device has been physically dropped.
2201 * Reported from the /vendor partition.
2202 */
2203message PhysicalDropDetected {
2204 // Confidence that the event was actually a drop, 0 -> 100
2205 optional int32 confidence_pctg = 1;
2206 // Peak acceleration of the drop, in 1/1000s of a g.
2207 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002208 // Duration of freefall in ms
2209 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002210}
2211
2212/**
2213 * Log bucketed battery charge cycles.
2214 *
2215 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002216 * a given charge point. For example, if 10 cycle buckets are
2217 * initialized, bucket 1 is the lowest 1/10th of the battery,
2218 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002219 *
2220 * Logged from:
2221 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2222 */
2223message ChargeCyclesReported {
2224 optional int32 cycle_bucket_1 = 1;
2225 optional int32 cycle_bucket_2 = 2;
2226 optional int32 cycle_bucket_3 = 3;
2227 optional int32 cycle_bucket_4 = 4;
2228 optional int32 cycle_bucket_5 = 5;
2229 optional int32 cycle_bucket_6 = 6;
2230 optional int32 cycle_bucket_7 = 7;
2231 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002232 optional int32 cycle_bucket_9 = 9;
2233 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002234}
2235
2236/**
Howard Roa46b6582018-09-18 16:45:02 -07002237 * Log battery health snapshot.
2238 *
2239 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2240 * are snapshotted periodically over 24hrs.
2241 */
2242message BatteryHealthSnapshot {
2243 enum BatterySnapshotType {
2244 UNKNOWN = 0;
2245 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2246 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2247 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2248 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2249 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2250 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2251 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2252 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2253 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2254 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2255 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2256 }
2257 optional BatterySnapshotType type = 1;
2258 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002259 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002260 // Voltage Battery Voltage, in microVolts.
2261 optional int32 voltage_micro_volt = 3;
2262 // Current Battery current, in microAmps.
2263 optional int32 current_micro_amps = 4;
2264 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2265 optional int32 open_circuit_micro_volt = 5;
2266 // Resistance Battery Resistance, in microOhms.
2267 optional int32 resistance_micro_ohm = 6;
2268 // Level Battery Level, as % of full.
2269 optional int32 level_percent = 7;
2270}
2271
2272/**
2273 * Log slow I/O operations on the primary storage.
2274 */
2275message SlowIo {
2276 // Classifications of IO Operations.
2277 enum IoOperation {
2278 UNKNOWN = 0;
2279 READ = 1;
2280 WRITE = 2;
2281 UNMAP = 3;
2282 SYNC = 4;
2283 }
2284 optional IoOperation operation = 1;
2285
2286 // The number of slow IO operations of this type over 24 hours.
2287 optional int32 count = 2;
2288}
2289
2290/**
2291 * Log battery caused shutdown with the last recorded voltage.
2292 */
2293message BatteryCausedShutdown {
2294 // The last recorded battery voltage prior to shutdown.
2295 optional int32 last_recorded_micro_volt = 1;
2296}
2297
2298/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002299 * Logs the duration of a davey (jank of >=700ms) when it occurs
2300 *
2301 * Logged from:
2302 * frameworks/base/libs/hwui/JankTracker.cpp
2303 */
2304message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002305 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002306 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002307
Tej Singhbb8554a2018-01-26 11:59:14 -08002308 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002309 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002310}
2311
2312/**
Bookatze5885242017-10-24 20:10:31 -07002313 * Logs phone signal strength changes.
2314 *
2315 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002316 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002317 */
2318message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002319 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2320 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002321}
2322
Yangster4ccebea2018-10-09 17:09:02 -07002323
2324/**
2325 * Logs when the phone state, sim state or signal strength changes
2326 *
2327 * Logged from:
2328 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2329 */
2330message PhoneServiceStateChanged {
2331 optional android.telephony.ServiceStateEnum state = 1;
2332 optional android.telephony.SimStateEnum sim_state = 2;
2333 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2334}
2335
2336/**
2337 * Logs when the phone becomes on or off.
2338 *
2339 * Logged from:
2340 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2341 */
2342message PhoneStateChanged {
2343 enum State {
2344 OFF = 0;
2345 ON = 1;
2346 }
2347 optional State state = 1;
2348}
2349
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002350message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002351 optional android.stats.launcher.LauncherAction action = 1;
2352 optional android.stats.launcher.LauncherState src_state = 2;
2353 optional android.stats.launcher.LauncherState dst_state = 3;
2354 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002355 optional bool is_swipe_up_enabled = 5;
2356}
2357
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002358message StyleUIChanged {
2359 optional android.stats.style.Action action = 1;
2360 optional int32 color_package_hash = 2;
2361 optional int32 font_package_hash = 3;
2362 optional int32 shape_package_hash = 4;
2363 optional int32 clock_package_hash = 5;
2364 optional int32 launcher_grid = 6;
2365 optional int32 wallpaper_category_hash = 7;
2366 optional int32 wallpaper_id_hash = 8;
2367}
2368
David Chenc28b2bb2017-10-24 12:52:52 -07002369/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002370 * Logs when Settings UI has changed.
2371 *
2372 * Logged from:
2373 * packages/apps/Settings
2374 */
2375message SettingsUIChanged {
2376 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002377 * Where this SettingsUIChange event comes from. For example, if
2378 * it's a PAGE_VISIBLE event, where the page is opened from.
2379 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002380 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002381
2382 /**
2383 * What the UI action is.
2384 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002385 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002386
2387 /**
2388 * Where the action is happening
2389 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002390 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002391
2392 /**
2393 * What preference changed in this event.
2394 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002395 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002396
2397 /**
2398 * The new value of the changed preference.
2399 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002400 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002401}
2402
2403/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002404 * Logs basic timing information about touch events.
2405 * Reported at most every 5 minutes while device is being interacted with.
2406 *
2407 * Logged from:
2408 * frameworks/native/services/inputflinger
2409 */
2410message TouchEventReported {
2411 /**
2412 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2413 * and the standard deviation of latency between the kernel and framework
2414 * for touchscreen events. The units are microseconds.
2415 *
2416 * The number is measured as the difference between the time at which
2417 * the input event was received in the evdev driver,
2418 * and the time at which the input event was received in EventHub.
2419 */
2420 // Minimum value
2421 optional float latency_min_micros = 1;
2422 // Maximum value
2423 optional float latency_max_micros = 2;
2424 // Average value
2425 optional float latency_mean_micros = 3;
2426 // Standard deviation
2427 optional float latency_stdev_micros = 4;
2428}
2429
2430/**
Philip Quinn0eded622019-01-29 12:46:28 -08002431 * Logs gesture classification and timing information for touch events.
2432 *
2433 * Logged from:
2434 * frameworks/base/core/java/android/view/GestureDetector.java
2435 * frameworks/base/core/java/android/view/View.java
2436 */
2437message TouchGestureClassified {
2438 // The source of the classification (e.g. Java class name).
2439 optional string source = 1;
2440
2441 enum Classification {
2442 UNKNOWN_CLASSIFICATION = 0;
2443 SINGLE_TAP = 1;
2444 DOUBLE_TAP = 2;
2445 LONG_PRESS = 3;
2446 DEEP_PRESS = 4;
2447 SCROLL = 5;
2448 }
2449 // The classification of the gesture.
2450 optional Classification classification = 2;
2451
2452 // The interval from the start of a touch event stream until the
2453 // classification was made.
2454 optional int32 latency_millis = 3;
2455
2456 // The distance from the location of the first touch event to the
2457 // location of the touch event when the classification was made.
2458 optional float displacement_px = 4;
2459}
2460
2461/**
David Chenc28b2bb2017-10-24 12:52:52 -07002462 * Logs that a setting was updated.
2463 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002464 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002465 * The tag and is_default allow resetting of settings to default values based on the specified
2466 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2467 */
2468message SettingChanged {
2469 // The name of the setting.
2470 optional string setting = 1;
2471
2472 // The change being imposed on this setting. May represent a number, eg "3".
2473 optional string value = 2;
2474
2475 // The new value of this setting. For most settings, this is same as value. For some settings,
2476 // value is +X or -X where X represents an element in a set. For example, if the previous value
2477 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2478 // The +/- feature is currently only used for location_providers_allowed.
2479 optional string new_value = 3;
2480
2481 // The previous value of this setting.
2482 optional string prev_value = 4;
2483
2484 // The tag used with the is_default for resetting sets of settings. This is generally null.
2485 optional string tag = 5;
2486
Bookatz90867622018-01-31 15:05:57 -08002487 // True if this setting with tag should be resettable.
2488 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002489
David Chenbd789912018-03-16 17:19:55 -07002490 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002491 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002492
2493 enum ChangeReason {
2494 UPDATED = 1; // Updated can be an insertion or an update.
2495 DELETED = 2;
2496 }
2497 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002498}
Chenjie Yub3dda412017-10-24 13:41:59 -07002499
Chenjie Yu05013b32017-11-21 10:21:41 -08002500/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002501 * Logs activity going to foreground or background
2502 *
2503 * Logged from:
2504 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2505 */
2506message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002507 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002508 optional string pkg_name = 2;
2509 optional string class_name = 3;
2510
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002511 enum State {
2512 BACKGROUND = 0;
2513 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002514 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002515 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002516}
David Chenc8a43242017-10-17 16:23:28 -07002517
2518/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002519 * Logs when a volume entered low Storage state.
2520 * Logged from:
2521 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2522 */
2523message LowStorageStateChanged {
2524 // Volume that ran out of storage.
2525 optional string volume_description = 1;
2526
2527 enum State {
2528 UNKNOWN = 0;
2529 OFF = 1;
2530 ON = 2;
2531 }
2532 optional State state = 2;
2533}
2534
2535/**
2536 * Logs when an app is downgraded.
2537 * Logged from:
2538 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2539 */
2540message AppDowngraded {
2541 optional string package_name = 1;
2542 // Size of the package (all data) before being downgraded.
2543 optional int64 size_in_bytes_before = 2;
2544 // Size of the package (all data) after being downgraded.
2545 optional int64 size_in_bytes_after = 3;
2546
2547 optional bool aggressive = 4;
2548}
2549
2550/**
2551 * Logs when an app is optimized after being downgraded.
2552 * Logged from:
2553 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2554 */
2555message AppOptimizedAfterDowngraded {
2556 optional string package_name = 1;
2557}
2558
2559/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002560 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002561 * Logged from:
2562 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2563 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002564message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002565 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002566
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002567 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002568
2569 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002570 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002571 optional string process_name = 3;
2572
2573 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002574 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002575
2576 optional string package_name = 5;
2577
2578 enum InstantApp {
2579 UNAVAILABLE = 0;
2580 FALSE = 1;
2581 TRUE = 2;
2582 }
2583 optional InstantApp is_instant_app = 6;
2584
2585 enum ForegroundState {
2586 UNKNOWN = 0;
2587 BACKGROUND = 1;
2588 FOREGROUND = 2;
2589 }
2590 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002591
2592 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002593}
David Chen9e3808c2017-11-20 17:25:34 -08002594
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002595/**
2596 * Logs when a WTF (What a Terrible Failure) happened.
2597 * Logged from:
2598 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2599 */
2600message WTFOccurred {
2601 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002602
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002603 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002604
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002605 // The name of the process.
2606 // system_server if it is not by an app
2607 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002608
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002609 // The pid if available. -1 means not available.
2610 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002611
2612 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002613}
2614
2615/**
2616 * Logs when system server reports low memory.
2617 * Logged from:
2618 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2619 */
2620message LowMemReported {
2621}
2622
2623/**
2624 * Logs when an app ANR (App Not Responding) occurs.
2625 * Logged from:
2626 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2627 */
2628message ANROccurred {
2629 optional int32 uid = 1 [(is_uid) = true];
2630
2631 optional string process_name = 2;
2632
2633 optional string short_component_name = 3;
2634
2635 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002636
2637 enum InstantApp {
2638 UNAVAILABLE = 0;
2639 FALSE = 1;
2640 TRUE = 2;
2641 }
2642 optional InstantApp is_instant_app = 5;
2643
2644 enum ForegroundState {
2645 UNKNOWN = 0;
2646 BACKGROUND = 1;
2647 FOREGROUND = 2;
2648 }
2649 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002650
2651 optional android.server.ErrorSource error_source = 7;
2652
2653 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002654}
2655
Bookatza7020bd2018-08-28 16:29:35 -07002656/**
2657 * Logs when the vibrator state changes.
2658 * Logged from:
2659 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2660 */
2661message VibratorStateChanged {
2662 repeated AttributionNode attribution_node = 1;
2663
2664 enum State {
2665 OFF = 0;
2666 ON = 1;
2667 }
2668 optional State state = 2;
2669
2670 // Duration (in milliseconds) requested to keep the vibrator on.
2671 // Only applicable for State == ON.
2672 optional int64 duration_millis = 3;
2673}
2674
David Chen0a368b22017-12-06 16:28:16 -08002675/*
2676 * Allows other apps to push events into statsd.
2677 * Logged from:
2678 * frameworks/base/core/java/android/util/StatsLog.java
2679 */
David Chen0b5c90c2018-01-25 16:51:49 -08002680message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002681 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002682 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002683
2684 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2685 optional int32 label = 2;
2686
2687 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2688 // predicates for the metrics).
2689 enum State {
2690 UNKNOWN = 0;
2691 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2692 STOP = 2;
2693 START = 3;
2694 }
2695 optional State state = 3;
2696}
2697
David Chen9e3808c2017-11-20 17:25:34 -08002698/**
Bookatz7948c872018-09-04 12:58:33 -07002699 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2700 * For example, this could be due to the user manually changing the time.
2701 *
2702 * Logged from:
2703 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2704 */
2705message WallClockTimeShifted {
2706 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2707 optional int64 wall_clock_timestamp_millis = 1;
2708}
2709
2710/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002711 * Logs when statsd detects an anomaly.
2712 *
2713 * Logged from:
2714 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2715 */
2716message AnomalyDetected {
2717 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002718 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002719
Yangster-mac94e197c2018-01-02 16:03:03 -08002720 // Id of the config whose anomaly detection alert fired.
2721 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002722
Yangster-mac94e197c2018-01-02 16:03:03 -08002723 // Id of the alert (i.e. name of the anomaly that was detected).
2724 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002725}
2726
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002727message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002728 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002729 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002730
2731 // The app package name.
2732 optional string pkg_name = 2;
2733
2734 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002735 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002736 WARM = 1;
2737 HOT = 2;
2738 COLD = 3;
2739 }
2740 // The transition type.
2741 optional TransitionType type = 3;
2742
2743 // The activity name.
2744 optional string activity_name = 4;
2745
2746 // The name of the calling app. Empty if not set.
2747 optional string calling_pkg_name = 5;
2748
2749 // Whether the app is an instant app.
2750 optional bool is_instant_app = 6;
2751
2752 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002753 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002754
Bookatz80d11a02018-01-16 10:46:35 -08002755 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002756
David Chen0b5c90c2018-01-25 16:51:49 -08002757 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002758 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002759 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002760 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002761 optional int32 bind_application_delay_millis = 11;
2762 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002763
2764 // Empty if not set.
2765 optional string launch_token = 13;
2766
Calin Juravle759fbda2018-02-20 19:52:30 +00002767 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002768 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002769
2770 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002771 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002772}
2773
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002774message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002775 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002776 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002777
2778 // The app package name.
2779 optional string pkg_name = 2;
2780
2781 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002782 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002783 WARM = 1;
2784 HOT = 2;
2785 COLD = 3;
2786 }
2787 // The transition type.
2788 optional TransitionType type = 3;
2789
2790 // The activity name.
2791 optional string activity_name = 4;
2792}
2793
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002794message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002795 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002796 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002797
2798 // The app package name.
2799 optional string pkg_name = 2;
2800
2801 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002802 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002803 WITH_BUNDLE = 1;
2804 WITHOUT_BUNDLE = 2;
2805 }
2806 // The transition type.
2807 optional TransitionType type = 3;
2808
2809 // The activity name.
2810 optional string activity_name = 4;
2811
2812 optional bool transition_process_running = 5;
2813
2814 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002815 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002816}
2817
Bookatz8fcd09a2017-12-18 13:01:10 -08002818/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002819 * Logs a picture-in-picture action
2820 * Logged from:
2821 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2822 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2823 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2824 */
2825message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002826 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002827 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002828
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002829 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002830
Chenjie Yu52cacc62017-12-08 18:11:45 -08002831 enum State {
2832 ENTERED = 1;
2833 EXPANDED_TO_FULL_SCREEN = 2;
2834 MINIMIZED = 3;
2835 DISMISSED = 4;
2836 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002837 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002838}
2839
2840/**
Chenjie Yue8904192017-12-08 19:12:57 -08002841 * Logs overlay action
2842 * Logged from:
2843 * services/core/java/com/android/server/wm/Session.java
2844 */
2845message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002846 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002847
2848 optional string package_name = 2;
2849
2850 optional bool using_alert_window = 3;
2851
2852 enum State {
2853 ENTERED = 1;
2854 EXITED = 2;
2855 }
2856 optional State state = 4;
2857}
2858
Chenjie Yuccfe6452018-01-30 11:33:21 -08002859/*
2860 * Logs foreground service starts and stops.
2861 * Note that this is not when a service starts or stops, but when it is
2862 * considered foreground.
2863 * Logged from
2864 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2865 */
2866message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002867 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002868 // package_name + "/" + class_name
2869 optional string short_name = 2;
2870
2871 enum State {
2872 ENTER = 1;
2873 EXIT = 2;
2874 }
2875 optional State state = 3;
2876}
2877
Chenjie Yue8904192017-12-08 19:12:57 -08002878/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002879 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2880 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2881 * attributed back to the parent (host) uid. One example is Chrome.
2882 *
2883 * Logged from:
2884 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2885 */
2886message IsolatedUidChanged {
2887 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002888 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002889 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002890 optional int32 parent_uid = 1;
2891
2892 optional int32 isolated_uid = 2;
2893
2894 // We expect an isolated uid to be removed before if it's used for another parent uid.
2895 enum Event {
2896 REMOVED = 0;
2897 CREATED = 1;
2898 }
2899 optional Event event = 3;
2900}
2901
2902/*
2903 * Logs the reception of an incoming network packet causing the main system to wake up for
2904 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2905 * and processed by WakeupController.cpp.
2906 */
2907message PacketWakeupOccurred {
2908 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2909 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002910 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002911 // The interface name on which the packet was received.
2912 optional string iface = 2;
2913 // The ethertype value of the packet.
2914 optional int32 ethertype = 3;
2915 // String representation of the destination MAC address of the packet.
2916 optional string destination_hardware_address = 4;
2917 // String representation of the source address of the packet if this was an IP packet.
2918 optional string source_ip = 5;
2919 // String representation of the destination address of the packet if this was an IP packet.
2920 optional string destination_ip = 6;
2921 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2922 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2923 // families.
2924 optional int32 ip_next_header = 7;
2925 // The source port if this was a TCP or UDP packet.
2926 optional int32 source_port = 8;
2927 // The destination port if this was a TCP or UDP packet.
2928 optional int32 destination_port = 9;
2929}
2930
2931/*
2932 * Logs the memory stats for an app on startup.
2933 * Logged from:
2934 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2935 */
2936message AppStartMemoryStateCaptured {
2937 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002938 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002939
2940 // The process name.
2941 optional string process_name = 2;
2942
2943 // The activity name.
2944 optional string activity_name = 3;
2945
2946 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002947 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002948
2949 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002950 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002951
2952 // RSS
2953 optional int64 rss_in_bytes = 6;
2954
2955 // CACHE
2956 optional int64 cache_in_bytes = 7;
2957
2958 // SWAP
2959 optional int64 swap_in_bytes = 8;
2960}
2961
2962/*
2963 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2964 * for LMK event.
2965 * Logged from:
2966 * system/core/lmkd/lmkd.c
2967 */
2968message LmkStateChanged {
2969 enum State {
2970 UNKNOWN = 0;
2971 START = 1;
2972 STOP = 2;
2973 }
2974 optional State state = 1;
2975}
2976
2977/*
2978 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2979 * Logged from:
2980 * system/core/lmkd/lmkd.c
2981 */
2982message LmkKillOccurred {
2983 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002984 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002985
2986 // The process name.
2987 optional string process_name = 2;
2988
2989 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002990 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002991
2992 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002993 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002994
2995 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002996 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002997
2998 // RSS
2999 optional int64 rss_in_bytes = 6;
3000
3001 // CACHE
3002 optional int64 cache_in_bytes = 7;
3003
3004 // SWAP
3005 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003006
3007 // The elapsed real time of start of the process.
3008 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003009
3010 // Min oom adj score considered by lmkd.
3011 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003012}
3013
Rajeev Kumar51b54602018-03-01 12:18:26 -08003014/*
3015 * Logs when the ActivityManagerService detects that an app died.
3016 *
3017 * Logged from:
3018 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3019 */
3020message AppDied {
3021 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003022 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003023}
3024
Howard Ro21a039c2018-08-06 14:55:47 -07003025/**
3026 * An atom for generic metrics logging. Available from Android Q.
3027 */
3028message GenericAtom {
3029 // The uid of the application that sent this custom atom.
3030 optional int32 uid = 1 [(is_uid) = true];
3031
3032 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003033 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003034}
3035
Tej Singhd6d6d772018-09-05 17:41:25 -07003036/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003037 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003038 *
3039 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003040 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003041 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003042message BiometricAcquired {
3043 // Biometric modality that was acquired.
3044 optional android.hardware.biometrics.ModalityEnum modality = 1;
3045 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3046 optional int32 user = 2;
3047 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3048 optional bool is_crypto = 3;
3049 // Action that the device is performing. Acquired messages are only expected for enroll and
3050 // authenticate. Other actions may indicate an error.
3051 optional android.hardware.biometrics.ActionEnum action = 4;
3052 // The client that this acquisition was received for.
3053 optional android.hardware.biometrics.ClientEnum client = 5;
3054 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3055 optional int32 acquire_info = 6;
3056 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3057 optional int32 acquire_info_vendor = 7;
Tej Singhd6d6d772018-09-05 17:41:25 -07003058}
3059
3060/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003061 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003062 *
3063 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003064 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003065 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003066message BiometricAuthenticated {
3067 // Biometric modality that was used.
3068 optional android.hardware.biometrics.ModalityEnum modality = 1;
3069 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3070 optional int32 user = 2;
3071 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3072 // storage.
3073 optional bool is_crypto = 3;
3074 // The client that this acquisition was received for.
3075 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003076 // If authentication requires user confirmation. See BiometricPrompt's
3077 // setRequireConfirmation(bool) method.
3078 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003079
Kevin Chyn1741a072019-01-17 11:54:40 -08003080 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003081 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003082 REJECTED = 1;
3083 PENDING_CONFIRMATION = 2;
3084 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003085 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003086
3087 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003088 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003089 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3090 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3091 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3092 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003093 optional int64 latency_millis = 7;
Kevin Chyn1741a072019-01-17 11:54:40 -08003094}
3095
3096/**
3097 * Logs when a biometric error occurs.
3098 *
3099 * Logged from:
3100 * frameworks/base/services/core/java/com/android/server/biometrics
3101 */
3102message BiometricErrorOccurred {
3103 // Biometric modality that was used.
3104 optional android.hardware.biometrics.ModalityEnum modality = 1;
3105 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3106 optional int32 user = 2;
3107 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3108 optional bool is_crypto = 3;
3109 // Action that the device is performing.
3110 optional android.hardware.biometrics.ActionEnum action = 4;
3111 // The client that this acquisition was received for.
3112 optional android.hardware.biometrics.ClientEnum client = 5;
3113 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3114 // are unique to modality.
3115 optional int32 error_info = 6;
3116 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3117 // by the vendor and not specified by the HIDL interface.
3118 optional int32 error_info_vendor = 7;
3119}
3120
3121/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003122 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003123 * Logged from:
3124 * frameworks/base/services/core/java/com/android/server/biometrics
3125 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003126message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003127 // Biometric modality.
3128 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003129 // Type of issue detected.
3130 optional android.hardware.biometrics.IssueEnum issue = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07003131}
Howard Ro688ae182018-09-25 00:09:36 -07003132
3133message Notification {
3134
3135 // Type of notification event.
3136 enum Type {
3137 TYPE_UNKNOWN = 0;
3138 // Notification became visible to the user.
3139 TYPE_OPEN = 1;
3140 // Notification became hidden.
3141 TYPE_CLOSE = 2;
3142 // Notification switched to detail mode.
3143 TYPE_DETAIL = 3;
3144 // Notification was clicked.
3145 TYPE_ACTION = 4;
3146 // Notification was dismissed.
3147 TYPE_DISMISS = 5;
3148 // Notification switched to summary mode. The enum value of 14 is to
3149 // match that of metrics_constants.
3150 TYPE_COLLAPSE = 14;
3151 }
3152 optional Type type = 1;
3153
3154 // Package name associated with the notification.
3155 optional string package_name = 2;
3156
3157 // Tag associated with notification.
3158 optional string tag = 3;
3159
3160 // Application-supplied ID associated with the notification.
3161 optional int32 id = 4;
3162
3163 // Index of notification in the notification panel.
3164 optional int32 shade_index = 5;
3165
3166 // The number of notifications in the notification panel.
3167 optional int32 shade_count = 6;
3168
3169 // Importance for the notification.
3170 optional int32 importance = 7;
3171
3172 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07003173 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07003174
3175 // Importance for the notification channel.
3176 optional int32 channel_importance = 9;
3177
Howard Ro183c2bd2018-10-18 13:52:10 -07003178 // Application-supplied ID associated with the notifications group.
3179 optional string group_id = 10;
3180
Howard Ro688ae182018-09-25 00:09:36 -07003181 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07003182 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07003183
Howard Ro183c2bd2018-10-18 13:52:10 -07003184 // Reason for dismissal of a notification. This field is only meaningful for
3185 // TYPE_DISMISS events.
3186 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07003187
Howard Ro183c2bd2018-10-18 13:52:10 -07003188 // The first post time of notification, stable across updates.
3189 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07003190
Howard Ro183c2bd2018-10-18 13:52:10 -07003191 // The most recent interruption time, or the creation time if no updates.
3192 // Differs from update_millis because updates are filtered based on whether
3193 // they actually interrupted the user.
3194 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07003195
Howard Ro183c2bd2018-10-18 13:52:10 -07003196 // The most recent update time, or the creation time if no updates.
3197 optional int64 update_millis = 15;
3198
3199 // The most recent visibility event.
3200 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07003201}
3202
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003203/*
Tej Singh0d176952019-01-16 19:10:54 -08003204 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003205 */
Tej Singh0d176952019-01-16 19:10:54 -08003206message FlagFlipUpdateOccurred {
3207 // If the event is from a flag config package, specify the package name.
3208 optional string flag_flip_package_name = 1;
3209
3210 // The order id of the package
3211 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003212}
3213
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003214/**
3215 * Potential experiment ids that goes with a train install.
3216 */
3217message TrainExperimentIds {
3218 repeated int64 experiment_id = 1;
3219}
3220
Yangster-macb89807e2018-11-15 21:10:57 -08003221/*
3222 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003223 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003224 */
3225message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003226 // Name of the train.
3227 optional string train_name = 1;
3228 // Version code for a "train" of packages that need to be installed atomically
3229 optional int64 train_version_code = 2;
3230 // After installation of this package, device requires a restart.
3231 optional bool requires_staging = 3;
3232 // Rollback should be enabled for this install.
3233 optional bool rollback_enabled = 4;
3234 // Requires low latency monitoring if possible.
3235 optional bool requires_low_latency_monitor = 5;
3236
Yangster-macb89807e2018-11-15 21:10:57 -08003237 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003238 UNKNOWN = 0;
3239 INSTALL_REQUESTED = 1;
3240 INSTALL_STARTED = 2;
3241 INSTALL_STAGED_NOT_READY = 3;
3242 INSTALL_STAGED_READY = 4;
3243 INSTALL_SUCCESS = 5;
3244 INSTALL_FAILURE = 6;
3245 INSTALL_CANCELLED = 7;
3246 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003247 INSTALLER_ROLLBACK_INITIATED = 9;
3248 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3249 INSTALLER_ROLLBACK_STAGED = 11;
3250 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3251 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3252 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3253 INSTALLER_ROLLBACK_SUCCESS = 15;
3254 INSTALLER_ROLLBACK_FAILURE = 16;
3255 INSTALLER_ROLLBACK_CANCEL_STAGED_REMOVE_FROM_QUEUE = 17;
3256 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_INITIATED = 18;
3257 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_SUCCESS = 19;
3258 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_FAILURE = 20;
Yangster-macb89807e2018-11-15 21:10:57 -08003259 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003260 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003261 // Possible experiment ids for monitoring this push.
3262 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3263 // user id
3264 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003265}
3266
Maggie Whitefc1aa592018-11-28 21:55:23 -08003267/** Represents USB port overheat event. */
3268message UsbPortOverheatEvent {
3269 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3270 optional int32 plug_temperature_deci_c = 1;
3271
3272 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3273 optional int32 max_temperature_deci_c = 2;
3274
3275 /* Time between USB plug event and overheat threshold trip, in seconds. */
3276 optional int32 time_to_overheat_secs = 3;
3277
3278 /* Time between overheat threshold trip and hysteresis, in seconds. */
3279 optional int32 time_to_hysteresis_secs = 4;
3280
3281 /* Time between hysteresis and active mitigation ending, in seconds. */
3282 optional int32 time_to_inactive_secs = 5;
3283};
3284
Maggie White8735b852019-01-18 11:40:49 -08003285/**
3286 * Logs total effective full charge and discharge cycles on a battery.
3287 * Here are some examples of one effective cycle:
3288 * 1) the battery charges from 0% to 100% and drains back to 0%,
3289 * 2) charging from 50% to 100% and draining back to 50% twice.
3290 * Pulled from:
3291 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3292 */
3293message BatteryCycleCount {
3294 /* Number of total charge and discharge cycles on the system battery. */
3295 optional int32 cycle_count = 1;
3296}
3297
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003298/**
3299 * Logs that an SD card is mounted and information about it, its type (public or private) and the
3300 * size in bytes.
3301 * Pulled from:
3302 * StatsCompanionService
3303 */
3304
3305message SDCardInfo {
3306
3307 enum Type {
3308 UNKNOWN = 0;
3309 TYPE_PUBLIC = 1;
3310 TYPE_PRIVATE = 2;
3311 OTHERS = 3;
3312 }
3313
3314 // Type of the SD card: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3315 optional Type type = 1;
3316 // Total size of the sd card in bytes.
3317 optional int64 size_bytes = 2;
3318}
3319
Yangster-macb89807e2018-11-15 21:10:57 -08003320/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003321 * Logs when a connection becomes available and lost.
3322 * Logged in StatsCompanionService.java
3323 */
3324message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003325 // Id of the network.
3326 optional int32 net_id = 1;
3327
3328 enum State {
3329 UNKNOWN = 0;
3330 CONNECTED = 1;
3331 DISCONNECTED = 2;
3332 }
3333 // Connected state of a network.
3334 optional State state = 2;
3335}
3336
3337/**
3338 * Logs when a service starts and stops.
3339 * Logged from:
3340 * services/core/java/com/android/server/am/ActiveServices.java
3341 */
3342message ServiceStateChanged {
3343
3344 optional int32 uid = 1 [(is_uid) = true];
3345
3346 optional string package_name = 2;
3347
3348 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003349
3350 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003351 START = 1;
3352 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003353 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003354
3355 optional State state = 4;
3356}
3357
3358/**
3359 * Logs when a service is launched.
3360 * Logged from:
3361 * services/core/java/com/android/server/am/ActiveServices.java
3362 */
3363message ServiceLaunchReported {
3364
3365 optional int32 uid = 1 [(is_uid) = true];
3366
3367 optional string package_name = 2;
3368
3369 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003370}
Howard Ro688ae182018-09-25 00:09:36 -07003371
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003372/**
3373 * Logs when a hidden API is used.
3374 *
3375 * Logged from:
3376 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3377 */
3378message HiddenApiUsed {
3379 // The uid of the app making the hidden access.
3380 optional int32 uid = 1 [(is_uid) = true];
3381
3382 // Signature of the method or field accessed.
3383 optional string signature = 2;
3384
3385 enum AccessMethod {
3386 NONE = 0;
3387 REFLECTION = 1;
3388 JNI = 2;
3389 LINKING = 3;
3390 }
3391
3392 // Type of access.
3393 optional AccessMethod access_method = 3;
3394
3395 // Whether the access was prevented or not.
3396 optional bool access_denied = 4;
3397}
3398
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003399/**
3400 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3401 * - When user sees privacy chip
3402 * - When user clicks privacy chip
3403 * - How does the user exit the Privacy Dialog
3404 * Logged from:
3405 * packages/SystemUI/src/com/android/systemui/privacy/OngoingPrivacyDialog.kt
3406 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3407 */
3408message PrivacyIndicatorsInteracted {
3409
3410 enum Type {
3411 UNKNOWN = 0;
3412 CHIP_VIEWED = 1;
3413 CHIP_CLICKED = 2;
3414 DIALOG_PRIVACY_SETTINGS = 3;
3415 DIALOG_DISMISS = 4;
3416 DIALOG_LINE_ITEM = 5;
3417 }
3418
3419 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3420
3421 // Used if the type is LINE_ITEM
3422 optional string package_name = 2;
3423}
3424
Chenjie Yubbcbc602018-02-05 16:51:52 -08003425//////////////////////////////////////////////////////////////////////
3426// Pulled atoms below this line //
3427//////////////////////////////////////////////////////////////////////
3428
3429/**
David Chenc8a43242017-10-17 16:23:28 -07003430 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3431 *
3432 * Pulled from:
3433 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3434 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003435message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003436 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003437
3438 optional int64 rx_bytes = 2;
3439
3440 optional int64 rx_packets = 3;
3441
3442 optional int64 tx_bytes = 4;
3443
3444 optional int64 tx_packets = 5;
3445}
3446
3447/**
3448 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3449 *
3450 * Pulled from:
3451 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3452 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003453message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003454 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003455
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003456 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3457 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003458
3459 optional int64 rx_bytes = 3;
3460
3461 optional int64 rx_packets = 4;
3462
3463 optional int64 tx_bytes = 5;
3464
3465 optional int64 tx_packets = 6;
3466}
3467
3468/**
3469 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3470 *
3471 * Pulled from:
3472 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3473 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003474message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003475 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003476
3477 optional int64 rx_bytes = 2;
3478
3479 optional int64 rx_packets = 3;
3480
3481 optional int64 tx_bytes = 4;
3482
3483 optional int64 tx_packets = 5;
3484}
3485
3486/**
3487 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3488 *
3489 * Pulled from:
3490 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3491 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003492message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003493 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003494
Yao Chenc40a19d2018-03-15 16:48:25 -07003495 // 1 denotes foreground and 0 denotes background. This is called Set in
3496 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003497 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003498
3499 optional int64 rx_bytes = 3;
3500
3501 optional int64 rx_packets = 4;
3502
3503 optional int64 tx_bytes = 5;
3504
3505 optional int64 tx_packets = 6;
3506}
3507
3508/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003509 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3510 *
3511 * Pulled from:
3512 * StatsCompanionService
3513 */
3514message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003515 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003516
3517 optional int64 rx_bytes = 2;
3518
3519 optional int64 tx_bytes = 3;
3520}
3521
3522/**
David Chenc8a43242017-10-17 16:23:28 -07003523 * Pulls the kernel wakelock durations. This atom is adapted from
3524 * android/internal/os/KernelWakelockStats.java
3525 *
3526 * Pulled from:
3527 * StatsCompanionService using KernelWakelockReader.
3528 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003529message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003530 optional string name = 1;
3531
3532 optional int32 count = 2;
3533
3534 optional int32 version = 3;
3535
Yangster-maca8a30442018-10-13 23:46:34 -07003536 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003537}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003538
Chenjie Yu05013b32017-11-21 10:21:41 -08003539/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003540 * Pulls low power state information. If power.stats HAL is not available, this
3541 * includes platform and subsystem sleep state information,
3542 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3543 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003544 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003545 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003546 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3547 * as defined in:
3548 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003549 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003550message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003551 // Subsystem name
3552 optional string subsystem_name = 1;
3553 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3554 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003555 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3556 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003557 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003558 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003559 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003560 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003561 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003562}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003563
Chenjie Yu05013b32017-11-21 10:21:41 -08003564/**
Bookatz92da2832018-11-01 18:10:03 -07003565 * Pulls on-device power measurement information.
3566 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3567 * Pulled from:
3568 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3569 */
3570message OnDevicePowerMeasurement {
3571 // Name of the subsystem (to which the rail belongs).
3572 optional string subsystem_name = 1;
3573
3574 // Rail name. The rail lies within the subsystem.
3575 optional string rail_name = 2;
3576
3577 // Time (in ms since boot) at which the rail energy value was measured.
3578 // This may differ slightly from the time that statsd logs this information.
3579 optional uint64 measurement_timestamp_millis = 3;
3580
3581 // Accumulated energy used via the rail since device boot in uWs.
3582 optional uint64 energy_microwatt_secs = 4;
3583}
3584
3585/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003586 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003587 * Pulls the time the cpu spend on the frequency index. Frequency index
3588 * starts from highest to lowest. The value should be monotonically
3589 * increasing since boot. However, if there is a cpu
3590 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003591 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003592message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003593 optional uint32 cluster = 1;
3594 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003595 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003596}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003597
Chenjie Yu05013b32017-11-21 10:21:41 -08003598/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003599 * Pulls Cpu Time Per Uid.
3600 * Note that isolated process uid time should be attributed to host uids.
3601 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003602message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003603 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003604 optional uint64 user_time_micros = 2;
3605 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003606}
3607
3608/**
3609 * Pulls Cpu Time Per Uid per frequency.
3610 * Note that isolated process uid time should be attributed to host uids.
3611 * For each uid, we order the time by descending frequencies.
3612 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003613message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003614 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003615 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003616 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003617}
Hugo Benichi884970e2017-11-14 22:42:46 +09003618
Chenjie Yu05013b32017-11-21 10:21:41 -08003619/**
3620 * Pulls Wifi Controller Activity Energy Info
3621 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003622message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003623 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003624 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003625 // stack reported state
3626 // TODO: replace this with proto enum
3627 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003628 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003629 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003630 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003631 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003632 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003633 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003634 // product of current(mA), voltage(V) and time(ms)
3635 optional uint64 controller_energy_used = 6;
3636}
3637
3638/**
3639 * Pulls Modem Activity Energy Info
3640 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003641message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003642 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003643 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003644 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003645 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003646 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003647 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003648 /**
3649 * Tx power index
3650 * index 0 = tx_power < 0dBm
3651 * index 1 = 0dBm < tx_power < 5dBm
3652 * index 2 = 5dBm < tx_power < 15dBm
3653 * index 3 = 15dBm < tx_power < 20dBm
3654 * index 4 = tx_power > 20dBm
3655 */
3656 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003657 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003658 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003659 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003660 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003661 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003662 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003663 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003664 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003665 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003666 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003667 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003668 // product of current(mA), voltage(V) and time(ms)
3669 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003670}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003671
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003672/**
3673 * Pulls Bluetooth Activity Energy Info
3674 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3675 */
3676message BluetoothActivityInfo {
3677 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003678 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003679 // bluetooth stack state
3680 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003681 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003682 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003683 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003684 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003685 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003686 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003687 // product of current(mA), voltage(V) and time(ms)
3688 optional uint64 energy_used = 6;
3689}
3690
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003691/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003692 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003693 *
3694 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003695 */
3696message ProcessMemoryState {
3697 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003698 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003699
3700 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003701 // Usually package name, "system" for system server.
3702 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003703 optional string process_name = 2;
3704
Rafal Slawikda51b932018-12-13 16:31:33 +00003705 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003706 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003707
3708 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003709 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003710
3711 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003712 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003713
Rajeev Kumar90235992018-01-29 11:06:48 -08003714 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003715 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3716 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003717 optional int64 rss_in_bytes = 6;
3718
3719 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003720 // Value is read from memory.stat, field total_cache if per-app memory
3721 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003722 optional int64 cache_in_bytes = 7;
3723
3724 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003725 // Value is read from memory.stat, field total_swap if per-app memory
3726 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003727 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003728
Rafal Slawikd03ae422018-11-20 11:27:45 +00003729 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003730 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003731
3732 // Elapsed real time when the process started.
3733 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3734 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003735}
3736
3737/*
Rafal Slawik08621582018-10-15 14:53:07 +01003738 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003739 *
3740 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003741 */
3742message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003743 // The uid if available. -1 means not available.
3744 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003745
Rafal Slawikbf67d072018-10-23 11:07:54 +01003746 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003747 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003748 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003749
Rafal Slawikbf67d072018-10-23 11:07:54 +01003750 // # of page-faults
3751 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003752
Rafal Slawikbf67d072018-10-23 11:07:54 +01003753 // # of major page-faults
3754 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003755
Rafal Slawikbf67d072018-10-23 11:07:54 +01003756 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003757 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003758 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003759
Rafal Slawikd03ae422018-11-20 11:27:45 +00003760 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003761 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003762
3763 // Elapsed real time when the process started.
3764 // Value is read from /proc/PID/stat, field 22.
3765 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01003766}
3767
3768/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003769 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003770 *
3771 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3772 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003773 *
3774 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003775 */
3776message ProcessMemoryHighWaterMark {
3777 // The uid if available. -1 means not available.
3778 optional int32 uid = 1 [(is_uid) = true];
3779
Rafal Slawikda51b932018-12-13 16:31:33 +00003780 // The process name.
3781 // Usually package name or process cmdline.
3782 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003783 optional string process_name = 2;
3784
3785 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3786 // /proc/PID/status.
3787 optional int64 rss_high_water_mark_in_bytes = 3;
3788}
3789
3790/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003791 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003792 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003793message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003794 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003795}
3796
3797/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003798 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003799 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003800message SystemUptime {
3801 // Milliseconds since the system was booted.
3802 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3803 // for external input).
3804 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003805 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003806}
3807
3808/*
3809 * Reads from /proc/uid_concurrent_active_time which has the format:
3810 * active: X (X is # cores)
3811 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3812 * [uid1]: [time-0] [time-1] [time-2] ... ...
3813 * ...
3814 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3815 * The file contains a monotonically increasing count of time for a single boot.
3816 */
3817message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003818 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003819 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003820}
3821
3822/**
3823 * Reads from /proc/uid_concurrent_policy_time which has the format:
3824 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3825 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3826 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3827 * ...
3828 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3829 * The file contains a monotonically increasing count of time for a single boot.
3830 */
3831message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003832 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003833 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003834 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003835}
3836
3837/*
3838 * Pulls free disk space, for data, system partition and temporary directory.
3839 */
3840message DiskSpace {
3841 // available bytes in data partition
3842 optional uint64 data_available_bytes = 1;
3843 // available bytes in system partition
3844 optional uint64 system_available_bytes = 2;
3845 // available bytes in download cache or temp directories
3846 optional uint64 temp_available_bytes = 3;
3847}
Tej Singhbf972d92018-01-10 20:51:13 -08003848
3849/**
3850 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003851 *
3852 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003853 */
3854message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003855 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003856}
3857
3858/**
3859 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003860 * Pulled from:
3861 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003862 */
3863message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003864 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003865}
3866
3867/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003868 * Pulls battery voltage.
3869 * Pulled from:
3870 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3871 */
3872message BatteryVoltage {
3873 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003874 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003875}
3876
3877/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003878 * Pulls battery level (percent full, from 0 to 100).
3879 *
3880 * Pulled from:
3881 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3882 */
3883message BatteryLevel {
3884 // Battery level. Should be in [0, 100].
3885 optional int32 battery_level = 1;
3886}
3887
3888/**
Tej Singhd89137e2018-03-26 14:51:40 -07003889 * Pulls the temperature of various parts of the device.
3890 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003891 *
3892 * Pulled from:
3893 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3894 */
3895message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003896 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003897 optional android.os.TemperatureTypeEnum sensor_location = 1;
3898
3899 // The name of the temperature source. Eg. CPU0
3900 optional string sensor_name = 2;
3901
Tej Singhd89137e2018-03-26 14:51:40 -07003902 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003903 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003904 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003905}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003906
3907/**
3908 * Pulls the statistics of calls to Binder.
3909 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003910 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3911 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003912 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003913 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003914 */
3915message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003916 // UID of the process responsible for the binder transaction. It will be set if the process
3917 // executing the binder transaction attribute the transaction to another uid using
3918 // Binder.setThreadWorkSource().
3919 //
3920 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003921 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003922 // UID of the process executing the binder transaction.
3923 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003924 // Fully qualified class name of the API call.
3925 //
3926 // This is a system server class name.
3927 //
3928 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3929 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3930 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3931 // commonly used APIs.
3932 optional string service_class_name = 2;
3933 // Method name of the API call. It can also be a transaction code if we cannot
3934 // resolve it to a name. See Binder#getTransactionName.
3935 //
3936 // This is a system server method name.
3937 optional string service_method_name = 3;
3938 // Total number of API calls.
3939 optional int64 call_count = 4;
3940 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3941 optional bool screen_interactive = 13;
3942 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3943 // call_count will be equal to recorded_call_count.
3944 //
3945 // If recorded_call_count is different than call_count, it means data collection has been
3946 // sampled. All the fields below will be sampled in this case.
3947 optional int64 recorded_call_count = 12;
3948 // Number of exceptions thrown by the API.
3949 optional int64 recorded_exception_count = 5;
3950 // Total latency of all API calls.
3951 // Average can be computed using total_latency_micros / recorded_call_count.
3952 optional int64 recorded_total_latency_micros = 6;
3953 // Maximum latency of one API call.
3954 optional int64 recorded_max_latency_micros = 7;
3955 // Total CPU usage of all API calls.
3956 // Average can be computed using total_cpu_micros / recorded_call_count.
3957 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3958 optional int64 recorded_total_cpu_micros = 8;
3959 // Maximum CPU usage of one API call.
3960 optional int64 recorded_max_cpu_micros = 9;
3961 // Maximum parcel reply size of one API call.
3962 optional int64 recorded_max_reply_size_bytes = 10;
3963 // Maximum parcel request size of one API call.
3964 optional int64 recorded_max_request_size_bytes = 11;
3965}
3966
3967/**
3968 * Pulls the statistics of exceptions during calls to Binder.
3969 *
3970 * Binder stats are cumulative from boot unless somebody reset the data using
3971 * > adb shell dumpsys binder_calls_stats --reset
3972 */
3973message BinderCallsExceptions {
3974 // Exception class name, e.g. java.lang.IllegalArgumentException.
3975 //
3976 // This is an exception class name thrown by the system server.
3977 optional string exception_class_name = 1;
3978 // Total number of exceptions.
3979 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003980}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003981
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003982/**
3983 * Pulls the statistics of message dispatching on HandlerThreads.
3984 *
3985 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
3986 * config on the device.
3987 *
3988 * Next tag: 11
3989 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003990message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01003991 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003992 optional int32 uid = 1 [(is_uid) = true];
3993
3994 // Fully qualified class name of the handler target class.
3995 //
3996 // This field does not contain PII. This is a system server class name.
3997 optional string handler_class_name = 2;
3998
3999 // The name of the thread that runs the Looper.
4000 //
4001 // This field does not contain PII. This is a system server thread name.
4002 optional string looper_thread_name = 3;
4003
4004 // The name of the dispatched message.
4005 //
4006 // This field does not contain PII. This is a system server constant or class
4007 // name.
4008 optional string message_name = 4;
4009
4010 // Total number of successfully dispatched messages.
4011 optional int64 message_count = 5;
4012
4013 // Total number of messages that failed dispatching.
4014 optional int64 exception_count = 6;
4015
4016 // Total number of processed messages we have data recorded for. If we
4017 // collected data for all the messages, message_count will be equal to
4018 // recorded_message_count.
4019 //
4020 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004021 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004022 optional int64 recorded_message_count = 7;
4023
4024 // Total latency of all processed messages.
4025 // Average can be computed using recorded_total_latency_micros /
4026 // recorded_message_count.
4027 optional int64 recorded_total_latency_micros = 8;
4028
4029 // Total CPU usage of all processed message.
4030 // Average can be computed using recorded_total_cpu_micros /
4031 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004032 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004033 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004034
4035 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4036 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004037
4038 // Max recorded CPU usage of all processed messages.
4039 optional int64 recorded_max_cpu_micros = 11;
4040
4041 // Max recorded latency of all processed messages.
4042 optional int64 recorded_max_latency_micros = 12;
4043
4044 // Total number of messages we tracked the dispatching delay for. If we
4045 // collected data for all the messages, message_count will be equal to
4046 // recorded_delay_message_count.
4047 //
4048 // If recorded_delay_message_count is different than message_count, it means data
4049 // collection has been sampled or/and not all messages specified the target dispatch time.
4050 // The fields below will be sampled in this case.
4051 optional int64 recorded_delay_message_count = 13;
4052
4053 // Total dispatching delay of all processed messages.
4054 // Calculated as a difference between the target dispatching time (Message.when)
4055 // and the actual dispatching time.
4056 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4057 optional int64 recorded_total_delay_millis = 14;
4058
4059 // Max dispatching delay of all processed messages.
4060 // Calculated as a difference between the target dispatching time (Message.when)
4061 // and the actual dispatching time.
4062 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004063}
Tej Singh86dc9db2018-09-06 00:39:57 +00004064
4065/**
4066 * Pulls disk information, such as write speed and latency.
4067 */
4068message DiskStats {
4069 // Time taken to open, write 512B to, and close a file.
4070 // -1 if error performing the check.
4071 optional int64 data_write_latency_millis = 1;
4072
4073 optional bool file_based_encryption = 2;
4074
4075 // Recent disk write speed in kB/s.
4076 // -1 if error querying storageed.
4077 // 0 if data is unavailable.
4078 optional int32 recent_disk_write_speed = 3;
4079}
4080
4081
4082/**
4083 * Free and total bytes of the Data, Cache, and System partition.
4084 */
4085message DirectoryUsage {
4086 enum Directory {
4087 UNKNOWN = 0;
4088 DATA = 1;
4089 CACHE = 2;
4090 SYSTEM = 3;
4091 }
4092 optional Directory directory = 1;
4093 optional int64 free_bytes = 2;
4094 optional int64 total_bytes = 3;
4095}
4096
4097
4098/**
4099 * Size of an application: apk size, data size, and cache size.
4100 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4101 * Information is only reported for apps with the primary user (user 0).
4102 * Sizes are aggregated by package name.
4103 */
4104message AppSize {
4105 // Including uids will involve modifying diskstats logic.
4106 optional string package_name = 1;
4107 // App size in bytes. -1 if unavailable.
4108 optional int64 app_size_bytes = 2;
4109 // App data size in bytes. -1 if unavailable.
4110 optional int64 app_data_size_bytes = 3;
4111 // App cache size in bytes. -1 if unavailable.
4112 optional int64 app_cache_size_bytes = 4;
4113 // Time that the cache file was produced.
4114 // Uses System.currentTimeMillis(), which is wall clock time.
4115 optional int64 cache_time_millis = 5;
4116}
4117
4118
4119/**
4120 * Size of a particular category. Eg: photos, videos.
4121 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4122 */
4123message CategorySize {
4124 enum Category {
4125 UNKNOWN = 0;
4126 APP_SIZE = 1;
4127 APP_DATA_SIZE = 2;
4128 APP_CACHE_SIZE = 3;
4129 PHOTOS = 4;
4130 VIDEOS = 5;
4131 AUDIO = 6;
4132 DOWNLOADS = 7;
4133 SYSTEM = 8;
4134 OTHER = 9;
4135 }
4136 optional Category category = 1;
4137 // Category size in bytes.
4138 optional int64 size_bytes = 2;
4139 // Time that the cache file was produced.
4140 // Uses System.currentTimeMillis(), which is wall clock time.
4141 optional int64 cache_time_millis = 3;
4142}
Tej Singhd6d6d772018-09-05 17:41:25 -07004143
4144/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004145 * Pulls per uid I/O stats. The stats are cumulative since boot.
4146 *
4147 * Read/write bytes are I/O events from a storage device
4148 * Read/write chars are data requested by read/write syscalls, and can be
4149 * satisfied by caching.
4150 *
4151 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4152 */
4153message DiskIo {
4154 optional int32 uid = 1 [(is_uid) = true];
4155 optional int64 fg_chars_read = 2;
4156 optional int64 fg_chars_write = 3;
4157 optional int64 fg_bytes_read = 4;
4158 optional int64 fg_bytes_write = 5;
4159 optional int64 bg_chars_read = 6;
4160 optional int64 bg_chars_write = 7;
4161 optional int64 bg_bytes_read = 8;
4162 optional int64 bg_bytes_write = 9;
4163 optional int64 fg_fsync = 10;
4164 optional int64 bg_fsync= 11;
4165}
4166
4167
4168/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004169 * Pulls the number of fingerprints for each user.
4170 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004171 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004172 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004173message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004174 // The associated user. Eg: 0 for owners, 10+ for others.
4175 // Defined in android/os/UserHandle.java
4176 optional int32 user = 1;
4177 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004178 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004179}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004180
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004181/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004182 * Pulls the number of faces for each user.
4183 *
4184 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4185 */
4186message NumFacesEnrolled {
4187 // The associated user. Eg: 0 for owners, 10+ for others.
4188 // Defined in android/os/UserHandle.java
4189 optional int32 user = 1;
4190 // Number of faces registered to that user.
4191 optional int32 num_faces_enrolled = 2;
4192}
4193/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004194 * A mapping of role holder -> role
4195 */
4196message RoleHolder {
4197 // uid of the role holder
4198 optional int32 uid = 1 [(is_uid) = true];
4199
4200 // package name of the role holder
4201 optional string package_name = 2;
4202
4203 // the role held
4204 optional string role = 3;
4205}
4206
Yangsteraf9aee72018-10-12 09:26:16 -07004207message AggStats {
4208 optional int64 min = 1;
4209
4210 optional int64 average = 2;
4211
4212 optional int64 max = 3;
4213}
4214
4215message ProcessStatsStateProto {
4216 optional android.service.procstats.ScreenState screen_state = 1;
4217
4218 optional android.service.procstats.MemoryState memory_state = 2;
4219
4220 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4221 // and not frameworks/base/core/java/android/app/ActivityManager.java
4222 optional android.service.procstats.ProcessState process_state = 3;
4223
4224 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004225 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004226
4227 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004228 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004229
4230 // # of samples taken
4231 optional int32 sample_size = 5;
4232
4233 // PSS is memory reserved for this process
4234 optional AggStats pss = 6;
4235
4236 // USS is memory shared between processes, divided evenly for accounting
4237 optional AggStats uss = 7;
4238
4239 // RSS is memory resident for this process
4240 optional AggStats rss = 8;
4241}
4242
4243// Next Tag: 7
4244message ProcessStatsProto {
4245 // Name of process.
4246 optional string process = 1;
4247
4248 // Uid of the process.
4249 optional int32 uid = 2;
4250
4251 // Information about how often kills occurred
4252 message Kill {
4253 // Count of excessive CPU kills
4254 optional int32 cpu = 1;
4255
4256 // Count of kills when cached
4257 optional int32 cached = 2;
4258
4259 // PSS stats during cached kill
4260 optional AggStats cached_pss = 3;
4261 }
4262 optional Kill kill = 3;
4263
4264 // Time and memory spent in various states.
4265 repeated ProcessStatsStateProto states = 5;
4266
4267 // Total time process has been running... screen_state, memory_state, and process_state
4268 // will not be set.
4269 optional ProcessStatsStateProto total_running_state = 6;
4270}
4271
4272message PackageServiceOperationStatsProto {
4273 // Operate enum: Started, Foreground, Bound, Executing
4274 optional android.service.procstats.ServiceOperationState operation = 1;
4275
4276 // Number of times the service was in this operation.
4277 optional int32 count = 2;
4278
4279 // Information about a state the service can be in.
4280 message StateStats {
4281 // Screen state enum.
4282 optional android.service.procstats.ScreenState screen_state = 1;
4283 // Memory state enum.
4284 optional android.service.procstats.MemoryState memory_state = 2;
4285
4286 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004287 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004288 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004289 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004290 }
4291 repeated StateStats state_stats = 3;
4292}
4293
4294message PackageServiceStatsProto {
4295 // Name of service component.
4296 optional string service_name = 1;
4297
4298 // The operation stats.
4299 // The package_name, package_uid, package_version, service_name will not be set to save space.
4300 repeated PackageServiceOperationStatsProto operation_stats = 2;
4301}
4302
4303message PackageAssociationSourceProcessStatsProto {
4304 // Uid of the process.
4305 optional int32 process_uid = 1;
4306 // Process name.
4307 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004308 // Package name.
4309 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004310 // Total count of the times this association appeared.
4311 optional int32 total_count = 3;
4312
4313 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004314 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004315
4316 // Total count of the times this association became actively impacting its target process.
4317 optional int32 active_count = 5;
4318
4319 // Information on one source in this association.
4320 message StateStats {
4321 // Process state enum.
4322 optional android.service.procstats.ProcessState process_state = 1;
4323 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004324 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004325 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004326 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004327 }
4328 repeated StateStats active_state_stats = 6;
4329}
4330
4331message PackageAssociationProcessStatsProto {
4332 // Name of the target component.
4333 optional string component_name = 1;
4334 // Information on one source in this association.
4335 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4336}
4337
4338
4339message ProcessStatsPackageProto {
4340 // Name of package.
4341 optional string package = 1;
4342
4343 // Uid of the package.
4344 optional int32 uid = 2;
4345
4346 // Version of the package.
4347 optional int64 version = 3;
4348
4349 // Stats for each process running with the package loaded in to it.
4350 repeated ProcessStatsProto process_stats = 4;
4351
4352 // Stats for each of the package's services.
4353 repeated PackageServiceStatsProto service_stats = 5;
4354
4355 // Stats for each association with the package.
4356 repeated PackageAssociationProcessStatsProto association_stats = 6;
4357}
4358
4359message ProcessStatsSectionProto {
4360 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004361 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004362
4363 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004364 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004365
4366 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004367 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004368
4369 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004370 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004371
4372 // System runtime library. e.g. "libdvm.so", "libart.so".
4373 optional string runtime = 5;
4374
4375 // whether kernel reports swapped pss.
4376 optional bool has_swapped_pss = 6;
4377
4378 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4379 enum Status {
4380 STATUS_UNKNOWN = 0;
4381 STATUS_COMPLETE = 1;
4382 STATUS_PARTIAL = 2;
4383 STATUS_SHUTDOWN = 3;
4384 STATUS_SYSPROPS = 4;
4385 }
4386 repeated Status status = 7;
4387
Chenjie Yub2ecc792019-01-17 10:27:26 -08004388 // Number of pages available of various types and sizes, representation fragmentation.
4389 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4390
Yangsteraf9aee72018-10-12 09:26:16 -07004391 // Stats for each process.
4392 repeated ProcessStatsProto process_stats = 8;
4393
4394 // Stats for each package.
4395 repeated ProcessStatsPackageProto package_stats = 9;
4396}
4397
Chenjie Yub2ecc792019-01-17 10:27:26 -08004398message ProcessStatsAvailablePagesProto {
4399 // Node these pages are in (as per /proc/pagetypeinfo)
4400 optional int32 node = 1;
4401
4402 // Zone these pages are in (as per /proc/pagetypeinfo)
4403 optional string zone = 2;
4404
4405 // Label for the type of these pages (as per /proc/pagetypeinfo)
4406 optional string label = 3;
4407
4408 // Distribution of number of pages available by order size. First entry in array is
4409 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4410 repeated int32 pages_per_order = 4;
4411}
4412
Chenjie Yu12e5e672018-09-14 15:54:59 -07004413/**
4414 * Pulled from ProcessStatsService.java
4415 */
4416message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004417 optional ProcessStatsSectionProto proc_stats_section = 1;
4418}
4419
Chenjie Yuf910b7802019-01-11 16:08:20 -08004420/**
4421 * Pulled from ProcessStatsService.java
4422 */
4423message ProcStatsPkgProc {
4424 optional ProcessStatsSectionProto proc_stats_section = 1;
4425}
4426
Yangsteraf9aee72018-10-12 09:26:16 -07004427message PowerProfileProto {
4428 optional double cpu_suspend = 1;
4429
4430 optional double cpu_idle = 2;
4431
4432 optional double cpu_active = 3;
4433
4434 message CpuCluster {
4435 optional int32 id = 1;
4436 optional double cluster_power = 2;
4437 optional int32 cores = 3;
4438 repeated int64 speed = 4;
4439 repeated double core_power = 5;
4440 }
4441
4442 repeated CpuCluster cpu_cluster = 40;
4443
4444 optional double wifi_scan = 4;
4445
4446 optional double wifi_on = 5;
4447
4448 optional double wifi_active = 6;
4449
4450 optional double wifi_controller_idle = 7;
4451
4452 optional double wifi_controller_rx = 8;
4453
4454 optional double wifi_controller_tx = 9;
4455
4456 repeated double wifi_controller_tx_levels = 10;
4457
4458 optional double wifi_controller_operating_voltage = 11;
4459
4460 optional double bluetooth_controller_idle = 12;
4461
4462 optional double bluetooth_controller_rx = 13;
4463
4464 optional double bluetooth_controller_tx = 14;
4465
4466 optional double bluetooth_controller_operating_voltage = 15;
4467
4468 optional double modem_controller_sleep = 16;
4469
4470 optional double modem_controller_idle = 17;
4471
4472 optional double modem_controller_rx = 18;
4473
4474 repeated double modem_controller_tx = 19;
4475
4476 optional double modem_controller_operating_voltage = 20;
4477
4478 optional double gps_on = 21;
4479
4480 repeated double gps_signal_quality_based = 22;
4481
4482 optional double gps_operating_voltage = 23;
4483
4484 optional double bluetooth_on = 24;
4485
4486 optional double bluetooth_active = 25;
4487
4488 optional double bluetooth_at_cmd = 26;
4489
4490 optional double ambient_display = 27;
4491
4492 optional double screen_on = 28;
4493
4494 optional double radio_on = 29;
4495
4496 optional double radio_scanning = 30;
4497
4498 optional double radio_active = 31;
4499
4500 optional double screen_full = 32;
4501
4502 optional double audio = 33;
4503
4504 optional double video = 34;
4505
4506 optional double flashlight = 35;
4507
4508 optional double memory = 36;
4509
4510 optional double camera = 37;
4511
4512 optional double wifi_batched_scan = 38;
4513
4514 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004515}
Chenjie Yuab530202018-09-26 12:39:20 -07004516
4517/**
4518 * power_profile.xml and other constants for power model calculations.
4519 * Pulled from PowerProfile.java
4520 */
4521message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004522 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004523}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004524
4525/**
arangelovd5db50e2018-10-12 20:24:39 +01004526 * Logs when a user restriction was added or removed.
4527 *
4528 * Logged from:
4529 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4530 */
4531message UserRestrictionChanged {
4532 // The raw string of the user restriction as defined in UserManager.
4533 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4534 optional string restriction = 1;
4535 // Whether the restriction is enabled or disabled.
4536 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004537}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004538
4539/**
4540 * Pulls process user time and system time. Puller takes a snapshot of all pids
4541 * in the system and returns cpu stats for those that are working at the time.
4542 * Dead pids will be dropped. Kernel processes are excluded.
4543 * Min cool-down is 5 sec.
4544 */
4545message ProcessCpuTime {
4546 optional int32 uid = 1 [(is_uid) = true];
4547
4548 optional string process_name = 2;
4549 // Process cpu time in user space, cumulative from boot/process start
4550 optional int64 user_time_millis = 3;
4551 // Process cpu time in system space, cumulative from boot/process start
4552 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004553}
Misha Wagner5a51e002018-10-03 15:04:09 +01004554
4555/**
4556 * Pulls the CPU usage for each thread.
4557 *
4558 * Read from /proc/$PID/task/$TID/time_in_state files.
4559 *
4560 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4561 * time_in_state files not being present on some phones, have not been addressed. These should be
4562 * considered before a public release.
4563 */
4564message CpuTimePerThreadFreq {
4565 // UID that owns the process.
4566 optional int32 uid = 1 [(is_uid) = true];
4567 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004568 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004569 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004570 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004571 // Name of the process taken from `/proc/$PID/cmdline`.
4572 optional string process_name = 4;
4573 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4574 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004575
4576 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4577 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4578 // frequencies are given here as the alternative is sending eight separate atoms. This method
4579 // significantly reduces the amount of data created
4580 optional int32 frequency1_khz = 6;
4581 optional int32 time1_millis = 7;
4582 optional int32 frequency2_khz = 8;
4583 optional int32 time2_millis = 9;
4584 optional int32 frequency3_khz = 10;
4585 optional int32 time3_millis = 11;
4586 optional int32 frequency4_khz = 12;
4587 optional int32 time4_millis = 13;
4588 optional int32 frequency5_khz = 14;
4589 optional int32 time5_millis = 15;
4590 optional int32 frequency6_khz = 16;
4591 optional int32 time6_millis = 17;
4592 optional int32 frequency7_khz = 18;
4593 optional int32 time7_millis = 19;
4594 optional int32 frequency8_khz = 20;
4595 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004596}
Bookatz75ee60422018-11-09 12:27:37 -08004597
4598/**
Bookatz366a4432018-11-20 09:42:33 -08004599 * Pulls information about the device's build.
4600 */
4601message BuildInformation {
4602 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4603 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4604 optional string fingerprint = 1;
4605
4606 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4607 optional string brand = 2;
4608
4609 // Build.PRODUCT. The name of the overall product.
4610 optional string product = 3;
4611
4612 // Build.DEVICE. The name of the industrial design.
4613 optional string device = 4;
4614
4615 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4616 optional string version_release = 5;
4617
4618 // Build.ID. E.g. a label like "M4-rc20".
4619 optional string id = 6;
4620
4621 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4622 // represent this build.
4623 optional string version_incremental = 7;
4624
4625 // Build.TYPE. The type of build, like "user" or "eng".
4626 optional string type = 8;
4627
4628 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4629 optional string tags = 9;
4630}
4631
4632/**
Bookatz75ee60422018-11-09 12:27:37 -08004633 * Pulls on-device BatteryStats power use calculations for the overall device.
4634 */
4635message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004636 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4637 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4638 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4639 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08004640}
4641
4642/**
4643 * Pulls on-device BatteryStats power use calculations broken down by uid.
4644 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4645 * that is attributed to non-uid items. They must all be included to get the total power use.
4646 */
4647message DeviceCalculatedPowerBlameUid {
4648 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4649 optional int32 uid = 1 [(is_uid) = true];
4650
Bookatz3dbc13a2018-12-21 12:16:51 -08004651 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4652 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4653 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08004654}
4655
4656/**
4657 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4658 * drain type.
4659 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4660 * is attributed uids. They must all be included to get the total power use.
4661 */
4662message DeviceCalculatedPowerBlameOther {
4663 // The type of item whose power use is being reported.
4664 enum DrainType {
4665 AMBIENT_DISPLAY = 0;
4666 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4667 BLUETOOTH = 2;
4668 CAMERA = 3;
4669 // Cell-standby
4670 CELL = 4;
4671 FLASHLIGHT = 5;
4672 IDLE = 6;
4673 MEMORY = 7;
4674 // Amount that total computed drain exceeded the drain estimated using the
4675 // battery level changes and capacity.
4676 OVERCOUNTED = 8;
4677 PHONE = 9;
4678 SCREEN = 10;
4679 // Amount that total computed drain was below the drain estimated using the
4680 // battery level changes and capacity.
4681 UNACCOUNTED = 11;
4682 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4683 WIFI = 13;
4684 }
4685 optional DrainType drain_type = 1;
4686
Bookatz3dbc13a2018-12-21 12:16:51 -08004687 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4688 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4689 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004690}
arangelov4e994062018-11-13 16:12:38 +00004691
4692/**
4693 * Logs device policy features.
4694 *
4695 * Logged from:
4696 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4697 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4698 */
4699message DevicePolicyEvent {
4700 // The event id - unique for each event.
4701 optional android.stats.devicepolicy.EventId event_id = 1;
4702 // The admin package name.
4703 optional string admin_package_name = 2;
4704 // A generic integer parameter.
4705 optional int32 integer_value = 3;
4706 // A generic boolean parameter.
4707 optional bool boolean_value = 4;
4708 // A parameter specifying a time period in milliseconds.
4709 optional uint64 time_period_millis = 5;
4710 // A parameter specifying a list of package names, bundle extras or string parameters.
4711 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4712}
shawnlinea5b66b2018-11-13 15:05:29 +08004713
4714/**
4715 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4716 *
4717 * Logged from:
4718 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4719 */
4720message DocsUILaunchReported {
4721 optional android.stats.docsui.LaunchAction launch_action = 1;
4722 optional bool has_initial_uri = 2;
4723 optional android.stats.docsui.MimeType mime_type = 3;
4724 optional android.stats.docsui.Root initial_root = 4;
4725}
4726
4727/**
4728 * Logs root/app visited event in file managers/picker. Call this when the user
4729 * taps on root/app in hamburger menu.
4730 *
4731 * Logged from:
4732 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4733 */
4734message DocsUIRootVisitedReported {
4735 optional android.stats.docsui.ContextScope scope = 1;
4736 optional android.stats.docsui.Root root = 2;
4737}
4738
4739/**
4740 * Logs file operation stats. Call this when a file operation has completed.
4741 *
4742 * Logged from:
4743 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4744 */
4745message DocsUIFileOperationReported {
4746 optional android.stats.docsui.Provider provider = 1;
4747 optional android.stats.docsui.FileOperation file_op = 2;
4748}
4749
4750/**
4751 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4752 * mode.
4753 *
4754 * Logged from:
4755 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4756 */
4757message DocsUIFileOperationCopyMoveModeReported {
4758 optional android.stats.docsui.FileOperation file_op = 1;
4759 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4760}
4761
4762
4763/**
4764 * Logs file sub operation stats. Call this when a file operation has failed.
4765 *
4766 * Logged from:
4767 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4768 */
4769message DocsUIFileOperationFailureReported {
4770 optional android.stats.docsui.Authority authority = 1;
4771 optional android.stats.docsui.SubFileOperation sub_op = 2;
4772}
4773
4774/**
4775* Logs the cancellation of a file operation. Call this when a job is canceled
4776*
4777* Logged from:
4778* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4779*/
4780message DocsUIFileOperationCanceledReported {
4781 optional android.stats.docsui.FileOperation file_op = 1;
4782}
4783
4784/**
4785 * Logs startup time in milliseconds.
4786 *
4787 * Logged from:
4788 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4789 */
4790message DocsUIStartupMsReported {
4791 optional int32 startup_millis = 1;
4792}
4793
4794/**
4795 * Logs the action that was started by user.
4796 *
4797 * Logged from:
4798 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4799 */
4800message DocsUIUserActionReported {
4801 optional android.stats.docsui.UserAction action = 1;
4802}
4803
4804/**
4805 * Logs the invalid type when invalid scoped access is requested.
4806 *
4807 * Logged from:
4808 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4809 */
4810message DocsUIInvalidScopedAccessRequestReported {
4811 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004812}
Ben Murdochbab399f62018-12-06 11:01:38 +00004813
4814/**
shawnlina75e82d2019-01-07 10:31:12 +08004815 * Logs the package name that launches docsui picker mode.
4816 *
4817 * Logged from:
4818 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4819 */
4820message DocsUIPickerLaunchedFromReported {
4821 optional string package_name = 1;
4822}
4823
4824/**
4825 * Logs the search type.
4826 *
4827 * Logged from:
4828 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4829 */
4830message DocsUISearchTypeReported {
4831 optional android.stats.docsui.SearchType search_type = 1;
4832}
4833
4834/**
4835 * Logs the search mode.
4836 *
4837 * Logged from:
4838 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4839 */
4840message DocsUISearchModeReported {
4841 optional android.stats.docsui.SearchMode search_mode = 1;
4842}
4843
4844/**
4845 * Logs the pick result information.
4846 *
4847 * Logged from:
4848 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4849 */
4850message DocsUIPickResultReported {
4851 optional int32 total_action_count = 1;
4852 optional int64 duration_millis = 2;
4853 optional int32 file_count= 3;
4854 optional bool is_searching = 4;
4855 optional android.stats.docsui.Root picked_from = 5;
4856 optional android.stats.docsui.MimeType mime_type = 6;
4857 optional int32 repeatedly_pick_times = 7;
4858}
4859
4860/**
Ben Murdochbab399f62018-12-06 11:01:38 +00004861 * Logs when an app's memory is compacted.
4862 *
4863 * Logged from:
4864 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4865 */
4866message AppCompacted {
4867 // The pid of the process being compacted.
4868 optional int32 pid = 1;
4869
4870 // The name of the process being compacted.
4871 optional string process_name = 2;
4872
4873 // The type of compaction.
4874 enum Action {
4875 UNKNOWN = 0;
4876 SOME = 1;
4877 FULL = 2;
4878 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004879 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00004880
4881 // Total RSS in kilobytes consumed by the process prior to compaction.
4882 optional int64 before_rss_total_kilobytes = 4;
4883
4884 // File RSS in kilobytes consumed by the process prior to compaction.
4885 optional int64 before_rss_file_kilobytes = 5;
4886
4887 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4888 optional int64 before_rss_anon_kilobytes = 6;
4889
4890 // Swap in kilobytes consumed by the process prior to compaction.
4891 optional int64 before_swap_kilobytes = 7;
4892
4893 // Total RSS in kilobytes consumed by the process after compaction.
4894 optional int64 after_rss_total_kilobytes = 8;
4895
4896 // File RSS in kilobytes consumed by the process after compaction.
4897 optional int64 after_rss_file_kilobytes = 9;
4898
4899 // Anonymous RSS in kilobytes consumed by the process after compaction.
4900 optional int64 after_rss_anon_kilobytes = 10;
4901
4902 // Swap in kilobytes consumed by the process after compaction.
4903 optional int64 after_swap_kilobytes = 11;
4904
4905 // The time taken to perform compaction in milliseconds.
4906 optional int64 time_to_compact_millis = 12;
4907
4908 // The last compaction action performed for this app.
4909 optional Action last_action = 13;
4910
Ben Murdoch01720b82018-12-19 18:03:44 +00004911 // The last time that compaction was attempted on this process in milliseconds
4912 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4913 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00004914
Ben Murdoch01720b82018-12-19 18:03:44 +00004915 // The oom_score_adj at the time of compaction.
4916 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00004917
4918 // The process state at the time of compaction.
4919 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00004920
4921 // Free ZRAM in kilobytes before compaction.
4922 optional int64 before_zram_free_kilobytes = 17;
4923
4924 // Free ZRAM in kilobytes after compaction.
4925 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00004926}
lifr157fc552018-12-12 16:38:04 +08004927
4928/**
4929 * Logs the latency period(in microseconds) and the return code of
4930 * the DNS(Domain Name System) lookups.
4931 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4932 * to get info(address or hostname) from DNS server(or DNS cache).
4933 * Logged from:
4934 * /system/netd/server/DnsProxyListener.cpp
4935 */
4936message NetworkDnsEventReported {
4937 // The types of the DNS lookups, as defined in
4938 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4939 enum EventType {
4940 EVENT_UNKNOWN = 0;
4941 EVENT_GETADDRINFO = 1;
4942 EVENT_GETHOSTBYNAME = 2;
4943 EVENT_GETHOSTBYADDR = 3;
4944 EVENT_RES_NSEND = 4;
4945 }
4946 optional EventType event_type = 1;
4947
4948 // The return value of the DNS resolver for each DNS lookups.
4949 //bionic/libc/include/netdb.h
4950 //system/netd/resolv/include/netd_resolv/resolv.h
4951 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08004952 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08004953 EAI_ADDRFAMILY = 1;
4954 EAI_AGAIN = 2;
4955 EAI_BADFLAGS = 3;
4956 EAI_FAIL = 4;
4957 EAI_FAMILY = 5;
4958 EAI_MEMORY = 6;
4959 EAI_NODATA = 7;
4960 EAI_NONAME = 8;
4961 EAI_SERVICE = 9;
4962 EAI_SOCKTYPE = 10;
4963 EAI_SYSTEM = 11;
4964 EAI_BADHINTS = 12;
4965 EAI_PROTOCOL = 13;
4966 EAI_OVERFLOW = 14;
4967 RESOLV_TIMEOUT = 255;
4968 EAI_MAX = 256;
4969 }
4970 optional ReturnCode return_code = 2;
4971
4972 // The latency period(in microseconds) it took for this DNS lookup to complete.
4973 optional int32 latency_micros = 3;
4974}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08004975
4976/**
4977 * Logs when a data stall event occurs.
4978 *
4979 * Log from:
4980 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4981 */
4982message DataStallEvent {
4983 // Data stall evaluation type.
4984 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4985 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
4986 optional int32 evaluation_type = 1;
4987 // See definition in data_stall_event.proto.
4988 optional com.android.server.connectivity.ProbeResult validation_result = 2;
4989 // See definition in data_stall_event.proto.
4990 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
4991 // See definition in data_stall_event.proto.
4992 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
4993 // See definition in data_stall_event.proto.
4994 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
4995 // See definition in data_stall_event.proto.
4996 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
4997}
Christian Brunschenf86039e2018-12-21 12:26:14 +00004998
4999/*
5000 * Logs when RescueParty resets some set of experiment flags.
5001 *
5002 * Logged from:
5003 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5004 */
5005message RescuePartyResetReported {
5006 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5007 optional int32 rescue_level = 1;
5008}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005009
5010/**
5011 * Logs when signed config is received from an APK, and if that config was applied successfully.
5012 * Logged from:
5013 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5014 */
5015message SignedConfigReported {
5016 enum Type {
5017 UNKNOWN_TYPE = 0;
5018 GLOBAL_SETTINGS = 1;
5019 }
5020 optional Type type = 1;
5021
5022 // The final status of the signed config received.
5023 enum Status {
5024 UNKNOWN_STATUS = 0;
5025 APPLIED = 1;
5026 BASE64_FAILURE_CONFIG = 2;
5027 BASE64_FAILURE_SIGNATURE = 3;
5028 SECURITY_EXCEPTION = 4;
5029 INVALID_CONFIG = 5;
5030 OLD_CONFIG = 6;
5031 SIGNATURE_CHECK_FAILED = 7;
5032 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005033 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005034 }
5035 optional Status status = 2;
5036
5037 // The version of the signed config processed.
5038 optional int32 version = 3;
5039
5040 // The package name that the config was extracted from.
5041 optional string from_package = 4;
5042
5043 enum Key {
5044 NO_KEY = 0;
5045 DEBUG = 1;
5046 PRODUCTION = 2;
5047 }
5048 // Which key was used to verify the config.
5049 optional Key verified_with = 5;
5050}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005051
5052/*
5053 * Logs GNSS Network-Initiated (NI) location events.
5054 *
5055 * Logged from:
5056 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5057 */
5058message GnssNiEventReported {
5059 // The type of GnssNiEvent.
5060 enum EventType {
5061 UNKNOWN = 0;
5062 NI_REQUEST = 1;
5063 NI_RESPONSE = 2;
5064 }
5065 optional EventType event_type = 1;
5066
5067 // An ID generated by HAL to associate NI notifications and UI responses.
5068 optional int32 notification_id = 2;
5069
5070 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005071 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005072
5073 // NI requires notification.
5074 optional bool need_notify = 4;
5075
5076 // NI requires verification.
5077 optional bool need_verify = 5;
5078
5079 // NI requires privacy override, no notification/minimal trace.
5080 optional bool privacy_override = 6;
5081
5082 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5083 // seconds.
5084 optional int32 timeout = 7;
5085
5086 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005087 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005088
5089 // String representing the requester of the network inititated location request.
5090 optional string requestor_id = 9;
5091
5092 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5093 // network initiated location request.
5094 optional string text = 10;
5095
5096 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005097 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005098
5099 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005100 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005101
5102 // True if SUPL ES is enabled.
5103 optional bool is_supl_es_enabled = 13;
5104
5105 // True if GNSS location is enabled.
5106 optional bool is_location_enabled = 14;
5107
5108 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005109 optional android.server.location.GnssUserResponseType user_response = 15;
5110}
5111
5112/**
5113 * Logs GNSS non-framework (NFW) location notification.
5114 *
5115 * Logged from:
5116 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5117 */
5118message GnssNfwNotificationReported {
5119 // Package name of the Android proxy application representing the non-framework entity that
5120 // requested location. Set to empty string if unknown.
5121 optional string proxy_app_package_name = 1;
5122
5123 // Protocol stack that initiated the non-framework location request.
5124 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5125
5126 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5127 // set to empty string. This field is opaque to the framework and used for logging purposes.
5128 optional string other_protocol_stack_name = 3;
5129
5130 // Source initiating/receiving the location information.
5131 optional android.server.location.NfwRequestor requestor = 4;
5132
5133 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5134 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5135 // and used for logging purposes.
5136 optional string requestor_id = 5;
5137
5138 // Indicates whether location information was provided for this request.
5139 optional android.server.location.NfwResponseType response_type = 6;
5140
5141 // True if the device is in user initiated emergency session.
5142 optional bool in_emergency_mode = 7;
5143
5144 // True if cached location is provided.
5145 optional bool is_cached_location = 8;
5146
5147 // True if proxy app permission mismatch between framework and GNSS HAL.
5148 optional bool is_permission_mismatched = 9;
5149}
5150
5151/**
5152 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5153 *
5154 * Logged from:
5155 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5156 */
5157message GnssConfigurationReported {
5158 // SUPL host name.
5159 optional string supl_host = 1;
5160
5161 // SUPL port number.
5162 optional int32 supl_port = 2;
5163
5164 // C2K host name.
5165 optional string c2k_host = 3;
5166
5167 // C2K port number.
5168 optional int32 c2k_port = 4;
5169
5170 // The SUPL version requested by Carrier.
5171 optional int32 supl_ver = 5;
5172
5173 // The SUPL mode.
5174 optional android.server.location.SuplMode supl_mode = 6;
5175
5176 // True if NI emergency SUPL restrictions is enabled.
5177 optional bool supl_es = 7;
5178
5179 // LTE Positioning Profile settings
5180 optional android.server.location.LppProfile lpp_profile = 8;
5181
5182 // Positioning protocol on A-Glonass system.
5183 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5184
5185 // True if emergency PDN is used. Otherwise, regular PDN is used.
5186 optional bool use_emergency_pdn_for_emergency_supl= 10;
5187
5188 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5189 optional android.server.location.GpsLock gps_lock = 11;
5190
5191 // Number of seconds to extend the emergency session duration post emergency call.
5192 optional int32 es_extension_sec = 12;
5193
5194 // The full list of package names of proxy Android applications representing the non-framework
5195 // location access entities (on/off the device) for which the framework user has granted
5196 // non-framework location access permission. The package names are concatenated in one string
5197 // with spaces as separators.
5198 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005199}
Jack Yu95b64f32018-12-13 18:26:11 +08005200
5201/**
5202 * Logs when a NFC device's error occurred.
5203 * Logged from:
5204 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5205 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5206 */
5207message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005208 enum Type {
5209 UNKNOWN = 0;
5210 CMD_TIMEOUT = 1;
5211 ERROR_NOTIFICATION = 2;
5212 AID_OVERFLOW = 3;
5213 }
5214 optional Type type = 1;
5215 // If it's nci cmd timeout, log the timeout command.
5216 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005217
Alex Salod7c3eef2019-01-25 14:43:27 -08005218 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005219}
5220
5221/**
5222 * Logs when a NFC device's state changed event
5223 * Logged from:
5224 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5225 */
5226message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005227 enum State {
5228 UNKNOWN = 0;
5229 OFF = 1;
5230 ON = 2;
5231 ON_LOCKED = 3; // Secure Nfc enabled.
5232 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5233 }
5234 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005235}
5236
5237/**
5238 * Logs when a NFC Beam Transaction occurred.
5239 * Logged from:
5240 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5241 */
5242message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005243 enum Operation {
5244 UNKNOWN = 0;
5245 SEND = 1;
5246 RECEIVE = 2;
5247 }
5248 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005249}
5250
5251/**
5252 * Logs when a NFC Card Emulation Transaction occurred.
5253 * Logged from:
5254 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5255 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5256 */
5257message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005258 enum Category {
5259 UNKNOWN = 0;
5260 HCE_PAYMENT = 1;
5261 HCE_OTHER = 2;
5262 OFFHOST = 3;
5263 }
5264 // Transaction belongs to HCE payment or HCE other category, or offhost.
5265 optional Category category = 1;
5266 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5267 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005268}
5269
5270/**
5271 * Logs when a NFC Tag event occurred.
5272 * Logged from:
5273 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5274 */
5275message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005276 enum Type {
5277 UNKNOWN = 0;
5278 URL = 1;
5279 BT_PAIRING = 2;
5280 PROVISION = 3;
5281 WIFI_CONNECT = 4;
5282 APP_LAUNCH = 5;
5283 OTHERS = 6;
5284 }
5285 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005286}
5287
5288/**
5289 * Logs when Hce transaction triggered
5290 * Logged from:
5291 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5292 */
5293message NfcHceTransactionOccurred {
5294 // The latency period(in microseconds) it took for the first HCE data
5295 // exchange.
5296 optional uint32 latency_micros = 1;
5297}
5298
5299/**
5300 * Logs when SecureElement state event changed
5301 * Logged from:
5302 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5303 */
5304message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005305 enum State {
5306 UNKNOWN = 0;
5307 INITIALIZED = 1;
5308 DISCONNECTED = 2;
5309 CONNECTED = 3;
5310 HALCRASH = 4;
5311 }
5312 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005313
Alex Salod7c3eef2019-01-25 14:43:27 -08005314 optional string state_change_reason = 2;
5315 // SIMx or eSEx.
5316 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005317}
5318
5319/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005320 * Information about a permission grant request
5321 */
5322message PermissionGrantRequestResultReported {
5323 // unique value identifying an API call. A API call might result in multiple of these atoms
5324 optional int64 request_id = 1;
5325
5326 // UID of package requesting the permission grant
5327 optional int32 requesting_uid = 2 [(is_uid) = true];
5328
5329 // Name of package requesting the permission grant
5330 optional string requesting_package_name = 3;
5331
5332 // The permission to be granted
5333 optional string permission_name = 4;
5334
5335 // If the permission was explicitly requested via the API or added by the system
5336 optional bool is_implicit = 5;
5337
5338 enum Result {
5339 UNDEFINED = 0;
5340 // permission request was ignored
5341 IGNORED = 1;
5342 // permission request was ignored because it was user fixed
5343 IGNORED_USER_FIXED = 2;
5344 // permission request was ignored because it was policy fixed
5345 IGNORED_POLICY_FIXED = 3;
5346 // permission was granted by user action
5347 USER_GRANTED = 4;
5348 // permission was automatically granted
5349 AUTO_GRANTED = 5;
5350 // permission was denied by user action
5351 USER_DENIED = 6;
5352 // permission was denied with prejudice by the user
5353 USER_DENIED_WITH_PREJUDICE = 7;
5354 // permission was automatically denied
5355 AUTO_DENIED = 8;
5356 }
5357 // The result of the permission grant
5358 optional Result result = 6;
5359}
5360
5361/**
Jack Yu95b64f32018-12-13 18:26:11 +08005362 * Logs when Omapi API used
5363 * Logged from:
5364 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5365 */
5366message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005367 enum Operation {
5368 UNKNOWN = 0;
5369 OPEN_CHANNEL = 1;
5370 }
5371 optional Operation operation = 1;
5372 // SIMx or eSEx.
5373 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005374
Alex Salod7c3eef2019-01-25 14:43:27 -08005375 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005376}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005377
5378/**
Alex Saloa060aee2019-01-21 14:36:41 -08005379 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5380 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005381 * Logged from:
5382 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5383 */
5384message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005385 optional int64 dispatch_latency_millis = 1;
5386}
5387
5388/**
5389 * Logs AttentionManagerService attention check result.
5390 *
5391 * Logged from:
5392 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5393 */
5394message AttentionManagerServiceResultReported {
5395 // See core/java/android/service/attention/AttentionService.java
5396 enum AttentionCheckResult {
5397 UNKNOWN = 20;
5398 ATTENTION_SUCCESS_ABSENT = 0;
5399 ATTENTION_SUCCESS_PRESENT = 1;
5400 ATTENTION_FAILURE_PREEMPTED = 2;
5401 ATTENTION_FAILURE_TIMED_OUT = 3;
5402 ATTENTION_FAILURE_UNKNOWN = 4;
5403 }
5404 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005405}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005406
5407/**
5408 * Logs when an adb connection changes state.
5409 *
5410 * Logged from:
5411 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5412 */
5413message AdbConnectionChanged {
5414 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5415 // previously selected for this system.
5416 optional int64 last_connection_time_millis = 1;
5417
5418 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5419 // to reconnect via adb without user interaction.
5420 optional int64 auth_window_millis = 2;
5421
5422 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5423 optional android.debug.AdbConnectionStateEnum state = 3;
5424
5425 // True if the 'always allow' option was selected for this system.
5426 optional bool always_allow = 4;
5427}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005428
5429/*
5430 * Logs the reported speech DSP status.
5431 *
5432 * Logged from:
5433 * Vendor audio implementation.
5434 */
5435message SpeechDspStatReported {
5436 // The total Speech DSP uptime in milliseconds.
5437 optional int32 total_uptime_millis = 1;
5438 // The total Speech DSP downtime in milliseconds.
5439 optional int32 total_downtime_millis = 2;
5440 optional int32 total_crash_count = 3;
5441 optional int32 total_recover_count = 4;
5442}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005443
5444/**
5445 * Logs USB connector contaminant status.
5446 *
5447 * Logged from: USB Service.
5448 */
5449message UsbContaminantReported {
5450 optional string id = 1;
5451 optional android.service.usb.ContaminantPresenceStatus status = 2;
5452}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005453
5454/**
5455 * This atom is for debugging purpose.
5456 */
5457message DebugElapsedClock {
5458 // Monotically increasing value for each pull.
5459 optional int64 pull_count = 1;
5460 // Time from System.elapsedRealtime.
5461 optional int64 elapsed_clock_millis = 2;
5462 // Time from System.elapsedRealtime.
5463 optional int64 same_elapsed_clock_millis = 3;
5464 // Diff between current elapsed time and elapsed time from previous pull.
5465 optional int64 elapsed_clock_diff_millis = 4;
5466
5467 enum Type {
5468 TYPE_UNKNOWN = 0;
5469 ALWAYS_PRESENT = 1;
5470 PRESENT_ON_ODD_PULLS = 2;
5471 }
5472 // Type of behavior for the pulled data.
5473 optional Type type = 5;
5474}
5475
5476/**
5477 * This atom is for debugging purpose.
5478 */
5479message DebugFailingElapsedClock {
5480 // Monotically increasing value for each pull.
5481 optional int64 pull_count = 1;
5482 // Time from System.elapsedRealtime.
5483 optional int64 elapsed_clock_millis = 2;
5484 // Time from System.elapsedRealtime.
5485 optional int64 same_elapsed_clock_millis = 3;
5486 // Diff between current elapsed time and elapsed time from previous pull.
5487 optional int64 elapsed_clock_diff_millis = 4;
5488}
Steven Wuacef6bb2019-01-23 14:21:17 -05005489
5490/** Logs System UI bubbles event changed.
5491 *
5492 * Logged from:
5493 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5494 */
5495message BubbleUIChanged {
5496
5497 // The app package that is posting the bubble.
5498 optional string package_name = 1;
5499
5500 // The notification channel that is posting the bubble.
5501 optional string notification_channel = 2;
5502
5503 // The notification id associated with the posted bubble.
5504 optional int32 notification_id = 3;
5505
5506 // The position of the bubble within the bubble stack.
5507 optional int32 position = 4;
5508
5509 // The total number of bubbles within the bubble stack.
5510 optional int32 total_number = 5;
5511
5512 // User interactions with the bubble.
5513 enum Action {
5514 UNKNOWN = 0;
5515 POSTED = 1;
5516 UPDATED = 2;
5517 EXPANDED = 3;
5518 COLLAPSED = 4;
5519 DISMISSED = 5;
5520 STACK_DISMISSED = 6;
5521 STACK_MOVED = 7;
5522 HEADER_GO_TO_APP = 8;
5523 HEADER_GO_TO_SETTINGS = 9;
5524 PERMISSION_OPT_IN = 10;
5525 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005526 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005527 SWIPE_LEFT = 13;
5528 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005529 STACK_EXPANDED = 15;
Steven Wuacef6bb2019-01-23 14:21:17 -05005530 }
5531 optional Action action = 6;
5532
5533 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5534 optional float normalized_x_position = 7;
5535 optional float normalized_y_position = 8;
5536}
Kweku Adams8845d012018-12-11 20:06:45 -08005537
5538/**
Steven Wu552f63f2019-02-05 13:41:36 -05005539 * Logs System UI bubbles developer errors.
5540 *
5541 * Logged from:
5542 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5543 */
5544message BubbleDeveloperErrorReported {
5545
5546 // The app package that is posting the bubble.
5547 optional string package_name = 1;
5548
5549 // Bubble developer error type enums.
5550 enum Error {
5551 UNKNOWN = 0;
5552 ACTIVITY_INFO_MISSING = 1;
5553 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5554 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5555 }
5556 optional Error error = 2 [default = UNKNOWN];
5557}
5558
5559/**
Kweku Adams8845d012018-12-11 20:06:45 -08005560 * Logs that a constraint for a scheduled job has changed.
5561 *
5562 * Logged from:
5563 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5564 */
5565message ScheduledJobConstraintChanged {
5566 repeated AttributionNode attribution_node = 1;
5567
5568 // Name of the job.
5569 optional string job_name = 2;
5570
5571 optional com.android.server.job.ConstraintEnum constraint = 3;
5572
5573 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08005574 UNKNOWN = 0;
5575 UNSATISFIED = 1;
5576 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08005577 }
5578 optional State state = 4;
5579}
Alex Salod7c3eef2019-01-25 14:43:27 -08005580
5581/**
5582 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5583 * returns true.
5584 *
5585 * Logged from:
5586 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5587 */
5588message ScreenTimeoutExtensionReported {
5589 // Describes how many times in a row did the power manager reset the screen off timeout.
5590 optional uint32 consecutive_timeout_extended_count = 1;
5591}
Hui Yu885aca12019-01-10 17:11:34 -08005592
5593/*
5594* Logs number of milliseconds it takes to start a process.
5595* The definition of app process start time is from the app launch time to
5596* the time that Zygote finished forking the app process and loaded the
5597* application package's java classes.
5598
5599* This metric is different from AppStartOccurred which is for foreground
5600* activity only.
5601
5602* ProcessStartTime can report all processes (both foreground and background)
5603* start time.
5604*
5605* Logged from:
5606* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5607*/
5608message ProcessStartTime {
5609 // The uid of the ProcessRecord.
5610 optional int32 uid = 1 [(is_uid) = true];
5611
5612 // The process pid.
5613 optional int32 pid = 2;
5614
5615 // The process name.
5616 // Usually package name, "system" for system server.
5617 // Provided by ActivityManagerService.
5618 optional string process_name = 3;
5619
5620 enum StartType {
5621 UNKNOWN = 0;
5622 WARM = 1;
5623 HOT = 2;
5624 COLD = 3;
5625 }
5626
5627 // The start type.
5628 optional StartType type = 4;
5629
5630 // The elapsed realtime at the start of the process.
5631 optional int64 process_start_time_millis = 5;
5632
5633 // Number of milliseconds it takes to reach bind application.
5634 optional int32 bind_application_delay_millis = 6;
5635
5636 // Number of milliseconds it takes to finish start of the process.
5637 optional int32 process_start_delay_millis = 7;
5638
5639 // hostingType field in ProcessRecord, the component type such as "activity",
5640 // "service", "content provider", "broadcast" or other strings.
5641 optional string hosting_type = 8;
5642
5643 // hostingNameStr field in ProcessRecord. The component class name that runs
5644 // in this process.
5645 optional string hosting_name = 9;
5646}
5647
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005648/**
5649 * State of a dangerous permission requested by a package
5650 */
5651message DangerousPermissionState {
5652 // Name of the permission
5653 optional string permission_name = 1;
5654
5655 // Uid of the package
5656 optional int32 uid = 2 [(is_uid) = true];
5657
5658 // Package requesting the permission
5659 optional string package_name = 3;
5660
5661 // If the permission is granted to the uid
5662 optional bool is_granted = 4;
5663}
5664
Michael Groover4a0ca942019-01-24 17:41:25 -08005665/**
5666 * Logs when a package is denied access to a device identifier based on the new access requirements.
5667 *
5668 * Logged from:
5669 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
5670 */
5671message DeviceIdentifierAccessDenied {
5672 // The name of the package denied access to the requested device identifier.
5673 optional string package_name = 1;
5674
5675 // The name of the device identifier method the package attempted to invoke.
5676 optional string method_name = 2;
5677
5678 // True if the package is preinstalled.
5679 optional bool is_preinstalled = 3;
5680
5681 // True if the package is privileged.
5682 optional bool is_priv_app = 4;
5683}
Chenjie Yue13f44a2019-02-07 17:51:38 -08005684
5685/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08005686 * Pulls the ongoing mainline install train version code.
5687 * Pulled from StatsCompanionService
5688 */
5689message TrainInfo {
5690 optional int64 train_version_code = 1;
5691
5692 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08005693
5694 optional string train_name = 3;
5695
5696 enum Status {
5697 UNKNOWN = 0;
5698 INSTALL_REQUESTED = 1;
5699 INSTALL_STARTED = 2;
5700 INSTALL_STAGED_NOT_READY = 3;
5701 INSTALL_STAGED_READY = 4;
5702 INSTALL_SUCCESS = 5;
5703 INSTALL_FAILURE = 6;
5704 INSTALL_CANCELLED = 7;
5705 INSTALLER_ROLLBACK_REQUESTED = 8;
5706 INSTALLER_ROLLBACK_INITIATED = 9;
5707 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
5708 INSTALLER_ROLLBACK_STAGED = 11;
5709 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
5710 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
5711 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
5712 INSTALLER_ROLLBACK_SUCCESS = 15;
5713 INSTALLER_ROLLBACK_FAILURE = 16;
5714 INSTALLER_ROLLBACK_CANCEL_STAGED_REMOVE_FROM_QUEUE = 17;
5715 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_INITIATED = 18;
5716 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_SUCCESS = 19;
5717 INSTALLER_ROLLBACK_CANCEL_STAGED_DELETE_SESSION_FAILURE = 20;
5718 }
5719 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08005720}
joshmccloskey8c3322e2019-01-09 18:25:57 -08005721
5722/**
5723 * Logs the gesture stage changed event.
5724 *
5725 * Logged from:
5726 * frameworks/base/packages/SystemUI/
5727 */
5728message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005729 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005730}
5731
5732/**
5733 * Logs the feedback type.
5734 *
5735 * Logged from:
5736 * frameworks/base/packages/SystemUI/
5737 */
5738message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005739 // Whether or not the gesture was used.
5740 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005741}
5742
5743/**
5744 * Logs the progress.
5745 *
5746 * Logged from:
5747 * frameworks/base/packages/SystemUI/
5748 */
5749message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005750 // [0,100] progress for the assist gesture.
5751 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005752}
Neil Fullerdb14b482019-02-05 19:44:44 +00005753
5754/*
5755 * Information about the time zone data on a device.
5756 */
5757message TimeZoneDataInfo {
5758 // A version identifier for the data set on device. e.g. "2018i"
5759 optional string tzdb_version = 1;
5760}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005761
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005762/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005763 * Logs the GPU stats global health information.
5764 *
5765 * Logged from:
5766 * frameworks/native/services/gpuservice/gpustats/
5767 */
5768message GpuStatsGlobalInfo {
5769 // Package name of the gpu driver.
5770 optional string driver_package_name = 1;
5771
5772 // Version name of the gpu driver.
5773 optional string driver_version_name = 2;
5774
5775 // Version code of the gpu driver.
5776 optional int64 driver_version_code = 3;
5777
5778 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
5779 optional int64 driver_build_time = 4;
5780
5781 // Total count of the gl driver gets loaded.
5782 optional int64 gl_loading_count = 5;
5783
5784 // Total count of the gl driver fails to be loaded.
5785 optional int64 gl_loading_failure_count = 6;
5786
5787 // Total count of the Vulkan driver gets loaded.
5788 optional int64 vk_loading_count = 7;
5789
5790 // Total count of the Vulkan driver fails to be loaded.
5791 optional int64 vk_loading_failure_count = 8;
5792}
5793
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005794/**
5795 * GPU driver loading time info.
5796 */
5797message GpuDriverLoadingTime {
5798 // List of all the driver loading times for this app. The list size is
5799 // capped at 50.
5800 repeated int64 driver_loading_time = 1;
5801}
5802
5803/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005804 * Logs the GPU stats per app health information.
5805 *
5806 * Logged from:
5807 * frameworks/native/services/gpuservice/gpustats/
5808 */
5809message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005810 // Package name of the application that loads the gpu driver. Total number
5811 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005812 optional string app_package_name = 1;
5813
5814 // Version code of the gpu driver this app loads.
5815 optional int64 driver_version_code = 2;
5816
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005817 // gl driver loading time info.
5818 optional GpuDriverLoadingTime gl_driver_loading_time = 3
5819 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005820
Yiwei Zhang4fb92892019-03-04 14:29:25 -08005821 // Vulkan driver loading time info.
5822 optional GpuDriverLoadingTime vk_driver_loading_time = 4
5823 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08005824}