blob: 1dd68df36ba8ae9e1ef4e2938992861cf7bf254e [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;
Yangster-mac48b3d622018-08-18 12:38:11 -0700152 KeyValuePairsAtom key_value_pairs_atom = 83;
Bookatza7020bd2018-08-28 16:29:35 -0700153 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700154 DeferredJobStatsReported deferred_job_stats_reported = 85;
Yangster-mace16189a2018-08-26 12:20:16 -0700155 ThermalThrottlingStateChanged thermal_throttling = 86;
Kevin Chyn1741a072019-01-17 11:54:40 -0800156 BiometricAcquired biometric_acquired = 87;
157 BiometricAuthenticated biometric_authenticated = 88;
158 BiometricErrorOccurred biometric_error_occurred = 89;
Howard Ro688ae182018-09-25 00:09:36 -0700159 Notification notification = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700160 BatteryHealthSnapshot battery_health_snapshot = 91;
161 SlowIo slow_io = 92;
162 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700163 PhoneServiceStateChanged phone_service_state_changed = 94;
164 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100165 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700166 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700167 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700168 // TODO: service state change is very noisy shortly after boot, as well
169 // as at other transitions - coming out of doze, device plugged in, etc.
170 // Consider removing this if it becomes a problem
171 ServiceStateChanged service_state_changed = 99;
172 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800173 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800174 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000175 DevicePolicyEvent device_policy_event = 103;
shawnlinea5b66b2018-11-13 15:05:29 +0800176 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104;
177 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported = 105;
178 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106;
179 DocsUIFileOperationReported docs_ui_provider_file_op = 107;
180 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request = 108;
181 DocsUILaunchReported docs_ui_launch_reported = 109;
182 DocsUIRootVisitedReported docs_ui_root_visited = 110;
183 DocsUIStartupMsReported docs_ui_startup_ms = 111;
184 DocsUIUserActionReported docs_ui_user_action_reported = 112;
Bookatzda1798c2018-12-13 14:16:00 -0800185 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
186 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f2018-12-06 11:01:38 +0000187 AppCompacted app_compacted = 115;
lifr030d23a2019-01-11 16:54:51 +0800188 NetworkDnsEventReported network_dns_event_reported = 116;
shawnlina75e82d2019-01-07 10:31:12 +0800189 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported = 117;
190 DocsUIPickResultReported docs_ui_pick_result_reported = 118;
191 DocsUISearchModeReported docs_ui_search_mode_reported = 119;
192 DocsUISearchTypeReported docs_ui_search_type_reported = 120;
Chiachang Wangf6bedc22019-01-14 11:54:32 +0800193 DataStallEvent data_stall_event = 121;
Christian Brunschenf86039e2018-12-21 12:26:14 +0000194 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000195 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800196 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800197 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800198 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
199 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000200 AppDowngraded app_downgraded = 128;
201 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
202 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800203 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
204 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800205 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800206 NfcErrorOccurred nfc_error_occurred = 134;
207 NfcStateChanged nfc_state_changed = 135;
208 NfcBeamOccurred nfc_beam_occurred = 136;
209 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
210 NfcTagOccurred nfc_tag_occurred = 138;
211 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
212 SeStateChanged se_state_changed = 140;
213 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800214 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800215 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800216 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800217 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800218 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800219 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyne5a37fb2019-02-08 13:10:36 -0800220 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500221 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800222 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Jack Hec27040a2019-01-09 20:54:41 -0800223 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
224 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
225 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
226 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
227 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
228 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
229 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
230 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
231 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He1021a612019-01-20 21:22:46 -0800232 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
233 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
234 BluetoothManufacturerInfoReported bluetooth_device_info_reported = 162;
235 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
236 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
237 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
238 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
239 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Alex Salod7c3eef2019-01-25 14:43:27 -0800240 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800241 ProcessStartTime process_start_time = 169;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -0800242 PermissionGrantRequestResultReported permission_grant_request_result_reported = 170;
Jack He815cdba2019-01-30 17:24:55 -0800243 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Michael Groover4a0ca942019-01-24 17:41:25 -0800244 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Steven Wu552f63f2019-02-05 13:41:36 -0500245 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
joshmccloskey8c3322e2019-01-09 18:25:57 -0800246 AssistGestureStageReported assist_gesture_stage_reported = 174;
247 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
248 AssistGestureProgressReported assist_gesture_progress_reported = 176;
Philip Quinn0eded622019-01-29 12:46:28 -0800249 TouchGestureClassified touch_gesture_classified = 177;
Andrei Onea4ad6d0c2019-02-08 13:54:12 +0000250 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true];
Hyunyoung Song80adf6be2019-01-30 09:59:30 -0800251 StyleUIChanged style_ui_changed = 179;
Yao Chend54f9dd2017-10-17 17:37:48 +0000252 }
David Chenc8a43242017-10-17 16:23:28 -0700253
David Chen6e3e6cb2018-01-03 16:14:06 -0800254 // Pulled events will start at field 10000.
Olivier Gaillard18d452202019-01-22 15:03:41 +0000255 // Next: 10048
David Chenc8a43242017-10-17 16:23:28 -0700256 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800257 WifiBytesTransfer wifi_bytes_transfer = 10000;
258 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
259 MobileBytesTransfer mobile_bytes_transfer = 10002;
260 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800261 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800262 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800263 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800264 CpuTimePerFreq cpu_time_per_freq = 10008;
265 CpuTimePerUid cpu_time_per_uid = 10009;
266 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800267 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800268 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800269 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800270 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800271 SystemElapsedRealtime system_elapsed_realtime = 10014;
272 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800273 CpuActiveTime cpu_active_time = 10016;
274 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000275 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800276 RemainingBatteryCapacity remaining_battery_capacity = 10019;
277 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800278 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100279 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100280 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100281 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000282 DiskStats disk_stats = 10025;
283 DirectoryUsage directory_usage = 10026;
284 AppSize app_size = 10027;
285 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700286 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700287 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800288 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700289 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700290 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800291 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700292 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100293 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100294 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700295 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee6042018-11-09 12:27:37 -0800296 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
297 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
298 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000299 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800300 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800301 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800302 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000303 DebugElapsedClock debug_elapsed_clock = 10046;
304 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800305 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800306 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800307 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800308 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000309 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +0000310 SDCardInfo sdcard_info = 10053;
David Chenc8a43242017-10-17 16:23:28 -0700311 }
yroa1fe77c2018-02-26 14:22:54 -0800312
Bookatz76aafcf2018-09-17 16:17:10 -0700313 // DO NOT USE field numbers above 100,000 in AOSP.
314 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
315 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700316}
317
Yao Chend54f9dd2017-10-17 17:37:48 +0000318/**
Yangster-mac20877162017-12-22 17:19:39 -0800319 * This proto represents a node of an attribution chain.
320 * Note: All attribution chains are represented as a repeated field of type
321 * AttributionNode. It is understood that in such arrays, the order is that
322 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000323 */
Yangster-mac20877162017-12-22 17:19:39 -0800324message AttributionNode {
325 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800326 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800327
Yangster-mac20877162017-12-22 17:19:39 -0800328 // The (optional) string tag for an element in the attribution chain. If the
329 // element has no tag, it is encoded as an empty string.
330 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700331}
332
Yangster-mac48b3d622018-08-18 12:38:11 -0700333message KeyValuePair {
334 optional int32 key = 1;
335 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700336 int32 value_int = 2;
337 int64 value_long = 3;
338 string value_str = 4;
339 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700340 }
341}
342
343message KeyValuePairsAtom {
344 optional int32 uid = 1;
345 repeated KeyValuePair pairs = 2;
346}
347
Yao Chend54f9dd2017-10-17 17:37:48 +0000348/*
349 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800350 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000351 *
352 * RULES:
353 * - The field ids for each atom must start at 1, and count upwards by 1.
354 * Skipping field ids is not allowed.
355 * - These form an API, so renaming, renumbering or removing fields is
356 * not allowed between android releases. (This is not currently enforced,
357 * but there will be a tool to enforce this restriction).
358 * - The types must be built-in protocol buffer types, namely, no sub-messages
359 * are allowed (yet). The bytes type is also not allowed.
360 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800361 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000362 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800363 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000364 * - A field that is a uid should be a string field, tagged with the [xxx]
365 * annotation. The generated code on android will be represented by UIDs,
366 * and those UIDs will be translated in xxx to those strings.
367 *
368 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700369 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000370 * - If there is a UID, it goes first. Think in an object-oriented fashion.
371 * *****************************************************************************
372 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700373
Yao Chend54f9dd2017-10-17 17:37:48 +0000374/**
Yangster-mace16189a2018-08-26 12:20:16 -0700375 * Logs when the Thermal service HAL notifies the throttling start/stop events.
376 *
377 * Logged from:
378 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
379 */
380message ThermalThrottlingStateChanged {
381 optional android.os.TemperatureTypeEnum sensor_type = 1;
382
383 enum State {
384 UNKNOWN = 0;
385 START = 1;
386 STOP = 2;
387 }
388
389 optional State state = 2;
390
391 optional float temperature = 3;
392}
393
394/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000395 * Logs when the screen state changes.
396 *
397 * Logged from:
398 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
399 */
400message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800401 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700402 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700403}
Yao Chend54f9dd2017-10-17 17:37:48 +0000404
405/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700406 * Logs that the process state of the uid, as determined by ActivityManager
407 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000408 *
409 * Logged from:
410 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
411 */
Bookatzc1a050a2017-10-10 15:49:28 -0700412message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700413 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000414
Bookatzdb026a22018-01-10 19:01:56 -0800415 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700416 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000417}
418
419/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700420 * Logs process state change of a process, as per the activity manager.
421 *
422 * Logged from:
423 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
424 */
425message ProcessStateChanged {
426 optional int32 uid = 1;
427 optional string process_name = 2;
428 optional string package_name = 3;
429 // TODO: remove this when validation is done
430 optional int64 version = 5;
431 // The state, from frameworks/base/core/proto/android/app/enums.proto.
432 optional android.app.ProcessStateEnum state = 4;
433}
434
435/**
436 * Logs when ActivityManagerService sleep state is changed.
437 *
438 * Logged from:
439 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
440 */
441message ActivityManagerSleepStateChanged {
442 // TODO: import frameworks proto
443 enum State {
444 UNKNOWN = 0;
445 ASLEEP = 1;
446 AWAKE = 2;
447 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700448 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700449}
450
451/**
452 * Logs when system memory state changes.
453 *
454 * Logged from:
455 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
456 */
457message MemoryFactorStateChanged {
458 // TODO: import frameworks proto
459 enum State {
460 MEMORY_UNKNOWN = 0;
461 NORMAL = 1; // normal.
462 MODERATE = 2; // moderate memory pressure.
463 LOW = 3; // low memory.
464 CRITICAL = 4; // critical memory.
465
466 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700467 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700468}
469
470/**
471 * Logs when app is using too much cpu, according to ActivityManagerService.
472 *
473 * Logged from:
474 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
475 */
476message ExcessiveCpuUsageReported {
477 optional int32 uid = 1;
478 optional string process_name = 2;
479 optional string package_name = 3;
480 // package version. TODO: remove this when validation is done
481 optional int64 version = 4;
482}
483
484/**
485 * Logs when a cached process is killed, along with its pss.
486 *
487 * Logged from:
488 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
489 */
490message CachedKillReported {
491 optional int32 uid = 1;
492 optional string process_name = 2;
493 optional string package_name = 3;
494 // TODO: remove this when validation is done
495 optional int64 version = 5;
496 optional int64 pss = 4;
497}
498
499/**
500 * Logs when memory stats of a process is reported.
501 *
502 * Logged from:
503 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
504 */
505message ProcessMemoryStatReported {
506 optional int32 uid = 1;
507 optional string process_name = 2;
508 optional string package_name = 3;
509 //TODO: remove this when validation is done
510 optional int64 version = 9;
511 optional int64 pss = 4;
512 optional int64 uss = 5;
513 optional int64 rss = 6;
514 enum Type {
515 ADD_PSS_INTERNAL_SINGLE = 0;
516 ADD_PSS_INTERNAL_ALL_MEM = 1;
517 ADD_PSS_INTERNAL_ALL_POLL = 2;
518 ADD_PSS_EXTERNAL = 3;
519 ADD_PSS_EXTERNAL_SLOW = 4;
520 }
521 optional Type type = 7;
522 optional int64 duration = 8;
523}
524
525/**
Bookatzc1a050a2017-10-10 15:49:28 -0700526 * Logs that a process started, finished, crashed, or ANRed.
527 *
528 * Logged from:
529 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
530 */
531message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700532 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700533
David Chen0b5c90c2018-01-25 16:51:49 -0800534 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800535 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700536
Bookatzddccf0a2017-11-28 16:48:14 -0800537 // What lifecycle state the process changed to.
538 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800539 enum State {
540 FINISHED = 0;
541 STARTED = 1;
542 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800543 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800544 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700545}
546
Bookatzc1a050a2017-10-10 15:49:28 -0700547/**
548 * Logs when the ble scan state changes.
549 *
550 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700551 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700552 */
553message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800554 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700555
556 enum State {
557 OFF = 0;
558 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700559 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
560 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700561 }
562 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700563
Bookatze5ec0b42018-03-26 13:34:56 -0700564 // Does the scan have a filter.
565 optional bool is_filtered = 3;
566 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
567 optional bool is_first_match = 4;
568 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
569 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700570}
571
572/**
573 * Logs reporting of a ble scan finding results.
574 *
575 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700576 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700577 */
Bookatzae6738e2018-09-13 11:38:56 -0700578// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700579message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800580 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700581
582 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800583 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700584}
585
586/**
587 * Logs when a sensor state changes.
588 *
589 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700590 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700591 */
592message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800593 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700594
Bookatzc1a050a2017-10-10 15:49:28 -0700595 // The id (int) of the sensor.
596 optional int32 sensor_id = 2;
597
598 enum State {
599 OFF = 0;
600 ON = 1;
601 }
602 optional State state = 3;
603}
604
Bookatzc1a050a2017-10-10 15:49:28 -0700605/**
606 * Logs when GPS state changes.
607 *
608 * Logged from:
609 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
610 */
611message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800612 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700613
614 enum State {
615 OFF = 0;
616 ON = 1;
617 }
618 optional State state = 2;
619}
620
Bookatz48d362e2018-11-06 15:49:08 -0800621/**
622 * Logs when GPS signal quality.
623 *
624 * Logged from:
625 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
626 */
627message GpsSignalQualityChanged {
628 optional android.server.location.GpsSignalQualityEnum level = 1;
629}
630
Bookatzc1a050a2017-10-10 15:49:28 -0700631
632/**
633 * Logs when a sync manager sync state changes.
634 *
635 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700636 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700637 */
638message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800639 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700640
David Chen0b5c90c2018-01-25 16:51:49 -0800641 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800642 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700643
644 enum State {
645 OFF = 0;
646 ON = 1;
647 }
648 optional State state = 3;
649}
650
Yangster-mac96353002018-09-05 11:18:55 -0700651/*
652 * Deferred job stats.
653 *
654 * Logged from:
655 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
656*/
657message DeferredJobStatsReported {
658 repeated AttributionNode attribution_node = 1;
659
660 // Number of jobs deferred.
661 optional int32 num_jobs_deferred = 2;
662
663 // Time since the last job runs.
664 optional int64 time_since_last_job_millis = 3;
665}
666
Bookatzc1a050a2017-10-10 15:49:28 -0700667/**
668 * Logs when a job scheduler job state changes.
669 *
670 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700671 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700672 */
673message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800674 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700675
676 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800677 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700678
679 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800680 FINISHED = 0;
681 STARTED = 1;
682 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700683 }
684 optional State state = 3;
685
Tej Singh33a412b2018-03-16 18:43:59 -0700686 // The reason a job has stopped.
687 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700688 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700689 optional android.app.job.StopReasonEnum stop_reason = 4;
Bookatzc1a050a2017-10-10 15:49:28 -0700690}
691
692/**
693 * Logs when the audio state changes.
694 *
695 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700696 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700697 */
698message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800699 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700700
701 enum State {
702 OFF = 0;
703 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700704 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
705 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700706 }
707 optional State state = 2;
708}
709
710/**
711 * Logs when the video codec state changes.
712 *
713 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700714 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700715 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800716message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800717 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700718
719 enum State {
720 OFF = 0;
721 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700722 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
723 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700724 }
725 optional State state = 2;
726}
727
728/**
729 * Logs when the flashlight state changes.
730 *
731 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700732 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700733 */
734message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800735 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700736
737 enum State {
738 OFF = 0;
739 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700740 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
741 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700742 }
743 optional State state = 2;
744}
745
746/**
747 * Logs when the camera state changes.
748 *
749 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700750 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700751 */
752message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800753 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700754
755 enum State {
756 OFF = 0;
757 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700758 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
759 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700760 }
761 optional State state = 2;
762}
763
764/**
765 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000766 *
767 * Logged from:
768 * TODO
769 */
Bookatzd6746242017-10-24 18:39:35 -0700770message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800771 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000772
Bookatz1a1b0462018-01-12 11:47:03 -0800773 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
774 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700775 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700776
777 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
778 optional string tag = 3;
779
780 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800781 RELEASE = 0;
782 ACQUIRE = 1;
783 CHANGE_RELEASE = 2;
784 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700785 }
786 optional State state = 4;
787}
788
789/**
Bookatzc1a050a2017-10-10 15:49:28 -0700790 * Logs when a partial wakelock is considered 'long' (over 1 min).
791 *
792 * Logged from:
793 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
794 */
795message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800796 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700797
Yao Chend54f9dd2017-10-17 17:37:48 +0000798 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
799 optional string tag = 2;
800
Bookatzc1a050a2017-10-10 15:49:28 -0700801 // TODO: I have no idea what this is.
802 optional string history_tag = 3;
803
804 enum State {
805 OFF = 0;
806 ON = 1;
807 }
808 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000809}
810
Bookatzc1a050a2017-10-10 15:49:28 -0700811/**
Bookatza66083f2018-09-20 17:24:00 -0700812 * Logs when the device is interactive, according to the PowerManager Notifier.
813 *
814 * Logged from:
815 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
816 */
817message InteractiveStateChanged {
818 enum State {
819 OFF = 0;
820 ON = 1;
821 }
822 optional State state = 1;
823}
824
825/**
Bookatzc1a050a2017-10-10 15:49:28 -0700826 * Logs Battery Saver state change.
827 *
828 * Logged from:
829 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
830 */
831message BatterySaverModeStateChanged {
832 enum State {
833 OFF = 0;
834 ON = 1;
835 }
836 optional State state = 1;
837}
838
839/**
840 * Logs Doze mode state change.
841 *
842 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800843 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700844 */
845message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800846 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800847}
848
849
850/**
851 * Logs state change of Doze mode including maintenance windows.
852 *
853 * Logged from:
854 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
855 */
856message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800857 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700858}
859
860/**
861 * Logs screen brightness level.
862 *
863 * Logged from:
864 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
865 */
866message ScreenBrightnessChanged {
867 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
868 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700869}
870
871/**
872 * Logs battery level (percent full, from 0 to 100).
873 *
874 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700875 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700876 */
877message BatteryLevelChanged {
878 // Battery level. Should be in [0, 100].
879 optional int32 battery_level = 1;
880}
881
882/**
883 * Logs change in charging status of the device.
884 *
885 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700886 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700887 */
888message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800889 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
890 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700891}
892
893/**
894 * Logs whether the device is plugged in, and what power source it is using.
895 *
896 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700897 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700898 */
899message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800900 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
901 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700902}
903
Bookatz8c6571b2017-10-24 15:04:41 -0700904/**
905 * Logs when an app's wakeup alarm fires.
906 *
907 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700908 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700909 */
910message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800911 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800912
913 // Name of the wakeup alarm.
914 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -0700915
916 // Name of source package (for historical reasons, since BatteryStats tracked it).
917 optional string package_name = 3;
Bookatzddccf0a2017-11-28 16:48:14 -0800918}
919
920/**
921 * Logs when an an app causes the mobile radio to change state.
922 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
923 *
924 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700925 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800926 */
927message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800928 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800929
Bookatz1a1b0462018-01-12 11:47:03 -0800930 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
931 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800932}
933
934/**
935 * Logs when an an app causes the wifi radio to change state.
936 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
937 *
938 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -0700939 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -0800940 */
941message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800942 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800943
Bookatz1a1b0462018-01-12 11:47:03 -0800944 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
945 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -0700946}
947
948/**
949 * Logs kernel wakeup reasons and aborts.
950 *
951 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -0700952 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700953 */
954message KernelWakeupReported {
955 // Name of the kernel wakeup reason (or abort).
956 optional string wakeup_reason_name = 1;
957
958 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -0800959 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -0700960}
961
962/**
Bookatzda1798c2018-12-13 14:16:00 -0800963 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -0800964 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -0800965 *
966 * Logged from:
967 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
968 */
969message WifiEnabledStateChanged {
970 enum State {
971 OFF = 0;
972 ON = 1;
973 }
974 optional State state = 1;
975}
976
977/**
978 * 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 -0800979 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
980 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -0800981 *
982 * Logged from:
983 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
984 */
985message WifiRunningStateChanged {
986 repeated AttributionNode attribution_node = 1;
987
988 enum State {
989 OFF = 0;
990 ON = 1;
991 }
992 optional State state = 2;
993}
994
995/**
Bookatze5885242017-10-24 20:10:31 -0700996 * Logs wifi locks held by an app.
997 *
998 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700999 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001000 */
1001message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001002 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001003
1004 enum State {
1005 OFF = 0;
1006 ON = 1;
1007 }
1008 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001009
1010 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1011 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001012}
1013
1014/**
1015 * Logs wifi signal strength changes.
1016 *
1017 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001018 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001019 */
1020message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001021 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1022 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001023}
1024
1025/**
1026 * Logs wifi scans performed by an app.
1027 *
1028 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001029 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001030 */
1031message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001032 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001033
1034 enum State {
1035 OFF = 0;
1036 ON = 1;
1037 }
1038 optional State state = 2;
1039}
1040
1041/**
Tej Singh4503e102018-01-04 14:35:01 -08001042 * Logs wifi multicast locks held by an app
1043 *
1044 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001045 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001046 */
1047message WifiMulticastLockStateChanged {
1048 repeated AttributionNode attribution_node = 1;
1049
1050 enum State {
1051 OFF = 0;
1052 ON = 1;
1053 }
1054 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001055
1056 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001057}
1058
1059/**
Tej Singh1ea42892018-01-19 09:27:00 -08001060 * Logs shutdown reason and duration on next boot.
1061 *
1062 * Logged from:
1063 * frameworks/base/core/java/com/android/server/BootReceiver.java
1064 */
1065message ShutdownSequenceReported {
1066 // True if shutdown is for a reboot. Default: false if we do not know.
1067 optional bool reboot = 1;
1068
1069 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1070 optional string reason = 2;
1071
1072 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1073 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001074 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001075
1076 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001077 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001078}
1079
Tej Singh6483ea42018-01-25 17:45:49 -08001080
1081/**
1082 * Logs boot reason and duration.
1083 *
1084 * Logged from:
1085 * system/core/bootstat/bootstat.cpp
1086 */
1087message BootSequenceReported {
1088 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1089 // Default: "<EMPTY>" if not available.
1090 optional string bootloader_reason = 1;
1091
1092 // Reason for system boot. Eg. bootloader, reboot,userrequested
1093 // Default: "<EMPTY>" if not available.
1094 optional string system_reason = 2;
1095
1096 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001097 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001098
1099 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001100 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001101
1102 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001103 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001104
1105 // Time since last boot in ms. Default: 0 if not available.
1106 optional int64 time_since_last_boot = 6;
1107}
1108
Tej Singhc477d9c2018-02-05 18:31:39 -08001109
1110/**
1111 * Logs call state and disconnect cause (if applicable).
1112 *
1113 * Logged from:
1114 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1115 */
1116message CallStateChanged {
1117 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1118 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1119 optional android.telecom.CallStateEnum call_state = 1;
1120
1121 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1122 // This value is only applicable when the call_state is DISCONNECTED, and
1123 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1124 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1125 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1126
1127 // True if the call is self-managed, which are apps that use the
1128 // telecom infrastructure to make their own calls.
1129 optional bool self_managed = 3;
1130
1131 // True if call is external. External calls are calls on connected Wear
1132 // devices but show up in Telecom so the user can pull them onto the device.
1133 optional bool external_call = 4;
1134}
1135
Tej Singh1ea42892018-01-19 09:27:00 -08001136/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001137 * Logs keyguard state. The keyguard is the lock screen.
1138 *
1139 * Logged from:
1140 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1141 */
1142message KeyguardStateChanged {
1143 enum State {
1144 UNKNOWN = 0;
1145 // The keyguard is hidden when the phone is unlocked.
1146 HIDDEN = 1;
1147 // The keyguard is shown when the phone is locked (screen turns off).
1148 SHOWN= 2;
1149 // The keyguard is occluded when something is overlaying the keyguard.
1150 // Eg. Opening the camera while on the lock screen.
1151 OCCLUDED = 3;
1152 }
1153 optional State state = 1;
1154}
1155
1156/**
1157 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1158 * prompts the user to enter a password (pattern, pin, etc).
1159 *
1160 * Logged from:
1161 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1162 */
1163
1164message KeyguardBouncerStateChanged {
1165 enum State {
1166 UNKNOWN = 0;
1167 // Bouncer is hidden, either as a result of successfully entering the
1168 // password, screen timing out, or user going back to lock screen.
1169 HIDDEN = 1;
1170 // This is when the user is being prompted to enter the password.
1171 SHOWN = 2;
1172 }
1173 optional State state = 1;
1174}
1175
1176/**
1177 * Logs the result of entering a password into the keyguard bouncer.
1178 *
1179 * Logged from:
1180 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1181 */
1182message KeyguardBouncerPasswordEntered {
1183 enum BouncerResult {
1184 UNKNOWN = 0;
1185 // The password entered was incorrect.
1186 FAILURE = 1;
1187 // The password entered was correct.
1188 SUCCESS = 2;
1189 }
1190 optional BouncerResult result = 1;
1191}
1192
Tej Singha883b372018-02-15 11:30:01 -08001193/*
1194 * Logs changes to the configuration of the device. The configuration is defined
1195 * in frameworks/base/core/java/android/content/res/Configuration.java
1196 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1197 * Please go there to interpret the possible values each field can be.
1198 *
1199 * Logged from:
1200 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1201 */
1202message ResourceConfigurationChanged {
1203 // Bit mask of color capabilities of the screen.
1204 // Contains information about the color gamut and hdr mode of the screen.
1205 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001206 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001207
1208 // The target screen density being rendered to.
1209 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001210 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001211
1212 // Current user preference for the scaling factor for fonts,
1213 // relative to the base density scaling.
1214 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001215 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001216
1217 // Flag indicating whether the hard keyboard is hidden.
1218 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001219 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001220
1221 // The type of keyboard attached to the device.
1222 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1223 optional int32 keyboard = 5;
1224
1225 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1226 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001227 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001228
1229 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1230 // 0 if undefined.
1231 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1232 optional int32 mcc = 7;
1233
1234 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1235 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1236 // MNC_ZERO symbol defined in Configuration.java.
1237 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1238 optional int32 mnc = 8;
1239
1240 // The kind of navigation available on the device.
1241 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1242 optional int32 navigation = 9;
1243
1244 // Flag indicating whether the navigation is available.
1245 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001246 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001247
1248 // Overall orientation of the screen.
1249 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1250 optional int32 orientation = 11;
1251
1252 // The current height of the available screen space, in dp units.
1253 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001254 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001255
1256 // Bit mask of overall layout of the screen.
1257 // Contains information about screen size, whether the screen is wider/taller
1258 // than normal, whether the screen layout is right-tl-left or left-to-right,
1259 // and whether the screen has a rounded shape.
1260 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001261 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001262
1263 // Current width of the available screen space, in dp units.
1264 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001265 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001266
1267 // The smallest screen size an application will see in normal operation.
1268 // This is the smallest value of both screenWidthDp and screenHeightDp
1269 // in portrait and landscape.
1270 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001271 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001272
1273 // The type of touch screen attached to the device.
1274 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1275 optional int32 touchscreen = 16;
1276
1277 // Bit mask of the ui mode.
1278 // Contains information about the overall ui mode of the device.
1279 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1280 // Also contains information about whether the device is in night mode.
1281 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001282 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001283}
1284
Tej Singheee317b2018-03-07 19:28:05 -08001285
1286/**
1287 * Logs changes in the connection state of the mobile radio.
1288 *
1289 * Logged from:
1290 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1291 */
1292message MobileConnectionStateChanged {
1293 // States are from the state machine DataConnection.java.
1294 enum State {
1295 UNKNOWN = 0;
1296 // The connection is inactive, or disconnected.
1297 INACTIVE = 1;
1298 // The connection is being activated, or connecting.
1299 ACTIVATING = 2;
1300 // The connection is active, or connected.
1301 ACTIVE = 3;
1302 // The connection is disconnecting.
1303 DISCONNECTING = 4;
1304 // The connection is disconnecting after creating a connection.
1305 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1306 }
1307 optional State state = 1;
1308 // For multi-sim phones, this distinguishes between the sim cards.
1309 optional int32 sim_slot_index = 2;
1310 // Used to identify the connection. Starts at 0 and increments by 1 for
1311 // every new network created. Resets whenever the device reboots.
1312 optional int32 data_connection_id = 3;
1313 // A bitmask for the capabilities of this connection.
1314 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1315 // Default value (if we have no information): 0
1316 optional int64 capabilities = 4;
1317 // If this connection has internet.
1318 // This just checks if the DEFAULT bit of capabilities is set.
1319 optional bool has_internet = 5;
1320}
1321
1322/**
1323 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1324 *
1325 * Logged from:
1326 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1327 */
1328message MobileRadioTechnologyChanged {
1329 optional android.telephony.NetworkTypeEnum state = 1;
1330 // For multi-sim phones, this distinguishes between the sim cards.
1331 optional int32 sim_slot_index = 2;
1332}
1333
Andrew Chantb56388b2018-03-22 21:07:33 -07001334/**
1335 * Logs the VID and PID of any connected USB devices.
1336 *
1337 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1338 *
1339 * Logged by Vendor.
1340 */
1341message UsbDeviceAttached {
1342 optional int32 vid = 1;
1343 optional int32 pid = 2;
1344 optional bool has_audio = 3;
1345 optional bool has_hid = 4;
1346 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001347 enum State {
1348 STATE_DISCONNECTED = 0;
1349 STATE_CONNECTED = 1;
1350 }
1351 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001352 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001353}
1354
Tej Singheee317b2018-03-07 19:28:05 -08001355
Tej Singhdd7bd352018-02-09 19:33:15 -08001356/**
Tej Singh5d991e12018-03-09 19:48:11 -08001357 * Logs when Bluetooth is enabled and disabled.
1358 *
1359 * Logged from:
1360 * services/core/java/com/android/server/BluetoothManagerService.java
1361 */
1362message BluetoothEnabledStateChanged {
1363 repeated AttributionNode attribution_node = 1;
1364 // Whether or not bluetooth is enabled on the device.
1365 enum State {
1366 UNKNOWN = 0;
1367 ENABLED = 1;
1368 DISABLED = 2;
1369 }
1370 optional State state = 2;
1371 // The reason for being enabled/disabled.
1372 // Eg. Airplane mode, crash, application request.
1373 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1374 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001375 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001376}
1377
1378/**
Jack Hed9837c82019-01-09 01:19:13 -08001379 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001380 *
1381 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001382 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1383 *
1384 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001385 */
1386message BluetoothConnectionStateChanged {
1387 // The state of the connection.
1388 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1389 optional android.bluetooth.ConnectionStateEnum state = 1;
1390 // An identifier that can be used to match connect and disconnect events.
1391 // Currently is last two bytes of a hash of a device level ID and
1392 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001393 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
1394 optional int32 OBSOLETE_obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001395 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1396 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001397 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001398 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001399 // An identifier that can be used to match events for this device.
1400 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1401 // Salt: Randomly generated 256 bit value
1402 // Hash algorithm: HMAC-SHA256
1403 // Size: 32 byte
1404 // Default: null or empty if the device identifier is not known
1405 optional bytes obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1406}
1407
1408/**
1409 * Logs when a Bluetooth device connects and disconnects over ACL
1410 *
1411 * Logged from:
1412 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1413 *
1414 * Next Tag: 3
1415 */
1416message BluetoothAclConnectionStateChanged {
1417 // An identifier that can be used to match events for this device.
1418 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1419 // Salt: Randomly generated 256 bit value
1420 // Hash algorithm: HMAC-SHA256
1421 // Size: 32 byte
1422 // Default: null or empty if the device identifier is not known
1423 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1424 // The state of the connection.
1425 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1426 optional android.bluetooth.ConnectionStateEnum state = 2;
1427}
1428
1429/**
1430 * Logs when a Bluetooth device connects and disconnects over SCO
1431 *
1432 * Logged from:
1433 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1434 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1435 *
1436 * Next Tag: 4
1437 */
1438message BluetoothScoConnectionStateChanged {
1439 // An identifier that can be used to match events for this device.
1440 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1441 // Salt: Randomly generated 256 bit value
1442 // Hash algorithm: HMAC-SHA256
1443 // Size: 32 byte
1444 // Default: null or empty if the device identifier is not known
1445 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1446 // The state of the connection.
1447 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1448 optional android.bluetooth.ConnectionStateEnum state = 2;
1449 // Codec used for this SCO connection
1450 // Default: UNKNOWN
1451 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001452}
1453
Jack Hec27040a2019-01-09 20:54:41 -08001454/**
1455 * Logged when active device of a profile changes
1456 *
1457 * Logged from:
1458 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1459 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1460 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1461 */
1462message BluetoothActiveDeviceChanged {
1463 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1464 // From android.bluetooth.BluetoothProfile
1465 optional int32 bt_profile = 1;
1466 // An identifier that can be used to match events for this new active device.
1467 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1468 // Salt: Randomly generated 256 bit value
1469 // Hash algorithm: HMAC-SHA256
1470 // Size: 32 byte
1471 // Default: null or empty if there is no active device for this profile
1472 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1473}
1474
Jack Heab86dbd22018-12-18 15:43:27 -08001475// Logs when there is an event affecting Bluetooth device's link layer connection.
1476// - This event is triggered when there is a related HCI command or event
1477// - Users of this metrics can deduce Bluetooth device's connection state from these events
1478// - HCI commands are logged before the command is sent, after receiving command status, and after
1479// receiving command complete
1480// - HCI events are logged when they arrive
1481//
1482// Low level log from system/bt
1483//
1484// Bluetooth classic commands:
1485// - CMD_CREATE_CONNECTION
1486// - CMD_DISCONNECT
1487// - CMD_CREATE_CONNECTION_CANCEL
1488// - CMD_ACCEPT_CONNECTION_REQUEST
1489// - CMD_REJECT_CONNECTION_REQUEST
1490// - CMD_SETUP_ESCO_CONNECTION
1491// - CMD_ACCEPT_ESCO_CONNECTION
1492// - CMD_REJECT_ESCO_CONNECTION
1493// - CMD_ENH_SETUP_ESCO_CONNECTION
1494// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1495//
1496// Bluetooth low energy commands:
1497// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1498// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1499// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1500// - CMD_BLE_CLEAR_WHITE_LIST
1501// - CMD_BLE_ADD_WHITE_LIST
1502// - CMD_BLE_REMOVE_WHITE_LIST
1503//
1504// Bluetooth classic events:
1505// - EVT_CONNECTION_COMP
1506// - EVT_CONNECTION_REQUEST
1507// - EVT_DISCONNECTION_COMP
1508// - EVT_ESCO_CONNECTION_COMP
1509// - EVT_ESCO_CONNECTION_CHANGED
1510//
1511// Bluetooth low energy meta events:
1512// - BLE_EVT_CONN_COMPLETE_EVT
1513// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1514//
1515// Next tag: 10
1516message BluetoothLinkLayerConnectionEvent {
1517 // An identifier that can be used to match events for this device.
1518 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1519 // Salt: Randomly generated 256 bit value
1520 // Hash algorithm: HMAC-SHA256
1521 // Size: 32 byte
1522 // Default: null or empty if the device identifier is not known
1523 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1524 // Connection handle of this connection if available
1525 // Range: 0x0000 - 0x0EFF (12 bits)
1526 // Default: 0xFFFF if the handle is unknown
1527 optional int32 connection_handle = 2;
1528 // Direction of the link
1529 // Default: DIRECTION_UNKNOWN
1530 optional android.bluetooth.DirectionEnum direction = 3;
1531 // Type of this link
1532 // Default: LINK_TYPE_UNKNOWN
1533 optional android.bluetooth.LinkTypeEnum type = 4;
1534
1535 // Reason metadata for this link layer connection event, rules for interpretation:
1536 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1537 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1538 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1539 // set and valid, ignore hci_ble_event
1540
1541 // HCI command associated with this event
1542 // Default: CMD_UNKNOWN
1543 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1544 // HCI event associated with this event
1545 // Default: EVT_UNKNOWN
1546 optional android.bluetooth.hci.EventEnum hci_event = 6;
1547 // HCI BLE meta event associated with this event
1548 // Default: BLE_EVT_UNKNOWN
1549 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1550 // HCI command status code if this is triggerred by hci_cmd
1551 // Default: STATUS_UNKNOWN
1552 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1553 // HCI reason code associated with this event
1554 // Default: STATUS_UNKNOWN
1555 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1556}
1557
Howard Roe103fe22019-01-17 16:52:16 -08001558/**
1559 * Logs when a module is rolled back by Watchdog.
1560 *
1561 * Logged from: Rollback Manager
1562 */
1563message WatchdogRollbackOccurred {
1564 enum RollbackType {
1565 UNKNOWN = 0;
1566 ROLLBACK_INITIATE = 1;
1567 ROLLBACK_SUCCESS = 2;
1568 ROLLBACK_FAILURE = 3;
1569 }
1570 optional RollbackType rollback_type = 1;
1571
1572 optional string package_name = 2;
1573
1574 optional int32 package_version_code = 3;
1575}
1576
Jack Hec27040a2019-01-09 20:54:41 -08001577/**
1578 * Logs when there is a change in Bluetooth A2DP playback state
1579 *
1580 * Logged from:
1581 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1582 */
1583message BluetoothA2dpPlaybackStateChanged {
1584 // An identifier that can be used to match events for this device.
1585 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1586 // Salt: Randomly generated 256 bit value
1587 // Hash algorithm: HMAC-SHA256
1588 // Size: 32 byte
1589 // Default: null or empty if the device identifier is not known
1590 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1591 // Current playback state
1592 // Default: PLAYBACK_STATE_UNKNOWN
1593 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1594 // Current audio coding mode
1595 // Default: AUDIO_CODING_MODE_UNKNOWN
1596 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1597}
1598
1599/**
1600 * Logs when there is a change in A2DP codec config for a particular remote device
1601 *
1602 * Logged from:
1603 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1604 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1605 */
1606message BluetoothA2dpCodecConfigChanged {
1607 // An identifier that can be used to match events for this device.
1608 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1609 // Salt: Randomly generated 256 bit value
1610 // Hash algorithm: HMAC-SHA256
1611 // Size: 32 byte
1612 // Default: null or empty if the device identifier is not known
1613 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1614 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1615 // Default SOURCE_CODEC_TYPE_INVALID
1616 optional int32 codec_type = 2;
1617 // Codec priroity, the higher the more preferred, -1 for disabled
1618 // Default: CODEC_PRIORITY_DEFAULT
1619 optional int32 codec_priority = 3;
1620 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1621 // Default: SAMPLE_RATE_NONE
1622 optional int32 sample_rate = 4;
1623 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1624 // Default: BITS_PER_SAMPLE_NONE
1625 optional int32 bits_per_sample = 5;
1626 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1627 // Default: CHANNEL_MODE_NONE
1628 optional int32 channel_mode = 6;
1629 // Codec specific values
1630 // Default 0
1631 optional int64 codec_specific_1 = 7;
1632 optional int64 codec_specific_2 = 8;
1633 optional int64 codec_specific_3 = 9;
1634 optional int64 codec_specific_4 = 10;
1635}
1636
1637/**
1638 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1639 * Each codec's capability is logged separately due to statsd restriction
1640 *
1641 * Logged from:
1642 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1643 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1644 */
1645message BluetoothA2dpCodecCapabilityChanged {
1646 // An identifier that can be used to match events for this device.
1647 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1648 // Salt: Randomly generated 256 bit value
1649 // Hash algorithm: HMAC-SHA256
1650 // Size: 32 byte
1651 // Default: null or empty if the device identifier is not known
1652 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1653 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1654 // Default SOURCE_CODEC_TYPE_INVALID
1655 optional int32 codec_type = 2;
1656 // Codec priroity, the higher the more preferred, -1 for disabled
1657 // Default: CODEC_PRIORITY_DEFAULT
1658 optional int32 codec_priority = 3;
1659 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1660 // in BluetoothCodecConfig
1661 // Default: empty and SAMPLE_RATE_NONE for individual item
1662 optional int32 sample_rate = 4;
1663 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1664 // in BluetoothCodecConfig
1665 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1666 optional int32 bits_per_sample = 5;
1667 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1668 // BluetoothCodecConfig
1669 // Default: empty and CHANNEL_MODE_NONE for individual item
1670 optional int32 channel_mode = 6;
1671 // Codec specific values
1672 // Default 0
1673 optional int64 codec_specific_1 = 7;
1674 optional int64 codec_specific_2 = 8;
1675 optional int64 codec_specific_3 = 9;
1676 optional int64 codec_specific_4 = 10;
1677}
1678
1679/**
1680 * Logs when A2DP failed to read from PCM source.
1681 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1682 *
1683 * Logged from:
1684 * system/bt
1685 */
1686message BluetoothA2dpAudioUnderrunReported {
1687 // An identifier that can be used to match events for this device.
1688 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1689 // Salt: Randomly generated 256 bit value
1690 // Hash algorithm: HMAC-SHA256
1691 // Size: 32 byte
1692 // Default: null or empty if the device identifier is not known
1693 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1694 // Encoding interval in nanoseconds
1695 // Default: 0
1696 optional int64 encoding_interval_nanos = 2;
1697 // Number of bytes of PCM data that could not be read from the source
1698 // Default: 0
1699 optional int32 num_missing_pcm_bytes = 3;
1700}
1701
1702/**
1703 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1704 * buffer queue is full and we have to drop data
1705 *
1706 * Logged from:
1707 * system/bt
1708 */
1709message BluetoothA2dpAudioOverrunReported {
1710 // An identifier that can be used to match events for this device.
1711 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1712 // Salt: Randomly generated 256 bit value
1713 // Hash algorithm: HMAC-SHA256
1714 // Size: 32 byte
1715 // Default: null or empty if the device identifier is not known
1716 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1717 // Encoding interval in nanoseconds
1718 // Default: 0
1719 optional int64 encoding_interval_nanos = 2;
1720 // Number of buffers dropped in this event
1721 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1722 // Default: 0
1723 optional int32 num_dropped_buffers = 3;
1724 // Number of encoded buffers dropped in this event
1725 // Default 0
1726 optional int32 num_dropped_encoded_frames = 4;
1727 // Number of encoded bytes dropped in this event
1728 // Default: 0
1729 optional int32 num_dropped_encoded_bytes = 5;
1730}
1731
1732/**
1733 * Logs when we receive reports regarding a device's RSSI value
1734 *
1735 * Logged from:
1736 * system/bt
1737 */
1738message BluetoothDeviceRssiReported {
1739 // An identifier that can be used to match events for this device.
1740 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1741 // Salt: Randomly generated 256 bit value
1742 // Hash algorithm: HMAC-SHA256
1743 // Size: 32 byte
1744 // Default: null or empty if the device identifier is not known
1745 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1746 // Connection handle of this connection if available
1747 // Range: 0x0000 - 0x0EFF (12 bits)
1748 // Default: 0xFFFF if the handle is unknown
1749 optional int32 connection_handle = 2;
1750 // HCI command status code if this is triggerred by hci_cmd
1751 // Default: STATUS_UNKNOWN
1752 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1753 // BR/EDR
1754 // Range: -128 ≤ N ≤ 127 (signed integer)
1755 // Units: dB
1756 // LE:
1757 // Range: -127 to 20, 127 (signed integer)
1758 // Units: dBm
1759 // Invalid when an out of range value is reported
1760 optional int32 rssi = 4;
1761}
1762
1763/**
1764 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1765 *
1766 * Logged from:
1767 * system/bt
1768 */
1769message BluetoothDeviceFailedContactCounterReported {
1770 // An identifier that can be used to match events for this device.
1771 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1772 // Salt: Randomly generated 256 bit value
1773 // Hash algorithm: HMAC-SHA256
1774 // Size: 32 byte
1775 // Default: null or empty if the device identifier is not known
1776 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1777 // Connection handle of this connection if available
1778 // Range: 0x0000 - 0x0EFF (12 bits)
1779 // Default: 0xFFFF if the handle is unknown
1780 optional int32 connection_handle = 2;
1781 // HCI command status code if this is triggerred by hci_cmd
1782 // Default: STATUS_UNKNOWN
1783 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1784 // Number of consecutive failed contacts for a connection corresponding to the Handle
1785 // Range: uint16_t, 0-0xFFFF
1786 // Default: 0xFFFFF
1787 optional int32 failed_contact_counter = 4;
1788}
1789
1790/**
1791 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1792 *
1793 * Logged from:
1794 * system/bt
1795 */
1796message BluetoothDeviceTxPowerLevelReported {
1797 // An identifier that can be used to match events for this device.
1798 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1799 // Salt: Randomly generated 256 bit value
1800 // Hash algorithm: HMAC-SHA256
1801 // Size: 32 byte
1802 // Default: null or empty if the device identifier is not known
1803 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1804 // Connection handle of this connection if available
1805 // Range: 0x0000 - 0x0EFF (12 bits)
1806 // Default: 0xFFFF if the handle is unknown
1807 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001808 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001809 // Default: STATUS_UNKNOWN
1810 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1811 // Range: -30 ≤ N ≤ 20
1812 // Units: dBm
1813 // Invalid when an out of range value is reported
1814 optional int32 transmit_power_level = 4;
1815}
Jack Heab86dbd22018-12-18 15:43:27 -08001816
Tej Singh5d991e12018-03-09 19:48:11 -08001817/**
Jack He1021a612019-01-20 21:22:46 -08001818 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1819 * receiving an HCI command from the host
1820 *
1821 * Logged from: system/bt
1822 */
1823message BluetoothHciTimeoutReported {
1824 // HCI command associated with this event
1825 // Default: CMD_UNKNOWN
1826 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1827}
1828
1829/**
1830 * Logs when we receive Bluetooth Link Quality Report event from the controller
1831 * See Android Bluetooth HCI specification for more details
1832 *
1833 * Note: all count and bytes field are counted since last event
1834 *
1835 * Logged from: system/bt
1836 */
1837message BluetoothQualityReportReported {
1838 // Quality report ID
1839 // Original type: uint8_t
1840 // Default: BQR_ID_UNKNOWN
1841 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1842 // Packet type of the connection
1843 // Original type: uint8_t
1844 // Default: BQR_PACKET_TYPE_UNKNOWN
1845 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1846 // Connection handle of the connection
1847 // Original type: uint16_t
1848 optional int32 connection_handle = 3;
1849 // Performing Role for the connection
1850 // Original type: uint8_t
1851 optional int32 connection_role = 4;
1852 // Current Transmit Power Level for the connection. This value is the same as the controller's
1853 // response to the HCI_Read_Transmit_Power_Level HCI command
1854 // Original type: uint8_t
1855 optional int32 tx_power_level = 5;
1856 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1857 // absolute receiver signal strength value
1858 // Original type: int8_t
1859 optional int32 rssi = 6;
1860 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1861 // channels used by the link currently
1862 // Original type: uint8_t
1863 optional int32 snr = 7;
1864 // Indicates the number of unused channels in AFH_channel_map
1865 // Original type: uint8_t
1866 optional int32 unused_afh_channel_count = 8;
1867 // Indicates the number of the channels which are interfered and quality is bad but are still
1868 // selected for AFH
1869 // Original type: uint8_t
1870 optional int32 afh_select_unideal_channel_count = 9;
1871 // Current Link Supervision Timeout Setting
1872 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1873 // Original type: uint16_t
1874 optional int32 lsto = 10;
1875 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1876 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1877 // 0x01 (Piconet Clock)
1878 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1879 // Original type: uint32_t
1880 optional int64 connection_piconet_clock = 11;
1881 // The count of retransmission
1882 // Original type: uint32_t
1883 optional int64 retransmission_count = 12;
1884 // The count of no RX
1885 // Original type: uint32_t
1886 optional int64 no_rx_count = 13;
1887 // The count of NAK (Negative Acknowledge)
1888 // Original type: uint32_t
1889 optional int64 nak_count = 14;
1890 // Controller timestamp of last TX ACK
1891 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1892 // Original type: uint32_t
1893 optional int64 last_tx_ack_timestamp = 15;
1894 // The count of Flow-off (STOP)
1895 // Original type: uint32_t
1896 optional int64 flow_off_count = 16;
1897 // Controller timestamp of last Flow-on (GO)
1898 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1899 // Original type: uint32_t
1900 optional int64 last_flow_on_timestamp = 17;
1901 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
1902 // Original type: uint32_t
1903 optional int64 buffer_overflow_bytes = 18;
1904 // Buffer underflow count (in byte) since last event
1905 // Original type: uint32_t
1906 optional int64 buffer_underflow_bytes = 19;
1907}
1908
1909/**
1910 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
1911 *
1912 * Notes:
1913 * - Each event can be partially filled as we might learn different pieces of device
1914 * information at different time
1915 * - Multiple device info events can be combined to give more complete picture
1916 * - When multiple device info events tries to describe the same information, the
1917 * later one wins
1918 *
1919 * Logged from:
1920 * packages/apps/Bluetooth
1921 */
1922message BluetoothManufacturerInfoReported {
1923 // An identifier that can be used to match events for this device.
1924 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1925 // Salt: Randomly generated 256 bit value
1926 // Hash algorithm: HMAC-SHA256
1927 // Size: 32 byte
1928 // Default: null or empty if the device identifier is not known
1929 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1930 // Where is this device info obtained from
1931 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
1932 // Name of the data source
1933 // For EXTERNAL: package name of the data source
1934 // For INTERNAL: null for general case, component name otherwise
1935 optional string source_name = 3;
1936 // Name of the manufacturer of this device
1937 optional string manufacturer = 4;
1938 // Model of this device
1939 optional string model = 5;
1940 // Hardware version of this device
1941 optional string hardware_version = 6;
1942 // Software version of this device
1943 optional string software_version = 7;
1944}
1945
1946/**
1947 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
1948 * device, as documented by the Bluetooth Core HCI specification
1949 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
1950 * Vol 2, Part E, Page 1118
1951 *
1952 * Logged from:
1953 * system/bt
1954 */
1955message BluetoothRemoteVersionInfoReported {
1956 // Connection handle of the connection
1957 // Original type: uint16_t
1958 optional int32 connection_handle = 1;
1959 // HCI command status code
1960 // Default: STATUS_UNKNOWN
1961 optional android.bluetooth.hci.StatusEnum hci_status = 2;
1962 // 1 byte Version of current LMP in the remote controller
1963 optional int32 lmp_version = 3;
1964 // 2 bytes LMP manufacturer code of the remote controller
1965 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
1966 optional int32 lmp_manufacturer_code = 4;
1967 // 4 bytes subversion of the LMP in the remote controller
1968 optional int32 lmp_subversion = 5;
1969}
1970
1971/**
1972 * Logs when certain Bluetooth SDP attributes are discovered
1973 * Constant definitions are from:
1974 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
1975 *
1976 * Current logged attributes:
1977 * - BluetoothProfileDescriptorList
1978 * - Supported Features Bitmask
1979 *
1980 * Logged from:
1981 * system/bt
1982 */
1983message BluetoothSdpAttributeReported {
1984 // An identifier that can be used to match events for this device.
1985 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1986 // Salt: Randomly generated 256 bit value
1987 // Hash algorithm: HMAC-SHA256
1988 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1989 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
1990 // Original type: uint16_t
1991 optional int32 protocol_uuid = 2;
1992 // Short form UUIDs used to identify Bluetooth SDP attribute types
1993 // Original type: uint16_t
1994 optional int32 attribute_id = 3;
1995 // Attribute value for the particular attribute
1996 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
1997}
1998
1999/**
2000 * Logs when bond state of a Bluetooth device changes
2001 *
2002 * Logged from:
2003 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2004 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2005 */
2006message BluetoothBondStateChanged {
2007 // An identifier that can be used to match events for this device.
2008 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2009 // Salt: Randomly generated 256 bit value
2010 // Hash algorithm: HMAC-SHA256
2011 // Size: 32 byte
2012 // Default: null or empty if the device identifier is not known
2013 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2014 // Preferred transport type to remote dual mode device
2015 // Default: TRANSPORT_AUTO means no preference
2016 optional android.bluetooth.TransportTypeEnum transport = 2;
2017 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2018 // Default: UNKNOWN
2019 optional android.bluetooth.DeviceTypeEnum type = 3;
2020 // Current bond state (NONE, BONDING, BONDED)
2021 // Default: BOND_STATE_UNKNOWN
2022 optional android.bluetooth.BondStateEnum bond_state = 4;
2023 // Bonding sub state
2024 // Default: BOND_SUB_STATE_UNKNOWN
2025 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2026 // Unbond Reason
2027 // Default: UNBOND_REASON_UNKNOWN
2028 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2029}
2030
2031/**
2032 * Logs there is an event related Bluetooth classic pairing
2033 *
2034 * Logged from:
2035 * system/bt
2036 */
2037message BluetoothClassicPairingEventReported {
2038 // An identifier that can be used to match events for this device.
2039 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2040 // Salt: Randomly generated 256 bit value
2041 // Hash algorithm: HMAC-SHA256
2042 // Size: 32 byte
2043 // Default: null or empty if the device identifier is not known
2044 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2045 // Connection handle of this connection if available
2046 // Range: 0x0000 - 0x0EFF (12 bits)
2047 // Default: 0xFFFF if the handle is unknown
2048 optional int32 connection_handle = 2;
2049 // HCI command associated with this event
2050 // Default: CMD_UNKNOWN
2051 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2052 // HCI event associated with this event
2053 // Default: EVT_UNKNOWN
2054 optional android.bluetooth.hci.EventEnum hci_event = 4;
2055 // HCI command status code if this is triggerred by hci_cmd
2056 // Default: STATUS_UNKNOWN
2057 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2058 // HCI reason code associated with this event
2059 // Default: STATUS_UNKNOWN
2060 optional android.bluetooth.hci.StatusEnum reason_code = 6;
2061}
2062
2063/**
2064 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2065 *
2066 * Logged from:
2067 * system/bt
2068 */
2069message BluetoothSmpPairingEventReported {
2070 // An identifier that can be used to match events for this device.
2071 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2072 // Salt: Randomly generated 256 bit value
2073 // Hash algorithm: HMAC-SHA256
2074 // Size: 32 byte
2075 // Default: null or empty if the device identifier is not known
2076 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2077 // SMP command sent or received over L2CAP
2078 // Default: CMD_UNKNOWN
2079 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2080 // Whether this command is sent or received
2081 // Default: DIRECTION_UNKNOWN
2082 optional android.bluetooth.DirectionEnum direction = 3;
2083 // SMP failure reason code
2084 // Default: PAIRING_FAIL_REASON_DEFAULT
2085 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2086}
2087
2088/**
Jack He815cdba2019-01-30 17:24:55 -08002089 * Logs when a Bluetooth socket’s connection state changed
2090 *
2091 * Logged from:
2092 * system/bt
2093 */
2094message BluetoothSocketConnectionStateChanged {
2095 // An identifier that can be used to match events for this device.
2096 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2097 // Salt: Randomly generated 256 bit value
2098 // Hash algorithm: HMAC-SHA256
2099 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002100 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002101 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002102 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002103 // Default 0 when unknown or don't care
2104 optional int32 port = 2;
2105 // Socket type as mentioned in
2106 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2107 // Default: SOCKET_TYPE_UNKNOWN
2108 optional android.bluetooth.SocketTypeEnum type = 3;
2109 // Socket connection state
2110 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2111 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2112 // Number of bytes sent to remote device during this connection
2113 optional int64 tx_bytes = 5;
2114 // Number of bytes received from remote device during this connection
2115 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002116 // Socket owner's UID
2117 optional int32 uid = 7 [(is_uid) = true];
2118 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2119 // |port| must be spawned by |server_port|
2120 // Default 0 when unknown or don't care
2121 optional int32 server_port = 8;
2122 // Whether this is a server listener socket
2123 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002124}
2125
2126/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002127 * Logs when something is plugged into or removed from the USB-C connector.
2128 *
2129 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002130 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002131 */
2132message UsbConnectorStateChanged {
2133 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002134 STATE_DISCONNECTED = 0;
2135 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002136 }
2137 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002138 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002139 // Last active session in ms.
2140 // 0 when the port is in connected state.
2141 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002142}
2143
2144/**
2145 * Logs the reported speaker impedance.
2146 *
2147 * Logged from:
2148 * Vendor audio implementation.
2149 */
2150message SpeakerImpedanceReported {
2151 optional int32 speaker_location = 1;
2152 optional int32 impedance = 2;
2153}
2154
2155/**
2156 * Logs the report of a failed hardware.
2157 *
2158 * Logged from:
2159 * Vendor HALs.
2160 *
2161 */
2162message HardwareFailed {
2163 enum HardwareType {
2164 HARDWARE_FAILED_UNKNOWN = 0;
2165 HARDWARE_FAILED_MICROPHONE = 1;
2166 HARDWARE_FAILED_CODEC = 2;
2167 HARDWARE_FAILED_SPEAKER = 3;
2168 HARDWARE_FAILED_FINGERPRINT = 4;
2169 }
2170 optional HardwareType hardware_type = 1;
2171
Maggie White6dcd8572019-01-31 14:11:50 -08002172 /**
2173 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002174 * the same hardware_type. The specific locations are vendor defined integers,
2175 * referring to board-specific numbering schemes.
2176 */
2177 optional int32 hardware_location = 2;
2178
Maggie White6dcd8572019-01-31 14:11:50 -08002179 /**
2180 * failure_code is specific to the HardwareType of the failed hardware.
2181 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002182 */
Maggie White6dcd8572019-01-31 14:11:50 -08002183 enum HardwareErrorCode {
2184 UNKNOWN = 0;
2185 COMPLETE = 1;
2186 SPEAKER_HIGH_Z = 2;
2187 SPEAKER_SHORT = 3;
2188 FINGERPRINT_SENSOR_BROKEN = 4;
2189 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002190 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002191 }
2192 optional int32 failure_code = 3;
2193}
2194
2195/**
2196 * Log an event when the device has been physically dropped.
2197 * Reported from the /vendor partition.
2198 */
2199message PhysicalDropDetected {
2200 // Confidence that the event was actually a drop, 0 -> 100
2201 optional int32 confidence_pctg = 1;
2202 // Peak acceleration of the drop, in 1/1000s of a g.
2203 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002204 // Duration of freefall in ms
2205 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002206}
2207
2208/**
2209 * Log bucketed battery charge cycles.
2210 *
2211 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002212 * a given charge point. For example, if 10 cycle buckets are
2213 * initialized, bucket 1 is the lowest 1/10th of the battery,
2214 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002215 *
2216 * Logged from:
2217 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2218 */
2219message ChargeCyclesReported {
2220 optional int32 cycle_bucket_1 = 1;
2221 optional int32 cycle_bucket_2 = 2;
2222 optional int32 cycle_bucket_3 = 3;
2223 optional int32 cycle_bucket_4 = 4;
2224 optional int32 cycle_bucket_5 = 5;
2225 optional int32 cycle_bucket_6 = 6;
2226 optional int32 cycle_bucket_7 = 7;
2227 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002228 optional int32 cycle_bucket_9 = 9;
2229 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002230}
2231
2232/**
Howard Roa46b6582018-09-18 16:45:02 -07002233 * Log battery health snapshot.
2234 *
2235 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2236 * are snapshotted periodically over 24hrs.
2237 */
2238message BatteryHealthSnapshot {
2239 enum BatterySnapshotType {
2240 UNKNOWN = 0;
2241 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2242 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2243 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2244 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2245 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2246 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2247 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2248 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2249 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2250 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2251 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2252 }
2253 optional BatterySnapshotType type = 1;
2254 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002255 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002256 // Voltage Battery Voltage, in microVolts.
2257 optional int32 voltage_micro_volt = 3;
2258 // Current Battery current, in microAmps.
2259 optional int32 current_micro_amps = 4;
2260 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2261 optional int32 open_circuit_micro_volt = 5;
2262 // Resistance Battery Resistance, in microOhms.
2263 optional int32 resistance_micro_ohm = 6;
2264 // Level Battery Level, as % of full.
2265 optional int32 level_percent = 7;
2266}
2267
2268/**
2269 * Log slow I/O operations on the primary storage.
2270 */
2271message SlowIo {
2272 // Classifications of IO Operations.
2273 enum IoOperation {
2274 UNKNOWN = 0;
2275 READ = 1;
2276 WRITE = 2;
2277 UNMAP = 3;
2278 SYNC = 4;
2279 }
2280 optional IoOperation operation = 1;
2281
2282 // The number of slow IO operations of this type over 24 hours.
2283 optional int32 count = 2;
2284}
2285
2286/**
2287 * Log battery caused shutdown with the last recorded voltage.
2288 */
2289message BatteryCausedShutdown {
2290 // The last recorded battery voltage prior to shutdown.
2291 optional int32 last_recorded_micro_volt = 1;
2292}
2293
2294/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002295 * Logs the duration of a davey (jank of >=700ms) when it occurs
2296 *
2297 * Logged from:
2298 * frameworks/base/libs/hwui/JankTracker.cpp
2299 */
2300message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002301 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002302 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002303
Tej Singhbb8554a2018-01-26 11:59:14 -08002304 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002305 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002306}
2307
2308/**
Bookatze5885242017-10-24 20:10:31 -07002309 * Logs phone signal strength changes.
2310 *
2311 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002312 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002313 */
2314message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002315 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2316 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002317}
2318
Yangster4ccebea2018-10-09 17:09:02 -07002319
2320/**
2321 * Logs when the phone state, sim state or signal strength changes
2322 *
2323 * Logged from:
2324 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2325 */
2326message PhoneServiceStateChanged {
2327 optional android.telephony.ServiceStateEnum state = 1;
2328 optional android.telephony.SimStateEnum sim_state = 2;
2329 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2330}
2331
2332/**
2333 * Logs when the phone becomes on or off.
2334 *
2335 * Logged from:
2336 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2337 */
2338message PhoneStateChanged {
2339 enum State {
2340 OFF = 0;
2341 ON = 1;
2342 }
2343 optional State state = 1;
2344}
2345
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002346message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002347 optional android.stats.launcher.LauncherAction action = 1;
2348 optional android.stats.launcher.LauncherState src_state = 2;
2349 optional android.stats.launcher.LauncherState dst_state = 3;
2350 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002351 optional bool is_swipe_up_enabled = 5;
2352}
2353
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002354message StyleUIChanged {
2355 optional android.stats.style.Action action = 1;
2356 optional int32 color_package_hash = 2;
2357 optional int32 font_package_hash = 3;
2358 optional int32 shape_package_hash = 4;
2359 optional int32 clock_package_hash = 5;
2360 optional int32 launcher_grid = 6;
2361 optional int32 wallpaper_category_hash = 7;
2362 optional int32 wallpaper_id_hash = 8;
2363}
2364
David Chenc28b2bb2017-10-24 12:52:52 -07002365/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002366 * Logs when Settings UI has changed.
2367 *
2368 * Logged from:
2369 * packages/apps/Settings
2370 */
2371message SettingsUIChanged {
2372 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002373 * Where this SettingsUIChange event comes from. For example, if
2374 * it's a PAGE_VISIBLE event, where the page is opened from.
2375 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002376 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002377
2378 /**
2379 * What the UI action is.
2380 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002381 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002382
2383 /**
2384 * Where the action is happening
2385 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002386 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002387
2388 /**
2389 * What preference changed in this event.
2390 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002391 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002392
2393 /**
2394 * The new value of the changed preference.
2395 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002396 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002397}
2398
2399/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002400 * Logs basic timing information about touch events.
2401 * Reported at most every 5 minutes while device is being interacted with.
2402 *
2403 * Logged from:
2404 * frameworks/native/services/inputflinger
2405 */
2406message TouchEventReported {
2407 /**
2408 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2409 * and the standard deviation of latency between the kernel and framework
2410 * for touchscreen events. The units are microseconds.
2411 *
2412 * The number is measured as the difference between the time at which
2413 * the input event was received in the evdev driver,
2414 * and the time at which the input event was received in EventHub.
2415 */
2416 // Minimum value
2417 optional float latency_min_micros = 1;
2418 // Maximum value
2419 optional float latency_max_micros = 2;
2420 // Average value
2421 optional float latency_mean_micros = 3;
2422 // Standard deviation
2423 optional float latency_stdev_micros = 4;
2424}
2425
2426/**
Philip Quinn0eded622019-01-29 12:46:28 -08002427 * Logs gesture classification and timing information for touch events.
2428 *
2429 * Logged from:
2430 * frameworks/base/core/java/android/view/GestureDetector.java
2431 * frameworks/base/core/java/android/view/View.java
2432 */
2433message TouchGestureClassified {
2434 // The source of the classification (e.g. Java class name).
2435 optional string source = 1;
2436
2437 enum Classification {
2438 UNKNOWN_CLASSIFICATION = 0;
2439 SINGLE_TAP = 1;
2440 DOUBLE_TAP = 2;
2441 LONG_PRESS = 3;
2442 DEEP_PRESS = 4;
2443 SCROLL = 5;
2444 }
2445 // The classification of the gesture.
2446 optional Classification classification = 2;
2447
2448 // The interval from the start of a touch event stream until the
2449 // classification was made.
2450 optional int32 latency_millis = 3;
2451
2452 // The distance from the location of the first touch event to the
2453 // location of the touch event when the classification was made.
2454 optional float displacement_px = 4;
2455}
2456
2457/**
David Chenc28b2bb2017-10-24 12:52:52 -07002458 * Logs that a setting was updated.
2459 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002460 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002461 * The tag and is_default allow resetting of settings to default values based on the specified
2462 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2463 */
2464message SettingChanged {
2465 // The name of the setting.
2466 optional string setting = 1;
2467
2468 // The change being imposed on this setting. May represent a number, eg "3".
2469 optional string value = 2;
2470
2471 // The new value of this setting. For most settings, this is same as value. For some settings,
2472 // value is +X or -X where X represents an element in a set. For example, if the previous value
2473 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2474 // The +/- feature is currently only used for location_providers_allowed.
2475 optional string new_value = 3;
2476
2477 // The previous value of this setting.
2478 optional string prev_value = 4;
2479
2480 // The tag used with the is_default for resetting sets of settings. This is generally null.
2481 optional string tag = 5;
2482
Bookatz90867622018-01-31 15:05:57 -08002483 // True if this setting with tag should be resettable.
2484 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002485
David Chenbd789912018-03-16 17:19:55 -07002486 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002487 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002488
2489 enum ChangeReason {
2490 UPDATED = 1; // Updated can be an insertion or an update.
2491 DELETED = 2;
2492 }
2493 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002494}
Chenjie Yub3dda412017-10-24 13:41:59 -07002495
Chenjie Yu05013b32017-11-21 10:21:41 -08002496/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002497 * Logs activity going to foreground or background
2498 *
2499 * Logged from:
2500 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2501 */
2502message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002503 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002504 optional string pkg_name = 2;
2505 optional string class_name = 3;
2506
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002507 enum State {
2508 BACKGROUND = 0;
2509 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002510 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002511 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002512}
David Chenc8a43242017-10-17 16:23:28 -07002513
2514/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002515 * Logs when a volume entered low Storage state.
2516 * Logged from:
2517 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2518 */
2519message LowStorageStateChanged {
2520 // Volume that ran out of storage.
2521 optional string volume_description = 1;
2522
2523 enum State {
2524 UNKNOWN = 0;
2525 OFF = 1;
2526 ON = 2;
2527 }
2528 optional State state = 2;
2529}
2530
2531/**
2532 * Logs when an app is downgraded.
2533 * Logged from:
2534 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2535 */
2536message AppDowngraded {
2537 optional string package_name = 1;
2538 // Size of the package (all data) before being downgraded.
2539 optional int64 size_in_bytes_before = 2;
2540 // Size of the package (all data) after being downgraded.
2541 optional int64 size_in_bytes_after = 3;
2542
2543 optional bool aggressive = 4;
2544}
2545
2546/**
2547 * Logs when an app is optimized after being downgraded.
2548 * Logged from:
2549 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2550 */
2551message AppOptimizedAfterDowngraded {
2552 optional string package_name = 1;
2553}
2554
2555/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002556 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002557 * Logged from:
2558 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2559 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002560message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002561 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002562
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002563 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002564
2565 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002566 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002567 optional string process_name = 3;
2568
2569 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002570 optional sint32 pid = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002571
2572 optional string package_name = 5;
2573
2574 enum InstantApp {
2575 UNAVAILABLE = 0;
2576 FALSE = 1;
2577 TRUE = 2;
2578 }
2579 optional InstantApp is_instant_app = 6;
2580
2581 enum ForegroundState {
2582 UNKNOWN = 0;
2583 BACKGROUND = 1;
2584 FOREGROUND = 2;
2585 }
2586 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002587
2588 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002589}
David Chen9e3808c2017-11-20 17:25:34 -08002590
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002591/**
2592 * Logs when a WTF (What a Terrible Failure) happened.
2593 * Logged from:
2594 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2595 */
2596message WTFOccurred {
2597 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002598
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002599 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002600
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002601 // The name of the process.
2602 // system_server if it is not by an app
2603 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002604
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002605 // The pid if available. -1 means not available.
2606 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002607
2608 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002609}
2610
2611/**
2612 * Logs when system server reports low memory.
2613 * Logged from:
2614 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2615 */
2616message LowMemReported {
2617}
2618
2619/**
2620 * Logs when an app ANR (App Not Responding) occurs.
2621 * Logged from:
2622 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2623 */
2624message ANROccurred {
2625 optional int32 uid = 1 [(is_uid) = true];
2626
2627 optional string process_name = 2;
2628
2629 optional string short_component_name = 3;
2630
2631 optional string reason = 4;
Chenjie Yuf17bf622018-04-02 14:22:19 -07002632
2633 enum InstantApp {
2634 UNAVAILABLE = 0;
2635 FALSE = 1;
2636 TRUE = 2;
2637 }
2638 optional InstantApp is_instant_app = 5;
2639
2640 enum ForegroundState {
2641 UNKNOWN = 0;
2642 BACKGROUND = 1;
2643 FOREGROUND = 2;
2644 }
2645 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002646
2647 optional android.server.ErrorSource error_source = 7;
2648
2649 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002650}
2651
Bookatza7020bd2018-08-28 16:29:35 -07002652/**
2653 * Logs when the vibrator state changes.
2654 * Logged from:
2655 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2656 */
2657message VibratorStateChanged {
2658 repeated AttributionNode attribution_node = 1;
2659
2660 enum State {
2661 OFF = 0;
2662 ON = 1;
2663 }
2664 optional State state = 2;
2665
2666 // Duration (in milliseconds) requested to keep the vibrator on.
2667 // Only applicable for State == ON.
2668 optional int64 duration_millis = 3;
2669}
2670
David Chen0a368b22017-12-06 16:28:16 -08002671/*
2672 * Allows other apps to push events into statsd.
2673 * Logged from:
2674 * frameworks/base/core/java/android/util/StatsLog.java
2675 */
David Chen0b5c90c2018-01-25 16:51:49 -08002676message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002677 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002678 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002679
2680 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2681 optional int32 label = 2;
2682
2683 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2684 // predicates for the metrics).
2685 enum State {
2686 UNKNOWN = 0;
2687 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2688 STOP = 2;
2689 START = 3;
2690 }
2691 optional State state = 3;
2692}
2693
David Chen9e3808c2017-11-20 17:25:34 -08002694/**
Bookatz7948c872018-09-04 12:58:33 -07002695 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2696 * For example, this could be due to the user manually changing the time.
2697 *
2698 * Logged from:
2699 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2700 */
2701message WallClockTimeShifted {
2702 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2703 optional int64 wall_clock_timestamp_millis = 1;
2704}
2705
2706/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002707 * Logs when statsd detects an anomaly.
2708 *
2709 * Logged from:
2710 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2711 */
2712message AnomalyDetected {
2713 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002714 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002715
Yangster-mac94e197c2018-01-02 16:03:03 -08002716 // Id of the config whose anomaly detection alert fired.
2717 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002718
Yangster-mac94e197c2018-01-02 16:03:03 -08002719 // Id of the alert (i.e. name of the anomaly that was detected).
2720 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002721}
2722
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002723message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002724 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002725 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002726
2727 // The app package name.
2728 optional string pkg_name = 2;
2729
2730 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002731 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002732 WARM = 1;
2733 HOT = 2;
2734 COLD = 3;
2735 }
2736 // The transition type.
2737 optional TransitionType type = 3;
2738
2739 // The activity name.
2740 optional string activity_name = 4;
2741
2742 // The name of the calling app. Empty if not set.
2743 optional string calling_pkg_name = 5;
2744
2745 // Whether the app is an instant app.
2746 optional bool is_instant_app = 6;
2747
2748 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002749 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002750
Bookatz80d11a02018-01-16 10:46:35 -08002751 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002752
David Chen0b5c90c2018-01-25 16:51:49 -08002753 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002754 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002755 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002756 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002757 optional int32 bind_application_delay_millis = 11;
2758 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002759
2760 // Empty if not set.
2761 optional string launch_token = 13;
2762
Calin Juravle759fbda2018-02-20 19:52:30 +00002763 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002764 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002765
2766 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002767 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002768}
2769
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002770message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002771 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002772 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002773
2774 // The app package name.
2775 optional string pkg_name = 2;
2776
2777 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002778 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002779 WARM = 1;
2780 HOT = 2;
2781 COLD = 3;
2782 }
2783 // The transition type.
2784 optional TransitionType type = 3;
2785
2786 // The activity name.
2787 optional string activity_name = 4;
2788}
2789
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002790message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002791 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002792 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002793
2794 // The app package name.
2795 optional string pkg_name = 2;
2796
2797 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002798 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002799 WITH_BUNDLE = 1;
2800 WITHOUT_BUNDLE = 2;
2801 }
2802 // The transition type.
2803 optional TransitionType type = 3;
2804
2805 // The activity name.
2806 optional string activity_name = 4;
2807
2808 optional bool transition_process_running = 5;
2809
2810 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002811 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002812}
2813
Bookatz8fcd09a2017-12-18 13:01:10 -08002814/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002815 * Logs a picture-in-picture action
2816 * Logged from:
2817 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2818 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2819 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2820 */
2821message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002822 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002823 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002824
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002825 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002826
Chenjie Yu52cacc62017-12-08 18:11:45 -08002827 enum State {
2828 ENTERED = 1;
2829 EXPANDED_TO_FULL_SCREEN = 2;
2830 MINIMIZED = 3;
2831 DISMISSED = 4;
2832 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002833 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002834}
2835
2836/**
Chenjie Yue8904192017-12-08 19:12:57 -08002837 * Logs overlay action
2838 * Logged from:
2839 * services/core/java/com/android/server/wm/Session.java
2840 */
2841message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002842 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08002843
2844 optional string package_name = 2;
2845
2846 optional bool using_alert_window = 3;
2847
2848 enum State {
2849 ENTERED = 1;
2850 EXITED = 2;
2851 }
2852 optional State state = 4;
2853}
2854
Chenjie Yuccfe6452018-01-30 11:33:21 -08002855/*
2856 * Logs foreground service starts and stops.
2857 * Note that this is not when a service starts or stops, but when it is
2858 * considered foreground.
2859 * Logged from
2860 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
2861 */
2862message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002863 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08002864 // package_name + "/" + class_name
2865 optional string short_name = 2;
2866
2867 enum State {
2868 ENTER = 1;
2869 EXIT = 2;
2870 }
2871 optional State state = 3;
2872}
2873
Chenjie Yue8904192017-12-08 19:12:57 -08002874/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08002875 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
2876 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
2877 * attributed back to the parent (host) uid. One example is Chrome.
2878 *
2879 * Logged from:
2880 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2881 */
2882message IsolatedUidChanged {
2883 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002884 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07002885 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08002886 optional int32 parent_uid = 1;
2887
2888 optional int32 isolated_uid = 2;
2889
2890 // We expect an isolated uid to be removed before if it's used for another parent uid.
2891 enum Event {
2892 REMOVED = 0;
2893 CREATED = 1;
2894 }
2895 optional Event event = 3;
2896}
2897
2898/*
2899 * Logs the reception of an incoming network packet causing the main system to wake up for
2900 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
2901 * and processed by WakeupController.cpp.
2902 */
2903message PacketWakeupOccurred {
2904 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
2905 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07002906 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002907 // The interface name on which the packet was received.
2908 optional string iface = 2;
2909 // The ethertype value of the packet.
2910 optional int32 ethertype = 3;
2911 // String representation of the destination MAC address of the packet.
2912 optional string destination_hardware_address = 4;
2913 // String representation of the source address of the packet if this was an IP packet.
2914 optional string source_ip = 5;
2915 // String representation of the destination address of the packet if this was an IP packet.
2916 optional string destination_ip = 6;
2917 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
2918 // field if this was an IPv6 packet. The range of possible values is the same for both IP
2919 // families.
2920 optional int32 ip_next_header = 7;
2921 // The source port if this was a TCP or UDP packet.
2922 optional int32 source_port = 8;
2923 // The destination port if this was a TCP or UDP packet.
2924 optional int32 destination_port = 9;
2925}
2926
2927/*
2928 * Logs the memory stats for an app on startup.
2929 * Logged from:
2930 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2931 */
2932message AppStartMemoryStateCaptured {
2933 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002934 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002935
2936 // The process name.
2937 optional string process_name = 2;
2938
2939 // The activity name.
2940 optional string activity_name = 3;
2941
2942 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002943 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002944
2945 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002946 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002947
2948 // RSS
2949 optional int64 rss_in_bytes = 6;
2950
2951 // CACHE
2952 optional int64 cache_in_bytes = 7;
2953
2954 // SWAP
2955 optional int64 swap_in_bytes = 8;
2956}
2957
2958/*
2959 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
2960 * for LMK event.
2961 * Logged from:
2962 * system/core/lmkd/lmkd.c
2963 */
2964message LmkStateChanged {
2965 enum State {
2966 UNKNOWN = 0;
2967 START = 1;
2968 STOP = 2;
2969 }
2970 optional State state = 1;
2971}
2972
2973/*
2974 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
2975 * Logged from:
2976 * system/core/lmkd/lmkd.c
2977 */
2978message LmkKillOccurred {
2979 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002980 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08002981
2982 // The process name.
2983 optional string process_name = 2;
2984
2985 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07002986 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002987
2988 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002989 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002990
2991 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07002992 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08002993
2994 // RSS
2995 optional int64 rss_in_bytes = 6;
2996
2997 // CACHE
2998 optional int64 cache_in_bytes = 7;
2999
3000 // SWAP
3001 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003002
3003 // The elapsed real time of start of the process.
3004 optional int64 process_start_time_nanos = 9;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003005}
3006
Rajeev Kumar51b54602018-03-01 12:18:26 -08003007/*
3008 * Logs when the ActivityManagerService detects that an app died.
3009 *
3010 * Logged from:
3011 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3012 */
3013message AppDied {
3014 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003015 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003016}
3017
Howard Ro21a039c2018-08-06 14:55:47 -07003018/**
3019 * An atom for generic metrics logging. Available from Android Q.
3020 */
3021message GenericAtom {
3022 // The uid of the application that sent this custom atom.
3023 optional int32 uid = 1 [(is_uid) = true];
3024
3025 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003026 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003027}
3028
Tej Singhd6d6d772018-09-05 17:41:25 -07003029/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003030 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003031 *
3032 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003033 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003034 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003035message BiometricAcquired {
3036 // Biometric modality that was acquired.
3037 optional android.hardware.biometrics.ModalityEnum modality = 1;
3038 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3039 optional int32 user = 2;
3040 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3041 optional bool is_crypto = 3;
3042 // Action that the device is performing. Acquired messages are only expected for enroll and
3043 // authenticate. Other actions may indicate an error.
3044 optional android.hardware.biometrics.ActionEnum action = 4;
3045 // The client that this acquisition was received for.
3046 optional android.hardware.biometrics.ClientEnum client = 5;
3047 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3048 optional int32 acquire_info = 6;
3049 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3050 optional int32 acquire_info_vendor = 7;
Tej Singhd6d6d772018-09-05 17:41:25 -07003051}
3052
3053/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003054 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003055 *
3056 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003057 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003058 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003059message BiometricAuthenticated {
3060 // Biometric modality that was used.
3061 optional android.hardware.biometrics.ModalityEnum modality = 1;
3062 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3063 optional int32 user = 2;
3064 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3065 // storage.
3066 optional bool is_crypto = 3;
3067 // The client that this acquisition was received for.
3068 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003069 // If authentication requires user confirmation. See BiometricPrompt's
3070 // setRequireConfirmation(bool) method.
3071 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003072
Kevin Chyn1741a072019-01-17 11:54:40 -08003073 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003074 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003075 REJECTED = 1;
3076 PENDING_CONFIRMATION = 2;
3077 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003078 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003079
3080 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003081 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003082 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3083 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3084 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3085 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003086 optional int64 latency_millis = 7;
Kevin Chyn1741a072019-01-17 11:54:40 -08003087}
3088
3089/**
3090 * Logs when a biometric error occurs.
3091 *
3092 * Logged from:
3093 * frameworks/base/services/core/java/com/android/server/biometrics
3094 */
3095message BiometricErrorOccurred {
3096 // Biometric modality that was used.
3097 optional android.hardware.biometrics.ModalityEnum modality = 1;
3098 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3099 optional int32 user = 2;
3100 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3101 optional bool is_crypto = 3;
3102 // Action that the device is performing.
3103 optional android.hardware.biometrics.ActionEnum action = 4;
3104 // The client that this acquisition was received for.
3105 optional android.hardware.biometrics.ClientEnum client = 5;
3106 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3107 // are unique to modality.
3108 optional int32 error_info = 6;
3109 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3110 // by the vendor and not specified by the HIDL interface.
3111 optional int32 error_info_vendor = 7;
3112}
3113
3114/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003115 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003116 * Logged from:
3117 * frameworks/base/services/core/java/com/android/server/biometrics
3118 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003119message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003120 // Biometric modality.
3121 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003122 // Type of issue detected.
3123 optional android.hardware.biometrics.IssueEnum issue = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07003124}
Howard Ro688ae182018-09-25 00:09:36 -07003125
3126message Notification {
3127
3128 // Type of notification event.
3129 enum Type {
3130 TYPE_UNKNOWN = 0;
3131 // Notification became visible to the user.
3132 TYPE_OPEN = 1;
3133 // Notification became hidden.
3134 TYPE_CLOSE = 2;
3135 // Notification switched to detail mode.
3136 TYPE_DETAIL = 3;
3137 // Notification was clicked.
3138 TYPE_ACTION = 4;
3139 // Notification was dismissed.
3140 TYPE_DISMISS = 5;
3141 // Notification switched to summary mode. The enum value of 14 is to
3142 // match that of metrics_constants.
3143 TYPE_COLLAPSE = 14;
3144 }
3145 optional Type type = 1;
3146
3147 // Package name associated with the notification.
3148 optional string package_name = 2;
3149
3150 // Tag associated with notification.
3151 optional string tag = 3;
3152
3153 // Application-supplied ID associated with the notification.
3154 optional int32 id = 4;
3155
3156 // Index of notification in the notification panel.
3157 optional int32 shade_index = 5;
3158
3159 // The number of notifications in the notification panel.
3160 optional int32 shade_count = 6;
3161
3162 // Importance for the notification.
3163 optional int32 importance = 7;
3164
3165 // ID for the notification channel.
Howard Ro183c2bd2018-10-18 13:52:10 -07003166 optional string channel_id = 8;
Howard Ro688ae182018-09-25 00:09:36 -07003167
3168 // Importance for the notification channel.
3169 optional int32 channel_importance = 9;
3170
Howard Ro183c2bd2018-10-18 13:52:10 -07003171 // Application-supplied ID associated with the notifications group.
3172 optional string group_id = 10;
3173
Howard Ro688ae182018-09-25 00:09:36 -07003174 // Whether notification was a group summary.
Howard Ro183c2bd2018-10-18 13:52:10 -07003175 optional bool group_summary = 11;
Howard Ro688ae182018-09-25 00:09:36 -07003176
Howard Ro183c2bd2018-10-18 13:52:10 -07003177 // Reason for dismissal of a notification. This field is only meaningful for
3178 // TYPE_DISMISS events.
3179 optional int32 dismiss_reason = 12;
Howard Ro688ae182018-09-25 00:09:36 -07003180
Howard Ro183c2bd2018-10-18 13:52:10 -07003181 // The first post time of notification, stable across updates.
3182 optional int64 creation_millis = 13;
Howard Ro688ae182018-09-25 00:09:36 -07003183
Howard Ro183c2bd2018-10-18 13:52:10 -07003184 // The most recent interruption time, or the creation time if no updates.
3185 // Differs from update_millis because updates are filtered based on whether
3186 // they actually interrupted the user.
3187 optional int64 interruption_millis = 14;
Howard Ro688ae182018-09-25 00:09:36 -07003188
Howard Ro183c2bd2018-10-18 13:52:10 -07003189 // The most recent update time, or the creation time if no updates.
3190 optional int64 update_millis = 15;
3191
3192 // The most recent visibility event.
3193 optional int64 visible_millis = 16;
Howard Ro688ae182018-09-25 00:09:36 -07003194}
3195
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003196/*
Tej Singh0d176952019-01-16 19:10:54 -08003197 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003198 */
Tej Singh0d176952019-01-16 19:10:54 -08003199message FlagFlipUpdateOccurred {
3200 // If the event is from a flag config package, specify the package name.
3201 optional string flag_flip_package_name = 1;
3202
3203 // The order id of the package
3204 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003205}
3206
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003207/**
3208 * Potential experiment ids that goes with a train install.
3209 */
3210message TrainExperimentIds {
3211 repeated int64 experiment_id = 1;
3212}
3213
Yangster-macb89807e2018-11-15 21:10:57 -08003214/*
3215 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003216 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003217 */
3218message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003219 // Name of the train.
3220 optional string train_name = 1;
3221 // Version code for a "train" of packages that need to be installed atomically
3222 optional int64 train_version_code = 2;
3223 // After installation of this package, device requires a restart.
3224 optional bool requires_staging = 3;
3225 // Rollback should be enabled for this install.
3226 optional bool rollback_enabled = 4;
3227 // Requires low latency monitoring if possible.
3228 optional bool requires_low_latency_monitor = 5;
3229
Yangster-macb89807e2018-11-15 21:10:57 -08003230 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003231 UNKNOWN = 0;
3232 INSTALL_REQUESTED = 1;
3233 INSTALL_STARTED = 2;
3234 INSTALL_STAGED_NOT_READY = 3;
3235 INSTALL_STAGED_READY = 4;
3236 INSTALL_SUCCESS = 5;
3237 INSTALL_FAILURE = 6;
3238 INSTALL_CANCELLED = 7;
3239 INSTALLER_ROLLBACK_REQUESTED = 8;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003240 INSTALLER_ROLLBACK_SUCCESS = 9;
3241 INSTALLER_ROLLBACK_FAILURE = 10;
Yangster-macb89807e2018-11-15 21:10:57 -08003242 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003243 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003244 // Possible experiment ids for monitoring this push.
3245 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3246 // user id
3247 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003248}
3249
Maggie Whitefc1aa592018-11-28 21:55:23 -08003250/** Represents USB port overheat event. */
3251message UsbPortOverheatEvent {
3252 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3253 optional int32 plug_temperature_deci_c = 1;
3254
3255 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3256 optional int32 max_temperature_deci_c = 2;
3257
3258 /* Time between USB plug event and overheat threshold trip, in seconds. */
3259 optional int32 time_to_overheat_secs = 3;
3260
3261 /* Time between overheat threshold trip and hysteresis, in seconds. */
3262 optional int32 time_to_hysteresis_secs = 4;
3263
3264 /* Time between hysteresis and active mitigation ending, in seconds. */
3265 optional int32 time_to_inactive_secs = 5;
3266};
3267
Maggie White8735b852019-01-18 11:40:49 -08003268/**
3269 * Logs total effective full charge and discharge cycles on a battery.
3270 * Here are some examples of one effective cycle:
3271 * 1) the battery charges from 0% to 100% and drains back to 0%,
3272 * 2) charging from 50% to 100% and draining back to 50% twice.
3273 * Pulled from:
3274 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3275 */
3276message BatteryCycleCount {
3277 /* Number of total charge and discharge cycles on the system battery. */
3278 optional int32 cycle_count = 1;
3279}
3280
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003281/**
3282 * Logs that an SD card is mounted and information about it, its type (public or private) and the
3283 * size in bytes.
3284 * Pulled from:
3285 * StatsCompanionService
3286 */
3287
3288message SDCardInfo {
3289
3290 enum Type {
3291 UNKNOWN = 0;
3292 TYPE_PUBLIC = 1;
3293 TYPE_PRIVATE = 2;
3294 OTHERS = 3;
3295 }
3296
3297 // Type of the SD card: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3298 optional Type type = 1;
3299 // Total size of the sd card in bytes.
3300 optional int64 size_bytes = 2;
3301}
3302
Yangster-macb89807e2018-11-15 21:10:57 -08003303/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003304 * Logs when a connection becomes available and lost.
3305 * Logged in StatsCompanionService.java
3306 */
3307message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003308 // Id of the network.
3309 optional int32 net_id = 1;
3310
3311 enum State {
3312 UNKNOWN = 0;
3313 CONNECTED = 1;
3314 DISCONNECTED = 2;
3315 }
3316 // Connected state of a network.
3317 optional State state = 2;
3318}
3319
3320/**
3321 * Logs when a service starts and stops.
3322 * Logged from:
3323 * services/core/java/com/android/server/am/ActiveServices.java
3324 */
3325message ServiceStateChanged {
3326
3327 optional int32 uid = 1 [(is_uid) = true];
3328
3329 optional string package_name = 2;
3330
3331 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003332
3333 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003334 START = 1;
3335 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003336 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003337
3338 optional State state = 4;
3339}
3340
3341/**
3342 * Logs when a service is launched.
3343 * Logged from:
3344 * services/core/java/com/android/server/am/ActiveServices.java
3345 */
3346message ServiceLaunchReported {
3347
3348 optional int32 uid = 1 [(is_uid) = true];
3349
3350 optional string package_name = 2;
3351
3352 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003353}
Howard Ro688ae182018-09-25 00:09:36 -07003354
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003355/**
3356 * Logs when a hidden API is used.
3357 *
3358 * Logged from:
3359 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3360 */
3361message HiddenApiUsed {
3362 // The uid of the app making the hidden access.
3363 optional int32 uid = 1 [(is_uid) = true];
3364
3365 // Signature of the method or field accessed.
3366 optional string signature = 2;
3367
3368 enum AccessMethod {
3369 NONE = 0;
3370 REFLECTION = 1;
3371 JNI = 2;
3372 LINKING = 3;
3373 }
3374
3375 // Type of access.
3376 optional AccessMethod access_method = 3;
3377
3378 // Whether the access was prevented or not.
3379 optional bool access_denied = 4;
3380}
3381
Chenjie Yubbcbc602018-02-05 16:51:52 -08003382//////////////////////////////////////////////////////////////////////
3383// Pulled atoms below this line //
3384//////////////////////////////////////////////////////////////////////
3385
3386/**
David Chenc8a43242017-10-17 16:23:28 -07003387 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3388 *
3389 * Pulled from:
3390 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3391 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003392message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003393 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003394
3395 optional int64 rx_bytes = 2;
3396
3397 optional int64 rx_packets = 3;
3398
3399 optional int64 tx_bytes = 4;
3400
3401 optional int64 tx_packets = 5;
3402}
3403
3404/**
3405 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3406 *
3407 * Pulled from:
3408 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3409 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003410message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003411 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003412
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003413 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3414 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003415
3416 optional int64 rx_bytes = 3;
3417
3418 optional int64 rx_packets = 4;
3419
3420 optional int64 tx_bytes = 5;
3421
3422 optional int64 tx_packets = 6;
3423}
3424
3425/**
3426 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3427 *
3428 * Pulled from:
3429 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3430 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003431message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003432 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003433
3434 optional int64 rx_bytes = 2;
3435
3436 optional int64 rx_packets = 3;
3437
3438 optional int64 tx_bytes = 4;
3439
3440 optional int64 tx_packets = 5;
3441}
3442
3443/**
3444 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3445 *
3446 * Pulled from:
3447 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3448 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003449message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003450 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003451
Yao Chenc40a19d2018-03-15 16:48:25 -07003452 // 1 denotes foreground and 0 denotes background. This is called Set in
3453 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003454 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003455
3456 optional int64 rx_bytes = 3;
3457
3458 optional int64 rx_packets = 4;
3459
3460 optional int64 tx_bytes = 5;
3461
3462 optional int64 tx_packets = 6;
3463}
3464
3465/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003466 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3467 *
3468 * Pulled from:
3469 * StatsCompanionService
3470 */
3471message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003472 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003473
3474 optional int64 rx_bytes = 2;
3475
3476 optional int64 tx_bytes = 3;
3477}
3478
3479/**
David Chenc8a43242017-10-17 16:23:28 -07003480 * Pulls the kernel wakelock durations. This atom is adapted from
3481 * android/internal/os/KernelWakelockStats.java
3482 *
3483 * Pulled from:
3484 * StatsCompanionService using KernelWakelockReader.
3485 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003486message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003487 optional string name = 1;
3488
3489 optional int32 count = 2;
3490
3491 optional int32 version = 3;
3492
Yangster-maca8a30442018-10-13 23:46:34 -07003493 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003494}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003495
Chenjie Yu05013b32017-11-21 10:21:41 -08003496/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003497 * Pulls low power state information. If power.stats HAL is not available, this
3498 * includes platform and subsystem sleep state information,
3499 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3500 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003501 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003502 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003503 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3504 * as defined in:
3505 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003506 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003507message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003508 // Subsystem name
3509 optional string subsystem_name = 1;
3510 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3511 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003512 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3513 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003514 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003515 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003516 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003517 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003518 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003519}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003520
Chenjie Yu05013b32017-11-21 10:21:41 -08003521/**
Bookatz92da2832018-11-01 18:10:03 -07003522 * Pulls on-device power measurement information.
3523 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3524 * Pulled from:
3525 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3526 */
3527message OnDevicePowerMeasurement {
3528 // Name of the subsystem (to which the rail belongs).
3529 optional string subsystem_name = 1;
3530
3531 // Rail name. The rail lies within the subsystem.
3532 optional string rail_name = 2;
3533
3534 // Time (in ms since boot) at which the rail energy value was measured.
3535 // This may differ slightly from the time that statsd logs this information.
3536 optional uint64 measurement_timestamp_millis = 3;
3537
3538 // Accumulated energy used via the rail since device boot in uWs.
3539 optional uint64 energy_microwatt_secs = 4;
3540}
3541
3542/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003543 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003544 * Pulls the time the cpu spend on the frequency index. Frequency index
3545 * starts from highest to lowest. The value should be monotonically
3546 * increasing since boot. However, if there is a cpu
3547 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003548 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003549message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003550 optional uint32 cluster = 1;
3551 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003552 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003553}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003554
Chenjie Yu05013b32017-11-21 10:21:41 -08003555/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003556 * Pulls Cpu Time Per Uid.
3557 * Note that isolated process uid time should be attributed to host uids.
3558 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003559message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003560 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003561 optional uint64 user_time_micros = 2;
3562 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003563}
3564
3565/**
3566 * Pulls Cpu Time Per Uid per frequency.
3567 * Note that isolated process uid time should be attributed to host uids.
3568 * For each uid, we order the time by descending frequencies.
3569 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003570message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003571 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003572 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003573 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003574}
Hugo Benichi884970e2017-11-14 22:42:46 +09003575
Chenjie Yu05013b32017-11-21 10:21:41 -08003576/**
3577 * Pulls Wifi Controller Activity Energy Info
3578 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003579message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003580 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003581 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003582 // stack reported state
3583 // TODO: replace this with proto enum
3584 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003585 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003586 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003587 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003588 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003589 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003590 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003591 // product of current(mA), voltage(V) and time(ms)
3592 optional uint64 controller_energy_used = 6;
3593}
3594
3595/**
3596 * Pulls Modem Activity Energy Info
3597 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003598message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003599 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003600 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003601 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003602 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003603 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003604 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003605 /**
3606 * Tx power index
3607 * index 0 = tx_power < 0dBm
3608 * index 1 = 0dBm < tx_power < 5dBm
3609 * index 2 = 5dBm < tx_power < 15dBm
3610 * index 3 = 15dBm < tx_power < 20dBm
3611 * index 4 = tx_power > 20dBm
3612 */
3613 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003614 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003615 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003616 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003617 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003618 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003619 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003620 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003621 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003622 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003623 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003624 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003625 // product of current(mA), voltage(V) and time(ms)
3626 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003627}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003628
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003629/**
3630 * Pulls Bluetooth Activity Energy Info
3631 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3632 */
3633message BluetoothActivityInfo {
3634 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003635 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003636 // bluetooth stack state
3637 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003638 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003639 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003640 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003641 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003642 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003643 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003644 // product of current(mA), voltage(V) and time(ms)
3645 optional uint64 energy_used = 6;
3646}
3647
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003648/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003649 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003650 *
3651 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003652 */
3653message ProcessMemoryState {
3654 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003655 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003656
3657 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003658 // Usually package name, "system" for system server.
3659 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003660 optional string process_name = 2;
3661
Rafal Slawikda51b932018-12-13 16:31:33 +00003662 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003663 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003664
3665 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003666 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003667
3668 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003669 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003670
Rajeev Kumar90235992018-01-29 11:06:48 -08003671 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003672 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3673 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003674 optional int64 rss_in_bytes = 6;
3675
3676 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003677 // Value is read from memory.stat, field total_cache if per-app memory
3678 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003679 optional int64 cache_in_bytes = 7;
3680
3681 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003682 // Value is read from memory.stat, field total_swap if per-app memory
3683 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003684 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003685
Rafal Slawikd03ae422018-11-20 11:27:45 +00003686 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003687 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003688
3689 // Elapsed real time when the process started.
3690 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3691 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003692}
3693
3694/*
Rafal Slawik08621582018-10-15 14:53:07 +01003695 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003696 *
3697 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003698 */
3699message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003700 // The uid if available. -1 means not available.
3701 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003702
Rafal Slawikbf67d072018-10-23 11:07:54 +01003703 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003704 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003705 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003706
Rafal Slawikbf67d072018-10-23 11:07:54 +01003707 // # of page-faults
3708 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003709
Rafal Slawikbf67d072018-10-23 11:07:54 +01003710 // # of major page-faults
3711 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003712
Rafal Slawikbf67d072018-10-23 11:07:54 +01003713 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003714 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003715 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003716
Rafal Slawikd03ae422018-11-20 11:27:45 +00003717 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003718 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003719
3720 // Elapsed real time when the process started.
3721 // Value is read from /proc/PID/stat, field 22.
3722 optional int64 start_time_nanos = 7;
Rafal Slawik08621582018-10-15 14:53:07 +01003723}
3724
3725/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00003726 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003727 *
3728 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
3729 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00003730 *
3731 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003732 */
3733message ProcessMemoryHighWaterMark {
3734 // The uid if available. -1 means not available.
3735 optional int32 uid = 1 [(is_uid) = true];
3736
Rafal Slawikda51b932018-12-13 16:31:33 +00003737 // The process name.
3738 // Usually package name or process cmdline.
3739 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003740 optional string process_name = 2;
3741
3742 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
3743 // /proc/PID/status.
3744 optional int64 rss_high_water_mark_in_bytes = 3;
3745}
3746
3747/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003748 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003749 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003750message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08003751 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003752}
3753
3754/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003755 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08003756 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003757message SystemUptime {
3758 // Milliseconds since the system was booted.
3759 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
3760 // for external input).
3761 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08003762 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003763}
3764
3765/*
3766 * Reads from /proc/uid_concurrent_active_time which has the format:
3767 * active: X (X is # cores)
3768 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
3769 * [uid1]: [time-0] [time-1] [time-2] ... ...
3770 * ...
3771 * Time-N means the CPU time a UID spent running concurrently with N other processes.
3772 * The file contains a monotonically increasing count of time for a single boot.
3773 */
3774message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003775 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003776 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08003777}
3778
3779/**
3780 * Reads from /proc/uid_concurrent_policy_time which has the format:
3781 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
3782 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3783 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
3784 * ...
3785 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
3786 * The file contains a monotonically increasing count of time for a single boot.
3787 */
3788message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07003789 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003790 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003791 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08003792}
3793
3794/*
3795 * Pulls free disk space, for data, system partition and temporary directory.
3796 */
3797message DiskSpace {
3798 // available bytes in data partition
3799 optional uint64 data_available_bytes = 1;
3800 // available bytes in system partition
3801 optional uint64 system_available_bytes = 2;
3802 // available bytes in download cache or temp directories
3803 optional uint64 temp_available_bytes = 3;
3804}
Tej Singhbf972d92018-01-10 20:51:13 -08003805
3806/**
3807 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08003808 *
3809 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08003810 */
3811message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003812 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08003813}
3814
3815/**
3816 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08003817 * Pulled from:
3818 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08003819 */
3820message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07003821 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08003822}
3823
3824/**
Bookatz17f0d8a2018-09-13 12:56:32 -07003825 * Pulls battery voltage.
3826 * Pulled from:
3827 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3828 */
3829message BatteryVoltage {
3830 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07003831 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07003832}
3833
3834/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08003835 * Pulls battery level (percent full, from 0 to 100).
3836 *
3837 * Pulled from:
3838 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3839 */
3840message BatteryLevel {
3841 // Battery level. Should be in [0, 100].
3842 optional int32 battery_level = 1;
3843}
3844
3845/**
Tej Singhd89137e2018-03-26 14:51:40 -07003846 * Pulls the temperature of various parts of the device.
3847 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08003848 *
3849 * Pulled from:
3850 * frameworks/base/cmds/statsd/src/external/ResourceThermalManagerPuller.cpp
3851 */
3852message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08003853 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08003854 optional android.os.TemperatureTypeEnum sensor_location = 1;
3855
3856 // The name of the temperature source. Eg. CPU0
3857 optional string sensor_name = 2;
3858
Tej Singhd89137e2018-03-26 14:51:40 -07003859 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08003860 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07003861 optional int32 temperature_deci_celsius = 3;
yroa1fe77c2018-02-26 14:22:54 -08003862}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003863
3864/**
3865 * Pulls the statistics of calls to Binder.
3866 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01003867 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
3868 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003869 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003870 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003871 */
3872message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003873 // UID of the process responsible for the binder transaction. It will be set if the process
3874 // executing the binder transaction attribute the transaction to another uid using
3875 // Binder.setThreadWorkSource().
3876 //
3877 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003878 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00003879 // UID of the process executing the binder transaction.
3880 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01003881 // Fully qualified class name of the API call.
3882 //
3883 // This is a system server class name.
3884 //
3885 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
3886 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
3887 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
3888 // commonly used APIs.
3889 optional string service_class_name = 2;
3890 // Method name of the API call. It can also be a transaction code if we cannot
3891 // resolve it to a name. See Binder#getTransactionName.
3892 //
3893 // This is a system server method name.
3894 optional string service_method_name = 3;
3895 // Total number of API calls.
3896 optional int64 call_count = 4;
3897 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3898 optional bool screen_interactive = 13;
3899 // Total number of API calls we have data recorded for. If we collected data for all the calls,
3900 // call_count will be equal to recorded_call_count.
3901 //
3902 // If recorded_call_count is different than call_count, it means data collection has been
3903 // sampled. All the fields below will be sampled in this case.
3904 optional int64 recorded_call_count = 12;
3905 // Number of exceptions thrown by the API.
3906 optional int64 recorded_exception_count = 5;
3907 // Total latency of all API calls.
3908 // Average can be computed using total_latency_micros / recorded_call_count.
3909 optional int64 recorded_total_latency_micros = 6;
3910 // Maximum latency of one API call.
3911 optional int64 recorded_max_latency_micros = 7;
3912 // Total CPU usage of all API calls.
3913 // Average can be computed using total_cpu_micros / recorded_call_count.
3914 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
3915 optional int64 recorded_total_cpu_micros = 8;
3916 // Maximum CPU usage of one API call.
3917 optional int64 recorded_max_cpu_micros = 9;
3918 // Maximum parcel reply size of one API call.
3919 optional int64 recorded_max_reply_size_bytes = 10;
3920 // Maximum parcel request size of one API call.
3921 optional int64 recorded_max_request_size_bytes = 11;
3922}
3923
3924/**
3925 * Pulls the statistics of exceptions during calls to Binder.
3926 *
3927 * Binder stats are cumulative from boot unless somebody reset the data using
3928 * > adb shell dumpsys binder_calls_stats --reset
3929 */
3930message BinderCallsExceptions {
3931 // Exception class name, e.g. java.lang.IllegalArgumentException.
3932 //
3933 // This is an exception class name thrown by the system server.
3934 optional string exception_class_name = 1;
3935 // Total number of exceptions.
3936 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01003937}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003938
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003939/**
3940 * Pulls the statistics of message dispatching on HandlerThreads.
3941 *
3942 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
3943 * config on the device.
3944 *
3945 * Next tag: 11
3946 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003947message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01003948 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003949 optional int32 uid = 1 [(is_uid) = true];
3950
3951 // Fully qualified class name of the handler target class.
3952 //
3953 // This field does not contain PII. This is a system server class name.
3954 optional string handler_class_name = 2;
3955
3956 // The name of the thread that runs the Looper.
3957 //
3958 // This field does not contain PII. This is a system server thread name.
3959 optional string looper_thread_name = 3;
3960
3961 // The name of the dispatched message.
3962 //
3963 // This field does not contain PII. This is a system server constant or class
3964 // name.
3965 optional string message_name = 4;
3966
3967 // Total number of successfully dispatched messages.
3968 optional int64 message_count = 5;
3969
3970 // Total number of messages that failed dispatching.
3971 optional int64 exception_count = 6;
3972
3973 // Total number of processed messages we have data recorded for. If we
3974 // collected data for all the messages, message_count will be equal to
3975 // recorded_message_count.
3976 //
3977 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003978 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003979 optional int64 recorded_message_count = 7;
3980
3981 // Total latency of all processed messages.
3982 // Average can be computed using recorded_total_latency_micros /
3983 // recorded_message_count.
3984 optional int64 recorded_total_latency_micros = 8;
3985
3986 // Total CPU usage of all processed message.
3987 // Average can be computed using recorded_total_cpu_micros /
3988 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003989 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01003990 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01003991
3992 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
3993 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01003994
3995 // Max recorded CPU usage of all processed messages.
3996 optional int64 recorded_max_cpu_micros = 11;
3997
3998 // Max recorded latency of all processed messages.
3999 optional int64 recorded_max_latency_micros = 12;
4000
4001 // Total number of messages we tracked the dispatching delay for. If we
4002 // collected data for all the messages, message_count will be equal to
4003 // recorded_delay_message_count.
4004 //
4005 // If recorded_delay_message_count is different than message_count, it means data
4006 // collection has been sampled or/and not all messages specified the target dispatch time.
4007 // The fields below will be sampled in this case.
4008 optional int64 recorded_delay_message_count = 13;
4009
4010 // Total dispatching delay of all processed messages.
4011 // Calculated as a difference between the target dispatching time (Message.when)
4012 // and the actual dispatching time.
4013 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4014 optional int64 recorded_total_delay_millis = 14;
4015
4016 // Max dispatching delay of all processed messages.
4017 // Calculated as a difference between the target dispatching time (Message.when)
4018 // and the actual dispatching time.
4019 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004020}
Tej Singh86dc9db2018-09-06 00:39:57 +00004021
4022/**
4023 * Pulls disk information, such as write speed and latency.
4024 */
4025message DiskStats {
4026 // Time taken to open, write 512B to, and close a file.
4027 // -1 if error performing the check.
4028 optional int64 data_write_latency_millis = 1;
4029
4030 optional bool file_based_encryption = 2;
4031
4032 // Recent disk write speed in kB/s.
4033 // -1 if error querying storageed.
4034 // 0 if data is unavailable.
4035 optional int32 recent_disk_write_speed = 3;
4036}
4037
4038
4039/**
4040 * Free and total bytes of the Data, Cache, and System partition.
4041 */
4042message DirectoryUsage {
4043 enum Directory {
4044 UNKNOWN = 0;
4045 DATA = 1;
4046 CACHE = 2;
4047 SYSTEM = 3;
4048 }
4049 optional Directory directory = 1;
4050 optional int64 free_bytes = 2;
4051 optional int64 total_bytes = 3;
4052}
4053
4054
4055/**
4056 * Size of an application: apk size, data size, and cache size.
4057 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4058 * Information is only reported for apps with the primary user (user 0).
4059 * Sizes are aggregated by package name.
4060 */
4061message AppSize {
4062 // Including uids will involve modifying diskstats logic.
4063 optional string package_name = 1;
4064 // App size in bytes. -1 if unavailable.
4065 optional int64 app_size_bytes = 2;
4066 // App data size in bytes. -1 if unavailable.
4067 optional int64 app_data_size_bytes = 3;
4068 // App cache size in bytes. -1 if unavailable.
4069 optional int64 app_cache_size_bytes = 4;
4070 // Time that the cache file was produced.
4071 // Uses System.currentTimeMillis(), which is wall clock time.
4072 optional int64 cache_time_millis = 5;
4073}
4074
4075
4076/**
4077 * Size of a particular category. Eg: photos, videos.
4078 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4079 */
4080message CategorySize {
4081 enum Category {
4082 UNKNOWN = 0;
4083 APP_SIZE = 1;
4084 APP_DATA_SIZE = 2;
4085 APP_CACHE_SIZE = 3;
4086 PHOTOS = 4;
4087 VIDEOS = 5;
4088 AUDIO = 6;
4089 DOWNLOADS = 7;
4090 SYSTEM = 8;
4091 OTHER = 9;
4092 }
4093 optional Category category = 1;
4094 // Category size in bytes.
4095 optional int64 size_bytes = 2;
4096 // Time that the cache file was produced.
4097 // Uses System.currentTimeMillis(), which is wall clock time.
4098 optional int64 cache_time_millis = 3;
4099}
Tej Singhd6d6d772018-09-05 17:41:25 -07004100
4101/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004102 * Pulls per uid I/O stats. The stats are cumulative since boot.
4103 *
4104 * Read/write bytes are I/O events from a storage device
4105 * Read/write chars are data requested by read/write syscalls, and can be
4106 * satisfied by caching.
4107 *
4108 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4109 */
4110message DiskIo {
4111 optional int32 uid = 1 [(is_uid) = true];
4112 optional int64 fg_chars_read = 2;
4113 optional int64 fg_chars_write = 3;
4114 optional int64 fg_bytes_read = 4;
4115 optional int64 fg_bytes_write = 5;
4116 optional int64 bg_chars_read = 6;
4117 optional int64 bg_chars_write = 7;
4118 optional int64 bg_bytes_read = 8;
4119 optional int64 bg_bytes_write = 9;
4120 optional int64 fg_fsync = 10;
4121 optional int64 bg_fsync= 11;
4122}
4123
4124
4125/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004126 * Pulls the number of fingerprints for each user.
4127 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004128 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004129 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004130message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004131 // The associated user. Eg: 0 for owners, 10+ for others.
4132 // Defined in android/os/UserHandle.java
4133 optional int32 user = 1;
4134 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004135 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004136}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004137
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004138/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004139 * Pulls the number of faces for each user.
4140 *
4141 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4142 */
4143message NumFacesEnrolled {
4144 // The associated user. Eg: 0 for owners, 10+ for others.
4145 // Defined in android/os/UserHandle.java
4146 optional int32 user = 1;
4147 // Number of faces registered to that user.
4148 optional int32 num_faces_enrolled = 2;
4149}
4150/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004151 * A mapping of role holder -> role
4152 */
4153message RoleHolder {
4154 // uid of the role holder
4155 optional int32 uid = 1 [(is_uid) = true];
4156
4157 // package name of the role holder
4158 optional string package_name = 2;
4159
4160 // the role held
4161 optional string role = 3;
4162}
4163
Yangsteraf9aee72018-10-12 09:26:16 -07004164message AggStats {
4165 optional int64 min = 1;
4166
4167 optional int64 average = 2;
4168
4169 optional int64 max = 3;
4170}
4171
4172message ProcessStatsStateProto {
4173 optional android.service.procstats.ScreenState screen_state = 1;
4174
4175 optional android.service.procstats.MemoryState memory_state = 2;
4176
4177 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4178 // and not frameworks/base/core/java/android/app/ActivityManager.java
4179 optional android.service.procstats.ProcessState process_state = 3;
4180
4181 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004182 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004183
4184 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004185 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004186
4187 // # of samples taken
4188 optional int32 sample_size = 5;
4189
4190 // PSS is memory reserved for this process
4191 optional AggStats pss = 6;
4192
4193 // USS is memory shared between processes, divided evenly for accounting
4194 optional AggStats uss = 7;
4195
4196 // RSS is memory resident for this process
4197 optional AggStats rss = 8;
4198}
4199
4200// Next Tag: 7
4201message ProcessStatsProto {
4202 // Name of process.
4203 optional string process = 1;
4204
4205 // Uid of the process.
4206 optional int32 uid = 2;
4207
4208 // Information about how often kills occurred
4209 message Kill {
4210 // Count of excessive CPU kills
4211 optional int32 cpu = 1;
4212
4213 // Count of kills when cached
4214 optional int32 cached = 2;
4215
4216 // PSS stats during cached kill
4217 optional AggStats cached_pss = 3;
4218 }
4219 optional Kill kill = 3;
4220
4221 // Time and memory spent in various states.
4222 repeated ProcessStatsStateProto states = 5;
4223
4224 // Total time process has been running... screen_state, memory_state, and process_state
4225 // will not be set.
4226 optional ProcessStatsStateProto total_running_state = 6;
4227}
4228
4229message PackageServiceOperationStatsProto {
4230 // Operate enum: Started, Foreground, Bound, Executing
4231 optional android.service.procstats.ServiceOperationState operation = 1;
4232
4233 // Number of times the service was in this operation.
4234 optional int32 count = 2;
4235
4236 // Information about a state the service can be in.
4237 message StateStats {
4238 // Screen state enum.
4239 optional android.service.procstats.ScreenState screen_state = 1;
4240 // Memory state enum.
4241 optional android.service.procstats.MemoryState memory_state = 2;
4242
4243 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004244 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004245 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004246 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004247 }
4248 repeated StateStats state_stats = 3;
4249}
4250
4251message PackageServiceStatsProto {
4252 // Name of service component.
4253 optional string service_name = 1;
4254
4255 // The operation stats.
4256 // The package_name, package_uid, package_version, service_name will not be set to save space.
4257 repeated PackageServiceOperationStatsProto operation_stats = 2;
4258}
4259
4260message PackageAssociationSourceProcessStatsProto {
4261 // Uid of the process.
4262 optional int32 process_uid = 1;
4263 // Process name.
4264 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004265 // Package name.
4266 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004267 // Total count of the times this association appeared.
4268 optional int32 total_count = 3;
4269
4270 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004271 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004272
4273 // Total count of the times this association became actively impacting its target process.
4274 optional int32 active_count = 5;
4275
4276 // Information on one source in this association.
4277 message StateStats {
4278 // Process state enum.
4279 optional android.service.procstats.ProcessState process_state = 1;
4280 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004281 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004282 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004283 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004284 }
4285 repeated StateStats active_state_stats = 6;
4286}
4287
4288message PackageAssociationProcessStatsProto {
4289 // Name of the target component.
4290 optional string component_name = 1;
4291 // Information on one source in this association.
4292 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4293}
4294
4295
4296message ProcessStatsPackageProto {
4297 // Name of package.
4298 optional string package = 1;
4299
4300 // Uid of the package.
4301 optional int32 uid = 2;
4302
4303 // Version of the package.
4304 optional int64 version = 3;
4305
4306 // Stats for each process running with the package loaded in to it.
4307 repeated ProcessStatsProto process_stats = 4;
4308
4309 // Stats for each of the package's services.
4310 repeated PackageServiceStatsProto service_stats = 5;
4311
4312 // Stats for each association with the package.
4313 repeated PackageAssociationProcessStatsProto association_stats = 6;
4314}
4315
4316message ProcessStatsSectionProto {
4317 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004318 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004319
4320 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004321 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004322
4323 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004324 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004325
4326 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004327 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004328
4329 // System runtime library. e.g. "libdvm.so", "libart.so".
4330 optional string runtime = 5;
4331
4332 // whether kernel reports swapped pss.
4333 optional bool has_swapped_pss = 6;
4334
4335 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4336 enum Status {
4337 STATUS_UNKNOWN = 0;
4338 STATUS_COMPLETE = 1;
4339 STATUS_PARTIAL = 2;
4340 STATUS_SHUTDOWN = 3;
4341 STATUS_SYSPROPS = 4;
4342 }
4343 repeated Status status = 7;
4344
Chenjie Yub2ecc792019-01-17 10:27:26 -08004345 // Number of pages available of various types and sizes, representation fragmentation.
4346 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4347
Yangsteraf9aee72018-10-12 09:26:16 -07004348 // Stats for each process.
4349 repeated ProcessStatsProto process_stats = 8;
4350
4351 // Stats for each package.
4352 repeated ProcessStatsPackageProto package_stats = 9;
4353}
4354
Chenjie Yub2ecc792019-01-17 10:27:26 -08004355message ProcessStatsAvailablePagesProto {
4356 // Node these pages are in (as per /proc/pagetypeinfo)
4357 optional int32 node = 1;
4358
4359 // Zone these pages are in (as per /proc/pagetypeinfo)
4360 optional string zone = 2;
4361
4362 // Label for the type of these pages (as per /proc/pagetypeinfo)
4363 optional string label = 3;
4364
4365 // Distribution of number of pages available by order size. First entry in array is
4366 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4367 repeated int32 pages_per_order = 4;
4368}
4369
Chenjie Yu12e5e672018-09-14 15:54:59 -07004370/**
4371 * Pulled from ProcessStatsService.java
4372 */
4373message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004374 optional ProcessStatsSectionProto proc_stats_section = 1;
4375}
4376
Chenjie Yuf910b7802019-01-11 16:08:20 -08004377/**
4378 * Pulled from ProcessStatsService.java
4379 */
4380message ProcStatsPkgProc {
4381 optional ProcessStatsSectionProto proc_stats_section = 1;
4382}
4383
Yangsteraf9aee72018-10-12 09:26:16 -07004384message PowerProfileProto {
4385 optional double cpu_suspend = 1;
4386
4387 optional double cpu_idle = 2;
4388
4389 optional double cpu_active = 3;
4390
4391 message CpuCluster {
4392 optional int32 id = 1;
4393 optional double cluster_power = 2;
4394 optional int32 cores = 3;
4395 repeated int64 speed = 4;
4396 repeated double core_power = 5;
4397 }
4398
4399 repeated CpuCluster cpu_cluster = 40;
4400
4401 optional double wifi_scan = 4;
4402
4403 optional double wifi_on = 5;
4404
4405 optional double wifi_active = 6;
4406
4407 optional double wifi_controller_idle = 7;
4408
4409 optional double wifi_controller_rx = 8;
4410
4411 optional double wifi_controller_tx = 9;
4412
4413 repeated double wifi_controller_tx_levels = 10;
4414
4415 optional double wifi_controller_operating_voltage = 11;
4416
4417 optional double bluetooth_controller_idle = 12;
4418
4419 optional double bluetooth_controller_rx = 13;
4420
4421 optional double bluetooth_controller_tx = 14;
4422
4423 optional double bluetooth_controller_operating_voltage = 15;
4424
4425 optional double modem_controller_sleep = 16;
4426
4427 optional double modem_controller_idle = 17;
4428
4429 optional double modem_controller_rx = 18;
4430
4431 repeated double modem_controller_tx = 19;
4432
4433 optional double modem_controller_operating_voltage = 20;
4434
4435 optional double gps_on = 21;
4436
4437 repeated double gps_signal_quality_based = 22;
4438
4439 optional double gps_operating_voltage = 23;
4440
4441 optional double bluetooth_on = 24;
4442
4443 optional double bluetooth_active = 25;
4444
4445 optional double bluetooth_at_cmd = 26;
4446
4447 optional double ambient_display = 27;
4448
4449 optional double screen_on = 28;
4450
4451 optional double radio_on = 29;
4452
4453 optional double radio_scanning = 30;
4454
4455 optional double radio_active = 31;
4456
4457 optional double screen_full = 32;
4458
4459 optional double audio = 33;
4460
4461 optional double video = 34;
4462
4463 optional double flashlight = 35;
4464
4465 optional double memory = 36;
4466
4467 optional double camera = 37;
4468
4469 optional double wifi_batched_scan = 38;
4470
4471 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004472}
Chenjie Yuab530202018-09-26 12:39:20 -07004473
4474/**
4475 * power_profile.xml and other constants for power model calculations.
4476 * Pulled from PowerProfile.java
4477 */
4478message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004479 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004480}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004481
4482/**
arangelovd5db50e2018-10-12 20:24:39 +01004483 * Logs when a user restriction was added or removed.
4484 *
4485 * Logged from:
4486 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4487 */
4488message UserRestrictionChanged {
4489 // The raw string of the user restriction as defined in UserManager.
4490 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4491 optional string restriction = 1;
4492 // Whether the restriction is enabled or disabled.
4493 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004494}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004495
4496/**
4497 * Pulls process user time and system time. Puller takes a snapshot of all pids
4498 * in the system and returns cpu stats for those that are working at the time.
4499 * Dead pids will be dropped. Kernel processes are excluded.
4500 * Min cool-down is 5 sec.
4501 */
4502message ProcessCpuTime {
4503 optional int32 uid = 1 [(is_uid) = true];
4504
4505 optional string process_name = 2;
4506 // Process cpu time in user space, cumulative from boot/process start
4507 optional int64 user_time_millis = 3;
4508 // Process cpu time in system space, cumulative from boot/process start
4509 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004510}
Misha Wagner5a51e002018-10-03 15:04:09 +01004511
4512/**
4513 * Pulls the CPU usage for each thread.
4514 *
4515 * Read from /proc/$PID/task/$TID/time_in_state files.
4516 *
4517 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4518 * time_in_state files not being present on some phones, have not been addressed. These should be
4519 * considered before a public release.
4520 */
4521message CpuTimePerThreadFreq {
4522 // UID that owns the process.
4523 optional int32 uid = 1 [(is_uid) = true];
4524 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004525 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004526 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004527 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004528 // Name of the process taken from `/proc/$PID/cmdline`.
4529 optional string process_name = 4;
4530 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4531 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004532
4533 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4534 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4535 // frequencies are given here as the alternative is sending eight separate atoms. This method
4536 // significantly reduces the amount of data created
4537 optional int32 frequency1_khz = 6;
4538 optional int32 time1_millis = 7;
4539 optional int32 frequency2_khz = 8;
4540 optional int32 time2_millis = 9;
4541 optional int32 frequency3_khz = 10;
4542 optional int32 time3_millis = 11;
4543 optional int32 frequency4_khz = 12;
4544 optional int32 time4_millis = 13;
4545 optional int32 frequency5_khz = 14;
4546 optional int32 time5_millis = 15;
4547 optional int32 frequency6_khz = 16;
4548 optional int32 time6_millis = 17;
4549 optional int32 frequency7_khz = 18;
4550 optional int32 time7_millis = 19;
4551 optional int32 frequency8_khz = 20;
4552 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004553}
Bookatz75ee6042018-11-09 12:27:37 -08004554
4555/**
Bookatz366a4432018-11-20 09:42:33 -08004556 * Pulls information about the device's build.
4557 */
4558message BuildInformation {
4559 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4560 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4561 optional string fingerprint = 1;
4562
4563 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4564 optional string brand = 2;
4565
4566 // Build.PRODUCT. The name of the overall product.
4567 optional string product = 3;
4568
4569 // Build.DEVICE. The name of the industrial design.
4570 optional string device = 4;
4571
4572 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4573 optional string version_release = 5;
4574
4575 // Build.ID. E.g. a label like "M4-rc20".
4576 optional string id = 6;
4577
4578 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4579 // represent this build.
4580 optional string version_incremental = 7;
4581
4582 // Build.TYPE. The type of build, like "user" or "eng".
4583 optional string type = 8;
4584
4585 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4586 optional string tags = 9;
4587}
4588
4589/**
Bookatz75ee6042018-11-09 12:27:37 -08004590 * Pulls on-device BatteryStats power use calculations for the overall device.
4591 */
4592message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004593 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4594 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4595 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4596 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee6042018-11-09 12:27:37 -08004597}
4598
4599/**
4600 * Pulls on-device BatteryStats power use calculations broken down by uid.
4601 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4602 * that is attributed to non-uid items. They must all be included to get the total power use.
4603 */
4604message DeviceCalculatedPowerBlameUid {
4605 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4606 optional int32 uid = 1 [(is_uid) = true];
4607
Bookatz3dbc13a2018-12-21 12:16:51 -08004608 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4609 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4610 optional int64 power_nano_amp_secs = 2;
Bookatz75ee6042018-11-09 12:27:37 -08004611}
4612
4613/**
4614 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4615 * drain type.
4616 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4617 * is attributed uids. They must all be included to get the total power use.
4618 */
4619message DeviceCalculatedPowerBlameOther {
4620 // The type of item whose power use is being reported.
4621 enum DrainType {
4622 AMBIENT_DISPLAY = 0;
4623 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4624 BLUETOOTH = 2;
4625 CAMERA = 3;
4626 // Cell-standby
4627 CELL = 4;
4628 FLASHLIGHT = 5;
4629 IDLE = 6;
4630 MEMORY = 7;
4631 // Amount that total computed drain exceeded the drain estimated using the
4632 // battery level changes and capacity.
4633 OVERCOUNTED = 8;
4634 PHONE = 9;
4635 SCREEN = 10;
4636 // Amount that total computed drain was below the drain estimated using the
4637 // battery level changes and capacity.
4638 UNACCOUNTED = 11;
4639 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
4640 WIFI = 13;
4641 }
4642 optional DrainType drain_type = 1;
4643
Bookatz3dbc13a2018-12-21 12:16:51 -08004644 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4645 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4646 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004647}
arangelov4e994062018-11-13 16:12:38 +00004648
4649/**
4650 * Logs device policy features.
4651 *
4652 * Logged from:
4653 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4654 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
4655 */
4656message DevicePolicyEvent {
4657 // The event id - unique for each event.
4658 optional android.stats.devicepolicy.EventId event_id = 1;
4659 // The admin package name.
4660 optional string admin_package_name = 2;
4661 // A generic integer parameter.
4662 optional int32 integer_value = 3;
4663 // A generic boolean parameter.
4664 optional bool boolean_value = 4;
4665 // A parameter specifying a time period in milliseconds.
4666 optional uint64 time_period_millis = 5;
4667 // A parameter specifying a list of package names, bundle extras or string parameters.
4668 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
4669}
shawnlinea5b66b2018-11-13 15:05:29 +08004670
4671/**
4672 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
4673 *
4674 * Logged from:
4675 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4676 */
4677message DocsUILaunchReported {
4678 optional android.stats.docsui.LaunchAction launch_action = 1;
4679 optional bool has_initial_uri = 2;
4680 optional android.stats.docsui.MimeType mime_type = 3;
4681 optional android.stats.docsui.Root initial_root = 4;
4682}
4683
4684/**
4685 * Logs root/app visited event in file managers/picker. Call this when the user
4686 * taps on root/app in hamburger menu.
4687 *
4688 * Logged from:
4689 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4690 */
4691message DocsUIRootVisitedReported {
4692 optional android.stats.docsui.ContextScope scope = 1;
4693 optional android.stats.docsui.Root root = 2;
4694}
4695
4696/**
4697 * Logs file operation stats. Call this when a file operation has completed.
4698 *
4699 * Logged from:
4700 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4701 */
4702message DocsUIFileOperationReported {
4703 optional android.stats.docsui.Provider provider = 1;
4704 optional android.stats.docsui.FileOperation file_op = 2;
4705}
4706
4707/**
4708 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
4709 * mode.
4710 *
4711 * Logged from:
4712 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4713 */
4714message DocsUIFileOperationCopyMoveModeReported {
4715 optional android.stats.docsui.FileOperation file_op = 1;
4716 optional android.stats.docsui.CopyMoveOpMode mode = 2;
4717}
4718
4719
4720/**
4721 * Logs file sub operation stats. Call this when a file operation has failed.
4722 *
4723 * Logged from:
4724 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4725 */
4726message DocsUIFileOperationFailureReported {
4727 optional android.stats.docsui.Authority authority = 1;
4728 optional android.stats.docsui.SubFileOperation sub_op = 2;
4729}
4730
4731/**
4732* Logs the cancellation of a file operation. Call this when a job is canceled
4733*
4734* Logged from:
4735* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4736*/
4737message DocsUIFileOperationCanceledReported {
4738 optional android.stats.docsui.FileOperation file_op = 1;
4739}
4740
4741/**
4742 * Logs startup time in milliseconds.
4743 *
4744 * Logged from:
4745 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4746 */
4747message DocsUIStartupMsReported {
4748 optional int32 startup_millis = 1;
4749}
4750
4751/**
4752 * Logs the action that was started by user.
4753 *
4754 * Logged from:
4755 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4756 */
4757message DocsUIUserActionReported {
4758 optional android.stats.docsui.UserAction action = 1;
4759}
4760
4761/**
4762 * Logs the invalid type when invalid scoped access is requested.
4763 *
4764 * Logged from:
4765 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
4766 */
4767message DocsUIInvalidScopedAccessRequestReported {
4768 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00004769}
Ben Murdochbab399f2018-12-06 11:01:38 +00004770
4771/**
shawnlina75e82d2019-01-07 10:31:12 +08004772 * Logs the package name that launches docsui picker mode.
4773 *
4774 * Logged from:
4775 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4776 */
4777message DocsUIPickerLaunchedFromReported {
4778 optional string package_name = 1;
4779}
4780
4781/**
4782 * Logs the search type.
4783 *
4784 * Logged from:
4785 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4786 */
4787message DocsUISearchTypeReported {
4788 optional android.stats.docsui.SearchType search_type = 1;
4789}
4790
4791/**
4792 * Logs the search mode.
4793 *
4794 * Logged from:
4795 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4796 */
4797message DocsUISearchModeReported {
4798 optional android.stats.docsui.SearchMode search_mode = 1;
4799}
4800
4801/**
4802 * Logs the pick result information.
4803 *
4804 * Logged from:
4805 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
4806 */
4807message DocsUIPickResultReported {
4808 optional int32 total_action_count = 1;
4809 optional int64 duration_millis = 2;
4810 optional int32 file_count= 3;
4811 optional bool is_searching = 4;
4812 optional android.stats.docsui.Root picked_from = 5;
4813 optional android.stats.docsui.MimeType mime_type = 6;
4814 optional int32 repeatedly_pick_times = 7;
4815}
4816
4817/**
Ben Murdochbab399f2018-12-06 11:01:38 +00004818 * Logs when an app's memory is compacted.
4819 *
4820 * Logged from:
4821 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
4822 */
4823message AppCompacted {
4824 // The pid of the process being compacted.
4825 optional int32 pid = 1;
4826
4827 // The name of the process being compacted.
4828 optional string process_name = 2;
4829
4830 // The type of compaction.
4831 enum Action {
4832 UNKNOWN = 0;
4833 SOME = 1;
4834 FULL = 2;
4835 }
Ben Murdoch01720b82018-12-19 18:03:44 +00004836 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00004837
4838 // Total RSS in kilobytes consumed by the process prior to compaction.
4839 optional int64 before_rss_total_kilobytes = 4;
4840
4841 // File RSS in kilobytes consumed by the process prior to compaction.
4842 optional int64 before_rss_file_kilobytes = 5;
4843
4844 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
4845 optional int64 before_rss_anon_kilobytes = 6;
4846
4847 // Swap in kilobytes consumed by the process prior to compaction.
4848 optional int64 before_swap_kilobytes = 7;
4849
4850 // Total RSS in kilobytes consumed by the process after compaction.
4851 optional int64 after_rss_total_kilobytes = 8;
4852
4853 // File RSS in kilobytes consumed by the process after compaction.
4854 optional int64 after_rss_file_kilobytes = 9;
4855
4856 // Anonymous RSS in kilobytes consumed by the process after compaction.
4857 optional int64 after_rss_anon_kilobytes = 10;
4858
4859 // Swap in kilobytes consumed by the process after compaction.
4860 optional int64 after_swap_kilobytes = 11;
4861
4862 // The time taken to perform compaction in milliseconds.
4863 optional int64 time_to_compact_millis = 12;
4864
4865 // The last compaction action performed for this app.
4866 optional Action last_action = 13;
4867
Ben Murdoch01720b82018-12-19 18:03:44 +00004868 // The last time that compaction was attempted on this process in milliseconds
4869 // since boot, not including sleep (see SystemClock.uptimeMillis()).
4870 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00004871
Ben Murdoch01720b82018-12-19 18:03:44 +00004872 // The oom_score_adj at the time of compaction.
4873 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00004874
4875 // The process state at the time of compaction.
4876 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00004877
4878 // Free ZRAM in kilobytes before compaction.
4879 optional int64 before_zram_free_kilobytes = 17;
4880
4881 // Free ZRAM in kilobytes after compaction.
4882 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00004883}
lifr157fc552018-12-12 16:38:04 +08004884
4885/**
4886 * Logs the latency period(in microseconds) and the return code of
4887 * the DNS(Domain Name System) lookups.
4888 * These 4 methods(GETADDRINFO,GETHOSTBYNAME,GETHOSTBYADDR,RES_NSEND)
4889 * to get info(address or hostname) from DNS server(or DNS cache).
4890 * Logged from:
4891 * /system/netd/server/DnsProxyListener.cpp
4892 */
4893message NetworkDnsEventReported {
4894 // The types of the DNS lookups, as defined in
4895 //system/netd/server/binder/android/net/metrics/INetdEventListener.aidl
4896 enum EventType {
4897 EVENT_UNKNOWN = 0;
4898 EVENT_GETADDRINFO = 1;
4899 EVENT_GETHOSTBYNAME = 2;
4900 EVENT_GETHOSTBYADDR = 3;
4901 EVENT_RES_NSEND = 4;
4902 }
4903 optional EventType event_type = 1;
4904
4905 // The return value of the DNS resolver for each DNS lookups.
4906 //bionic/libc/include/netdb.h
4907 //system/netd/resolv/include/netd_resolv/resolv.h
4908 enum ReturnCode {
lifr357b7cf2019-01-15 02:05:45 +08004909 EAI_NO_ERROR = 0;
lifr157fc552018-12-12 16:38:04 +08004910 EAI_ADDRFAMILY = 1;
4911 EAI_AGAIN = 2;
4912 EAI_BADFLAGS = 3;
4913 EAI_FAIL = 4;
4914 EAI_FAMILY = 5;
4915 EAI_MEMORY = 6;
4916 EAI_NODATA = 7;
4917 EAI_NONAME = 8;
4918 EAI_SERVICE = 9;
4919 EAI_SOCKTYPE = 10;
4920 EAI_SYSTEM = 11;
4921 EAI_BADHINTS = 12;
4922 EAI_PROTOCOL = 13;
4923 EAI_OVERFLOW = 14;
4924 RESOLV_TIMEOUT = 255;
4925 EAI_MAX = 256;
4926 }
4927 optional ReturnCode return_code = 2;
4928
4929 // The latency period(in microseconds) it took for this DNS lookup to complete.
4930 optional int32 latency_micros = 3;
4931}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08004932
4933/**
4934 * Logs when a data stall event occurs.
4935 *
4936 * Log from:
4937 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4938 */
4939message DataStallEvent {
4940 // Data stall evaluation type.
4941 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
4942 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
4943 optional int32 evaluation_type = 1;
4944 // See definition in data_stall_event.proto.
4945 optional com.android.server.connectivity.ProbeResult validation_result = 2;
4946 // See definition in data_stall_event.proto.
4947 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
4948 // See definition in data_stall_event.proto.
4949 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
4950 // See definition in data_stall_event.proto.
4951 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
4952 // See definition in data_stall_event.proto.
4953 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
4954}
Christian Brunschenf86039e2018-12-21 12:26:14 +00004955
4956/*
4957 * Logs when RescueParty resets some set of experiment flags.
4958 *
4959 * Logged from:
4960 * frameworks/base/services/core/java/com/android/server/RescueParty.java
4961 */
4962message RescuePartyResetReported {
4963 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
4964 optional int32 rescue_level = 1;
4965}
Mathew Inwoodb375be52019-01-04 11:36:25 +00004966
4967/**
4968 * Logs when signed config is received from an APK, and if that config was applied successfully.
4969 * Logged from:
4970 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
4971 */
4972message SignedConfigReported {
4973 enum Type {
4974 UNKNOWN_TYPE = 0;
4975 GLOBAL_SETTINGS = 1;
4976 }
4977 optional Type type = 1;
4978
4979 // The final status of the signed config received.
4980 enum Status {
4981 UNKNOWN_STATUS = 0;
4982 APPLIED = 1;
4983 BASE64_FAILURE_CONFIG = 2;
4984 BASE64_FAILURE_SIGNATURE = 3;
4985 SECURITY_EXCEPTION = 4;
4986 INVALID_CONFIG = 5;
4987 OLD_CONFIG = 6;
4988 SIGNATURE_CHECK_FAILED = 7;
4989 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00004990 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00004991 }
4992 optional Status status = 2;
4993
4994 // The version of the signed config processed.
4995 optional int32 version = 3;
4996
4997 // The package name that the config was extracted from.
4998 optional string from_package = 4;
4999
5000 enum Key {
5001 NO_KEY = 0;
5002 DEBUG = 1;
5003 PRODUCTION = 2;
5004 }
5005 // Which key was used to verify the config.
5006 optional Key verified_with = 5;
5007}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005008
5009/*
5010 * Logs GNSS Network-Initiated (NI) location events.
5011 *
5012 * Logged from:
5013 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5014 */
5015message GnssNiEventReported {
5016 // The type of GnssNiEvent.
5017 enum EventType {
5018 UNKNOWN = 0;
5019 NI_REQUEST = 1;
5020 NI_RESPONSE = 2;
5021 }
5022 optional EventType event_type = 1;
5023
5024 // An ID generated by HAL to associate NI notifications and UI responses.
5025 optional int32 notification_id = 2;
5026
5027 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005028 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005029
5030 // NI requires notification.
5031 optional bool need_notify = 4;
5032
5033 // NI requires verification.
5034 optional bool need_verify = 5;
5035
5036 // NI requires privacy override, no notification/minimal trace.
5037 optional bool privacy_override = 6;
5038
5039 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5040 // seconds.
5041 optional int32 timeout = 7;
5042
5043 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005044 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005045
5046 // String representing the requester of the network inititated location request.
5047 optional string requestor_id = 9;
5048
5049 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5050 // network initiated location request.
5051 optional string text = 10;
5052
5053 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005054 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005055
5056 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005057 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005058
5059 // True if SUPL ES is enabled.
5060 optional bool is_supl_es_enabled = 13;
5061
5062 // True if GNSS location is enabled.
5063 optional bool is_location_enabled = 14;
5064
5065 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005066 optional android.server.location.GnssUserResponseType user_response = 15;
5067}
5068
5069/**
5070 * Logs GNSS non-framework (NFW) location notification.
5071 *
5072 * Logged from:
5073 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5074 */
5075message GnssNfwNotificationReported {
5076 // Package name of the Android proxy application representing the non-framework entity that
5077 // requested location. Set to empty string if unknown.
5078 optional string proxy_app_package_name = 1;
5079
5080 // Protocol stack that initiated the non-framework location request.
5081 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5082
5083 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5084 // set to empty string. This field is opaque to the framework and used for logging purposes.
5085 optional string other_protocol_stack_name = 3;
5086
5087 // Source initiating/receiving the location information.
5088 optional android.server.location.NfwRequestor requestor = 4;
5089
5090 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5091 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5092 // and used for logging purposes.
5093 optional string requestor_id = 5;
5094
5095 // Indicates whether location information was provided for this request.
5096 optional android.server.location.NfwResponseType response_type = 6;
5097
5098 // True if the device is in user initiated emergency session.
5099 optional bool in_emergency_mode = 7;
5100
5101 // True if cached location is provided.
5102 optional bool is_cached_location = 8;
5103
5104 // True if proxy app permission mismatch between framework and GNSS HAL.
5105 optional bool is_permission_mismatched = 9;
5106}
5107
5108/**
5109 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5110 *
5111 * Logged from:
5112 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5113 */
5114message GnssConfigurationReported {
5115 // SUPL host name.
5116 optional string supl_host = 1;
5117
5118 // SUPL port number.
5119 optional int32 supl_port = 2;
5120
5121 // C2K host name.
5122 optional string c2k_host = 3;
5123
5124 // C2K port number.
5125 optional int32 c2k_port = 4;
5126
5127 // The SUPL version requested by Carrier.
5128 optional int32 supl_ver = 5;
5129
5130 // The SUPL mode.
5131 optional android.server.location.SuplMode supl_mode = 6;
5132
5133 // True if NI emergency SUPL restrictions is enabled.
5134 optional bool supl_es = 7;
5135
5136 // LTE Positioning Profile settings
5137 optional android.server.location.LppProfile lpp_profile = 8;
5138
5139 // Positioning protocol on A-Glonass system.
5140 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5141
5142 // True if emergency PDN is used. Otherwise, regular PDN is used.
5143 optional bool use_emergency_pdn_for_emergency_supl= 10;
5144
5145 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5146 optional android.server.location.GpsLock gps_lock = 11;
5147
5148 // Number of seconds to extend the emergency session duration post emergency call.
5149 optional int32 es_extension_sec = 12;
5150
5151 // The full list of package names of proxy Android applications representing the non-framework
5152 // location access entities (on/off the device) for which the framework user has granted
5153 // non-framework location access permission. The package names are concatenated in one string
5154 // with spaces as separators.
5155 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005156}
Jack Yu95b64f32018-12-13 18:26:11 +08005157
5158/**
5159 * Logs when a NFC device's error occurred.
5160 * Logged from:
5161 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5162 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5163 */
5164message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005165 enum Type {
5166 UNKNOWN = 0;
5167 CMD_TIMEOUT = 1;
5168 ERROR_NOTIFICATION = 2;
5169 AID_OVERFLOW = 3;
5170 }
5171 optional Type type = 1;
5172 // If it's nci cmd timeout, log the timeout command.
5173 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005174
Alex Salod7c3eef2019-01-25 14:43:27 -08005175 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005176}
5177
5178/**
5179 * Logs when a NFC device's state changed event
5180 * Logged from:
5181 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5182 */
5183message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005184 enum State {
5185 UNKNOWN = 0;
5186 OFF = 1;
5187 ON = 2;
5188 ON_LOCKED = 3; // Secure Nfc enabled.
5189 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5190 }
5191 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005192}
5193
5194/**
5195 * Logs when a NFC Beam Transaction occurred.
5196 * Logged from:
5197 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5198 */
5199message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005200 enum Operation {
5201 UNKNOWN = 0;
5202 SEND = 1;
5203 RECEIVE = 2;
5204 }
5205 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005206}
5207
5208/**
5209 * Logs when a NFC Card Emulation Transaction occurred.
5210 * Logged from:
5211 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5212 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5213 */
5214message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005215 enum Category {
5216 UNKNOWN = 0;
5217 HCE_PAYMENT = 1;
5218 HCE_OTHER = 2;
5219 OFFHOST = 3;
5220 }
5221 // Transaction belongs to HCE payment or HCE other category, or offhost.
5222 optional Category category = 1;
5223 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5224 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005225}
5226
5227/**
5228 * Logs when a NFC Tag event occurred.
5229 * Logged from:
5230 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5231 */
5232message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005233 enum Type {
5234 UNKNOWN = 0;
5235 URL = 1;
5236 BT_PAIRING = 2;
5237 PROVISION = 3;
5238 WIFI_CONNECT = 4;
5239 APP_LAUNCH = 5;
5240 OTHERS = 6;
5241 }
5242 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005243}
5244
5245/**
5246 * Logs when Hce transaction triggered
5247 * Logged from:
5248 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5249 */
5250message NfcHceTransactionOccurred {
5251 // The latency period(in microseconds) it took for the first HCE data
5252 // exchange.
5253 optional uint32 latency_micros = 1;
5254}
5255
5256/**
5257 * Logs when SecureElement state event changed
5258 * Logged from:
5259 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5260 */
5261message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005262 enum State {
5263 UNKNOWN = 0;
5264 INITIALIZED = 1;
5265 DISCONNECTED = 2;
5266 CONNECTED = 3;
5267 HALCRASH = 4;
5268 }
5269 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005270
Alex Salod7c3eef2019-01-25 14:43:27 -08005271 optional string state_change_reason = 2;
5272 // SIMx or eSEx.
5273 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005274}
5275
5276/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005277 * Information about a permission grant request
5278 */
5279message PermissionGrantRequestResultReported {
5280 // unique value identifying an API call. A API call might result in multiple of these atoms
5281 optional int64 request_id = 1;
5282
5283 // UID of package requesting the permission grant
5284 optional int32 requesting_uid = 2 [(is_uid) = true];
5285
5286 // Name of package requesting the permission grant
5287 optional string requesting_package_name = 3;
5288
5289 // The permission to be granted
5290 optional string permission_name = 4;
5291
5292 // If the permission was explicitly requested via the API or added by the system
5293 optional bool is_implicit = 5;
5294
5295 enum Result {
5296 UNDEFINED = 0;
5297 // permission request was ignored
5298 IGNORED = 1;
5299 // permission request was ignored because it was user fixed
5300 IGNORED_USER_FIXED = 2;
5301 // permission request was ignored because it was policy fixed
5302 IGNORED_POLICY_FIXED = 3;
5303 // permission was granted by user action
5304 USER_GRANTED = 4;
5305 // permission was automatically granted
5306 AUTO_GRANTED = 5;
5307 // permission was denied by user action
5308 USER_DENIED = 6;
5309 // permission was denied with prejudice by the user
5310 USER_DENIED_WITH_PREJUDICE = 7;
5311 // permission was automatically denied
5312 AUTO_DENIED = 8;
5313 }
5314 // The result of the permission grant
5315 optional Result result = 6;
5316}
5317
5318/**
Jack Yu95b64f32018-12-13 18:26:11 +08005319 * Logs when Omapi API used
5320 * Logged from:
5321 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5322 */
5323message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005324 enum Operation {
5325 UNKNOWN = 0;
5326 OPEN_CHANNEL = 1;
5327 }
5328 optional Operation operation = 1;
5329 // SIMx or eSEx.
5330 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005331
Alex Salod7c3eef2019-01-25 14:43:27 -08005332 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005333}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005334
5335/**
Alex Saloa060aee2019-01-21 14:36:41 -08005336 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5337 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005338 * Logged from:
5339 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5340 */
5341message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005342 optional int64 dispatch_latency_millis = 1;
5343}
5344
5345/**
5346 * Logs AttentionManagerService attention check result.
5347 *
5348 * Logged from:
5349 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5350 */
5351message AttentionManagerServiceResultReported {
5352 // See core/java/android/service/attention/AttentionService.java
5353 enum AttentionCheckResult {
5354 UNKNOWN = 20;
5355 ATTENTION_SUCCESS_ABSENT = 0;
5356 ATTENTION_SUCCESS_PRESENT = 1;
5357 ATTENTION_FAILURE_PREEMPTED = 2;
5358 ATTENTION_FAILURE_TIMED_OUT = 3;
5359 ATTENTION_FAILURE_UNKNOWN = 4;
5360 }
5361 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005362}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005363
5364/**
5365 * Logs when an adb connection changes state.
5366 *
5367 * Logged from:
5368 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5369 */
5370message AdbConnectionChanged {
5371 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5372 // previously selected for this system.
5373 optional int64 last_connection_time_millis = 1;
5374
5375 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5376 // to reconnect via adb without user interaction.
5377 optional int64 auth_window_millis = 2;
5378
5379 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5380 optional android.debug.AdbConnectionStateEnum state = 3;
5381
5382 // True if the 'always allow' option was selected for this system.
5383 optional bool always_allow = 4;
5384}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005385
5386/*
5387 * Logs the reported speech DSP status.
5388 *
5389 * Logged from:
5390 * Vendor audio implementation.
5391 */
5392message SpeechDspStatReported {
5393 // The total Speech DSP uptime in milliseconds.
5394 optional int32 total_uptime_millis = 1;
5395 // The total Speech DSP downtime in milliseconds.
5396 optional int32 total_downtime_millis = 2;
5397 optional int32 total_crash_count = 3;
5398 optional int32 total_recover_count = 4;
5399}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005400
5401/**
5402 * Logs USB connector contaminant status.
5403 *
5404 * Logged from: USB Service.
5405 */
5406message UsbContaminantReported {
5407 optional string id = 1;
5408 optional android.service.usb.ContaminantPresenceStatus status = 2;
5409}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005410
5411/**
5412 * This atom is for debugging purpose.
5413 */
5414message DebugElapsedClock {
5415 // Monotically increasing value for each pull.
5416 optional int64 pull_count = 1;
5417 // Time from System.elapsedRealtime.
5418 optional int64 elapsed_clock_millis = 2;
5419 // Time from System.elapsedRealtime.
5420 optional int64 same_elapsed_clock_millis = 3;
5421 // Diff between current elapsed time and elapsed time from previous pull.
5422 optional int64 elapsed_clock_diff_millis = 4;
5423
5424 enum Type {
5425 TYPE_UNKNOWN = 0;
5426 ALWAYS_PRESENT = 1;
5427 PRESENT_ON_ODD_PULLS = 2;
5428 }
5429 // Type of behavior for the pulled data.
5430 optional Type type = 5;
5431}
5432
5433/**
5434 * This atom is for debugging purpose.
5435 */
5436message DebugFailingElapsedClock {
5437 // Monotically increasing value for each pull.
5438 optional int64 pull_count = 1;
5439 // Time from System.elapsedRealtime.
5440 optional int64 elapsed_clock_millis = 2;
5441 // Time from System.elapsedRealtime.
5442 optional int64 same_elapsed_clock_millis = 3;
5443 // Diff between current elapsed time and elapsed time from previous pull.
5444 optional int64 elapsed_clock_diff_millis = 4;
5445}
Steven Wuacef6bb2019-01-23 14:21:17 -05005446
5447/** Logs System UI bubbles event changed.
5448 *
5449 * Logged from:
5450 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5451 */
5452message BubbleUIChanged {
5453
5454 // The app package that is posting the bubble.
5455 optional string package_name = 1;
5456
5457 // The notification channel that is posting the bubble.
5458 optional string notification_channel = 2;
5459
5460 // The notification id associated with the posted bubble.
5461 optional int32 notification_id = 3;
5462
5463 // The position of the bubble within the bubble stack.
5464 optional int32 position = 4;
5465
5466 // The total number of bubbles within the bubble stack.
5467 optional int32 total_number = 5;
5468
5469 // User interactions with the bubble.
5470 enum Action {
5471 UNKNOWN = 0;
5472 POSTED = 1;
5473 UPDATED = 2;
5474 EXPANDED = 3;
5475 COLLAPSED = 4;
5476 DISMISSED = 5;
5477 STACK_DISMISSED = 6;
5478 STACK_MOVED = 7;
5479 HEADER_GO_TO_APP = 8;
5480 HEADER_GO_TO_SETTINGS = 9;
5481 PERMISSION_OPT_IN = 10;
5482 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005483 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005484 SWIPE_LEFT = 13;
5485 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005486 STACK_EXPANDED = 15;
Steven Wuacef6bb2019-01-23 14:21:17 -05005487 }
5488 optional Action action = 6;
5489
5490 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5491 optional float normalized_x_position = 7;
5492 optional float normalized_y_position = 8;
5493}
Kweku Adams8845d012018-12-11 20:06:45 -08005494
5495/**
Steven Wu552f63f2019-02-05 13:41:36 -05005496 * Logs System UI bubbles developer errors.
5497 *
5498 * Logged from:
5499 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5500 */
5501message BubbleDeveloperErrorReported {
5502
5503 // The app package that is posting the bubble.
5504 optional string package_name = 1;
5505
5506 // Bubble developer error type enums.
5507 enum Error {
5508 UNKNOWN = 0;
5509 ACTIVITY_INFO_MISSING = 1;
5510 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5511 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5512 }
5513 optional Error error = 2 [default = UNKNOWN];
5514}
5515
5516/**
Kweku Adams8845d012018-12-11 20:06:45 -08005517 * Logs that a constraint for a scheduled job has changed.
5518 *
5519 * Logged from:
5520 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5521 */
5522message ScheduledJobConstraintChanged {
5523 repeated AttributionNode attribution_node = 1;
5524
5525 // Name of the job.
5526 optional string job_name = 2;
5527
5528 optional com.android.server.job.ConstraintEnum constraint = 3;
5529
5530 enum State {
5531 UNSATISFIED = 0;
5532 SATISFIED = 1;
5533 }
5534 optional State state = 4;
5535}
Alex Salod7c3eef2019-01-25 14:43:27 -08005536
5537/**
5538 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5539 * returns true.
5540 *
5541 * Logged from:
5542 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5543 */
5544message ScreenTimeoutExtensionReported {
5545 // Describes how many times in a row did the power manager reset the screen off timeout.
5546 optional uint32 consecutive_timeout_extended_count = 1;
5547}
Hui Yu885aca12019-01-10 17:11:34 -08005548
5549/*
5550* Logs number of milliseconds it takes to start a process.
5551* The definition of app process start time is from the app launch time to
5552* the time that Zygote finished forking the app process and loaded the
5553* application package's java classes.
5554
5555* This metric is different from AppStartOccurred which is for foreground
5556* activity only.
5557
5558* ProcessStartTime can report all processes (both foreground and background)
5559* start time.
5560*
5561* Logged from:
5562* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5563*/
5564message ProcessStartTime {
5565 // The uid of the ProcessRecord.
5566 optional int32 uid = 1 [(is_uid) = true];
5567
5568 // The process pid.
5569 optional int32 pid = 2;
5570
5571 // The process name.
5572 // Usually package name, "system" for system server.
5573 // Provided by ActivityManagerService.
5574 optional string process_name = 3;
5575
5576 enum StartType {
5577 UNKNOWN = 0;
5578 WARM = 1;
5579 HOT = 2;
5580 COLD = 3;
5581 }
5582
5583 // The start type.
5584 optional StartType type = 4;
5585
5586 // The elapsed realtime at the start of the process.
5587 optional int64 process_start_time_millis = 5;
5588
5589 // Number of milliseconds it takes to reach bind application.
5590 optional int32 bind_application_delay_millis = 6;
5591
5592 // Number of milliseconds it takes to finish start of the process.
5593 optional int32 process_start_delay_millis = 7;
5594
5595 // hostingType field in ProcessRecord, the component type such as "activity",
5596 // "service", "content provider", "broadcast" or other strings.
5597 optional string hosting_type = 8;
5598
5599 // hostingNameStr field in ProcessRecord. The component class name that runs
5600 // in this process.
5601 optional string hosting_name = 9;
5602}
5603
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005604/**
5605 * State of a dangerous permission requested by a package
5606 */
5607message DangerousPermissionState {
5608 // Name of the permission
5609 optional string permission_name = 1;
5610
5611 // Uid of the package
5612 optional int32 uid = 2 [(is_uid) = true];
5613
5614 // Package requesting the permission
5615 optional string package_name = 3;
5616
5617 // If the permission is granted to the uid
5618 optional bool is_granted = 4;
5619}
5620
Michael Groover4a0ca942019-01-24 17:41:25 -08005621/**
5622 * Logs when a package is denied access to a device identifier based on the new access requirements.
5623 *
5624 * Logged from:
5625 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
5626 */
5627message DeviceIdentifierAccessDenied {
5628 // The name of the package denied access to the requested device identifier.
5629 optional string package_name = 1;
5630
5631 // The name of the device identifier method the package attempted to invoke.
5632 optional string method_name = 2;
5633
5634 // True if the package is preinstalled.
5635 optional bool is_preinstalled = 3;
5636
5637 // True if the package is privileged.
5638 optional bool is_priv_app = 4;
5639}
Chenjie Yue13f44a2019-02-07 17:51:38 -08005640
5641/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08005642 * Pulls the ongoing mainline install train version code.
5643 * Pulled from StatsCompanionService
5644 */
5645message TrainInfo {
5646 optional int64 train_version_code = 1;
5647
5648 optional TrainExperimentIds train_experiment_id = 2;
5649}
joshmccloskey8c3322e2019-01-09 18:25:57 -08005650
5651/**
5652 * Logs the gesture stage changed event.
5653 *
5654 * Logged from:
5655 * frameworks/base/packages/SystemUI/
5656 */
5657message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005658 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005659}
5660
5661/**
5662 * Logs the feedback type.
5663 *
5664 * Logged from:
5665 * frameworks/base/packages/SystemUI/
5666 */
5667message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005668 // Whether or not the gesture was used.
5669 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005670}
5671
5672/**
5673 * Logs the progress.
5674 *
5675 * Logged from:
5676 * frameworks/base/packages/SystemUI/
5677 */
5678message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08005679 // [0,100] progress for the assist gesture.
5680 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08005681}
Neil Fullerdb14b482019-02-05 19:44:44 +00005682
5683/*
5684 * Information about the time zone data on a device.
5685 */
5686message TimeZoneDataInfo {
5687 // A version identifier for the data set on device. e.g. "2018i"
5688 optional string tzdb_version = 1;
5689}