blob: d457ff9f212fc0a2fbe32ddde49750b6c2bda725 [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";
Tej Singh33a412b2018-03-16 18:43:59 -070025import "frameworks/base/core/proto/android/app/job/enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070026import "frameworks/base/core/proto/android/app/settings_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";
Chiachang Wang0e88ebf2019-03-21 10:18:07 +080043import "frameworks/base/core/proto/android/stats/connectivity/network_stack.proto";
lifra2e19c02019-04-16 22:16:30 +080044import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.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";
Ben Blount763a5d52019-04-10 11:48:58 -070047import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
48import "frameworks/base/core/proto/android/stats/enums.proto";
49import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070050import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Hongyi Zhang700137e2019-05-23 21:19:36 -070051import "frameworks/base/core/proto/android/stats/location/location_enums.proto";
Ray Essick8ab04df2019-02-15 11:01:02 -080052import "frameworks/base/core/proto/android/stats/mediametrics/mediametrics.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000053import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080054import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080055import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080056import "frameworks/base/core/proto/android/telephony/enums.proto";
57import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080058import "frameworks/base/core/proto/android/wifi/enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080059
Yao Chend54f9dd2017-10-17 17:37:48 +000060/**
Stefan Lafonae2df012017-11-14 09:17:21 -080061 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000062 * raw stats log events from the Android system, also known as "atoms."
63 *
64 * This field contains a single oneof with all of the available messages.
65 * The stats-log-api-gen tool runs as part of the Android build and
66 * generates the android.util.StatsLog class, which contains the constants
67 * and methods that Android uses to log.
68 *
Stefan Lafonae2df012017-11-14 09:17:21 -080069 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000070 * Instead, statsd on Android constructs these messages synthetically,
71 * in the format defined here and in stats_log.proto.
72 */
Stefan Lafonae2df012017-11-14 09:17:21 -080073message Atom {
74 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070075 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070076 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
77 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070078 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070079 BleScanResultReceived ble_scan_result_received = 4;
80 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080081 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070082 SyncStateChanged sync_state_changed = 7;
83 ScheduledJobStateChanged scheduled_job_state_changed = 8;
84 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070085 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080086 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
87 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
88 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070089 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
90 MemoryFactorStateChanged memory_factor_state_changed = 15;
91 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
92 CachedKillReported cached_kill_reported = 17;
93 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070094 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080095 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
96 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
97 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070098 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080099 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -0700100 CameraStateChanged camera_state_changed = 25;
101 FlashlightStateChanged flashlight_state_changed = 26;
102 UidProcessStateChanged uid_process_state_changed = 27;
103 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
104 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -0700105 BatteryLevelChanged battery_level_changed = 30;
106 ChargingStateChanged charging_state_changed = 31;
107 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -0700108 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800109 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -0700110 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
111 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -0700112 WifiLockStateChanged wifi_lock_state_changed = 37;
113 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
114 WifiScanStateChanged wifi_scan_state_changed = 39;
115 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700116 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700117 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700118 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900119 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700120 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800121 AnomalyDetected anomaly_detected = 46;
Andrei Oneada01ea52019-01-30 15:28:36 +0000122 AppBreadcrumbReported app_breadcrumb_reported = 47 [(allow_from_any_uid) = true];
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800123 AppStartOccurred app_start_occurred = 48;
124 AppStartCanceled app_start_canceled = 49;
125 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800126 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800127 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800128 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800129 LmkStateChanged lmk_state_changed = 54;
130 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800131 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800132 BootSequenceReported boot_sequence_reported = 57;
Andrei Oneada01ea52019-01-30 15:28:36 +0000133 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -0800134 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800135 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800136 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800137 KeyguardStateChanged keyguard_state_changed = 62;
138 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
139 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800140 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800141 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800142 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
143 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800144 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700145 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800146 SpeakerImpedanceReported speaker_impedance_reported = 71;
147 HardwareFailed hardware_failed = 72;
148 PhysicalDropDetected physical_drop_detected = 73;
149 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800150 MobileConnectionStateChanged mobile_connection_state_changed = 75;
151 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700152 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800153 AppCrashOccurred app_crash_occurred = 78;
154 ANROccurred anr_occurred = 79;
155 WTFOccurred wtf_occurred = 80;
156 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700157 GenericAtom generic_atom = 82;
jianjin6eada302019-02-28 11:25:57 -0800158 KeyValuePairsAtom key_value_pairs_atom = 83 [(allow_from_any_uid) = true];
Bookatza7020bd2018-08-28 16:29:35 -0700159 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700160 DeferredJobStatsReported deferred_job_stats_reported = 85;
Tej Singha72344992019-04-17 18:55:08 -0700161 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Kevin Chyn1741a072019-01-17 11:54:40 -0800162 BiometricAcquired biometric_acquired = 87;
163 BiometricAuthenticated biometric_authenticated = 88;
164 BiometricErrorOccurred biometric_error_occurred = 89;
Howard Ro0db82032019-04-07 18:43:34 -0700165 // Atom number 90 is available for use.
Howard Roa46b6582018-09-18 16:45:02 -0700166 BatteryHealthSnapshot battery_health_snapshot = 91;
167 SlowIo slow_io = 92;
168 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700169 PhoneServiceStateChanged phone_service_state_changed = 94;
170 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100171 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700172 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700173 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700174 // TODO: service state change is very noisy shortly after boot, as well
175 // as at other transitions - coming out of doze, device plugged in, etc.
176 // Consider removing this if it becomes a problem
177 ServiceStateChanged service_state_changed = 99;
178 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800179 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800180 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000181 DevicePolicyEvent device_policy_event = 103;
shawnlin9a1392a2019-04-09 16:21:17 +0800182 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled =
183 104 [(log_from_module) = "docsui"];
184 DocsUIFileOperationCopyMoveModeReported
185 docs_ui_file_op_copy_move_mode_reported =
186 105 [(log_from_module) = "docsui"];
187 DocsUIFileOperationFailureReported docs_ui_file_op_failure =
188 106 [(log_from_module) = "docsui"];
189 DocsUIFileOperationReported docs_ui_provider_file_op =
190 107 [(log_from_module) = "docsui"];
191 DocsUIInvalidScopedAccessRequestReported
192 docs_ui_invalid_scoped_access_request =
193 108 [(log_from_module) = "docsui"];
194 DocsUILaunchReported docs_ui_launch_reported =
195 109 [(log_from_module) = "docsui"];
196 DocsUIRootVisitedReported docs_ui_root_visited =
197 110 [(log_from_module) = "docsui"];
198 DocsUIStartupMsReported docs_ui_startup_ms =
199 111 [(log_from_module) = "docsui"];
200 DocsUIUserActionReported docs_ui_user_action_reported =
201 112 [(log_from_module) = "docsui"];
Bookatzda1798c2018-12-13 14:16:00 -0800202 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
203 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f62018-12-06 11:01:38 +0000204 AppCompacted app_compacted = 115;
lifre82d8f62019-03-25 20:33:21 +0800205 NetworkDnsEventReported network_dns_event_reported = 116 [(log_from_module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800206 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
207 117 [(log_from_module) = "docsui"];
208 DocsUIPickResultReported docs_ui_pick_result_reported =
209 118 [(log_from_module) = "docsui"];
210 DocsUISearchModeReported docs_ui_search_mode_reported =
211 119 [(log_from_module) = "docsui"];
212 DocsUISearchTypeReported docs_ui_search_type_reported =
213 120 [(log_from_module) = "docsui"];
Chiachang Wange512b262019-04-11 21:24:28 +0800214 DataStallEvent data_stall_event = 121 [(log_from_module) = "network_stack"];
Christian Brunschenf86039e2018-12-21 12:26:14 +0000215 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000216 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800217 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800218 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800219 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
220 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000221 AppDowngraded app_downgraded = 128;
222 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
223 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800224 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
225 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800226 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800227 NfcErrorOccurred nfc_error_occurred = 134;
228 NfcStateChanged nfc_state_changed = 135;
229 NfcBeamOccurred nfc_beam_occurred = 136;
230 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
231 NfcTagOccurred nfc_tag_occurred = 138;
232 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
233 SeStateChanged se_state_changed = 140;
234 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800235 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800236 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800237 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800238 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800239 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800240 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyne5a37fb2019-02-08 13:10:36 -0800241 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500242 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800243 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Jack Hec27040a2019-01-09 20:54:41 -0800244 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
245 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
246 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
247 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
248 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
249 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
250 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
251 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
252 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He1021a612019-01-20 21:22:46 -0800253 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
254 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
Jack Heaea26982019-04-04 11:19:48 -0700255 BluetoothDeviceInfoReported bluetooth_device_info_reported = 162;
Jack He1021a612019-01-20 21:22:46 -0800256 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
257 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
258 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
259 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
260 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Alex Salod7c3eef2019-01-25 14:43:27 -0800261 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800262 ProcessStartTime process_start_time = 169;
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700263 PermissionGrantRequestResultReported permission_grant_request_result_reported =
264 170 [(log_from_module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800265 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Michael Groover4a0ca942019-01-24 17:41:25 -0800266 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Steven Wu552f63f2019-02-05 13:41:36 -0500267 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
joshmccloskey8c3322e2019-01-09 18:25:57 -0800268 AssistGestureStageReported assist_gesture_stage_reported = 174;
269 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
270 AssistGestureProgressReported assist_gesture_progress_reported = 176;
Philip Quinn0eded622019-01-29 12:46:28 -0800271 TouchGestureClassified touch_gesture_classified = 177;
Andrei Onea4ad6d0c2019-02-08 13:54:12 +0000272 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true];
Kunhung Li286c52f2019-05-21 20:10:43 +0800273 StyleUIChanged style_ui_changed = 179 [(log_from_module) = "style"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700274 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Tej Singha72344992019-04-17 18:55:08 -0700275 180 [(log_from_module) = "permissioncontroller"];
Carmen Agimof6688a352019-01-30 19:36:04 +0000276 AppInstallOnExternalStorageReported app_install_on_external_storage_reported = 181;
Chiachang Wange512b262019-04-11 21:24:28 +0800277 NetworkStackReported network_stack_reported = 182 [(log_from_module) = "network_stack"];
Carmen Agimof6dcc5032019-03-01 16:20:09 +0000278 AppMovedStorageReported app_moved_storage_reported = 183;
joshmccloskey6f952b22019-03-25 20:59:35 -0700279 BiometricEnrolled biometric_enrolled = 184;
jianjin8f2dee02019-03-29 14:03:08 -0700280 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185;
281 TombStoneOccurred tomb_stone_occurred = 186;
Jack He71426802019-04-02 13:32:52 -0700282 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported = 187;
Ben Blount763a5d52019-04-10 11:48:58 -0700283 IntelligenceEventReported intelligence_event_reported =
284 188 [(log_from_module) = "intelligence"];
Tej Singha72344992019-04-17 18:55:08 -0700285 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed = 189;
Hai Zhang5d3328d2019-04-13 21:25:06 +0800286 RoleRequestResultReported role_request_result_reported =
287 190 [(log_from_module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800288 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
289 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
290 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
291 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
292 MediametricsCodecReported mediametrics_codec_reported = 195;
293 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
294 MediametricsExtractorReported mediametrics_extractor_reported = 197;
295 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
296 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
297 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Yuncheol Heod1a85d22019-05-08 17:13:42 -0700298 CarPowerStateChanged car_power_state_changed = 203;
299 GarageModeInfo garage_mode_info = 204;
Tej Singhc9203082019-05-03 13:42:23 -0700300 TestAtomReported test_atom_reported = 205 [(log_from_module) = "cts"];
Adam Heff2185342019-01-23 15:59:09 -0800301 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported = 206;
302 ContentCaptureServiceEvents content_capture_service_events = 207;
303 ContentCaptureSessionEvents content_capture_session_events = 208;
304 ContentCaptureFlushed content_capture_flushed = 209;
Hongyi Zhang700137e2019-05-23 21:19:36 -0700305 LocationManagerApiUsageReported location_manager_api_usage_reported = 210;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100306 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
307 211 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100308 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
309 212 [(log_from_module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100310 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
311 213 [(log_from_module) = "permissioncontroller"];
Yao Chend54f9dd2017-10-17 17:37:48 +0000312 }
David Chenc8a43242017-10-17 16:23:28 -0700313
David Chen6e3e6cb2018-01-03 16:14:06 -0800314 // Pulled events will start at field 10000.
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700315 // Next: 10059
David Chenc8a43242017-10-17 16:23:28 -0700316 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800317 WifiBytesTransfer wifi_bytes_transfer = 10000;
318 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
319 MobileBytesTransfer mobile_bytes_transfer = 10002;
320 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800321 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800322 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800323 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800324 CpuTimePerFreq cpu_time_per_freq = 10008;
325 CpuTimePerUid cpu_time_per_uid = 10009;
326 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800327 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800328 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800329 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800330 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800331 SystemElapsedRealtime system_elapsed_realtime = 10014;
332 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800333 CpuActiveTime cpu_active_time = 10016;
334 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000335 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800336 RemainingBatteryCapacity remaining_battery_capacity = 10019;
337 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800338 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100339 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100340 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100341 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000342 DiskStats disk_stats = 10025;
343 DirectoryUsage directory_usage = 10026;
344 AppSize app_size = 10027;
345 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700346 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700347 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800348 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700349 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700350 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800351 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700352 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100353 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100354 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700355 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee60422018-11-09 12:27:37 -0800356 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
357 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
358 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000359 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800360 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800361 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800362 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000363 DebugElapsedClock debug_elapsed_clock = 10046;
364 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800365 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800366 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800367 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800368 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000369 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000370 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800371 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
372 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000373 SystemIonHeapSize system_ion_heap_size = 10056;
Carmen Agimofa769c152019-03-04 14:39:14 +0000374 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700375 FaceSettings face_settings = 10058;
Maggie White442b6312019-04-05 16:26:44 -0700376 CoolingDevice cooling_device = 10059;
Martijn Coenencd95d462019-04-25 17:09:45 +0200377 AppOps app_ops = 10060;
David Chenc8a43242017-10-17 16:23:28 -0700378 }
yroa1fe77c2018-02-26 14:22:54 -0800379
Bookatz76aafcf2018-09-17 16:17:10 -0700380 // DO NOT USE field numbers above 100,000 in AOSP.
381 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
382 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700383}
384
Yao Chend54f9dd2017-10-17 17:37:48 +0000385/**
Yangster-mac20877162017-12-22 17:19:39 -0800386 * This proto represents a node of an attribution chain.
387 * Note: All attribution chains are represented as a repeated field of type
388 * AttributionNode. It is understood that in such arrays, the order is that
389 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000390 */
Yangster-mac20877162017-12-22 17:19:39 -0800391message AttributionNode {
392 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800393 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800394
Yangster-mac20877162017-12-22 17:19:39 -0800395 // The (optional) string tag for an element in the attribution chain. If the
396 // element has no tag, it is encoded as an empty string.
397 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700398}
399
Yangster-mac48b3d622018-08-18 12:38:11 -0700400message KeyValuePair {
401 optional int32 key = 1;
402 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700403 int32 value_int = 2;
404 int64 value_long = 3;
405 string value_str = 4;
406 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700407 }
408}
409
410message KeyValuePairsAtom {
411 optional int32 uid = 1;
412 repeated KeyValuePair pairs = 2;
413}
414
Yao Chend54f9dd2017-10-17 17:37:48 +0000415/*
416 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800417 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000418 *
419 * RULES:
420 * - The field ids for each atom must start at 1, and count upwards by 1.
421 * Skipping field ids is not allowed.
422 * - These form an API, so renaming, renumbering or removing fields is
423 * not allowed between android releases. (This is not currently enforced,
424 * but there will be a tool to enforce this restriction).
425 * - The types must be built-in protocol buffer types, namely, no sub-messages
426 * are allowed (yet). The bytes type is also not allowed.
427 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800428 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000429 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800430 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000431 * - A field that is a uid should be a string field, tagged with the [xxx]
432 * annotation. The generated code on android will be represented by UIDs,
433 * and those UIDs will be translated in xxx to those strings.
434 *
435 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700436 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000437 * - If there is a UID, it goes first. Think in an object-oriented fashion.
438 * *****************************************************************************
439 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700440
Yao Chend54f9dd2017-10-17 17:37:48 +0000441/**
Tej Singha72344992019-04-17 18:55:08 -0700442 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700443 * Logs when the Thermal service HAL notifies the throttling start/stop events.
444 *
445 * Logged from:
446 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
447 */
448message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700449 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700450 optional android.os.TemperatureTypeEnum sensor_type = 1;
451
Maggie White442b6312019-04-05 16:26:44 -0700452 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700453 enum State {
454 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700455 START = 1; // START indicated that throttling was triggered.
456 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700457 }
Yangster-mace16189a2018-08-26 12:20:16 -0700458 optional State state = 2;
459
460 optional float temperature = 3;
461}
462
463/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000464 * Logs when the screen state changes.
465 *
466 * Logged from:
467 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
468 */
469message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800470 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700471 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700472}
Yao Chend54f9dd2017-10-17 17:37:48 +0000473
474/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700475 * Logs that the process state of the uid, as determined by ActivityManager
476 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000477 *
478 * Logged from:
479 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
480 */
Bookatzc1a050a2017-10-10 15:49:28 -0700481message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700482 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000483
Bookatzdb026a22018-01-10 19:01:56 -0800484 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700485 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000486}
487
488/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700489 * Logs process state change of a process, as per the activity manager.
490 *
491 * Logged from:
492 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
493 */
494message ProcessStateChanged {
495 optional int32 uid = 1;
496 optional string process_name = 2;
497 optional string package_name = 3;
498 // TODO: remove this when validation is done
499 optional int64 version = 5;
500 // The state, from frameworks/base/core/proto/android/app/enums.proto.
501 optional android.app.ProcessStateEnum state = 4;
502}
503
504/**
505 * Logs when ActivityManagerService sleep state is changed.
506 *
507 * Logged from:
508 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
509 */
510message ActivityManagerSleepStateChanged {
511 // TODO: import frameworks proto
512 enum State {
513 UNKNOWN = 0;
514 ASLEEP = 1;
515 AWAKE = 2;
516 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700517 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700518}
519
520/**
521 * Logs when system memory state changes.
522 *
523 * Logged from:
524 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
525 */
526message MemoryFactorStateChanged {
527 // TODO: import frameworks proto
528 enum State {
529 MEMORY_UNKNOWN = 0;
530 NORMAL = 1; // normal.
531 MODERATE = 2; // moderate memory pressure.
532 LOW = 3; // low memory.
533 CRITICAL = 4; // critical memory.
534
535 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700536 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700537}
538
539/**
540 * Logs when app is using too much cpu, according to ActivityManagerService.
541 *
542 * Logged from:
543 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
544 */
545message ExcessiveCpuUsageReported {
546 optional int32 uid = 1;
547 optional string process_name = 2;
548 optional string package_name = 3;
549 // package version. TODO: remove this when validation is done
550 optional int64 version = 4;
551}
552
553/**
554 * Logs when a cached process is killed, along with its pss.
555 *
556 * Logged from:
557 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
558 */
559message CachedKillReported {
560 optional int32 uid = 1;
561 optional string process_name = 2;
562 optional string package_name = 3;
563 // TODO: remove this when validation is done
564 optional int64 version = 5;
565 optional int64 pss = 4;
566}
567
568/**
569 * Logs when memory stats of a process is reported.
570 *
571 * Logged from:
572 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
573 */
574message ProcessMemoryStatReported {
575 optional int32 uid = 1;
576 optional string process_name = 2;
577 optional string package_name = 3;
578 //TODO: remove this when validation is done
579 optional int64 version = 9;
580 optional int64 pss = 4;
581 optional int64 uss = 5;
582 optional int64 rss = 6;
583 enum Type {
584 ADD_PSS_INTERNAL_SINGLE = 0;
585 ADD_PSS_INTERNAL_ALL_MEM = 1;
586 ADD_PSS_INTERNAL_ALL_POLL = 2;
587 ADD_PSS_EXTERNAL = 3;
588 ADD_PSS_EXTERNAL_SLOW = 4;
589 }
590 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800591 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700592}
593
594/**
Bookatzc1a050a2017-10-10 15:49:28 -0700595 * Logs that a process started, finished, crashed, or ANRed.
596 *
597 * Logged from:
598 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
599 */
600message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700601 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700602
David Chen0b5c90c2018-01-25 16:51:49 -0800603 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800604 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700605
Bookatzddccf0a2017-11-28 16:48:14 -0800606 // What lifecycle state the process changed to.
607 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800608 enum State {
609 FINISHED = 0;
610 STARTED = 1;
611 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800612 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800613 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700614}
615
Bookatzc1a050a2017-10-10 15:49:28 -0700616/**
617 * Logs when the ble scan state changes.
618 *
619 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700620 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700621 */
622message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800623 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700624
625 enum State {
626 OFF = 0;
627 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700628 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
629 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700630 }
631 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700632
Bookatze5ec0b42018-03-26 13:34:56 -0700633 // Does the scan have a filter.
634 optional bool is_filtered = 3;
635 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
636 optional bool is_first_match = 4;
637 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
638 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700639}
640
641/**
642 * Logs reporting of a ble scan finding results.
643 *
644 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700645 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700646 */
Bookatzae6738e2018-09-13 11:38:56 -0700647// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700648message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800649 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700650
651 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800652 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700653}
654
655/**
656 * Logs when a sensor state changes.
657 *
658 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700659 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700660 */
661message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800662 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700663
Bookatzc1a050a2017-10-10 15:49:28 -0700664 // The id (int) of the sensor.
665 optional int32 sensor_id = 2;
666
667 enum State {
668 OFF = 0;
669 ON = 1;
670 }
671 optional State state = 3;
672}
673
Bookatzc1a050a2017-10-10 15:49:28 -0700674/**
675 * Logs when GPS state changes.
676 *
677 * Logged from:
678 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
679 */
680message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800681 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700682
683 enum State {
684 OFF = 0;
685 ON = 1;
686 }
687 optional State state = 2;
688}
689
Bookatz48d362e2018-11-06 15:49:08 -0800690/**
691 * Logs when GPS signal quality.
692 *
693 * Logged from:
694 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
695 */
696message GpsSignalQualityChanged {
697 optional android.server.location.GpsSignalQualityEnum level = 1;
698}
699
Bookatzc1a050a2017-10-10 15:49:28 -0700700
701/**
702 * Logs when a sync manager sync state changes.
703 *
704 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700705 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700706 */
707message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800708 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700709
David Chen0b5c90c2018-01-25 16:51:49 -0800710 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800711 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700712
713 enum State {
714 OFF = 0;
715 ON = 1;
716 }
717 optional State state = 3;
718}
719
Yangster-mac96353002018-09-05 11:18:55 -0700720/*
721 * Deferred job stats.
722 *
723 * Logged from:
724 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
725*/
726message DeferredJobStatsReported {
727 repeated AttributionNode attribution_node = 1;
728
729 // Number of jobs deferred.
730 optional int32 num_jobs_deferred = 2;
731
732 // Time since the last job runs.
733 optional int64 time_since_last_job_millis = 3;
734}
735
Bookatzc1a050a2017-10-10 15:49:28 -0700736/**
737 * Logs when a job scheduler job state changes.
738 *
739 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700740 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700741 */
742message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800743 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700744
745 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800746 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700747
748 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800749 FINISHED = 0;
750 STARTED = 1;
751 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700752 }
753 optional State state = 3;
754
Tej Singh33a412b2018-03-16 18:43:59 -0700755 // The reason a job has stopped.
756 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700757 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700758 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100759
760 // The standby bucket of the app that scheduled the job. These match the framework constants
761 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
762 // already assigned 0.
763 enum Bucket {
764 UNKNOWN = -1;
765 ACTIVE = 0;
766 WORKING_SET = 1;
767 FREQUENT = 2;
768 RARE = 3;
769 NEVER = 4;
770 }
771 optional Bucket standby_bucket = 5 [default = UNKNOWN];
772
773 // The job id (as assigned by the app).
774 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700775}
776
777/**
778 * Logs when the audio state changes.
779 *
780 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700781 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700782 */
783message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800784 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700785
786 enum State {
787 OFF = 0;
788 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700789 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
790 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700791 }
792 optional State state = 2;
793}
794
795/**
796 * Logs when the video codec state changes.
797 *
798 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700799 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700800 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800801message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800802 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700803
804 enum State {
805 OFF = 0;
806 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700807 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
808 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700809 }
810 optional State state = 2;
811}
812
813/**
814 * Logs when the flashlight state changes.
815 *
816 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700817 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700818 */
819message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800820 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700821
822 enum State {
823 OFF = 0;
824 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700825 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
826 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700827 }
828 optional State state = 2;
829}
830
831/**
832 * Logs when the camera state changes.
833 *
834 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700835 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700836 */
837message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800838 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700839
840 enum State {
841 OFF = 0;
842 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700843 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
844 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700845 }
846 optional State state = 2;
847}
848
849/**
850 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000851 *
852 * Logged from:
853 * TODO
854 */
Bookatzd6746242017-10-24 18:39:35 -0700855message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800856 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000857
Bookatz1a1b0462018-01-12 11:47:03 -0800858 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
859 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700860 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700861
862 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
863 optional string tag = 3;
864
865 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800866 RELEASE = 0;
867 ACQUIRE = 1;
868 CHANGE_RELEASE = 2;
869 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700870 }
871 optional State state = 4;
872}
873
874/**
Bookatzc1a050a2017-10-10 15:49:28 -0700875 * Logs when a partial wakelock is considered 'long' (over 1 min).
876 *
877 * Logged from:
878 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
879 */
880message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800881 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700882
Yao Chend54f9dd2017-10-17 17:37:48 +0000883 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
884 optional string tag = 2;
885
Bookatzc1a050a2017-10-10 15:49:28 -0700886 // TODO: I have no idea what this is.
887 optional string history_tag = 3;
888
889 enum State {
890 OFF = 0;
891 ON = 1;
892 }
893 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000894}
895
Bookatzc1a050a2017-10-10 15:49:28 -0700896/**
Bookatza66083f2018-09-20 17:24:00 -0700897 * Logs when the device is interactive, according to the PowerManager Notifier.
898 *
899 * Logged from:
900 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
901 */
902message InteractiveStateChanged {
903 enum State {
904 OFF = 0;
905 ON = 1;
906 }
907 optional State state = 1;
908}
909
910/**
Bookatzc1a050a2017-10-10 15:49:28 -0700911 * Logs Battery Saver state change.
912 *
913 * Logged from:
914 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
915 */
916message BatterySaverModeStateChanged {
917 enum State {
918 OFF = 0;
919 ON = 1;
920 }
921 optional State state = 1;
922}
923
924/**
925 * Logs Doze mode state change.
926 *
927 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800928 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700929 */
930message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800931 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800932}
933
934
935/**
936 * Logs state change of Doze mode including maintenance windows.
937 *
938 * Logged from:
939 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
940 */
941message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800942 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700943}
944
945/**
946 * Logs screen brightness level.
947 *
948 * Logged from:
949 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
950 */
951message ScreenBrightnessChanged {
952 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
953 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700954}
955
956/**
957 * Logs battery level (percent full, from 0 to 100).
958 *
959 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700960 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700961 */
962message BatteryLevelChanged {
963 // Battery level. Should be in [0, 100].
964 optional int32 battery_level = 1;
965}
966
967/**
968 * Logs change in charging status of the device.
969 *
970 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700971 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700972 */
973message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800974 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
975 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700976}
977
978/**
979 * Logs whether the device is plugged in, and what power source it is using.
980 *
981 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700982 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700983 */
984message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800985 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
986 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700987}
988
Bookatz8c6571b2017-10-24 15:04:41 -0700989/**
990 * Logs when an app's wakeup alarm fires.
991 *
992 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700993 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700994 */
995message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800996 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800997
998 // Name of the wakeup alarm.
999 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001000
1001 // Name of source package (for historical reasons, since BatteryStats tracked it).
1002 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001003
1004 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1005 enum Bucket {
1006 UNKNOWN = 0;
1007 EXEMPTED = 5;
1008 ACTIVE = 10;
1009 WORKING_SET = 20;
1010 FREQUENT = 30;
1011 RARE = 40;
1012 NEVER = 50;
1013 }
1014 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1015 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001016}
1017
1018/**
1019 * Logs when an an app causes the mobile radio to change state.
1020 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1021 *
1022 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001023 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001024 */
1025message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001026 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001027
Bookatz1a1b0462018-01-12 11:47:03 -08001028 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1029 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001030}
1031
1032/**
1033 * Logs when an an app causes the wifi radio to change state.
1034 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1035 *
1036 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001037 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001038 */
1039message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001040 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001041
Bookatz1a1b0462018-01-12 11:47:03 -08001042 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1043 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001044}
1045
1046/**
1047 * Logs kernel wakeup reasons and aborts.
1048 *
1049 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001050 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001051 */
1052message KernelWakeupReported {
1053 // Name of the kernel wakeup reason (or abort).
1054 optional string wakeup_reason_name = 1;
1055
1056 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001057 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001058}
1059
1060/**
Bookatzda1798c2018-12-13 14:16:00 -08001061 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001062 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001063 *
1064 * Logged from:
1065 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1066 */
1067message WifiEnabledStateChanged {
1068 enum State {
1069 OFF = 0;
1070 ON = 1;
1071 }
1072 optional State state = 1;
1073}
1074
1075/**
1076 * 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 -08001077 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1078 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001079 *
1080 * Logged from:
1081 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1082 */
1083message WifiRunningStateChanged {
1084 repeated AttributionNode attribution_node = 1;
1085
1086 enum State {
1087 OFF = 0;
1088 ON = 1;
1089 }
1090 optional State state = 2;
1091}
1092
1093/**
Bookatze5885242017-10-24 20:10:31 -07001094 * Logs wifi locks held by an app.
1095 *
1096 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001097 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001098 */
1099message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001100 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001101
1102 enum State {
1103 OFF = 0;
1104 ON = 1;
1105 }
1106 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001107
1108 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1109 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001110}
1111
1112/**
1113 * Logs wifi signal strength changes.
1114 *
1115 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001116 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001117 */
1118message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001119 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1120 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001121}
1122
1123/**
1124 * Logs wifi scans performed by an app.
1125 *
1126 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001127 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001128 */
1129message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001130 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001131
1132 enum State {
1133 OFF = 0;
1134 ON = 1;
1135 }
1136 optional State state = 2;
1137}
1138
1139/**
Tej Singh4503e102018-01-04 14:35:01 -08001140 * Logs wifi multicast locks held by an app
1141 *
1142 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001143 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001144 */
1145message WifiMulticastLockStateChanged {
1146 repeated AttributionNode attribution_node = 1;
1147
1148 enum State {
1149 OFF = 0;
1150 ON = 1;
1151 }
1152 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001153
1154 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001155}
1156
1157/**
Tej Singh1ea42892018-01-19 09:27:00 -08001158 * Logs shutdown reason and duration on next boot.
1159 *
1160 * Logged from:
1161 * frameworks/base/core/java/com/android/server/BootReceiver.java
1162 */
1163message ShutdownSequenceReported {
1164 // True if shutdown is for a reboot. Default: false if we do not know.
1165 optional bool reboot = 1;
1166
1167 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1168 optional string reason = 2;
1169
1170 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1171 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001172 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001173
1174 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001175 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001176}
1177
Tej Singh6483ea42018-01-25 17:45:49 -08001178
1179/**
1180 * Logs boot reason and duration.
1181 *
1182 * Logged from:
1183 * system/core/bootstat/bootstat.cpp
1184 */
1185message BootSequenceReported {
1186 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1187 // Default: "<EMPTY>" if not available.
1188 optional string bootloader_reason = 1;
1189
1190 // Reason for system boot. Eg. bootloader, reboot,userrequested
1191 // Default: "<EMPTY>" if not available.
1192 optional string system_reason = 2;
1193
1194 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001195 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001196
1197 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001198 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001199
1200 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001201 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001202
1203 // Time since last boot in ms. Default: 0 if not available.
1204 optional int64 time_since_last_boot = 6;
1205}
1206
Tej Singhc477d9c2018-02-05 18:31:39 -08001207
1208/**
1209 * Logs call state and disconnect cause (if applicable).
1210 *
1211 * Logged from:
1212 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1213 */
1214message CallStateChanged {
1215 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1216 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1217 optional android.telecom.CallStateEnum call_state = 1;
1218
1219 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1220 // This value is only applicable when the call_state is DISCONNECTED, and
1221 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1222 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1223 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1224
1225 // True if the call is self-managed, which are apps that use the
1226 // telecom infrastructure to make their own calls.
1227 optional bool self_managed = 3;
1228
1229 // True if call is external. External calls are calls on connected Wear
1230 // devices but show up in Telecom so the user can pull them onto the device.
1231 optional bool external_call = 4;
1232}
1233
Tej Singh1ea42892018-01-19 09:27:00 -08001234/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001235 * Logs keyguard state. The keyguard is the lock screen.
1236 *
1237 * Logged from:
1238 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1239 */
1240message KeyguardStateChanged {
1241 enum State {
1242 UNKNOWN = 0;
1243 // The keyguard is hidden when the phone is unlocked.
1244 HIDDEN = 1;
1245 // The keyguard is shown when the phone is locked (screen turns off).
1246 SHOWN= 2;
1247 // The keyguard is occluded when something is overlaying the keyguard.
1248 // Eg. Opening the camera while on the lock screen.
1249 OCCLUDED = 3;
1250 }
1251 optional State state = 1;
1252}
1253
1254/**
1255 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1256 * prompts the user to enter a password (pattern, pin, etc).
1257 *
1258 * Logged from:
1259 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1260 */
1261
1262message KeyguardBouncerStateChanged {
1263 enum State {
1264 UNKNOWN = 0;
1265 // Bouncer is hidden, either as a result of successfully entering the
1266 // password, screen timing out, or user going back to lock screen.
1267 HIDDEN = 1;
1268 // This is when the user is being prompted to enter the password.
1269 SHOWN = 2;
1270 }
1271 optional State state = 1;
1272}
1273
1274/**
1275 * Logs the result of entering a password into the keyguard bouncer.
1276 *
1277 * Logged from:
1278 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1279 */
1280message KeyguardBouncerPasswordEntered {
1281 enum BouncerResult {
1282 UNKNOWN = 0;
1283 // The password entered was incorrect.
1284 FAILURE = 1;
1285 // The password entered was correct.
1286 SUCCESS = 2;
1287 }
1288 optional BouncerResult result = 1;
1289}
1290
Tej Singha883b372018-02-15 11:30:01 -08001291/*
1292 * Logs changes to the configuration of the device. The configuration is defined
1293 * in frameworks/base/core/java/android/content/res/Configuration.java
1294 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1295 * Please go there to interpret the possible values each field can be.
1296 *
1297 * Logged from:
1298 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1299 */
1300message ResourceConfigurationChanged {
1301 // Bit mask of color capabilities of the screen.
1302 // Contains information about the color gamut and hdr mode of the screen.
1303 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001304 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001305
1306 // The target screen density being rendered to.
1307 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001308 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001309
1310 // Current user preference for the scaling factor for fonts,
1311 // relative to the base density scaling.
1312 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001313 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001314
1315 // Flag indicating whether the hard keyboard is hidden.
1316 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001317 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001318
1319 // The type of keyboard attached to the device.
1320 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1321 optional int32 keyboard = 5;
1322
1323 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1324 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001325 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001326
1327 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1328 // 0 if undefined.
1329 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1330 optional int32 mcc = 7;
1331
1332 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1333 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1334 // MNC_ZERO symbol defined in Configuration.java.
1335 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1336 optional int32 mnc = 8;
1337
1338 // The kind of navigation available on the device.
1339 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1340 optional int32 navigation = 9;
1341
1342 // Flag indicating whether the navigation is available.
1343 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001344 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001345
1346 // Overall orientation of the screen.
1347 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1348 optional int32 orientation = 11;
1349
1350 // The current height of the available screen space, in dp units.
1351 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001352 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001353
1354 // Bit mask of overall layout of the screen.
1355 // Contains information about screen size, whether the screen is wider/taller
1356 // than normal, whether the screen layout is right-tl-left or left-to-right,
1357 // and whether the screen has a rounded shape.
1358 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001359 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001360
1361 // Current width of the available screen space, in dp units.
1362 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001363 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001364
1365 // The smallest screen size an application will see in normal operation.
1366 // This is the smallest value of both screenWidthDp and screenHeightDp
1367 // in portrait and landscape.
1368 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001369 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001370
1371 // The type of touch screen attached to the device.
1372 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1373 optional int32 touchscreen = 16;
1374
1375 // Bit mask of the ui mode.
1376 // Contains information about the overall ui mode of the device.
1377 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1378 // Also contains information about whether the device is in night mode.
1379 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001380 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001381}
1382
Tej Singheee317b2018-03-07 19:28:05 -08001383
1384/**
1385 * Logs changes in the connection state of the mobile radio.
1386 *
1387 * Logged from:
1388 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1389 */
1390message MobileConnectionStateChanged {
1391 // States are from the state machine DataConnection.java.
1392 enum State {
1393 UNKNOWN = 0;
1394 // The connection is inactive, or disconnected.
1395 INACTIVE = 1;
1396 // The connection is being activated, or connecting.
1397 ACTIVATING = 2;
1398 // The connection is active, or connected.
1399 ACTIVE = 3;
1400 // The connection is disconnecting.
1401 DISCONNECTING = 4;
1402 // The connection is disconnecting after creating a connection.
1403 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1404 }
1405 optional State state = 1;
1406 // For multi-sim phones, this distinguishes between the sim cards.
1407 optional int32 sim_slot_index = 2;
1408 // Used to identify the connection. Starts at 0 and increments by 1 for
1409 // every new network created. Resets whenever the device reboots.
1410 optional int32 data_connection_id = 3;
1411 // A bitmask for the capabilities of this connection.
1412 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1413 // Default value (if we have no information): 0
1414 optional int64 capabilities = 4;
1415 // If this connection has internet.
1416 // This just checks if the DEFAULT bit of capabilities is set.
1417 optional bool has_internet = 5;
1418}
1419
1420/**
1421 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1422 *
1423 * Logged from:
1424 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1425 */
1426message MobileRadioTechnologyChanged {
1427 optional android.telephony.NetworkTypeEnum state = 1;
1428 // For multi-sim phones, this distinguishes between the sim cards.
1429 optional int32 sim_slot_index = 2;
1430}
1431
Andrew Chantb56388b2018-03-22 21:07:33 -07001432/**
1433 * Logs the VID and PID of any connected USB devices.
1434 *
1435 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1436 *
1437 * Logged by Vendor.
1438 */
1439message UsbDeviceAttached {
1440 optional int32 vid = 1;
1441 optional int32 pid = 2;
1442 optional bool has_audio = 3;
1443 optional bool has_hid = 4;
1444 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001445 enum State {
1446 STATE_DISCONNECTED = 0;
1447 STATE_CONNECTED = 1;
1448 }
1449 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001450 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001451}
1452
Tej Singheee317b2018-03-07 19:28:05 -08001453
Tej Singhdd7bd352018-02-09 19:33:15 -08001454/**
Tej Singh5d991e12018-03-09 19:48:11 -08001455 * Logs when Bluetooth is enabled and disabled.
1456 *
1457 * Logged from:
1458 * services/core/java/com/android/server/BluetoothManagerService.java
1459 */
1460message BluetoothEnabledStateChanged {
1461 repeated AttributionNode attribution_node = 1;
1462 // Whether or not bluetooth is enabled on the device.
1463 enum State {
1464 UNKNOWN = 0;
1465 ENABLED = 1;
1466 DISABLED = 2;
1467 }
1468 optional State state = 2;
1469 // The reason for being enabled/disabled.
1470 // Eg. Airplane mode, crash, application request.
1471 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1472 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001473 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001474}
1475
1476/**
Jack Hed9837c82019-01-09 01:19:13 -08001477 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001478 *
1479 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001480 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1481 *
1482 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001483 */
1484message BluetoothConnectionStateChanged {
1485 // The state of the connection.
1486 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1487 optional android.bluetooth.ConnectionStateEnum state = 1;
1488 // An identifier that can be used to match connect and disconnect events.
1489 // Currently is last two bytes of a hash of a device level ID and
1490 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001491 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001492 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001493 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1494 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001495 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001496 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001497 // An identifier that can be used to match events for this device.
1498 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1499 // Salt: Randomly generated 256 bit value
1500 // Hash algorithm: HMAC-SHA256
1501 // Size: 32 byte
1502 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001503 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001504}
1505
1506/**
1507 * Logs when a Bluetooth device connects and disconnects over ACL
1508 *
1509 * Logged from:
1510 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1511 *
1512 * Next Tag: 3
1513 */
1514message BluetoothAclConnectionStateChanged {
1515 // An identifier that can be used to match events for this device.
1516 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1517 // Salt: Randomly generated 256 bit value
1518 // Hash algorithm: HMAC-SHA256
1519 // Size: 32 byte
1520 // Default: null or empty if the device identifier is not known
1521 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1522 // The state of the connection.
1523 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1524 optional android.bluetooth.ConnectionStateEnum state = 2;
1525}
1526
1527/**
1528 * Logs when a Bluetooth device connects and disconnects over SCO
1529 *
1530 * Logged from:
1531 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1532 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1533 *
1534 * Next Tag: 4
1535 */
1536message BluetoothScoConnectionStateChanged {
1537 // An identifier that can be used to match events for this device.
1538 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1539 // Salt: Randomly generated 256 bit value
1540 // Hash algorithm: HMAC-SHA256
1541 // Size: 32 byte
1542 // Default: null or empty if the device identifier is not known
1543 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1544 // The state of the connection.
1545 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1546 optional android.bluetooth.ConnectionStateEnum state = 2;
1547 // Codec used for this SCO connection
1548 // Default: UNKNOWN
1549 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001550}
1551
Jack Hec27040a2019-01-09 20:54:41 -08001552/**
1553 * Logged when active device of a profile changes
1554 *
1555 * Logged from:
1556 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1557 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1558 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1559 */
1560message BluetoothActiveDeviceChanged {
1561 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1562 // From android.bluetooth.BluetoothProfile
1563 optional int32 bt_profile = 1;
1564 // An identifier that can be used to match events for this new active device.
1565 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1566 // Salt: Randomly generated 256 bit value
1567 // Hash algorithm: HMAC-SHA256
1568 // Size: 32 byte
1569 // Default: null or empty if there is no active device for this profile
1570 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1571}
1572
Jack Heab86dbd22018-12-18 15:43:27 -08001573// Logs when there is an event affecting Bluetooth device's link layer connection.
1574// - This event is triggered when there is a related HCI command or event
1575// - Users of this metrics can deduce Bluetooth device's connection state from these events
1576// - HCI commands are logged before the command is sent, after receiving command status, and after
1577// receiving command complete
1578// - HCI events are logged when they arrive
1579//
1580// Low level log from system/bt
1581//
1582// Bluetooth classic commands:
1583// - CMD_CREATE_CONNECTION
1584// - CMD_DISCONNECT
1585// - CMD_CREATE_CONNECTION_CANCEL
1586// - CMD_ACCEPT_CONNECTION_REQUEST
1587// - CMD_REJECT_CONNECTION_REQUEST
1588// - CMD_SETUP_ESCO_CONNECTION
1589// - CMD_ACCEPT_ESCO_CONNECTION
1590// - CMD_REJECT_ESCO_CONNECTION
1591// - CMD_ENH_SETUP_ESCO_CONNECTION
1592// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1593//
1594// Bluetooth low energy commands:
1595// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1596// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1597// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1598// - CMD_BLE_CLEAR_WHITE_LIST
1599// - CMD_BLE_ADD_WHITE_LIST
1600// - CMD_BLE_REMOVE_WHITE_LIST
1601//
1602// Bluetooth classic events:
1603// - EVT_CONNECTION_COMP
1604// - EVT_CONNECTION_REQUEST
1605// - EVT_DISCONNECTION_COMP
1606// - EVT_ESCO_CONNECTION_COMP
1607// - EVT_ESCO_CONNECTION_CHANGED
1608//
1609// Bluetooth low energy meta events:
1610// - BLE_EVT_CONN_COMPLETE_EVT
1611// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1612//
1613// Next tag: 10
1614message BluetoothLinkLayerConnectionEvent {
1615 // An identifier that can be used to match events for this device.
1616 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1617 // Salt: Randomly generated 256 bit value
1618 // Hash algorithm: HMAC-SHA256
1619 // Size: 32 byte
1620 // Default: null or empty if the device identifier is not known
1621 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1622 // Connection handle of this connection if available
1623 // Range: 0x0000 - 0x0EFF (12 bits)
1624 // Default: 0xFFFF if the handle is unknown
1625 optional int32 connection_handle = 2;
1626 // Direction of the link
1627 // Default: DIRECTION_UNKNOWN
1628 optional android.bluetooth.DirectionEnum direction = 3;
1629 // Type of this link
1630 // Default: LINK_TYPE_UNKNOWN
1631 optional android.bluetooth.LinkTypeEnum type = 4;
1632
1633 // Reason metadata for this link layer connection event, rules for interpretation:
1634 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1635 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1636 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1637 // set and valid, ignore hci_ble_event
1638
1639 // HCI command associated with this event
1640 // Default: CMD_UNKNOWN
1641 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1642 // HCI event associated with this event
1643 // Default: EVT_UNKNOWN
1644 optional android.bluetooth.hci.EventEnum hci_event = 6;
1645 // HCI BLE meta event associated with this event
1646 // Default: BLE_EVT_UNKNOWN
1647 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1648 // HCI command status code if this is triggerred by hci_cmd
1649 // Default: STATUS_UNKNOWN
1650 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1651 // HCI reason code associated with this event
1652 // Default: STATUS_UNKNOWN
1653 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1654}
1655
Howard Roe103fe22019-01-17 16:52:16 -08001656/**
1657 * Logs when a module is rolled back by Watchdog.
1658 *
1659 * Logged from: Rollback Manager
1660 */
1661message WatchdogRollbackOccurred {
1662 enum RollbackType {
1663 UNKNOWN = 0;
1664 ROLLBACK_INITIATE = 1;
1665 ROLLBACK_SUCCESS = 2;
1666 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001667 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001668 }
1669 optional RollbackType rollback_type = 1;
1670
1671 optional string package_name = 2;
1672
1673 optional int32 package_version_code = 3;
1674}
1675
Jack Hec27040a2019-01-09 20:54:41 -08001676/**
1677 * Logs when there is a change in Bluetooth A2DP playback state
1678 *
1679 * Logged from:
1680 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1681 */
1682message BluetoothA2dpPlaybackStateChanged {
1683 // An identifier that can be used to match events for this device.
1684 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1685 // Salt: Randomly generated 256 bit value
1686 // Hash algorithm: HMAC-SHA256
1687 // Size: 32 byte
1688 // Default: null or empty if the device identifier is not known
1689 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1690 // Current playback state
1691 // Default: PLAYBACK_STATE_UNKNOWN
1692 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1693 // Current audio coding mode
1694 // Default: AUDIO_CODING_MODE_UNKNOWN
1695 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1696}
1697
1698/**
1699 * Logs when there is a change in A2DP codec config for a particular remote device
1700 *
1701 * Logged from:
1702 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1703 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1704 */
1705message BluetoothA2dpCodecConfigChanged {
1706 // An identifier that can be used to match events for this device.
1707 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1708 // Salt: Randomly generated 256 bit value
1709 // Hash algorithm: HMAC-SHA256
1710 // Size: 32 byte
1711 // Default: null or empty if the device identifier is not known
1712 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1713 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1714 // Default SOURCE_CODEC_TYPE_INVALID
1715 optional int32 codec_type = 2;
1716 // Codec priroity, the higher the more preferred, -1 for disabled
1717 // Default: CODEC_PRIORITY_DEFAULT
1718 optional int32 codec_priority = 3;
1719 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1720 // Default: SAMPLE_RATE_NONE
1721 optional int32 sample_rate = 4;
1722 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1723 // Default: BITS_PER_SAMPLE_NONE
1724 optional int32 bits_per_sample = 5;
1725 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1726 // Default: CHANNEL_MODE_NONE
1727 optional int32 channel_mode = 6;
1728 // Codec specific values
1729 // Default 0
1730 optional int64 codec_specific_1 = 7;
1731 optional int64 codec_specific_2 = 8;
1732 optional int64 codec_specific_3 = 9;
1733 optional int64 codec_specific_4 = 10;
1734}
1735
1736/**
1737 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1738 * Each codec's capability is logged separately due to statsd restriction
1739 *
1740 * Logged from:
1741 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1742 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1743 */
1744message BluetoothA2dpCodecCapabilityChanged {
1745 // An identifier that can be used to match events for this device.
1746 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1747 // Salt: Randomly generated 256 bit value
1748 // Hash algorithm: HMAC-SHA256
1749 // Size: 32 byte
1750 // Default: null or empty if the device identifier is not known
1751 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1752 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1753 // Default SOURCE_CODEC_TYPE_INVALID
1754 optional int32 codec_type = 2;
1755 // Codec priroity, the higher the more preferred, -1 for disabled
1756 // Default: CODEC_PRIORITY_DEFAULT
1757 optional int32 codec_priority = 3;
1758 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1759 // in BluetoothCodecConfig
1760 // Default: empty and SAMPLE_RATE_NONE for individual item
1761 optional int32 sample_rate = 4;
1762 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1763 // in BluetoothCodecConfig
1764 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1765 optional int32 bits_per_sample = 5;
1766 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1767 // BluetoothCodecConfig
1768 // Default: empty and CHANNEL_MODE_NONE for individual item
1769 optional int32 channel_mode = 6;
1770 // Codec specific values
1771 // Default 0
1772 optional int64 codec_specific_1 = 7;
1773 optional int64 codec_specific_2 = 8;
1774 optional int64 codec_specific_3 = 9;
1775 optional int64 codec_specific_4 = 10;
1776}
1777
1778/**
1779 * Logs when A2DP failed to read from PCM source.
1780 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1781 *
1782 * Logged from:
1783 * system/bt
1784 */
1785message BluetoothA2dpAudioUnderrunReported {
1786 // An identifier that can be used to match events for this device.
1787 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1788 // Salt: Randomly generated 256 bit value
1789 // Hash algorithm: HMAC-SHA256
1790 // Size: 32 byte
1791 // Default: null or empty if the device identifier is not known
1792 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1793 // Encoding interval in nanoseconds
1794 // Default: 0
1795 optional int64 encoding_interval_nanos = 2;
1796 // Number of bytes of PCM data that could not be read from the source
1797 // Default: 0
1798 optional int32 num_missing_pcm_bytes = 3;
1799}
1800
1801/**
1802 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1803 * buffer queue is full and we have to drop data
1804 *
1805 * Logged from:
1806 * system/bt
1807 */
1808message BluetoothA2dpAudioOverrunReported {
1809 // An identifier that can be used to match events for this device.
1810 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1811 // Salt: Randomly generated 256 bit value
1812 // Hash algorithm: HMAC-SHA256
1813 // Size: 32 byte
1814 // Default: null or empty if the device identifier is not known
1815 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1816 // Encoding interval in nanoseconds
1817 // Default: 0
1818 optional int64 encoding_interval_nanos = 2;
1819 // Number of buffers dropped in this event
1820 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1821 // Default: 0
1822 optional int32 num_dropped_buffers = 3;
1823 // Number of encoded buffers dropped in this event
1824 // Default 0
1825 optional int32 num_dropped_encoded_frames = 4;
1826 // Number of encoded bytes dropped in this event
1827 // Default: 0
1828 optional int32 num_dropped_encoded_bytes = 5;
1829}
1830
1831/**
1832 * Logs when we receive reports regarding a device's RSSI value
1833 *
1834 * Logged from:
1835 * system/bt
1836 */
1837message BluetoothDeviceRssiReported {
1838 // An identifier that can be used to match events for this device.
1839 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1840 // Salt: Randomly generated 256 bit value
1841 // Hash algorithm: HMAC-SHA256
1842 // Size: 32 byte
1843 // Default: null or empty if the device identifier is not known
1844 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1845 // Connection handle of this connection if available
1846 // Range: 0x0000 - 0x0EFF (12 bits)
1847 // Default: 0xFFFF if the handle is unknown
1848 optional int32 connection_handle = 2;
1849 // HCI command status code if this is triggerred by hci_cmd
1850 // Default: STATUS_UNKNOWN
1851 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1852 // BR/EDR
1853 // Range: -128 ≤ N ≤ 127 (signed integer)
1854 // Units: dB
1855 // LE:
1856 // Range: -127 to 20, 127 (signed integer)
1857 // Units: dBm
1858 // Invalid when an out of range value is reported
1859 optional int32 rssi = 4;
1860}
1861
1862/**
1863 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1864 *
1865 * Logged from:
1866 * system/bt
1867 */
1868message BluetoothDeviceFailedContactCounterReported {
1869 // An identifier that can be used to match events for this device.
1870 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1871 // Salt: Randomly generated 256 bit value
1872 // Hash algorithm: HMAC-SHA256
1873 // Size: 32 byte
1874 // Default: null or empty if the device identifier is not known
1875 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1876 // Connection handle of this connection if available
1877 // Range: 0x0000 - 0x0EFF (12 bits)
1878 // Default: 0xFFFF if the handle is unknown
1879 optional int32 connection_handle = 2;
1880 // HCI command status code if this is triggerred by hci_cmd
1881 // Default: STATUS_UNKNOWN
1882 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1883 // Number of consecutive failed contacts for a connection corresponding to the Handle
1884 // Range: uint16_t, 0-0xFFFF
1885 // Default: 0xFFFFF
1886 optional int32 failed_contact_counter = 4;
1887}
1888
1889/**
1890 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1891 *
1892 * Logged from:
1893 * system/bt
1894 */
1895message BluetoothDeviceTxPowerLevelReported {
1896 // An identifier that can be used to match events for this device.
1897 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1898 // Salt: Randomly generated 256 bit value
1899 // Hash algorithm: HMAC-SHA256
1900 // Size: 32 byte
1901 // Default: null or empty if the device identifier is not known
1902 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1903 // Connection handle of this connection if available
1904 // Range: 0x0000 - 0x0EFF (12 bits)
1905 // Default: 0xFFFF if the handle is unknown
1906 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001907 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001908 // Default: STATUS_UNKNOWN
1909 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1910 // Range: -30 ≤ N ≤ 20
1911 // Units: dBm
1912 // Invalid when an out of range value is reported
1913 optional int32 transmit_power_level = 4;
1914}
Jack Heab86dbd22018-12-18 15:43:27 -08001915
Tej Singh5d991e12018-03-09 19:48:11 -08001916/**
Jack He1021a612019-01-20 21:22:46 -08001917 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1918 * receiving an HCI command from the host
1919 *
1920 * Logged from: system/bt
1921 */
1922message BluetoothHciTimeoutReported {
1923 // HCI command associated with this event
1924 // Default: CMD_UNKNOWN
1925 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1926}
1927
1928/**
1929 * Logs when we receive Bluetooth Link Quality Report event from the controller
1930 * See Android Bluetooth HCI specification for more details
1931 *
1932 * Note: all count and bytes field are counted since last event
1933 *
1934 * Logged from: system/bt
1935 */
1936message BluetoothQualityReportReported {
1937 // Quality report ID
1938 // Original type: uint8_t
1939 // Default: BQR_ID_UNKNOWN
1940 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1941 // Packet type of the connection
1942 // Original type: uint8_t
1943 // Default: BQR_PACKET_TYPE_UNKNOWN
1944 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1945 // Connection handle of the connection
1946 // Original type: uint16_t
1947 optional int32 connection_handle = 3;
1948 // Performing Role for the connection
1949 // Original type: uint8_t
1950 optional int32 connection_role = 4;
1951 // Current Transmit Power Level for the connection. This value is the same as the controller's
1952 // response to the HCI_Read_Transmit_Power_Level HCI command
1953 // Original type: uint8_t
1954 optional int32 tx_power_level = 5;
1955 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1956 // absolute receiver signal strength value
1957 // Original type: int8_t
1958 optional int32 rssi = 6;
1959 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1960 // channels used by the link currently
1961 // Original type: uint8_t
1962 optional int32 snr = 7;
1963 // Indicates the number of unused channels in AFH_channel_map
1964 // Original type: uint8_t
1965 optional int32 unused_afh_channel_count = 8;
1966 // Indicates the number of the channels which are interfered and quality is bad but are still
1967 // selected for AFH
1968 // Original type: uint8_t
1969 optional int32 afh_select_unideal_channel_count = 9;
1970 // Current Link Supervision Timeout Setting
1971 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1972 // Original type: uint16_t
1973 optional int32 lsto = 10;
1974 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1975 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1976 // 0x01 (Piconet Clock)
1977 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1978 // Original type: uint32_t
1979 optional int64 connection_piconet_clock = 11;
1980 // The count of retransmission
1981 // Original type: uint32_t
1982 optional int64 retransmission_count = 12;
1983 // The count of no RX
1984 // Original type: uint32_t
1985 optional int64 no_rx_count = 13;
1986 // The count of NAK (Negative Acknowledge)
1987 // Original type: uint32_t
1988 optional int64 nak_count = 14;
1989 // Controller timestamp of last TX ACK
1990 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1991 // Original type: uint32_t
1992 optional int64 last_tx_ack_timestamp = 15;
1993 // The count of Flow-off (STOP)
1994 // Original type: uint32_t
1995 optional int64 flow_off_count = 16;
1996 // Controller timestamp of last Flow-on (GO)
1997 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1998 // Original type: uint32_t
1999 optional int64 last_flow_on_timestamp = 17;
2000 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2001 // Original type: uint32_t
2002 optional int64 buffer_overflow_bytes = 18;
2003 // Buffer underflow count (in byte) since last event
2004 // Original type: uint32_t
2005 optional int64 buffer_underflow_bytes = 19;
2006}
2007
2008/**
2009 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2010 *
2011 * Notes:
2012 * - Each event can be partially filled as we might learn different pieces of device
2013 * information at different time
2014 * - Multiple device info events can be combined to give more complete picture
2015 * - When multiple device info events tries to describe the same information, the
2016 * later one wins
2017 *
2018 * Logged from:
2019 * packages/apps/Bluetooth
2020 */
Jack Heaea26982019-04-04 11:19:48 -07002021message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002022 // An identifier that can be used to match events for this device.
2023 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2024 // Salt: Randomly generated 256 bit value
2025 // Hash algorithm: HMAC-SHA256
2026 // Size: 32 byte
2027 // Default: null or empty if the device identifier is not known
2028 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2029 // Where is this device info obtained from
2030 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2031 // Name of the data source
2032 // For EXTERNAL: package name of the data source
2033 // For INTERNAL: null for general case, component name otherwise
2034 optional string source_name = 3;
2035 // Name of the manufacturer of this device
2036 optional string manufacturer = 4;
2037 // Model of this device
2038 optional string model = 5;
2039 // Hardware version of this device
2040 optional string hardware_version = 6;
2041 // Software version of this device
2042 optional string software_version = 7;
2043}
2044
2045/**
2046 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2047 * device, as documented by the Bluetooth Core HCI specification
2048 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2049 * Vol 2, Part E, Page 1118
2050 *
2051 * Logged from:
2052 * system/bt
2053 */
2054message BluetoothRemoteVersionInfoReported {
2055 // Connection handle of the connection
2056 // Original type: uint16_t
2057 optional int32 connection_handle = 1;
2058 // HCI command status code
2059 // Default: STATUS_UNKNOWN
2060 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2061 // 1 byte Version of current LMP in the remote controller
2062 optional int32 lmp_version = 3;
2063 // 2 bytes LMP manufacturer code of the remote controller
2064 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2065 optional int32 lmp_manufacturer_code = 4;
2066 // 4 bytes subversion of the LMP in the remote controller
2067 optional int32 lmp_subversion = 5;
2068}
2069
2070/**
2071 * Logs when certain Bluetooth SDP attributes are discovered
2072 * Constant definitions are from:
2073 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2074 *
2075 * Current logged attributes:
2076 * - BluetoothProfileDescriptorList
2077 * - Supported Features Bitmask
2078 *
2079 * Logged from:
2080 * system/bt
2081 */
2082message BluetoothSdpAttributeReported {
2083 // An identifier that can be used to match events for this device.
2084 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2085 // Salt: Randomly generated 256 bit value
2086 // Hash algorithm: HMAC-SHA256
2087 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2088 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2089 // Original type: uint16_t
2090 optional int32 protocol_uuid = 2;
2091 // Short form UUIDs used to identify Bluetooth SDP attribute types
2092 // Original type: uint16_t
2093 optional int32 attribute_id = 3;
2094 // Attribute value for the particular attribute
2095 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2096}
2097
2098/**
2099 * Logs when bond state of a Bluetooth device changes
2100 *
2101 * Logged from:
2102 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2103 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2104 */
2105message BluetoothBondStateChanged {
2106 // An identifier that can be used to match events for this device.
2107 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2108 // Salt: Randomly generated 256 bit value
2109 // Hash algorithm: HMAC-SHA256
2110 // Size: 32 byte
2111 // Default: null or empty if the device identifier is not known
2112 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2113 // Preferred transport type to remote dual mode device
2114 // Default: TRANSPORT_AUTO means no preference
2115 optional android.bluetooth.TransportTypeEnum transport = 2;
2116 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2117 // Default: UNKNOWN
2118 optional android.bluetooth.DeviceTypeEnum type = 3;
2119 // Current bond state (NONE, BONDING, BONDED)
2120 // Default: BOND_STATE_UNKNOWN
2121 optional android.bluetooth.BondStateEnum bond_state = 4;
2122 // Bonding sub state
2123 // Default: BOND_SUB_STATE_UNKNOWN
2124 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2125 // Unbond Reason
2126 // Default: UNBOND_REASON_UNKNOWN
2127 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2128}
2129
2130/**
2131 * Logs there is an event related Bluetooth classic pairing
2132 *
2133 * Logged from:
2134 * system/bt
2135 */
2136message BluetoothClassicPairingEventReported {
2137 // An identifier that can be used to match events for this device.
2138 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2139 // Salt: Randomly generated 256 bit value
2140 // Hash algorithm: HMAC-SHA256
2141 // Size: 32 byte
2142 // Default: null or empty if the device identifier is not known
2143 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2144 // Connection handle of this connection if available
2145 // Range: 0x0000 - 0x0EFF (12 bits)
2146 // Default: 0xFFFF if the handle is unknown
2147 optional int32 connection_handle = 2;
2148 // HCI command associated with this event
2149 // Default: CMD_UNKNOWN
2150 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2151 // HCI event associated with this event
2152 // Default: EVT_UNKNOWN
2153 optional android.bluetooth.hci.EventEnum hci_event = 4;
2154 // HCI command status code if this is triggerred by hci_cmd
2155 // Default: STATUS_UNKNOWN
2156 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2157 // HCI reason code associated with this event
2158 // Default: STATUS_UNKNOWN
2159 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002160 // A status value related to this specific event
2161 // Default: 0
2162 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002163}
2164
2165/**
2166 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2167 *
2168 * Logged from:
2169 * system/bt
2170 */
2171message BluetoothSmpPairingEventReported {
2172 // An identifier that can be used to match events for this device.
2173 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2174 // Salt: Randomly generated 256 bit value
2175 // Hash algorithm: HMAC-SHA256
2176 // Size: 32 byte
2177 // Default: null or empty if the device identifier is not known
2178 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2179 // SMP command sent or received over L2CAP
2180 // Default: CMD_UNKNOWN
2181 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2182 // Whether this command is sent or received
2183 // Default: DIRECTION_UNKNOWN
2184 optional android.bluetooth.DirectionEnum direction = 3;
2185 // SMP failure reason code
2186 // Default: PAIRING_FAIL_REASON_DEFAULT
2187 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2188}
2189
2190/**
Jack He815cdba2019-01-30 17:24:55 -08002191 * Logs when a Bluetooth socket’s connection state changed
2192 *
2193 * Logged from:
2194 * system/bt
2195 */
2196message BluetoothSocketConnectionStateChanged {
2197 // An identifier that can be used to match events for this device.
2198 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2199 // Salt: Randomly generated 256 bit value
2200 // Hash algorithm: HMAC-SHA256
2201 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002202 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002203 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002204 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002205 // Default 0 when unknown or don't care
2206 optional int32 port = 2;
2207 // Socket type as mentioned in
2208 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2209 // Default: SOCKET_TYPE_UNKNOWN
2210 optional android.bluetooth.SocketTypeEnum type = 3;
2211 // Socket connection state
2212 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2213 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2214 // Number of bytes sent to remote device during this connection
2215 optional int64 tx_bytes = 5;
2216 // Number of bytes received from remote device during this connection
2217 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002218 // Socket owner's UID
2219 optional int32 uid = 7 [(is_uid) = true];
2220 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2221 // |port| must be spawned by |server_port|
2222 // Default 0 when unknown or don't care
2223 optional int32 server_port = 8;
2224 // Whether this is a server listener socket
2225 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002226}
2227
2228/**
Jack He71426802019-04-02 13:32:52 -07002229 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2230 *
2231 * Logged from:
2232 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2233 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2234 *
2235 */
2236message BluetoothClassOfDeviceReported {
2237 // An identifier that can be used to match events for this device.
2238 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2239 // Salt: Randomly generated 256 bit value
2240 // Hash algorithm: HMAC-SHA256
2241 // Size: 32 byte
2242 // Default: null or empty if this is a server listener socket
2243 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2244 // Class of Device (CoD) value including both Major, Minor device class and service class
2245 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2246 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2247 // Default: 0
2248 optional int32 class_of_device = 2;
2249}
2250
2251/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002252 * Logs when something is plugged into or removed from the USB-C connector.
2253 *
2254 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002255 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002256 */
2257message UsbConnectorStateChanged {
2258 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002259 STATE_DISCONNECTED = 0;
2260 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002261 }
2262 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002263 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002264 // Last active session in ms.
2265 // 0 when the port is in connected state.
2266 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002267}
2268
2269/**
2270 * Logs the reported speaker impedance.
2271 *
2272 * Logged from:
2273 * Vendor audio implementation.
2274 */
2275message SpeakerImpedanceReported {
2276 optional int32 speaker_location = 1;
2277 optional int32 impedance = 2;
2278}
2279
2280/**
2281 * Logs the report of a failed hardware.
2282 *
2283 * Logged from:
2284 * Vendor HALs.
2285 *
2286 */
2287message HardwareFailed {
2288 enum HardwareType {
2289 HARDWARE_FAILED_UNKNOWN = 0;
2290 HARDWARE_FAILED_MICROPHONE = 1;
2291 HARDWARE_FAILED_CODEC = 2;
2292 HARDWARE_FAILED_SPEAKER = 3;
2293 HARDWARE_FAILED_FINGERPRINT = 4;
2294 }
2295 optional HardwareType hardware_type = 1;
2296
Maggie White6dcd8572019-01-31 14:11:50 -08002297 /**
2298 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002299 * the same hardware_type. The specific locations are vendor defined integers,
2300 * referring to board-specific numbering schemes.
2301 */
2302 optional int32 hardware_location = 2;
2303
Maggie White6dcd8572019-01-31 14:11:50 -08002304 /**
2305 * failure_code is specific to the HardwareType of the failed hardware.
2306 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002307 */
Maggie White6dcd8572019-01-31 14:11:50 -08002308 enum HardwareErrorCode {
2309 UNKNOWN = 0;
2310 COMPLETE = 1;
2311 SPEAKER_HIGH_Z = 2;
2312 SPEAKER_SHORT = 3;
2313 FINGERPRINT_SENSOR_BROKEN = 4;
2314 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002315 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002316 }
2317 optional int32 failure_code = 3;
2318}
2319
2320/**
2321 * Log an event when the device has been physically dropped.
2322 * Reported from the /vendor partition.
2323 */
2324message PhysicalDropDetected {
2325 // Confidence that the event was actually a drop, 0 -> 100
2326 optional int32 confidence_pctg = 1;
2327 // Peak acceleration of the drop, in 1/1000s of a g.
2328 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002329 // Duration of freefall in ms
2330 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002331}
2332
2333/**
2334 * Log bucketed battery charge cycles.
2335 *
2336 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002337 * a given charge point. For example, if 10 cycle buckets are
2338 * initialized, bucket 1 is the lowest 1/10th of the battery,
2339 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002340 *
2341 * Logged from:
2342 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2343 */
2344message ChargeCyclesReported {
2345 optional int32 cycle_bucket_1 = 1;
2346 optional int32 cycle_bucket_2 = 2;
2347 optional int32 cycle_bucket_3 = 3;
2348 optional int32 cycle_bucket_4 = 4;
2349 optional int32 cycle_bucket_5 = 5;
2350 optional int32 cycle_bucket_6 = 6;
2351 optional int32 cycle_bucket_7 = 7;
2352 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002353 optional int32 cycle_bucket_9 = 9;
2354 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002355}
2356
2357/**
Howard Roa46b6582018-09-18 16:45:02 -07002358 * Log battery health snapshot.
2359 *
2360 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2361 * are snapshotted periodically over 24hrs.
2362 */
2363message BatteryHealthSnapshot {
2364 enum BatterySnapshotType {
2365 UNKNOWN = 0;
2366 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2367 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2368 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2369 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2370 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2371 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2372 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2373 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2374 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2375 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2376 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2377 }
2378 optional BatterySnapshotType type = 1;
2379 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002380 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002381 // Voltage Battery Voltage, in microVolts.
2382 optional int32 voltage_micro_volt = 3;
2383 // Current Battery current, in microAmps.
2384 optional int32 current_micro_amps = 4;
2385 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2386 optional int32 open_circuit_micro_volt = 5;
2387 // Resistance Battery Resistance, in microOhms.
2388 optional int32 resistance_micro_ohm = 6;
2389 // Level Battery Level, as % of full.
2390 optional int32 level_percent = 7;
2391}
2392
2393/**
2394 * Log slow I/O operations on the primary storage.
2395 */
2396message SlowIo {
2397 // Classifications of IO Operations.
2398 enum IoOperation {
2399 UNKNOWN = 0;
2400 READ = 1;
2401 WRITE = 2;
2402 UNMAP = 3;
2403 SYNC = 4;
2404 }
2405 optional IoOperation operation = 1;
2406
2407 // The number of slow IO operations of this type over 24 hours.
2408 optional int32 count = 2;
2409}
2410
2411/**
2412 * Log battery caused shutdown with the last recorded voltage.
2413 */
2414message BatteryCausedShutdown {
2415 // The last recorded battery voltage prior to shutdown.
2416 optional int32 last_recorded_micro_volt = 1;
2417}
2418
2419/**
Tej Singha72344992019-04-17 18:55:08 -07002420 * Logs when ThermalService receives throttling events.
2421 *
2422 * Logged from:
2423 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2424 */
2425message ThermalThrottlingSeverityStateChanged {
2426 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2427 optional android.os.TemperatureTypeEnum sensor_type = 1;
2428
2429 // The name of the temperature source. Eg. CPU0
2430 optional string sensor_name = 2;
2431
2432 // Temperature in tenths of a degree C.
2433 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2434 optional int32 temperature_deci_celsius = 3;
2435
2436 // Relative severity of the throttling, see enum definition.
2437 optional android.os.ThrottlingSeverityEnum severity = 4;
2438}
2439
2440/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002441 * Logs the duration of a davey (jank of >=700ms) when it occurs
2442 *
2443 * Logged from:
2444 * frameworks/base/libs/hwui/JankTracker.cpp
2445 */
2446message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002447 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002448 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002449
Tej Singhbb8554a2018-01-26 11:59:14 -08002450 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002451 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002452}
2453
2454/**
Bookatze5885242017-10-24 20:10:31 -07002455 * Logs phone signal strength changes.
2456 *
2457 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002458 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002459 */
2460message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002461 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2462 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002463}
2464
Yangster4ccebea2018-10-09 17:09:02 -07002465
2466/**
2467 * Logs when the phone state, sim state or signal strength changes
2468 *
2469 * Logged from:
2470 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2471 */
2472message PhoneServiceStateChanged {
2473 optional android.telephony.ServiceStateEnum state = 1;
2474 optional android.telephony.SimStateEnum sim_state = 2;
2475 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2476}
2477
2478/**
2479 * Logs when the phone becomes on or off.
2480 *
2481 * Logged from:
2482 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2483 */
2484message PhoneStateChanged {
2485 enum State {
2486 OFF = 0;
2487 ON = 1;
2488 }
2489 optional State state = 1;
2490}
2491
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002492message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002493 optional android.stats.launcher.LauncherAction action = 1;
2494 optional android.stats.launcher.LauncherState src_state = 2;
2495 optional android.stats.launcher.LauncherState dst_state = 3;
2496 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002497 optional bool is_swipe_up_enabled = 5;
2498}
2499
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002500message StyleUIChanged {
2501 optional android.stats.style.Action action = 1;
2502 optional int32 color_package_hash = 2;
2503 optional int32 font_package_hash = 3;
2504 optional int32 shape_package_hash = 4;
2505 optional int32 clock_package_hash = 5;
2506 optional int32 launcher_grid = 6;
2507 optional int32 wallpaper_category_hash = 7;
2508 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002509 optional int32 color_preference = 9;
2510 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002511}
2512
David Chenc28b2bb2017-10-24 12:52:52 -07002513/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002514 * Logs when Settings UI has changed.
2515 *
2516 * Logged from:
2517 * packages/apps/Settings
2518 */
2519message SettingsUIChanged {
2520 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002521 * Where this SettingsUIChange event comes from. For example, if
2522 * it's a PAGE_VISIBLE event, where the page is opened from.
2523 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002524 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002525
2526 /**
2527 * What the UI action is.
2528 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002529 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002530
2531 /**
2532 * Where the action is happening
2533 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002534 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002535
2536 /**
2537 * What preference changed in this event.
2538 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002539 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002540
2541 /**
2542 * The new value of the changed preference.
2543 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002544 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002545}
2546
2547/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002548 * Logs basic timing information about touch events.
2549 * Reported at most every 5 minutes while device is being interacted with.
2550 *
2551 * Logged from:
2552 * frameworks/native/services/inputflinger
2553 */
2554message TouchEventReported {
2555 /**
2556 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2557 * and the standard deviation of latency between the kernel and framework
2558 * for touchscreen events. The units are microseconds.
2559 *
2560 * The number is measured as the difference between the time at which
2561 * the input event was received in the evdev driver,
2562 * and the time at which the input event was received in EventHub.
2563 */
2564 // Minimum value
2565 optional float latency_min_micros = 1;
2566 // Maximum value
2567 optional float latency_max_micros = 2;
2568 // Average value
2569 optional float latency_mean_micros = 3;
2570 // Standard deviation
2571 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002572 // Number of touch events (input_event) in this report
2573 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002574}
2575
2576/**
Philip Quinn0eded622019-01-29 12:46:28 -08002577 * Logs gesture classification and timing information for touch events.
2578 *
2579 * Logged from:
2580 * frameworks/base/core/java/android/view/GestureDetector.java
2581 * frameworks/base/core/java/android/view/View.java
2582 */
2583message TouchGestureClassified {
2584 // The source of the classification (e.g. Java class name).
2585 optional string source = 1;
2586
2587 enum Classification {
2588 UNKNOWN_CLASSIFICATION = 0;
2589 SINGLE_TAP = 1;
2590 DOUBLE_TAP = 2;
2591 LONG_PRESS = 3;
2592 DEEP_PRESS = 4;
2593 SCROLL = 5;
2594 }
2595 // The classification of the gesture.
2596 optional Classification classification = 2;
2597
2598 // The interval from the start of a touch event stream until the
2599 // classification was made.
2600 optional int32 latency_millis = 3;
2601
2602 // The distance from the location of the first touch event to the
2603 // location of the touch event when the classification was made.
2604 optional float displacement_px = 4;
2605}
2606
2607/**
David Chenc28b2bb2017-10-24 12:52:52 -07002608 * Logs that a setting was updated.
2609 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002610 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002611 * The tag and is_default allow resetting of settings to default values based on the specified
2612 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2613 */
2614message SettingChanged {
2615 // The name of the setting.
2616 optional string setting = 1;
2617
2618 // The change being imposed on this setting. May represent a number, eg "3".
2619 optional string value = 2;
2620
2621 // The new value of this setting. For most settings, this is same as value. For some settings,
2622 // value is +X or -X where X represents an element in a set. For example, if the previous value
2623 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2624 // The +/- feature is currently only used for location_providers_allowed.
2625 optional string new_value = 3;
2626
2627 // The previous value of this setting.
2628 optional string prev_value = 4;
2629
2630 // The tag used with the is_default for resetting sets of settings. This is generally null.
2631 optional string tag = 5;
2632
Bookatz90867622018-01-31 15:05:57 -08002633 // True if this setting with tag should be resettable.
2634 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002635
David Chenbd789912018-03-16 17:19:55 -07002636 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002637 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002638
2639 enum ChangeReason {
2640 UPDATED = 1; // Updated can be an insertion or an update.
2641 DELETED = 2;
2642 }
2643 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002644}
Chenjie Yub3dda412017-10-24 13:41:59 -07002645
Chenjie Yu05013b32017-11-21 10:21:41 -08002646/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002647 * Logs activity going to foreground or background
2648 *
2649 * Logged from:
2650 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2651 */
2652message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002653 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002654 optional string pkg_name = 2;
2655 optional string class_name = 3;
2656
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002657 enum State {
2658 BACKGROUND = 0;
2659 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002660 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002661 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002662}
David Chenc8a43242017-10-17 16:23:28 -07002663
2664/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002665 * Logs when a volume entered low Storage state.
2666 * Logged from:
2667 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2668 */
2669message LowStorageStateChanged {
2670 // Volume that ran out of storage.
2671 optional string volume_description = 1;
2672
2673 enum State {
2674 UNKNOWN = 0;
2675 OFF = 1;
2676 ON = 2;
2677 }
2678 optional State state = 2;
2679}
2680
2681/**
2682 * Logs when an app is downgraded.
2683 * Logged from:
2684 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2685 */
2686message AppDowngraded {
2687 optional string package_name = 1;
2688 // Size of the package (all data) before being downgraded.
2689 optional int64 size_in_bytes_before = 2;
2690 // Size of the package (all data) after being downgraded.
2691 optional int64 size_in_bytes_after = 3;
2692
2693 optional bool aggressive = 4;
2694}
2695
2696/**
2697 * Logs when an app is optimized after being downgraded.
2698 * Logged from:
2699 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2700 */
2701message AppOptimizedAfterDowngraded {
2702 optional string package_name = 1;
2703}
2704
2705/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002706 * Logs whenever an app is installed on external storage.
2707 * Logged from:
2708 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2709 */
2710message AppInstallOnExternalStorageReported {
2711 // The type of external storage.
2712 optional android.stats.storage.ExternalStorageType storage_type = 1;
2713 // The name of the package that is installed on the sd card.
2714 optional string package_name = 2;
2715}
2716
2717/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002718 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002719 * Logged from:
2720 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2721 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002722message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002723 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002724
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002725 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002726
2727 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002728 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002729 optional string process_name = 3;
2730
2731 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002732 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002733
2734 optional string package_name = 5;
2735
2736 enum InstantApp {
2737 UNAVAILABLE = 0;
2738 FALSE = 1;
2739 TRUE = 2;
2740 }
2741 optional InstantApp is_instant_app = 6;
2742
2743 enum ForegroundState {
2744 UNKNOWN = 0;
2745 BACKGROUND = 1;
2746 FOREGROUND = 2;
2747 }
2748 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002749
2750 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002751}
David Chen9e3808c2017-11-20 17:25:34 -08002752
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002753/**
2754 * Logs when a WTF (What a Terrible Failure) happened.
2755 * Logged from:
2756 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2757 */
2758message WTFOccurred {
2759 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002760
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002761 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002762
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002763 // The name of the process.
2764 // system_server if it is not by an app
2765 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002766
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002767 // The pid if available. -1 means not available.
2768 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002769
2770 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002771}
2772
2773/**
2774 * Logs when system server reports low memory.
2775 * Logged from:
2776 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2777 */
2778message LowMemReported {
2779}
2780
2781/**
2782 * Logs when an app ANR (App Not Responding) occurs.
2783 * Logged from:
2784 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2785 */
2786message ANROccurred {
2787 optional int32 uid = 1 [(is_uid) = true];
2788
2789 optional string process_name = 2;
2790
2791 optional string short_component_name = 3;
2792
2793 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002794
2795 enum InstantApp {
2796 UNAVAILABLE = 0;
2797 FALSE = 1;
2798 TRUE = 2;
2799 }
2800 optional InstantApp is_instant_app = 5;
2801
2802 enum ForegroundState {
2803 UNKNOWN = 0;
2804 BACKGROUND = 1;
2805 FOREGROUND = 2;
2806 }
2807 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002808
2809 optional android.server.ErrorSource error_source = 7;
2810
2811 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002812}
2813
Bookatza7020bd2018-08-28 16:29:35 -07002814/**
2815 * Logs when the vibrator state changes.
2816 * Logged from:
2817 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2818 */
2819message VibratorStateChanged {
2820 repeated AttributionNode attribution_node = 1;
2821
2822 enum State {
2823 OFF = 0;
2824 ON = 1;
2825 }
2826 optional State state = 2;
2827
2828 // Duration (in milliseconds) requested to keep the vibrator on.
2829 // Only applicable for State == ON.
2830 optional int64 duration_millis = 3;
2831}
2832
David Chen0a368b22017-12-06 16:28:16 -08002833/*
2834 * Allows other apps to push events into statsd.
2835 * Logged from:
2836 * frameworks/base/core/java/android/util/StatsLog.java
2837 */
David Chen0b5c90c2018-01-25 16:51:49 -08002838message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002839 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002840 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002841
2842 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2843 optional int32 label = 2;
2844
2845 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2846 // predicates for the metrics).
2847 enum State {
2848 UNKNOWN = 0;
2849 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2850 STOP = 2;
2851 START = 3;
2852 }
2853 optional State state = 3;
2854}
2855
David Chen9e3808c2017-11-20 17:25:34 -08002856/**
Bookatz7948c872018-09-04 12:58:33 -07002857 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2858 * For example, this could be due to the user manually changing the time.
2859 *
2860 * Logged from:
2861 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2862 */
2863message WallClockTimeShifted {
2864 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2865 optional int64 wall_clock_timestamp_millis = 1;
2866}
2867
2868/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002869 * Logs when statsd detects an anomaly.
2870 *
2871 * Logged from:
2872 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2873 */
2874message AnomalyDetected {
2875 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002876 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002877
Yangster-mac94e197c2018-01-02 16:03:03 -08002878 // Id of the config whose anomaly detection alert fired.
2879 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002880
Yangster-mac94e197c2018-01-02 16:03:03 -08002881 // Id of the alert (i.e. name of the anomaly that was detected).
2882 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002883}
2884
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002885message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002886 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002887 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002888
2889 // The app package name.
2890 optional string pkg_name = 2;
2891
2892 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002893 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002894 WARM = 1;
2895 HOT = 2;
2896 COLD = 3;
2897 }
2898 // The transition type.
2899 optional TransitionType type = 3;
2900
2901 // The activity name.
2902 optional string activity_name = 4;
2903
2904 // The name of the calling app. Empty if not set.
2905 optional string calling_pkg_name = 5;
2906
2907 // Whether the app is an instant app.
2908 optional bool is_instant_app = 6;
2909
2910 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002911 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002912
Bookatz80d11a02018-01-16 10:46:35 -08002913 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002914
David Chen0b5c90c2018-01-25 16:51:49 -08002915 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002916 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002917 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002918 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002919 optional int32 bind_application_delay_millis = 11;
2920 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002921
2922 // Empty if not set.
2923 optional string launch_token = 13;
2924
Calin Juravle759fbda2018-02-20 19:52:30 +00002925 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002926 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002927
2928 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002929 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002930}
2931
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002932message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002933 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002934 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002935
2936 // The app package name.
2937 optional string pkg_name = 2;
2938
2939 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002940 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002941 WARM = 1;
2942 HOT = 2;
2943 COLD = 3;
2944 }
2945 // The transition type.
2946 optional TransitionType type = 3;
2947
2948 // The activity name.
2949 optional string activity_name = 4;
2950}
2951
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002952message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002953 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002954 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002955
2956 // The app package name.
2957 optional string pkg_name = 2;
2958
2959 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002960 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002961 WITH_BUNDLE = 1;
2962 WITHOUT_BUNDLE = 2;
2963 }
2964 // The transition type.
2965 optional TransitionType type = 3;
2966
2967 // The activity name.
2968 optional string activity_name = 4;
2969
2970 optional bool transition_process_running = 5;
2971
2972 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002973 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002974}
2975
Bookatz8fcd09a2017-12-18 13:01:10 -08002976/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002977 * Logs a picture-in-picture action
2978 * Logged from:
2979 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2980 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2981 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2982 */
2983message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002984 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002985 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002986
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002987 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002988
Chenjie Yu52cacc62017-12-08 18:11:45 -08002989 enum State {
2990 ENTERED = 1;
2991 EXPANDED_TO_FULL_SCREEN = 2;
2992 MINIMIZED = 3;
2993 DISMISSED = 4;
2994 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002995 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002996}
2997
2998/**
Chenjie Yue8904192017-12-08 19:12:57 -08002999 * Logs overlay action
3000 * Logged from:
3001 * services/core/java/com/android/server/wm/Session.java
3002 */
3003message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003004 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003005
3006 optional string package_name = 2;
3007
3008 optional bool using_alert_window = 3;
3009
3010 enum State {
3011 ENTERED = 1;
3012 EXITED = 2;
3013 }
3014 optional State state = 4;
3015}
3016
Chenjie Yuccfe6452018-01-30 11:33:21 -08003017/*
3018 * Logs foreground service starts and stops.
3019 * Note that this is not when a service starts or stops, but when it is
3020 * considered foreground.
3021 * Logged from
3022 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3023 */
3024message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003025 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003026 // package_name + "/" + class_name
3027 optional string short_name = 2;
3028
3029 enum State {
3030 ENTER = 1;
3031 EXIT = 2;
3032 }
3033 optional State state = 3;
3034}
3035
Chenjie Yue8904192017-12-08 19:12:57 -08003036/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003037 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3038 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3039 * attributed back to the parent (host) uid. One example is Chrome.
3040 *
3041 * Logged from:
3042 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3043 */
3044message IsolatedUidChanged {
3045 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003046 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003047 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003048 optional int32 parent_uid = 1;
3049
3050 optional int32 isolated_uid = 2;
3051
3052 // We expect an isolated uid to be removed before if it's used for another parent uid.
3053 enum Event {
3054 REMOVED = 0;
3055 CREATED = 1;
3056 }
3057 optional Event event = 3;
3058}
3059
3060/*
3061 * Logs the reception of an incoming network packet causing the main system to wake up for
3062 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3063 * and processed by WakeupController.cpp.
3064 */
3065message PacketWakeupOccurred {
3066 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3067 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003068 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003069 // The interface name on which the packet was received.
3070 optional string iface = 2;
3071 // The ethertype value of the packet.
3072 optional int32 ethertype = 3;
3073 // String representation of the destination MAC address of the packet.
3074 optional string destination_hardware_address = 4;
3075 // String representation of the source address of the packet if this was an IP packet.
3076 optional string source_ip = 5;
3077 // String representation of the destination address of the packet if this was an IP packet.
3078 optional string destination_ip = 6;
3079 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3080 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3081 // families.
3082 optional int32 ip_next_header = 7;
3083 // The source port if this was a TCP or UDP packet.
3084 optional int32 source_port = 8;
3085 // The destination port if this was a TCP or UDP packet.
3086 optional int32 destination_port = 9;
3087}
3088
3089/*
3090 * Logs the memory stats for an app on startup.
3091 * Logged from:
3092 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3093 */
3094message AppStartMemoryStateCaptured {
3095 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003096 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003097
3098 // The process name.
3099 optional string process_name = 2;
3100
3101 // The activity name.
3102 optional string activity_name = 3;
3103
3104 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003105 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003106
3107 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003108 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003109
3110 // RSS
3111 optional int64 rss_in_bytes = 6;
3112
3113 // CACHE
3114 optional int64 cache_in_bytes = 7;
3115
3116 // SWAP
3117 optional int64 swap_in_bytes = 8;
3118}
3119
3120/*
3121 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3122 * for LMK event.
3123 * Logged from:
3124 * system/core/lmkd/lmkd.c
3125 */
3126message LmkStateChanged {
3127 enum State {
3128 UNKNOWN = 0;
3129 START = 1;
3130 STOP = 2;
3131 }
3132 optional State state = 1;
3133}
3134
3135/*
3136 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3137 * Logged from:
3138 * system/core/lmkd/lmkd.c
3139 */
3140message LmkKillOccurred {
3141 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003142 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003143
3144 // The process name.
3145 optional string process_name = 2;
3146
3147 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003148 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003149
3150 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003151 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003152
3153 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003154 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003155
3156 // RSS
3157 optional int64 rss_in_bytes = 6;
3158
3159 // CACHE
3160 optional int64 cache_in_bytes = 7;
3161
3162 // SWAP
3163 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003164
3165 // The elapsed real time of start of the process.
3166 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003167
3168 // Min oom adj score considered by lmkd.
3169 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003170}
3171
Rajeev Kumar51b54602018-03-01 12:18:26 -08003172/*
3173 * Logs when the ActivityManagerService detects that an app died.
3174 *
3175 * Logged from:
3176 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3177 */
3178message AppDied {
3179 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003180 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003181}
3182
Howard Ro21a039c2018-08-06 14:55:47 -07003183/**
3184 * An atom for generic metrics logging. Available from Android Q.
3185 */
3186message GenericAtom {
3187 // The uid of the application that sent this custom atom.
3188 optional int32 uid = 1 [(is_uid) = true];
3189
3190 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003191 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003192}
3193
Tej Singhd6d6d772018-09-05 17:41:25 -07003194/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003195 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003196 *
3197 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003198 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003199 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003200message BiometricAcquired {
3201 // Biometric modality that was acquired.
3202 optional android.hardware.biometrics.ModalityEnum modality = 1;
3203 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3204 optional int32 user = 2;
3205 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3206 optional bool is_crypto = 3;
3207 // Action that the device is performing. Acquired messages are only expected for enroll and
3208 // authenticate. Other actions may indicate an error.
3209 optional android.hardware.biometrics.ActionEnum action = 4;
3210 // The client that this acquisition was received for.
3211 optional android.hardware.biometrics.ClientEnum client = 5;
3212 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3213 optional int32 acquire_info = 6;
3214 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3215 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003216 // Dictates if this message should trigger additional debugging.
3217 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003218}
3219
3220/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003221 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003222 *
3223 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003224 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003225 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003226message BiometricAuthenticated {
3227 // Biometric modality that was used.
3228 optional android.hardware.biometrics.ModalityEnum modality = 1;
3229 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3230 optional int32 user = 2;
3231 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3232 // storage.
3233 optional bool is_crypto = 3;
3234 // The client that this acquisition was received for.
3235 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003236 // If authentication requires user confirmation. See BiometricPrompt's
3237 // setRequireConfirmation(bool) method.
3238 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003239
Kevin Chyn1741a072019-01-17 11:54:40 -08003240 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003241 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003242 REJECTED = 1;
3243 PENDING_CONFIRMATION = 2;
3244 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003245 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003246
3247 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003248 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003249 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3250 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3251 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3252 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003253 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003254 // Dictates if this message should trigger additional debugging.
3255 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003256}
3257
3258/**
3259 * Logs when a biometric error occurs.
3260 *
3261 * Logged from:
3262 * frameworks/base/services/core/java/com/android/server/biometrics
3263 */
3264message BiometricErrorOccurred {
3265 // Biometric modality that was used.
3266 optional android.hardware.biometrics.ModalityEnum modality = 1;
3267 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3268 optional int32 user = 2;
3269 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3270 optional bool is_crypto = 3;
3271 // Action that the device is performing.
3272 optional android.hardware.biometrics.ActionEnum action = 4;
3273 // The client that this acquisition was received for.
3274 optional android.hardware.biometrics.ClientEnum client = 5;
3275 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3276 // are unique to modality.
3277 optional int32 error_info = 6;
3278 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3279 // by the vendor and not specified by the HIDL interface.
3280 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003281 // Dictates if this message should trigger additional debugging.
3282 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003283}
3284
3285/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003286 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003287 * Logged from:
3288 * frameworks/base/services/core/java/com/android/server/biometrics
3289 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003290message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003291 // Biometric modality.
3292 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003293 // Type of issue detected.
3294 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003295 // Dictates if this message should trigger additional debugging.
3296 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003297}
Howard Ro688ae182018-09-25 00:09:36 -07003298
joshmccloskey6f952b22019-03-25 20:59:35 -07003299/**
3300 * Logs when a biometric enrollment occurs.
3301 *
3302 * Logged from:
3303 * frameworks/base/services/core/java/com/android/server/biometrics
3304 */
3305message BiometricEnrolled {
3306 // Biometric modality that was used.
3307 optional android.hardware.biometrics.ModalityEnum modality = 1;
3308 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3309 optional int32 user = 2;
3310 // The amount of time the enrollment took in milliseconds.
3311 optional int64 latency_millis = 3;
3312 // Whether or not the enrollment was successful.
3313 optional bool success = 4;
3314}
3315
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003316/*
Tej Singh0d176952019-01-16 19:10:54 -08003317 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003318 */
Tej Singh0d176952019-01-16 19:10:54 -08003319message FlagFlipUpdateOccurred {
3320 // If the event is from a flag config package, specify the package name.
3321 optional string flag_flip_package_name = 1;
3322
3323 // The order id of the package
3324 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003325}
3326
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003327/**
3328 * Potential experiment ids that goes with a train install.
3329 */
3330message TrainExperimentIds {
3331 repeated int64 experiment_id = 1;
3332}
3333
Yangster-macb89807e2018-11-15 21:10:57 -08003334/*
3335 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003336 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003337 */
3338message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003339 // Name of the train.
3340 optional string train_name = 1;
3341 // Version code for a "train" of packages that need to be installed atomically
3342 optional int64 train_version_code = 2;
3343 // After installation of this package, device requires a restart.
3344 optional bool requires_staging = 3;
3345 // Rollback should be enabled for this install.
3346 optional bool rollback_enabled = 4;
3347 // Requires low latency monitoring if possible.
3348 optional bool requires_low_latency_monitor = 5;
3349
Yangster-macb89807e2018-11-15 21:10:57 -08003350 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003351 UNKNOWN = 0;
3352 INSTALL_REQUESTED = 1;
3353 INSTALL_STARTED = 2;
3354 INSTALL_STAGED_NOT_READY = 3;
3355 INSTALL_STAGED_READY = 4;
3356 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003357 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3358 // and INSTALL_FAILURE_COMMIT.
3359 INSTALL_FAILURE = 6 [deprecated = true];
3360 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003361 INSTALL_CANCELLED = 7;
3362 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003363 INSTALLER_ROLLBACK_INITIATED = 9;
3364 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3365 INSTALLER_ROLLBACK_STAGED = 11;
3366 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3367 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3368 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3369 INSTALLER_ROLLBACK_SUCCESS = 15;
3370 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003371 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3372 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3373 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3374 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3375 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3376 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003377 INSTALL_FAILURE_DOWNLOAD = 23;
3378 INSTALL_FAILURE_STATE_MISMATCH = 24;
3379 INSTALL_FAILURE_COMMIT = 25;
Yangster-macb89807e2018-11-15 21:10:57 -08003380 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003381 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003382 // Possible experiment ids for monitoring this push.
3383 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3384 // user id
3385 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003386}
3387
Tej Singhc9203082019-05-03 13:42:23 -07003388/* Test atom, is not logged anywhere */
3389message TestAtomReported {
3390 repeated AttributionNode attribution_node = 1;
3391 optional int32 int_field = 2;
3392 optional int64 long_field = 3;
3393 optional float float_field = 4;
3394 optional string string_field = 5;
3395 optional bool boolean_field = 6;
3396 enum State {
3397 UNKNOWN = 0;
3398 OFF = 1;
3399 ON = 2;
3400 }
3401 optional State state = 7;
3402 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3403}
3404
Maggie Whitefc1aa592018-11-28 21:55:23 -08003405/** Represents USB port overheat event. */
3406message UsbPortOverheatEvent {
3407 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3408 optional int32 plug_temperature_deci_c = 1;
3409
3410 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3411 optional int32 max_temperature_deci_c = 2;
3412
3413 /* Time between USB plug event and overheat threshold trip, in seconds. */
3414 optional int32 time_to_overheat_secs = 3;
3415
3416 /* Time between overheat threshold trip and hysteresis, in seconds. */
3417 optional int32 time_to_hysteresis_secs = 4;
3418
3419 /* Time between hysteresis and active mitigation ending, in seconds. */
3420 optional int32 time_to_inactive_secs = 5;
3421};
3422
Maggie White8735b852019-01-18 11:40:49 -08003423/**
3424 * Logs total effective full charge and discharge cycles on a battery.
3425 * Here are some examples of one effective cycle:
3426 * 1) the battery charges from 0% to 100% and drains back to 0%,
3427 * 2) charging from 50% to 100% and draining back to 50% twice.
3428 * Pulled from:
3429 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3430 */
3431message BatteryCycleCount {
3432 /* Number of total charge and discharge cycles on the system battery. */
3433 optional int32 cycle_count = 1;
3434}
3435
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003436/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003437 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3438 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003439 * Pulled from:
3440 * StatsCompanionService
3441 */
3442
Carmen Agimof12dec122019-03-06 16:14:38 +00003443message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003444
Carmen Agimof12dec122019-03-06 16:14:38 +00003445 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003446 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003447 PUBLIC = 1;
3448 PRIVATE = 2;
3449 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003450 }
3451
Carmen Agimof12dec122019-03-06 16:14:38 +00003452 // The type of external storage.
3453 optional android.stats.storage.ExternalStorageType storage_type = 1;
3454 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3455 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003456 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003457 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003458}
3459
Yangster-macb89807e2018-11-15 21:10:57 -08003460/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003461 * Logs when a connection becomes available and lost.
3462 * Logged in StatsCompanionService.java
3463 */
3464message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003465 // Id of the network.
3466 optional int32 net_id = 1;
3467
3468 enum State {
3469 UNKNOWN = 0;
3470 CONNECTED = 1;
3471 DISCONNECTED = 2;
3472 }
3473 // Connected state of a network.
3474 optional State state = 2;
3475}
3476
3477/**
3478 * Logs when a service starts and stops.
3479 * Logged from:
3480 * services/core/java/com/android/server/am/ActiveServices.java
3481 */
3482message ServiceStateChanged {
3483
3484 optional int32 uid = 1 [(is_uid) = true];
3485
3486 optional string package_name = 2;
3487
3488 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003489
3490 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003491 START = 1;
3492 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003493 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003494
3495 optional State state = 4;
3496}
3497
3498/**
3499 * Logs when a service is launched.
3500 * Logged from:
3501 * services/core/java/com/android/server/am/ActiveServices.java
3502 */
3503message ServiceLaunchReported {
3504
3505 optional int32 uid = 1 [(is_uid) = true];
3506
3507 optional string package_name = 2;
3508
3509 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003510}
Howard Ro688ae182018-09-25 00:09:36 -07003511
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003512/**
3513 * Logs when a hidden API is used.
3514 *
3515 * Logged from:
3516 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3517 */
3518message HiddenApiUsed {
3519 // The uid of the app making the hidden access.
3520 optional int32 uid = 1 [(is_uid) = true];
3521
3522 // Signature of the method or field accessed.
3523 optional string signature = 2;
3524
3525 enum AccessMethod {
3526 NONE = 0;
3527 REFLECTION = 1;
3528 JNI = 2;
3529 LINKING = 3;
3530 }
3531
3532 // Type of access.
3533 optional AccessMethod access_method = 3;
3534
3535 // Whether the access was prevented or not.
3536 optional bool access_denied = 4;
3537}
3538
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003539/**
3540 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3541 * - When user sees privacy chip
3542 * - When user clicks privacy chip
3543 * - How does the user exit the Privacy Dialog
3544 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003545 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3546 */
3547message PrivacyIndicatorsInteracted {
3548
3549 enum Type {
3550 UNKNOWN = 0;
3551 CHIP_VIEWED = 1;
3552 CHIP_CLICKED = 2;
3553 DIALOG_PRIVACY_SETTINGS = 3;
3554 DIALOG_DISMISS = 4;
3555 DIALOG_LINE_ITEM = 5;
3556 }
3557
3558 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3559
3560 // Used if the type is LINE_ITEM
3561 optional string package_name = 2;
3562}
3563
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003564/**
3565 * Logs information about a package that is moved from the internal to external storage and vice
3566 * versa.
3567 * It logs the package name, the type of the external storage where the package is installed
3568 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3569 * and the move type: if it's from internal to external or the other way around.
3570 *
3571 * Logged from:
3572 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3573 */
3574message AppMovedStorageReported {
3575 enum MoveType {
3576 UNKNOWN = 0;
3577 TO_EXTERNAL = 1;
3578 TO_INTERNAL = 2;
3579 }
3580 // The type of the external storage.
3581 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3582 // The type of move.
3583 optional MoveType move_type = 2;
3584 // The name of the package that was moved.
3585 optional string package_name = 3;
3586}
3587
jianjin8f2dee02019-03-29 14:03:08 -07003588/**
3589 * Logs when system server watchdog occurs.
3590 * Logged from:
3591 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3592 */
3593message SystemServerWatchdogOccurred {
3594 optional string subject = 1;
3595}
3596
3597/**
3598 * Logs when new file added to tombstones.
3599 * Logged from:
3600 * frameworks/base/core/java/com/android/server/BootReceiver.java
3601 */
3602message TombStoneOccurred {
3603}
3604
Hai Zhang5d3328d2019-04-13 21:25:06 +08003605/*
3606 * Information about a role request
3607 *
3608 * Logged from:
3609 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3610 */
3611message RoleRequestResultReported {
3612 // UID of application requesting the role
3613 optional int32 requesting_uid = 1;
3614
3615 // Package name of application requesting the role
3616 optional string requesting_package_name = 2;
3617
3618 // The role to be granted
3619 optional string role_name = 3;
3620
3621 // The count of applications qualifying for the role
3622 optional int32 qualifying_count = 4;
3623
3624 // UID of application current granted the role
3625 optional int32 current_uid = 5;
3626
3627 // Package name of application current granted the role
3628 optional string current_package_name = 6;
3629
3630 // UID of another application that user chose to grant the role to, instead of the requesting
3631 // application
3632 optional int32 granted_another_uid = 7;
3633
3634 // Package name of another application that user chose to grant the role to, instead of the
3635 // requesting application
3636 optional string granted_another_package_name = 8;
3637
3638 enum Result {
3639 UNDEFINED = 0;
3640 // role request was ignored
3641 IGNORED = 1;
3642 // role request was ignored because it's already granted
3643 IGNORED_ALREADY_GRANTED = 2;
3644 // role request was ignored because the application isn't qualified
3645 IGNORED_NOT_QUALIFIED = 3;
3646 // role request was ignored because user said it should be always denied
3647 IGNORED_USER_ALWAYS_DENIED = 4;
3648 // role was granted by user action
3649 USER_GRANTED = 5;
3650 // role was denied by user action
3651 USER_DENIED = 6;
3652 // role was denied by user granting another application the role
3653 USER_DENIED_GRANTED_ANOTHER = 7;
3654 // role was denied and set to be always denied by the user
3655 USER_DENIED_WITH_ALWAYS = 8;
3656 }
3657 // The result of the role request
3658 optional Result result = 9;
3659}
3660
Chenjie Yubbcbc602018-02-05 16:51:52 -08003661//////////////////////////////////////////////////////////////////////
3662// Pulled atoms below this line //
3663//////////////////////////////////////////////////////////////////////
3664
3665/**
David Chenc8a43242017-10-17 16:23:28 -07003666 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3667 *
3668 * Pulled from:
3669 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3670 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003671message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003672 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003673
3674 optional int64 rx_bytes = 2;
3675
3676 optional int64 rx_packets = 3;
3677
3678 optional int64 tx_bytes = 4;
3679
3680 optional int64 tx_packets = 5;
3681}
3682
3683/**
3684 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3685 *
3686 * Pulled from:
3687 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3688 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003689message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003690 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003691
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003692 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3693 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003694
3695 optional int64 rx_bytes = 3;
3696
3697 optional int64 rx_packets = 4;
3698
3699 optional int64 tx_bytes = 5;
3700
3701 optional int64 tx_packets = 6;
3702}
3703
3704/**
3705 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3706 *
3707 * Pulled from:
3708 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3709 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003710message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003711 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003712
3713 optional int64 rx_bytes = 2;
3714
3715 optional int64 rx_packets = 3;
3716
3717 optional int64 tx_bytes = 4;
3718
3719 optional int64 tx_packets = 5;
3720}
3721
3722/**
3723 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3724 *
3725 * Pulled from:
3726 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3727 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003728message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003729 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003730
Yao Chenc40a19d2018-03-15 16:48:25 -07003731 // 1 denotes foreground and 0 denotes background. This is called Set in
3732 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003733 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003734
3735 optional int64 rx_bytes = 3;
3736
3737 optional int64 rx_packets = 4;
3738
3739 optional int64 tx_bytes = 5;
3740
3741 optional int64 tx_packets = 6;
3742}
3743
3744/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003745 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3746 *
3747 * Pulled from:
3748 * StatsCompanionService
3749 */
3750message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003751 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003752
3753 optional int64 rx_bytes = 2;
3754
3755 optional int64 tx_bytes = 3;
3756}
3757
3758/**
David Chenc8a43242017-10-17 16:23:28 -07003759 * Pulls the kernel wakelock durations. This atom is adapted from
3760 * android/internal/os/KernelWakelockStats.java
3761 *
3762 * Pulled from:
3763 * StatsCompanionService using KernelWakelockReader.
3764 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003765message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003766 optional string name = 1;
3767
3768 optional int32 count = 2;
3769
3770 optional int32 version = 3;
3771
Yangster-maca8a30442018-10-13 23:46:34 -07003772 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003773}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003774
Chenjie Yu05013b32017-11-21 10:21:41 -08003775/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003776 * Pulls low power state information. If power.stats HAL is not available, this
3777 * includes platform and subsystem sleep state information,
3778 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3779 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003780 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003781 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003782 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3783 * as defined in:
3784 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003785 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003786message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003787 // Subsystem name
3788 optional string subsystem_name = 1;
3789 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3790 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003791 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3792 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003793 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003794 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003795 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003796 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003797 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003798}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003799
Chenjie Yu05013b32017-11-21 10:21:41 -08003800/**
Bookatz92da2832018-11-01 18:10:03 -07003801 * Pulls on-device power measurement information.
3802 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3803 * Pulled from:
3804 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3805 */
3806message OnDevicePowerMeasurement {
3807 // Name of the subsystem (to which the rail belongs).
3808 optional string subsystem_name = 1;
3809
3810 // Rail name. The rail lies within the subsystem.
3811 optional string rail_name = 2;
3812
3813 // Time (in ms since boot) at which the rail energy value was measured.
3814 // This may differ slightly from the time that statsd logs this information.
3815 optional uint64 measurement_timestamp_millis = 3;
3816
3817 // Accumulated energy used via the rail since device boot in uWs.
3818 optional uint64 energy_microwatt_secs = 4;
3819}
3820
3821/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003822 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003823 * Pulls the time the cpu spend on the frequency index. Frequency index
3824 * starts from highest to lowest. The value should be monotonically
3825 * increasing since boot. However, if there is a cpu
3826 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003827 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003828message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003829 optional uint32 cluster = 1;
3830 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003831 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003832}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003833
Chenjie Yu05013b32017-11-21 10:21:41 -08003834/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003835 * Pulls Cpu Time Per Uid.
3836 * Note that isolated process uid time should be attributed to host uids.
3837 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003838message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003839 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003840 optional uint64 user_time_micros = 2;
3841 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003842}
3843
3844/**
3845 * Pulls Cpu Time Per Uid per frequency.
3846 * Note that isolated process uid time should be attributed to host uids.
3847 * For each uid, we order the time by descending frequencies.
3848 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003849message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003850 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003851 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003852 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003853}
Hugo Benichi884970e2017-11-14 22:42:46 +09003854
Chenjie Yu05013b32017-11-21 10:21:41 -08003855/**
3856 * Pulls Wifi Controller Activity Energy Info
3857 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003858message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003859 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003860 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003861 // stack reported state
3862 // TODO: replace this with proto enum
3863 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003864 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003865 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003866 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003867 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003868 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003869 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003870 // product of current(mA), voltage(V) and time(ms)
3871 optional uint64 controller_energy_used = 6;
3872}
3873
3874/**
3875 * Pulls Modem Activity Energy Info
3876 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003877message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003878 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003879 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003880 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003881 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003882 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003883 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003884 /**
3885 * Tx power index
3886 * index 0 = tx_power < 0dBm
3887 * index 1 = 0dBm < tx_power < 5dBm
3888 * index 2 = 5dBm < tx_power < 15dBm
3889 * index 3 = 15dBm < tx_power < 20dBm
3890 * index 4 = tx_power > 20dBm
3891 */
3892 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003893 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003894 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003895 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003896 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003897 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003898 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003899 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003900 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003901 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003902 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003903 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003904 // product of current(mA), voltage(V) and time(ms)
3905 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003906}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003907
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003908/**
3909 * Pulls Bluetooth Activity Energy Info
3910 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3911 */
3912message BluetoothActivityInfo {
3913 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003914 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003915 // bluetooth stack state
3916 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003917 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003918 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003919 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003920 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003921 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003922 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003923 // product of current(mA), voltage(V) and time(ms)
3924 optional uint64 energy_used = 6;
3925}
3926
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003927/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003928 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003929 *
3930 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003931 */
3932message ProcessMemoryState {
3933 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003934 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003935
3936 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003937 // Usually package name, "system" for system server.
3938 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003939 optional string process_name = 2;
3940
Rafal Slawikda51b932018-12-13 16:31:33 +00003941 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003942 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003943
3944 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003945 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003946
3947 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003948 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003949
Rajeev Kumar90235992018-01-29 11:06:48 -08003950 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003951 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3952 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003953 optional int64 rss_in_bytes = 6;
3954
3955 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003956 // Value is read from memory.stat, field total_cache if per-app memory
3957 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003958 optional int64 cache_in_bytes = 7;
3959
3960 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003961 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik44af3b32019-04-16 13:16:15 +01003962 // cgroups are enabled. Otherwise, VmSwap from /proc/PID/status.
Rajeev Kumar90235992018-01-29 11:06:48 -08003963 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003964
Rafal Slawikd03ae422018-11-20 11:27:45 +00003965 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003966 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003967
3968 // Elapsed real time when the process started.
3969 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3970 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003971}
3972
3973/*
Rafal Slawik08621582018-10-15 14:53:07 +01003974 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003975 *
3976 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003977 */
3978message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003979 // The uid if available. -1 means not available.
3980 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003981
Rafal Slawikbf67d072018-10-23 11:07:54 +01003982 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003983 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003984 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003985
Rafal Slawikbf67d072018-10-23 11:07:54 +01003986 // # of page-faults
3987 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003988
Rafal Slawikbf67d072018-10-23 11:07:54 +01003989 // # of major page-faults
3990 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003991
Rafal Slawikbf67d072018-10-23 11:07:54 +01003992 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003993 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003994 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003995
Rafal Slawikd03ae422018-11-20 11:27:45 +00003996 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003997 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01003998
3999 // Elapsed real time when the process started.
4000 // Value is read from /proc/PID/stat, field 22.
4001 optional int64 start_time_nanos = 7;
Rafal Slawik44af3b32019-04-16 13:16:15 +01004002
4003 // SWAP
4004 // Value read from /proc/PID/status, field VmSwap.
4005 optional int64 swap_in_bytes = 8;
Rafal Slawik08621582018-10-15 14:53:07 +01004006}
4007
4008/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004009 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004010 *
4011 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4012 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004013 *
4014 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004015 */
4016message ProcessMemoryHighWaterMark {
4017 // The uid if available. -1 means not available.
4018 optional int32 uid = 1 [(is_uid) = true];
4019
Rafal Slawikda51b932018-12-13 16:31:33 +00004020 // The process name.
4021 // Usually package name or process cmdline.
4022 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004023 optional string process_name = 2;
4024
4025 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4026 // /proc/PID/status.
4027 optional int64 rss_high_water_mark_in_bytes = 3;
4028}
4029
4030/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004031 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004032 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004033message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004034 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004035}
4036
4037/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004038 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004039 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004040message SystemUptime {
4041 // Milliseconds since the system was booted.
4042 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4043 // for external input).
4044 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004045 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004046}
4047
4048/*
4049 * Reads from /proc/uid_concurrent_active_time which has the format:
4050 * active: X (X is # cores)
4051 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4052 * [uid1]: [time-0] [time-1] [time-2] ... ...
4053 * ...
4054 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4055 * The file contains a monotonically increasing count of time for a single boot.
4056 */
4057message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004058 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004059 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004060}
4061
4062/**
4063 * Reads from /proc/uid_concurrent_policy_time which has the format:
4064 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4065 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4066 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4067 * ...
4068 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4069 * The file contains a monotonically increasing count of time for a single boot.
4070 */
4071message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004072 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004073 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004074 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004075}
4076
4077/*
4078 * Pulls free disk space, for data, system partition and temporary directory.
4079 */
4080message DiskSpace {
4081 // available bytes in data partition
4082 optional uint64 data_available_bytes = 1;
4083 // available bytes in system partition
4084 optional uint64 system_available_bytes = 2;
4085 // available bytes in download cache or temp directories
4086 optional uint64 temp_available_bytes = 3;
4087}
Tej Singhbf972d92018-01-10 20:51:13 -08004088
4089/**
4090 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004091 *
4092 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004093 */
4094message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004095 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004096}
4097
4098/**
4099 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004100 * Pulled from:
4101 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004102 */
4103message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004104 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004105}
4106
4107/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004108 * Pulls battery voltage.
4109 * Pulled from:
4110 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4111 */
4112message BatteryVoltage {
4113 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004114 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004115}
4116
4117/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004118 * Pulls battery level (percent full, from 0 to 100).
4119 *
4120 * Pulled from:
4121 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4122 */
4123message BatteryLevel {
4124 // Battery level. Should be in [0, 100].
4125 optional int32 battery_level = 1;
4126}
4127
4128/**
Tej Singhd89137e2018-03-26 14:51:40 -07004129 * Pulls the temperature of various parts of the device.
4130 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004131 *
Maggie White442b6312019-04-05 16:26:44 -07004132 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004133 */
4134message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004135 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004136 optional android.os.TemperatureTypeEnum sensor_location = 1;
4137
4138 // The name of the temperature source. Eg. CPU0
4139 optional string sensor_name = 2;
4140
Tej Singhd89137e2018-03-26 14:51:40 -07004141 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004142 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004143 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004144
4145 // Relative severity of the throttling, see enum definition.
4146 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004147}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004148
4149/**
4150 * Pulls the statistics of calls to Binder.
4151 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004152 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4153 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004154 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004155 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004156 */
4157message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004158 // UID of the process responsible for the binder transaction. It will be set if the process
4159 // executing the binder transaction attribute the transaction to another uid using
4160 // Binder.setThreadWorkSource().
4161 //
4162 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004163 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004164 // UID of the process executing the binder transaction.
4165 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004166 // Fully qualified class name of the API call.
4167 //
4168 // This is a system server class name.
4169 //
4170 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4171 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4172 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4173 // commonly used APIs.
4174 optional string service_class_name = 2;
4175 // Method name of the API call. It can also be a transaction code if we cannot
4176 // resolve it to a name. See Binder#getTransactionName.
4177 //
4178 // This is a system server method name.
4179 optional string service_method_name = 3;
4180 // Total number of API calls.
4181 optional int64 call_count = 4;
4182 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4183 optional bool screen_interactive = 13;
4184 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4185 // call_count will be equal to recorded_call_count.
4186 //
4187 // If recorded_call_count is different than call_count, it means data collection has been
4188 // sampled. All the fields below will be sampled in this case.
4189 optional int64 recorded_call_count = 12;
4190 // Number of exceptions thrown by the API.
4191 optional int64 recorded_exception_count = 5;
4192 // Total latency of all API calls.
4193 // Average can be computed using total_latency_micros / recorded_call_count.
4194 optional int64 recorded_total_latency_micros = 6;
4195 // Maximum latency of one API call.
4196 optional int64 recorded_max_latency_micros = 7;
4197 // Total CPU usage of all API calls.
4198 // Average can be computed using total_cpu_micros / recorded_call_count.
4199 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4200 optional int64 recorded_total_cpu_micros = 8;
4201 // Maximum CPU usage of one API call.
4202 optional int64 recorded_max_cpu_micros = 9;
4203 // Maximum parcel reply size of one API call.
4204 optional int64 recorded_max_reply_size_bytes = 10;
4205 // Maximum parcel request size of one API call.
4206 optional int64 recorded_max_request_size_bytes = 11;
4207}
4208
4209/**
4210 * Pulls the statistics of exceptions during calls to Binder.
4211 *
4212 * Binder stats are cumulative from boot unless somebody reset the data using
4213 * > adb shell dumpsys binder_calls_stats --reset
4214 */
4215message BinderCallsExceptions {
4216 // Exception class name, e.g. java.lang.IllegalArgumentException.
4217 //
4218 // This is an exception class name thrown by the system server.
4219 optional string exception_class_name = 1;
4220 // Total number of exceptions.
4221 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004222}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004223
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004224/**
4225 * Pulls the statistics of message dispatching on HandlerThreads.
4226 *
4227 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4228 * config on the device.
4229 *
4230 * Next tag: 11
4231 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004232message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004233 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004234 optional int32 uid = 1 [(is_uid) = true];
4235
4236 // Fully qualified class name of the handler target class.
4237 //
4238 // This field does not contain PII. This is a system server class name.
4239 optional string handler_class_name = 2;
4240
4241 // The name of the thread that runs the Looper.
4242 //
4243 // This field does not contain PII. This is a system server thread name.
4244 optional string looper_thread_name = 3;
4245
4246 // The name of the dispatched message.
4247 //
4248 // This field does not contain PII. This is a system server constant or class
4249 // name.
4250 optional string message_name = 4;
4251
4252 // Total number of successfully dispatched messages.
4253 optional int64 message_count = 5;
4254
4255 // Total number of messages that failed dispatching.
4256 optional int64 exception_count = 6;
4257
4258 // Total number of processed messages we have data recorded for. If we
4259 // collected data for all the messages, message_count will be equal to
4260 // recorded_message_count.
4261 //
4262 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004263 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004264 optional int64 recorded_message_count = 7;
4265
4266 // Total latency of all processed messages.
4267 // Average can be computed using recorded_total_latency_micros /
4268 // recorded_message_count.
4269 optional int64 recorded_total_latency_micros = 8;
4270
4271 // Total CPU usage of all processed message.
4272 // Average can be computed using recorded_total_cpu_micros /
4273 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004274 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004275 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004276
4277 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4278 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004279
4280 // Max recorded CPU usage of all processed messages.
4281 optional int64 recorded_max_cpu_micros = 11;
4282
4283 // Max recorded latency of all processed messages.
4284 optional int64 recorded_max_latency_micros = 12;
4285
4286 // Total number of messages we tracked the dispatching delay for. If we
4287 // collected data for all the messages, message_count will be equal to
4288 // recorded_delay_message_count.
4289 //
4290 // If recorded_delay_message_count is different than message_count, it means data
4291 // collection has been sampled or/and not all messages specified the target dispatch time.
4292 // The fields below will be sampled in this case.
4293 optional int64 recorded_delay_message_count = 13;
4294
4295 // Total dispatching delay of all processed messages.
4296 // Calculated as a difference between the target dispatching time (Message.when)
4297 // and the actual dispatching time.
4298 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4299 optional int64 recorded_total_delay_millis = 14;
4300
4301 // Max dispatching delay of all processed messages.
4302 // Calculated as a difference between the target dispatching time (Message.when)
4303 // and the actual dispatching time.
4304 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004305}
Tej Singh86dc9db2018-09-06 00:39:57 +00004306
4307/**
4308 * Pulls disk information, such as write speed and latency.
4309 */
4310message DiskStats {
4311 // Time taken to open, write 512B to, and close a file.
4312 // -1 if error performing the check.
4313 optional int64 data_write_latency_millis = 1;
4314
4315 optional bool file_based_encryption = 2;
4316
4317 // Recent disk write speed in kB/s.
4318 // -1 if error querying storageed.
4319 // 0 if data is unavailable.
4320 optional int32 recent_disk_write_speed = 3;
4321}
4322
4323
4324/**
4325 * Free and total bytes of the Data, Cache, and System partition.
4326 */
4327message DirectoryUsage {
4328 enum Directory {
4329 UNKNOWN = 0;
4330 DATA = 1;
4331 CACHE = 2;
4332 SYSTEM = 3;
4333 }
4334 optional Directory directory = 1;
4335 optional int64 free_bytes = 2;
4336 optional int64 total_bytes = 3;
4337}
4338
4339
4340/**
4341 * Size of an application: apk size, data size, and cache size.
4342 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4343 * Information is only reported for apps with the primary user (user 0).
4344 * Sizes are aggregated by package name.
4345 */
4346message AppSize {
4347 // Including uids will involve modifying diskstats logic.
4348 optional string package_name = 1;
4349 // App size in bytes. -1 if unavailable.
4350 optional int64 app_size_bytes = 2;
4351 // App data size in bytes. -1 if unavailable.
4352 optional int64 app_data_size_bytes = 3;
4353 // App cache size in bytes. -1 if unavailable.
4354 optional int64 app_cache_size_bytes = 4;
4355 // Time that the cache file was produced.
4356 // Uses System.currentTimeMillis(), which is wall clock time.
4357 optional int64 cache_time_millis = 5;
4358}
4359
4360
4361/**
4362 * Size of a particular category. Eg: photos, videos.
4363 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4364 */
4365message CategorySize {
4366 enum Category {
4367 UNKNOWN = 0;
4368 APP_SIZE = 1;
4369 APP_DATA_SIZE = 2;
4370 APP_CACHE_SIZE = 3;
4371 PHOTOS = 4;
4372 VIDEOS = 5;
4373 AUDIO = 6;
4374 DOWNLOADS = 7;
4375 SYSTEM = 8;
4376 OTHER = 9;
4377 }
4378 optional Category category = 1;
4379 // Category size in bytes.
4380 optional int64 size_bytes = 2;
4381 // Time that the cache file was produced.
4382 // Uses System.currentTimeMillis(), which is wall clock time.
4383 optional int64 cache_time_millis = 3;
4384}
Tej Singhd6d6d772018-09-05 17:41:25 -07004385
4386/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004387 * Pulls per uid I/O stats. The stats are cumulative since boot.
4388 *
4389 * Read/write bytes are I/O events from a storage device
4390 * Read/write chars are data requested by read/write syscalls, and can be
4391 * satisfied by caching.
4392 *
4393 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4394 */
4395message DiskIo {
4396 optional int32 uid = 1 [(is_uid) = true];
4397 optional int64 fg_chars_read = 2;
4398 optional int64 fg_chars_write = 3;
4399 optional int64 fg_bytes_read = 4;
4400 optional int64 fg_bytes_write = 5;
4401 optional int64 bg_chars_read = 6;
4402 optional int64 bg_chars_write = 7;
4403 optional int64 bg_bytes_read = 8;
4404 optional int64 bg_bytes_write = 9;
4405 optional int64 fg_fsync = 10;
4406 optional int64 bg_fsync= 11;
4407}
4408
4409
4410/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004411 * Pulls the number of fingerprints for each user.
4412 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004413 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004414 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004415message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004416 // The associated user. Eg: 0 for owners, 10+ for others.
4417 // Defined in android/os/UserHandle.java
4418 optional int32 user = 1;
4419 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004420 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004421}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004422
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004423/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004424 * Pulls the number of faces for each user.
4425 *
4426 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4427 */
4428message NumFacesEnrolled {
4429 // The associated user. Eg: 0 for owners, 10+ for others.
4430 // Defined in android/os/UserHandle.java
4431 optional int32 user = 1;
4432 // Number of faces registered to that user.
4433 optional int32 num_faces_enrolled = 2;
4434}
4435/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004436 * A mapping of role holder -> role
4437 */
4438message RoleHolder {
4439 // uid of the role holder
4440 optional int32 uid = 1 [(is_uid) = true];
4441
4442 // package name of the role holder
4443 optional string package_name = 2;
4444
4445 // the role held
4446 optional string role = 3;
4447}
4448
Yangsteraf9aee72018-10-12 09:26:16 -07004449message AggStats {
4450 optional int64 min = 1;
4451
4452 optional int64 average = 2;
4453
4454 optional int64 max = 3;
4455}
4456
4457message ProcessStatsStateProto {
4458 optional android.service.procstats.ScreenState screen_state = 1;
4459
4460 optional android.service.procstats.MemoryState memory_state = 2;
4461
4462 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4463 // and not frameworks/base/core/java/android/app/ActivityManager.java
4464 optional android.service.procstats.ProcessState process_state = 3;
4465
4466 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004467 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004468
4469 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004470 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004471
4472 // # of samples taken
4473 optional int32 sample_size = 5;
4474
4475 // PSS is memory reserved for this process
4476 optional AggStats pss = 6;
4477
4478 // USS is memory shared between processes, divided evenly for accounting
4479 optional AggStats uss = 7;
4480
4481 // RSS is memory resident for this process
4482 optional AggStats rss = 8;
4483}
4484
4485// Next Tag: 7
4486message ProcessStatsProto {
4487 // Name of process.
4488 optional string process = 1;
4489
4490 // Uid of the process.
4491 optional int32 uid = 2;
4492
4493 // Information about how often kills occurred
4494 message Kill {
4495 // Count of excessive CPU kills
4496 optional int32 cpu = 1;
4497
4498 // Count of kills when cached
4499 optional int32 cached = 2;
4500
4501 // PSS stats during cached kill
4502 optional AggStats cached_pss = 3;
4503 }
4504 optional Kill kill = 3;
4505
4506 // Time and memory spent in various states.
4507 repeated ProcessStatsStateProto states = 5;
4508
4509 // Total time process has been running... screen_state, memory_state, and process_state
4510 // will not be set.
4511 optional ProcessStatsStateProto total_running_state = 6;
4512}
4513
4514message PackageServiceOperationStatsProto {
4515 // Operate enum: Started, Foreground, Bound, Executing
4516 optional android.service.procstats.ServiceOperationState operation = 1;
4517
4518 // Number of times the service was in this operation.
4519 optional int32 count = 2;
4520
4521 // Information about a state the service can be in.
4522 message StateStats {
4523 // Screen state enum.
4524 optional android.service.procstats.ScreenState screen_state = 1;
4525 // Memory state enum.
4526 optional android.service.procstats.MemoryState memory_state = 2;
4527
4528 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004529 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004530 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004531 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004532 }
4533 repeated StateStats state_stats = 3;
4534}
4535
4536message PackageServiceStatsProto {
4537 // Name of service component.
4538 optional string service_name = 1;
4539
4540 // The operation stats.
4541 // The package_name, package_uid, package_version, service_name will not be set to save space.
4542 repeated PackageServiceOperationStatsProto operation_stats = 2;
4543}
4544
4545message PackageAssociationSourceProcessStatsProto {
4546 // Uid of the process.
4547 optional int32 process_uid = 1;
4548 // Process name.
4549 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004550 // Package name.
4551 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004552 // Total count of the times this association appeared.
4553 optional int32 total_count = 3;
4554
4555 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004556 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004557
4558 // Total count of the times this association became actively impacting its target process.
4559 optional int32 active_count = 5;
4560
4561 // Information on one source in this association.
4562 message StateStats {
4563 // Process state enum.
4564 optional android.service.procstats.ProcessState process_state = 1;
4565 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004566 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004567 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004568 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004569 }
4570 repeated StateStats active_state_stats = 6;
4571}
4572
4573message PackageAssociationProcessStatsProto {
4574 // Name of the target component.
4575 optional string component_name = 1;
4576 // Information on one source in this association.
4577 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4578}
4579
4580
4581message ProcessStatsPackageProto {
4582 // Name of package.
4583 optional string package = 1;
4584
4585 // Uid of the package.
4586 optional int32 uid = 2;
4587
4588 // Version of the package.
4589 optional int64 version = 3;
4590
4591 // Stats for each process running with the package loaded in to it.
4592 repeated ProcessStatsProto process_stats = 4;
4593
4594 // Stats for each of the package's services.
4595 repeated PackageServiceStatsProto service_stats = 5;
4596
4597 // Stats for each association with the package.
4598 repeated PackageAssociationProcessStatsProto association_stats = 6;
4599}
4600
4601message ProcessStatsSectionProto {
4602 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004603 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004604
4605 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004606 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004607
4608 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004609 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004610
4611 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004612 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004613
4614 // System runtime library. e.g. "libdvm.so", "libart.so".
4615 optional string runtime = 5;
4616
4617 // whether kernel reports swapped pss.
4618 optional bool has_swapped_pss = 6;
4619
4620 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4621 enum Status {
4622 STATUS_UNKNOWN = 0;
4623 STATUS_COMPLETE = 1;
4624 STATUS_PARTIAL = 2;
4625 STATUS_SHUTDOWN = 3;
4626 STATUS_SYSPROPS = 4;
4627 }
4628 repeated Status status = 7;
4629
Chenjie Yub2ecc792019-01-17 10:27:26 -08004630 // Number of pages available of various types and sizes, representation fragmentation.
4631 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4632
Yangsteraf9aee72018-10-12 09:26:16 -07004633 // Stats for each process.
4634 repeated ProcessStatsProto process_stats = 8;
4635
4636 // Stats for each package.
4637 repeated ProcessStatsPackageProto package_stats = 9;
4638}
4639
Chenjie Yub2ecc792019-01-17 10:27:26 -08004640message ProcessStatsAvailablePagesProto {
4641 // Node these pages are in (as per /proc/pagetypeinfo)
4642 optional int32 node = 1;
4643
4644 // Zone these pages are in (as per /proc/pagetypeinfo)
4645 optional string zone = 2;
4646
4647 // Label for the type of these pages (as per /proc/pagetypeinfo)
4648 optional string label = 3;
4649
4650 // Distribution of number of pages available by order size. First entry in array is
4651 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4652 repeated int32 pages_per_order = 4;
4653}
4654
Chenjie Yu12e5e672018-09-14 15:54:59 -07004655/**
4656 * Pulled from ProcessStatsService.java
4657 */
4658message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004659 optional ProcessStatsSectionProto proc_stats_section = 1;
4660}
4661
Chenjie Yuf910b7802019-01-11 16:08:20 -08004662/**
4663 * Pulled from ProcessStatsService.java
4664 */
4665message ProcStatsPkgProc {
4666 optional ProcessStatsSectionProto proc_stats_section = 1;
4667}
4668
Yangsteraf9aee72018-10-12 09:26:16 -07004669message PowerProfileProto {
4670 optional double cpu_suspend = 1;
4671
4672 optional double cpu_idle = 2;
4673
4674 optional double cpu_active = 3;
4675
4676 message CpuCluster {
4677 optional int32 id = 1;
4678 optional double cluster_power = 2;
4679 optional int32 cores = 3;
4680 repeated int64 speed = 4;
4681 repeated double core_power = 5;
4682 }
4683
4684 repeated CpuCluster cpu_cluster = 40;
4685
4686 optional double wifi_scan = 4;
4687
4688 optional double wifi_on = 5;
4689
4690 optional double wifi_active = 6;
4691
4692 optional double wifi_controller_idle = 7;
4693
4694 optional double wifi_controller_rx = 8;
4695
4696 optional double wifi_controller_tx = 9;
4697
4698 repeated double wifi_controller_tx_levels = 10;
4699
4700 optional double wifi_controller_operating_voltage = 11;
4701
4702 optional double bluetooth_controller_idle = 12;
4703
4704 optional double bluetooth_controller_rx = 13;
4705
4706 optional double bluetooth_controller_tx = 14;
4707
4708 optional double bluetooth_controller_operating_voltage = 15;
4709
4710 optional double modem_controller_sleep = 16;
4711
4712 optional double modem_controller_idle = 17;
4713
4714 optional double modem_controller_rx = 18;
4715
4716 repeated double modem_controller_tx = 19;
4717
4718 optional double modem_controller_operating_voltage = 20;
4719
4720 optional double gps_on = 21;
4721
4722 repeated double gps_signal_quality_based = 22;
4723
4724 optional double gps_operating_voltage = 23;
4725
4726 optional double bluetooth_on = 24;
4727
4728 optional double bluetooth_active = 25;
4729
4730 optional double bluetooth_at_cmd = 26;
4731
4732 optional double ambient_display = 27;
4733
4734 optional double screen_on = 28;
4735
4736 optional double radio_on = 29;
4737
4738 optional double radio_scanning = 30;
4739
4740 optional double radio_active = 31;
4741
4742 optional double screen_full = 32;
4743
4744 optional double audio = 33;
4745
4746 optional double video = 34;
4747
4748 optional double flashlight = 35;
4749
4750 optional double memory = 36;
4751
4752 optional double camera = 37;
4753
4754 optional double wifi_batched_scan = 38;
4755
4756 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004757}
Chenjie Yuab530202018-09-26 12:39:20 -07004758
4759/**
4760 * power_profile.xml and other constants for power model calculations.
4761 * Pulled from PowerProfile.java
4762 */
4763message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004764 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004765}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004766
4767/**
arangelovd5db50e2018-10-12 20:24:39 +01004768 * Logs when a user restriction was added or removed.
4769 *
4770 * Logged from:
4771 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4772 */
4773message UserRestrictionChanged {
4774 // The raw string of the user restriction as defined in UserManager.
4775 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4776 optional string restriction = 1;
4777 // Whether the restriction is enabled or disabled.
4778 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004779}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004780
4781/**
4782 * Pulls process user time and system time. Puller takes a snapshot of all pids
4783 * in the system and returns cpu stats for those that are working at the time.
4784 * Dead pids will be dropped. Kernel processes are excluded.
4785 * Min cool-down is 5 sec.
4786 */
4787message ProcessCpuTime {
4788 optional int32 uid = 1 [(is_uid) = true];
4789
4790 optional string process_name = 2;
4791 // Process cpu time in user space, cumulative from boot/process start
4792 optional int64 user_time_millis = 3;
4793 // Process cpu time in system space, cumulative from boot/process start
4794 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004795}
Misha Wagner5a51e002018-10-03 15:04:09 +01004796
4797/**
4798 * Pulls the CPU usage for each thread.
4799 *
4800 * Read from /proc/$PID/task/$TID/time_in_state files.
4801 *
4802 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4803 * time_in_state files not being present on some phones, have not been addressed. These should be
4804 * considered before a public release.
4805 */
4806message CpuTimePerThreadFreq {
4807 // UID that owns the process.
4808 optional int32 uid = 1 [(is_uid) = true];
4809 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004810 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004811 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004812 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004813 // Name of the process taken from `/proc/$PID/cmdline`.
4814 optional string process_name = 4;
4815 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4816 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004817
4818 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4819 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4820 // frequencies are given here as the alternative is sending eight separate atoms. This method
4821 // significantly reduces the amount of data created
4822 optional int32 frequency1_khz = 6;
4823 optional int32 time1_millis = 7;
4824 optional int32 frequency2_khz = 8;
4825 optional int32 time2_millis = 9;
4826 optional int32 frequency3_khz = 10;
4827 optional int32 time3_millis = 11;
4828 optional int32 frequency4_khz = 12;
4829 optional int32 time4_millis = 13;
4830 optional int32 frequency5_khz = 14;
4831 optional int32 time5_millis = 15;
4832 optional int32 frequency6_khz = 16;
4833 optional int32 time6_millis = 17;
4834 optional int32 frequency7_khz = 18;
4835 optional int32 time7_millis = 19;
4836 optional int32 frequency8_khz = 20;
4837 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004838}
Bookatz75ee60422018-11-09 12:27:37 -08004839
4840/**
Bookatz366a4432018-11-20 09:42:33 -08004841 * Pulls information about the device's build.
4842 */
4843message BuildInformation {
4844 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4845 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4846 optional string fingerprint = 1;
4847
4848 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4849 optional string brand = 2;
4850
4851 // Build.PRODUCT. The name of the overall product.
4852 optional string product = 3;
4853
4854 // Build.DEVICE. The name of the industrial design.
4855 optional string device = 4;
4856
4857 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4858 optional string version_release = 5;
4859
4860 // Build.ID. E.g. a label like "M4-rc20".
4861 optional string id = 6;
4862
4863 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4864 // represent this build.
4865 optional string version_incremental = 7;
4866
4867 // Build.TYPE. The type of build, like "user" or "eng".
4868 optional string type = 8;
4869
4870 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4871 optional string tags = 9;
4872}
4873
4874/**
Adam Heff2185342019-01-23 15:59:09 -08004875 * Logs information about mismatched caller for content capture.
4876 *
4877 * Logged from:
4878 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
4879 */
4880message ContentCaptureCallerMismatchReported {
4881 optional string intended_package = 1;
4882 optional string calling_package = 2;
4883}
4884
4885/**
4886 * Logs information about content capture service events.
4887 *
4888 * Logged from:
4889 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4890 */
4891message ContentCaptureServiceEvents {
4892 // The type of event.
4893 enum Event {
4894 UNKNOWN = 0;
4895 ON_CONNECTED = 1;
4896 ON_DISCONNECTED = 2;
4897 SET_WHITELIST = 3;
4898 SET_DISABLED = 4;
4899 ON_USER_DATA_REMOVED = 5;
4900 }
4901 optional Event event = 1;
4902 // component/package of content capture service.
4903 optional string service_info = 2;
4904 // component/package of target.
4905 // it's a concatenated list of component/package for SET_WHITELIST event
4906 // separated by " ".
4907 optional string target_info = 3;
4908}
4909
4910/**
4911 * Logs information about content capture session events.
4912 *
4913 * Logged from:
4914 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4915 */
4916message ContentCaptureSessionEvents {
4917 // The type of event.
4918 enum Event {
4919 UNKNOWN = 0;
4920 ON_SESSION_STARTED = 1;
4921 ON_SESSION_FINISHED = 2;
4922 SESSION_NOT_CREATED = 3;
4923 }
4924 optional int32 session_id = 1;
4925 optional Event event = 2;
4926 // (n/a on session finished)
4927 optional int32 state_flags = 3;
4928 // component/package of content capture service.
4929 optional string service_info = 4;
4930 // component/package of app.
4931 // (n/a on session finished)
4932 optional string app_info = 5;
4933 optional bool is_child_session = 6;
4934}
4935
4936/**
4937 * Logs information about session being flushed.
4938 *
4939 * Logged from:
4940 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4941 */
4942message ContentCaptureFlushed {
4943 optional int32 session_id = 1;
4944 // component/package of content capture service.
4945 optional string service_info = 2;
4946 // component/package of app.
4947 optional string app_info = 3;
4948 // session start/finish events
4949 optional int32 child_session_started = 4;
4950 optional int32 child_session_finished = 5;
4951 // count of view events.
4952 optional int32 view_appeared_count = 6;
4953 optional int32 view_disappeared_count = 7;
4954 optional int32 view_text_changed_count = 8;
4955
4956 // Flush stats.
4957 optional int32 max_events = 9;
4958 optional int32 idle_flush_freq = 10;
4959 optional int32 text_flush_freq = 11;
4960 optional int32 flush_reason = 12;
4961}
4962
4963/**
Bookatz75ee60422018-11-09 12:27:37 -08004964 * Pulls on-device BatteryStats power use calculations for the overall device.
4965 */
4966message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004967 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4968 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4969 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4970 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08004971}
4972
4973/**
4974 * Pulls on-device BatteryStats power use calculations broken down by uid.
4975 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4976 * that is attributed to non-uid items. They must all be included to get the total power use.
4977 */
4978message DeviceCalculatedPowerBlameUid {
4979 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4980 optional int32 uid = 1 [(is_uid) = true];
4981
Bookatz3dbc13a2018-12-21 12:16:51 -08004982 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4983 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4984 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08004985}
4986
4987/**
4988 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4989 * drain type.
4990 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4991 * is attributed uids. They must all be included to get the total power use.
4992 */
4993message DeviceCalculatedPowerBlameOther {
4994 // The type of item whose power use is being reported.
4995 enum DrainType {
4996 AMBIENT_DISPLAY = 0;
4997 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
4998 BLUETOOTH = 2;
4999 CAMERA = 3;
5000 // Cell-standby
5001 CELL = 4;
5002 FLASHLIGHT = 5;
5003 IDLE = 6;
5004 MEMORY = 7;
5005 // Amount that total computed drain exceeded the drain estimated using the
5006 // battery level changes and capacity.
5007 OVERCOUNTED = 8;
5008 PHONE = 9;
5009 SCREEN = 10;
5010 // Amount that total computed drain was below the drain estimated using the
5011 // battery level changes and capacity.
5012 UNACCOUNTED = 11;
5013 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5014 WIFI = 13;
5015 }
5016 optional DrainType drain_type = 1;
5017
Bookatz3dbc13a2018-12-21 12:16:51 -08005018 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5019 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5020 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005021}
arangelov4e994062018-11-13 16:12:38 +00005022
5023/**
5024 * Logs device policy features.
5025 *
5026 * Logged from:
5027 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5028 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5029 */
5030message DevicePolicyEvent {
5031 // The event id - unique for each event.
5032 optional android.stats.devicepolicy.EventId event_id = 1;
5033 // The admin package name.
5034 optional string admin_package_name = 2;
5035 // A generic integer parameter.
5036 optional int32 integer_value = 3;
5037 // A generic boolean parameter.
5038 optional bool boolean_value = 4;
5039 // A parameter specifying a time period in milliseconds.
5040 optional uint64 time_period_millis = 5;
5041 // A parameter specifying a list of package names, bundle extras or string parameters.
5042 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5043}
shawnlinea5b66b2018-11-13 15:05:29 +08005044
5045/**
5046 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5047 *
5048 * Logged from:
5049 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5050 */
5051message DocsUILaunchReported {
5052 optional android.stats.docsui.LaunchAction launch_action = 1;
5053 optional bool has_initial_uri = 2;
5054 optional android.stats.docsui.MimeType mime_type = 3;
5055 optional android.stats.docsui.Root initial_root = 4;
5056}
5057
5058/**
5059 * Logs root/app visited event in file managers/picker. Call this when the user
5060 * taps on root/app in hamburger menu.
5061 *
5062 * Logged from:
5063 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5064 */
5065message DocsUIRootVisitedReported {
5066 optional android.stats.docsui.ContextScope scope = 1;
5067 optional android.stats.docsui.Root root = 2;
5068}
5069
5070/**
5071 * Logs file operation stats. Call this when a file operation has completed.
5072 *
5073 * Logged from:
5074 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5075 */
5076message DocsUIFileOperationReported {
5077 optional android.stats.docsui.Provider provider = 1;
5078 optional android.stats.docsui.FileOperation file_op = 2;
5079}
5080
5081/**
5082 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5083 * mode.
5084 *
5085 * Logged from:
5086 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5087 */
5088message DocsUIFileOperationCopyMoveModeReported {
5089 optional android.stats.docsui.FileOperation file_op = 1;
5090 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5091}
5092
5093
5094/**
5095 * Logs file sub operation stats. Call this when a file operation has failed.
5096 *
5097 * Logged from:
5098 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5099 */
5100message DocsUIFileOperationFailureReported {
5101 optional android.stats.docsui.Authority authority = 1;
5102 optional android.stats.docsui.SubFileOperation sub_op = 2;
5103}
5104
5105/**
5106* Logs the cancellation of a file operation. Call this when a job is canceled
5107*
5108* Logged from:
5109* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5110*/
5111message DocsUIFileOperationCanceledReported {
5112 optional android.stats.docsui.FileOperation file_op = 1;
5113}
5114
5115/**
5116 * Logs startup time in milliseconds.
5117 *
5118 * Logged from:
5119 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5120 */
5121message DocsUIStartupMsReported {
5122 optional int32 startup_millis = 1;
5123}
5124
5125/**
5126 * Logs the action that was started by user.
5127 *
5128 * Logged from:
5129 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5130 */
5131message DocsUIUserActionReported {
5132 optional android.stats.docsui.UserAction action = 1;
5133}
5134
5135/**
5136 * Logs the invalid type when invalid scoped access is requested.
5137 *
5138 * Logged from:
5139 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5140 */
5141message DocsUIInvalidScopedAccessRequestReported {
5142 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005143}
Ben Murdochbab399f62018-12-06 11:01:38 +00005144
5145/**
shawnlina75e82d2019-01-07 10:31:12 +08005146 * Logs the package name that launches docsui picker mode.
5147 *
5148 * Logged from:
5149 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5150 */
5151message DocsUIPickerLaunchedFromReported {
5152 optional string package_name = 1;
5153}
5154
5155/**
5156 * Logs the search type.
5157 *
5158 * Logged from:
5159 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5160 */
5161message DocsUISearchTypeReported {
5162 optional android.stats.docsui.SearchType search_type = 1;
5163}
5164
5165/**
5166 * Logs the search mode.
5167 *
5168 * Logged from:
5169 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5170 */
5171message DocsUISearchModeReported {
5172 optional android.stats.docsui.SearchMode search_mode = 1;
5173}
5174
5175/**
5176 * Logs the pick result information.
5177 *
5178 * Logged from:
5179 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5180 */
5181message DocsUIPickResultReported {
5182 optional int32 total_action_count = 1;
5183 optional int64 duration_millis = 2;
5184 optional int32 file_count= 3;
5185 optional bool is_searching = 4;
5186 optional android.stats.docsui.Root picked_from = 5;
5187 optional android.stats.docsui.MimeType mime_type = 6;
5188 optional int32 repeatedly_pick_times = 7;
5189}
5190
5191/**
Ben Murdochbab399f62018-12-06 11:01:38 +00005192 * Logs when an app's memory is compacted.
5193 *
5194 * Logged from:
5195 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5196 */
5197message AppCompacted {
5198 // The pid of the process being compacted.
5199 optional int32 pid = 1;
5200
5201 // The name of the process being compacted.
5202 optional string process_name = 2;
5203
5204 // The type of compaction.
5205 enum Action {
5206 UNKNOWN = 0;
5207 SOME = 1;
5208 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005209 PERSISTENT = 3;
5210 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00005211 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005212 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00005213
5214 // Total RSS in kilobytes consumed by the process prior to compaction.
5215 optional int64 before_rss_total_kilobytes = 4;
5216
5217 // File RSS in kilobytes consumed by the process prior to compaction.
5218 optional int64 before_rss_file_kilobytes = 5;
5219
5220 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5221 optional int64 before_rss_anon_kilobytes = 6;
5222
5223 // Swap in kilobytes consumed by the process prior to compaction.
5224 optional int64 before_swap_kilobytes = 7;
5225
5226 // Total RSS in kilobytes consumed by the process after compaction.
5227 optional int64 after_rss_total_kilobytes = 8;
5228
5229 // File RSS in kilobytes consumed by the process after compaction.
5230 optional int64 after_rss_file_kilobytes = 9;
5231
5232 // Anonymous RSS in kilobytes consumed by the process after compaction.
5233 optional int64 after_rss_anon_kilobytes = 10;
5234
5235 // Swap in kilobytes consumed by the process after compaction.
5236 optional int64 after_swap_kilobytes = 11;
5237
5238 // The time taken to perform compaction in milliseconds.
5239 optional int64 time_to_compact_millis = 12;
5240
5241 // The last compaction action performed for this app.
5242 optional Action last_action = 13;
5243
Ben Murdoch01720b82018-12-19 18:03:44 +00005244 // The last time that compaction was attempted on this process in milliseconds
5245 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5246 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00005247
Ben Murdoch885c21b2019-03-15 18:02:04 +00005248 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005249 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00005250
5251 // The process state at the time of compaction.
5252 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005253
5254 // Free ZRAM in kilobytes before compaction.
5255 optional int64 before_zram_free_kilobytes = 17;
5256
5257 // Free ZRAM in kilobytes after compaction.
5258 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00005259}
lifr157fc552018-12-12 16:38:04 +08005260
5261/**
lifrb6b90b62019-03-29 00:40:17 +08005262 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5263 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5264 *
lifra2e19c02019-04-16 22:16:30 +08005265 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5266 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5267 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5268 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005269 */
5270message NetworkDnsEventReported {
lifra2e19c02019-04-16 22:16:30 +08005271 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005272
lifra2e19c02019-04-16 22:16:30 +08005273 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005274
5275 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005276 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005277
lifra2e19c02019-04-16 22:16:30 +08005278 // Only valid for event_type = EVENT_GETADDRINFO.
5279 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005280
lifra2e19c02019-04-16 22:16:30 +08005281 // Flags passed to android_res_nsend() defined in multinetwork.h
5282 // Only valid for event_type = EVENT_RESNSEND.
5283 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005284
lifra2e19c02019-04-16 22:16:30 +08005285 optional android.stats.dnsresolver.Transport network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005286
5287 // The DNS over TLS mode on a specific netId.
lifra2e19c02019-04-16 22:16:30 +08005288 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005289
5290 // Additional pass-through fields opaque to statsd.
5291 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifra2e19c02019-04-16 22:16:30 +08005292 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr157fc552018-12-12 16:38:04 +08005293}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005294
5295/**
5296 * Logs when a data stall event occurs.
5297 *
5298 * Log from:
5299 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5300 */
5301message DataStallEvent {
5302 // Data stall evaluation type.
5303 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5304 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5305 optional int32 evaluation_type = 1;
5306 // See definition in data_stall_event.proto.
5307 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5308 // See definition in data_stall_event.proto.
5309 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5310 // See definition in data_stall_event.proto.
5311 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5312 // See definition in data_stall_event.proto.
5313 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5314 // See definition in data_stall_event.proto.
5315 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5316}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005317
5318/*
5319 * Logs when RescueParty resets some set of experiment flags.
5320 *
5321 * Logged from:
5322 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5323 */
5324message RescuePartyResetReported {
5325 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5326 optional int32 rescue_level = 1;
5327}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005328
5329/**
5330 * Logs when signed config is received from an APK, and if that config was applied successfully.
5331 * Logged from:
5332 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5333 */
5334message SignedConfigReported {
5335 enum Type {
5336 UNKNOWN_TYPE = 0;
5337 GLOBAL_SETTINGS = 1;
5338 }
5339 optional Type type = 1;
5340
5341 // The final status of the signed config received.
5342 enum Status {
5343 UNKNOWN_STATUS = 0;
5344 APPLIED = 1;
5345 BASE64_FAILURE_CONFIG = 2;
5346 BASE64_FAILURE_SIGNATURE = 3;
5347 SECURITY_EXCEPTION = 4;
5348 INVALID_CONFIG = 5;
5349 OLD_CONFIG = 6;
5350 SIGNATURE_CHECK_FAILED = 7;
5351 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005352 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005353 }
5354 optional Status status = 2;
5355
5356 // The version of the signed config processed.
5357 optional int32 version = 3;
5358
5359 // The package name that the config was extracted from.
5360 optional string from_package = 4;
5361
5362 enum Key {
5363 NO_KEY = 0;
5364 DEBUG = 1;
5365 PRODUCTION = 2;
5366 }
5367 // Which key was used to verify the config.
5368 optional Key verified_with = 5;
5369}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005370
5371/*
5372 * Logs GNSS Network-Initiated (NI) location events.
5373 *
5374 * Logged from:
5375 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5376 */
5377message GnssNiEventReported {
5378 // The type of GnssNiEvent.
5379 enum EventType {
5380 UNKNOWN = 0;
5381 NI_REQUEST = 1;
5382 NI_RESPONSE = 2;
5383 }
5384 optional EventType event_type = 1;
5385
5386 // An ID generated by HAL to associate NI notifications and UI responses.
5387 optional int32 notification_id = 2;
5388
5389 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005390 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005391
5392 // NI requires notification.
5393 optional bool need_notify = 4;
5394
5395 // NI requires verification.
5396 optional bool need_verify = 5;
5397
5398 // NI requires privacy override, no notification/minimal trace.
5399 optional bool privacy_override = 6;
5400
5401 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5402 // seconds.
5403 optional int32 timeout = 7;
5404
5405 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005406 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005407
5408 // String representing the requester of the network inititated location request.
5409 optional string requestor_id = 9;
5410
5411 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5412 // network initiated location request.
5413 optional string text = 10;
5414
5415 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005416 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005417
5418 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005419 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005420
5421 // True if SUPL ES is enabled.
5422 optional bool is_supl_es_enabled = 13;
5423
5424 // True if GNSS location is enabled.
5425 optional bool is_location_enabled = 14;
5426
5427 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005428 optional android.server.location.GnssUserResponseType user_response = 15;
5429}
5430
5431/**
5432 * Logs GNSS non-framework (NFW) location notification.
5433 *
5434 * Logged from:
5435 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5436 */
5437message GnssNfwNotificationReported {
5438 // Package name of the Android proxy application representing the non-framework entity that
5439 // requested location. Set to empty string if unknown.
5440 optional string proxy_app_package_name = 1;
5441
5442 // Protocol stack that initiated the non-framework location request.
5443 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5444
5445 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5446 // set to empty string. This field is opaque to the framework and used for logging purposes.
5447 optional string other_protocol_stack_name = 3;
5448
5449 // Source initiating/receiving the location information.
5450 optional android.server.location.NfwRequestor requestor = 4;
5451
5452 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5453 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5454 // and used for logging purposes.
5455 optional string requestor_id = 5;
5456
5457 // Indicates whether location information was provided for this request.
5458 optional android.server.location.NfwResponseType response_type = 6;
5459
5460 // True if the device is in user initiated emergency session.
5461 optional bool in_emergency_mode = 7;
5462
5463 // True if cached location is provided.
5464 optional bool is_cached_location = 8;
5465
5466 // True if proxy app permission mismatch between framework and GNSS HAL.
5467 optional bool is_permission_mismatched = 9;
5468}
5469
5470/**
5471 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5472 *
5473 * Logged from:
5474 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5475 */
5476message GnssConfigurationReported {
5477 // SUPL host name.
5478 optional string supl_host = 1;
5479
5480 // SUPL port number.
5481 optional int32 supl_port = 2;
5482
5483 // C2K host name.
5484 optional string c2k_host = 3;
5485
5486 // C2K port number.
5487 optional int32 c2k_port = 4;
5488
5489 // The SUPL version requested by Carrier.
5490 optional int32 supl_ver = 5;
5491
5492 // The SUPL mode.
5493 optional android.server.location.SuplMode supl_mode = 6;
5494
5495 // True if NI emergency SUPL restrictions is enabled.
5496 optional bool supl_es = 7;
5497
5498 // LTE Positioning Profile settings
5499 optional android.server.location.LppProfile lpp_profile = 8;
5500
5501 // Positioning protocol on A-Glonass system.
5502 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5503
5504 // True if emergency PDN is used. Otherwise, regular PDN is used.
5505 optional bool use_emergency_pdn_for_emergency_supl= 10;
5506
5507 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5508 optional android.server.location.GpsLock gps_lock = 11;
5509
5510 // Number of seconds to extend the emergency session duration post emergency call.
5511 optional int32 es_extension_sec = 12;
5512
5513 // The full list of package names of proxy Android applications representing the non-framework
5514 // location access entities (on/off the device) for which the framework user has granted
5515 // non-framework location access permission. The package names are concatenated in one string
5516 // with spaces as separators.
5517 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005518}
Jack Yu95b64f32018-12-13 18:26:11 +08005519
5520/**
5521 * Logs when a NFC device's error occurred.
5522 * Logged from:
5523 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5524 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5525 */
5526message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005527 enum Type {
5528 UNKNOWN = 0;
5529 CMD_TIMEOUT = 1;
5530 ERROR_NOTIFICATION = 2;
5531 AID_OVERFLOW = 3;
5532 }
5533 optional Type type = 1;
5534 // If it's nci cmd timeout, log the timeout command.
5535 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005536
Alex Salod7c3eef2019-01-25 14:43:27 -08005537 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005538}
5539
5540/**
5541 * Logs when a NFC device's state changed event
5542 * Logged from:
5543 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5544 */
5545message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005546 enum State {
5547 UNKNOWN = 0;
5548 OFF = 1;
5549 ON = 2;
5550 ON_LOCKED = 3; // Secure Nfc enabled.
5551 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5552 }
5553 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005554}
5555
5556/**
5557 * Logs when a NFC Beam Transaction occurred.
5558 * Logged from:
5559 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5560 */
5561message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005562 enum Operation {
5563 UNKNOWN = 0;
5564 SEND = 1;
5565 RECEIVE = 2;
5566 }
5567 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005568}
5569
5570/**
5571 * Logs when a NFC Card Emulation Transaction occurred.
5572 * Logged from:
5573 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5574 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5575 */
5576message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005577 enum Category {
5578 UNKNOWN = 0;
5579 HCE_PAYMENT = 1;
5580 HCE_OTHER = 2;
5581 OFFHOST = 3;
5582 }
5583 // Transaction belongs to HCE payment or HCE other category, or offhost.
5584 optional Category category = 1;
5585 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5586 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005587}
5588
5589/**
5590 * Logs when a NFC Tag event occurred.
5591 * Logged from:
5592 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5593 */
5594message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005595 enum Type {
5596 UNKNOWN = 0;
5597 URL = 1;
5598 BT_PAIRING = 2;
5599 PROVISION = 3;
5600 WIFI_CONNECT = 4;
5601 APP_LAUNCH = 5;
5602 OTHERS = 6;
5603 }
5604 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005605}
5606
5607/**
5608 * Logs when Hce transaction triggered
5609 * Logged from:
5610 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5611 */
5612message NfcHceTransactionOccurred {
5613 // The latency period(in microseconds) it took for the first HCE data
5614 // exchange.
5615 optional uint32 latency_micros = 1;
5616}
5617
5618/**
5619 * Logs when SecureElement state event changed
5620 * Logged from:
5621 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5622 */
5623message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005624 enum State {
5625 UNKNOWN = 0;
5626 INITIALIZED = 1;
5627 DISCONNECTED = 2;
5628 CONNECTED = 3;
5629 HALCRASH = 4;
5630 }
5631 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005632
Alex Salod7c3eef2019-01-25 14:43:27 -08005633 optional string state_change_reason = 2;
5634 // SIMx or eSEx.
5635 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005636}
5637
5638/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005639 * Information about a permission grant request
5640 */
5641message PermissionGrantRequestResultReported {
5642 // unique value identifying an API call. A API call might result in multiple of these atoms
5643 optional int64 request_id = 1;
5644
5645 // UID of package requesting the permission grant
5646 optional int32 requesting_uid = 2 [(is_uid) = true];
5647
5648 // Name of package requesting the permission grant
5649 optional string requesting_package_name = 3;
5650
5651 // The permission to be granted
5652 optional string permission_name = 4;
5653
5654 // If the permission was explicitly requested via the API or added by the system
5655 optional bool is_implicit = 5;
5656
5657 enum Result {
5658 UNDEFINED = 0;
5659 // permission request was ignored
5660 IGNORED = 1;
5661 // permission request was ignored because it was user fixed
5662 IGNORED_USER_FIXED = 2;
5663 // permission request was ignored because it was policy fixed
5664 IGNORED_POLICY_FIXED = 3;
5665 // permission was granted by user action
5666 USER_GRANTED = 4;
5667 // permission was automatically granted
5668 AUTO_GRANTED = 5;
5669 // permission was denied by user action
5670 USER_DENIED = 6;
5671 // permission was denied with prejudice by the user
5672 USER_DENIED_WITH_PREJUDICE = 7;
5673 // permission was automatically denied
5674 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07005675 // permission request was ignored because permission is restricted
5676 IGNORED_RESTRICTED_PERMISSION = 9;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005677 }
5678 // The result of the permission grant
5679 optional Result result = 6;
5680}
5681
5682/**
Jack Yu95b64f32018-12-13 18:26:11 +08005683 * Logs when Omapi API used
5684 * Logged from:
5685 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5686 */
5687message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005688 enum Operation {
5689 UNKNOWN = 0;
5690 OPEN_CHANNEL = 1;
5691 }
5692 optional Operation operation = 1;
5693 // SIMx or eSEx.
5694 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005695
Alex Salod7c3eef2019-01-25 14:43:27 -08005696 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005697}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005698
5699/**
Alex Saloa060aee2019-01-21 14:36:41 -08005700 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5701 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005702 * Logged from:
5703 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5704 */
5705message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005706 optional int64 dispatch_latency_millis = 1;
5707}
5708
5709/**
5710 * Logs AttentionManagerService attention check result.
5711 *
5712 * Logged from:
5713 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5714 */
5715message AttentionManagerServiceResultReported {
5716 // See core/java/android/service/attention/AttentionService.java
5717 enum AttentionCheckResult {
5718 UNKNOWN = 20;
5719 ATTENTION_SUCCESS_ABSENT = 0;
5720 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07005721 ATTENTION_FAILURE_UNKNOWN = 2;
5722 ATTENTION_FAILURE_CANCELLED = 3;
5723 ATTENTION_FAILURE_PREEMPTED = 4;
5724 ATTENTION_FAILURE_TIMED_OUT = 5;
5725 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08005726 }
5727 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005728}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005729
5730/**
5731 * Logs when an adb connection changes state.
5732 *
5733 * Logged from:
5734 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5735 */
5736message AdbConnectionChanged {
5737 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5738 // previously selected for this system.
5739 optional int64 last_connection_time_millis = 1;
5740
5741 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5742 // to reconnect via adb without user interaction.
5743 optional int64 auth_window_millis = 2;
5744
5745 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5746 optional android.debug.AdbConnectionStateEnum state = 3;
5747
5748 // True if the 'always allow' option was selected for this system.
5749 optional bool always_allow = 4;
5750}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005751
5752/*
5753 * Logs the reported speech DSP status.
5754 *
5755 * Logged from:
5756 * Vendor audio implementation.
5757 */
5758message SpeechDspStatReported {
5759 // The total Speech DSP uptime in milliseconds.
5760 optional int32 total_uptime_millis = 1;
5761 // The total Speech DSP downtime in milliseconds.
5762 optional int32 total_downtime_millis = 2;
5763 optional int32 total_crash_count = 3;
5764 optional int32 total_recover_count = 4;
5765}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005766
5767/**
5768 * Logs USB connector contaminant status.
5769 *
5770 * Logged from: USB Service.
5771 */
5772message UsbContaminantReported {
5773 optional string id = 1;
5774 optional android.service.usb.ContaminantPresenceStatus status = 2;
5775}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005776
5777/**
5778 * This atom is for debugging purpose.
5779 */
5780message DebugElapsedClock {
5781 // Monotically increasing value for each pull.
5782 optional int64 pull_count = 1;
5783 // Time from System.elapsedRealtime.
5784 optional int64 elapsed_clock_millis = 2;
5785 // Time from System.elapsedRealtime.
5786 optional int64 same_elapsed_clock_millis = 3;
5787 // Diff between current elapsed time and elapsed time from previous pull.
5788 optional int64 elapsed_clock_diff_millis = 4;
5789
5790 enum Type {
5791 TYPE_UNKNOWN = 0;
5792 ALWAYS_PRESENT = 1;
5793 PRESENT_ON_ODD_PULLS = 2;
5794 }
5795 // Type of behavior for the pulled data.
5796 optional Type type = 5;
5797}
5798
5799/**
5800 * This atom is for debugging purpose.
5801 */
5802message DebugFailingElapsedClock {
5803 // Monotically increasing value for each pull.
5804 optional int64 pull_count = 1;
5805 // Time from System.elapsedRealtime.
5806 optional int64 elapsed_clock_millis = 2;
5807 // Time from System.elapsedRealtime.
5808 optional int64 same_elapsed_clock_millis = 3;
5809 // Diff between current elapsed time and elapsed time from previous pull.
5810 optional int64 elapsed_clock_diff_millis = 4;
5811}
Steven Wuacef6bb2019-01-23 14:21:17 -05005812
5813/** Logs System UI bubbles event changed.
5814 *
5815 * Logged from:
5816 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5817 */
5818message BubbleUIChanged {
5819
5820 // The app package that is posting the bubble.
5821 optional string package_name = 1;
5822
5823 // The notification channel that is posting the bubble.
5824 optional string notification_channel = 2;
5825
5826 // The notification id associated with the posted bubble.
5827 optional int32 notification_id = 3;
5828
5829 // The position of the bubble within the bubble stack.
5830 optional int32 position = 4;
5831
5832 // The total number of bubbles within the bubble stack.
5833 optional int32 total_number = 5;
5834
5835 // User interactions with the bubble.
5836 enum Action {
5837 UNKNOWN = 0;
5838 POSTED = 1;
5839 UPDATED = 2;
5840 EXPANDED = 3;
5841 COLLAPSED = 4;
5842 DISMISSED = 5;
5843 STACK_DISMISSED = 6;
5844 STACK_MOVED = 7;
5845 HEADER_GO_TO_APP = 8;
5846 HEADER_GO_TO_SETTINGS = 9;
5847 PERMISSION_OPT_IN = 10;
5848 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005849 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005850 SWIPE_LEFT = 13;
5851 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005852 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04005853 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05005854 }
5855 optional Action action = 6;
5856
5857 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5858 optional float normalized_x_position = 7;
5859 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04005860
5861 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
5862 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04005863
5864 // Whether the bubble is an on-going one.
5865 optional bool is_ongoing = 10;
5866
5867 // Whether the bubble is produced by an app running in foreground.
5868 optional bool is_foreground = 11;
Steven Wuacef6bb2019-01-23 14:21:17 -05005869}
Kweku Adams8845d012018-12-11 20:06:45 -08005870
5871/**
Steven Wu552f63f2019-02-05 13:41:36 -05005872 * Logs System UI bubbles developer errors.
5873 *
5874 * Logged from:
5875 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5876 */
5877message BubbleDeveloperErrorReported {
5878
5879 // The app package that is posting the bubble.
5880 optional string package_name = 1;
5881
5882 // Bubble developer error type enums.
5883 enum Error {
5884 UNKNOWN = 0;
5885 ACTIVITY_INFO_MISSING = 1;
5886 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5887 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5888 }
5889 optional Error error = 2 [default = UNKNOWN];
5890}
5891
5892/**
Kweku Adams8845d012018-12-11 20:06:45 -08005893 * Logs that a constraint for a scheduled job has changed.
5894 *
5895 * Logged from:
5896 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5897 */
5898message ScheduledJobConstraintChanged {
5899 repeated AttributionNode attribution_node = 1;
5900
5901 // Name of the job.
5902 optional string job_name = 2;
5903
5904 optional com.android.server.job.ConstraintEnum constraint = 3;
5905
5906 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08005907 UNKNOWN = 0;
5908 UNSATISFIED = 1;
5909 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08005910 }
5911 optional State state = 4;
5912}
Alex Salod7c3eef2019-01-25 14:43:27 -08005913
5914/**
5915 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5916 * returns true.
5917 *
5918 * Logged from:
5919 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5920 */
5921message ScreenTimeoutExtensionReported {
5922 // Describes how many times in a row did the power manager reset the screen off timeout.
5923 optional uint32 consecutive_timeout_extended_count = 1;
5924}
Hui Yu885aca12019-01-10 17:11:34 -08005925
5926/*
5927* Logs number of milliseconds it takes to start a process.
5928* The definition of app process start time is from the app launch time to
5929* the time that Zygote finished forking the app process and loaded the
5930* application package's java classes.
5931
5932* This metric is different from AppStartOccurred which is for foreground
5933* activity only.
5934
5935* ProcessStartTime can report all processes (both foreground and background)
5936* start time.
5937*
5938* Logged from:
5939* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5940*/
5941message ProcessStartTime {
5942 // The uid of the ProcessRecord.
5943 optional int32 uid = 1 [(is_uid) = true];
5944
5945 // The process pid.
5946 optional int32 pid = 2;
5947
5948 // The process name.
5949 // Usually package name, "system" for system server.
5950 // Provided by ActivityManagerService.
5951 optional string process_name = 3;
5952
5953 enum StartType {
5954 UNKNOWN = 0;
5955 WARM = 1;
5956 HOT = 2;
5957 COLD = 3;
5958 }
5959
5960 // The start type.
5961 optional StartType type = 4;
5962
5963 // The elapsed realtime at the start of the process.
5964 optional int64 process_start_time_millis = 5;
5965
5966 // Number of milliseconds it takes to reach bind application.
5967 optional int32 bind_application_delay_millis = 6;
5968
5969 // Number of milliseconds it takes to finish start of the process.
5970 optional int32 process_start_delay_millis = 7;
5971
5972 // hostingType field in ProcessRecord, the component type such as "activity",
5973 // "service", "content provider", "broadcast" or other strings.
5974 optional string hosting_type = 8;
5975
5976 // hostingNameStr field in ProcessRecord. The component class name that runs
5977 // in this process.
5978 optional string hosting_name = 9;
5979}
5980
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005981/**
Ray Essick8ab04df2019-02-15 11:01:02 -08005982 * Track Media Codec usage
5983 * Logged from:
5984 * frameworks/av/media/libstagefright/MediaCodec.cpp
5985 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
5986 */
5987message MediametricsCodecReported {
5988 optional int64 timestamp_nanos = 1;
5989 optional string package_name = 2;
5990 optional int64 package_version_code = 3;
5991 optional int64 media_apex_version = 4;
5992
5993 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
5994}
5995
5996/**
5997 * Track Media Extractor (pulling video/audio streams out of containers) usage
5998 * Logged from:
5999 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6000 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6001 */
6002message MediametricsExtractorReported {
6003 optional int64 timestamp_nanos = 1;
6004 optional string package_name = 2;
6005 optional int64 package_version_code = 3;
6006 optional int64 media_apex_version = 4;
6007
6008 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6009}
6010
6011/**
6012 * Track how we arbitrate between microphone/input requests.
6013 * Logged from
6014 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6015 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6016 */
6017message MediametricsAudiopolicyReported {
6018 optional int64 timestamp_nanos = 1;
6019 optional string package_name = 2;
6020 optional int64 package_version_code = 3;
6021 optional int64 media_apex_version = 4;
6022
6023 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6024}
6025
6026/**
6027 * Track how we arbitrate between microphone requests.
6028 * Logged from
6029 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6030 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6031 */
6032message MediametricsAudiorecordReported {
6033 optional int64 timestamp_nanos = 1;
6034 optional string package_name = 2;
6035 optional int64 package_version_code = 3;
6036 optional int64 media_apex_version = 4;
6037
6038 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6039}
6040
6041/**
6042 * Track how we arbitrate between microphone/input requests.
6043 * Logged from
6044 * frameworks/av/media/libnblog/ReportPerformance.cpp
6045 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6046 */
6047message MediametricsAudiothreadReported {
6048 optional int64 timestamp_nanos = 1;
6049 optional string package_name = 2;
6050 optional int64 package_version_code = 3;
6051 optional int64 media_apex_version = 4;
6052
6053 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6054}
6055
6056/**
6057 * Track how we arbitrate between microphone/input requests.
6058 * Logged from
6059 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6060 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6061 */
6062message MediametricsAudiotrackReported {
6063 optional int64 timestamp_nanos = 1;
6064 optional string package_name = 2;
6065 optional int64 package_version_code = 3;
6066 optional int64 media_apex_version = 4;
6067
6068 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6069}
6070
6071/**
6072 * Track information about DRM framework performance
6073 * Logged from
6074 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6075 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6076 */
6077message MediametricsMediadrmReported {
6078 optional int64 timestamp_nanos = 1;
6079 optional string package_name = 2;
6080 optional int64 package_version_code = 3;
6081 optional int64 media_apex_version = 4;
6082
6083 // vendor+description tell about which DRM plugin is in use on this device
6084 optional string vendor = 5;
6085 optional string description = 6;
6086 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6087 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6088}
6089
6090/**
6091 * Track information about the widevine DRM plugin performance
6092 * Logged from
6093 * vendor/widevine/libwvdrmengine/cdm/metrics
6094 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6095 */
6096message MediametricsDrmWidevineReported {
6097 optional int64 timestamp_nanos = 1;
6098 optional string package_name = 2;
6099 optional int64 package_version_code = 3;
6100 optional int64 media_apex_version = 4;
6101
6102 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6103}
6104
6105/**
6106 * Track information about recordings (e.g. camcorder)
6107 * Logged from
6108 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6109 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6110 */
6111message MediametricsRecorderReported {
6112 optional int64 timestamp_nanos = 1;
6113 optional string package_name = 2;
6114 optional int64 package_version_code = 3;
6115 optional int64 media_apex_version = 4;
6116
6117 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6118}
6119
6120/**
6121 * Track Media Player usage
6122 * Logged from:
6123 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6124 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6125 */
6126message MediametricsNuPlayerReported {
6127 optional int64 timestamp_nanos = 1;
6128 optional string package_name = 2;
6129 optional int64 package_version_code = 3;
6130 optional int64 media_apex_version = 4;
6131
6132 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6133}
6134
6135/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006136 * State of a dangerous permission requested by a package
6137 */
6138message DangerousPermissionState {
6139 // Name of the permission
6140 optional string permission_name = 1;
6141
6142 // Uid of the package
6143 optional int32 uid = 2 [(is_uid) = true];
6144
6145 // Package requesting the permission
6146 optional string package_name = 3;
6147
6148 // If the permission is granted to the uid
6149 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01006150
6151 // Permission flags as per android.content.pm.PermissionFlags
6152 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006153}
6154
Michael Groover4a0ca942019-01-24 17:41:25 -08006155/**
6156 * Logs when a package is denied access to a device identifier based on the new access requirements.
6157 *
6158 * Logged from:
6159 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6160 */
6161message DeviceIdentifierAccessDenied {
6162 // The name of the package denied access to the requested device identifier.
6163 optional string package_name = 1;
6164
6165 // The name of the device identifier method the package attempted to invoke.
6166 optional string method_name = 2;
6167
6168 // True if the package is preinstalled.
6169 optional bool is_preinstalled = 3;
6170
6171 // True if the package is privileged.
6172 optional bool is_priv_app = 4;
6173}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006174
6175/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006176 * Pulls the ongoing mainline install train version code.
6177 * Pulled from StatsCompanionService
6178 */
6179message TrainInfo {
6180 optional int64 train_version_code = 1;
6181
6182 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006183
6184 optional string train_name = 3;
6185
6186 enum Status {
6187 UNKNOWN = 0;
6188 INSTALL_REQUESTED = 1;
6189 INSTALL_STARTED = 2;
6190 INSTALL_STAGED_NOT_READY = 3;
6191 INSTALL_STAGED_READY = 4;
6192 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006193 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6194 // and INSTALL_FAILURE_COMMIT.
6195 INSTALL_FAILURE = 6 [deprecated = true];
6196 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006197 INSTALL_CANCELLED = 7;
6198 INSTALLER_ROLLBACK_REQUESTED = 8;
6199 INSTALLER_ROLLBACK_INITIATED = 9;
6200 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6201 INSTALLER_ROLLBACK_STAGED = 11;
6202 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6203 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6204 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6205 INSTALLER_ROLLBACK_SUCCESS = 15;
6206 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006207 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6208 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6209 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6210 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6211 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6212 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006213 INSTALL_FAILURE_DOWNLOAD = 23;
6214 INSTALL_FAILURE_STATE_MISMATCH = 24;
6215 INSTALL_FAILURE_COMMIT = 25;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006216 }
6217 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006218}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006219
6220/**
6221 * Logs the gesture stage changed event.
6222 *
6223 * Logged from:
6224 * frameworks/base/packages/SystemUI/
6225 */
6226message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006227 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006228}
6229
6230/**
6231 * Logs the feedback type.
6232 *
6233 * Logged from:
6234 * frameworks/base/packages/SystemUI/
6235 */
6236message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006237 // Whether or not the gesture was used.
6238 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006239}
6240
6241/**
6242 * Logs the progress.
6243 *
6244 * Logged from:
6245 * frameworks/base/packages/SystemUI/
6246 */
6247message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006248 // [0,100] progress for the assist gesture.
6249 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006250}
Neil Fullerdb14b482019-02-05 19:44:44 +00006251
6252/*
6253 * Information about the time zone data on a device.
6254 */
6255message TimeZoneDataInfo {
6256 // A version identifier for the data set on device. e.g. "2018i"
6257 optional string tzdb_version = 1;
6258}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006259
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006260/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006261 * Logs the GPU stats global health information.
6262 *
6263 * Logged from:
6264 * frameworks/native/services/gpuservice/gpustats/
6265 */
6266message GpuStatsGlobalInfo {
6267 // Package name of the gpu driver.
6268 optional string driver_package_name = 1;
6269
6270 // Version name of the gpu driver.
6271 optional string driver_version_name = 2;
6272
6273 // Version code of the gpu driver.
6274 optional int64 driver_version_code = 3;
6275
6276 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
6277 optional int64 driver_build_time = 4;
6278
6279 // Total count of the gl driver gets loaded.
6280 optional int64 gl_loading_count = 5;
6281
6282 // Total count of the gl driver fails to be loaded.
6283 optional int64 gl_loading_failure_count = 6;
6284
6285 // Total count of the Vulkan driver gets loaded.
6286 optional int64 vk_loading_count = 7;
6287
6288 // Total count of the Vulkan driver fails to be loaded.
6289 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07006290
6291 // Api version of the system Vulkan driver.
6292 optional int32 vulkan_version = 9;
6293
6294 // Api version of the system CPU Vulkan driver.
6295 optional int32 cpu_vulkan_version = 10;
6296
6297 // Api version of the system GLES driver.
6298 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006299
6300 // Total count of the angle driver gets loaded.
6301 optional int64 angle_loading_count = 12;
6302
6303 // Total count of the angle driver fails to be loaded.
6304 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006305}
6306
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006307/**
6308 * GPU driver loading time info.
6309 */
6310message GpuDriverLoadingTime {
6311 // List of all the driver loading times for this app. The list size is
6312 // capped at 50.
6313 repeated int64 driver_loading_time = 1;
6314}
6315
6316/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006317 * Logs the GPU stats per app health information.
6318 *
6319 * Logged from:
6320 * frameworks/native/services/gpuservice/gpustats/
6321 */
6322message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006323 // Package name of the application that loads the gpu driver. Total number
6324 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006325 optional string app_package_name = 1;
6326
6327 // Version code of the gpu driver this app loads.
6328 optional int64 driver_version_code = 2;
6329
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006330 // gl driver loading time info.
6331 optional GpuDriverLoadingTime gl_driver_loading_time = 3
6332 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006333
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006334 // Vulkan driver loading time info.
6335 optional GpuDriverLoadingTime vk_driver_loading_time = 4
6336 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006337
6338 // Angle driver loading time info.
6339 optional GpuDriverLoadingTime angle_driver_loading_time = 5
6340 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07006341
6342 // CPU Vulkan implementation is in use.
6343 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006344}
Rafal Slawikd4e87572019-03-12 13:08:38 +00006345
6346/*
6347 * Logs the size of the system ion heap.
6348 *
6349 * Pulled from StatsCompanionService.
6350 */
6351message SystemIonHeapSize {
6352 // Size of the system ion heap in bytes.
6353 optional int64 size_in_bytes = 1;
6354}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006355
6356/**
6357 * Push network stack events.
6358 *
6359 * Log from:
6360 * frameworks/base/packages/NetworkStack/
6361 */
6362message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08006363 // The id that indicates the event reported from NetworkStack.
6364 optional int32 event_id = 1;
6365 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006366 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
6367}
Carmen Agimofa769c152019-03-04 14:39:14 +00006368
6369/**
6370 * Logs the apps that are installed on the external storage.
6371 * Pulled from:
6372 * StatsCompanionService
6373 */
6374message AppsOnExternalStorageInfo {
6375 // The type of the external storage.
6376 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
6377 // The name of the package that is installed on the external storage.
6378 optional string package_name = 2;
6379}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07006380
6381/**
6382 * Logs the settings related to Face.
6383 * Logged from:
6384 * frameworks/base/services/core/java/com/android/server/stats
6385 */
6386message FaceSettings {
6387 // Whether or not face unlock is allowed on Keyguard.
6388 optional bool unlock_keyguard_enabled = 1;
6389 // Whether or not face unlock dismisses the Keyguard.
6390 optional bool unlock_dismisses_keyguard = 2;
6391 // Whether or not face unlock requires attention.
6392 optional bool unlock_attention_required = 3;
6393 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
6394 optional bool unlock_app_enabled = 4;
6395 // Whether or not face unlock always requires user confirmation.
6396 optional bool unlock_always_require_confirmation = 5;
6397 // Whether or not a diverse set of poses are required during enrollment.
6398 optional bool unlock_diversity_required = 6;
6399}
Maggie White442b6312019-04-05 16:26:44 -07006400
6401/**
6402 * Logs cooling devices maintained by the kernel.
6403 *
6404 * Pulled from StatsCompanionService.java
6405 */
6406message CoolingDevice {
6407 // The type of cooling device being reported. Eg. CPU, GPU...
6408 optional android.os.CoolingTypeEnum device_location = 1;
6409 // The name of the cooling device source. Eg. CPU0
6410 optional string device_name = 2;
6411 // Current throttle state of the cooling device. The value can any unsigned
6412 // integer between 0 and max_state defined in its driver. 0 means device is
6413 // not in throttling, higher value means deeper throttling.
6414 optional int32 state = 3;
6415}
Ben Blount763a5d52019-04-10 11:48:58 -07006416
6417/**
6418 * Intelligence has several counter-type events that don't warrant a
6419 * full separate atom. These are primarily API call counters but also include
6420 * counters for feature usage and specific failure modes.
6421 *
6422 * Logged from the Intelligence mainline module.
6423 */
6424message IntelligenceEventReported {
6425 optional android.stats.intelligence.EventType event_id = 1;
6426 optional android.stats.intelligence.Status status = 2;
6427}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07006428
6429/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07006430 * Logs when Car Power state changed.
6431 *
6432 * Logged from:
6433 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6434 */
6435message CarPowerStateChanged {
6436 // States come from CpmsState in CarPowerManagementService.java.
6437 enum State {
6438 WAIT_FOR_VHAL = 0;
6439 ON = 1;
6440 SHUTDOWN_PREPARE = 2;
6441 WAIT_FOR_FINISH = 3;
6442 SUSPEND = 4;
6443 SIMULATE_SLEEP = 5;
6444 }
6445 optional State state = 1;
6446}
6447
6448/**
6449 * Logs whether GarageMode is entered.
6450 *
6451 * Logged from:
6452 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6453 */
6454message GarageModeInfo {
6455 // Whether GarageMode is entered.
6456 optional bool is_garage_mode = 1;
6457}
Martijn Coenencd95d462019-04-25 17:09:45 +02006458
6459/**
6460 * Historical app ops data per package.
6461 */
6462message AppOps {
6463 // Uid of the package requesting the op
6464 optional int32 uid = 1 [(is_uid) = true];
6465
6466 // Nmae of the package performing the op
6467 optional string package_name = 2;
6468
6469 // operation id; maps to the OP_* constants in AppOpsManager.java
6470 optional int32 op_id = 3;
6471
6472 // The number of times the op was granted while the app was in the
6473 // foreground (only for trusted requests)
6474 optional int64 trusted_foreground_granted_count = 4;
6475
6476 // The number of times the op was granted while the app was in the
6477 // background (only for trusted requests)
6478 optional int64 trusted_background_granted_count = 5;
6479
6480 // The number of times the op was rejected while the app was in the
6481 // foreground (only for trusted requests)
6482 optional int64 trusted_foreground_rejected_count = 6;
6483
6484 // The number of times the op was rejected while the app was in the
6485 // background (only for trusted requests)
6486 optional int64 trusted_background_rejected_count = 7;
6487
6488 // For long-running operations, total duration of the operation
6489 // while the app was in the foreground (only for trusted requests)
6490 optional int64 trusted_foreground_duration_millis = 8;
6491
6492 // For long-running operations, total duration of the operation
6493 // while the app was in the background (only for trusted requests)
6494 optional int64 trusted_background_duration_millis = 9;
6495}
Hongyi Zhang700137e2019-05-23 21:19:36 -07006496
6497/**
6498 * Location Manager API Usage information(e.g. API under usage,
6499 * API call's parameters).
6500 * Logged from:
6501 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
6502 */
6503message LocationManagerApiUsageReported {
6504
6505 // Indicating if usage starts or usage ends.
6506 optional android.stats.location.UsageState state = 1;
6507
6508 // LocationManagerService's API in use.
6509 // We can identify which API from LocationManager is
6510 // invoking current LMS API by the combination of
6511 // API parameter(e.g. is_listener_null, is_intent_null,
6512 // is_location_request_null)
6513 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
6514
6515 // Name of the package calling the API.
6516 optional string calling_package_name = 3;
6517
6518 // Type of the location provider.
6519 optional android.stats.location.ProviderType provider = 4;
6520
6521 // Quality of the location request
6522 optional android.stats.location.LocationRequestQuality quality = 5;
6523
6524 // The desired interval for active location updates, in milliseconds.
6525 // Bucketized to reduce cardinality.
6526 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
6527
6528 // Minimum distance between location updates, in meters.
6529 // Bucketized to reduce cardinality.
6530 optional android.stats.location.SmallestDisplacementBucket
6531 bucketized_smallest_displacement = 7;
6532
6533 // The number of location updates.
6534 optional int64 num_updates = 8;
6535
6536 // The request expiration time, in millisecond since boot.
6537 // Bucketized to reduce cardinality.
6538 optional android.stats.location.ExpirationBucket
6539 bucketized_expire_in = 9;
6540
6541 // Type of Callback passed in for this API.
6542 optional android.stats.location.CallbackType callback_type = 10;
6543
6544 // The radius of the central point of the alert
6545 // region, in meters. Only for API REQUEST_GEOFENCE.
6546 // Bucketized to reduce cardinality.
6547 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
6548
6549 // Activity Importance of API caller.
6550 // Categorized to 3 types that are interesting from location's perspective.
6551 optional android.stats.location.ActivityImportance activiy_importance = 12;
6552}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01006553
6554/**
6555 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
6556 */
6557message ReviewPermissionsFragmentResultReported {
6558 // unique value identifying a permission group change. A permission group change might result
6559 // in multiple of these atoms
6560 optional int64 change_id = 1;
6561
6562 // UID of package the permission belongs to
6563 optional int32 uid = 2 [(is_uid) = true];
6564
6565 // Name of package the permission belongs to
6566 optional string package_name = 3;
6567
6568 // The permission to be granted
6569 optional string permission_name = 4;
6570
6571 // The result of the permission grant
6572 optional bool permission_granted = 5;
6573}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01006574
6575/**
6576* Information about results of permission upgrade by RuntimePermissionsUpgradeController
6577* Logged from: RuntimePermissionUpdgradeController
6578*/
6579message RuntimePermissionsUpgradeResult {
6580 // Permission granted as result of upgrade
6581 optional string permission_name = 1;
6582
6583 // UID of package granted permission
6584 optional int32 uid = 2 [(is_uid) = true];
6585
6586 // Name of package granted permission
6587 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01006588}
6589
6590/**
6591* Information about a buttons presented in GrantPermissionsActivty and choice made by user
6592*/
6593message GrantPermissionsActivityButtonActions {
6594 // Permission granted as result of upgrade
6595 optional string permission_group_name = 1;
6596
6597 // UID of package granted permission
6598 optional int32 uid = 2 [(is_uid) = true];
6599
6600 // Name of package requesting permission
6601 optional string package_name = 3;
6602
6603 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
6604 // LABEL_ constants in GrantPermissionActivity.java
6605 optional int32 buttons_presented = 4;
6606
6607 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
6608 optional int32 button_clicked = 5;
6609}