blob: 96522f7f8ea12a4d53b30df8135e6ccbd94e22f9 [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";
lifr1f74b052019-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";
Tony Make2b1b672019-07-29 16:59:47 +010059import "frameworks/base/core/proto/android/stats/textclassifier/textclassifier_enums.proto";
Tianjie Xu167c3db2019-07-22 14:25:14 -070060import "frameworks/base/core/proto/android/stats/otaupdate/updateengine_enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080061
Yao Chend54f9dd2017-10-17 17:37:48 +000062/**
Stefan Lafonae2df012017-11-14 09:17:21 -080063 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000064 * raw stats log events from the Android system, also known as "atoms."
65 *
66 * This field contains a single oneof with all of the available messages.
67 * The stats-log-api-gen tool runs as part of the Android build and
68 * generates the android.util.StatsLog class, which contains the constants
69 * and methods that Android uses to log.
70 *
Stefan Lafonae2df012017-11-14 09:17:21 -080071 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000072 * Instead, statsd on Android constructs these messages synthetically,
73 * in the format defined here and in stats_log.proto.
74 */
Stefan Lafonae2df012017-11-14 09:17:21 -080075message Atom {
76 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070077 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070078 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
79 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070080 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070081 BleScanResultReceived ble_scan_result_received = 4;
82 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080083 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070084 SyncStateChanged sync_state_changed = 7;
85 ScheduledJobStateChanged scheduled_job_state_changed = 8;
86 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070087 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080088 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
89 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
90 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070091 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
92 MemoryFactorStateChanged memory_factor_state_changed = 15;
93 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
94 CachedKillReported cached_kill_reported = 17;
95 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070096 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080097 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
98 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
99 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -0700100 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800101 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -0700102 CameraStateChanged camera_state_changed = 25;
103 FlashlightStateChanged flashlight_state_changed = 26;
104 UidProcessStateChanged uid_process_state_changed = 27;
105 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
106 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -0700107 BatteryLevelChanged battery_level_changed = 30;
108 ChargingStateChanged charging_state_changed = 31;
109 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -0700110 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800111 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -0700112 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
113 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -0700114 WifiLockStateChanged wifi_lock_state_changed = 37;
115 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
116 WifiScanStateChanged wifi_scan_state_changed = 39;
117 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700118 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700119 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700120 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900121 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700122 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800123 AnomalyDetected anomaly_detected = 46;
Andrei Oneada01ea52019-01-30 15:28:36 +0000124 AppBreadcrumbReported app_breadcrumb_reported = 47 [(allow_from_any_uid) = true];
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800125 AppStartOccurred app_start_occurred = 48;
126 AppStartCanceled app_start_canceled = 49;
127 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800128 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800129 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800130 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800131 LmkStateChanged lmk_state_changed = 54;
132 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800133 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800134 BootSequenceReported boot_sequence_reported = 57;
Andrei Oneada01ea52019-01-30 15:28:36 +0000135 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -0800136 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800137 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800138 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800139 KeyguardStateChanged keyguard_state_changed = 62;
140 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
141 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800142 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800143 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800144 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
145 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800146 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700147 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800148 SpeakerImpedanceReported speaker_impedance_reported = 71;
149 HardwareFailed hardware_failed = 72;
150 PhysicalDropDetected physical_drop_detected = 73;
151 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800152 MobileConnectionStateChanged mobile_connection_state_changed = 75;
153 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700154 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800155 AppCrashOccurred app_crash_occurred = 78;
156 ANROccurred anr_occurred = 79;
157 WTFOccurred wtf_occurred = 80;
158 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700159 GenericAtom generic_atom = 82;
jianjin6eada302019-02-28 11:25:57 -0800160 KeyValuePairsAtom key_value_pairs_atom = 83 [(allow_from_any_uid) = true];
Bookatza7020bd2018-08-28 16:29:35 -0700161 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700162 DeferredJobStatsReported deferred_job_stats_reported = 85;
Tej Singha72344992019-04-17 18:55:08 -0700163 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Kevin Chyn1741a072019-01-17 11:54:40 -0800164 BiometricAcquired biometric_acquired = 87;
165 BiometricAuthenticated biometric_authenticated = 88;
166 BiometricErrorOccurred biometric_error_occurred = 89;
Howard Ro0db82032019-04-07 18:43:34 -0700167 // Atom number 90 is available for use.
Howard Roa46b6582018-09-18 16:45:02 -0700168 BatteryHealthSnapshot battery_health_snapshot = 91;
169 SlowIo slow_io = 92;
170 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700171 PhoneServiceStateChanged phone_service_state_changed = 94;
172 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100173 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700174 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700175 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700176 // TODO: service state change is very noisy shortly after boot, as well
177 // as at other transitions - coming out of doze, device plugged in, etc.
178 // Consider removing this if it becomes a problem
179 ServiceStateChanged service_state_changed = 99;
180 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800181 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800182 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000183 DevicePolicyEvent device_policy_event = 103;
shawnlin9a1392a2019-04-09 16:21:17 +0800184 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled =
185 104 [(log_from_module) = "docsui"];
186 DocsUIFileOperationCopyMoveModeReported
187 docs_ui_file_op_copy_move_mode_reported =
188 105 [(log_from_module) = "docsui"];
189 DocsUIFileOperationFailureReported docs_ui_file_op_failure =
190 106 [(log_from_module) = "docsui"];
191 DocsUIFileOperationReported docs_ui_provider_file_op =
192 107 [(log_from_module) = "docsui"];
193 DocsUIInvalidScopedAccessRequestReported
194 docs_ui_invalid_scoped_access_request =
195 108 [(log_from_module) = "docsui"];
196 DocsUILaunchReported docs_ui_launch_reported =
197 109 [(log_from_module) = "docsui"];
198 DocsUIRootVisitedReported docs_ui_root_visited =
199 110 [(log_from_module) = "docsui"];
200 DocsUIStartupMsReported docs_ui_startup_ms =
201 111 [(log_from_module) = "docsui"];
202 DocsUIUserActionReported docs_ui_user_action_reported =
203 112 [(log_from_module) = "docsui"];
Bookatzda1798c2018-12-13 14:16:00 -0800204 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
205 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f62018-12-06 11:01:38 +0000206 AppCompacted app_compacted = 115;
lifre82d8f62019-03-25 20:33:21 +0800207 NetworkDnsEventReported network_dns_event_reported = 116 [(log_from_module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800208 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
209 117 [(log_from_module) = "docsui"];
210 DocsUIPickResultReported docs_ui_pick_result_reported =
211 118 [(log_from_module) = "docsui"];
212 DocsUISearchModeReported docs_ui_search_mode_reported =
213 119 [(log_from_module) = "docsui"];
214 DocsUISearchTypeReported docs_ui_search_type_reported =
215 120 [(log_from_module) = "docsui"];
Chiachang Wange512b262019-04-11 21:24:28 +0800216 DataStallEvent data_stall_event = 121 [(log_from_module) = "network_stack"];
Christian Brunschenf86039e2018-12-21 12:26:14 +0000217 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000218 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800219 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800220 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800221 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
222 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000223 AppDowngraded app_downgraded = 128;
224 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
225 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800226 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
227 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800228 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800229 NfcErrorOccurred nfc_error_occurred = 134;
230 NfcStateChanged nfc_state_changed = 135;
231 NfcBeamOccurred nfc_beam_occurred = 136;
232 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
233 NfcTagOccurred nfc_tag_occurred = 138;
234 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
235 SeStateChanged se_state_changed = 140;
236 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800237 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800238 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800239 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800240 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800241 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800242 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyne5a37fb2019-02-08 13:10:36 -0800243 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500244 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800245 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Jack Hec27040a2019-01-09 20:54:41 -0800246 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
247 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
248 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
249 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
250 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
251 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
252 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
253 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
254 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He1021a612019-01-20 21:22:46 -0800255 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
256 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
Jack Heaea26982019-04-04 11:19:48 -0700257 BluetoothDeviceInfoReported bluetooth_device_info_reported = 162;
Jack He1021a612019-01-20 21:22:46 -0800258 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
259 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
260 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
261 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
262 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Alex Salod7c3eef2019-01-25 14:43:27 -0800263 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800264 ProcessStartTime process_start_time = 169;
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700265 PermissionGrantRequestResultReported permission_grant_request_result_reported =
266 170 [(log_from_module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800267 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Michael Groover4a0ca942019-01-24 17:41:25 -0800268 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Steven Wu552f63f2019-02-05 13:41:36 -0500269 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
joshmccloskey8c3322e2019-01-09 18:25:57 -0800270 AssistGestureStageReported assist_gesture_stage_reported = 174;
271 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
272 AssistGestureProgressReported assist_gesture_progress_reported = 176;
Philip Quinn0eded622019-01-29 12:46:28 -0800273 TouchGestureClassified touch_gesture_classified = 177;
Andrei Onea4ad6d0c2019-02-08 13:54:12 +0000274 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true];
Kunhung Li286c52f2019-05-21 20:10:43 +0800275 StyleUIChanged style_ui_changed = 179 [(log_from_module) = "style"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700276 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Tej Singha72344992019-04-17 18:55:08 -0700277 180 [(log_from_module) = "permissioncontroller"];
Carmen Agimof6688a352019-01-30 19:36:04 +0000278 AppInstallOnExternalStorageReported app_install_on_external_storage_reported = 181;
Chiachang Wange512b262019-04-11 21:24:28 +0800279 NetworkStackReported network_stack_reported = 182 [(log_from_module) = "network_stack"];
Carmen Agimof6dcc5032019-03-01 16:20:09 +0000280 AppMovedStorageReported app_moved_storage_reported = 183;
joshmccloskey6f952b22019-03-25 20:59:35 -0700281 BiometricEnrolled biometric_enrolled = 184;
jianjin8f2dee02019-03-29 14:03:08 -0700282 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185;
283 TombStoneOccurred tomb_stone_occurred = 186;
Jack He71426802019-04-02 13:32:52 -0700284 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported = 187;
Ben Blount763a5d52019-04-10 11:48:58 -0700285 IntelligenceEventReported intelligence_event_reported =
286 188 [(log_from_module) = "intelligence"];
Tej Singha72344992019-04-17 18:55:08 -0700287 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed = 189;
Hai Zhang5d3328d2019-04-13 21:25:06 +0800288 RoleRequestResultReported role_request_result_reported =
289 190 [(log_from_module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800290 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
291 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
292 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
293 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
294 MediametricsCodecReported mediametrics_codec_reported = 195;
295 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
296 MediametricsExtractorReported mediametrics_extractor_reported = 197;
297 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
298 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
299 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Yuncheol Heod1a85d22019-05-08 17:13:42 -0700300 CarPowerStateChanged car_power_state_changed = 203;
301 GarageModeInfo garage_mode_info = 204;
Tej Singhc9203082019-05-03 13:42:23 -0700302 TestAtomReported test_atom_reported = 205 [(log_from_module) = "cts"];
Adam He420947c2019-01-23 15:59:09 -0800303 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported = 206;
304 ContentCaptureServiceEvents content_capture_service_events = 207;
305 ContentCaptureSessionEvents content_capture_session_events = 208;
306 ContentCaptureFlushed content_capture_flushed = 209;
Hongyi Zhang700137e2019-05-23 21:19:36 -0700307 LocationManagerApiUsageReported location_manager_api_usage_reported = 210;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100308 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
309 211 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100310 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
311 212 [(log_from_module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100312 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
313 213 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100314 LocationAccessCheckNotificationAction location_access_check_notification_action =
315 214 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100316 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
317 215 [(log_from_module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100318 AppPermissionFragmentViewed app_permission_fragment_viewed =
319 216 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100320 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
321 217 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100322 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
323 218 [(log_from_module) = "permissioncontroller"];
Tony Make2b1b672019-07-29 16:59:47 +0100324 TextSelectionEvent text_selection_event =
325 219 [(log_from_module) = "textclassifier"];
326 TextLinkifyEvent text_linkify_event =
327 220 [(log_from_module) = "textclassifier"];
328 ConversationActionsEvent conversation_actions_event =
329 221 [(log_from_module) = "textclassifier"];
330 LanguageDetectionEvent language_detection_event =
331 222 [(log_from_module) = "textclassifier"];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -0700332 ExclusionRectStateChanged exclusion_rect_state_changed = 223;
333 BackGesture back_gesture_reported_reported = 224;
Tianjie Xu167c3db2019-07-22 14:25:14 -0700334 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
335 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Yao Chend54f9dd2017-10-17 17:37:48 +0000336 }
David Chenc8a43242017-10-17 16:23:28 -0700337
David Chen6e3e6cb2018-01-03 16:14:06 -0800338 // Pulled events will start at field 10000.
Rafal Slawik77987ed2019-06-17 12:28:23 +0100339 // Next: 10062
David Chenc8a43242017-10-17 16:23:28 -0700340 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800341 WifiBytesTransfer wifi_bytes_transfer = 10000;
342 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
343 MobileBytesTransfer mobile_bytes_transfer = 10002;
344 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800345 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800346 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800347 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800348 CpuTimePerFreq cpu_time_per_freq = 10008;
349 CpuTimePerUid cpu_time_per_uid = 10009;
350 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800351 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800352 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800353 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800354 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800355 SystemElapsedRealtime system_elapsed_realtime = 10014;
356 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800357 CpuActiveTime cpu_active_time = 10016;
358 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000359 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800360 RemainingBatteryCapacity remaining_battery_capacity = 10019;
361 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800362 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100363 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100364 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100365 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000366 DiskStats disk_stats = 10025;
367 DirectoryUsage directory_usage = 10026;
368 AppSize app_size = 10027;
369 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700370 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700371 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800372 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700373 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700374 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800375 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700376 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100377 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100378 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700379 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee60422018-11-09 12:27:37 -0800380 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
381 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
382 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000383 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800384 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800385 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800386 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000387 DebugElapsedClock debug_elapsed_clock = 10046;
388 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800389 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800390 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800391 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800392 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000393 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000394 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800395 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
396 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000397 SystemIonHeapSize system_ion_heap_size = 10056;
Carmen Agimofa769c152019-03-04 14:39:14 +0000398 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700399 FaceSettings face_settings = 10058;
Maggie White442b6312019-04-05 16:26:44 -0700400 CoolingDevice cooling_device = 10059;
Martijn Coenencd95d462019-04-25 17:09:45 +0200401 AppOps app_ops = 10060;
Rafal Slawik77987ed2019-06-17 12:28:23 +0100402 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061;
David Chenc8a43242017-10-17 16:23:28 -0700403 }
yroa1fe77c2018-02-26 14:22:54 -0800404
Bookatz76aafcf2018-09-17 16:17:10 -0700405 // DO NOT USE field numbers above 100,000 in AOSP.
406 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
407 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700408}
409
Yao Chend54f9dd2017-10-17 17:37:48 +0000410/**
Yangster-mac20877162017-12-22 17:19:39 -0800411 * This proto represents a node of an attribution chain.
412 * Note: All attribution chains are represented as a repeated field of type
413 * AttributionNode. It is understood that in such arrays, the order is that
414 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000415 */
Yangster-mac20877162017-12-22 17:19:39 -0800416message AttributionNode {
417 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800418 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800419
Yangster-mac20877162017-12-22 17:19:39 -0800420 // The (optional) string tag for an element in the attribution chain. If the
421 // element has no tag, it is encoded as an empty string.
422 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700423}
424
Yangster-mac48b3d622018-08-18 12:38:11 -0700425message KeyValuePair {
426 optional int32 key = 1;
427 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700428 int32 value_int = 2;
429 int64 value_long = 3;
430 string value_str = 4;
431 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700432 }
433}
434
435message KeyValuePairsAtom {
436 optional int32 uid = 1;
437 repeated KeyValuePair pairs = 2;
438}
439
Yao Chend54f9dd2017-10-17 17:37:48 +0000440/*
441 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800442 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000443 *
444 * RULES:
445 * - The field ids for each atom must start at 1, and count upwards by 1.
446 * Skipping field ids is not allowed.
447 * - These form an API, so renaming, renumbering or removing fields is
448 * not allowed between android releases. (This is not currently enforced,
449 * but there will be a tool to enforce this restriction).
450 * - The types must be built-in protocol buffer types, namely, no sub-messages
451 * are allowed (yet). The bytes type is also not allowed.
452 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800453 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000454 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800455 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000456 * - A field that is a uid should be a string field, tagged with the [xxx]
457 * annotation. The generated code on android will be represented by UIDs,
458 * and those UIDs will be translated in xxx to those strings.
459 *
460 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700461 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000462 * - If there is a UID, it goes first. Think in an object-oriented fashion.
463 * *****************************************************************************
464 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700465
Yao Chend54f9dd2017-10-17 17:37:48 +0000466/**
Tej Singha72344992019-04-17 18:55:08 -0700467 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700468 * Logs when the Thermal service HAL notifies the throttling start/stop events.
469 *
470 * Logged from:
471 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
472 */
473message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700474 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700475 optional android.os.TemperatureTypeEnum sensor_type = 1;
476
Maggie White442b6312019-04-05 16:26:44 -0700477 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700478 enum State {
479 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700480 START = 1; // START indicated that throttling was triggered.
481 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700482 }
Yangster-mace16189a2018-08-26 12:20:16 -0700483 optional State state = 2;
484
485 optional float temperature = 3;
486}
487
488/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000489 * Logs when the screen state changes.
490 *
491 * Logged from:
492 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
493 */
494message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800495 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700496 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700497}
Yao Chend54f9dd2017-10-17 17:37:48 +0000498
499/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700500 * Logs that the process state of the uid, as determined by ActivityManager
501 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000502 *
503 * Logged from:
504 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
505 */
Bookatzc1a050a2017-10-10 15:49:28 -0700506message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700507 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000508
Bookatzdb026a22018-01-10 19:01:56 -0800509 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700510 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000511}
512
513/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700514 * Logs process state change of a process, as per the activity manager.
515 *
516 * Logged from:
517 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
518 */
519message ProcessStateChanged {
520 optional int32 uid = 1;
521 optional string process_name = 2;
522 optional string package_name = 3;
523 // TODO: remove this when validation is done
524 optional int64 version = 5;
525 // The state, from frameworks/base/core/proto/android/app/enums.proto.
526 optional android.app.ProcessStateEnum state = 4;
527}
528
529/**
530 * Logs when ActivityManagerService sleep state is changed.
531 *
532 * Logged from:
533 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
534 */
535message ActivityManagerSleepStateChanged {
536 // TODO: import frameworks proto
537 enum State {
538 UNKNOWN = 0;
539 ASLEEP = 1;
540 AWAKE = 2;
541 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700542 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700543}
544
545/**
546 * Logs when system memory state changes.
547 *
548 * Logged from:
549 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
550 */
551message MemoryFactorStateChanged {
552 // TODO: import frameworks proto
553 enum State {
554 MEMORY_UNKNOWN = 0;
555 NORMAL = 1; // normal.
556 MODERATE = 2; // moderate memory pressure.
557 LOW = 3; // low memory.
558 CRITICAL = 4; // critical memory.
559
560 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700561 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700562}
563
564/**
565 * Logs when app is using too much cpu, according to ActivityManagerService.
566 *
567 * Logged from:
568 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
569 */
570message ExcessiveCpuUsageReported {
571 optional int32 uid = 1;
572 optional string process_name = 2;
573 optional string package_name = 3;
574 // package version. TODO: remove this when validation is done
575 optional int64 version = 4;
576}
577
578/**
579 * Logs when a cached process is killed, along with its pss.
580 *
581 * Logged from:
582 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
583 */
584message CachedKillReported {
585 optional int32 uid = 1;
586 optional string process_name = 2;
587 optional string package_name = 3;
588 // TODO: remove this when validation is done
589 optional int64 version = 5;
590 optional int64 pss = 4;
591}
592
593/**
594 * Logs when memory stats of a process is reported.
595 *
596 * Logged from:
597 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
598 */
599message ProcessMemoryStatReported {
600 optional int32 uid = 1;
601 optional string process_name = 2;
602 optional string package_name = 3;
603 //TODO: remove this when validation is done
604 optional int64 version = 9;
605 optional int64 pss = 4;
606 optional int64 uss = 5;
607 optional int64 rss = 6;
608 enum Type {
609 ADD_PSS_INTERNAL_SINGLE = 0;
610 ADD_PSS_INTERNAL_ALL_MEM = 1;
611 ADD_PSS_INTERNAL_ALL_POLL = 2;
612 ADD_PSS_EXTERNAL = 3;
613 ADD_PSS_EXTERNAL_SLOW = 4;
614 }
615 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800616 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700617}
618
619/**
Bookatzc1a050a2017-10-10 15:49:28 -0700620 * Logs that a process started, finished, crashed, or ANRed.
621 *
622 * Logged from:
623 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
624 */
625message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700626 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700627
David Chen0b5c90c2018-01-25 16:51:49 -0800628 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800629 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700630
Bookatzddccf0a2017-11-28 16:48:14 -0800631 // What lifecycle state the process changed to.
632 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800633 enum State {
634 FINISHED = 0;
635 STARTED = 1;
636 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800637 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800638 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700639}
640
Bookatzc1a050a2017-10-10 15:49:28 -0700641/**
642 * Logs when the ble scan state changes.
643 *
644 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700645 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700646 */
647message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800648 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700649
650 enum State {
651 OFF = 0;
652 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700653 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
654 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700655 }
656 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700657
Bookatze5ec0b42018-03-26 13:34:56 -0700658 // Does the scan have a filter.
659 optional bool is_filtered = 3;
660 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
661 optional bool is_first_match = 4;
662 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
663 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700664}
665
666/**
667 * Logs reporting of a ble scan finding results.
668 *
669 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700670 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700671 */
Bookatzae6738e2018-09-13 11:38:56 -0700672// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700673message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800674 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700675
676 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800677 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700678}
679
680/**
681 * Logs when a sensor state changes.
682 *
683 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700684 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700685 */
686message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800687 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700688
Bookatzc1a050a2017-10-10 15:49:28 -0700689 // The id (int) of the sensor.
690 optional int32 sensor_id = 2;
691
692 enum State {
693 OFF = 0;
694 ON = 1;
695 }
696 optional State state = 3;
697}
698
Bookatzc1a050a2017-10-10 15:49:28 -0700699/**
700 * Logs when GPS state changes.
701 *
702 * Logged from:
703 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
704 */
705message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800706 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700707
708 enum State {
709 OFF = 0;
710 ON = 1;
711 }
712 optional State state = 2;
713}
714
Bookatz48d362e2018-11-06 15:49:08 -0800715/**
716 * Logs when GPS signal quality.
717 *
718 * Logged from:
719 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
720 */
721message GpsSignalQualityChanged {
722 optional android.server.location.GpsSignalQualityEnum level = 1;
723}
724
Bookatzc1a050a2017-10-10 15:49:28 -0700725
726/**
727 * Logs when a sync manager sync state changes.
728 *
729 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700730 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700731 */
732message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800733 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700734
David Chen0b5c90c2018-01-25 16:51:49 -0800735 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800736 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700737
738 enum State {
739 OFF = 0;
740 ON = 1;
741 }
742 optional State state = 3;
743}
744
Yangster-mac96353002018-09-05 11:18:55 -0700745/*
746 * Deferred job stats.
747 *
748 * Logged from:
749 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
750*/
751message DeferredJobStatsReported {
752 repeated AttributionNode attribution_node = 1;
753
754 // Number of jobs deferred.
755 optional int32 num_jobs_deferred = 2;
756
757 // Time since the last job runs.
758 optional int64 time_since_last_job_millis = 3;
759}
760
Bookatzc1a050a2017-10-10 15:49:28 -0700761/**
762 * Logs when a job scheduler job state changes.
763 *
764 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700765 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700766 */
767message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800768 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700769
770 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800771 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700772
773 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800774 FINISHED = 0;
775 STARTED = 1;
776 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700777 }
778 optional State state = 3;
779
Tej Singh33a412b2018-03-16 18:43:59 -0700780 // The reason a job has stopped.
781 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700782 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700783 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100784
785 // The standby bucket of the app that scheduled the job. These match the framework constants
786 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
787 // already assigned 0.
788 enum Bucket {
789 UNKNOWN = -1;
790 ACTIVE = 0;
791 WORKING_SET = 1;
792 FREQUENT = 2;
793 RARE = 3;
794 NEVER = 4;
795 }
796 optional Bucket standby_bucket = 5 [default = UNKNOWN];
797
798 // The job id (as assigned by the app).
799 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700800}
801
802/**
803 * Logs when the audio state changes.
804 *
805 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700806 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700807 */
808message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800809 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700810
811 enum State {
812 OFF = 0;
813 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700814 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
815 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700816 }
817 optional State state = 2;
818}
819
820/**
821 * Logs when the video codec state changes.
822 *
823 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700824 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700825 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800826message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800827 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700828
829 enum State {
830 OFF = 0;
831 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700832 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
833 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700834 }
835 optional State state = 2;
836}
837
838/**
839 * Logs when the flashlight state changes.
840 *
841 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700842 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700843 */
844message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800845 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700846
847 enum State {
848 OFF = 0;
849 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700850 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
851 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700852 }
853 optional State state = 2;
854}
855
856/**
857 * Logs when the camera state changes.
858 *
859 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700860 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700861 */
862message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800863 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700864
865 enum State {
866 OFF = 0;
867 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700868 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
869 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700870 }
871 optional State state = 2;
872}
873
874/**
875 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000876 *
877 * Logged from:
878 * TODO
879 */
Bookatzd6746242017-10-24 18:39:35 -0700880message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800881 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000882
Bookatz1a1b0462018-01-12 11:47:03 -0800883 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
884 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700885 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700886
887 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
888 optional string tag = 3;
889
890 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800891 RELEASE = 0;
892 ACQUIRE = 1;
893 CHANGE_RELEASE = 2;
894 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700895 }
896 optional State state = 4;
897}
898
899/**
Bookatzc1a050a2017-10-10 15:49:28 -0700900 * Logs when a partial wakelock is considered 'long' (over 1 min).
901 *
902 * Logged from:
903 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
904 */
905message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800906 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700907
Yao Chend54f9dd2017-10-17 17:37:48 +0000908 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
909 optional string tag = 2;
910
Bookatzc1a050a2017-10-10 15:49:28 -0700911 // TODO: I have no idea what this is.
912 optional string history_tag = 3;
913
914 enum State {
915 OFF = 0;
916 ON = 1;
917 }
918 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000919}
920
Bookatzc1a050a2017-10-10 15:49:28 -0700921/**
Bookatza66083f2018-09-20 17:24:00 -0700922 * Logs when the device is interactive, according to the PowerManager Notifier.
923 *
924 * Logged from:
925 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
926 */
927message InteractiveStateChanged {
928 enum State {
929 OFF = 0;
930 ON = 1;
931 }
932 optional State state = 1;
933}
934
935/**
Bookatzc1a050a2017-10-10 15:49:28 -0700936 * Logs Battery Saver state change.
937 *
938 * Logged from:
939 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
940 */
941message BatterySaverModeStateChanged {
942 enum State {
943 OFF = 0;
944 ON = 1;
945 }
946 optional State state = 1;
947}
948
949/**
950 * Logs Doze mode state change.
951 *
952 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800953 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700954 */
955message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800956 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800957}
958
959
960/**
961 * Logs state change of Doze mode including maintenance windows.
962 *
963 * Logged from:
964 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
965 */
966message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800967 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700968}
969
970/**
971 * Logs screen brightness level.
972 *
973 * Logged from:
974 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
975 */
976message ScreenBrightnessChanged {
977 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
978 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700979}
980
981/**
982 * Logs battery level (percent full, from 0 to 100).
983 *
984 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700985 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700986 */
987message BatteryLevelChanged {
988 // Battery level. Should be in [0, 100].
989 optional int32 battery_level = 1;
990}
991
992/**
993 * Logs change in charging status of the device.
994 *
995 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700996 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700997 */
998message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800999 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1000 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001001}
1002
1003/**
1004 * Logs whether the device is plugged in, and what power source it is using.
1005 *
1006 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001007 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001008 */
1009message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001010 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1011 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001012}
1013
Bookatz8c6571b2017-10-24 15:04:41 -07001014/**
1015 * Logs when an app's wakeup alarm fires.
1016 *
1017 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001018 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001019 */
1020message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001021 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001022
1023 // Name of the wakeup alarm.
1024 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001025
1026 // Name of source package (for historical reasons, since BatteryStats tracked it).
1027 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001028
1029 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1030 enum Bucket {
1031 UNKNOWN = 0;
1032 EXEMPTED = 5;
1033 ACTIVE = 10;
1034 WORKING_SET = 20;
1035 FREQUENT = 30;
1036 RARE = 40;
1037 NEVER = 50;
1038 }
1039 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1040 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001041}
1042
1043/**
1044 * Logs when an an app causes the mobile radio to change state.
1045 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1046 *
1047 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001048 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001049 */
1050message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001051 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001052
Bookatz1a1b0462018-01-12 11:47:03 -08001053 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1054 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001055}
1056
1057/**
1058 * Logs when an an app causes the wifi radio to change state.
1059 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1060 *
1061 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001062 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001063 */
1064message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001065 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001066
Bookatz1a1b0462018-01-12 11:47:03 -08001067 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1068 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001069}
1070
1071/**
1072 * Logs kernel wakeup reasons and aborts.
1073 *
1074 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001075 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001076 */
1077message KernelWakeupReported {
1078 // Name of the kernel wakeup reason (or abort).
1079 optional string wakeup_reason_name = 1;
1080
1081 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001082 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001083}
1084
1085/**
Bookatzda1798c2018-12-13 14:16:00 -08001086 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001087 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001088 *
1089 * Logged from:
1090 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1091 */
1092message WifiEnabledStateChanged {
1093 enum State {
1094 OFF = 0;
1095 ON = 1;
1096 }
1097 optional State state = 1;
1098}
1099
1100/**
1101 * 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 -08001102 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1103 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001104 *
1105 * Logged from:
1106 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1107 */
1108message WifiRunningStateChanged {
1109 repeated AttributionNode attribution_node = 1;
1110
1111 enum State {
1112 OFF = 0;
1113 ON = 1;
1114 }
1115 optional State state = 2;
1116}
1117
1118/**
Bookatze5885242017-10-24 20:10:31 -07001119 * Logs wifi locks held by an app.
1120 *
1121 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001122 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001123 */
1124message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001125 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001126
1127 enum State {
1128 OFF = 0;
1129 ON = 1;
1130 }
1131 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001132
1133 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1134 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001135}
1136
1137/**
1138 * Logs wifi signal strength changes.
1139 *
1140 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001141 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001142 */
1143message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001144 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1145 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001146}
1147
1148/**
1149 * Logs wifi scans performed by an app.
1150 *
1151 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001152 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001153 */
1154message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001155 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001156
1157 enum State {
1158 OFF = 0;
1159 ON = 1;
1160 }
1161 optional State state = 2;
1162}
1163
1164/**
Tej Singh4503e102018-01-04 14:35:01 -08001165 * Logs wifi multicast locks held by an app
1166 *
1167 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001168 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001169 */
1170message WifiMulticastLockStateChanged {
1171 repeated AttributionNode attribution_node = 1;
1172
1173 enum State {
1174 OFF = 0;
1175 ON = 1;
1176 }
1177 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001178
1179 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001180}
1181
1182/**
Tej Singh1ea42892018-01-19 09:27:00 -08001183 * Logs shutdown reason and duration on next boot.
1184 *
1185 * Logged from:
1186 * frameworks/base/core/java/com/android/server/BootReceiver.java
1187 */
1188message ShutdownSequenceReported {
1189 // True if shutdown is for a reboot. Default: false if we do not know.
1190 optional bool reboot = 1;
1191
1192 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1193 optional string reason = 2;
1194
1195 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1196 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001197 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001198
1199 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001200 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001201}
1202
Tej Singh6483ea42018-01-25 17:45:49 -08001203
1204/**
1205 * Logs boot reason and duration.
1206 *
1207 * Logged from:
1208 * system/core/bootstat/bootstat.cpp
1209 */
1210message BootSequenceReported {
1211 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1212 // Default: "<EMPTY>" if not available.
1213 optional string bootloader_reason = 1;
1214
1215 // Reason for system boot. Eg. bootloader, reboot,userrequested
1216 // Default: "<EMPTY>" if not available.
1217 optional string system_reason = 2;
1218
1219 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001220 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001221
1222 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001223 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001224
1225 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001226 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001227
1228 // Time since last boot in ms. Default: 0 if not available.
1229 optional int64 time_since_last_boot = 6;
1230}
1231
Tej Singhc477d9c2018-02-05 18:31:39 -08001232
1233/**
1234 * Logs call state and disconnect cause (if applicable).
1235 *
1236 * Logged from:
1237 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1238 */
1239message CallStateChanged {
1240 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1241 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1242 optional android.telecom.CallStateEnum call_state = 1;
1243
1244 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1245 // This value is only applicable when the call_state is DISCONNECTED, and
1246 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1247 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1248 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1249
1250 // True if the call is self-managed, which are apps that use the
1251 // telecom infrastructure to make their own calls.
1252 optional bool self_managed = 3;
1253
1254 // True if call is external. External calls are calls on connected Wear
1255 // devices but show up in Telecom so the user can pull them onto the device.
1256 optional bool external_call = 4;
1257}
1258
Tej Singh1ea42892018-01-19 09:27:00 -08001259/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001260 * Logs keyguard state. The keyguard is the lock screen.
1261 *
1262 * Logged from:
1263 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1264 */
1265message KeyguardStateChanged {
1266 enum State {
1267 UNKNOWN = 0;
1268 // The keyguard is hidden when the phone is unlocked.
1269 HIDDEN = 1;
1270 // The keyguard is shown when the phone is locked (screen turns off).
1271 SHOWN= 2;
1272 // The keyguard is occluded when something is overlaying the keyguard.
1273 // Eg. Opening the camera while on the lock screen.
1274 OCCLUDED = 3;
1275 }
1276 optional State state = 1;
1277}
1278
1279/**
1280 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1281 * prompts the user to enter a password (pattern, pin, etc).
1282 *
1283 * Logged from:
1284 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1285 */
1286
1287message KeyguardBouncerStateChanged {
1288 enum State {
1289 UNKNOWN = 0;
1290 // Bouncer is hidden, either as a result of successfully entering the
1291 // password, screen timing out, or user going back to lock screen.
1292 HIDDEN = 1;
1293 // This is when the user is being prompted to enter the password.
1294 SHOWN = 2;
1295 }
1296 optional State state = 1;
1297}
1298
1299/**
1300 * Logs the result of entering a password into the keyguard bouncer.
1301 *
1302 * Logged from:
1303 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1304 */
1305message KeyguardBouncerPasswordEntered {
1306 enum BouncerResult {
1307 UNKNOWN = 0;
1308 // The password entered was incorrect.
1309 FAILURE = 1;
1310 // The password entered was correct.
1311 SUCCESS = 2;
1312 }
1313 optional BouncerResult result = 1;
1314}
1315
Tej Singha883b372018-02-15 11:30:01 -08001316/*
1317 * Logs changes to the configuration of the device. The configuration is defined
1318 * in frameworks/base/core/java/android/content/res/Configuration.java
1319 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1320 * Please go there to interpret the possible values each field can be.
1321 *
1322 * Logged from:
1323 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1324 */
1325message ResourceConfigurationChanged {
1326 // Bit mask of color capabilities of the screen.
1327 // Contains information about the color gamut and hdr mode of the screen.
1328 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001329 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001330
1331 // The target screen density being rendered to.
1332 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001333 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001334
1335 // Current user preference for the scaling factor for fonts,
1336 // relative to the base density scaling.
1337 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001338 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001339
1340 // Flag indicating whether the hard keyboard is hidden.
1341 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001342 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001343
1344 // The type of keyboard attached to the device.
1345 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1346 optional int32 keyboard = 5;
1347
1348 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1349 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001350 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001351
1352 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1353 // 0 if undefined.
1354 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1355 optional int32 mcc = 7;
1356
1357 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1358 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1359 // MNC_ZERO symbol defined in Configuration.java.
1360 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1361 optional int32 mnc = 8;
1362
1363 // The kind of navigation available on the device.
1364 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1365 optional int32 navigation = 9;
1366
1367 // Flag indicating whether the navigation is available.
1368 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001369 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001370
1371 // Overall orientation of the screen.
1372 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1373 optional int32 orientation = 11;
1374
1375 // The current height of the available screen space, in dp units.
1376 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001377 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001378
1379 // Bit mask of overall layout of the screen.
1380 // Contains information about screen size, whether the screen is wider/taller
1381 // than normal, whether the screen layout is right-tl-left or left-to-right,
1382 // and whether the screen has a rounded shape.
1383 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001384 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001385
1386 // Current width of the available screen space, in dp units.
1387 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001388 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001389
1390 // The smallest screen size an application will see in normal operation.
1391 // This is the smallest value of both screenWidthDp and screenHeightDp
1392 // in portrait and landscape.
1393 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001394 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001395
1396 // The type of touch screen attached to the device.
1397 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1398 optional int32 touchscreen = 16;
1399
1400 // Bit mask of the ui mode.
1401 // Contains information about the overall ui mode of the device.
1402 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1403 // Also contains information about whether the device is in night mode.
1404 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001405 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001406}
1407
Tej Singheee317b2018-03-07 19:28:05 -08001408
1409/**
1410 * Logs changes in the connection state of the mobile radio.
1411 *
1412 * Logged from:
1413 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1414 */
1415message MobileConnectionStateChanged {
1416 // States are from the state machine DataConnection.java.
1417 enum State {
1418 UNKNOWN = 0;
1419 // The connection is inactive, or disconnected.
1420 INACTIVE = 1;
1421 // The connection is being activated, or connecting.
1422 ACTIVATING = 2;
1423 // The connection is active, or connected.
1424 ACTIVE = 3;
1425 // The connection is disconnecting.
1426 DISCONNECTING = 4;
1427 // The connection is disconnecting after creating a connection.
1428 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1429 }
1430 optional State state = 1;
1431 // For multi-sim phones, this distinguishes between the sim cards.
1432 optional int32 sim_slot_index = 2;
1433 // Used to identify the connection. Starts at 0 and increments by 1 for
1434 // every new network created. Resets whenever the device reboots.
1435 optional int32 data_connection_id = 3;
1436 // A bitmask for the capabilities of this connection.
1437 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1438 // Default value (if we have no information): 0
1439 optional int64 capabilities = 4;
1440 // If this connection has internet.
1441 // This just checks if the DEFAULT bit of capabilities is set.
1442 optional bool has_internet = 5;
1443}
1444
1445/**
1446 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1447 *
1448 * Logged from:
1449 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1450 */
1451message MobileRadioTechnologyChanged {
1452 optional android.telephony.NetworkTypeEnum state = 1;
1453 // For multi-sim phones, this distinguishes between the sim cards.
1454 optional int32 sim_slot_index = 2;
1455}
1456
Andrew Chantb56388b2018-03-22 21:07:33 -07001457/**
1458 * Logs the VID and PID of any connected USB devices.
1459 *
1460 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1461 *
1462 * Logged by Vendor.
1463 */
1464message UsbDeviceAttached {
1465 optional int32 vid = 1;
1466 optional int32 pid = 2;
1467 optional bool has_audio = 3;
1468 optional bool has_hid = 4;
1469 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001470 enum State {
1471 STATE_DISCONNECTED = 0;
1472 STATE_CONNECTED = 1;
1473 }
1474 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001475 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001476}
1477
Tej Singheee317b2018-03-07 19:28:05 -08001478
Tej Singhdd7bd352018-02-09 19:33:15 -08001479/**
Tej Singh5d991e12018-03-09 19:48:11 -08001480 * Logs when Bluetooth is enabled and disabled.
1481 *
1482 * Logged from:
1483 * services/core/java/com/android/server/BluetoothManagerService.java
1484 */
1485message BluetoothEnabledStateChanged {
1486 repeated AttributionNode attribution_node = 1;
1487 // Whether or not bluetooth is enabled on the device.
1488 enum State {
1489 UNKNOWN = 0;
1490 ENABLED = 1;
1491 DISABLED = 2;
1492 }
1493 optional State state = 2;
1494 // The reason for being enabled/disabled.
1495 // Eg. Airplane mode, crash, application request.
1496 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1497 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001498 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001499}
1500
1501/**
Jack Hed9837c82019-01-09 01:19:13 -08001502 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001503 *
1504 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001505 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1506 *
1507 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001508 */
1509message BluetoothConnectionStateChanged {
1510 // The state of the connection.
1511 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1512 optional android.bluetooth.ConnectionStateEnum state = 1;
1513 // An identifier that can be used to match connect and disconnect events.
1514 // Currently is last two bytes of a hash of a device level ID and
1515 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001516 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001517 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001518 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1519 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001520 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001521 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001522 // An identifier that can be used to match events for this device.
1523 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1524 // Salt: Randomly generated 256 bit value
1525 // Hash algorithm: HMAC-SHA256
1526 // Size: 32 byte
1527 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001528 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001529}
1530
1531/**
1532 * Logs when a Bluetooth device connects and disconnects over ACL
1533 *
1534 * Logged from:
1535 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1536 *
1537 * Next Tag: 3
1538 */
1539message BluetoothAclConnectionStateChanged {
1540 // An identifier that can be used to match events for this device.
1541 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1542 // Salt: Randomly generated 256 bit value
1543 // Hash algorithm: HMAC-SHA256
1544 // Size: 32 byte
1545 // Default: null or empty if the device identifier is not known
1546 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1547 // The state of the connection.
1548 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1549 optional android.bluetooth.ConnectionStateEnum state = 2;
1550}
1551
1552/**
1553 * Logs when a Bluetooth device connects and disconnects over SCO
1554 *
1555 * Logged from:
1556 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1557 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1558 *
1559 * Next Tag: 4
1560 */
1561message BluetoothScoConnectionStateChanged {
1562 // An identifier that can be used to match events for this device.
1563 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1564 // Salt: Randomly generated 256 bit value
1565 // Hash algorithm: HMAC-SHA256
1566 // Size: 32 byte
1567 // Default: null or empty if the device identifier is not known
1568 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1569 // The state of the connection.
1570 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1571 optional android.bluetooth.ConnectionStateEnum state = 2;
1572 // Codec used for this SCO connection
1573 // Default: UNKNOWN
1574 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001575}
1576
Jack Hec27040a2019-01-09 20:54:41 -08001577/**
1578 * Logged when active device of a profile changes
1579 *
1580 * Logged from:
1581 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1582 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1583 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1584 */
1585message BluetoothActiveDeviceChanged {
1586 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1587 // From android.bluetooth.BluetoothProfile
1588 optional int32 bt_profile = 1;
1589 // An identifier that can be used to match events for this new active device.
1590 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1591 // Salt: Randomly generated 256 bit value
1592 // Hash algorithm: HMAC-SHA256
1593 // Size: 32 byte
1594 // Default: null or empty if there is no active device for this profile
1595 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1596}
1597
Jack Heab86dbd22018-12-18 15:43:27 -08001598// Logs when there is an event affecting Bluetooth device's link layer connection.
1599// - This event is triggered when there is a related HCI command or event
1600// - Users of this metrics can deduce Bluetooth device's connection state from these events
1601// - HCI commands are logged before the command is sent, after receiving command status, and after
1602// receiving command complete
1603// - HCI events are logged when they arrive
1604//
1605// Low level log from system/bt
1606//
1607// Bluetooth classic commands:
1608// - CMD_CREATE_CONNECTION
1609// - CMD_DISCONNECT
1610// - CMD_CREATE_CONNECTION_CANCEL
1611// - CMD_ACCEPT_CONNECTION_REQUEST
1612// - CMD_REJECT_CONNECTION_REQUEST
1613// - CMD_SETUP_ESCO_CONNECTION
1614// - CMD_ACCEPT_ESCO_CONNECTION
1615// - CMD_REJECT_ESCO_CONNECTION
1616// - CMD_ENH_SETUP_ESCO_CONNECTION
1617// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1618//
1619// Bluetooth low energy commands:
1620// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1621// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1622// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1623// - CMD_BLE_CLEAR_WHITE_LIST
1624// - CMD_BLE_ADD_WHITE_LIST
1625// - CMD_BLE_REMOVE_WHITE_LIST
1626//
1627// Bluetooth classic events:
1628// - EVT_CONNECTION_COMP
1629// - EVT_CONNECTION_REQUEST
1630// - EVT_DISCONNECTION_COMP
1631// - EVT_ESCO_CONNECTION_COMP
1632// - EVT_ESCO_CONNECTION_CHANGED
1633//
1634// Bluetooth low energy meta events:
1635// - BLE_EVT_CONN_COMPLETE_EVT
1636// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1637//
1638// Next tag: 10
1639message BluetoothLinkLayerConnectionEvent {
1640 // An identifier that can be used to match events for this device.
1641 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1642 // Salt: Randomly generated 256 bit value
1643 // Hash algorithm: HMAC-SHA256
1644 // Size: 32 byte
1645 // Default: null or empty if the device identifier is not known
1646 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1647 // Connection handle of this connection if available
1648 // Range: 0x0000 - 0x0EFF (12 bits)
1649 // Default: 0xFFFF if the handle is unknown
1650 optional int32 connection_handle = 2;
1651 // Direction of the link
1652 // Default: DIRECTION_UNKNOWN
1653 optional android.bluetooth.DirectionEnum direction = 3;
1654 // Type of this link
1655 // Default: LINK_TYPE_UNKNOWN
1656 optional android.bluetooth.LinkTypeEnum type = 4;
1657
1658 // Reason metadata for this link layer connection event, rules for interpretation:
1659 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1660 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1661 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1662 // set and valid, ignore hci_ble_event
1663
1664 // HCI command associated with this event
1665 // Default: CMD_UNKNOWN
1666 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1667 // HCI event associated with this event
1668 // Default: EVT_UNKNOWN
1669 optional android.bluetooth.hci.EventEnum hci_event = 6;
1670 // HCI BLE meta event associated with this event
1671 // Default: BLE_EVT_UNKNOWN
1672 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1673 // HCI command status code if this is triggerred by hci_cmd
1674 // Default: STATUS_UNKNOWN
1675 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1676 // HCI reason code associated with this event
1677 // Default: STATUS_UNKNOWN
1678 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1679}
1680
Howard Roe103fe22019-01-17 16:52:16 -08001681/**
1682 * Logs when a module is rolled back by Watchdog.
1683 *
1684 * Logged from: Rollback Manager
1685 */
1686message WatchdogRollbackOccurred {
1687 enum RollbackType {
1688 UNKNOWN = 0;
1689 ROLLBACK_INITIATE = 1;
1690 ROLLBACK_SUCCESS = 2;
1691 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001692 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001693 }
1694 optional RollbackType rollback_type = 1;
1695
1696 optional string package_name = 2;
1697
1698 optional int32 package_version_code = 3;
1699}
1700
Jack Hec27040a2019-01-09 20:54:41 -08001701/**
1702 * Logs when there is a change in Bluetooth A2DP playback state
1703 *
1704 * Logged from:
1705 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1706 */
1707message BluetoothA2dpPlaybackStateChanged {
1708 // An identifier that can be used to match events for this device.
1709 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1710 // Salt: Randomly generated 256 bit value
1711 // Hash algorithm: HMAC-SHA256
1712 // Size: 32 byte
1713 // Default: null or empty if the device identifier is not known
1714 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1715 // Current playback state
1716 // Default: PLAYBACK_STATE_UNKNOWN
1717 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1718 // Current audio coding mode
1719 // Default: AUDIO_CODING_MODE_UNKNOWN
1720 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1721}
1722
1723/**
1724 * Logs when there is a change in A2DP codec config for a particular remote device
1725 *
1726 * Logged from:
1727 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1728 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1729 */
1730message BluetoothA2dpCodecConfigChanged {
1731 // An identifier that can be used to match events for this device.
1732 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1733 // Salt: Randomly generated 256 bit value
1734 // Hash algorithm: HMAC-SHA256
1735 // Size: 32 byte
1736 // Default: null or empty if the device identifier is not known
1737 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1738 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1739 // Default SOURCE_CODEC_TYPE_INVALID
1740 optional int32 codec_type = 2;
1741 // Codec priroity, the higher the more preferred, -1 for disabled
1742 // Default: CODEC_PRIORITY_DEFAULT
1743 optional int32 codec_priority = 3;
1744 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1745 // Default: SAMPLE_RATE_NONE
1746 optional int32 sample_rate = 4;
1747 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1748 // Default: BITS_PER_SAMPLE_NONE
1749 optional int32 bits_per_sample = 5;
1750 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1751 // Default: CHANNEL_MODE_NONE
1752 optional int32 channel_mode = 6;
1753 // Codec specific values
1754 // Default 0
1755 optional int64 codec_specific_1 = 7;
1756 optional int64 codec_specific_2 = 8;
1757 optional int64 codec_specific_3 = 9;
1758 optional int64 codec_specific_4 = 10;
1759}
1760
1761/**
1762 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1763 * Each codec's capability is logged separately due to statsd restriction
1764 *
1765 * Logged from:
1766 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1767 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1768 */
1769message BluetoothA2dpCodecCapabilityChanged {
1770 // An identifier that can be used to match events for this device.
1771 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1772 // Salt: Randomly generated 256 bit value
1773 // Hash algorithm: HMAC-SHA256
1774 // Size: 32 byte
1775 // Default: null or empty if the device identifier is not known
1776 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1777 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1778 // Default SOURCE_CODEC_TYPE_INVALID
1779 optional int32 codec_type = 2;
1780 // Codec priroity, the higher the more preferred, -1 for disabled
1781 // Default: CODEC_PRIORITY_DEFAULT
1782 optional int32 codec_priority = 3;
1783 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1784 // in BluetoothCodecConfig
1785 // Default: empty and SAMPLE_RATE_NONE for individual item
1786 optional int32 sample_rate = 4;
1787 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1788 // in BluetoothCodecConfig
1789 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1790 optional int32 bits_per_sample = 5;
1791 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1792 // BluetoothCodecConfig
1793 // Default: empty and CHANNEL_MODE_NONE for individual item
1794 optional int32 channel_mode = 6;
1795 // Codec specific values
1796 // Default 0
1797 optional int64 codec_specific_1 = 7;
1798 optional int64 codec_specific_2 = 8;
1799 optional int64 codec_specific_3 = 9;
1800 optional int64 codec_specific_4 = 10;
1801}
1802
1803/**
1804 * Logs when A2DP failed to read from PCM source.
1805 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1806 *
1807 * Logged from:
1808 * system/bt
1809 */
1810message BluetoothA2dpAudioUnderrunReported {
1811 // An identifier that can be used to match events for this device.
1812 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1813 // Salt: Randomly generated 256 bit value
1814 // Hash algorithm: HMAC-SHA256
1815 // Size: 32 byte
1816 // Default: null or empty if the device identifier is not known
1817 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1818 // Encoding interval in nanoseconds
1819 // Default: 0
1820 optional int64 encoding_interval_nanos = 2;
1821 // Number of bytes of PCM data that could not be read from the source
1822 // Default: 0
1823 optional int32 num_missing_pcm_bytes = 3;
1824}
1825
1826/**
1827 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1828 * buffer queue is full and we have to drop data
1829 *
1830 * Logged from:
1831 * system/bt
1832 */
1833message BluetoothA2dpAudioOverrunReported {
1834 // An identifier that can be used to match events for this device.
1835 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1836 // Salt: Randomly generated 256 bit value
1837 // Hash algorithm: HMAC-SHA256
1838 // Size: 32 byte
1839 // Default: null or empty if the device identifier is not known
1840 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1841 // Encoding interval in nanoseconds
1842 // Default: 0
1843 optional int64 encoding_interval_nanos = 2;
1844 // Number of buffers dropped in this event
1845 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1846 // Default: 0
1847 optional int32 num_dropped_buffers = 3;
1848 // Number of encoded buffers dropped in this event
1849 // Default 0
1850 optional int32 num_dropped_encoded_frames = 4;
1851 // Number of encoded bytes dropped in this event
1852 // Default: 0
1853 optional int32 num_dropped_encoded_bytes = 5;
1854}
1855
1856/**
1857 * Logs when we receive reports regarding a device's RSSI value
1858 *
1859 * Logged from:
1860 * system/bt
1861 */
1862message BluetoothDeviceRssiReported {
1863 // An identifier that can be used to match events for this device.
1864 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1865 // Salt: Randomly generated 256 bit value
1866 // Hash algorithm: HMAC-SHA256
1867 // Size: 32 byte
1868 // Default: null or empty if the device identifier is not known
1869 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1870 // Connection handle of this connection if available
1871 // Range: 0x0000 - 0x0EFF (12 bits)
1872 // Default: 0xFFFF if the handle is unknown
1873 optional int32 connection_handle = 2;
1874 // HCI command status code if this is triggerred by hci_cmd
1875 // Default: STATUS_UNKNOWN
1876 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1877 // BR/EDR
1878 // Range: -128 ≤ N ≤ 127 (signed integer)
1879 // Units: dB
1880 // LE:
1881 // Range: -127 to 20, 127 (signed integer)
1882 // Units: dBm
1883 // Invalid when an out of range value is reported
1884 optional int32 rssi = 4;
1885}
1886
1887/**
1888 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1889 *
1890 * Logged from:
1891 * system/bt
1892 */
1893message BluetoothDeviceFailedContactCounterReported {
1894 // An identifier that can be used to match events for this device.
1895 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1896 // Salt: Randomly generated 256 bit value
1897 // Hash algorithm: HMAC-SHA256
1898 // Size: 32 byte
1899 // Default: null or empty if the device identifier is not known
1900 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1901 // Connection handle of this connection if available
1902 // Range: 0x0000 - 0x0EFF (12 bits)
1903 // Default: 0xFFFF if the handle is unknown
1904 optional int32 connection_handle = 2;
1905 // HCI command status code if this is triggerred by hci_cmd
1906 // Default: STATUS_UNKNOWN
1907 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1908 // Number of consecutive failed contacts for a connection corresponding to the Handle
1909 // Range: uint16_t, 0-0xFFFF
1910 // Default: 0xFFFFF
1911 optional int32 failed_contact_counter = 4;
1912}
1913
1914/**
1915 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1916 *
1917 * Logged from:
1918 * system/bt
1919 */
1920message BluetoothDeviceTxPowerLevelReported {
1921 // An identifier that can be used to match events for this device.
1922 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1923 // Salt: Randomly generated 256 bit value
1924 // Hash algorithm: HMAC-SHA256
1925 // Size: 32 byte
1926 // Default: null or empty if the device identifier is not known
1927 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1928 // Connection handle of this connection if available
1929 // Range: 0x0000 - 0x0EFF (12 bits)
1930 // Default: 0xFFFF if the handle is unknown
1931 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001932 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001933 // Default: STATUS_UNKNOWN
1934 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1935 // Range: -30 ≤ N ≤ 20
1936 // Units: dBm
1937 // Invalid when an out of range value is reported
1938 optional int32 transmit_power_level = 4;
1939}
Jack Heab86dbd22018-12-18 15:43:27 -08001940
Tej Singh5d991e12018-03-09 19:48:11 -08001941/**
Jack He1021a612019-01-20 21:22:46 -08001942 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1943 * receiving an HCI command from the host
1944 *
1945 * Logged from: system/bt
1946 */
1947message BluetoothHciTimeoutReported {
1948 // HCI command associated with this event
1949 // Default: CMD_UNKNOWN
1950 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1951}
1952
1953/**
1954 * Logs when we receive Bluetooth Link Quality Report event from the controller
1955 * See Android Bluetooth HCI specification for more details
1956 *
1957 * Note: all count and bytes field are counted since last event
1958 *
1959 * Logged from: system/bt
1960 */
1961message BluetoothQualityReportReported {
1962 // Quality report ID
1963 // Original type: uint8_t
1964 // Default: BQR_ID_UNKNOWN
1965 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1966 // Packet type of the connection
1967 // Original type: uint8_t
1968 // Default: BQR_PACKET_TYPE_UNKNOWN
1969 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1970 // Connection handle of the connection
1971 // Original type: uint16_t
1972 optional int32 connection_handle = 3;
1973 // Performing Role for the connection
1974 // Original type: uint8_t
1975 optional int32 connection_role = 4;
1976 // Current Transmit Power Level for the connection. This value is the same as the controller's
1977 // response to the HCI_Read_Transmit_Power_Level HCI command
1978 // Original type: uint8_t
1979 optional int32 tx_power_level = 5;
1980 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1981 // absolute receiver signal strength value
1982 // Original type: int8_t
1983 optional int32 rssi = 6;
1984 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1985 // channels used by the link currently
1986 // Original type: uint8_t
1987 optional int32 snr = 7;
1988 // Indicates the number of unused channels in AFH_channel_map
1989 // Original type: uint8_t
1990 optional int32 unused_afh_channel_count = 8;
1991 // Indicates the number of the channels which are interfered and quality is bad but are still
1992 // selected for AFH
1993 // Original type: uint8_t
1994 optional int32 afh_select_unideal_channel_count = 9;
1995 // Current Link Supervision Timeout Setting
1996 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1997 // Original type: uint16_t
1998 optional int32 lsto = 10;
1999 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2000 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2001 // 0x01 (Piconet Clock)
2002 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2003 // Original type: uint32_t
2004 optional int64 connection_piconet_clock = 11;
2005 // The count of retransmission
2006 // Original type: uint32_t
2007 optional int64 retransmission_count = 12;
2008 // The count of no RX
2009 // Original type: uint32_t
2010 optional int64 no_rx_count = 13;
2011 // The count of NAK (Negative Acknowledge)
2012 // Original type: uint32_t
2013 optional int64 nak_count = 14;
2014 // Controller timestamp of last TX ACK
2015 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2016 // Original type: uint32_t
2017 optional int64 last_tx_ack_timestamp = 15;
2018 // The count of Flow-off (STOP)
2019 // Original type: uint32_t
2020 optional int64 flow_off_count = 16;
2021 // Controller timestamp of last Flow-on (GO)
2022 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2023 // Original type: uint32_t
2024 optional int64 last_flow_on_timestamp = 17;
2025 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2026 // Original type: uint32_t
2027 optional int64 buffer_overflow_bytes = 18;
2028 // Buffer underflow count (in byte) since last event
2029 // Original type: uint32_t
2030 optional int64 buffer_underflow_bytes = 19;
2031}
2032
2033/**
2034 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2035 *
2036 * Notes:
2037 * - Each event can be partially filled as we might learn different pieces of device
2038 * information at different time
2039 * - Multiple device info events can be combined to give more complete picture
2040 * - When multiple device info events tries to describe the same information, the
2041 * later one wins
2042 *
2043 * Logged from:
2044 * packages/apps/Bluetooth
2045 */
Jack Heaea26982019-04-04 11:19:48 -07002046message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002047 // An identifier that can be used to match events for this device.
2048 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2049 // Salt: Randomly generated 256 bit value
2050 // Hash algorithm: HMAC-SHA256
2051 // Size: 32 byte
2052 // Default: null or empty if the device identifier is not known
2053 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2054 // Where is this device info obtained from
2055 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2056 // Name of the data source
2057 // For EXTERNAL: package name of the data source
2058 // For INTERNAL: null for general case, component name otherwise
2059 optional string source_name = 3;
2060 // Name of the manufacturer of this device
2061 optional string manufacturer = 4;
2062 // Model of this device
2063 optional string model = 5;
2064 // Hardware version of this device
2065 optional string hardware_version = 6;
2066 // Software version of this device
2067 optional string software_version = 7;
2068}
2069
2070/**
2071 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2072 * device, as documented by the Bluetooth Core HCI specification
2073 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2074 * Vol 2, Part E, Page 1118
2075 *
2076 * Logged from:
2077 * system/bt
2078 */
2079message BluetoothRemoteVersionInfoReported {
2080 // Connection handle of the connection
2081 // Original type: uint16_t
2082 optional int32 connection_handle = 1;
2083 // HCI command status code
2084 // Default: STATUS_UNKNOWN
2085 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2086 // 1 byte Version of current LMP in the remote controller
2087 optional int32 lmp_version = 3;
2088 // 2 bytes LMP manufacturer code of the remote controller
2089 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2090 optional int32 lmp_manufacturer_code = 4;
2091 // 4 bytes subversion of the LMP in the remote controller
2092 optional int32 lmp_subversion = 5;
2093}
2094
2095/**
2096 * Logs when certain Bluetooth SDP attributes are discovered
2097 * Constant definitions are from:
2098 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2099 *
2100 * Current logged attributes:
2101 * - BluetoothProfileDescriptorList
2102 * - Supported Features Bitmask
2103 *
2104 * Logged from:
2105 * system/bt
2106 */
2107message BluetoothSdpAttributeReported {
2108 // An identifier that can be used to match events for this device.
2109 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2110 // Salt: Randomly generated 256 bit value
2111 // Hash algorithm: HMAC-SHA256
2112 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2113 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2114 // Original type: uint16_t
2115 optional int32 protocol_uuid = 2;
2116 // Short form UUIDs used to identify Bluetooth SDP attribute types
2117 // Original type: uint16_t
2118 optional int32 attribute_id = 3;
2119 // Attribute value for the particular attribute
2120 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2121}
2122
2123/**
2124 * Logs when bond state of a Bluetooth device changes
2125 *
2126 * Logged from:
2127 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2128 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2129 */
2130message BluetoothBondStateChanged {
2131 // An identifier that can be used to match events for this device.
2132 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2133 // Salt: Randomly generated 256 bit value
2134 // Hash algorithm: HMAC-SHA256
2135 // Size: 32 byte
2136 // Default: null or empty if the device identifier is not known
2137 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2138 // Preferred transport type to remote dual mode device
2139 // Default: TRANSPORT_AUTO means no preference
2140 optional android.bluetooth.TransportTypeEnum transport = 2;
2141 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2142 // Default: UNKNOWN
2143 optional android.bluetooth.DeviceTypeEnum type = 3;
2144 // Current bond state (NONE, BONDING, BONDED)
2145 // Default: BOND_STATE_UNKNOWN
2146 optional android.bluetooth.BondStateEnum bond_state = 4;
2147 // Bonding sub state
2148 // Default: BOND_SUB_STATE_UNKNOWN
2149 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2150 // Unbond Reason
2151 // Default: UNBOND_REASON_UNKNOWN
2152 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2153}
2154
2155/**
2156 * Logs there is an event related Bluetooth classic pairing
2157 *
2158 * Logged from:
2159 * system/bt
2160 */
2161message BluetoothClassicPairingEventReported {
2162 // An identifier that can be used to match events for this device.
2163 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2164 // Salt: Randomly generated 256 bit value
2165 // Hash algorithm: HMAC-SHA256
2166 // Size: 32 byte
2167 // Default: null or empty if the device identifier is not known
2168 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2169 // Connection handle of this connection if available
2170 // Range: 0x0000 - 0x0EFF (12 bits)
2171 // Default: 0xFFFF if the handle is unknown
2172 optional int32 connection_handle = 2;
2173 // HCI command associated with this event
2174 // Default: CMD_UNKNOWN
2175 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2176 // HCI event associated with this event
2177 // Default: EVT_UNKNOWN
2178 optional android.bluetooth.hci.EventEnum hci_event = 4;
2179 // HCI command status code if this is triggerred by hci_cmd
2180 // Default: STATUS_UNKNOWN
2181 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2182 // HCI reason code associated with this event
2183 // Default: STATUS_UNKNOWN
2184 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002185 // A status value related to this specific event
2186 // Default: 0
2187 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002188}
2189
2190/**
2191 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2192 *
2193 * Logged from:
2194 * system/bt
2195 */
2196message BluetoothSmpPairingEventReported {
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
2202 // Default: null or empty if the device identifier is not known
2203 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2204 // SMP command sent or received over L2CAP
2205 // Default: CMD_UNKNOWN
2206 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2207 // Whether this command is sent or received
2208 // Default: DIRECTION_UNKNOWN
2209 optional android.bluetooth.DirectionEnum direction = 3;
2210 // SMP failure reason code
2211 // Default: PAIRING_FAIL_REASON_DEFAULT
2212 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2213}
2214
2215/**
Jack He815cdba2019-01-30 17:24:55 -08002216 * Logs when a Bluetooth socket’s connection state changed
2217 *
2218 * Logged from:
2219 * system/bt
2220 */
2221message BluetoothSocketConnectionStateChanged {
2222 // An identifier that can be used to match events for this device.
2223 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2224 // Salt: Randomly generated 256 bit value
2225 // Hash algorithm: HMAC-SHA256
2226 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002227 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002228 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002229 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002230 // Default 0 when unknown or don't care
2231 optional int32 port = 2;
2232 // Socket type as mentioned in
2233 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2234 // Default: SOCKET_TYPE_UNKNOWN
2235 optional android.bluetooth.SocketTypeEnum type = 3;
2236 // Socket connection state
2237 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2238 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2239 // Number of bytes sent to remote device during this connection
2240 optional int64 tx_bytes = 5;
2241 // Number of bytes received from remote device during this connection
2242 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002243 // Socket owner's UID
2244 optional int32 uid = 7 [(is_uid) = true];
2245 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2246 // |port| must be spawned by |server_port|
2247 // Default 0 when unknown or don't care
2248 optional int32 server_port = 8;
2249 // Whether this is a server listener socket
2250 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002251}
2252
2253/**
Jack He71426802019-04-02 13:32:52 -07002254 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2255 *
2256 * Logged from:
2257 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2258 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2259 *
2260 */
2261message BluetoothClassOfDeviceReported {
2262 // An identifier that can be used to match events for this device.
2263 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2264 // Salt: Randomly generated 256 bit value
2265 // Hash algorithm: HMAC-SHA256
2266 // Size: 32 byte
2267 // Default: null or empty if this is a server listener socket
2268 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2269 // Class of Device (CoD) value including both Major, Minor device class and service class
2270 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2271 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2272 // Default: 0
2273 optional int32 class_of_device = 2;
2274}
2275
2276/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002277 * Logs when something is plugged into or removed from the USB-C connector.
2278 *
2279 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002280 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002281 */
2282message UsbConnectorStateChanged {
2283 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002284 STATE_DISCONNECTED = 0;
2285 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002286 }
2287 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002288 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002289 // Last active session in ms.
2290 // 0 when the port is in connected state.
2291 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002292}
2293
2294/**
2295 * Logs the reported speaker impedance.
2296 *
2297 * Logged from:
2298 * Vendor audio implementation.
2299 */
2300message SpeakerImpedanceReported {
2301 optional int32 speaker_location = 1;
2302 optional int32 impedance = 2;
2303}
2304
2305/**
2306 * Logs the report of a failed hardware.
2307 *
2308 * Logged from:
2309 * Vendor HALs.
2310 *
2311 */
2312message HardwareFailed {
2313 enum HardwareType {
2314 HARDWARE_FAILED_UNKNOWN = 0;
2315 HARDWARE_FAILED_MICROPHONE = 1;
2316 HARDWARE_FAILED_CODEC = 2;
2317 HARDWARE_FAILED_SPEAKER = 3;
2318 HARDWARE_FAILED_FINGERPRINT = 4;
2319 }
2320 optional HardwareType hardware_type = 1;
2321
Maggie White6dcd8572019-01-31 14:11:50 -08002322 /**
2323 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002324 * the same hardware_type. The specific locations are vendor defined integers,
2325 * referring to board-specific numbering schemes.
2326 */
2327 optional int32 hardware_location = 2;
2328
Maggie White6dcd8572019-01-31 14:11:50 -08002329 /**
2330 * failure_code is specific to the HardwareType of the failed hardware.
2331 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002332 */
Maggie White6dcd8572019-01-31 14:11:50 -08002333 enum HardwareErrorCode {
2334 UNKNOWN = 0;
2335 COMPLETE = 1;
2336 SPEAKER_HIGH_Z = 2;
2337 SPEAKER_SHORT = 3;
2338 FINGERPRINT_SENSOR_BROKEN = 4;
2339 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002340 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002341 }
2342 optional int32 failure_code = 3;
2343}
2344
2345/**
2346 * Log an event when the device has been physically dropped.
2347 * Reported from the /vendor partition.
2348 */
2349message PhysicalDropDetected {
2350 // Confidence that the event was actually a drop, 0 -> 100
2351 optional int32 confidence_pctg = 1;
2352 // Peak acceleration of the drop, in 1/1000s of a g.
2353 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002354 // Duration of freefall in ms
2355 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002356}
2357
2358/**
2359 * Log bucketed battery charge cycles.
2360 *
2361 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002362 * a given charge point. For example, if 10 cycle buckets are
2363 * initialized, bucket 1 is the lowest 1/10th of the battery,
2364 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002365 *
2366 * Logged from:
2367 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2368 */
2369message ChargeCyclesReported {
2370 optional int32 cycle_bucket_1 = 1;
2371 optional int32 cycle_bucket_2 = 2;
2372 optional int32 cycle_bucket_3 = 3;
2373 optional int32 cycle_bucket_4 = 4;
2374 optional int32 cycle_bucket_5 = 5;
2375 optional int32 cycle_bucket_6 = 6;
2376 optional int32 cycle_bucket_7 = 7;
2377 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002378 optional int32 cycle_bucket_9 = 9;
2379 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002380}
2381
2382/**
Howard Roa46b6582018-09-18 16:45:02 -07002383 * Log battery health snapshot.
2384 *
2385 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2386 * are snapshotted periodically over 24hrs.
2387 */
2388message BatteryHealthSnapshot {
2389 enum BatterySnapshotType {
2390 UNKNOWN = 0;
2391 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2392 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2393 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2394 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2395 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2396 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2397 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2398 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2399 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2400 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2401 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2402 }
2403 optional BatterySnapshotType type = 1;
2404 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002405 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002406 // Voltage Battery Voltage, in microVolts.
2407 optional int32 voltage_micro_volt = 3;
2408 // Current Battery current, in microAmps.
2409 optional int32 current_micro_amps = 4;
2410 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2411 optional int32 open_circuit_micro_volt = 5;
2412 // Resistance Battery Resistance, in microOhms.
2413 optional int32 resistance_micro_ohm = 6;
2414 // Level Battery Level, as % of full.
2415 optional int32 level_percent = 7;
2416}
2417
2418/**
2419 * Log slow I/O operations on the primary storage.
2420 */
2421message SlowIo {
2422 // Classifications of IO Operations.
2423 enum IoOperation {
2424 UNKNOWN = 0;
2425 READ = 1;
2426 WRITE = 2;
2427 UNMAP = 3;
2428 SYNC = 4;
2429 }
2430 optional IoOperation operation = 1;
2431
2432 // The number of slow IO operations of this type over 24 hours.
2433 optional int32 count = 2;
2434}
2435
2436/**
2437 * Log battery caused shutdown with the last recorded voltage.
2438 */
2439message BatteryCausedShutdown {
2440 // The last recorded battery voltage prior to shutdown.
2441 optional int32 last_recorded_micro_volt = 1;
2442}
2443
2444/**
Tej Singha72344992019-04-17 18:55:08 -07002445 * Logs when ThermalService receives throttling events.
2446 *
2447 * Logged from:
2448 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2449 */
2450message ThermalThrottlingSeverityStateChanged {
2451 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2452 optional android.os.TemperatureTypeEnum sensor_type = 1;
2453
2454 // The name of the temperature source. Eg. CPU0
2455 optional string sensor_name = 2;
2456
2457 // Temperature in tenths of a degree C.
2458 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2459 optional int32 temperature_deci_celsius = 3;
2460
2461 // Relative severity of the throttling, see enum definition.
2462 optional android.os.ThrottlingSeverityEnum severity = 4;
2463}
2464
2465/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002466 * Logs the duration of a davey (jank of >=700ms) when it occurs
2467 *
2468 * Logged from:
2469 * frameworks/base/libs/hwui/JankTracker.cpp
2470 */
2471message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002472 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002473 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002474
Tej Singhbb8554a2018-01-26 11:59:14 -08002475 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002476 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002477}
2478
2479/**
Bookatze5885242017-10-24 20:10:31 -07002480 * Logs phone signal strength changes.
2481 *
2482 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002483 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002484 */
2485message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002486 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2487 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002488}
2489
Yangster4ccebea2018-10-09 17:09:02 -07002490
2491/**
2492 * Logs when the phone state, sim state or signal strength changes
2493 *
2494 * Logged from:
2495 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2496 */
2497message PhoneServiceStateChanged {
2498 optional android.telephony.ServiceStateEnum state = 1;
2499 optional android.telephony.SimStateEnum sim_state = 2;
2500 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2501}
2502
2503/**
2504 * Logs when the phone becomes on or off.
2505 *
2506 * Logged from:
2507 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2508 */
2509message PhoneStateChanged {
2510 enum State {
2511 OFF = 0;
2512 ON = 1;
2513 }
2514 optional State state = 1;
2515}
2516
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002517message BackGesture {
2518 enum BackType {
2519 DEFAULT_BACK_TYPE = 0;
2520 COMPLETED = 1;
2521 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2522 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2523 INCOMPLETE = 4;
2524 }
2525 optional BackType type = 1;
2526
2527 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2528 enum WindowHorizontalLocation {
2529 DEFAULT_LOCATION = 0;
2530 LEFT = 1;
2531 RIGHT = 2;
2532 }
2533 optional WindowHorizontalLocation x_location = 3;
2534}
2535
2536message ExclusionRectStateChanged {
2537 optional string component_name = 1; // if not available, simply packageName
2538 optional int32 requested_height = 2; // px
2539 optional int32 rejected_height = 3; // px
2540
2541 enum WindowHorizontalLocation {
2542 DEFAULT_LOCATION = 0;
2543 LEFT = 1;
2544 RIGHT = 2;
2545 }
2546 optional WindowHorizontalLocation x_location = 4;
2547 optional bool landscape = 5;
2548 optional bool splitscreen = 6;
2549 optional int32 duration_millis = 7;
2550}
2551
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002552message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002553 optional android.stats.launcher.LauncherAction action = 1;
2554 optional android.stats.launcher.LauncherState src_state = 2;
2555 optional android.stats.launcher.LauncherState dst_state = 3;
2556 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002557 optional bool is_swipe_up_enabled = 5;
2558}
2559
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002560message StyleUIChanged {
2561 optional android.stats.style.Action action = 1;
2562 optional int32 color_package_hash = 2;
2563 optional int32 font_package_hash = 3;
2564 optional int32 shape_package_hash = 4;
2565 optional int32 clock_package_hash = 5;
2566 optional int32 launcher_grid = 6;
2567 optional int32 wallpaper_category_hash = 7;
2568 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002569 optional int32 color_preference = 9;
2570 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002571}
2572
David Chenc28b2bb2017-10-24 12:52:52 -07002573/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002574 * Logs when Settings UI has changed.
2575 *
2576 * Logged from:
2577 * packages/apps/Settings
2578 */
2579message SettingsUIChanged {
2580 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002581 * Where this SettingsUIChange event comes from. For example, if
2582 * it's a PAGE_VISIBLE event, where the page is opened from.
2583 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002584 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002585
2586 /**
2587 * What the UI action is.
2588 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002589 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002590
2591 /**
2592 * Where the action is happening
2593 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002594 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002595
2596 /**
2597 * What preference changed in this event.
2598 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002599 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002600
2601 /**
2602 * The new value of the changed preference.
2603 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002604 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002605}
2606
2607/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002608 * Logs basic timing information about touch events.
2609 * Reported at most every 5 minutes while device is being interacted with.
2610 *
2611 * Logged from:
2612 * frameworks/native/services/inputflinger
2613 */
2614message TouchEventReported {
2615 /**
2616 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2617 * and the standard deviation of latency between the kernel and framework
2618 * for touchscreen events. The units are microseconds.
2619 *
2620 * The number is measured as the difference between the time at which
2621 * the input event was received in the evdev driver,
2622 * and the time at which the input event was received in EventHub.
2623 */
2624 // Minimum value
2625 optional float latency_min_micros = 1;
2626 // Maximum value
2627 optional float latency_max_micros = 2;
2628 // Average value
2629 optional float latency_mean_micros = 3;
2630 // Standard deviation
2631 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002632 // Number of touch events (input_event) in this report
2633 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002634}
2635
2636/**
Philip Quinn0eded622019-01-29 12:46:28 -08002637 * Logs gesture classification and timing information for touch events.
2638 *
2639 * Logged from:
2640 * frameworks/base/core/java/android/view/GestureDetector.java
2641 * frameworks/base/core/java/android/view/View.java
2642 */
2643message TouchGestureClassified {
2644 // The source of the classification (e.g. Java class name).
2645 optional string source = 1;
2646
2647 enum Classification {
2648 UNKNOWN_CLASSIFICATION = 0;
2649 SINGLE_TAP = 1;
2650 DOUBLE_TAP = 2;
2651 LONG_PRESS = 3;
2652 DEEP_PRESS = 4;
2653 SCROLL = 5;
2654 }
2655 // The classification of the gesture.
2656 optional Classification classification = 2;
2657
2658 // The interval from the start of a touch event stream until the
2659 // classification was made.
2660 optional int32 latency_millis = 3;
2661
2662 // The distance from the location of the first touch event to the
2663 // location of the touch event when the classification was made.
2664 optional float displacement_px = 4;
2665}
2666
2667/**
David Chenc28b2bb2017-10-24 12:52:52 -07002668 * Logs that a setting was updated.
2669 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002670 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002671 * The tag and is_default allow resetting of settings to default values based on the specified
2672 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2673 */
2674message SettingChanged {
2675 // The name of the setting.
2676 optional string setting = 1;
2677
2678 // The change being imposed on this setting. May represent a number, eg "3".
2679 optional string value = 2;
2680
2681 // The new value of this setting. For most settings, this is same as value. For some settings,
2682 // value is +X or -X where X represents an element in a set. For example, if the previous value
2683 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2684 // The +/- feature is currently only used for location_providers_allowed.
2685 optional string new_value = 3;
2686
2687 // The previous value of this setting.
2688 optional string prev_value = 4;
2689
2690 // The tag used with the is_default for resetting sets of settings. This is generally null.
2691 optional string tag = 5;
2692
Bookatz90867622018-01-31 15:05:57 -08002693 // True if this setting with tag should be resettable.
2694 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002695
David Chenbd789912018-03-16 17:19:55 -07002696 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002697 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002698
2699 enum ChangeReason {
2700 UPDATED = 1; // Updated can be an insertion or an update.
2701 DELETED = 2;
2702 }
2703 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002704}
Chenjie Yub3dda412017-10-24 13:41:59 -07002705
Chenjie Yu05013b32017-11-21 10:21:41 -08002706/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002707 * Logs activity going to foreground or background
2708 *
2709 * Logged from:
2710 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2711 */
2712message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002713 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002714 optional string pkg_name = 2;
2715 optional string class_name = 3;
2716
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002717 enum State {
2718 BACKGROUND = 0;
2719 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002720 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002721 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002722}
David Chenc8a43242017-10-17 16:23:28 -07002723
2724/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002725 * Logs when a volume entered low Storage state.
2726 * Logged from:
2727 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2728 */
2729message LowStorageStateChanged {
2730 // Volume that ran out of storage.
2731 optional string volume_description = 1;
2732
2733 enum State {
2734 UNKNOWN = 0;
2735 OFF = 1;
2736 ON = 2;
2737 }
2738 optional State state = 2;
2739}
2740
2741/**
2742 * Logs when an app is downgraded.
2743 * Logged from:
2744 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2745 */
2746message AppDowngraded {
2747 optional string package_name = 1;
2748 // Size of the package (all data) before being downgraded.
2749 optional int64 size_in_bytes_before = 2;
2750 // Size of the package (all data) after being downgraded.
2751 optional int64 size_in_bytes_after = 3;
2752
2753 optional bool aggressive = 4;
2754}
2755
2756/**
2757 * Logs when an app is optimized after being downgraded.
2758 * Logged from:
2759 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2760 */
2761message AppOptimizedAfterDowngraded {
2762 optional string package_name = 1;
2763}
2764
2765/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002766 * Logs whenever an app is installed on external storage.
2767 * Logged from:
2768 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2769 */
2770message AppInstallOnExternalStorageReported {
2771 // The type of external storage.
2772 optional android.stats.storage.ExternalStorageType storage_type = 1;
2773 // The name of the package that is installed on the sd card.
2774 optional string package_name = 2;
2775}
2776
2777/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002778 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002779 * Logged from:
2780 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2781 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002782message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002783 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002784
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002785 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002786
2787 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002788 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002789 optional string process_name = 3;
2790
2791 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002792 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002793
2794 optional string package_name = 5;
2795
2796 enum InstantApp {
2797 UNAVAILABLE = 0;
2798 FALSE = 1;
2799 TRUE = 2;
2800 }
2801 optional InstantApp is_instant_app = 6;
2802
2803 enum ForegroundState {
2804 UNKNOWN = 0;
2805 BACKGROUND = 1;
2806 FOREGROUND = 2;
2807 }
2808 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002809
2810 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002811}
David Chen9e3808c2017-11-20 17:25:34 -08002812
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002813/**
2814 * Logs when a WTF (What a Terrible Failure) happened.
2815 * Logged from:
2816 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2817 */
2818message WTFOccurred {
2819 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002820
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002821 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002822
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002823 // The name of the process.
2824 // system_server if it is not by an app
2825 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002826
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002827 // The pid if available. -1 means not available.
2828 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002829
2830 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002831}
2832
2833/**
2834 * Logs when system server reports low memory.
2835 * Logged from:
2836 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2837 */
2838message LowMemReported {
2839}
2840
2841/**
2842 * Logs when an app ANR (App Not Responding) occurs.
2843 * Logged from:
2844 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2845 */
2846message ANROccurred {
2847 optional int32 uid = 1 [(is_uid) = true];
2848
2849 optional string process_name = 2;
2850
2851 optional string short_component_name = 3;
2852
2853 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002854
2855 enum InstantApp {
2856 UNAVAILABLE = 0;
2857 FALSE = 1;
2858 TRUE = 2;
2859 }
2860 optional InstantApp is_instant_app = 5;
2861
2862 enum ForegroundState {
2863 UNKNOWN = 0;
2864 BACKGROUND = 1;
2865 FOREGROUND = 2;
2866 }
2867 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002868
2869 optional android.server.ErrorSource error_source = 7;
2870
2871 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002872}
2873
Bookatza7020bd2018-08-28 16:29:35 -07002874/**
2875 * Logs when the vibrator state changes.
2876 * Logged from:
2877 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2878 */
2879message VibratorStateChanged {
2880 repeated AttributionNode attribution_node = 1;
2881
2882 enum State {
2883 OFF = 0;
2884 ON = 1;
2885 }
2886 optional State state = 2;
2887
2888 // Duration (in milliseconds) requested to keep the vibrator on.
2889 // Only applicable for State == ON.
2890 optional int64 duration_millis = 3;
2891}
2892
David Chen0a368b22017-12-06 16:28:16 -08002893/*
2894 * Allows other apps to push events into statsd.
2895 * Logged from:
2896 * frameworks/base/core/java/android/util/StatsLog.java
2897 */
David Chen0b5c90c2018-01-25 16:51:49 -08002898message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002899 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002900 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002901
2902 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2903 optional int32 label = 2;
2904
2905 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2906 // predicates for the metrics).
2907 enum State {
2908 UNKNOWN = 0;
2909 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2910 STOP = 2;
2911 START = 3;
2912 }
2913 optional State state = 3;
2914}
2915
David Chen9e3808c2017-11-20 17:25:34 -08002916/**
Bookatz7948c872018-09-04 12:58:33 -07002917 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2918 * For example, this could be due to the user manually changing the time.
2919 *
2920 * Logged from:
2921 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2922 */
2923message WallClockTimeShifted {
2924 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2925 optional int64 wall_clock_timestamp_millis = 1;
2926}
2927
2928/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002929 * Logs when statsd detects an anomaly.
2930 *
2931 * Logged from:
2932 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2933 */
2934message AnomalyDetected {
2935 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002936 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002937
Yangster-mac94e197c2018-01-02 16:03:03 -08002938 // Id of the config whose anomaly detection alert fired.
2939 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002940
Yangster-mac94e197c2018-01-02 16:03:03 -08002941 // Id of the alert (i.e. name of the anomaly that was detected).
2942 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002943}
2944
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002945message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002946 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002947 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002948
2949 // The app package name.
2950 optional string pkg_name = 2;
2951
2952 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002953 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002954 WARM = 1;
2955 HOT = 2;
2956 COLD = 3;
2957 }
2958 // The transition type.
2959 optional TransitionType type = 3;
2960
2961 // The activity name.
2962 optional string activity_name = 4;
2963
2964 // The name of the calling app. Empty if not set.
2965 optional string calling_pkg_name = 5;
2966
2967 // Whether the app is an instant app.
2968 optional bool is_instant_app = 6;
2969
2970 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002971 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002972
Bookatz80d11a02018-01-16 10:46:35 -08002973 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002974
David Chen0b5c90c2018-01-25 16:51:49 -08002975 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002976 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002977 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002978 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002979 optional int32 bind_application_delay_millis = 11;
2980 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002981
2982 // Empty if not set.
2983 optional string launch_token = 13;
2984
Calin Juravle759fbda2018-02-20 19:52:30 +00002985 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002986 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002987
2988 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002989 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002990}
2991
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002992message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002993 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002994 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002995
2996 // The app package name.
2997 optional string pkg_name = 2;
2998
2999 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003000 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003001 WARM = 1;
3002 HOT = 2;
3003 COLD = 3;
3004 }
3005 // The transition type.
3006 optional TransitionType type = 3;
3007
3008 // The activity name.
3009 optional string activity_name = 4;
3010}
3011
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003012message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003013 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003014 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003015
3016 // The app package name.
3017 optional string pkg_name = 2;
3018
3019 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003020 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003021 WITH_BUNDLE = 1;
3022 WITHOUT_BUNDLE = 2;
3023 }
3024 // The transition type.
3025 optional TransitionType type = 3;
3026
3027 // The activity name.
3028 optional string activity_name = 4;
3029
3030 optional bool transition_process_running = 5;
3031
3032 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003033 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003034}
3035
Bookatz8fcd09a2017-12-18 13:01:10 -08003036/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003037 * Logs a picture-in-picture action
3038 * Logged from:
3039 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3040 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3041 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3042 */
3043message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003044 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003045 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003046
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003047 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003048
Chenjie Yu52cacc62017-12-08 18:11:45 -08003049 enum State {
3050 ENTERED = 1;
3051 EXPANDED_TO_FULL_SCREEN = 2;
3052 MINIMIZED = 3;
3053 DISMISSED = 4;
3054 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003055 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003056}
3057
3058/**
Chenjie Yue8904192017-12-08 19:12:57 -08003059 * Logs overlay action
3060 * Logged from:
3061 * services/core/java/com/android/server/wm/Session.java
3062 */
3063message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003064 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003065
3066 optional string package_name = 2;
3067
3068 optional bool using_alert_window = 3;
3069
3070 enum State {
3071 ENTERED = 1;
3072 EXITED = 2;
3073 }
3074 optional State state = 4;
3075}
3076
Chenjie Yuccfe6452018-01-30 11:33:21 -08003077/*
3078 * Logs foreground service starts and stops.
3079 * Note that this is not when a service starts or stops, but when it is
3080 * considered foreground.
3081 * Logged from
3082 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3083 */
3084message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003085 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003086 // package_name + "/" + class_name
3087 optional string short_name = 2;
3088
3089 enum State {
3090 ENTER = 1;
3091 EXIT = 2;
3092 }
3093 optional State state = 3;
3094}
3095
Chenjie Yue8904192017-12-08 19:12:57 -08003096/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003097 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3098 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3099 * attributed back to the parent (host) uid. One example is Chrome.
3100 *
3101 * Logged from:
3102 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3103 */
3104message IsolatedUidChanged {
3105 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003106 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003107 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003108 optional int32 parent_uid = 1;
3109
3110 optional int32 isolated_uid = 2;
3111
3112 // We expect an isolated uid to be removed before if it's used for another parent uid.
3113 enum Event {
3114 REMOVED = 0;
3115 CREATED = 1;
3116 }
3117 optional Event event = 3;
3118}
3119
3120/*
3121 * Logs the reception of an incoming network packet causing the main system to wake up for
3122 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3123 * and processed by WakeupController.cpp.
3124 */
3125message PacketWakeupOccurred {
3126 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3127 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003128 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003129 // The interface name on which the packet was received.
3130 optional string iface = 2;
3131 // The ethertype value of the packet.
3132 optional int32 ethertype = 3;
3133 // String representation of the destination MAC address of the packet.
3134 optional string destination_hardware_address = 4;
3135 // String representation of the source address of the packet if this was an IP packet.
3136 optional string source_ip = 5;
3137 // String representation of the destination address of the packet if this was an IP packet.
3138 optional string destination_ip = 6;
3139 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3140 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3141 // families.
3142 optional int32 ip_next_header = 7;
3143 // The source port if this was a TCP or UDP packet.
3144 optional int32 source_port = 8;
3145 // The destination port if this was a TCP or UDP packet.
3146 optional int32 destination_port = 9;
3147}
3148
3149/*
3150 * Logs the memory stats for an app on startup.
3151 * Logged from:
3152 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3153 */
3154message AppStartMemoryStateCaptured {
3155 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003156 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003157
3158 // The process name.
3159 optional string process_name = 2;
3160
3161 // The activity name.
3162 optional string activity_name = 3;
3163
3164 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003165 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003166
3167 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003168 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003169
3170 // RSS
3171 optional int64 rss_in_bytes = 6;
3172
3173 // CACHE
3174 optional int64 cache_in_bytes = 7;
3175
3176 // SWAP
3177 optional int64 swap_in_bytes = 8;
3178}
3179
3180/*
3181 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3182 * for LMK event.
3183 * Logged from:
3184 * system/core/lmkd/lmkd.c
3185 */
3186message LmkStateChanged {
3187 enum State {
3188 UNKNOWN = 0;
3189 START = 1;
3190 STOP = 2;
3191 }
3192 optional State state = 1;
3193}
3194
3195/*
3196 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3197 * Logged from:
3198 * system/core/lmkd/lmkd.c
3199 */
3200message LmkKillOccurred {
3201 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003202 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003203
3204 // The process name.
3205 optional string process_name = 2;
3206
3207 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003208 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003209
3210 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003211 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003212
3213 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003214 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003215
3216 // RSS
3217 optional int64 rss_in_bytes = 6;
3218
3219 // CACHE
3220 optional int64 cache_in_bytes = 7;
3221
3222 // SWAP
3223 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003224
3225 // The elapsed real time of start of the process.
3226 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003227
3228 // Min oom adj score considered by lmkd.
3229 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003230}
3231
Rajeev Kumar51b54602018-03-01 12:18:26 -08003232/*
3233 * Logs when the ActivityManagerService detects that an app died.
3234 *
3235 * Logged from:
3236 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3237 */
3238message AppDied {
3239 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003240 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003241}
3242
Howard Ro21a039c2018-08-06 14:55:47 -07003243/**
3244 * An atom for generic metrics logging. Available from Android Q.
3245 */
3246message GenericAtom {
3247 // The uid of the application that sent this custom atom.
3248 optional int32 uid = 1 [(is_uid) = true];
3249
3250 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003251 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003252}
3253
Tej Singhd6d6d772018-09-05 17:41:25 -07003254/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003255 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003256 *
3257 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003258 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003259 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003260message BiometricAcquired {
3261 // Biometric modality that was acquired.
3262 optional android.hardware.biometrics.ModalityEnum modality = 1;
3263 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3264 optional int32 user = 2;
3265 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3266 optional bool is_crypto = 3;
3267 // Action that the device is performing. Acquired messages are only expected for enroll and
3268 // authenticate. Other actions may indicate an error.
3269 optional android.hardware.biometrics.ActionEnum action = 4;
3270 // The client that this acquisition was received for.
3271 optional android.hardware.biometrics.ClientEnum client = 5;
3272 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3273 optional int32 acquire_info = 6;
3274 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3275 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003276 // Dictates if this message should trigger additional debugging.
3277 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003278}
3279
3280/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003281 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003282 *
3283 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003284 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003285 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003286message BiometricAuthenticated {
3287 // Biometric modality that was used.
3288 optional android.hardware.biometrics.ModalityEnum modality = 1;
3289 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3290 optional int32 user = 2;
3291 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3292 // storage.
3293 optional bool is_crypto = 3;
3294 // The client that this acquisition was received for.
3295 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003296 // If authentication requires user confirmation. See BiometricPrompt's
3297 // setRequireConfirmation(bool) method.
3298 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003299
Kevin Chyn1741a072019-01-17 11:54:40 -08003300 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003301 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003302 REJECTED = 1;
3303 PENDING_CONFIRMATION = 2;
3304 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003305 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003306
3307 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003308 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003309 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3310 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3311 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3312 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003313 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003314 // Dictates if this message should trigger additional debugging.
3315 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003316}
3317
3318/**
3319 * Logs when a biometric error occurs.
3320 *
3321 * Logged from:
3322 * frameworks/base/services/core/java/com/android/server/biometrics
3323 */
3324message BiometricErrorOccurred {
3325 // Biometric modality that was used.
3326 optional android.hardware.biometrics.ModalityEnum modality = 1;
3327 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3328 optional int32 user = 2;
3329 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3330 optional bool is_crypto = 3;
3331 // Action that the device is performing.
3332 optional android.hardware.biometrics.ActionEnum action = 4;
3333 // The client that this acquisition was received for.
3334 optional android.hardware.biometrics.ClientEnum client = 5;
3335 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3336 // are unique to modality.
3337 optional int32 error_info = 6;
3338 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3339 // by the vendor and not specified by the HIDL interface.
3340 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003341 // Dictates if this message should trigger additional debugging.
3342 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003343 // Time spent during the authentication attempt.
3344 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003345}
3346
3347/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003348 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003349 * Logged from:
3350 * frameworks/base/services/core/java/com/android/server/biometrics
3351 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003352message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003353 // Biometric modality.
3354 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003355 // Type of issue detected.
3356 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003357 // Dictates if this message should trigger additional debugging.
3358 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003359}
Howard Ro688ae182018-09-25 00:09:36 -07003360
joshmccloskey6f952b22019-03-25 20:59:35 -07003361/**
3362 * Logs when a biometric enrollment occurs.
3363 *
3364 * Logged from:
3365 * frameworks/base/services/core/java/com/android/server/biometrics
3366 */
3367message BiometricEnrolled {
3368 // Biometric modality that was used.
3369 optional android.hardware.biometrics.ModalityEnum modality = 1;
3370 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3371 optional int32 user = 2;
3372 // The amount of time the enrollment took in milliseconds.
3373 optional int64 latency_millis = 3;
3374 // Whether or not the enrollment was successful.
3375 optional bool success = 4;
3376}
3377
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003378/*
Tej Singh0d176952019-01-16 19:10:54 -08003379 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003380 */
Tej Singh0d176952019-01-16 19:10:54 -08003381message FlagFlipUpdateOccurred {
3382 // If the event is from a flag config package, specify the package name.
3383 optional string flag_flip_package_name = 1;
3384
3385 // The order id of the package
3386 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003387}
3388
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003389/**
3390 * Potential experiment ids that goes with a train install.
3391 */
3392message TrainExperimentIds {
3393 repeated int64 experiment_id = 1;
3394}
3395
Yangster-macb89807e2018-11-15 21:10:57 -08003396/*
3397 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003398 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003399 */
3400message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003401 // Name of the train.
3402 optional string train_name = 1;
3403 // Version code for a "train" of packages that need to be installed atomically
3404 optional int64 train_version_code = 2;
3405 // After installation of this package, device requires a restart.
3406 optional bool requires_staging = 3;
3407 // Rollback should be enabled for this install.
3408 optional bool rollback_enabled = 4;
3409 // Requires low latency monitoring if possible.
3410 optional bool requires_low_latency_monitor = 5;
3411
Yangster-macb89807e2018-11-15 21:10:57 -08003412 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003413 UNKNOWN = 0;
3414 INSTALL_REQUESTED = 1;
3415 INSTALL_STARTED = 2;
3416 INSTALL_STAGED_NOT_READY = 3;
3417 INSTALL_STAGED_READY = 4;
3418 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003419 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3420 // and INSTALL_FAILURE_COMMIT.
3421 INSTALL_FAILURE = 6 [deprecated = true];
3422 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003423 INSTALL_CANCELLED = 7;
3424 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003425 INSTALLER_ROLLBACK_INITIATED = 9;
3426 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3427 INSTALLER_ROLLBACK_STAGED = 11;
3428 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3429 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3430 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3431 INSTALLER_ROLLBACK_SUCCESS = 15;
3432 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003433 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3434 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3435 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3436 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3437 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3438 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003439 INSTALL_FAILURE_DOWNLOAD = 23;
3440 INSTALL_FAILURE_STATE_MISMATCH = 24;
3441 INSTALL_FAILURE_COMMIT = 25;
Yangster-macb89807e2018-11-15 21:10:57 -08003442 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003443 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003444 // Possible experiment ids for monitoring this push.
3445 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3446 // user id
3447 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003448}
3449
Tej Singhc9203082019-05-03 13:42:23 -07003450/* Test atom, is not logged anywhere */
3451message TestAtomReported {
3452 repeated AttributionNode attribution_node = 1;
3453 optional int32 int_field = 2;
3454 optional int64 long_field = 3;
3455 optional float float_field = 4;
3456 optional string string_field = 5;
3457 optional bool boolean_field = 6;
3458 enum State {
3459 UNKNOWN = 0;
3460 OFF = 1;
3461 ON = 2;
3462 }
3463 optional State state = 7;
3464 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3465}
3466
Maggie Whitefc1aa592018-11-28 21:55:23 -08003467/** Represents USB port overheat event. */
3468message UsbPortOverheatEvent {
3469 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3470 optional int32 plug_temperature_deci_c = 1;
3471
3472 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3473 optional int32 max_temperature_deci_c = 2;
3474
3475 /* Time between USB plug event and overheat threshold trip, in seconds. */
3476 optional int32 time_to_overheat_secs = 3;
3477
3478 /* Time between overheat threshold trip and hysteresis, in seconds. */
3479 optional int32 time_to_hysteresis_secs = 4;
3480
3481 /* Time between hysteresis and active mitigation ending, in seconds. */
3482 optional int32 time_to_inactive_secs = 5;
3483};
3484
Maggie White8735b852019-01-18 11:40:49 -08003485/**
3486 * Logs total effective full charge and discharge cycles on a battery.
3487 * Here are some examples of one effective cycle:
3488 * 1) the battery charges from 0% to 100% and drains back to 0%,
3489 * 2) charging from 50% to 100% and draining back to 50% twice.
3490 * Pulled from:
3491 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3492 */
3493message BatteryCycleCount {
3494 /* Number of total charge and discharge cycles on the system battery. */
3495 optional int32 cycle_count = 1;
3496}
3497
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003498/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003499 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3500 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003501 * Pulled from:
3502 * StatsCompanionService
3503 */
3504
Carmen Agimof12dec122019-03-06 16:14:38 +00003505message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003506
Carmen Agimof12dec122019-03-06 16:14:38 +00003507 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003508 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003509 PUBLIC = 1;
3510 PRIVATE = 2;
3511 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003512 }
3513
Carmen Agimof12dec122019-03-06 16:14:38 +00003514 // The type of external storage.
3515 optional android.stats.storage.ExternalStorageType storage_type = 1;
3516 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3517 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003518 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003519 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003520}
3521
Yangster-macb89807e2018-11-15 21:10:57 -08003522/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003523 * Logs when a connection becomes available and lost.
3524 * Logged in StatsCompanionService.java
3525 */
3526message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003527 // Id of the network.
3528 optional int32 net_id = 1;
3529
3530 enum State {
3531 UNKNOWN = 0;
3532 CONNECTED = 1;
3533 DISCONNECTED = 2;
3534 }
3535 // Connected state of a network.
3536 optional State state = 2;
3537}
3538
3539/**
3540 * Logs when a service starts and stops.
3541 * Logged from:
3542 * services/core/java/com/android/server/am/ActiveServices.java
3543 */
3544message ServiceStateChanged {
3545
3546 optional int32 uid = 1 [(is_uid) = true];
3547
3548 optional string package_name = 2;
3549
3550 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003551
3552 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003553 START = 1;
3554 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003555 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003556
3557 optional State state = 4;
3558}
3559
3560/**
3561 * Logs when a service is launched.
3562 * Logged from:
3563 * services/core/java/com/android/server/am/ActiveServices.java
3564 */
3565message ServiceLaunchReported {
3566
3567 optional int32 uid = 1 [(is_uid) = true];
3568
3569 optional string package_name = 2;
3570
3571 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003572}
Howard Ro688ae182018-09-25 00:09:36 -07003573
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003574/**
3575 * Logs when a hidden API is used.
3576 *
3577 * Logged from:
3578 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3579 */
3580message HiddenApiUsed {
3581 // The uid of the app making the hidden access.
3582 optional int32 uid = 1 [(is_uid) = true];
3583
3584 // Signature of the method or field accessed.
3585 optional string signature = 2;
3586
3587 enum AccessMethod {
3588 NONE = 0;
3589 REFLECTION = 1;
3590 JNI = 2;
3591 LINKING = 3;
3592 }
3593
3594 // Type of access.
3595 optional AccessMethod access_method = 3;
3596
3597 // Whether the access was prevented or not.
3598 optional bool access_denied = 4;
3599}
3600
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003601/**
3602 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3603 * - When user sees privacy chip
3604 * - When user clicks privacy chip
3605 * - How does the user exit the Privacy Dialog
3606 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003607 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3608 */
3609message PrivacyIndicatorsInteracted {
3610
3611 enum Type {
3612 UNKNOWN = 0;
3613 CHIP_VIEWED = 1;
3614 CHIP_CLICKED = 2;
3615 DIALOG_PRIVACY_SETTINGS = 3;
3616 DIALOG_DISMISS = 4;
3617 DIALOG_LINE_ITEM = 5;
3618 }
3619
3620 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3621
3622 // Used if the type is LINE_ITEM
3623 optional string package_name = 2;
3624}
3625
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003626/**
3627 * Logs information about a package that is moved from the internal to external storage and vice
3628 * versa.
3629 * It logs the package name, the type of the external storage where the package is installed
3630 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3631 * and the move type: if it's from internal to external or the other way around.
3632 *
3633 * Logged from:
3634 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3635 */
3636message AppMovedStorageReported {
3637 enum MoveType {
3638 UNKNOWN = 0;
3639 TO_EXTERNAL = 1;
3640 TO_INTERNAL = 2;
3641 }
3642 // The type of the external storage.
3643 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3644 // The type of move.
3645 optional MoveType move_type = 2;
3646 // The name of the package that was moved.
3647 optional string package_name = 3;
3648}
3649
jianjin8f2dee02019-03-29 14:03:08 -07003650/**
3651 * Logs when system server watchdog occurs.
3652 * Logged from:
3653 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3654 */
3655message SystemServerWatchdogOccurred {
3656 optional string subject = 1;
3657}
3658
3659/**
3660 * Logs when new file added to tombstones.
3661 * Logged from:
3662 * frameworks/base/core/java/com/android/server/BootReceiver.java
3663 */
3664message TombStoneOccurred {
3665}
3666
Hai Zhang5d3328d2019-04-13 21:25:06 +08003667/*
3668 * Information about a role request
3669 *
3670 * Logged from:
3671 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3672 */
3673message RoleRequestResultReported {
3674 // UID of application requesting the role
3675 optional int32 requesting_uid = 1;
3676
3677 // Package name of application requesting the role
3678 optional string requesting_package_name = 2;
3679
3680 // The role to be granted
3681 optional string role_name = 3;
3682
3683 // The count of applications qualifying for the role
3684 optional int32 qualifying_count = 4;
3685
3686 // UID of application current granted the role
3687 optional int32 current_uid = 5;
3688
3689 // Package name of application current granted the role
3690 optional string current_package_name = 6;
3691
3692 // UID of another application that user chose to grant the role to, instead of the requesting
3693 // application
3694 optional int32 granted_another_uid = 7;
3695
3696 // Package name of another application that user chose to grant the role to, instead of the
3697 // requesting application
3698 optional string granted_another_package_name = 8;
3699
3700 enum Result {
3701 UNDEFINED = 0;
3702 // role request was ignored
3703 IGNORED = 1;
3704 // role request was ignored because it's already granted
3705 IGNORED_ALREADY_GRANTED = 2;
3706 // role request was ignored because the application isn't qualified
3707 IGNORED_NOT_QUALIFIED = 3;
3708 // role request was ignored because user said it should be always denied
3709 IGNORED_USER_ALWAYS_DENIED = 4;
3710 // role was granted by user action
3711 USER_GRANTED = 5;
3712 // role was denied by user action
3713 USER_DENIED = 6;
3714 // role was denied by user granting another application the role
3715 USER_DENIED_GRANTED_ANOTHER = 7;
3716 // role was denied and set to be always denied by the user
3717 USER_DENIED_WITH_ALWAYS = 8;
3718 }
3719 // The result of the role request
3720 optional Result result = 9;
3721}
3722
Chenjie Yubbcbc602018-02-05 16:51:52 -08003723//////////////////////////////////////////////////////////////////////
3724// Pulled atoms below this line //
3725//////////////////////////////////////////////////////////////////////
3726
3727/**
David Chenc8a43242017-10-17 16:23:28 -07003728 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3729 *
3730 * Pulled from:
3731 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3732 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003733message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003734 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003735
3736 optional int64 rx_bytes = 2;
3737
3738 optional int64 rx_packets = 3;
3739
3740 optional int64 tx_bytes = 4;
3741
3742 optional int64 tx_packets = 5;
3743}
3744
3745/**
3746 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3747 *
3748 * Pulled from:
3749 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3750 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003751message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003752 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003753
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003754 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3755 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003756
3757 optional int64 rx_bytes = 3;
3758
3759 optional int64 rx_packets = 4;
3760
3761 optional int64 tx_bytes = 5;
3762
3763 optional int64 tx_packets = 6;
3764}
3765
3766/**
3767 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3768 *
3769 * Pulled from:
3770 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3771 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003772message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003773 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003774
3775 optional int64 rx_bytes = 2;
3776
3777 optional int64 rx_packets = 3;
3778
3779 optional int64 tx_bytes = 4;
3780
3781 optional int64 tx_packets = 5;
3782}
3783
3784/**
3785 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3786 *
3787 * Pulled from:
3788 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3789 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003790message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003791 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003792
Yao Chenc40a19d2018-03-15 16:48:25 -07003793 // 1 denotes foreground and 0 denotes background. This is called Set in
3794 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003795 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003796
3797 optional int64 rx_bytes = 3;
3798
3799 optional int64 rx_packets = 4;
3800
3801 optional int64 tx_bytes = 5;
3802
3803 optional int64 tx_packets = 6;
3804}
3805
3806/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003807 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3808 *
3809 * Pulled from:
3810 * StatsCompanionService
3811 */
3812message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003813 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003814
3815 optional int64 rx_bytes = 2;
3816
3817 optional int64 tx_bytes = 3;
3818}
3819
3820/**
David Chenc8a43242017-10-17 16:23:28 -07003821 * Pulls the kernel wakelock durations. This atom is adapted from
3822 * android/internal/os/KernelWakelockStats.java
3823 *
3824 * Pulled from:
3825 * StatsCompanionService using KernelWakelockReader.
3826 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003827message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003828 optional string name = 1;
3829
3830 optional int32 count = 2;
3831
3832 optional int32 version = 3;
3833
Yangster-maca8a30442018-10-13 23:46:34 -07003834 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003835}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003836
Chenjie Yu05013b32017-11-21 10:21:41 -08003837/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003838 * Pulls low power state information. If power.stats HAL is not available, this
3839 * includes platform and subsystem sleep state information,
3840 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3841 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003842 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003843 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003844 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3845 * as defined in:
3846 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003847 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003848message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003849 // Subsystem name
3850 optional string subsystem_name = 1;
3851 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3852 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003853 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3854 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003855 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003856 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003857 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003858 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003859 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003860}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003861
Chenjie Yu05013b32017-11-21 10:21:41 -08003862/**
Bookatz92da2832018-11-01 18:10:03 -07003863 * Pulls on-device power measurement information.
3864 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3865 * Pulled from:
3866 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3867 */
3868message OnDevicePowerMeasurement {
3869 // Name of the subsystem (to which the rail belongs).
3870 optional string subsystem_name = 1;
3871
3872 // Rail name. The rail lies within the subsystem.
3873 optional string rail_name = 2;
3874
3875 // Time (in ms since boot) at which the rail energy value was measured.
3876 // This may differ slightly from the time that statsd logs this information.
3877 optional uint64 measurement_timestamp_millis = 3;
3878
3879 // Accumulated energy used via the rail since device boot in uWs.
3880 optional uint64 energy_microwatt_secs = 4;
3881}
3882
3883/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003884 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003885 * Pulls the time the cpu spend on the frequency index. Frequency index
3886 * starts from highest to lowest. The value should be monotonically
3887 * increasing since boot. However, if there is a cpu
3888 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003889 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003890message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003891 optional uint32 cluster = 1;
3892 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003893 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003894}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003895
Chenjie Yu05013b32017-11-21 10:21:41 -08003896/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003897 * Pulls Cpu Time Per Uid.
3898 * Note that isolated process uid time should be attributed to host uids.
3899 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003900message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003901 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003902 optional uint64 user_time_micros = 2;
3903 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003904}
3905
3906/**
3907 * Pulls Cpu Time Per Uid per frequency.
3908 * Note that isolated process uid time should be attributed to host uids.
3909 * For each uid, we order the time by descending frequencies.
3910 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003911message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003912 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003913 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003914 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003915}
Hugo Benichi884970e2017-11-14 22:42:46 +09003916
Chenjie Yu05013b32017-11-21 10:21:41 -08003917/**
3918 * Pulls Wifi Controller Activity Energy Info
3919 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003920message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003921 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003922 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003923 // stack reported state
3924 // TODO: replace this with proto enum
3925 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003926 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003927 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003928 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003929 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003930 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003931 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003932 // product of current(mA), voltage(V) and time(ms)
3933 optional uint64 controller_energy_used = 6;
3934}
3935
3936/**
3937 * Pulls Modem Activity Energy Info
3938 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003939message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003940 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003941 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003942 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003943 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003944 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003945 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003946 /**
3947 * Tx power index
3948 * index 0 = tx_power < 0dBm
3949 * index 1 = 0dBm < tx_power < 5dBm
3950 * index 2 = 5dBm < tx_power < 15dBm
3951 * index 3 = 15dBm < tx_power < 20dBm
3952 * index 4 = tx_power > 20dBm
3953 */
3954 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003955 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003956 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003957 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003958 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003959 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003960 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003961 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003962 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003963 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003964 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003965 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003966 // product of current(mA), voltage(V) and time(ms)
3967 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003968}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003969
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003970/**
3971 * Pulls Bluetooth Activity Energy Info
3972 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3973 */
3974message BluetoothActivityInfo {
3975 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003976 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003977 // bluetooth stack state
3978 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003979 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003980 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003981 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003982 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003983 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003984 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003985 // product of current(mA), voltage(V) and time(ms)
3986 optional uint64 energy_used = 6;
3987}
3988
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003989/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003990 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003991 *
3992 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003993 */
3994message ProcessMemoryState {
3995 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003996 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003997
3998 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003999 // Usually package name, "system" for system server.
4000 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004001 optional string process_name = 2;
4002
Rafal Slawikda51b932018-12-13 16:31:33 +00004003 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004004 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004005
4006 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004007 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004008
4009 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004010 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004011
Rajeev Kumar90235992018-01-29 11:06:48 -08004012 // RSS
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004013 // Value is read from /proc/PID/status. Or from memory.stat, field
Rafal Slawikda51b932018-12-13 16:31:33 +00004014 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08004015 optional int64 rss_in_bytes = 6;
4016
4017 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004018 // Value is read from memory.stat, field total_cache if per-app memory
4019 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004020 optional int64 cache_in_bytes = 7;
4021
4022 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004023 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik44af3b32019-04-16 13:16:15 +01004024 // cgroups are enabled. Otherwise, VmSwap from /proc/PID/status.
Rajeev Kumar90235992018-01-29 11:06:48 -08004025 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004026
Rafal Slawikd03ae422018-11-20 11:27:45 +00004027 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004028 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004029
4030 // Elapsed real time when the process started.
4031 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
4032 optional int64 start_time_nanos = 10;
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004033
4034 // Anonymous page size plus swap size. Values are read from /proc/PID/status.
4035 optional int32 anon_rss_and_swap_in_kilobytes = 11;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004036}
4037
4038/*
Rafal Slawik08621582018-10-15 14:53:07 +01004039 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00004040 *
4041 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01004042 */
4043message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01004044 // The uid if available. -1 means not available.
4045 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004046
Rafal Slawikbf67d072018-10-23 11:07:54 +01004047 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004048 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01004049 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01004050
Rafal Slawikbf67d072018-10-23 11:07:54 +01004051 // # of page-faults
4052 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01004053
Rafal Slawikbf67d072018-10-23 11:07:54 +01004054 // # of major page-faults
4055 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01004056
Rafal Slawikbf67d072018-10-23 11:07:54 +01004057 // RSS
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004058 // Value read from /proc/PID/status.
Rafal Slawikbf67d072018-10-23 11:07:54 +01004059 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01004060
Rafal Slawikd03ae422018-11-20 11:27:45 +00004061 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004062 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01004063
4064 // Elapsed real time when the process started.
4065 // Value is read from /proc/PID/stat, field 22.
4066 optional int64 start_time_nanos = 7;
Rafal Slawik44af3b32019-04-16 13:16:15 +01004067
4068 // SWAP
4069 // Value read from /proc/PID/status, field VmSwap.
4070 optional int64 swap_in_bytes = 8;
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004071
4072 // Anonymous page size plus swap size. Values are read from /proc/PID/status.
4073 optional int32 anon_rss_and_swap_in_kilobytes = 9;
Rafal Slawik08621582018-10-15 14:53:07 +01004074}
4075
4076/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004077 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004078 *
4079 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4080 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004081 *
4082 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004083 */
4084message ProcessMemoryHighWaterMark {
4085 // The uid if available. -1 means not available.
4086 optional int32 uid = 1 [(is_uid) = true];
4087
Rafal Slawikda51b932018-12-13 16:31:33 +00004088 // The process name.
4089 // Usually package name or process cmdline.
4090 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004091 optional string process_name = 2;
4092
4093 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4094 // /proc/PID/status.
4095 optional int64 rss_high_water_mark_in_bytes = 3;
4096}
4097
4098/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004099 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004100 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004101message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004102 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004103}
4104
4105/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004106 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004107 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004108message SystemUptime {
4109 // Milliseconds since the system was booted.
4110 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4111 // for external input).
4112 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004113 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004114}
4115
4116/*
4117 * Reads from /proc/uid_concurrent_active_time which has the format:
4118 * active: X (X is # cores)
4119 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4120 * [uid1]: [time-0] [time-1] [time-2] ... ...
4121 * ...
4122 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4123 * The file contains a monotonically increasing count of time for a single boot.
4124 */
4125message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004126 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004127 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004128}
4129
4130/**
4131 * Reads from /proc/uid_concurrent_policy_time which has the format:
4132 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4133 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4134 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4135 * ...
4136 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4137 * The file contains a monotonically increasing count of time for a single boot.
4138 */
4139message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004140 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004141 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004142 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004143}
4144
4145/*
4146 * Pulls free disk space, for data, system partition and temporary directory.
4147 */
4148message DiskSpace {
4149 // available bytes in data partition
4150 optional uint64 data_available_bytes = 1;
4151 // available bytes in system partition
4152 optional uint64 system_available_bytes = 2;
4153 // available bytes in download cache or temp directories
4154 optional uint64 temp_available_bytes = 3;
4155}
Tej Singhbf972d92018-01-10 20:51:13 -08004156
4157/**
4158 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004159 *
4160 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004161 */
4162message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004163 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004164}
4165
4166/**
4167 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004168 * Pulled from:
4169 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004170 */
4171message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004172 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004173}
4174
4175/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004176 * Pulls battery voltage.
4177 * Pulled from:
4178 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4179 */
4180message BatteryVoltage {
4181 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004182 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004183}
4184
4185/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004186 * Pulls battery level (percent full, from 0 to 100).
4187 *
4188 * Pulled from:
4189 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4190 */
4191message BatteryLevel {
4192 // Battery level. Should be in [0, 100].
4193 optional int32 battery_level = 1;
4194}
4195
4196/**
Tej Singhd89137e2018-03-26 14:51:40 -07004197 * Pulls the temperature of various parts of the device.
4198 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004199 *
Maggie White442b6312019-04-05 16:26:44 -07004200 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004201 */
4202message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004203 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004204 optional android.os.TemperatureTypeEnum sensor_location = 1;
4205
4206 // The name of the temperature source. Eg. CPU0
4207 optional string sensor_name = 2;
4208
Tej Singhd89137e2018-03-26 14:51:40 -07004209 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004210 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004211 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004212
4213 // Relative severity of the throttling, see enum definition.
4214 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004215}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004216
4217/**
4218 * Pulls the statistics of calls to Binder.
4219 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004220 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4221 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004222 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004223 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004224 */
4225message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004226 // UID of the process responsible for the binder transaction. It will be set if the process
4227 // executing the binder transaction attribute the transaction to another uid using
4228 // Binder.setThreadWorkSource().
4229 //
4230 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004231 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004232 // UID of the process executing the binder transaction.
4233 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004234 // Fully qualified class name of the API call.
4235 //
4236 // This is a system server class name.
4237 //
4238 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4239 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4240 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4241 // commonly used APIs.
4242 optional string service_class_name = 2;
4243 // Method name of the API call. It can also be a transaction code if we cannot
4244 // resolve it to a name. See Binder#getTransactionName.
4245 //
4246 // This is a system server method name.
4247 optional string service_method_name = 3;
4248 // Total number of API calls.
4249 optional int64 call_count = 4;
4250 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4251 optional bool screen_interactive = 13;
4252 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4253 // call_count will be equal to recorded_call_count.
4254 //
4255 // If recorded_call_count is different than call_count, it means data collection has been
4256 // sampled. All the fields below will be sampled in this case.
4257 optional int64 recorded_call_count = 12;
4258 // Number of exceptions thrown by the API.
4259 optional int64 recorded_exception_count = 5;
4260 // Total latency of all API calls.
4261 // Average can be computed using total_latency_micros / recorded_call_count.
4262 optional int64 recorded_total_latency_micros = 6;
4263 // Maximum latency of one API call.
4264 optional int64 recorded_max_latency_micros = 7;
4265 // Total CPU usage of all API calls.
4266 // Average can be computed using total_cpu_micros / recorded_call_count.
4267 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4268 optional int64 recorded_total_cpu_micros = 8;
4269 // Maximum CPU usage of one API call.
4270 optional int64 recorded_max_cpu_micros = 9;
4271 // Maximum parcel reply size of one API call.
4272 optional int64 recorded_max_reply_size_bytes = 10;
4273 // Maximum parcel request size of one API call.
4274 optional int64 recorded_max_request_size_bytes = 11;
4275}
4276
4277/**
4278 * Pulls the statistics of exceptions during calls to Binder.
4279 *
4280 * Binder stats are cumulative from boot unless somebody reset the data using
4281 * > adb shell dumpsys binder_calls_stats --reset
4282 */
4283message BinderCallsExceptions {
4284 // Exception class name, e.g. java.lang.IllegalArgumentException.
4285 //
4286 // This is an exception class name thrown by the system server.
4287 optional string exception_class_name = 1;
4288 // Total number of exceptions.
4289 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004290}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004291
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004292/**
4293 * Pulls the statistics of message dispatching on HandlerThreads.
4294 *
4295 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4296 * config on the device.
4297 *
4298 * Next tag: 11
4299 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004300message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004301 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004302 optional int32 uid = 1 [(is_uid) = true];
4303
4304 // Fully qualified class name of the handler target class.
4305 //
4306 // This field does not contain PII. This is a system server class name.
4307 optional string handler_class_name = 2;
4308
4309 // The name of the thread that runs the Looper.
4310 //
4311 // This field does not contain PII. This is a system server thread name.
4312 optional string looper_thread_name = 3;
4313
4314 // The name of the dispatched message.
4315 //
4316 // This field does not contain PII. This is a system server constant or class
4317 // name.
4318 optional string message_name = 4;
4319
4320 // Total number of successfully dispatched messages.
4321 optional int64 message_count = 5;
4322
4323 // Total number of messages that failed dispatching.
4324 optional int64 exception_count = 6;
4325
4326 // Total number of processed messages we have data recorded for. If we
4327 // collected data for all the messages, message_count will be equal to
4328 // recorded_message_count.
4329 //
4330 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004331 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004332 optional int64 recorded_message_count = 7;
4333
4334 // Total latency of all processed messages.
4335 // Average can be computed using recorded_total_latency_micros /
4336 // recorded_message_count.
4337 optional int64 recorded_total_latency_micros = 8;
4338
4339 // Total CPU usage of all processed message.
4340 // Average can be computed using recorded_total_cpu_micros /
4341 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004342 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004343 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004344
4345 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4346 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004347
4348 // Max recorded CPU usage of all processed messages.
4349 optional int64 recorded_max_cpu_micros = 11;
4350
4351 // Max recorded latency of all processed messages.
4352 optional int64 recorded_max_latency_micros = 12;
4353
4354 // Total number of messages we tracked the dispatching delay for. If we
4355 // collected data for all the messages, message_count will be equal to
4356 // recorded_delay_message_count.
4357 //
4358 // If recorded_delay_message_count is different than message_count, it means data
4359 // collection has been sampled or/and not all messages specified the target dispatch time.
4360 // The fields below will be sampled in this case.
4361 optional int64 recorded_delay_message_count = 13;
4362
4363 // Total dispatching delay of all processed messages.
4364 // Calculated as a difference between the target dispatching time (Message.when)
4365 // and the actual dispatching time.
4366 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4367 optional int64 recorded_total_delay_millis = 14;
4368
4369 // Max dispatching delay of all processed messages.
4370 // Calculated as a difference between the target dispatching time (Message.when)
4371 // and the actual dispatching time.
4372 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004373}
Tej Singh86dc9db2018-09-06 00:39:57 +00004374
4375/**
4376 * Pulls disk information, such as write speed and latency.
4377 */
4378message DiskStats {
4379 // Time taken to open, write 512B to, and close a file.
4380 // -1 if error performing the check.
4381 optional int64 data_write_latency_millis = 1;
4382
4383 optional bool file_based_encryption = 2;
4384
4385 // Recent disk write speed in kB/s.
4386 // -1 if error querying storageed.
4387 // 0 if data is unavailable.
4388 optional int32 recent_disk_write_speed = 3;
4389}
4390
4391
4392/**
4393 * Free and total bytes of the Data, Cache, and System partition.
4394 */
4395message DirectoryUsage {
4396 enum Directory {
4397 UNKNOWN = 0;
4398 DATA = 1;
4399 CACHE = 2;
4400 SYSTEM = 3;
4401 }
4402 optional Directory directory = 1;
4403 optional int64 free_bytes = 2;
4404 optional int64 total_bytes = 3;
4405}
4406
4407
4408/**
4409 * Size of an application: apk size, data size, and cache size.
4410 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4411 * Information is only reported for apps with the primary user (user 0).
4412 * Sizes are aggregated by package name.
4413 */
4414message AppSize {
4415 // Including uids will involve modifying diskstats logic.
4416 optional string package_name = 1;
4417 // App size in bytes. -1 if unavailable.
4418 optional int64 app_size_bytes = 2;
4419 // App data size in bytes. -1 if unavailable.
4420 optional int64 app_data_size_bytes = 3;
4421 // App cache size in bytes. -1 if unavailable.
4422 optional int64 app_cache_size_bytes = 4;
4423 // Time that the cache file was produced.
4424 // Uses System.currentTimeMillis(), which is wall clock time.
4425 optional int64 cache_time_millis = 5;
4426}
4427
4428
4429/**
4430 * Size of a particular category. Eg: photos, videos.
4431 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4432 */
4433message CategorySize {
4434 enum Category {
4435 UNKNOWN = 0;
4436 APP_SIZE = 1;
4437 APP_DATA_SIZE = 2;
4438 APP_CACHE_SIZE = 3;
4439 PHOTOS = 4;
4440 VIDEOS = 5;
4441 AUDIO = 6;
4442 DOWNLOADS = 7;
4443 SYSTEM = 8;
4444 OTHER = 9;
4445 }
4446 optional Category category = 1;
4447 // Category size in bytes.
4448 optional int64 size_bytes = 2;
4449 // Time that the cache file was produced.
4450 // Uses System.currentTimeMillis(), which is wall clock time.
4451 optional int64 cache_time_millis = 3;
4452}
Tej Singhd6d6d772018-09-05 17:41:25 -07004453
4454/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004455 * Pulls per uid I/O stats. The stats are cumulative since boot.
4456 *
4457 * Read/write bytes are I/O events from a storage device
4458 * Read/write chars are data requested by read/write syscalls, and can be
4459 * satisfied by caching.
4460 *
4461 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4462 */
4463message DiskIo {
4464 optional int32 uid = 1 [(is_uid) = true];
4465 optional int64 fg_chars_read = 2;
4466 optional int64 fg_chars_write = 3;
4467 optional int64 fg_bytes_read = 4;
4468 optional int64 fg_bytes_write = 5;
4469 optional int64 bg_chars_read = 6;
4470 optional int64 bg_chars_write = 7;
4471 optional int64 bg_bytes_read = 8;
4472 optional int64 bg_bytes_write = 9;
4473 optional int64 fg_fsync = 10;
4474 optional int64 bg_fsync= 11;
4475}
4476
4477
4478/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004479 * Pulls the number of fingerprints for each user.
4480 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004481 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004482 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004483message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004484 // The associated user. Eg: 0 for owners, 10+ for others.
4485 // Defined in android/os/UserHandle.java
4486 optional int32 user = 1;
4487 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004488 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004489}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004490
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004491/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004492 * Pulls the number of faces for each user.
4493 *
4494 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4495 */
4496message NumFacesEnrolled {
4497 // The associated user. Eg: 0 for owners, 10+ for others.
4498 // Defined in android/os/UserHandle.java
4499 optional int32 user = 1;
4500 // Number of faces registered to that user.
4501 optional int32 num_faces_enrolled = 2;
4502}
4503/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004504 * A mapping of role holder -> role
4505 */
4506message RoleHolder {
4507 // uid of the role holder
4508 optional int32 uid = 1 [(is_uid) = true];
4509
4510 // package name of the role holder
4511 optional string package_name = 2;
4512
4513 // the role held
4514 optional string role = 3;
4515}
4516
Yangsteraf9aee72018-10-12 09:26:16 -07004517message AggStats {
4518 optional int64 min = 1;
4519
4520 optional int64 average = 2;
4521
4522 optional int64 max = 3;
4523}
4524
4525message ProcessStatsStateProto {
4526 optional android.service.procstats.ScreenState screen_state = 1;
4527
4528 optional android.service.procstats.MemoryState memory_state = 2;
4529
4530 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4531 // and not frameworks/base/core/java/android/app/ActivityManager.java
4532 optional android.service.procstats.ProcessState process_state = 3;
4533
4534 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004535 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004536
4537 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004538 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004539
4540 // # of samples taken
4541 optional int32 sample_size = 5;
4542
4543 // PSS is memory reserved for this process
4544 optional AggStats pss = 6;
4545
4546 // USS is memory shared between processes, divided evenly for accounting
4547 optional AggStats uss = 7;
4548
4549 // RSS is memory resident for this process
4550 optional AggStats rss = 8;
4551}
4552
4553// Next Tag: 7
4554message ProcessStatsProto {
4555 // Name of process.
4556 optional string process = 1;
4557
4558 // Uid of the process.
4559 optional int32 uid = 2;
4560
4561 // Information about how often kills occurred
4562 message Kill {
4563 // Count of excessive CPU kills
4564 optional int32 cpu = 1;
4565
4566 // Count of kills when cached
4567 optional int32 cached = 2;
4568
4569 // PSS stats during cached kill
4570 optional AggStats cached_pss = 3;
4571 }
4572 optional Kill kill = 3;
4573
4574 // Time and memory spent in various states.
4575 repeated ProcessStatsStateProto states = 5;
4576
4577 // Total time process has been running... screen_state, memory_state, and process_state
4578 // will not be set.
4579 optional ProcessStatsStateProto total_running_state = 6;
4580}
4581
4582message PackageServiceOperationStatsProto {
4583 // Operate enum: Started, Foreground, Bound, Executing
4584 optional android.service.procstats.ServiceOperationState operation = 1;
4585
4586 // Number of times the service was in this operation.
4587 optional int32 count = 2;
4588
4589 // Information about a state the service can be in.
4590 message StateStats {
4591 // Screen state enum.
4592 optional android.service.procstats.ScreenState screen_state = 1;
4593 // Memory state enum.
4594 optional android.service.procstats.MemoryState memory_state = 2;
4595
4596 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004597 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004598 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004599 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004600 }
4601 repeated StateStats state_stats = 3;
4602}
4603
4604message PackageServiceStatsProto {
4605 // Name of service component.
4606 optional string service_name = 1;
4607
4608 // The operation stats.
4609 // The package_name, package_uid, package_version, service_name will not be set to save space.
4610 repeated PackageServiceOperationStatsProto operation_stats = 2;
4611}
4612
4613message PackageAssociationSourceProcessStatsProto {
4614 // Uid of the process.
4615 optional int32 process_uid = 1;
4616 // Process name.
4617 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004618 // Package name.
4619 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004620 // Total count of the times this association appeared.
4621 optional int32 total_count = 3;
4622
4623 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004624 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004625
4626 // Total count of the times this association became actively impacting its target process.
4627 optional int32 active_count = 5;
4628
4629 // Information on one source in this association.
4630 message StateStats {
4631 // Process state enum.
4632 optional android.service.procstats.ProcessState process_state = 1;
4633 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004634 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004635 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004636 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004637 }
4638 repeated StateStats active_state_stats = 6;
4639}
4640
4641message PackageAssociationProcessStatsProto {
4642 // Name of the target component.
4643 optional string component_name = 1;
4644 // Information on one source in this association.
4645 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4646}
4647
4648
4649message ProcessStatsPackageProto {
4650 // Name of package.
4651 optional string package = 1;
4652
4653 // Uid of the package.
4654 optional int32 uid = 2;
4655
4656 // Version of the package.
4657 optional int64 version = 3;
4658
4659 // Stats for each process running with the package loaded in to it.
4660 repeated ProcessStatsProto process_stats = 4;
4661
4662 // Stats for each of the package's services.
4663 repeated PackageServiceStatsProto service_stats = 5;
4664
4665 // Stats for each association with the package.
4666 repeated PackageAssociationProcessStatsProto association_stats = 6;
4667}
4668
4669message ProcessStatsSectionProto {
4670 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004671 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004672
4673 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004674 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004675
4676 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004677 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004678
4679 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004680 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004681
4682 // System runtime library. e.g. "libdvm.so", "libart.so".
4683 optional string runtime = 5;
4684
4685 // whether kernel reports swapped pss.
4686 optional bool has_swapped_pss = 6;
4687
4688 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4689 enum Status {
4690 STATUS_UNKNOWN = 0;
4691 STATUS_COMPLETE = 1;
4692 STATUS_PARTIAL = 2;
4693 STATUS_SHUTDOWN = 3;
4694 STATUS_SYSPROPS = 4;
4695 }
4696 repeated Status status = 7;
4697
Chenjie Yub2ecc792019-01-17 10:27:26 -08004698 // Number of pages available of various types and sizes, representation fragmentation.
4699 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4700
Yangsteraf9aee72018-10-12 09:26:16 -07004701 // Stats for each process.
4702 repeated ProcessStatsProto process_stats = 8;
4703
4704 // Stats for each package.
4705 repeated ProcessStatsPackageProto package_stats = 9;
4706}
4707
Chenjie Yub2ecc792019-01-17 10:27:26 -08004708message ProcessStatsAvailablePagesProto {
4709 // Node these pages are in (as per /proc/pagetypeinfo)
4710 optional int32 node = 1;
4711
4712 // Zone these pages are in (as per /proc/pagetypeinfo)
4713 optional string zone = 2;
4714
4715 // Label for the type of these pages (as per /proc/pagetypeinfo)
4716 optional string label = 3;
4717
4718 // Distribution of number of pages available by order size. First entry in array is
4719 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4720 repeated int32 pages_per_order = 4;
4721}
4722
Chenjie Yu12e5e672018-09-14 15:54:59 -07004723/**
4724 * Pulled from ProcessStatsService.java
4725 */
4726message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004727 optional ProcessStatsSectionProto proc_stats_section = 1;
4728}
4729
Chenjie Yuf910b7802019-01-11 16:08:20 -08004730/**
4731 * Pulled from ProcessStatsService.java
4732 */
4733message ProcStatsPkgProc {
4734 optional ProcessStatsSectionProto proc_stats_section = 1;
4735}
4736
Yangsteraf9aee72018-10-12 09:26:16 -07004737message PowerProfileProto {
4738 optional double cpu_suspend = 1;
4739
4740 optional double cpu_idle = 2;
4741
4742 optional double cpu_active = 3;
4743
4744 message CpuCluster {
4745 optional int32 id = 1;
4746 optional double cluster_power = 2;
4747 optional int32 cores = 3;
4748 repeated int64 speed = 4;
4749 repeated double core_power = 5;
4750 }
4751
4752 repeated CpuCluster cpu_cluster = 40;
4753
4754 optional double wifi_scan = 4;
4755
4756 optional double wifi_on = 5;
4757
4758 optional double wifi_active = 6;
4759
4760 optional double wifi_controller_idle = 7;
4761
4762 optional double wifi_controller_rx = 8;
4763
4764 optional double wifi_controller_tx = 9;
4765
4766 repeated double wifi_controller_tx_levels = 10;
4767
4768 optional double wifi_controller_operating_voltage = 11;
4769
4770 optional double bluetooth_controller_idle = 12;
4771
4772 optional double bluetooth_controller_rx = 13;
4773
4774 optional double bluetooth_controller_tx = 14;
4775
4776 optional double bluetooth_controller_operating_voltage = 15;
4777
4778 optional double modem_controller_sleep = 16;
4779
4780 optional double modem_controller_idle = 17;
4781
4782 optional double modem_controller_rx = 18;
4783
4784 repeated double modem_controller_tx = 19;
4785
4786 optional double modem_controller_operating_voltage = 20;
4787
4788 optional double gps_on = 21;
4789
4790 repeated double gps_signal_quality_based = 22;
4791
4792 optional double gps_operating_voltage = 23;
4793
4794 optional double bluetooth_on = 24;
4795
4796 optional double bluetooth_active = 25;
4797
4798 optional double bluetooth_at_cmd = 26;
4799
4800 optional double ambient_display = 27;
4801
4802 optional double screen_on = 28;
4803
4804 optional double radio_on = 29;
4805
4806 optional double radio_scanning = 30;
4807
4808 optional double radio_active = 31;
4809
4810 optional double screen_full = 32;
4811
4812 optional double audio = 33;
4813
4814 optional double video = 34;
4815
4816 optional double flashlight = 35;
4817
4818 optional double memory = 36;
4819
4820 optional double camera = 37;
4821
4822 optional double wifi_batched_scan = 38;
4823
4824 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004825}
Chenjie Yuab530202018-09-26 12:39:20 -07004826
4827/**
4828 * power_profile.xml and other constants for power model calculations.
4829 * Pulled from PowerProfile.java
4830 */
4831message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004832 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004833}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004834
4835/**
arangelovd5db50e2018-10-12 20:24:39 +01004836 * Logs when a user restriction was added or removed.
4837 *
4838 * Logged from:
4839 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4840 */
4841message UserRestrictionChanged {
4842 // The raw string of the user restriction as defined in UserManager.
4843 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4844 optional string restriction = 1;
4845 // Whether the restriction is enabled or disabled.
4846 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004847}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004848
4849/**
4850 * Pulls process user time and system time. Puller takes a snapshot of all pids
4851 * in the system and returns cpu stats for those that are working at the time.
4852 * Dead pids will be dropped. Kernel processes are excluded.
4853 * Min cool-down is 5 sec.
4854 */
4855message ProcessCpuTime {
4856 optional int32 uid = 1 [(is_uid) = true];
4857
4858 optional string process_name = 2;
4859 // Process cpu time in user space, cumulative from boot/process start
4860 optional int64 user_time_millis = 3;
4861 // Process cpu time in system space, cumulative from boot/process start
4862 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004863}
Misha Wagner5a51e002018-10-03 15:04:09 +01004864
4865/**
4866 * Pulls the CPU usage for each thread.
4867 *
4868 * Read from /proc/$PID/task/$TID/time_in_state files.
4869 *
4870 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4871 * time_in_state files not being present on some phones, have not been addressed. These should be
4872 * considered before a public release.
4873 */
4874message CpuTimePerThreadFreq {
4875 // UID that owns the process.
4876 optional int32 uid = 1 [(is_uid) = true];
4877 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004878 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004879 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004880 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004881 // Name of the process taken from `/proc/$PID/cmdline`.
4882 optional string process_name = 4;
4883 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4884 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004885
4886 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4887 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4888 // frequencies are given here as the alternative is sending eight separate atoms. This method
4889 // significantly reduces the amount of data created
4890 optional int32 frequency1_khz = 6;
4891 optional int32 time1_millis = 7;
4892 optional int32 frequency2_khz = 8;
4893 optional int32 time2_millis = 9;
4894 optional int32 frequency3_khz = 10;
4895 optional int32 time3_millis = 11;
4896 optional int32 frequency4_khz = 12;
4897 optional int32 time4_millis = 13;
4898 optional int32 frequency5_khz = 14;
4899 optional int32 time5_millis = 15;
4900 optional int32 frequency6_khz = 16;
4901 optional int32 time6_millis = 17;
4902 optional int32 frequency7_khz = 18;
4903 optional int32 time7_millis = 19;
4904 optional int32 frequency8_khz = 20;
4905 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004906}
Bookatz75ee60422018-11-09 12:27:37 -08004907
4908/**
Bookatz366a4432018-11-20 09:42:33 -08004909 * Pulls information about the device's build.
4910 */
4911message BuildInformation {
4912 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4913 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4914 optional string fingerprint = 1;
4915
4916 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4917 optional string brand = 2;
4918
4919 // Build.PRODUCT. The name of the overall product.
4920 optional string product = 3;
4921
4922 // Build.DEVICE. The name of the industrial design.
4923 optional string device = 4;
4924
4925 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4926 optional string version_release = 5;
4927
4928 // Build.ID. E.g. a label like "M4-rc20".
4929 optional string id = 6;
4930
4931 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4932 // represent this build.
4933 optional string version_incremental = 7;
4934
4935 // Build.TYPE. The type of build, like "user" or "eng".
4936 optional string type = 8;
4937
4938 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4939 optional string tags = 9;
4940}
4941
4942/**
Adam He420947c2019-01-23 15:59:09 -08004943 * Logs information about mismatched caller for content capture.
4944 *
4945 * Logged from:
4946 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
4947 */
4948message ContentCaptureCallerMismatchReported {
4949 optional string intended_package = 1;
4950 optional string calling_package = 2;
4951}
4952
4953/**
4954 * Logs information about content capture service events.
4955 *
4956 * Logged from:
4957 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4958 */
4959message ContentCaptureServiceEvents {
4960 // The type of event.
4961 enum Event {
4962 UNKNOWN = 0;
4963 ON_CONNECTED = 1;
4964 ON_DISCONNECTED = 2;
4965 SET_WHITELIST = 3;
4966 SET_DISABLED = 4;
4967 ON_USER_DATA_REMOVED = 5;
4968 }
4969 optional Event event = 1;
4970 // component/package of content capture service.
4971 optional string service_info = 2;
4972 // component/package of target.
4973 // it's a concatenated list of component/package for SET_WHITELIST event
4974 // separated by " ".
4975 optional string target_info = 3;
4976}
4977
4978/**
4979 * Logs information about content capture session events.
4980 *
4981 * Logged from:
4982 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4983 */
4984message ContentCaptureSessionEvents {
4985 // The type of event.
4986 enum Event {
4987 UNKNOWN = 0;
4988 ON_SESSION_STARTED = 1;
4989 ON_SESSION_FINISHED = 2;
4990 SESSION_NOT_CREATED = 3;
4991 }
4992 optional int32 session_id = 1;
4993 optional Event event = 2;
4994 // (n/a on session finished)
4995 optional int32 state_flags = 3;
4996 // component/package of content capture service.
4997 optional string service_info = 4;
4998 // component/package of app.
4999 // (n/a on session finished)
5000 optional string app_info = 5;
5001 optional bool is_child_session = 6;
5002}
5003
5004/**
5005 * Logs information about session being flushed.
5006 *
5007 * Logged from:
5008 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5009 */
5010message ContentCaptureFlushed {
5011 optional int32 session_id = 1;
5012 // component/package of content capture service.
5013 optional string service_info = 2;
5014 // component/package of app.
5015 optional string app_info = 3;
5016 // session start/finish events
5017 optional int32 child_session_started = 4;
5018 optional int32 child_session_finished = 5;
5019 // count of view events.
5020 optional int32 view_appeared_count = 6;
5021 optional int32 view_disappeared_count = 7;
5022 optional int32 view_text_changed_count = 8;
5023
5024 // Flush stats.
5025 optional int32 max_events = 9;
5026 optional int32 idle_flush_freq = 10;
5027 optional int32 text_flush_freq = 11;
5028 optional int32 flush_reason = 12;
5029}
5030
5031/**
Bookatz75ee60422018-11-09 12:27:37 -08005032 * Pulls on-device BatteryStats power use calculations for the overall device.
5033 */
5034message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005035 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5036 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5037 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5038 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005039}
5040
5041/**
5042 * Pulls on-device BatteryStats power use calculations broken down by uid.
5043 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5044 * that is attributed to non-uid items. They must all be included to get the total power use.
5045 */
5046message DeviceCalculatedPowerBlameUid {
5047 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5048 optional int32 uid = 1 [(is_uid) = true];
5049
Bookatz3dbc13a2018-12-21 12:16:51 -08005050 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5051 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5052 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005053}
5054
5055/**
5056 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5057 * drain type.
5058 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5059 * is attributed uids. They must all be included to get the total power use.
5060 */
5061message DeviceCalculatedPowerBlameOther {
5062 // The type of item whose power use is being reported.
5063 enum DrainType {
5064 AMBIENT_DISPLAY = 0;
5065 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5066 BLUETOOTH = 2;
5067 CAMERA = 3;
5068 // Cell-standby
5069 CELL = 4;
5070 FLASHLIGHT = 5;
5071 IDLE = 6;
5072 MEMORY = 7;
5073 // Amount that total computed drain exceeded the drain estimated using the
5074 // battery level changes and capacity.
5075 OVERCOUNTED = 8;
5076 PHONE = 9;
5077 SCREEN = 10;
5078 // Amount that total computed drain was below the drain estimated using the
5079 // battery level changes and capacity.
5080 UNACCOUNTED = 11;
5081 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5082 WIFI = 13;
5083 }
5084 optional DrainType drain_type = 1;
5085
Bookatz3dbc13a2018-12-21 12:16:51 -08005086 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5087 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5088 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005089}
arangelov4e994062018-11-13 16:12:38 +00005090
5091/**
5092 * Logs device policy features.
5093 *
5094 * Logged from:
5095 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5096 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5097 */
5098message DevicePolicyEvent {
5099 // The event id - unique for each event.
5100 optional android.stats.devicepolicy.EventId event_id = 1;
5101 // The admin package name.
5102 optional string admin_package_name = 2;
5103 // A generic integer parameter.
5104 optional int32 integer_value = 3;
5105 // A generic boolean parameter.
5106 optional bool boolean_value = 4;
5107 // A parameter specifying a time period in milliseconds.
5108 optional uint64 time_period_millis = 5;
5109 // A parameter specifying a list of package names, bundle extras or string parameters.
5110 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5111}
shawnlinea5b66b2018-11-13 15:05:29 +08005112
5113/**
5114 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5115 *
5116 * Logged from:
5117 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5118 */
5119message DocsUILaunchReported {
5120 optional android.stats.docsui.LaunchAction launch_action = 1;
5121 optional bool has_initial_uri = 2;
5122 optional android.stats.docsui.MimeType mime_type = 3;
5123 optional android.stats.docsui.Root initial_root = 4;
5124}
5125
5126/**
5127 * Logs root/app visited event in file managers/picker. Call this when the user
5128 * taps on root/app in hamburger menu.
5129 *
5130 * Logged from:
5131 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5132 */
5133message DocsUIRootVisitedReported {
5134 optional android.stats.docsui.ContextScope scope = 1;
5135 optional android.stats.docsui.Root root = 2;
5136}
5137
5138/**
5139 * Logs file operation stats. Call this when a file operation has completed.
5140 *
5141 * Logged from:
5142 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5143 */
5144message DocsUIFileOperationReported {
5145 optional android.stats.docsui.Provider provider = 1;
5146 optional android.stats.docsui.FileOperation file_op = 2;
5147}
5148
5149/**
5150 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5151 * mode.
5152 *
5153 * Logged from:
5154 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5155 */
5156message DocsUIFileOperationCopyMoveModeReported {
5157 optional android.stats.docsui.FileOperation file_op = 1;
5158 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5159}
5160
5161
5162/**
5163 * Logs file sub operation stats. Call this when a file operation has failed.
5164 *
5165 * Logged from:
5166 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5167 */
5168message DocsUIFileOperationFailureReported {
5169 optional android.stats.docsui.Authority authority = 1;
5170 optional android.stats.docsui.SubFileOperation sub_op = 2;
5171}
5172
5173/**
5174* Logs the cancellation of a file operation. Call this when a job is canceled
5175*
5176* Logged from:
5177* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5178*/
5179message DocsUIFileOperationCanceledReported {
5180 optional android.stats.docsui.FileOperation file_op = 1;
5181}
5182
5183/**
5184 * Logs startup time in milliseconds.
5185 *
5186 * Logged from:
5187 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5188 */
5189message DocsUIStartupMsReported {
5190 optional int32 startup_millis = 1;
5191}
5192
5193/**
5194 * Logs the action that was started by user.
5195 *
5196 * Logged from:
5197 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5198 */
5199message DocsUIUserActionReported {
5200 optional android.stats.docsui.UserAction action = 1;
5201}
5202
5203/**
5204 * Logs the invalid type when invalid scoped access is requested.
5205 *
5206 * Logged from:
5207 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5208 */
5209message DocsUIInvalidScopedAccessRequestReported {
5210 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005211}
Ben Murdochbab399f62018-12-06 11:01:38 +00005212
5213/**
shawnlina75e82d2019-01-07 10:31:12 +08005214 * Logs the package name that launches docsui picker mode.
5215 *
5216 * Logged from:
5217 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5218 */
5219message DocsUIPickerLaunchedFromReported {
5220 optional string package_name = 1;
5221}
5222
5223/**
5224 * Logs the search type.
5225 *
5226 * Logged from:
5227 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5228 */
5229message DocsUISearchTypeReported {
5230 optional android.stats.docsui.SearchType search_type = 1;
5231}
5232
5233/**
5234 * Logs the search mode.
5235 *
5236 * Logged from:
5237 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5238 */
5239message DocsUISearchModeReported {
5240 optional android.stats.docsui.SearchMode search_mode = 1;
5241}
5242
5243/**
5244 * Logs the pick result information.
5245 *
5246 * Logged from:
5247 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5248 */
5249message DocsUIPickResultReported {
5250 optional int32 total_action_count = 1;
5251 optional int64 duration_millis = 2;
5252 optional int32 file_count= 3;
5253 optional bool is_searching = 4;
5254 optional android.stats.docsui.Root picked_from = 5;
5255 optional android.stats.docsui.MimeType mime_type = 6;
5256 optional int32 repeatedly_pick_times = 7;
5257}
5258
5259/**
Ben Murdochbab399f62018-12-06 11:01:38 +00005260 * Logs when an app's memory is compacted.
5261 *
5262 * Logged from:
5263 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5264 */
5265message AppCompacted {
5266 // The pid of the process being compacted.
5267 optional int32 pid = 1;
5268
5269 // The name of the process being compacted.
5270 optional string process_name = 2;
5271
5272 // The type of compaction.
5273 enum Action {
5274 UNKNOWN = 0;
5275 SOME = 1;
5276 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005277 PERSISTENT = 3;
5278 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00005279 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005280 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00005281
5282 // Total RSS in kilobytes consumed by the process prior to compaction.
5283 optional int64 before_rss_total_kilobytes = 4;
5284
5285 // File RSS in kilobytes consumed by the process prior to compaction.
5286 optional int64 before_rss_file_kilobytes = 5;
5287
5288 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5289 optional int64 before_rss_anon_kilobytes = 6;
5290
5291 // Swap in kilobytes consumed by the process prior to compaction.
5292 optional int64 before_swap_kilobytes = 7;
5293
5294 // Total RSS in kilobytes consumed by the process after compaction.
5295 optional int64 after_rss_total_kilobytes = 8;
5296
5297 // File RSS in kilobytes consumed by the process after compaction.
5298 optional int64 after_rss_file_kilobytes = 9;
5299
5300 // Anonymous RSS in kilobytes consumed by the process after compaction.
5301 optional int64 after_rss_anon_kilobytes = 10;
5302
5303 // Swap in kilobytes consumed by the process after compaction.
5304 optional int64 after_swap_kilobytes = 11;
5305
5306 // The time taken to perform compaction in milliseconds.
5307 optional int64 time_to_compact_millis = 12;
5308
5309 // The last compaction action performed for this app.
5310 optional Action last_action = 13;
5311
Ben Murdoch01720b82018-12-19 18:03:44 +00005312 // The last time that compaction was attempted on this process in milliseconds
5313 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5314 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00005315
Ben Murdoch885c21b2019-03-15 18:02:04 +00005316 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005317 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00005318
5319 // The process state at the time of compaction.
5320 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005321
5322 // Free ZRAM in kilobytes before compaction.
5323 optional int64 before_zram_free_kilobytes = 17;
5324
5325 // Free ZRAM in kilobytes after compaction.
5326 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00005327}
lifr157fc552018-12-12 16:38:04 +08005328
5329/**
lifrb6b90b62019-03-29 00:40:17 +08005330 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5331 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5332 *
lifr1f74b052019-04-16 22:16:30 +08005333 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5334 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5335 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5336 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005337 */
5338message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08005339 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005340
lifr1f74b052019-04-16 22:16:30 +08005341 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005342
5343 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005344 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005345
lifr1f74b052019-04-16 22:16:30 +08005346 // Only valid for event_type = EVENT_GETADDRINFO.
5347 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005348
lifr1f74b052019-04-16 22:16:30 +08005349 // Flags passed to android_res_nsend() defined in multinetwork.h
5350 // Only valid for event_type = EVENT_RESNSEND.
5351 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005352
lifrad9becc2019-05-20 11:04:41 +08005353 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005354
5355 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08005356 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005357
5358 // Additional pass-through fields opaque to statsd.
5359 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08005360 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08005361
5362 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
5363 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08005364}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005365
5366/**
5367 * Logs when a data stall event occurs.
5368 *
5369 * Log from:
5370 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5371 */
5372message DataStallEvent {
5373 // Data stall evaluation type.
5374 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5375 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5376 optional int32 evaluation_type = 1;
5377 // See definition in data_stall_event.proto.
5378 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5379 // See definition in data_stall_event.proto.
5380 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5381 // See definition in data_stall_event.proto.
5382 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5383 // See definition in data_stall_event.proto.
5384 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5385 // See definition in data_stall_event.proto.
5386 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5387}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005388
5389/*
5390 * Logs when RescueParty resets some set of experiment flags.
5391 *
5392 * Logged from:
5393 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5394 */
5395message RescuePartyResetReported {
5396 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5397 optional int32 rescue_level = 1;
5398}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005399
5400/**
5401 * Logs when signed config is received from an APK, and if that config was applied successfully.
5402 * Logged from:
5403 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5404 */
5405message SignedConfigReported {
5406 enum Type {
5407 UNKNOWN_TYPE = 0;
5408 GLOBAL_SETTINGS = 1;
5409 }
5410 optional Type type = 1;
5411
5412 // The final status of the signed config received.
5413 enum Status {
5414 UNKNOWN_STATUS = 0;
5415 APPLIED = 1;
5416 BASE64_FAILURE_CONFIG = 2;
5417 BASE64_FAILURE_SIGNATURE = 3;
5418 SECURITY_EXCEPTION = 4;
5419 INVALID_CONFIG = 5;
5420 OLD_CONFIG = 6;
5421 SIGNATURE_CHECK_FAILED = 7;
5422 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005423 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005424 }
5425 optional Status status = 2;
5426
5427 // The version of the signed config processed.
5428 optional int32 version = 3;
5429
5430 // The package name that the config was extracted from.
5431 optional string from_package = 4;
5432
5433 enum Key {
5434 NO_KEY = 0;
5435 DEBUG = 1;
5436 PRODUCTION = 2;
5437 }
5438 // Which key was used to verify the config.
5439 optional Key verified_with = 5;
5440}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005441
5442/*
5443 * Logs GNSS Network-Initiated (NI) location events.
5444 *
5445 * Logged from:
5446 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5447 */
5448message GnssNiEventReported {
5449 // The type of GnssNiEvent.
5450 enum EventType {
5451 UNKNOWN = 0;
5452 NI_REQUEST = 1;
5453 NI_RESPONSE = 2;
5454 }
5455 optional EventType event_type = 1;
5456
5457 // An ID generated by HAL to associate NI notifications and UI responses.
5458 optional int32 notification_id = 2;
5459
5460 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005461 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005462
5463 // NI requires notification.
5464 optional bool need_notify = 4;
5465
5466 // NI requires verification.
5467 optional bool need_verify = 5;
5468
5469 // NI requires privacy override, no notification/minimal trace.
5470 optional bool privacy_override = 6;
5471
5472 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5473 // seconds.
5474 optional int32 timeout = 7;
5475
5476 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005477 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005478
5479 // String representing the requester of the network inititated location request.
5480 optional string requestor_id = 9;
5481
5482 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5483 // network initiated location request.
5484 optional string text = 10;
5485
5486 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005487 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005488
5489 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005490 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005491
5492 // True if SUPL ES is enabled.
5493 optional bool is_supl_es_enabled = 13;
5494
5495 // True if GNSS location is enabled.
5496 optional bool is_location_enabled = 14;
5497
5498 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005499 optional android.server.location.GnssUserResponseType user_response = 15;
5500}
5501
5502/**
5503 * Logs GNSS non-framework (NFW) location notification.
5504 *
5505 * Logged from:
5506 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5507 */
5508message GnssNfwNotificationReported {
5509 // Package name of the Android proxy application representing the non-framework entity that
5510 // requested location. Set to empty string if unknown.
5511 optional string proxy_app_package_name = 1;
5512
5513 // Protocol stack that initiated the non-framework location request.
5514 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5515
5516 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5517 // set to empty string. This field is opaque to the framework and used for logging purposes.
5518 optional string other_protocol_stack_name = 3;
5519
5520 // Source initiating/receiving the location information.
5521 optional android.server.location.NfwRequestor requestor = 4;
5522
5523 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5524 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5525 // and used for logging purposes.
5526 optional string requestor_id = 5;
5527
5528 // Indicates whether location information was provided for this request.
5529 optional android.server.location.NfwResponseType response_type = 6;
5530
5531 // True if the device is in user initiated emergency session.
5532 optional bool in_emergency_mode = 7;
5533
5534 // True if cached location is provided.
5535 optional bool is_cached_location = 8;
5536
5537 // True if proxy app permission mismatch between framework and GNSS HAL.
5538 optional bool is_permission_mismatched = 9;
5539}
5540
5541/**
5542 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5543 *
5544 * Logged from:
5545 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5546 */
5547message GnssConfigurationReported {
5548 // SUPL host name.
5549 optional string supl_host = 1;
5550
5551 // SUPL port number.
5552 optional int32 supl_port = 2;
5553
5554 // C2K host name.
5555 optional string c2k_host = 3;
5556
5557 // C2K port number.
5558 optional int32 c2k_port = 4;
5559
5560 // The SUPL version requested by Carrier.
5561 optional int32 supl_ver = 5;
5562
5563 // The SUPL mode.
5564 optional android.server.location.SuplMode supl_mode = 6;
5565
5566 // True if NI emergency SUPL restrictions is enabled.
5567 optional bool supl_es = 7;
5568
5569 // LTE Positioning Profile settings
5570 optional android.server.location.LppProfile lpp_profile = 8;
5571
5572 // Positioning protocol on A-Glonass system.
5573 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5574
5575 // True if emergency PDN is used. Otherwise, regular PDN is used.
5576 optional bool use_emergency_pdn_for_emergency_supl= 10;
5577
5578 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5579 optional android.server.location.GpsLock gps_lock = 11;
5580
5581 // Number of seconds to extend the emergency session duration post emergency call.
5582 optional int32 es_extension_sec = 12;
5583
5584 // The full list of package names of proxy Android applications representing the non-framework
5585 // location access entities (on/off the device) for which the framework user has granted
5586 // non-framework location access permission. The package names are concatenated in one string
5587 // with spaces as separators.
5588 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005589}
Jack Yu95b64f32018-12-13 18:26:11 +08005590
5591/**
5592 * Logs when a NFC device's error occurred.
5593 * Logged from:
5594 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5595 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5596 */
5597message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005598 enum Type {
5599 UNKNOWN = 0;
5600 CMD_TIMEOUT = 1;
5601 ERROR_NOTIFICATION = 2;
5602 AID_OVERFLOW = 3;
5603 }
5604 optional Type type = 1;
5605 // If it's nci cmd timeout, log the timeout command.
5606 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005607
Alex Salod7c3eef2019-01-25 14:43:27 -08005608 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005609}
5610
5611/**
5612 * Logs when a NFC device's state changed event
5613 * Logged from:
5614 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5615 */
5616message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005617 enum State {
5618 UNKNOWN = 0;
5619 OFF = 1;
5620 ON = 2;
5621 ON_LOCKED = 3; // Secure Nfc enabled.
5622 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5623 }
5624 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005625}
5626
5627/**
5628 * Logs when a NFC Beam Transaction occurred.
5629 * Logged from:
5630 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5631 */
5632message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005633 enum Operation {
5634 UNKNOWN = 0;
5635 SEND = 1;
5636 RECEIVE = 2;
5637 }
5638 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005639}
5640
5641/**
5642 * Logs when a NFC Card Emulation Transaction occurred.
5643 * Logged from:
5644 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5645 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5646 */
5647message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005648 enum Category {
5649 UNKNOWN = 0;
5650 HCE_PAYMENT = 1;
5651 HCE_OTHER = 2;
5652 OFFHOST = 3;
5653 }
5654 // Transaction belongs to HCE payment or HCE other category, or offhost.
5655 optional Category category = 1;
5656 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5657 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005658}
5659
5660/**
5661 * Logs when a NFC Tag event occurred.
5662 * Logged from:
5663 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5664 */
5665message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005666 enum Type {
5667 UNKNOWN = 0;
5668 URL = 1;
5669 BT_PAIRING = 2;
5670 PROVISION = 3;
5671 WIFI_CONNECT = 4;
5672 APP_LAUNCH = 5;
5673 OTHERS = 6;
5674 }
5675 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005676}
5677
5678/**
5679 * Logs when Hce transaction triggered
5680 * Logged from:
5681 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5682 */
5683message NfcHceTransactionOccurred {
5684 // The latency period(in microseconds) it took for the first HCE data
5685 // exchange.
5686 optional uint32 latency_micros = 1;
5687}
5688
5689/**
5690 * Logs when SecureElement state event changed
5691 * Logged from:
5692 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5693 */
5694message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005695 enum State {
5696 UNKNOWN = 0;
5697 INITIALIZED = 1;
5698 DISCONNECTED = 2;
5699 CONNECTED = 3;
5700 HALCRASH = 4;
5701 }
5702 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005703
Alex Salod7c3eef2019-01-25 14:43:27 -08005704 optional string state_change_reason = 2;
5705 // SIMx or eSEx.
5706 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005707}
5708
5709/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005710 * Information about a permission grant request
5711 */
5712message PermissionGrantRequestResultReported {
5713 // unique value identifying an API call. A API call might result in multiple of these atoms
5714 optional int64 request_id = 1;
5715
5716 // UID of package requesting the permission grant
5717 optional int32 requesting_uid = 2 [(is_uid) = true];
5718
5719 // Name of package requesting the permission grant
5720 optional string requesting_package_name = 3;
5721
5722 // The permission to be granted
5723 optional string permission_name = 4;
5724
5725 // If the permission was explicitly requested via the API or added by the system
5726 optional bool is_implicit = 5;
5727
5728 enum Result {
5729 UNDEFINED = 0;
5730 // permission request was ignored
5731 IGNORED = 1;
5732 // permission request was ignored because it was user fixed
5733 IGNORED_USER_FIXED = 2;
5734 // permission request was ignored because it was policy fixed
5735 IGNORED_POLICY_FIXED = 3;
5736 // permission was granted by user action
5737 USER_GRANTED = 4;
5738 // permission was automatically granted
5739 AUTO_GRANTED = 5;
5740 // permission was denied by user action
5741 USER_DENIED = 6;
5742 // permission was denied with prejudice by the user
5743 USER_DENIED_WITH_PREJUDICE = 7;
5744 // permission was automatically denied
5745 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07005746 // permission request was ignored because permission is restricted
5747 IGNORED_RESTRICTED_PERMISSION = 9;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005748 }
5749 // The result of the permission grant
5750 optional Result result = 6;
5751}
5752
5753/**
Jack Yu95b64f32018-12-13 18:26:11 +08005754 * Logs when Omapi API used
5755 * Logged from:
5756 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5757 */
5758message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005759 enum Operation {
5760 UNKNOWN = 0;
5761 OPEN_CHANNEL = 1;
5762 }
5763 optional Operation operation = 1;
5764 // SIMx or eSEx.
5765 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005766
Alex Salod7c3eef2019-01-25 14:43:27 -08005767 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005768}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005769
5770/**
Alex Saloa060aee2019-01-21 14:36:41 -08005771 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5772 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005773 * Logged from:
5774 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5775 */
5776message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005777 optional int64 dispatch_latency_millis = 1;
5778}
5779
5780/**
5781 * Logs AttentionManagerService attention check result.
5782 *
5783 * Logged from:
5784 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5785 */
5786message AttentionManagerServiceResultReported {
5787 // See core/java/android/service/attention/AttentionService.java
5788 enum AttentionCheckResult {
5789 UNKNOWN = 20;
5790 ATTENTION_SUCCESS_ABSENT = 0;
5791 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07005792 ATTENTION_FAILURE_UNKNOWN = 2;
5793 ATTENTION_FAILURE_CANCELLED = 3;
5794 ATTENTION_FAILURE_PREEMPTED = 4;
5795 ATTENTION_FAILURE_TIMED_OUT = 5;
5796 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08005797 }
5798 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005799}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005800
5801/**
5802 * Logs when an adb connection changes state.
5803 *
5804 * Logged from:
5805 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5806 */
5807message AdbConnectionChanged {
5808 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5809 // previously selected for this system.
5810 optional int64 last_connection_time_millis = 1;
5811
5812 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5813 // to reconnect via adb without user interaction.
5814 optional int64 auth_window_millis = 2;
5815
5816 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5817 optional android.debug.AdbConnectionStateEnum state = 3;
5818
5819 // True if the 'always allow' option was selected for this system.
5820 optional bool always_allow = 4;
5821}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005822
5823/*
5824 * Logs the reported speech DSP status.
5825 *
5826 * Logged from:
5827 * Vendor audio implementation.
5828 */
5829message SpeechDspStatReported {
5830 // The total Speech DSP uptime in milliseconds.
5831 optional int32 total_uptime_millis = 1;
5832 // The total Speech DSP downtime in milliseconds.
5833 optional int32 total_downtime_millis = 2;
5834 optional int32 total_crash_count = 3;
5835 optional int32 total_recover_count = 4;
5836}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005837
5838/**
5839 * Logs USB connector contaminant status.
5840 *
5841 * Logged from: USB Service.
5842 */
5843message UsbContaminantReported {
5844 optional string id = 1;
5845 optional android.service.usb.ContaminantPresenceStatus status = 2;
5846}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005847
5848/**
5849 * This atom is for debugging purpose.
5850 */
5851message DebugElapsedClock {
5852 // Monotically increasing value for each pull.
5853 optional int64 pull_count = 1;
5854 // Time from System.elapsedRealtime.
5855 optional int64 elapsed_clock_millis = 2;
5856 // Time from System.elapsedRealtime.
5857 optional int64 same_elapsed_clock_millis = 3;
5858 // Diff between current elapsed time and elapsed time from previous pull.
5859 optional int64 elapsed_clock_diff_millis = 4;
5860
5861 enum Type {
5862 TYPE_UNKNOWN = 0;
5863 ALWAYS_PRESENT = 1;
5864 PRESENT_ON_ODD_PULLS = 2;
5865 }
5866 // Type of behavior for the pulled data.
5867 optional Type type = 5;
5868}
5869
5870/**
5871 * This atom is for debugging purpose.
5872 */
5873message DebugFailingElapsedClock {
5874 // Monotically increasing value for each pull.
5875 optional int64 pull_count = 1;
5876 // Time from System.elapsedRealtime.
5877 optional int64 elapsed_clock_millis = 2;
5878 // Time from System.elapsedRealtime.
5879 optional int64 same_elapsed_clock_millis = 3;
5880 // Diff between current elapsed time and elapsed time from previous pull.
5881 optional int64 elapsed_clock_diff_millis = 4;
5882}
Steven Wuacef6bb2019-01-23 14:21:17 -05005883
5884/** Logs System UI bubbles event changed.
5885 *
5886 * Logged from:
5887 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5888 */
5889message BubbleUIChanged {
5890
5891 // The app package that is posting the bubble.
5892 optional string package_name = 1;
5893
5894 // The notification channel that is posting the bubble.
5895 optional string notification_channel = 2;
5896
5897 // The notification id associated with the posted bubble.
5898 optional int32 notification_id = 3;
5899
5900 // The position of the bubble within the bubble stack.
5901 optional int32 position = 4;
5902
5903 // The total number of bubbles within the bubble stack.
5904 optional int32 total_number = 5;
5905
5906 // User interactions with the bubble.
5907 enum Action {
5908 UNKNOWN = 0;
5909 POSTED = 1;
5910 UPDATED = 2;
5911 EXPANDED = 3;
5912 COLLAPSED = 4;
5913 DISMISSED = 5;
5914 STACK_DISMISSED = 6;
5915 STACK_MOVED = 7;
5916 HEADER_GO_TO_APP = 8;
5917 HEADER_GO_TO_SETTINGS = 9;
5918 PERMISSION_OPT_IN = 10;
5919 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005920 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005921 SWIPE_LEFT = 13;
5922 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005923 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04005924 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05005925 }
5926 optional Action action = 6;
5927
5928 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5929 optional float normalized_x_position = 7;
5930 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04005931
5932 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
5933 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04005934
5935 // Whether the bubble is an on-going one.
5936 optional bool is_ongoing = 10;
5937
5938 // Whether the bubble is produced by an app running in foreground.
5939 optional bool is_foreground = 11;
Steven Wuacef6bb2019-01-23 14:21:17 -05005940}
Kweku Adams8845d012018-12-11 20:06:45 -08005941
5942/**
Steven Wu552f63f2019-02-05 13:41:36 -05005943 * Logs System UI bubbles developer errors.
5944 *
5945 * Logged from:
5946 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5947 */
5948message BubbleDeveloperErrorReported {
5949
5950 // The app package that is posting the bubble.
5951 optional string package_name = 1;
5952
5953 // Bubble developer error type enums.
5954 enum Error {
5955 UNKNOWN = 0;
5956 ACTIVITY_INFO_MISSING = 1;
5957 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5958 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5959 }
5960 optional Error error = 2 [default = UNKNOWN];
5961}
5962
5963/**
Kweku Adams8845d012018-12-11 20:06:45 -08005964 * Logs that a constraint for a scheduled job has changed.
5965 *
5966 * Logged from:
5967 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5968 */
5969message ScheduledJobConstraintChanged {
5970 repeated AttributionNode attribution_node = 1;
5971
5972 // Name of the job.
5973 optional string job_name = 2;
5974
5975 optional com.android.server.job.ConstraintEnum constraint = 3;
5976
5977 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08005978 UNKNOWN = 0;
5979 UNSATISFIED = 1;
5980 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08005981 }
5982 optional State state = 4;
5983}
Alex Salod7c3eef2019-01-25 14:43:27 -08005984
5985/**
5986 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5987 * returns true.
5988 *
5989 * Logged from:
5990 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5991 */
5992message ScreenTimeoutExtensionReported {
5993 // Describes how many times in a row did the power manager reset the screen off timeout.
5994 optional uint32 consecutive_timeout_extended_count = 1;
5995}
Hui Yu885aca12019-01-10 17:11:34 -08005996
5997/*
5998* Logs number of milliseconds it takes to start a process.
5999* The definition of app process start time is from the app launch time to
6000* the time that Zygote finished forking the app process and loaded the
6001* application package's java classes.
6002
6003* This metric is different from AppStartOccurred which is for foreground
6004* activity only.
6005
6006* ProcessStartTime can report all processes (both foreground and background)
6007* start time.
6008*
6009* Logged from:
6010* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6011*/
6012message ProcessStartTime {
6013 // The uid of the ProcessRecord.
6014 optional int32 uid = 1 [(is_uid) = true];
6015
6016 // The process pid.
6017 optional int32 pid = 2;
6018
6019 // The process name.
6020 // Usually package name, "system" for system server.
6021 // Provided by ActivityManagerService.
6022 optional string process_name = 3;
6023
6024 enum StartType {
6025 UNKNOWN = 0;
6026 WARM = 1;
6027 HOT = 2;
6028 COLD = 3;
6029 }
6030
6031 // The start type.
6032 optional StartType type = 4;
6033
6034 // The elapsed realtime at the start of the process.
6035 optional int64 process_start_time_millis = 5;
6036
6037 // Number of milliseconds it takes to reach bind application.
6038 optional int32 bind_application_delay_millis = 6;
6039
6040 // Number of milliseconds it takes to finish start of the process.
6041 optional int32 process_start_delay_millis = 7;
6042
6043 // hostingType field in ProcessRecord, the component type such as "activity",
6044 // "service", "content provider", "broadcast" or other strings.
6045 optional string hosting_type = 8;
6046
6047 // hostingNameStr field in ProcessRecord. The component class name that runs
6048 // in this process.
6049 optional string hosting_name = 9;
6050}
6051
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006052/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006053 * Track Media Codec usage
6054 * Logged from:
6055 * frameworks/av/media/libstagefright/MediaCodec.cpp
6056 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6057 */
6058message MediametricsCodecReported {
6059 optional int64 timestamp_nanos = 1;
6060 optional string package_name = 2;
6061 optional int64 package_version_code = 3;
6062 optional int64 media_apex_version = 4;
6063
6064 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6065}
6066
6067/**
6068 * Track Media Extractor (pulling video/audio streams out of containers) usage
6069 * Logged from:
6070 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6071 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6072 */
6073message MediametricsExtractorReported {
6074 optional int64 timestamp_nanos = 1;
6075 optional string package_name = 2;
6076 optional int64 package_version_code = 3;
6077 optional int64 media_apex_version = 4;
6078
6079 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6080}
6081
6082/**
6083 * Track how we arbitrate between microphone/input requests.
6084 * Logged from
6085 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6086 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6087 */
6088message MediametricsAudiopolicyReported {
6089 optional int64 timestamp_nanos = 1;
6090 optional string package_name = 2;
6091 optional int64 package_version_code = 3;
6092 optional int64 media_apex_version = 4;
6093
6094 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6095}
6096
6097/**
6098 * Track how we arbitrate between microphone requests.
6099 * Logged from
6100 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6101 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6102 */
6103message MediametricsAudiorecordReported {
6104 optional int64 timestamp_nanos = 1;
6105 optional string package_name = 2;
6106 optional int64 package_version_code = 3;
6107 optional int64 media_apex_version = 4;
6108
6109 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6110}
6111
6112/**
6113 * Track how we arbitrate between microphone/input requests.
6114 * Logged from
6115 * frameworks/av/media/libnblog/ReportPerformance.cpp
6116 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6117 */
6118message MediametricsAudiothreadReported {
6119 optional int64 timestamp_nanos = 1;
6120 optional string package_name = 2;
6121 optional int64 package_version_code = 3;
6122 optional int64 media_apex_version = 4;
6123
6124 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6125}
6126
6127/**
6128 * Track how we arbitrate between microphone/input requests.
6129 * Logged from
6130 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6131 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6132 */
6133message MediametricsAudiotrackReported {
6134 optional int64 timestamp_nanos = 1;
6135 optional string package_name = 2;
6136 optional int64 package_version_code = 3;
6137 optional int64 media_apex_version = 4;
6138
6139 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6140}
6141
6142/**
6143 * Track information about DRM framework performance
6144 * Logged from
6145 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6146 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6147 */
6148message MediametricsMediadrmReported {
6149 optional int64 timestamp_nanos = 1;
6150 optional string package_name = 2;
6151 optional int64 package_version_code = 3;
6152 optional int64 media_apex_version = 4;
6153
6154 // vendor+description tell about which DRM plugin is in use on this device
6155 optional string vendor = 5;
6156 optional string description = 6;
6157 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6158 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6159}
6160
6161/**
6162 * Track information about the widevine DRM plugin performance
6163 * Logged from
6164 * vendor/widevine/libwvdrmengine/cdm/metrics
6165 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6166 */
6167message MediametricsDrmWidevineReported {
6168 optional int64 timestamp_nanos = 1;
6169 optional string package_name = 2;
6170 optional int64 package_version_code = 3;
6171 optional int64 media_apex_version = 4;
6172
6173 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6174}
6175
6176/**
6177 * Track information about recordings (e.g. camcorder)
6178 * Logged from
6179 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6180 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6181 */
6182message MediametricsRecorderReported {
6183 optional int64 timestamp_nanos = 1;
6184 optional string package_name = 2;
6185 optional int64 package_version_code = 3;
6186 optional int64 media_apex_version = 4;
6187
6188 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6189}
6190
6191/**
6192 * Track Media Player usage
6193 * Logged from:
6194 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6195 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6196 */
6197message MediametricsNuPlayerReported {
6198 optional int64 timestamp_nanos = 1;
6199 optional string package_name = 2;
6200 optional int64 package_version_code = 3;
6201 optional int64 media_apex_version = 4;
6202
6203 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6204}
6205
6206/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006207 * State of a dangerous permission requested by a package
6208 */
6209message DangerousPermissionState {
6210 // Name of the permission
6211 optional string permission_name = 1;
6212
6213 // Uid of the package
6214 optional int32 uid = 2 [(is_uid) = true];
6215
6216 // Package requesting the permission
6217 optional string package_name = 3;
6218
6219 // If the permission is granted to the uid
6220 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01006221
6222 // Permission flags as per android.content.pm.PermissionFlags
6223 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006224}
6225
Michael Groover4a0ca942019-01-24 17:41:25 -08006226/**
6227 * Logs when a package is denied access to a device identifier based on the new access requirements.
6228 *
6229 * Logged from:
6230 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6231 */
6232message DeviceIdentifierAccessDenied {
6233 // The name of the package denied access to the requested device identifier.
6234 optional string package_name = 1;
6235
6236 // The name of the device identifier method the package attempted to invoke.
6237 optional string method_name = 2;
6238
6239 // True if the package is preinstalled.
6240 optional bool is_preinstalled = 3;
6241
6242 // True if the package is privileged.
6243 optional bool is_priv_app = 4;
6244}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006245
6246/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006247 * Pulls the ongoing mainline install train version code.
6248 * Pulled from StatsCompanionService
6249 */
6250message TrainInfo {
6251 optional int64 train_version_code = 1;
6252
6253 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006254
6255 optional string train_name = 3;
6256
6257 enum Status {
6258 UNKNOWN = 0;
6259 INSTALL_REQUESTED = 1;
6260 INSTALL_STARTED = 2;
6261 INSTALL_STAGED_NOT_READY = 3;
6262 INSTALL_STAGED_READY = 4;
6263 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006264 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6265 // and INSTALL_FAILURE_COMMIT.
6266 INSTALL_FAILURE = 6 [deprecated = true];
6267 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006268 INSTALL_CANCELLED = 7;
6269 INSTALLER_ROLLBACK_REQUESTED = 8;
6270 INSTALLER_ROLLBACK_INITIATED = 9;
6271 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6272 INSTALLER_ROLLBACK_STAGED = 11;
6273 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6274 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6275 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6276 INSTALLER_ROLLBACK_SUCCESS = 15;
6277 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006278 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6279 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6280 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6281 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6282 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6283 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006284 INSTALL_FAILURE_DOWNLOAD = 23;
6285 INSTALL_FAILURE_STATE_MISMATCH = 24;
6286 INSTALL_FAILURE_COMMIT = 25;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006287 }
6288 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006289}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006290
6291/**
6292 * Logs the gesture stage changed event.
6293 *
6294 * Logged from:
6295 * frameworks/base/packages/SystemUI/
6296 */
6297message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006298 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006299}
6300
6301/**
6302 * Logs the feedback type.
6303 *
6304 * Logged from:
6305 * frameworks/base/packages/SystemUI/
6306 */
6307message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006308 // Whether or not the gesture was used.
6309 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006310}
6311
6312/**
6313 * Logs the progress.
6314 *
6315 * Logged from:
6316 * frameworks/base/packages/SystemUI/
6317 */
6318message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006319 // [0,100] progress for the assist gesture.
6320 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006321}
Neil Fullerdb14b482019-02-05 19:44:44 +00006322
6323/*
6324 * Information about the time zone data on a device.
6325 */
6326message TimeZoneDataInfo {
6327 // A version identifier for the data set on device. e.g. "2018i"
6328 optional string tzdb_version = 1;
6329}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006330
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006331/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006332 * Logs the GPU stats global health information.
6333 *
6334 * Logged from:
6335 * frameworks/native/services/gpuservice/gpustats/
6336 */
6337message GpuStatsGlobalInfo {
6338 // Package name of the gpu driver.
6339 optional string driver_package_name = 1;
6340
6341 // Version name of the gpu driver.
6342 optional string driver_version_name = 2;
6343
6344 // Version code of the gpu driver.
6345 optional int64 driver_version_code = 3;
6346
6347 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
6348 optional int64 driver_build_time = 4;
6349
6350 // Total count of the gl driver gets loaded.
6351 optional int64 gl_loading_count = 5;
6352
6353 // Total count of the gl driver fails to be loaded.
6354 optional int64 gl_loading_failure_count = 6;
6355
6356 // Total count of the Vulkan driver gets loaded.
6357 optional int64 vk_loading_count = 7;
6358
6359 // Total count of the Vulkan driver fails to be loaded.
6360 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07006361
6362 // Api version of the system Vulkan driver.
6363 optional int32 vulkan_version = 9;
6364
6365 // Api version of the system CPU Vulkan driver.
6366 optional int32 cpu_vulkan_version = 10;
6367
6368 // Api version of the system GLES driver.
6369 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006370
6371 // Total count of the angle driver gets loaded.
6372 optional int64 angle_loading_count = 12;
6373
6374 // Total count of the angle driver fails to be loaded.
6375 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006376}
6377
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006378/**
6379 * GPU driver loading time info.
6380 */
6381message GpuDriverLoadingTime {
6382 // List of all the driver loading times for this app. The list size is
6383 // capped at 50.
6384 repeated int64 driver_loading_time = 1;
6385}
6386
6387/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006388 * Logs the GPU stats per app health information.
6389 *
6390 * Logged from:
6391 * frameworks/native/services/gpuservice/gpustats/
6392 */
6393message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006394 // Package name of the application that loads the gpu driver. Total number
6395 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006396 optional string app_package_name = 1;
6397
6398 // Version code of the gpu driver this app loads.
6399 optional int64 driver_version_code = 2;
6400
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006401 // gl driver loading time info.
6402 optional GpuDriverLoadingTime gl_driver_loading_time = 3
6403 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006404
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006405 // Vulkan driver loading time info.
6406 optional GpuDriverLoadingTime vk_driver_loading_time = 4
6407 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006408
6409 // Angle driver loading time info.
6410 optional GpuDriverLoadingTime angle_driver_loading_time = 5
6411 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07006412
6413 // CPU Vulkan implementation is in use.
6414 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07006415
6416 // App is not doing pre-rotation correctly.
6417 optional bool false_prerotation = 7;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006418}
Rafal Slawikd4e87572019-03-12 13:08:38 +00006419
6420/*
6421 * Logs the size of the system ion heap.
6422 *
6423 * Pulled from StatsCompanionService.
6424 */
6425message SystemIonHeapSize {
6426 // Size of the system ion heap in bytes.
6427 optional int64 size_in_bytes = 1;
6428}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006429
Rafal Slawik77987ed2019-06-17 12:28:23 +01006430/*
6431 * Logs the per-process size of the system ion heap.
6432 *
6433 * Pulled from StatsCompanionService.
6434 */
6435message ProcessSystemIonHeapSize {
6436 // The uid if available. -1 means not available.
6437 optional int32 uid = 1 [(is_uid) = true];
6438
6439 // The process name (from /proc/PID/cmdline).
6440 optional string process_name = 2;
6441
6442 // Sum of sizes of all allocations.
6443 optional int32 total_size_in_kilobytes = 3;
6444
6445 // Number of allocations.
6446 optional int32 allocation_count = 4;
6447
6448 // Size of the largest allocation.
6449 optional int32 max_size_in_kilobytes = 5;
6450}
6451
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006452/**
6453 * Push network stack events.
6454 *
6455 * Log from:
6456 * frameworks/base/packages/NetworkStack/
6457 */
6458message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08006459 // The id that indicates the event reported from NetworkStack.
6460 optional int32 event_id = 1;
6461 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006462 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
6463}
Carmen Agimofa769c152019-03-04 14:39:14 +00006464
6465/**
6466 * Logs the apps that are installed on the external storage.
6467 * Pulled from:
6468 * StatsCompanionService
6469 */
6470message AppsOnExternalStorageInfo {
6471 // The type of the external storage.
6472 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
6473 // The name of the package that is installed on the external storage.
6474 optional string package_name = 2;
6475}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07006476
6477/**
6478 * Logs the settings related to Face.
6479 * Logged from:
6480 * frameworks/base/services/core/java/com/android/server/stats
6481 */
6482message FaceSettings {
6483 // Whether or not face unlock is allowed on Keyguard.
6484 optional bool unlock_keyguard_enabled = 1;
6485 // Whether or not face unlock dismisses the Keyguard.
6486 optional bool unlock_dismisses_keyguard = 2;
6487 // Whether or not face unlock requires attention.
6488 optional bool unlock_attention_required = 3;
6489 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
6490 optional bool unlock_app_enabled = 4;
6491 // Whether or not face unlock always requires user confirmation.
6492 optional bool unlock_always_require_confirmation = 5;
6493 // Whether or not a diverse set of poses are required during enrollment.
6494 optional bool unlock_diversity_required = 6;
6495}
Maggie White442b6312019-04-05 16:26:44 -07006496
6497/**
6498 * Logs cooling devices maintained by the kernel.
6499 *
6500 * Pulled from StatsCompanionService.java
6501 */
6502message CoolingDevice {
6503 // The type of cooling device being reported. Eg. CPU, GPU...
6504 optional android.os.CoolingTypeEnum device_location = 1;
6505 // The name of the cooling device source. Eg. CPU0
6506 optional string device_name = 2;
6507 // Current throttle state of the cooling device. The value can any unsigned
6508 // integer between 0 and max_state defined in its driver. 0 means device is
6509 // not in throttling, higher value means deeper throttling.
6510 optional int32 state = 3;
6511}
Ben Blount763a5d52019-04-10 11:48:58 -07006512
6513/**
6514 * Intelligence has several counter-type events that don't warrant a
6515 * full separate atom. These are primarily API call counters but also include
6516 * counters for feature usage and specific failure modes.
6517 *
6518 * Logged from the Intelligence mainline module.
6519 */
6520message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07006521 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07006522 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07006523 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07006524 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07006525 // How many times the event occured (to report a batch of high frequency events).
6526 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07006527 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07006528 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07006529}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07006530
6531/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07006532 * Logs when Car Power state changed.
6533 *
6534 * Logged from:
6535 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6536 */
6537message CarPowerStateChanged {
6538 // States come from CpmsState in CarPowerManagementService.java.
6539 enum State {
6540 WAIT_FOR_VHAL = 0;
6541 ON = 1;
6542 SHUTDOWN_PREPARE = 2;
6543 WAIT_FOR_FINISH = 3;
6544 SUSPEND = 4;
6545 SIMULATE_SLEEP = 5;
6546 }
6547 optional State state = 1;
6548}
6549
6550/**
6551 * Logs whether GarageMode is entered.
6552 *
6553 * Logged from:
6554 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6555 */
6556message GarageModeInfo {
6557 // Whether GarageMode is entered.
6558 optional bool is_garage_mode = 1;
6559}
Martijn Coenencd95d462019-04-25 17:09:45 +02006560
6561/**
6562 * Historical app ops data per package.
6563 */
6564message AppOps {
6565 // Uid of the package requesting the op
6566 optional int32 uid = 1 [(is_uid) = true];
6567
6568 // Nmae of the package performing the op
6569 optional string package_name = 2;
6570
6571 // operation id; maps to the OP_* constants in AppOpsManager.java
6572 optional int32 op_id = 3;
6573
6574 // The number of times the op was granted while the app was in the
6575 // foreground (only for trusted requests)
6576 optional int64 trusted_foreground_granted_count = 4;
6577
6578 // The number of times the op was granted while the app was in the
6579 // background (only for trusted requests)
6580 optional int64 trusted_background_granted_count = 5;
6581
6582 // The number of times the op was rejected while the app was in the
6583 // foreground (only for trusted requests)
6584 optional int64 trusted_foreground_rejected_count = 6;
6585
6586 // The number of times the op was rejected while the app was in the
6587 // background (only for trusted requests)
6588 optional int64 trusted_background_rejected_count = 7;
6589
6590 // For long-running operations, total duration of the operation
6591 // while the app was in the foreground (only for trusted requests)
6592 optional int64 trusted_foreground_duration_millis = 8;
6593
6594 // For long-running operations, total duration of the operation
6595 // while the app was in the background (only for trusted requests)
6596 optional int64 trusted_background_duration_millis = 9;
6597}
Hongyi Zhang700137e2019-05-23 21:19:36 -07006598
6599/**
6600 * Location Manager API Usage information(e.g. API under usage,
6601 * API call's parameters).
6602 * Logged from:
6603 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
6604 */
6605message LocationManagerApiUsageReported {
6606
6607 // Indicating if usage starts or usage ends.
6608 optional android.stats.location.UsageState state = 1;
6609
6610 // LocationManagerService's API in use.
6611 // We can identify which API from LocationManager is
6612 // invoking current LMS API by the combination of
6613 // API parameter(e.g. is_listener_null, is_intent_null,
6614 // is_location_request_null)
6615 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
6616
6617 // Name of the package calling the API.
6618 optional string calling_package_name = 3;
6619
6620 // Type of the location provider.
6621 optional android.stats.location.ProviderType provider = 4;
6622
6623 // Quality of the location request
6624 optional android.stats.location.LocationRequestQuality quality = 5;
6625
6626 // The desired interval for active location updates, in milliseconds.
6627 // Bucketized to reduce cardinality.
6628 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
6629
6630 // Minimum distance between location updates, in meters.
6631 // Bucketized to reduce cardinality.
6632 optional android.stats.location.SmallestDisplacementBucket
6633 bucketized_smallest_displacement = 7;
6634
6635 // The number of location updates.
6636 optional int64 num_updates = 8;
6637
6638 // The request expiration time, in millisecond since boot.
6639 // Bucketized to reduce cardinality.
6640 optional android.stats.location.ExpirationBucket
6641 bucketized_expire_in = 9;
6642
6643 // Type of Callback passed in for this API.
6644 optional android.stats.location.CallbackType callback_type = 10;
6645
6646 // The radius of the central point of the alert
6647 // region, in meters. Only for API REQUEST_GEOFENCE.
6648 // Bucketized to reduce cardinality.
6649 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
6650
6651 // Activity Importance of API caller.
6652 // Categorized to 3 types that are interesting from location's perspective.
6653 optional android.stats.location.ActivityImportance activiy_importance = 12;
6654}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01006655
6656/**
6657 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
6658 */
6659message ReviewPermissionsFragmentResultReported {
6660 // unique value identifying a permission group change. A permission group change might result
6661 // in multiple of these atoms
6662 optional int64 change_id = 1;
6663
6664 // UID of package the permission belongs to
6665 optional int32 uid = 2 [(is_uid) = true];
6666
6667 // Name of package the permission belongs to
6668 optional string package_name = 3;
6669
6670 // The permission to be granted
6671 optional string permission_name = 4;
6672
6673 // The result of the permission grant
6674 optional bool permission_granted = 5;
6675}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01006676
6677/**
6678* Information about results of permission upgrade by RuntimePermissionsUpgradeController
6679* Logged from: RuntimePermissionUpdgradeController
6680*/
6681message RuntimePermissionsUpgradeResult {
6682 // Permission granted as result of upgrade
6683 optional string permission_name = 1;
6684
6685 // UID of package granted permission
6686 optional int32 uid = 2 [(is_uid) = true];
6687
6688 // Name of package granted permission
6689 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01006690}
6691
6692/**
6693* Information about a buttons presented in GrantPermissionsActivty and choice made by user
6694*/
6695message GrantPermissionsActivityButtonActions {
6696 // Permission granted as result of upgrade
6697 optional string permission_group_name = 1;
6698
6699 // UID of package granted permission
6700 optional int32 uid = 2 [(is_uid) = true];
6701
6702 // Name of package requesting permission
6703 optional string package_name = 3;
6704
6705 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
6706 // LABEL_ constants in GrantPermissionActivity.java
6707 optional int32 buttons_presented = 4;
6708
6709 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
6710 optional int32 button_clicked = 5;
6711}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01006712
6713/**
6714 * Information about LocationAccessCheck notification presented to user
6715 */
6716message LocationAccessCheckNotificationAction {
6717
6718 // id which identifies single session of user interacting with permission controller
6719 optional int64 session_id = 1;
6720
6721 // Uid of package for which location access check is presented
6722 optional int32 package_uid = 2;
6723
6724 // Name of package for which location access check is presented
6725 optional string package_name = 3;
6726
6727 enum Result {
6728 UNDEFINED = 0;
6729 // notification was presented to the user
6730 NOTIFICATION_PRESENTED = 1;
6731 // notification was declined by the user
6732 NOTIFICATION_DECLINED = 2;
6733 // notification was clicked by the user
6734 NOTIFICATION_CLICKED = 3;
6735 }
6736
6737 // View / interaction recorded
6738 optional Result result = 4;
6739}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01006740
6741/**
6742 * Information about a permission grant or revoke made by user inside AppPermissionFragment
6743 */
6744message AppPermissionFragmentActionReported {
6745 // id which identifies single session of user interacting with permission controller
6746 optional int64 session_id = 1;
6747
6748 // unique value identifying a permission group change. A permission group change might result
6749 // in multiple of these atoms
6750 optional int64 change_id = 2;
6751
6752 // UID of package the permission belongs to
6753 optional int32 uid = 3 [(is_uid) = true];
6754
6755 // Name of package the permission belongs to
6756 optional string package_name = 4;
6757
6758 // The permission to be granted
6759 optional string permission_name = 5;
6760
6761 // The result of the permission grant
6762 optional bool permission_granted = 6;
6763}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01006764
6765/**
6766* Information about a AppPermissionFragment viewed by user
6767*/
6768message AppPermissionFragmentViewed {
6769 // id which identifies single session of user interacting with permission controller
6770 optional int64 session_id = 1;
6771
6772 // UID of package for which permissions are viewed
6773 optional int32 uid = 2 [(is_uid) = true];
6774
6775 // Name of package for which permissions are viewed
6776 optional string package_name = 3;
6777
6778 // Permission group viewed
6779 optional string permission_group_name = 4;
6780}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01006781
6782/**
6783* Information about a AppPermissionsFragment viewed by user
6784*/
6785message AppPermissionsFragmentViewed {
6786 // id which identifies single session of user interacting with permission controller
6787 optional int64 session_id = 1;
6788
6789 // id which identifies single view as every view might have several logging records
6790 // with different package information attached
6791 optional int64 view_id = 2;
6792
6793 // Permission group viewed
6794 optional string permission_group_name = 3;
6795
6796 // UID of package for which permissions are viewed
6797 optional int32 uid = 4 [(is_uid) = true];
6798
6799 // Name of package for which permissions are viewed
6800 optional string package_name = 5;
6801
6802 // Category in which permission is included
6803 enum Category {
6804 UNDEFINED = 0;
6805 ALLOWED = 1;
6806 ALLOWED_FOREGROUND = 2;
6807 DENIED = 3;
6808 }
6809 optional Category category = 6;
6810}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01006811
6812/**
6813* Information about a PermissionAppsFragment viewed by user.
6814* Logged from ui/handheld/PermissionAppsFragment.java
6815*/
6816message PermissionAppsFragmentViewed {
6817 // id which identifies single session of user interacting with permission controller
6818 optional int64 session_id = 1;
6819
6820 // id which identifies single view as every view might have several logging records
6821 // with different package information attached
6822 optional int64 view_id = 2;
6823
6824 // Permission group viewed
6825 optional string permission_group_name = 3;
6826
6827 // UID of package for which permissions are viewed
6828 optional int32 uid = 4 [(is_uid) = true];
6829
6830 // Name of package for which permissions are viewed
6831 optional string package_name = 5;
6832
6833 // Category in which app is included
6834 enum Category {
6835 UNDEFINED = 0;
6836 ALLOWED = 1;
6837 ALLOWED_FOREGROUND = 2;
6838 DENIED = 3;
6839 }
6840 optional Category category = 6;
6841}
Tony Make2b1b672019-07-29 16:59:47 +01006842
6843/**
6844 * Logs when there is a smart selection related event.
6845 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
6846 * Logged from: TextClassifierEventLogger.java
6847 */
6848message TextSelectionEvent {
6849 // A session ID.
6850 optional string session_id = 1;
6851
6852 // Event type of this event.
6853 optional android.stats.textclassifier.EventType event_type = 2;
6854
6855 // Name of the model that is involved in this event.
6856 optional string model_name = 3;
6857
6858 // Type of widget that was involved in triggering this event.
6859 optional android.stats.textclassifier.WidgetType widget_type = 4;
6860
6861 // Index of this event in a session.
6862 optional int32 event_index = 5;
6863
6864 // Entity type that is involved.
6865 optional string entity_type = 6;
6866
6867 // Relative word index of the start of the selection.
6868 optional int32 relative_word_start_index = 7;
6869
6870 // Relative word (exclusive) index of the end of the selection.
6871 optional int32 relative_word_end_index = 8;
6872
6873 // Relative word index of the start of the smart selection.
6874 optional int32 relative_suggested_word_start_index = 9;
6875
6876 // Relative word (exclusive) index of the end of the smart selection.
6877 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01006878
6879 // Name of source package.
6880 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01006881}
6882
6883/**
6884 * Logs when there is a smart linkify related event.
6885 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
6886 * Logged from: TextClassifierEventLogger.java
6887 */
6888message TextLinkifyEvent {
6889 // A session ID.
6890 optional string session_id = 1;
6891
6892 // Event type of this event.
6893 optional android.stats.textclassifier.EventType event_type = 2;
6894
6895 // Name of the model that is involved in this event.
6896 optional string model_name = 3;
6897
6898 // Type of widget that was involved in triggering this event.
6899 optional android.stats.textclassifier.WidgetType widget_type = 4;
6900
6901 // Index of this event in a session.
6902 optional int32 event_index = 5;
6903
6904 // Entity type that is involved.
6905 optional string entity_type = 6;
6906
6907 // Number of links detected.
6908 optional int32 num_links = 7;
6909
6910 // The total length of all links.
6911 optional int32 linked_text_length = 8;
6912
6913 // Length of input text.
6914 optional int32 text_length = 9;
6915
6916 // Time spent on generating links in ms.
6917 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01006918
6919 // Name of source package.
6920 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01006921}
6922
6923/**
6924 * Logs when there is a conversation actions related event.
6925 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
6926 * Logged from: TextClassifierEventLogger.java
6927 */
6928message ConversationActionsEvent {
6929 // A session ID.
6930 optional string session_id = 1;
6931
6932 // Event type of this event.
6933 optional android.stats.textclassifier.EventType event_type = 2;
6934
6935 // Name of the model that is involved in this event.
6936 optional string model_name = 3;
6937
6938 // Type of widget that was involved in triggering this event.
6939 optional android.stats.textclassifier.WidgetType widget_type = 4;
6940
6941 // The first entity type that is involved.
6942 optional string first_entity_type = 5;
6943
6944 // The second entity type that is involved.
6945 optional string second_entity_type = 6;
6946
6947 // The third entity type that is involved.
6948 optional string third_entity_type = 7;
6949
6950 // The score of the first entity type.
6951 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01006952
6953 // Name of source package.
6954 optional string package_name = 9;
Tony Make2b1b672019-07-29 16:59:47 +01006955}
6956
6957/**
6958 * Logs when there is a language detection related event.
6959 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
6960 * Logged from: TextClassifierEventLogger.java
6961 */
6962message LanguageDetectionEvent {
6963 // A session ID.
6964 optional string session_id = 1;
6965
6966 // Event type of this event.
6967 optional android.stats.textclassifier.EventType event_type = 2;
6968
6969 // Name of the model that is involved in this event.
6970 optional string model_name = 3;
6971
6972 // Type of widget that was involved in triggering this event.
6973 optional android.stats.textclassifier.WidgetType widget_type = 4;
6974
6975 // Detected language.
6976 optional string language_tag = 5;
6977
6978 // Score of the detected language.
6979 optional float score = 6;
6980
6981 // Position of this action.
6982 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01006983
6984 // Name of source package.
6985 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01006986}
Tianjie Xu167c3db2019-07-22 14:25:14 -07006987
6988/**
6989 * Information about an OTA update attempt by update_engine.
6990 * Logged from platform/system/update_engine/metrics_reporter_android.cc
6991 */
6992message UpdateEngineUpdateAttemptReported {
6993 // The number of attempts for the update engine to apply a given payload.
6994 optional int32 attempt_number = 1;
6995
6996 optional android.stats.otaupdate.PayloadType payload_type = 2;
6997
6998 // The total time in minutes for the update engine to apply a given payload.
6999 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
7000 // it's increased when the system is sleeping.
7001 optional int32 duration_boottime_in_minutes = 3;
7002
7003 // The total time in minutes for the update engine to apply a given payload.
7004 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
7005 // and it's not increased when the system is sleeping.
7006 optional int32 duration_monotonic_in_minutes = 4;
7007
7008 // The size of the payload in MiBs.
7009 optional int32 payload_size_mib = 5;
7010
7011 // The attempt result reported by the update engine for an OTA update.
7012 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
7013
7014 // The error code reported by the update engine after an OTA update attempt
7015 // on A/B devices.
7016 optional android.stats.otaupdate.ErrorCode error_code = 7;
7017
7018 // The build fingerprint of the source system. The value is read from a
7019 // system property when the device takes the update. e.g.
7020 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
7021 optional string source_fingerprint = 8;
7022}
7023
7024/**
7025 * Information about all the attempts the device make before finishing the
7026 * successful update.
7027 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7028 */
7029message UpdateEngineSuccessfulUpdateReported {
7030 // The number of attempts for the update engine to apply the payload for a
7031 // successful update.
7032 optional int32 attempt_count = 1;
7033
7034 optional android.stats.otaupdate.PayloadType payload_type = 2;
7035
7036 optional int32 payload_size_mib = 3;
7037
7038 // The total number of bytes downloaded by update_engine since the last
7039 // successful update.
7040 optional int32 total_bytes_downloaded_mib = 4;
7041
7042 // The ratio in percentage of the over-downloaded bytes compared to the
7043 // total bytes needed to successfully install the update. e.g. 200 if we
7044 // download 200MiB in total for a 100MiB package.
7045 optional int32 download_overhead_percentage = 5;
7046
7047 // The total time in minutes for the update engine to apply the payload for a
7048 // successful update.
7049 optional int32 total_duration_minutes = 6;
7050
7051 // The number of reboot of the device during a successful update.
7052 optional int32 reboot_count = 7;
7053}