blob: ae751ce6d7abe3035e002ed459289170005c593f [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;
Robert Shiha4beed32019-08-19 14:15:23 -0700300 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Yuncheol Heod1a85d22019-05-08 17:13:42 -0700301 CarPowerStateChanged car_power_state_changed = 203;
302 GarageModeInfo garage_mode_info = 204;
Tej Singhc9203082019-05-03 13:42:23 -0700303 TestAtomReported test_atom_reported = 205 [(log_from_module) = "cts"];
Adam He420947c2019-01-23 15:59:09 -0800304 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported = 206;
305 ContentCaptureServiceEvents content_capture_service_events = 207;
306 ContentCaptureSessionEvents content_capture_session_events = 208;
307 ContentCaptureFlushed content_capture_flushed = 209;
Hongyi Zhang700137e2019-05-23 21:19:36 -0700308 LocationManagerApiUsageReported location_manager_api_usage_reported = 210;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100309 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
310 211 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100311 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
312 212 [(log_from_module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100313 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
314 213 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100315 LocationAccessCheckNotificationAction location_access_check_notification_action =
316 214 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100317 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
318 215 [(log_from_module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100319 AppPermissionFragmentViewed app_permission_fragment_viewed =
320 216 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100321 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
322 217 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100323 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
324 218 [(log_from_module) = "permissioncontroller"];
Tony Make2b1b672019-07-29 16:59:47 +0100325 TextSelectionEvent text_selection_event =
326 219 [(log_from_module) = "textclassifier"];
327 TextLinkifyEvent text_linkify_event =
328 220 [(log_from_module) = "textclassifier"];
329 ConversationActionsEvent conversation_actions_event =
330 221 [(log_from_module) = "textclassifier"];
331 LanguageDetectionEvent language_detection_event =
332 222 [(log_from_module) = "textclassifier"];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -0700333 ExclusionRectStateChanged exclusion_rect_state_changed = 223;
334 BackGesture back_gesture_reported_reported = 224;
Tianjie Xu167c3db2019-07-22 14:25:14 -0700335 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
336 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Emilian Peev6729f372019-08-29 09:14:09 -0700337 CameraActionEvent camera_action_event = 227;
Yao Chend54f9dd2017-10-17 17:37:48 +0000338 }
David Chenc8a43242017-10-17 16:23:28 -0700339
David Chen6e3e6cb2018-01-03 16:14:06 -0800340 // Pulled events will start at field 10000.
Alec Mourie088e762019-07-02 13:10:55 -0700341 // Next: 10064
David Chenc8a43242017-10-17 16:23:28 -0700342 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800343 WifiBytesTransfer wifi_bytes_transfer = 10000;
344 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
345 MobileBytesTransfer mobile_bytes_transfer = 10002;
346 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800347 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800348 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800349 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800350 CpuTimePerFreq cpu_time_per_freq = 10008;
351 CpuTimePerUid cpu_time_per_uid = 10009;
352 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800353 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800354 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800355 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800356 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800357 SystemElapsedRealtime system_elapsed_realtime = 10014;
358 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800359 CpuActiveTime cpu_active_time = 10016;
360 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000361 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800362 RemainingBatteryCapacity remaining_battery_capacity = 10019;
363 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800364 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100365 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100366 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100367 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000368 DiskStats disk_stats = 10025;
369 DirectoryUsage directory_usage = 10026;
370 AppSize app_size = 10027;
371 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700372 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700373 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800374 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700375 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700376 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800377 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700378 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100379 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100380 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700381 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee60422018-11-09 12:27:37 -0800382 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
383 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
384 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000385 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800386 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800387 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800388 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000389 DebugElapsedClock debug_elapsed_clock = 10046;
390 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800391 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800392 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800393 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800394 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000395 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000396 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800397 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
398 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000399 SystemIonHeapSize system_ion_heap_size = 10056;
Carmen Agimofa769c152019-03-04 14:39:14 +0000400 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700401 FaceSettings face_settings = 10058;
Maggie White442b6312019-04-05 16:26:44 -0700402 CoolingDevice cooling_device = 10059;
Martijn Coenencd95d462019-04-25 17:09:45 +0200403 AppOps app_ops = 10060;
Rafal Slawik77987ed2019-06-17 12:28:23 +0100404 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061;
Alec Mourie088e762019-07-02 13:10:55 -0700405 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
406 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
David Chenc8a43242017-10-17 16:23:28 -0700407 }
yroa1fe77c2018-02-26 14:22:54 -0800408
Bookatz76aafcf2018-09-17 16:17:10 -0700409 // DO NOT USE field numbers above 100,000 in AOSP.
410 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
411 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700412}
413
Yao Chend54f9dd2017-10-17 17:37:48 +0000414/**
Yangster-mac20877162017-12-22 17:19:39 -0800415 * This proto represents a node of an attribution chain.
416 * Note: All attribution chains are represented as a repeated field of type
417 * AttributionNode. It is understood that in such arrays, the order is that
418 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000419 */
Yangster-mac20877162017-12-22 17:19:39 -0800420message AttributionNode {
421 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800422 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800423
Yangster-mac20877162017-12-22 17:19:39 -0800424 // The (optional) string tag for an element in the attribution chain. If the
425 // element has no tag, it is encoded as an empty string.
426 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700427}
428
Yangster-mac48b3d622018-08-18 12:38:11 -0700429message KeyValuePair {
430 optional int32 key = 1;
431 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700432 int32 value_int = 2;
433 int64 value_long = 3;
434 string value_str = 4;
435 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700436 }
437}
438
439message KeyValuePairsAtom {
440 optional int32 uid = 1;
441 repeated KeyValuePair pairs = 2;
442}
443
Yao Chend54f9dd2017-10-17 17:37:48 +0000444/*
445 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800446 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000447 *
448 * RULES:
449 * - The field ids for each atom must start at 1, and count upwards by 1.
450 * Skipping field ids is not allowed.
451 * - These form an API, so renaming, renumbering or removing fields is
452 * not allowed between android releases. (This is not currently enforced,
453 * but there will be a tool to enforce this restriction).
454 * - The types must be built-in protocol buffer types, namely, no sub-messages
455 * are allowed (yet). The bytes type is also not allowed.
456 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800457 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000458 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800459 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000460 * - A field that is a uid should be a string field, tagged with the [xxx]
461 * annotation. The generated code on android will be represented by UIDs,
462 * and those UIDs will be translated in xxx to those strings.
463 *
464 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700465 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000466 * - If there is a UID, it goes first. Think in an object-oriented fashion.
467 * *****************************************************************************
468 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700469
Yao Chend54f9dd2017-10-17 17:37:48 +0000470/**
Tej Singha72344992019-04-17 18:55:08 -0700471 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700472 * Logs when the Thermal service HAL notifies the throttling start/stop events.
473 *
474 * Logged from:
475 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
476 */
477message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700478 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700479 optional android.os.TemperatureTypeEnum sensor_type = 1;
480
Maggie White442b6312019-04-05 16:26:44 -0700481 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700482 enum State {
483 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700484 START = 1; // START indicated that throttling was triggered.
485 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700486 }
Yangster-mace16189a2018-08-26 12:20:16 -0700487 optional State state = 2;
488
489 optional float temperature = 3;
490}
491
492/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000493 * Logs when the screen state changes.
494 *
495 * Logged from:
496 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
497 */
498message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800499 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700500 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700501}
Yao Chend54f9dd2017-10-17 17:37:48 +0000502
503/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700504 * Logs that the process state of the uid, as determined by ActivityManager
505 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000506 *
507 * Logged from:
508 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
509 */
Bookatzc1a050a2017-10-10 15:49:28 -0700510message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700511 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000512
Bookatzdb026a22018-01-10 19:01:56 -0800513 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700514 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000515}
516
517/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700518 * Logs process state change of a process, as per the activity manager.
519 *
520 * Logged from:
521 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
522 */
523message ProcessStateChanged {
524 optional int32 uid = 1;
525 optional string process_name = 2;
526 optional string package_name = 3;
527 // TODO: remove this when validation is done
528 optional int64 version = 5;
529 // The state, from frameworks/base/core/proto/android/app/enums.proto.
530 optional android.app.ProcessStateEnum state = 4;
531}
532
533/**
534 * Logs when ActivityManagerService sleep state is changed.
535 *
536 * Logged from:
537 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
538 */
539message ActivityManagerSleepStateChanged {
540 // TODO: import frameworks proto
541 enum State {
542 UNKNOWN = 0;
543 ASLEEP = 1;
544 AWAKE = 2;
545 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700546 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700547}
548
549/**
550 * Logs when system memory state changes.
551 *
552 * Logged from:
553 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
554 */
555message MemoryFactorStateChanged {
556 // TODO: import frameworks proto
557 enum State {
558 MEMORY_UNKNOWN = 0;
559 NORMAL = 1; // normal.
560 MODERATE = 2; // moderate memory pressure.
561 LOW = 3; // low memory.
562 CRITICAL = 4; // critical memory.
563
564 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700565 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700566}
567
568/**
569 * Logs when app is using too much cpu, according to ActivityManagerService.
570 *
571 * Logged from:
572 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
573 */
574message ExcessiveCpuUsageReported {
575 optional int32 uid = 1;
576 optional string process_name = 2;
577 optional string package_name = 3;
578 // package version. TODO: remove this when validation is done
579 optional int64 version = 4;
580}
581
582/**
583 * Logs when a cached process is killed, along with its pss.
584 *
585 * Logged from:
586 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
587 */
588message CachedKillReported {
589 optional int32 uid = 1;
590 optional string process_name = 2;
591 optional string package_name = 3;
592 // TODO: remove this when validation is done
593 optional int64 version = 5;
594 optional int64 pss = 4;
595}
596
597/**
598 * Logs when memory stats of a process is reported.
599 *
600 * Logged from:
601 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
602 */
603message ProcessMemoryStatReported {
604 optional int32 uid = 1;
605 optional string process_name = 2;
606 optional string package_name = 3;
607 //TODO: remove this when validation is done
608 optional int64 version = 9;
609 optional int64 pss = 4;
610 optional int64 uss = 5;
611 optional int64 rss = 6;
612 enum Type {
613 ADD_PSS_INTERNAL_SINGLE = 0;
614 ADD_PSS_INTERNAL_ALL_MEM = 1;
615 ADD_PSS_INTERNAL_ALL_POLL = 2;
616 ADD_PSS_EXTERNAL = 3;
617 ADD_PSS_EXTERNAL_SLOW = 4;
618 }
619 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800620 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700621}
622
623/**
Bookatzc1a050a2017-10-10 15:49:28 -0700624 * Logs that a process started, finished, crashed, or ANRed.
625 *
626 * Logged from:
627 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
628 */
629message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700630 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700631
David Chen0b5c90c2018-01-25 16:51:49 -0800632 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800633 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700634
Bookatzddccf0a2017-11-28 16:48:14 -0800635 // What lifecycle state the process changed to.
636 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800637 enum State {
638 FINISHED = 0;
639 STARTED = 1;
640 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800641 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800642 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700643}
644
Bookatzc1a050a2017-10-10 15:49:28 -0700645/**
646 * Logs when the ble scan state changes.
647 *
648 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700649 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700650 */
651message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800652 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700653
654 enum State {
655 OFF = 0;
656 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700657 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
658 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700659 }
660 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700661
Bookatze5ec0b42018-03-26 13:34:56 -0700662 // Does the scan have a filter.
663 optional bool is_filtered = 3;
664 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
665 optional bool is_first_match = 4;
666 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
667 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700668}
669
670/**
671 * Logs reporting of a ble scan finding results.
672 *
673 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700674 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700675 */
Bookatzae6738e2018-09-13 11:38:56 -0700676// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700677message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800678 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700679
680 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800681 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700682}
683
684/**
685 * Logs when a sensor state changes.
686 *
687 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700688 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700689 */
690message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800691 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700692
Bookatzc1a050a2017-10-10 15:49:28 -0700693 // The id (int) of the sensor.
694 optional int32 sensor_id = 2;
695
696 enum State {
697 OFF = 0;
698 ON = 1;
699 }
700 optional State state = 3;
701}
702
Bookatzc1a050a2017-10-10 15:49:28 -0700703/**
704 * Logs when GPS state changes.
705 *
706 * Logged from:
707 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
708 */
709message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800710 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700711
712 enum State {
713 OFF = 0;
714 ON = 1;
715 }
716 optional State state = 2;
717}
718
Bookatz48d362e2018-11-06 15:49:08 -0800719/**
720 * Logs when GPS signal quality.
721 *
722 * Logged from:
723 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
724 */
725message GpsSignalQualityChanged {
726 optional android.server.location.GpsSignalQualityEnum level = 1;
727}
728
Bookatzc1a050a2017-10-10 15:49:28 -0700729
730/**
731 * Logs when a sync manager sync state changes.
732 *
733 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700734 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700735 */
736message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800737 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700738
David Chen0b5c90c2018-01-25 16:51:49 -0800739 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800740 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700741
742 enum State {
743 OFF = 0;
744 ON = 1;
745 }
746 optional State state = 3;
747}
748
Yangster-mac96353002018-09-05 11:18:55 -0700749/*
750 * Deferred job stats.
751 *
752 * Logged from:
753 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
754*/
755message DeferredJobStatsReported {
756 repeated AttributionNode attribution_node = 1;
757
758 // Number of jobs deferred.
759 optional int32 num_jobs_deferred = 2;
760
761 // Time since the last job runs.
762 optional int64 time_since_last_job_millis = 3;
763}
764
Bookatzc1a050a2017-10-10 15:49:28 -0700765/**
766 * Logs when a job scheduler job state changes.
767 *
768 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700769 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700770 */
771message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800772 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700773
774 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800775 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700776
777 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800778 FINISHED = 0;
779 STARTED = 1;
780 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700781 }
782 optional State state = 3;
783
Tej Singh33a412b2018-03-16 18:43:59 -0700784 // The reason a job has stopped.
785 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700786 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700787 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100788
789 // The standby bucket of the app that scheduled the job. These match the framework constants
790 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
791 // already assigned 0.
792 enum Bucket {
793 UNKNOWN = -1;
794 ACTIVE = 0;
795 WORKING_SET = 1;
796 FREQUENT = 2;
797 RARE = 3;
798 NEVER = 4;
799 }
800 optional Bucket standby_bucket = 5 [default = UNKNOWN];
801
802 // The job id (as assigned by the app).
803 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700804}
805
806/**
807 * Logs when the audio state changes.
808 *
809 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700810 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700811 */
812message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800813 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700814
815 enum State {
816 OFF = 0;
817 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700818 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
819 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700820 }
821 optional State state = 2;
822}
823
824/**
825 * Logs when the video codec state changes.
826 *
827 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700828 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700829 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800830message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800831 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700832
833 enum State {
834 OFF = 0;
835 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700836 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
837 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700838 }
839 optional State state = 2;
840}
841
842/**
843 * Logs when the flashlight state changes.
844 *
845 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700846 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700847 */
848message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800849 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700850
851 enum State {
852 OFF = 0;
853 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700854 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
855 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700856 }
857 optional State state = 2;
858}
859
860/**
861 * Logs when the camera state changes.
862 *
863 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700864 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700865 */
866message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800867 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700868
869 enum State {
870 OFF = 0;
871 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700872 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
873 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700874 }
875 optional State state = 2;
876}
877
878/**
879 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000880 *
881 * Logged from:
882 * TODO
883 */
Bookatzd6746242017-10-24 18:39:35 -0700884message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800885 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000886
Bookatz1a1b0462018-01-12 11:47:03 -0800887 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
888 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700889 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700890
891 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
892 optional string tag = 3;
893
894 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800895 RELEASE = 0;
896 ACQUIRE = 1;
897 CHANGE_RELEASE = 2;
898 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700899 }
900 optional State state = 4;
901}
902
903/**
Bookatzc1a050a2017-10-10 15:49:28 -0700904 * Logs when a partial wakelock is considered 'long' (over 1 min).
905 *
906 * Logged from:
907 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
908 */
909message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800910 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700911
Yao Chend54f9dd2017-10-17 17:37:48 +0000912 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
913 optional string tag = 2;
914
Bookatzc1a050a2017-10-10 15:49:28 -0700915 // TODO: I have no idea what this is.
916 optional string history_tag = 3;
917
918 enum State {
919 OFF = 0;
920 ON = 1;
921 }
922 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000923}
924
Bookatzc1a050a2017-10-10 15:49:28 -0700925/**
Bookatza66083f2018-09-20 17:24:00 -0700926 * Logs when the device is interactive, according to the PowerManager Notifier.
927 *
928 * Logged from:
929 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
930 */
931message InteractiveStateChanged {
932 enum State {
933 OFF = 0;
934 ON = 1;
935 }
936 optional State state = 1;
937}
938
939/**
Bookatzc1a050a2017-10-10 15:49:28 -0700940 * Logs Battery Saver state change.
941 *
942 * Logged from:
943 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
944 */
945message BatterySaverModeStateChanged {
946 enum State {
947 OFF = 0;
948 ON = 1;
949 }
950 optional State state = 1;
951}
952
953/**
954 * Logs Doze mode state change.
955 *
956 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800957 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700958 */
959message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800960 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800961}
962
963
964/**
965 * Logs state change of Doze mode including maintenance windows.
966 *
967 * Logged from:
968 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
969 */
970message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800971 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700972}
973
974/**
975 * Logs screen brightness level.
976 *
977 * Logged from:
978 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
979 */
980message ScreenBrightnessChanged {
981 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
982 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700983}
984
985/**
986 * Logs battery level (percent full, from 0 to 100).
987 *
988 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700989 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700990 */
991message BatteryLevelChanged {
992 // Battery level. Should be in [0, 100].
993 optional int32 battery_level = 1;
994}
995
996/**
997 * Logs change in charging status of the device.
998 *
999 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001000 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001001 */
1002message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001003 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1004 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001005}
1006
1007/**
1008 * Logs whether the device is plugged in, and what power source it is using.
1009 *
1010 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001011 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001012 */
1013message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001014 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1015 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001016}
1017
Bookatz8c6571b2017-10-24 15:04:41 -07001018/**
1019 * Logs when an app's wakeup alarm fires.
1020 *
1021 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001022 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001023 */
1024message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001025 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001026
1027 // Name of the wakeup alarm.
1028 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001029
1030 // Name of source package (for historical reasons, since BatteryStats tracked it).
1031 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001032
1033 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1034 enum Bucket {
1035 UNKNOWN = 0;
1036 EXEMPTED = 5;
1037 ACTIVE = 10;
1038 WORKING_SET = 20;
1039 FREQUENT = 30;
1040 RARE = 40;
1041 NEVER = 50;
1042 }
1043 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1044 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001045}
1046
1047/**
1048 * Logs when an an app causes the mobile radio to change state.
1049 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1050 *
1051 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001052 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001053 */
1054message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001055 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001056
Bookatz1a1b0462018-01-12 11:47:03 -08001057 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1058 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001059}
1060
1061/**
1062 * Logs when an an app causes the wifi radio to change state.
1063 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1064 *
1065 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001066 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001067 */
1068message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001069 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001070
Bookatz1a1b0462018-01-12 11:47:03 -08001071 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1072 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001073}
1074
1075/**
1076 * Logs kernel wakeup reasons and aborts.
1077 *
1078 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001079 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001080 */
1081message KernelWakeupReported {
1082 // Name of the kernel wakeup reason (or abort).
1083 optional string wakeup_reason_name = 1;
1084
1085 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001086 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001087}
1088
1089/**
Bookatzda1798c2018-12-13 14:16:00 -08001090 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001091 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001092 *
1093 * Logged from:
1094 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1095 */
1096message WifiEnabledStateChanged {
1097 enum State {
1098 OFF = 0;
1099 ON = 1;
1100 }
1101 optional State state = 1;
1102}
1103
1104/**
1105 * 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 -08001106 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1107 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001108 *
1109 * Logged from:
1110 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1111 */
1112message WifiRunningStateChanged {
1113 repeated AttributionNode attribution_node = 1;
1114
1115 enum State {
1116 OFF = 0;
1117 ON = 1;
1118 }
1119 optional State state = 2;
1120}
1121
1122/**
Bookatze5885242017-10-24 20:10:31 -07001123 * Logs wifi locks held by an app.
1124 *
1125 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001126 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001127 */
1128message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001129 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001130
1131 enum State {
1132 OFF = 0;
1133 ON = 1;
1134 }
1135 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001136
1137 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1138 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001139}
1140
1141/**
1142 * Logs wifi signal strength changes.
1143 *
1144 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001145 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001146 */
1147message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001148 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1149 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001150}
1151
1152/**
1153 * Logs wifi scans performed by an app.
1154 *
1155 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001156 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001157 */
1158message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001159 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001160
1161 enum State {
1162 OFF = 0;
1163 ON = 1;
1164 }
1165 optional State state = 2;
1166}
1167
1168/**
Tej Singh4503e102018-01-04 14:35:01 -08001169 * Logs wifi multicast locks held by an app
1170 *
1171 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001172 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001173 */
1174message WifiMulticastLockStateChanged {
1175 repeated AttributionNode attribution_node = 1;
1176
1177 enum State {
1178 OFF = 0;
1179 ON = 1;
1180 }
1181 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001182
1183 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001184}
1185
1186/**
Tej Singh1ea42892018-01-19 09:27:00 -08001187 * Logs shutdown reason and duration on next boot.
1188 *
1189 * Logged from:
1190 * frameworks/base/core/java/com/android/server/BootReceiver.java
1191 */
1192message ShutdownSequenceReported {
1193 // True if shutdown is for a reboot. Default: false if we do not know.
1194 optional bool reboot = 1;
1195
1196 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1197 optional string reason = 2;
1198
1199 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1200 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001201 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001202
1203 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001204 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001205}
1206
Tej Singh6483ea42018-01-25 17:45:49 -08001207
1208/**
1209 * Logs boot reason and duration.
1210 *
1211 * Logged from:
1212 * system/core/bootstat/bootstat.cpp
1213 */
1214message BootSequenceReported {
1215 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1216 // Default: "<EMPTY>" if not available.
1217 optional string bootloader_reason = 1;
1218
1219 // Reason for system boot. Eg. bootloader, reboot,userrequested
1220 // Default: "<EMPTY>" if not available.
1221 optional string system_reason = 2;
1222
1223 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001224 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001225
1226 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001227 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001228
1229 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001230 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001231
1232 // Time since last boot in ms. Default: 0 if not available.
1233 optional int64 time_since_last_boot = 6;
1234}
1235
Tej Singhc477d9c2018-02-05 18:31:39 -08001236
1237/**
1238 * Logs call state and disconnect cause (if applicable).
1239 *
1240 * Logged from:
1241 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1242 */
1243message CallStateChanged {
1244 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1245 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1246 optional android.telecom.CallStateEnum call_state = 1;
1247
1248 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1249 // This value is only applicable when the call_state is DISCONNECTED, and
1250 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1251 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1252 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1253
1254 // True if the call is self-managed, which are apps that use the
1255 // telecom infrastructure to make their own calls.
1256 optional bool self_managed = 3;
1257
1258 // True if call is external. External calls are calls on connected Wear
1259 // devices but show up in Telecom so the user can pull them onto the device.
1260 optional bool external_call = 4;
1261}
1262
Tej Singh1ea42892018-01-19 09:27:00 -08001263/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001264 * Logs keyguard state. The keyguard is the lock screen.
1265 *
1266 * Logged from:
1267 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1268 */
1269message KeyguardStateChanged {
1270 enum State {
1271 UNKNOWN = 0;
1272 // The keyguard is hidden when the phone is unlocked.
1273 HIDDEN = 1;
1274 // The keyguard is shown when the phone is locked (screen turns off).
1275 SHOWN= 2;
1276 // The keyguard is occluded when something is overlaying the keyguard.
1277 // Eg. Opening the camera while on the lock screen.
1278 OCCLUDED = 3;
1279 }
1280 optional State state = 1;
1281}
1282
1283/**
1284 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1285 * prompts the user to enter a password (pattern, pin, etc).
1286 *
1287 * Logged from:
1288 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1289 */
1290
1291message KeyguardBouncerStateChanged {
1292 enum State {
1293 UNKNOWN = 0;
1294 // Bouncer is hidden, either as a result of successfully entering the
1295 // password, screen timing out, or user going back to lock screen.
1296 HIDDEN = 1;
1297 // This is when the user is being prompted to enter the password.
1298 SHOWN = 2;
1299 }
1300 optional State state = 1;
1301}
1302
1303/**
1304 * Logs the result of entering a password into the keyguard bouncer.
1305 *
1306 * Logged from:
1307 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1308 */
1309message KeyguardBouncerPasswordEntered {
1310 enum BouncerResult {
1311 UNKNOWN = 0;
1312 // The password entered was incorrect.
1313 FAILURE = 1;
1314 // The password entered was correct.
1315 SUCCESS = 2;
1316 }
1317 optional BouncerResult result = 1;
1318}
1319
Tej Singha883b372018-02-15 11:30:01 -08001320/*
1321 * Logs changes to the configuration of the device. The configuration is defined
1322 * in frameworks/base/core/java/android/content/res/Configuration.java
1323 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1324 * Please go there to interpret the possible values each field can be.
1325 *
1326 * Logged from:
1327 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1328 */
1329message ResourceConfigurationChanged {
1330 // Bit mask of color capabilities of the screen.
1331 // Contains information about the color gamut and hdr mode of the screen.
1332 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001333 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001334
1335 // The target screen density being rendered to.
1336 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001337 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001338
1339 // Current user preference for the scaling factor for fonts,
1340 // relative to the base density scaling.
1341 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001342 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001343
1344 // Flag indicating whether the hard keyboard is hidden.
1345 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001346 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001347
1348 // The type of keyboard attached to the device.
1349 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1350 optional int32 keyboard = 5;
1351
1352 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1353 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001354 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001355
1356 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1357 // 0 if undefined.
1358 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1359 optional int32 mcc = 7;
1360
1361 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1362 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1363 // MNC_ZERO symbol defined in Configuration.java.
1364 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1365 optional int32 mnc = 8;
1366
1367 // The kind of navigation available on the device.
1368 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1369 optional int32 navigation = 9;
1370
1371 // Flag indicating whether the navigation is available.
1372 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001373 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001374
1375 // Overall orientation of the screen.
1376 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1377 optional int32 orientation = 11;
1378
1379 // The current height of the available screen space, in dp units.
1380 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001381 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001382
1383 // Bit mask of overall layout of the screen.
1384 // Contains information about screen size, whether the screen is wider/taller
1385 // than normal, whether the screen layout is right-tl-left or left-to-right,
1386 // and whether the screen has a rounded shape.
1387 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001388 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001389
1390 // Current width of the available screen space, in dp units.
1391 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001392 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001393
1394 // The smallest screen size an application will see in normal operation.
1395 // This is the smallest value of both screenWidthDp and screenHeightDp
1396 // in portrait and landscape.
1397 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001398 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001399
1400 // The type of touch screen attached to the device.
1401 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1402 optional int32 touchscreen = 16;
1403
1404 // Bit mask of the ui mode.
1405 // Contains information about the overall ui mode of the device.
1406 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1407 // Also contains information about whether the device is in night mode.
1408 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001409 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001410}
1411
Tej Singheee317b2018-03-07 19:28:05 -08001412
1413/**
1414 * Logs changes in the connection state of the mobile radio.
1415 *
1416 * Logged from:
1417 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1418 */
1419message MobileConnectionStateChanged {
1420 // States are from the state machine DataConnection.java.
1421 enum State {
1422 UNKNOWN = 0;
1423 // The connection is inactive, or disconnected.
1424 INACTIVE = 1;
1425 // The connection is being activated, or connecting.
1426 ACTIVATING = 2;
1427 // The connection is active, or connected.
1428 ACTIVE = 3;
1429 // The connection is disconnecting.
1430 DISCONNECTING = 4;
1431 // The connection is disconnecting after creating a connection.
1432 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1433 }
1434 optional State state = 1;
1435 // For multi-sim phones, this distinguishes between the sim cards.
1436 optional int32 sim_slot_index = 2;
1437 // Used to identify the connection. Starts at 0 and increments by 1 for
1438 // every new network created. Resets whenever the device reboots.
1439 optional int32 data_connection_id = 3;
1440 // A bitmask for the capabilities of this connection.
1441 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1442 // Default value (if we have no information): 0
1443 optional int64 capabilities = 4;
1444 // If this connection has internet.
1445 // This just checks if the DEFAULT bit of capabilities is set.
1446 optional bool has_internet = 5;
1447}
1448
1449/**
1450 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1451 *
1452 * Logged from:
1453 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1454 */
1455message MobileRadioTechnologyChanged {
1456 optional android.telephony.NetworkTypeEnum state = 1;
1457 // For multi-sim phones, this distinguishes between the sim cards.
1458 optional int32 sim_slot_index = 2;
1459}
1460
Andrew Chantb56388b2018-03-22 21:07:33 -07001461/**
1462 * Logs the VID and PID of any connected USB devices.
1463 *
1464 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1465 *
1466 * Logged by Vendor.
1467 */
1468message UsbDeviceAttached {
1469 optional int32 vid = 1;
1470 optional int32 pid = 2;
1471 optional bool has_audio = 3;
1472 optional bool has_hid = 4;
1473 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001474 enum State {
1475 STATE_DISCONNECTED = 0;
1476 STATE_CONNECTED = 1;
1477 }
1478 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001479 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001480}
1481
Tej Singheee317b2018-03-07 19:28:05 -08001482
Tej Singhdd7bd352018-02-09 19:33:15 -08001483/**
Tej Singh5d991e12018-03-09 19:48:11 -08001484 * Logs when Bluetooth is enabled and disabled.
1485 *
1486 * Logged from:
1487 * services/core/java/com/android/server/BluetoothManagerService.java
1488 */
1489message BluetoothEnabledStateChanged {
1490 repeated AttributionNode attribution_node = 1;
1491 // Whether or not bluetooth is enabled on the device.
1492 enum State {
1493 UNKNOWN = 0;
1494 ENABLED = 1;
1495 DISABLED = 2;
1496 }
1497 optional State state = 2;
1498 // The reason for being enabled/disabled.
1499 // Eg. Airplane mode, crash, application request.
1500 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1501 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001502 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001503}
1504
1505/**
Jack Hed9837c82019-01-09 01:19:13 -08001506 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001507 *
1508 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001509 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1510 *
1511 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001512 */
1513message BluetoothConnectionStateChanged {
1514 // The state of the connection.
1515 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1516 optional android.bluetooth.ConnectionStateEnum state = 1;
1517 // An identifier that can be used to match connect and disconnect events.
1518 // Currently is last two bytes of a hash of a device level ID and
1519 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001520 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001521 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001522 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1523 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001524 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001525 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001526 // An identifier that can be used to match events for this device.
1527 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1528 // Salt: Randomly generated 256 bit value
1529 // Hash algorithm: HMAC-SHA256
1530 // Size: 32 byte
1531 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001532 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001533}
1534
1535/**
1536 * Logs when a Bluetooth device connects and disconnects over ACL
1537 *
1538 * Logged from:
1539 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1540 *
1541 * Next Tag: 3
1542 */
1543message BluetoothAclConnectionStateChanged {
1544 // An identifier that can be used to match events for this device.
1545 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1546 // Salt: Randomly generated 256 bit value
1547 // Hash algorithm: HMAC-SHA256
1548 // Size: 32 byte
1549 // Default: null or empty if the device identifier is not known
1550 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1551 // The state of the connection.
1552 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1553 optional android.bluetooth.ConnectionStateEnum state = 2;
1554}
1555
1556/**
1557 * Logs when a Bluetooth device connects and disconnects over SCO
1558 *
1559 * Logged from:
1560 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1561 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1562 *
1563 * Next Tag: 4
1564 */
1565message BluetoothScoConnectionStateChanged {
1566 // An identifier that can be used to match events for this device.
1567 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1568 // Salt: Randomly generated 256 bit value
1569 // Hash algorithm: HMAC-SHA256
1570 // Size: 32 byte
1571 // Default: null or empty if the device identifier is not known
1572 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1573 // The state of the connection.
1574 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1575 optional android.bluetooth.ConnectionStateEnum state = 2;
1576 // Codec used for this SCO connection
1577 // Default: UNKNOWN
1578 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001579}
1580
Jack Hec27040a2019-01-09 20:54:41 -08001581/**
1582 * Logged when active device of a profile changes
1583 *
1584 * Logged from:
1585 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1586 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1587 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1588 */
1589message BluetoothActiveDeviceChanged {
1590 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1591 // From android.bluetooth.BluetoothProfile
1592 optional int32 bt_profile = 1;
1593 // An identifier that can be used to match events for this new active device.
1594 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1595 // Salt: Randomly generated 256 bit value
1596 // Hash algorithm: HMAC-SHA256
1597 // Size: 32 byte
1598 // Default: null or empty if there is no active device for this profile
1599 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1600}
1601
Jack Heab86dbd22018-12-18 15:43:27 -08001602// Logs when there is an event affecting Bluetooth device's link layer connection.
1603// - This event is triggered when there is a related HCI command or event
1604// - Users of this metrics can deduce Bluetooth device's connection state from these events
1605// - HCI commands are logged before the command is sent, after receiving command status, and after
1606// receiving command complete
1607// - HCI events are logged when they arrive
1608//
1609// Low level log from system/bt
1610//
1611// Bluetooth classic commands:
1612// - CMD_CREATE_CONNECTION
1613// - CMD_DISCONNECT
1614// - CMD_CREATE_CONNECTION_CANCEL
1615// - CMD_ACCEPT_CONNECTION_REQUEST
1616// - CMD_REJECT_CONNECTION_REQUEST
1617// - CMD_SETUP_ESCO_CONNECTION
1618// - CMD_ACCEPT_ESCO_CONNECTION
1619// - CMD_REJECT_ESCO_CONNECTION
1620// - CMD_ENH_SETUP_ESCO_CONNECTION
1621// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1622//
1623// Bluetooth low energy commands:
1624// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1625// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1626// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1627// - CMD_BLE_CLEAR_WHITE_LIST
1628// - CMD_BLE_ADD_WHITE_LIST
1629// - CMD_BLE_REMOVE_WHITE_LIST
1630//
1631// Bluetooth classic events:
1632// - EVT_CONNECTION_COMP
1633// - EVT_CONNECTION_REQUEST
1634// - EVT_DISCONNECTION_COMP
1635// - EVT_ESCO_CONNECTION_COMP
1636// - EVT_ESCO_CONNECTION_CHANGED
1637//
1638// Bluetooth low energy meta events:
1639// - BLE_EVT_CONN_COMPLETE_EVT
1640// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1641//
1642// Next tag: 10
1643message BluetoothLinkLayerConnectionEvent {
1644 // An identifier that can be used to match events for this device.
1645 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1646 // Salt: Randomly generated 256 bit value
1647 // Hash algorithm: HMAC-SHA256
1648 // Size: 32 byte
1649 // Default: null or empty if the device identifier is not known
1650 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1651 // Connection handle of this connection if available
1652 // Range: 0x0000 - 0x0EFF (12 bits)
1653 // Default: 0xFFFF if the handle is unknown
1654 optional int32 connection_handle = 2;
1655 // Direction of the link
1656 // Default: DIRECTION_UNKNOWN
1657 optional android.bluetooth.DirectionEnum direction = 3;
1658 // Type of this link
1659 // Default: LINK_TYPE_UNKNOWN
1660 optional android.bluetooth.LinkTypeEnum type = 4;
1661
1662 // Reason metadata for this link layer connection event, rules for interpretation:
1663 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1664 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1665 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1666 // set and valid, ignore hci_ble_event
1667
1668 // HCI command associated with this event
1669 // Default: CMD_UNKNOWN
1670 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1671 // HCI event associated with this event
1672 // Default: EVT_UNKNOWN
1673 optional android.bluetooth.hci.EventEnum hci_event = 6;
1674 // HCI BLE meta event associated with this event
1675 // Default: BLE_EVT_UNKNOWN
1676 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1677 // HCI command status code if this is triggerred by hci_cmd
1678 // Default: STATUS_UNKNOWN
1679 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1680 // HCI reason code associated with this event
1681 // Default: STATUS_UNKNOWN
1682 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1683}
1684
Howard Roe103fe22019-01-17 16:52:16 -08001685/**
1686 * Logs when a module is rolled back by Watchdog.
1687 *
1688 * Logged from: Rollback Manager
1689 */
1690message WatchdogRollbackOccurred {
1691 enum RollbackType {
1692 UNKNOWN = 0;
1693 ROLLBACK_INITIATE = 1;
1694 ROLLBACK_SUCCESS = 2;
1695 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001696 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001697 }
1698 optional RollbackType rollback_type = 1;
1699
1700 optional string package_name = 2;
1701
1702 optional int32 package_version_code = 3;
1703}
1704
Jack Hec27040a2019-01-09 20:54:41 -08001705/**
1706 * Logs when there is a change in Bluetooth A2DP playback state
1707 *
1708 * Logged from:
1709 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1710 */
1711message BluetoothA2dpPlaybackStateChanged {
1712 // An identifier that can be used to match events for this device.
1713 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1714 // Salt: Randomly generated 256 bit value
1715 // Hash algorithm: HMAC-SHA256
1716 // Size: 32 byte
1717 // Default: null or empty if the device identifier is not known
1718 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1719 // Current playback state
1720 // Default: PLAYBACK_STATE_UNKNOWN
1721 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1722 // Current audio coding mode
1723 // Default: AUDIO_CODING_MODE_UNKNOWN
1724 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1725}
1726
1727/**
1728 * Logs when there is a change in A2DP codec config for a particular remote device
1729 *
1730 * Logged from:
1731 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1732 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1733 */
1734message BluetoothA2dpCodecConfigChanged {
1735 // An identifier that can be used to match events for this device.
1736 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1737 // Salt: Randomly generated 256 bit value
1738 // Hash algorithm: HMAC-SHA256
1739 // Size: 32 byte
1740 // Default: null or empty if the device identifier is not known
1741 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1742 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1743 // Default SOURCE_CODEC_TYPE_INVALID
1744 optional int32 codec_type = 2;
1745 // Codec priroity, the higher the more preferred, -1 for disabled
1746 // Default: CODEC_PRIORITY_DEFAULT
1747 optional int32 codec_priority = 3;
1748 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1749 // Default: SAMPLE_RATE_NONE
1750 optional int32 sample_rate = 4;
1751 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1752 // Default: BITS_PER_SAMPLE_NONE
1753 optional int32 bits_per_sample = 5;
1754 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1755 // Default: CHANNEL_MODE_NONE
1756 optional int32 channel_mode = 6;
1757 // Codec specific values
1758 // Default 0
1759 optional int64 codec_specific_1 = 7;
1760 optional int64 codec_specific_2 = 8;
1761 optional int64 codec_specific_3 = 9;
1762 optional int64 codec_specific_4 = 10;
1763}
1764
1765/**
1766 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1767 * Each codec's capability is logged separately due to statsd restriction
1768 *
1769 * Logged from:
1770 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1771 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1772 */
1773message BluetoothA2dpCodecCapabilityChanged {
1774 // An identifier that can be used to match events for this device.
1775 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1776 // Salt: Randomly generated 256 bit value
1777 // Hash algorithm: HMAC-SHA256
1778 // Size: 32 byte
1779 // Default: null or empty if the device identifier is not known
1780 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1781 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1782 // Default SOURCE_CODEC_TYPE_INVALID
1783 optional int32 codec_type = 2;
1784 // Codec priroity, the higher the more preferred, -1 for disabled
1785 // Default: CODEC_PRIORITY_DEFAULT
1786 optional int32 codec_priority = 3;
1787 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1788 // in BluetoothCodecConfig
1789 // Default: empty and SAMPLE_RATE_NONE for individual item
1790 optional int32 sample_rate = 4;
1791 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1792 // in BluetoothCodecConfig
1793 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1794 optional int32 bits_per_sample = 5;
1795 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1796 // BluetoothCodecConfig
1797 // Default: empty and CHANNEL_MODE_NONE for individual item
1798 optional int32 channel_mode = 6;
1799 // Codec specific values
1800 // Default 0
1801 optional int64 codec_specific_1 = 7;
1802 optional int64 codec_specific_2 = 8;
1803 optional int64 codec_specific_3 = 9;
1804 optional int64 codec_specific_4 = 10;
1805}
1806
1807/**
1808 * Logs when A2DP failed to read from PCM source.
1809 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1810 *
1811 * Logged from:
1812 * system/bt
1813 */
1814message BluetoothA2dpAudioUnderrunReported {
1815 // An identifier that can be used to match events for this device.
1816 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1817 // Salt: Randomly generated 256 bit value
1818 // Hash algorithm: HMAC-SHA256
1819 // Size: 32 byte
1820 // Default: null or empty if the device identifier is not known
1821 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1822 // Encoding interval in nanoseconds
1823 // Default: 0
1824 optional int64 encoding_interval_nanos = 2;
1825 // Number of bytes of PCM data that could not be read from the source
1826 // Default: 0
1827 optional int32 num_missing_pcm_bytes = 3;
1828}
1829
1830/**
1831 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1832 * buffer queue is full and we have to drop data
1833 *
1834 * Logged from:
1835 * system/bt
1836 */
1837message BluetoothA2dpAudioOverrunReported {
1838 // An identifier that can be used to match events for this device.
1839 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1840 // Salt: Randomly generated 256 bit value
1841 // Hash algorithm: HMAC-SHA256
1842 // Size: 32 byte
1843 // Default: null or empty if the device identifier is not known
1844 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1845 // Encoding interval in nanoseconds
1846 // Default: 0
1847 optional int64 encoding_interval_nanos = 2;
1848 // Number of buffers dropped in this event
1849 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1850 // Default: 0
1851 optional int32 num_dropped_buffers = 3;
1852 // Number of encoded buffers dropped in this event
1853 // Default 0
1854 optional int32 num_dropped_encoded_frames = 4;
1855 // Number of encoded bytes dropped in this event
1856 // Default: 0
1857 optional int32 num_dropped_encoded_bytes = 5;
1858}
1859
1860/**
1861 * Logs when we receive reports regarding a device's RSSI value
1862 *
1863 * Logged from:
1864 * system/bt
1865 */
1866message BluetoothDeviceRssiReported {
1867 // An identifier that can be used to match events for this device.
1868 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1869 // Salt: Randomly generated 256 bit value
1870 // Hash algorithm: HMAC-SHA256
1871 // Size: 32 byte
1872 // Default: null or empty if the device identifier is not known
1873 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1874 // Connection handle of this connection if available
1875 // Range: 0x0000 - 0x0EFF (12 bits)
1876 // Default: 0xFFFF if the handle is unknown
1877 optional int32 connection_handle = 2;
1878 // HCI command status code if this is triggerred by hci_cmd
1879 // Default: STATUS_UNKNOWN
1880 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1881 // BR/EDR
1882 // Range: -128 ≤ N ≤ 127 (signed integer)
1883 // Units: dB
1884 // LE:
1885 // Range: -127 to 20, 127 (signed integer)
1886 // Units: dBm
1887 // Invalid when an out of range value is reported
1888 optional int32 rssi = 4;
1889}
1890
1891/**
1892 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1893 *
1894 * Logged from:
1895 * system/bt
1896 */
1897message BluetoothDeviceFailedContactCounterReported {
1898 // An identifier that can be used to match events for this device.
1899 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1900 // Salt: Randomly generated 256 bit value
1901 // Hash algorithm: HMAC-SHA256
1902 // Size: 32 byte
1903 // Default: null or empty if the device identifier is not known
1904 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1905 // Connection handle of this connection if available
1906 // Range: 0x0000 - 0x0EFF (12 bits)
1907 // Default: 0xFFFF if the handle is unknown
1908 optional int32 connection_handle = 2;
1909 // HCI command status code if this is triggerred by hci_cmd
1910 // Default: STATUS_UNKNOWN
1911 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1912 // Number of consecutive failed contacts for a connection corresponding to the Handle
1913 // Range: uint16_t, 0-0xFFFF
1914 // Default: 0xFFFFF
1915 optional int32 failed_contact_counter = 4;
1916}
1917
1918/**
1919 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1920 *
1921 * Logged from:
1922 * system/bt
1923 */
1924message BluetoothDeviceTxPowerLevelReported {
1925 // An identifier that can be used to match events for this device.
1926 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1927 // Salt: Randomly generated 256 bit value
1928 // Hash algorithm: HMAC-SHA256
1929 // Size: 32 byte
1930 // Default: null or empty if the device identifier is not known
1931 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1932 // Connection handle of this connection if available
1933 // Range: 0x0000 - 0x0EFF (12 bits)
1934 // Default: 0xFFFF if the handle is unknown
1935 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001936 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001937 // Default: STATUS_UNKNOWN
1938 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1939 // Range: -30 ≤ N ≤ 20
1940 // Units: dBm
1941 // Invalid when an out of range value is reported
1942 optional int32 transmit_power_level = 4;
1943}
Jack Heab86dbd22018-12-18 15:43:27 -08001944
Tej Singh5d991e12018-03-09 19:48:11 -08001945/**
Jack He1021a612019-01-20 21:22:46 -08001946 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1947 * receiving an HCI command from the host
1948 *
1949 * Logged from: system/bt
1950 */
1951message BluetoothHciTimeoutReported {
1952 // HCI command associated with this event
1953 // Default: CMD_UNKNOWN
1954 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1955}
1956
1957/**
1958 * Logs when we receive Bluetooth Link Quality Report event from the controller
1959 * See Android Bluetooth HCI specification for more details
1960 *
1961 * Note: all count and bytes field are counted since last event
1962 *
1963 * Logged from: system/bt
1964 */
1965message BluetoothQualityReportReported {
1966 // Quality report ID
1967 // Original type: uint8_t
1968 // Default: BQR_ID_UNKNOWN
1969 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1970 // Packet type of the connection
1971 // Original type: uint8_t
1972 // Default: BQR_PACKET_TYPE_UNKNOWN
1973 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1974 // Connection handle of the connection
1975 // Original type: uint16_t
1976 optional int32 connection_handle = 3;
1977 // Performing Role for the connection
1978 // Original type: uint8_t
1979 optional int32 connection_role = 4;
1980 // Current Transmit Power Level for the connection. This value is the same as the controller's
1981 // response to the HCI_Read_Transmit_Power_Level HCI command
1982 // Original type: uint8_t
1983 optional int32 tx_power_level = 5;
1984 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1985 // absolute receiver signal strength value
1986 // Original type: int8_t
1987 optional int32 rssi = 6;
1988 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1989 // channels used by the link currently
1990 // Original type: uint8_t
1991 optional int32 snr = 7;
1992 // Indicates the number of unused channels in AFH_channel_map
1993 // Original type: uint8_t
1994 optional int32 unused_afh_channel_count = 8;
1995 // Indicates the number of the channels which are interfered and quality is bad but are still
1996 // selected for AFH
1997 // Original type: uint8_t
1998 optional int32 afh_select_unideal_channel_count = 9;
1999 // Current Link Supervision Timeout Setting
2000 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2001 // Original type: uint16_t
2002 optional int32 lsto = 10;
2003 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2004 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2005 // 0x01 (Piconet Clock)
2006 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2007 // Original type: uint32_t
2008 optional int64 connection_piconet_clock = 11;
2009 // The count of retransmission
2010 // Original type: uint32_t
2011 optional int64 retransmission_count = 12;
2012 // The count of no RX
2013 // Original type: uint32_t
2014 optional int64 no_rx_count = 13;
2015 // The count of NAK (Negative Acknowledge)
2016 // Original type: uint32_t
2017 optional int64 nak_count = 14;
2018 // Controller timestamp of last TX ACK
2019 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2020 // Original type: uint32_t
2021 optional int64 last_tx_ack_timestamp = 15;
2022 // The count of Flow-off (STOP)
2023 // Original type: uint32_t
2024 optional int64 flow_off_count = 16;
2025 // Controller timestamp of last Flow-on (GO)
2026 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2027 // Original type: uint32_t
2028 optional int64 last_flow_on_timestamp = 17;
2029 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2030 // Original type: uint32_t
2031 optional int64 buffer_overflow_bytes = 18;
2032 // Buffer underflow count (in byte) since last event
2033 // Original type: uint32_t
2034 optional int64 buffer_underflow_bytes = 19;
2035}
2036
2037/**
2038 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2039 *
2040 * Notes:
2041 * - Each event can be partially filled as we might learn different pieces of device
2042 * information at different time
2043 * - Multiple device info events can be combined to give more complete picture
2044 * - When multiple device info events tries to describe the same information, the
2045 * later one wins
2046 *
2047 * Logged from:
2048 * packages/apps/Bluetooth
2049 */
Jack Heaea26982019-04-04 11:19:48 -07002050message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002051 // An identifier that can be used to match events for this device.
2052 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2053 // Salt: Randomly generated 256 bit value
2054 // Hash algorithm: HMAC-SHA256
2055 // Size: 32 byte
2056 // Default: null or empty if the device identifier is not known
2057 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2058 // Where is this device info obtained from
2059 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2060 // Name of the data source
2061 // For EXTERNAL: package name of the data source
2062 // For INTERNAL: null for general case, component name otherwise
2063 optional string source_name = 3;
2064 // Name of the manufacturer of this device
2065 optional string manufacturer = 4;
2066 // Model of this device
2067 optional string model = 5;
2068 // Hardware version of this device
2069 optional string hardware_version = 6;
2070 // Software version of this device
2071 optional string software_version = 7;
2072}
2073
2074/**
2075 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2076 * device, as documented by the Bluetooth Core HCI specification
2077 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2078 * Vol 2, Part E, Page 1118
2079 *
2080 * Logged from:
2081 * system/bt
2082 */
2083message BluetoothRemoteVersionInfoReported {
2084 // Connection handle of the connection
2085 // Original type: uint16_t
2086 optional int32 connection_handle = 1;
2087 // HCI command status code
2088 // Default: STATUS_UNKNOWN
2089 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2090 // 1 byte Version of current LMP in the remote controller
2091 optional int32 lmp_version = 3;
2092 // 2 bytes LMP manufacturer code of the remote controller
2093 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2094 optional int32 lmp_manufacturer_code = 4;
2095 // 4 bytes subversion of the LMP in the remote controller
2096 optional int32 lmp_subversion = 5;
2097}
2098
2099/**
2100 * Logs when certain Bluetooth SDP attributes are discovered
2101 * Constant definitions are from:
2102 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2103 *
2104 * Current logged attributes:
2105 * - BluetoothProfileDescriptorList
2106 * - Supported Features Bitmask
2107 *
2108 * Logged from:
2109 * system/bt
2110 */
2111message BluetoothSdpAttributeReported {
2112 // An identifier that can be used to match events for this device.
2113 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2114 // Salt: Randomly generated 256 bit value
2115 // Hash algorithm: HMAC-SHA256
2116 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2117 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2118 // Original type: uint16_t
2119 optional int32 protocol_uuid = 2;
2120 // Short form UUIDs used to identify Bluetooth SDP attribute types
2121 // Original type: uint16_t
2122 optional int32 attribute_id = 3;
2123 // Attribute value for the particular attribute
2124 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2125}
2126
2127/**
2128 * Logs when bond state of a Bluetooth device changes
2129 *
2130 * Logged from:
2131 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2132 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2133 */
2134message BluetoothBondStateChanged {
2135 // An identifier that can be used to match events for this device.
2136 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2137 // Salt: Randomly generated 256 bit value
2138 // Hash algorithm: HMAC-SHA256
2139 // Size: 32 byte
2140 // Default: null or empty if the device identifier is not known
2141 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2142 // Preferred transport type to remote dual mode device
2143 // Default: TRANSPORT_AUTO means no preference
2144 optional android.bluetooth.TransportTypeEnum transport = 2;
2145 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2146 // Default: UNKNOWN
2147 optional android.bluetooth.DeviceTypeEnum type = 3;
2148 // Current bond state (NONE, BONDING, BONDED)
2149 // Default: BOND_STATE_UNKNOWN
2150 optional android.bluetooth.BondStateEnum bond_state = 4;
2151 // Bonding sub state
2152 // Default: BOND_SUB_STATE_UNKNOWN
2153 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2154 // Unbond Reason
2155 // Default: UNBOND_REASON_UNKNOWN
2156 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2157}
2158
2159/**
2160 * Logs there is an event related Bluetooth classic pairing
2161 *
2162 * Logged from:
2163 * system/bt
2164 */
2165message BluetoothClassicPairingEventReported {
2166 // An identifier that can be used to match events for this device.
2167 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2168 // Salt: Randomly generated 256 bit value
2169 // Hash algorithm: HMAC-SHA256
2170 // Size: 32 byte
2171 // Default: null or empty if the device identifier is not known
2172 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2173 // Connection handle of this connection if available
2174 // Range: 0x0000 - 0x0EFF (12 bits)
2175 // Default: 0xFFFF if the handle is unknown
2176 optional int32 connection_handle = 2;
2177 // HCI command associated with this event
2178 // Default: CMD_UNKNOWN
2179 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2180 // HCI event associated with this event
2181 // Default: EVT_UNKNOWN
2182 optional android.bluetooth.hci.EventEnum hci_event = 4;
2183 // HCI command status code if this is triggerred by hci_cmd
2184 // Default: STATUS_UNKNOWN
2185 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2186 // HCI reason code associated with this event
2187 // Default: STATUS_UNKNOWN
2188 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002189 // A status value related to this specific event
2190 // Default: 0
2191 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002192}
2193
2194/**
2195 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2196 *
2197 * Logged from:
2198 * system/bt
2199 */
2200message BluetoothSmpPairingEventReported {
2201 // An identifier that can be used to match events for this device.
2202 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2203 // Salt: Randomly generated 256 bit value
2204 // Hash algorithm: HMAC-SHA256
2205 // Size: 32 byte
2206 // Default: null or empty if the device identifier is not known
2207 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2208 // SMP command sent or received over L2CAP
2209 // Default: CMD_UNKNOWN
2210 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2211 // Whether this command is sent or received
2212 // Default: DIRECTION_UNKNOWN
2213 optional android.bluetooth.DirectionEnum direction = 3;
2214 // SMP failure reason code
2215 // Default: PAIRING_FAIL_REASON_DEFAULT
2216 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2217}
2218
2219/**
Jack He815cdba2019-01-30 17:24:55 -08002220 * Logs when a Bluetooth socket’s connection state changed
2221 *
2222 * Logged from:
2223 * system/bt
2224 */
2225message BluetoothSocketConnectionStateChanged {
2226 // An identifier that can be used to match events for this device.
2227 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2228 // Salt: Randomly generated 256 bit value
2229 // Hash algorithm: HMAC-SHA256
2230 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002231 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002232 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002233 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002234 // Default 0 when unknown or don't care
2235 optional int32 port = 2;
2236 // Socket type as mentioned in
2237 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2238 // Default: SOCKET_TYPE_UNKNOWN
2239 optional android.bluetooth.SocketTypeEnum type = 3;
2240 // Socket connection state
2241 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2242 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2243 // Number of bytes sent to remote device during this connection
2244 optional int64 tx_bytes = 5;
2245 // Number of bytes received from remote device during this connection
2246 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002247 // Socket owner's UID
2248 optional int32 uid = 7 [(is_uid) = true];
2249 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2250 // |port| must be spawned by |server_port|
2251 // Default 0 when unknown or don't care
2252 optional int32 server_port = 8;
2253 // Whether this is a server listener socket
2254 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002255}
2256
2257/**
Jack He71426802019-04-02 13:32:52 -07002258 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2259 *
2260 * Logged from:
2261 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2262 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2263 *
2264 */
2265message BluetoothClassOfDeviceReported {
2266 // An identifier that can be used to match events for this device.
2267 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2268 // Salt: Randomly generated 256 bit value
2269 // Hash algorithm: HMAC-SHA256
2270 // Size: 32 byte
2271 // Default: null or empty if this is a server listener socket
2272 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2273 // Class of Device (CoD) value including both Major, Minor device class and service class
2274 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2275 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2276 // Default: 0
2277 optional int32 class_of_device = 2;
2278}
2279
2280/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002281 * Logs when something is plugged into or removed from the USB-C connector.
2282 *
2283 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002284 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002285 */
2286message UsbConnectorStateChanged {
2287 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002288 STATE_DISCONNECTED = 0;
2289 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002290 }
2291 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002292 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002293 // Last active session in ms.
2294 // 0 when the port is in connected state.
2295 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002296}
2297
2298/**
2299 * Logs the reported speaker impedance.
2300 *
2301 * Logged from:
2302 * Vendor audio implementation.
2303 */
2304message SpeakerImpedanceReported {
2305 optional int32 speaker_location = 1;
2306 optional int32 impedance = 2;
2307}
2308
2309/**
2310 * Logs the report of a failed hardware.
2311 *
2312 * Logged from:
2313 * Vendor HALs.
2314 *
2315 */
2316message HardwareFailed {
2317 enum HardwareType {
2318 HARDWARE_FAILED_UNKNOWN = 0;
2319 HARDWARE_FAILED_MICROPHONE = 1;
2320 HARDWARE_FAILED_CODEC = 2;
2321 HARDWARE_FAILED_SPEAKER = 3;
2322 HARDWARE_FAILED_FINGERPRINT = 4;
2323 }
2324 optional HardwareType hardware_type = 1;
2325
Maggie White6dcd8572019-01-31 14:11:50 -08002326 /**
2327 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002328 * the same hardware_type. The specific locations are vendor defined integers,
2329 * referring to board-specific numbering schemes.
2330 */
2331 optional int32 hardware_location = 2;
2332
Maggie White6dcd8572019-01-31 14:11:50 -08002333 /**
2334 * failure_code is specific to the HardwareType of the failed hardware.
2335 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002336 */
Maggie White6dcd8572019-01-31 14:11:50 -08002337 enum HardwareErrorCode {
2338 UNKNOWN = 0;
2339 COMPLETE = 1;
2340 SPEAKER_HIGH_Z = 2;
2341 SPEAKER_SHORT = 3;
2342 FINGERPRINT_SENSOR_BROKEN = 4;
2343 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002344 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002345 }
2346 optional int32 failure_code = 3;
2347}
2348
2349/**
2350 * Log an event when the device has been physically dropped.
2351 * Reported from the /vendor partition.
2352 */
2353message PhysicalDropDetected {
2354 // Confidence that the event was actually a drop, 0 -> 100
2355 optional int32 confidence_pctg = 1;
2356 // Peak acceleration of the drop, in 1/1000s of a g.
2357 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002358 // Duration of freefall in ms
2359 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002360}
2361
2362/**
2363 * Log bucketed battery charge cycles.
2364 *
2365 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002366 * a given charge point. For example, if 10 cycle buckets are
2367 * initialized, bucket 1 is the lowest 1/10th of the battery,
2368 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002369 *
2370 * Logged from:
2371 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2372 */
2373message ChargeCyclesReported {
2374 optional int32 cycle_bucket_1 = 1;
2375 optional int32 cycle_bucket_2 = 2;
2376 optional int32 cycle_bucket_3 = 3;
2377 optional int32 cycle_bucket_4 = 4;
2378 optional int32 cycle_bucket_5 = 5;
2379 optional int32 cycle_bucket_6 = 6;
2380 optional int32 cycle_bucket_7 = 7;
2381 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002382 optional int32 cycle_bucket_9 = 9;
2383 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002384}
2385
2386/**
Howard Roa46b6582018-09-18 16:45:02 -07002387 * Log battery health snapshot.
2388 *
2389 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2390 * are snapshotted periodically over 24hrs.
2391 */
2392message BatteryHealthSnapshot {
2393 enum BatterySnapshotType {
2394 UNKNOWN = 0;
2395 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2396 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2397 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2398 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2399 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2400 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2401 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2402 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2403 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2404 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2405 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2406 }
2407 optional BatterySnapshotType type = 1;
2408 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002409 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002410 // Voltage Battery Voltage, in microVolts.
2411 optional int32 voltage_micro_volt = 3;
2412 // Current Battery current, in microAmps.
2413 optional int32 current_micro_amps = 4;
2414 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2415 optional int32 open_circuit_micro_volt = 5;
2416 // Resistance Battery Resistance, in microOhms.
2417 optional int32 resistance_micro_ohm = 6;
2418 // Level Battery Level, as % of full.
2419 optional int32 level_percent = 7;
2420}
2421
2422/**
2423 * Log slow I/O operations on the primary storage.
2424 */
2425message SlowIo {
2426 // Classifications of IO Operations.
2427 enum IoOperation {
2428 UNKNOWN = 0;
2429 READ = 1;
2430 WRITE = 2;
2431 UNMAP = 3;
2432 SYNC = 4;
2433 }
2434 optional IoOperation operation = 1;
2435
2436 // The number of slow IO operations of this type over 24 hours.
2437 optional int32 count = 2;
2438}
2439
2440/**
2441 * Log battery caused shutdown with the last recorded voltage.
2442 */
2443message BatteryCausedShutdown {
2444 // The last recorded battery voltage prior to shutdown.
2445 optional int32 last_recorded_micro_volt = 1;
2446}
2447
2448/**
Tej Singha72344992019-04-17 18:55:08 -07002449 * Logs when ThermalService receives throttling events.
2450 *
2451 * Logged from:
2452 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2453 */
2454message ThermalThrottlingSeverityStateChanged {
2455 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2456 optional android.os.TemperatureTypeEnum sensor_type = 1;
2457
2458 // The name of the temperature source. Eg. CPU0
2459 optional string sensor_name = 2;
2460
2461 // Temperature in tenths of a degree C.
2462 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2463 optional int32 temperature_deci_celsius = 3;
2464
2465 // Relative severity of the throttling, see enum definition.
2466 optional android.os.ThrottlingSeverityEnum severity = 4;
2467}
2468
2469/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002470 * Logs the duration of a davey (jank of >=700ms) when it occurs
2471 *
2472 * Logged from:
2473 * frameworks/base/libs/hwui/JankTracker.cpp
2474 */
2475message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002476 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002477 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002478
Tej Singhbb8554a2018-01-26 11:59:14 -08002479 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002480 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002481}
2482
2483/**
Bookatze5885242017-10-24 20:10:31 -07002484 * Logs phone signal strength changes.
2485 *
2486 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002487 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002488 */
2489message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002490 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2491 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002492}
2493
Yangster4ccebea2018-10-09 17:09:02 -07002494
2495/**
2496 * Logs when the phone state, sim state or signal strength changes
2497 *
2498 * Logged from:
2499 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2500 */
2501message PhoneServiceStateChanged {
2502 optional android.telephony.ServiceStateEnum state = 1;
2503 optional android.telephony.SimStateEnum sim_state = 2;
2504 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2505}
2506
2507/**
2508 * Logs when the phone becomes on or off.
2509 *
2510 * Logged from:
2511 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2512 */
2513message PhoneStateChanged {
2514 enum State {
2515 OFF = 0;
2516 ON = 1;
2517 }
2518 optional State state = 1;
2519}
2520
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002521message BackGesture {
2522 enum BackType {
2523 DEFAULT_BACK_TYPE = 0;
2524 COMPLETED = 1;
2525 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2526 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2527 INCOMPLETE = 4;
2528 }
2529 optional BackType type = 1;
2530
2531 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2532 enum WindowHorizontalLocation {
2533 DEFAULT_LOCATION = 0;
2534 LEFT = 1;
2535 RIGHT = 2;
2536 }
2537 optional WindowHorizontalLocation x_location = 3;
2538}
2539
2540message ExclusionRectStateChanged {
2541 optional string component_name = 1; // if not available, simply packageName
2542 optional int32 requested_height = 2; // px
2543 optional int32 rejected_height = 3; // px
2544
2545 enum WindowHorizontalLocation {
2546 DEFAULT_LOCATION = 0;
2547 LEFT = 1;
2548 RIGHT = 2;
2549 }
2550 optional WindowHorizontalLocation x_location = 4;
2551 optional bool landscape = 5;
2552 optional bool splitscreen = 6;
2553 optional int32 duration_millis = 7;
2554}
2555
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002556message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002557 optional android.stats.launcher.LauncherAction action = 1;
2558 optional android.stats.launcher.LauncherState src_state = 2;
2559 optional android.stats.launcher.LauncherState dst_state = 3;
2560 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002561 optional bool is_swipe_up_enabled = 5;
2562}
2563
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002564message StyleUIChanged {
2565 optional android.stats.style.Action action = 1;
2566 optional int32 color_package_hash = 2;
2567 optional int32 font_package_hash = 3;
2568 optional int32 shape_package_hash = 4;
2569 optional int32 clock_package_hash = 5;
2570 optional int32 launcher_grid = 6;
2571 optional int32 wallpaper_category_hash = 7;
2572 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002573 optional int32 color_preference = 9;
2574 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002575}
2576
David Chenc28b2bb2017-10-24 12:52:52 -07002577/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002578 * Logs when Settings UI has changed.
2579 *
2580 * Logged from:
2581 * packages/apps/Settings
2582 */
2583message SettingsUIChanged {
2584 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002585 * Where this SettingsUIChange event comes from. For example, if
2586 * it's a PAGE_VISIBLE event, where the page is opened from.
2587 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002588 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002589
2590 /**
2591 * What the UI action is.
2592 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002593 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002594
2595 /**
2596 * Where the action is happening
2597 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002598 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002599
2600 /**
2601 * What preference changed in this event.
2602 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002603 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002604
2605 /**
2606 * The new value of the changed preference.
2607 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002608 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002609}
2610
2611/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002612 * Logs basic timing information about touch events.
2613 * Reported at most every 5 minutes while device is being interacted with.
2614 *
2615 * Logged from:
2616 * frameworks/native/services/inputflinger
2617 */
2618message TouchEventReported {
2619 /**
2620 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2621 * and the standard deviation of latency between the kernel and framework
2622 * for touchscreen events. The units are microseconds.
2623 *
2624 * The number is measured as the difference between the time at which
2625 * the input event was received in the evdev driver,
2626 * and the time at which the input event was received in EventHub.
2627 */
2628 // Minimum value
2629 optional float latency_min_micros = 1;
2630 // Maximum value
2631 optional float latency_max_micros = 2;
2632 // Average value
2633 optional float latency_mean_micros = 3;
2634 // Standard deviation
2635 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002636 // Number of touch events (input_event) in this report
2637 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002638}
2639
2640/**
Philip Quinn0eded622019-01-29 12:46:28 -08002641 * Logs gesture classification and timing information for touch events.
2642 *
2643 * Logged from:
2644 * frameworks/base/core/java/android/view/GestureDetector.java
2645 * frameworks/base/core/java/android/view/View.java
2646 */
2647message TouchGestureClassified {
2648 // The source of the classification (e.g. Java class name).
2649 optional string source = 1;
2650
2651 enum Classification {
2652 UNKNOWN_CLASSIFICATION = 0;
2653 SINGLE_TAP = 1;
2654 DOUBLE_TAP = 2;
2655 LONG_PRESS = 3;
2656 DEEP_PRESS = 4;
2657 SCROLL = 5;
2658 }
2659 // The classification of the gesture.
2660 optional Classification classification = 2;
2661
2662 // The interval from the start of a touch event stream until the
2663 // classification was made.
2664 optional int32 latency_millis = 3;
2665
2666 // The distance from the location of the first touch event to the
2667 // location of the touch event when the classification was made.
2668 optional float displacement_px = 4;
2669}
2670
2671/**
David Chenc28b2bb2017-10-24 12:52:52 -07002672 * Logs that a setting was updated.
2673 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002674 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002675 * The tag and is_default allow resetting of settings to default values based on the specified
2676 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2677 */
2678message SettingChanged {
2679 // The name of the setting.
2680 optional string setting = 1;
2681
2682 // The change being imposed on this setting. May represent a number, eg "3".
2683 optional string value = 2;
2684
2685 // The new value of this setting. For most settings, this is same as value. For some settings,
2686 // value is +X or -X where X represents an element in a set. For example, if the previous value
2687 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2688 // The +/- feature is currently only used for location_providers_allowed.
2689 optional string new_value = 3;
2690
2691 // The previous value of this setting.
2692 optional string prev_value = 4;
2693
2694 // The tag used with the is_default for resetting sets of settings. This is generally null.
2695 optional string tag = 5;
2696
Bookatz90867622018-01-31 15:05:57 -08002697 // True if this setting with tag should be resettable.
2698 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002699
David Chenbd789912018-03-16 17:19:55 -07002700 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002701 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002702
2703 enum ChangeReason {
2704 UPDATED = 1; // Updated can be an insertion or an update.
2705 DELETED = 2;
2706 }
2707 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002708}
Chenjie Yub3dda412017-10-24 13:41:59 -07002709
Chenjie Yu05013b32017-11-21 10:21:41 -08002710/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002711 * Logs activity going to foreground or background
2712 *
2713 * Logged from:
2714 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2715 */
2716message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002717 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002718 optional string pkg_name = 2;
2719 optional string class_name = 3;
2720
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002721 enum State {
2722 BACKGROUND = 0;
2723 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002724 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002725 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002726}
David Chenc8a43242017-10-17 16:23:28 -07002727
2728/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002729 * Logs when a volume entered low Storage state.
2730 * Logged from:
2731 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2732 */
2733message LowStorageStateChanged {
2734 // Volume that ran out of storage.
2735 optional string volume_description = 1;
2736
2737 enum State {
2738 UNKNOWN = 0;
2739 OFF = 1;
2740 ON = 2;
2741 }
2742 optional State state = 2;
2743}
2744
2745/**
2746 * Logs when an app is downgraded.
2747 * Logged from:
2748 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2749 */
2750message AppDowngraded {
2751 optional string package_name = 1;
2752 // Size of the package (all data) before being downgraded.
2753 optional int64 size_in_bytes_before = 2;
2754 // Size of the package (all data) after being downgraded.
2755 optional int64 size_in_bytes_after = 3;
2756
2757 optional bool aggressive = 4;
2758}
2759
2760/**
2761 * Logs when an app is optimized after being downgraded.
2762 * Logged from:
2763 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2764 */
2765message AppOptimizedAfterDowngraded {
2766 optional string package_name = 1;
2767}
2768
2769/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002770 * Logs whenever an app is installed on external storage.
2771 * Logged from:
2772 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2773 */
2774message AppInstallOnExternalStorageReported {
2775 // The type of external storage.
2776 optional android.stats.storage.ExternalStorageType storage_type = 1;
2777 // The name of the package that is installed on the sd card.
2778 optional string package_name = 2;
2779}
2780
2781/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002782 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002783 * Logged from:
2784 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2785 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002786message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002787 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002788
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002789 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002790
2791 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002792 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002793 optional string process_name = 3;
2794
2795 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002796 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002797
2798 optional string package_name = 5;
2799
2800 enum InstantApp {
2801 UNAVAILABLE = 0;
2802 FALSE = 1;
2803 TRUE = 2;
2804 }
2805 optional InstantApp is_instant_app = 6;
2806
2807 enum ForegroundState {
2808 UNKNOWN = 0;
2809 BACKGROUND = 1;
2810 FOREGROUND = 2;
2811 }
2812 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002813
2814 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002815}
David Chen9e3808c2017-11-20 17:25:34 -08002816
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002817/**
2818 * Logs when a WTF (What a Terrible Failure) happened.
2819 * Logged from:
2820 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2821 */
2822message WTFOccurred {
2823 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002824
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002825 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002826
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002827 // The name of the process.
2828 // system_server if it is not by an app
2829 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002830
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002831 // The pid if available. -1 means not available.
2832 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002833
2834 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002835}
2836
2837/**
2838 * Logs when system server reports low memory.
2839 * Logged from:
2840 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2841 */
2842message LowMemReported {
2843}
2844
2845/**
2846 * Logs when an app ANR (App Not Responding) occurs.
2847 * Logged from:
2848 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2849 */
2850message ANROccurred {
2851 optional int32 uid = 1 [(is_uid) = true];
2852
2853 optional string process_name = 2;
2854
2855 optional string short_component_name = 3;
2856
2857 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002858
2859 enum InstantApp {
2860 UNAVAILABLE = 0;
2861 FALSE = 1;
2862 TRUE = 2;
2863 }
2864 optional InstantApp is_instant_app = 5;
2865
2866 enum ForegroundState {
2867 UNKNOWN = 0;
2868 BACKGROUND = 1;
2869 FOREGROUND = 2;
2870 }
2871 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002872
2873 optional android.server.ErrorSource error_source = 7;
2874
2875 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002876}
2877
Bookatza7020bd2018-08-28 16:29:35 -07002878/**
2879 * Logs when the vibrator state changes.
2880 * Logged from:
2881 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2882 */
2883message VibratorStateChanged {
2884 repeated AttributionNode attribution_node = 1;
2885
2886 enum State {
2887 OFF = 0;
2888 ON = 1;
2889 }
2890 optional State state = 2;
2891
2892 // Duration (in milliseconds) requested to keep the vibrator on.
2893 // Only applicable for State == ON.
2894 optional int64 duration_millis = 3;
2895}
2896
David Chen0a368b22017-12-06 16:28:16 -08002897/*
2898 * Allows other apps to push events into statsd.
2899 * Logged from:
2900 * frameworks/base/core/java/android/util/StatsLog.java
2901 */
David Chen0b5c90c2018-01-25 16:51:49 -08002902message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002903 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002904 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002905
2906 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2907 optional int32 label = 2;
2908
2909 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2910 // predicates for the metrics).
2911 enum State {
2912 UNKNOWN = 0;
2913 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2914 STOP = 2;
2915 START = 3;
2916 }
2917 optional State state = 3;
2918}
2919
David Chen9e3808c2017-11-20 17:25:34 -08002920/**
Bookatz7948c872018-09-04 12:58:33 -07002921 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2922 * For example, this could be due to the user manually changing the time.
2923 *
2924 * Logged from:
2925 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2926 */
2927message WallClockTimeShifted {
2928 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2929 optional int64 wall_clock_timestamp_millis = 1;
2930}
2931
2932/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002933 * Logs when statsd detects an anomaly.
2934 *
2935 * Logged from:
2936 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2937 */
2938message AnomalyDetected {
2939 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002940 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002941
Yangster-mac94e197c2018-01-02 16:03:03 -08002942 // Id of the config whose anomaly detection alert fired.
2943 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002944
Yangster-mac94e197c2018-01-02 16:03:03 -08002945 // Id of the alert (i.e. name of the anomaly that was detected).
2946 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002947}
2948
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002949message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002950 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002951 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002952
2953 // The app package name.
2954 optional string pkg_name = 2;
2955
2956 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002957 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002958 WARM = 1;
2959 HOT = 2;
2960 COLD = 3;
2961 }
2962 // The transition type.
2963 optional TransitionType type = 3;
2964
2965 // The activity name.
2966 optional string activity_name = 4;
2967
2968 // The name of the calling app. Empty if not set.
2969 optional string calling_pkg_name = 5;
2970
2971 // Whether the app is an instant app.
2972 optional bool is_instant_app = 6;
2973
2974 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002975 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002976
Bookatz80d11a02018-01-16 10:46:35 -08002977 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002978
David Chen0b5c90c2018-01-25 16:51:49 -08002979 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002980 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002981 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002982 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002983 optional int32 bind_application_delay_millis = 11;
2984 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002985
2986 // Empty if not set.
2987 optional string launch_token = 13;
2988
Calin Juravle759fbda2018-02-20 19:52:30 +00002989 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002990 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002991
2992 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002993 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002994}
2995
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002996message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002997 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002998 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002999
3000 // The app package name.
3001 optional string pkg_name = 2;
3002
3003 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003004 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003005 WARM = 1;
3006 HOT = 2;
3007 COLD = 3;
3008 }
3009 // The transition type.
3010 optional TransitionType type = 3;
3011
3012 // The activity name.
3013 optional string activity_name = 4;
3014}
3015
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003016message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003017 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003018 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003019
3020 // The app package name.
3021 optional string pkg_name = 2;
3022
3023 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003024 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003025 WITH_BUNDLE = 1;
3026 WITHOUT_BUNDLE = 2;
3027 }
3028 // The transition type.
3029 optional TransitionType type = 3;
3030
3031 // The activity name.
3032 optional string activity_name = 4;
3033
3034 optional bool transition_process_running = 5;
3035
3036 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003037 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003038}
3039
Bookatz8fcd09a2017-12-18 13:01:10 -08003040/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003041 * Logs a picture-in-picture action
3042 * Logged from:
3043 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3044 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3045 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3046 */
3047message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003048 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003049 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003050
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003051 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003052
Chenjie Yu52cacc62017-12-08 18:11:45 -08003053 enum State {
3054 ENTERED = 1;
3055 EXPANDED_TO_FULL_SCREEN = 2;
3056 MINIMIZED = 3;
3057 DISMISSED = 4;
3058 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003059 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003060}
3061
3062/**
Chenjie Yue8904192017-12-08 19:12:57 -08003063 * Logs overlay action
3064 * Logged from:
3065 * services/core/java/com/android/server/wm/Session.java
3066 */
3067message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003068 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003069
3070 optional string package_name = 2;
3071
3072 optional bool using_alert_window = 3;
3073
3074 enum State {
3075 ENTERED = 1;
3076 EXITED = 2;
3077 }
3078 optional State state = 4;
3079}
3080
Chenjie Yuccfe6452018-01-30 11:33:21 -08003081/*
3082 * Logs foreground service starts and stops.
3083 * Note that this is not when a service starts or stops, but when it is
3084 * considered foreground.
3085 * Logged from
3086 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3087 */
3088message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003089 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003090 // package_name + "/" + class_name
3091 optional string short_name = 2;
3092
3093 enum State {
3094 ENTER = 1;
3095 EXIT = 2;
3096 }
3097 optional State state = 3;
3098}
3099
Chenjie Yue8904192017-12-08 19:12:57 -08003100/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003101 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3102 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3103 * attributed back to the parent (host) uid. One example is Chrome.
3104 *
3105 * Logged from:
3106 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3107 */
3108message IsolatedUidChanged {
3109 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003110 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003111 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003112 optional int32 parent_uid = 1;
3113
3114 optional int32 isolated_uid = 2;
3115
3116 // We expect an isolated uid to be removed before if it's used for another parent uid.
3117 enum Event {
3118 REMOVED = 0;
3119 CREATED = 1;
3120 }
3121 optional Event event = 3;
3122}
3123
3124/*
3125 * Logs the reception of an incoming network packet causing the main system to wake up for
3126 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3127 * and processed by WakeupController.cpp.
3128 */
3129message PacketWakeupOccurred {
3130 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3131 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003132 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003133 // The interface name on which the packet was received.
3134 optional string iface = 2;
3135 // The ethertype value of the packet.
3136 optional int32 ethertype = 3;
3137 // String representation of the destination MAC address of the packet.
3138 optional string destination_hardware_address = 4;
3139 // String representation of the source address of the packet if this was an IP packet.
3140 optional string source_ip = 5;
3141 // String representation of the destination address of the packet if this was an IP packet.
3142 optional string destination_ip = 6;
3143 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3144 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3145 // families.
3146 optional int32 ip_next_header = 7;
3147 // The source port if this was a TCP or UDP packet.
3148 optional int32 source_port = 8;
3149 // The destination port if this was a TCP or UDP packet.
3150 optional int32 destination_port = 9;
3151}
3152
3153/*
3154 * Logs the memory stats for an app on startup.
3155 * Logged from:
3156 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3157 */
3158message AppStartMemoryStateCaptured {
3159 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003160 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003161
3162 // The process name.
3163 optional string process_name = 2;
3164
3165 // The activity name.
3166 optional string activity_name = 3;
3167
3168 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003169 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003170
3171 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003172 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003173
3174 // RSS
3175 optional int64 rss_in_bytes = 6;
3176
3177 // CACHE
3178 optional int64 cache_in_bytes = 7;
3179
3180 // SWAP
3181 optional int64 swap_in_bytes = 8;
3182}
3183
3184/*
3185 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3186 * for LMK event.
3187 * Logged from:
3188 * system/core/lmkd/lmkd.c
3189 */
3190message LmkStateChanged {
3191 enum State {
3192 UNKNOWN = 0;
3193 START = 1;
3194 STOP = 2;
3195 }
3196 optional State state = 1;
3197}
3198
3199/*
3200 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3201 * Logged from:
3202 * system/core/lmkd/lmkd.c
3203 */
3204message LmkKillOccurred {
3205 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003206 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003207
3208 // The process name.
3209 optional string process_name = 2;
3210
3211 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003212 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003213
3214 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003215 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003216
3217 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003218 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003219
3220 // RSS
3221 optional int64 rss_in_bytes = 6;
3222
3223 // CACHE
3224 optional int64 cache_in_bytes = 7;
3225
3226 // SWAP
3227 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003228
3229 // The elapsed real time of start of the process.
3230 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003231
3232 // Min oom adj score considered by lmkd.
3233 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003234}
3235
Rajeev Kumar51b54602018-03-01 12:18:26 -08003236/*
3237 * Logs when the ActivityManagerService detects that an app died.
3238 *
3239 * Logged from:
3240 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3241 */
3242message AppDied {
3243 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003244 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003245}
3246
Howard Ro21a039c2018-08-06 14:55:47 -07003247/**
3248 * An atom for generic metrics logging. Available from Android Q.
3249 */
3250message GenericAtom {
3251 // The uid of the application that sent this custom atom.
3252 optional int32 uid = 1 [(is_uid) = true];
3253
3254 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003255 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003256}
3257
Tej Singhd6d6d772018-09-05 17:41:25 -07003258/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003259 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003260 *
3261 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003262 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003263 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003264message BiometricAcquired {
3265 // Biometric modality that was acquired.
3266 optional android.hardware.biometrics.ModalityEnum modality = 1;
3267 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3268 optional int32 user = 2;
3269 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3270 optional bool is_crypto = 3;
3271 // Action that the device is performing. Acquired messages are only expected for enroll and
3272 // authenticate. Other actions may indicate an error.
3273 optional android.hardware.biometrics.ActionEnum action = 4;
3274 // The client that this acquisition was received for.
3275 optional android.hardware.biometrics.ClientEnum client = 5;
3276 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3277 optional int32 acquire_info = 6;
3278 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3279 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003280 // Dictates if this message should trigger additional debugging.
3281 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003282}
3283
3284/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003285 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003286 *
3287 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003288 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003289 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003290message BiometricAuthenticated {
3291 // Biometric modality that was used.
3292 optional android.hardware.biometrics.ModalityEnum modality = 1;
3293 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3294 optional int32 user = 2;
3295 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3296 // storage.
3297 optional bool is_crypto = 3;
3298 // The client that this acquisition was received for.
3299 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003300 // If authentication requires user confirmation. See BiometricPrompt's
3301 // setRequireConfirmation(bool) method.
3302 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003303
Kevin Chyn1741a072019-01-17 11:54:40 -08003304 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003305 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003306 REJECTED = 1;
3307 PENDING_CONFIRMATION = 2;
3308 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003309 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003310
3311 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003312 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003313 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3314 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3315 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3316 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003317 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003318 // Dictates if this message should trigger additional debugging.
3319 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003320}
3321
3322/**
3323 * Logs when a biometric error occurs.
3324 *
3325 * Logged from:
3326 * frameworks/base/services/core/java/com/android/server/biometrics
3327 */
3328message BiometricErrorOccurred {
3329 // Biometric modality that was used.
3330 optional android.hardware.biometrics.ModalityEnum modality = 1;
3331 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3332 optional int32 user = 2;
3333 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3334 optional bool is_crypto = 3;
3335 // Action that the device is performing.
3336 optional android.hardware.biometrics.ActionEnum action = 4;
3337 // The client that this acquisition was received for.
3338 optional android.hardware.biometrics.ClientEnum client = 5;
3339 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3340 // are unique to modality.
3341 optional int32 error_info = 6;
3342 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3343 // by the vendor and not specified by the HIDL interface.
3344 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003345 // Dictates if this message should trigger additional debugging.
3346 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003347 // Time spent during the authentication attempt.
3348 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003349}
3350
3351/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003352 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003353 * Logged from:
3354 * frameworks/base/services/core/java/com/android/server/biometrics
3355 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003356message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003357 // Biometric modality.
3358 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003359 // Type of issue detected.
3360 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003361 // Dictates if this message should trigger additional debugging.
3362 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003363}
Howard Ro688ae182018-09-25 00:09:36 -07003364
joshmccloskey6f952b22019-03-25 20:59:35 -07003365/**
3366 * Logs when a biometric enrollment occurs.
3367 *
3368 * Logged from:
3369 * frameworks/base/services/core/java/com/android/server/biometrics
3370 */
3371message BiometricEnrolled {
3372 // Biometric modality that was used.
3373 optional android.hardware.biometrics.ModalityEnum modality = 1;
3374 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3375 optional int32 user = 2;
3376 // The amount of time the enrollment took in milliseconds.
3377 optional int64 latency_millis = 3;
3378 // Whether or not the enrollment was successful.
3379 optional bool success = 4;
3380}
3381
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003382/*
Tej Singh0d176952019-01-16 19:10:54 -08003383 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003384 */
Tej Singh0d176952019-01-16 19:10:54 -08003385message FlagFlipUpdateOccurred {
3386 // If the event is from a flag config package, specify the package name.
3387 optional string flag_flip_package_name = 1;
3388
3389 // The order id of the package
3390 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003391}
3392
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003393/**
3394 * Potential experiment ids that goes with a train install.
3395 */
3396message TrainExperimentIds {
3397 repeated int64 experiment_id = 1;
3398}
3399
Yangster-macb89807e2018-11-15 21:10:57 -08003400/*
3401 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003402 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003403 */
3404message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003405 // Name of the train.
3406 optional string train_name = 1;
3407 // Version code for a "train" of packages that need to be installed atomically
3408 optional int64 train_version_code = 2;
3409 // After installation of this package, device requires a restart.
3410 optional bool requires_staging = 3;
3411 // Rollback should be enabled for this install.
3412 optional bool rollback_enabled = 4;
3413 // Requires low latency monitoring if possible.
3414 optional bool requires_low_latency_monitor = 5;
3415
Yangster-macb89807e2018-11-15 21:10:57 -08003416 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003417 UNKNOWN = 0;
3418 INSTALL_REQUESTED = 1;
3419 INSTALL_STARTED = 2;
3420 INSTALL_STAGED_NOT_READY = 3;
3421 INSTALL_STAGED_READY = 4;
3422 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003423 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3424 // and INSTALL_FAILURE_COMMIT.
3425 INSTALL_FAILURE = 6 [deprecated = true];
3426 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003427 INSTALL_CANCELLED = 7;
3428 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003429 INSTALLER_ROLLBACK_INITIATED = 9;
3430 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3431 INSTALLER_ROLLBACK_STAGED = 11;
3432 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3433 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3434 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3435 INSTALLER_ROLLBACK_SUCCESS = 15;
3436 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003437 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3438 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3439 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3440 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3441 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3442 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003443 INSTALL_FAILURE_DOWNLOAD = 23;
3444 INSTALL_FAILURE_STATE_MISMATCH = 24;
3445 INSTALL_FAILURE_COMMIT = 25;
Yangster-macb89807e2018-11-15 21:10:57 -08003446 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003447 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003448 // Possible experiment ids for monitoring this push.
3449 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3450 // user id
3451 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003452}
3453
Tej Singhc9203082019-05-03 13:42:23 -07003454/* Test atom, is not logged anywhere */
3455message TestAtomReported {
3456 repeated AttributionNode attribution_node = 1;
3457 optional int32 int_field = 2;
3458 optional int64 long_field = 3;
3459 optional float float_field = 4;
3460 optional string string_field = 5;
3461 optional bool boolean_field = 6;
3462 enum State {
3463 UNKNOWN = 0;
3464 OFF = 1;
3465 ON = 2;
3466 }
3467 optional State state = 7;
3468 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3469}
3470
Maggie Whitefc1aa592018-11-28 21:55:23 -08003471/** Represents USB port overheat event. */
3472message UsbPortOverheatEvent {
3473 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3474 optional int32 plug_temperature_deci_c = 1;
3475
3476 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3477 optional int32 max_temperature_deci_c = 2;
3478
3479 /* Time between USB plug event and overheat threshold trip, in seconds. */
3480 optional int32 time_to_overheat_secs = 3;
3481
3482 /* Time between overheat threshold trip and hysteresis, in seconds. */
3483 optional int32 time_to_hysteresis_secs = 4;
3484
3485 /* Time between hysteresis and active mitigation ending, in seconds. */
3486 optional int32 time_to_inactive_secs = 5;
3487};
3488
Maggie White8735b852019-01-18 11:40:49 -08003489/**
3490 * Logs total effective full charge and discharge cycles on a battery.
3491 * Here are some examples of one effective cycle:
3492 * 1) the battery charges from 0% to 100% and drains back to 0%,
3493 * 2) charging from 50% to 100% and draining back to 50% twice.
3494 * Pulled from:
3495 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3496 */
3497message BatteryCycleCount {
3498 /* Number of total charge and discharge cycles on the system battery. */
3499 optional int32 cycle_count = 1;
3500}
3501
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003502/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003503 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3504 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003505 * Pulled from:
3506 * StatsCompanionService
3507 */
3508
Carmen Agimof12dec122019-03-06 16:14:38 +00003509message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003510
Carmen Agimof12dec122019-03-06 16:14:38 +00003511 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003512 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003513 PUBLIC = 1;
3514 PRIVATE = 2;
3515 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003516 }
3517
Carmen Agimof12dec122019-03-06 16:14:38 +00003518 // The type of external storage.
3519 optional android.stats.storage.ExternalStorageType storage_type = 1;
3520 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3521 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003522 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003523 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003524}
3525
Yangster-macb89807e2018-11-15 21:10:57 -08003526/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003527 * Logs when a connection becomes available and lost.
3528 * Logged in StatsCompanionService.java
3529 */
3530message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003531 // Id of the network.
3532 optional int32 net_id = 1;
3533
3534 enum State {
3535 UNKNOWN = 0;
3536 CONNECTED = 1;
3537 DISCONNECTED = 2;
3538 }
3539 // Connected state of a network.
3540 optional State state = 2;
3541}
3542
3543/**
3544 * Logs when a service starts and stops.
3545 * Logged from:
3546 * services/core/java/com/android/server/am/ActiveServices.java
3547 */
3548message ServiceStateChanged {
3549
3550 optional int32 uid = 1 [(is_uid) = true];
3551
3552 optional string package_name = 2;
3553
3554 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003555
3556 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003557 START = 1;
3558 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003559 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003560
3561 optional State state = 4;
3562}
3563
3564/**
3565 * Logs when a service is launched.
3566 * Logged from:
3567 * services/core/java/com/android/server/am/ActiveServices.java
3568 */
3569message ServiceLaunchReported {
3570
3571 optional int32 uid = 1 [(is_uid) = true];
3572
3573 optional string package_name = 2;
3574
3575 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003576}
Howard Ro688ae182018-09-25 00:09:36 -07003577
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003578/**
3579 * Logs when a hidden API is used.
3580 *
3581 * Logged from:
3582 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3583 */
3584message HiddenApiUsed {
3585 // The uid of the app making the hidden access.
3586 optional int32 uid = 1 [(is_uid) = true];
3587
3588 // Signature of the method or field accessed.
3589 optional string signature = 2;
3590
3591 enum AccessMethod {
3592 NONE = 0;
3593 REFLECTION = 1;
3594 JNI = 2;
3595 LINKING = 3;
3596 }
3597
3598 // Type of access.
3599 optional AccessMethod access_method = 3;
3600
3601 // Whether the access was prevented or not.
3602 optional bool access_denied = 4;
3603}
3604
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003605/**
3606 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3607 * - When user sees privacy chip
3608 * - When user clicks privacy chip
3609 * - How does the user exit the Privacy Dialog
3610 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003611 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3612 */
3613message PrivacyIndicatorsInteracted {
3614
3615 enum Type {
3616 UNKNOWN = 0;
3617 CHIP_VIEWED = 1;
3618 CHIP_CLICKED = 2;
3619 DIALOG_PRIVACY_SETTINGS = 3;
3620 DIALOG_DISMISS = 4;
3621 DIALOG_LINE_ITEM = 5;
3622 }
3623
3624 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3625
3626 // Used if the type is LINE_ITEM
3627 optional string package_name = 2;
3628}
3629
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003630/**
3631 * Logs information about a package that is moved from the internal to external storage and vice
3632 * versa.
3633 * It logs the package name, the type of the external storage where the package is installed
3634 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3635 * and the move type: if it's from internal to external or the other way around.
3636 *
3637 * Logged from:
3638 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3639 */
3640message AppMovedStorageReported {
3641 enum MoveType {
3642 UNKNOWN = 0;
3643 TO_EXTERNAL = 1;
3644 TO_INTERNAL = 2;
3645 }
3646 // The type of the external storage.
3647 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3648 // The type of move.
3649 optional MoveType move_type = 2;
3650 // The name of the package that was moved.
3651 optional string package_name = 3;
3652}
3653
jianjin8f2dee02019-03-29 14:03:08 -07003654/**
3655 * Logs when system server watchdog occurs.
3656 * Logged from:
3657 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3658 */
3659message SystemServerWatchdogOccurred {
3660 optional string subject = 1;
3661}
3662
3663/**
3664 * Logs when new file added to tombstones.
3665 * Logged from:
3666 * frameworks/base/core/java/com/android/server/BootReceiver.java
3667 */
3668message TombStoneOccurred {
3669}
3670
Hai Zhang5d3328d2019-04-13 21:25:06 +08003671/*
3672 * Information about a role request
3673 *
3674 * Logged from:
3675 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3676 */
3677message RoleRequestResultReported {
3678 // UID of application requesting the role
3679 optional int32 requesting_uid = 1;
3680
3681 // Package name of application requesting the role
3682 optional string requesting_package_name = 2;
3683
3684 // The role to be granted
3685 optional string role_name = 3;
3686
3687 // The count of applications qualifying for the role
3688 optional int32 qualifying_count = 4;
3689
3690 // UID of application current granted the role
3691 optional int32 current_uid = 5;
3692
3693 // Package name of application current granted the role
3694 optional string current_package_name = 6;
3695
3696 // UID of another application that user chose to grant the role to, instead of the requesting
3697 // application
3698 optional int32 granted_another_uid = 7;
3699
3700 // Package name of another application that user chose to grant the role to, instead of the
3701 // requesting application
3702 optional string granted_another_package_name = 8;
3703
3704 enum Result {
3705 UNDEFINED = 0;
3706 // role request was ignored
3707 IGNORED = 1;
3708 // role request was ignored because it's already granted
3709 IGNORED_ALREADY_GRANTED = 2;
3710 // role request was ignored because the application isn't qualified
3711 IGNORED_NOT_QUALIFIED = 3;
3712 // role request was ignored because user said it should be always denied
3713 IGNORED_USER_ALWAYS_DENIED = 4;
3714 // role was granted by user action
3715 USER_GRANTED = 5;
3716 // role was denied by user action
3717 USER_DENIED = 6;
3718 // role was denied by user granting another application the role
3719 USER_DENIED_GRANTED_ANOTHER = 7;
3720 // role was denied and set to be always denied by the user
3721 USER_DENIED_WITH_ALWAYS = 8;
3722 }
3723 // The result of the role request
3724 optional Result result = 9;
3725}
3726
Chenjie Yubbcbc602018-02-05 16:51:52 -08003727//////////////////////////////////////////////////////////////////////
3728// Pulled atoms below this line //
3729//////////////////////////////////////////////////////////////////////
3730
3731/**
David Chenc8a43242017-10-17 16:23:28 -07003732 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3733 *
3734 * Pulled from:
3735 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3736 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003737message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003738 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003739
3740 optional int64 rx_bytes = 2;
3741
3742 optional int64 rx_packets = 3;
3743
3744 optional int64 tx_bytes = 4;
3745
3746 optional int64 tx_packets = 5;
3747}
3748
3749/**
3750 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3751 *
3752 * Pulled from:
3753 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3754 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003755message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003756 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003757
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003758 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3759 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003760
3761 optional int64 rx_bytes = 3;
3762
3763 optional int64 rx_packets = 4;
3764
3765 optional int64 tx_bytes = 5;
3766
3767 optional int64 tx_packets = 6;
3768}
3769
3770/**
3771 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3772 *
3773 * Pulled from:
3774 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3775 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003776message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003777 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003778
3779 optional int64 rx_bytes = 2;
3780
3781 optional int64 rx_packets = 3;
3782
3783 optional int64 tx_bytes = 4;
3784
3785 optional int64 tx_packets = 5;
3786}
3787
3788/**
3789 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3790 *
3791 * Pulled from:
3792 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3793 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003794message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003795 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003796
Yao Chenc40a19d2018-03-15 16:48:25 -07003797 // 1 denotes foreground and 0 denotes background. This is called Set in
3798 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003799 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003800
3801 optional int64 rx_bytes = 3;
3802
3803 optional int64 rx_packets = 4;
3804
3805 optional int64 tx_bytes = 5;
3806
3807 optional int64 tx_packets = 6;
3808}
3809
3810/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003811 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3812 *
3813 * Pulled from:
3814 * StatsCompanionService
3815 */
3816message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003817 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003818
3819 optional int64 rx_bytes = 2;
3820
3821 optional int64 tx_bytes = 3;
3822}
3823
3824/**
David Chenc8a43242017-10-17 16:23:28 -07003825 * Pulls the kernel wakelock durations. This atom is adapted from
3826 * android/internal/os/KernelWakelockStats.java
3827 *
3828 * Pulled from:
3829 * StatsCompanionService using KernelWakelockReader.
3830 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003831message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003832 optional string name = 1;
3833
3834 optional int32 count = 2;
3835
3836 optional int32 version = 3;
3837
Yangster-maca8a30442018-10-13 23:46:34 -07003838 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003839}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003840
Chenjie Yu05013b32017-11-21 10:21:41 -08003841/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003842 * Pulls low power state information. If power.stats HAL is not available, this
3843 * includes platform and subsystem sleep state information,
3844 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3845 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003846 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003847 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003848 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3849 * as defined in:
3850 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003851 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003852message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003853 // Subsystem name
3854 optional string subsystem_name = 1;
3855 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3856 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003857 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3858 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003859 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003860 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003861 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003862 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003863 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003864}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003865
Chenjie Yu05013b32017-11-21 10:21:41 -08003866/**
Bookatz92da2832018-11-01 18:10:03 -07003867 * Pulls on-device power measurement information.
3868 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3869 * Pulled from:
3870 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3871 */
3872message OnDevicePowerMeasurement {
3873 // Name of the subsystem (to which the rail belongs).
3874 optional string subsystem_name = 1;
3875
3876 // Rail name. The rail lies within the subsystem.
3877 optional string rail_name = 2;
3878
3879 // Time (in ms since boot) at which the rail energy value was measured.
3880 // This may differ slightly from the time that statsd logs this information.
3881 optional uint64 measurement_timestamp_millis = 3;
3882
3883 // Accumulated energy used via the rail since device boot in uWs.
3884 optional uint64 energy_microwatt_secs = 4;
3885}
3886
3887/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003888 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003889 * Pulls the time the cpu spend on the frequency index. Frequency index
3890 * starts from highest to lowest. The value should be monotonically
3891 * increasing since boot. However, if there is a cpu
3892 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003893 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003894message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003895 optional uint32 cluster = 1;
3896 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003897 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003898}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003899
Chenjie Yu05013b32017-11-21 10:21:41 -08003900/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003901 * Pulls Cpu Time Per Uid.
3902 * Note that isolated process uid time should be attributed to host uids.
3903 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003904message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003905 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003906 optional uint64 user_time_micros = 2;
3907 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003908}
3909
3910/**
3911 * Pulls Cpu Time Per Uid per frequency.
3912 * Note that isolated process uid time should be attributed to host uids.
3913 * For each uid, we order the time by descending frequencies.
3914 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003915message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003916 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003917 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003918 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003919}
Hugo Benichi884970e2017-11-14 22:42:46 +09003920
Chenjie Yu05013b32017-11-21 10:21:41 -08003921/**
3922 * Pulls Wifi Controller Activity Energy Info
3923 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003924message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003925 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003926 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003927 // stack reported state
3928 // TODO: replace this with proto enum
3929 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003930 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003931 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003932 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003933 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003934 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003935 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003936 // product of current(mA), voltage(V) and time(ms)
3937 optional uint64 controller_energy_used = 6;
3938}
3939
3940/**
3941 * Pulls Modem Activity Energy Info
3942 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003943message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003944 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003945 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003946 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003947 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003948 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003949 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003950 /**
3951 * Tx power index
3952 * index 0 = tx_power < 0dBm
3953 * index 1 = 0dBm < tx_power < 5dBm
3954 * index 2 = 5dBm < tx_power < 15dBm
3955 * index 3 = 15dBm < tx_power < 20dBm
3956 * index 4 = tx_power > 20dBm
3957 */
3958 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003959 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003960 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003961 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003962 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003963 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003964 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003965 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003966 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003967 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003968 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003969 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003970 // product of current(mA), voltage(V) and time(ms)
3971 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003972}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003973
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003974/**
3975 * Pulls Bluetooth Activity Energy Info
3976 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3977 */
3978message BluetoothActivityInfo {
3979 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003980 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003981 // bluetooth stack state
3982 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003983 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003984 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003985 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003986 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003987 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003988 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003989 // product of current(mA), voltage(V) and time(ms)
3990 optional uint64 energy_used = 6;
3991}
3992
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003993/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003994 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003995 *
3996 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003997 */
3998message ProcessMemoryState {
3999 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004000 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004001
4002 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004003 // Usually package name, "system" for system server.
4004 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004005 optional string process_name = 2;
4006
Rafal Slawikda51b932018-12-13 16:31:33 +00004007 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004008 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004009
4010 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004011 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004012
4013 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004014 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004015
Rajeev Kumar90235992018-01-29 11:06:48 -08004016 // RSS
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004017 // Value is read from /proc/PID/status. Or from memory.stat, field
Rafal Slawikda51b932018-12-13 16:31:33 +00004018 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08004019 optional int64 rss_in_bytes = 6;
4020
4021 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004022 // Value is read from memory.stat, field total_cache if per-app memory
4023 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004024 optional int64 cache_in_bytes = 7;
4025
4026 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004027 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik44af3b32019-04-16 13:16:15 +01004028 // cgroups are enabled. Otherwise, VmSwap from /proc/PID/status.
Rajeev Kumar90235992018-01-29 11:06:48 -08004029 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004030
Rafal Slawikd03ae422018-11-20 11:27:45 +00004031 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004032 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004033
4034 // Elapsed real time when the process started.
4035 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
4036 optional int64 start_time_nanos = 10;
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004037
4038 // Anonymous page size plus swap size. Values are read from /proc/PID/status.
4039 optional int32 anon_rss_and_swap_in_kilobytes = 11;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004040}
4041
4042/*
Rafal Slawik08621582018-10-15 14:53:07 +01004043 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00004044 *
4045 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01004046 */
4047message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01004048 // The uid if available. -1 means not available.
4049 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004050
Rafal Slawikbf67d072018-10-23 11:07:54 +01004051 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004052 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01004053 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01004054
Rafal Slawikbf67d072018-10-23 11:07:54 +01004055 // # of page-faults
4056 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01004057
Rafal Slawikbf67d072018-10-23 11:07:54 +01004058 // # of major page-faults
4059 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01004060
Rafal Slawikbf67d072018-10-23 11:07:54 +01004061 // RSS
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004062 // Value read from /proc/PID/status.
Rafal Slawikbf67d072018-10-23 11:07:54 +01004063 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01004064
Rafal Slawikd03ae422018-11-20 11:27:45 +00004065 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004066 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01004067
4068 // Elapsed real time when the process started.
4069 // Value is read from /proc/PID/stat, field 22.
4070 optional int64 start_time_nanos = 7;
Rafal Slawik44af3b32019-04-16 13:16:15 +01004071
4072 // SWAP
4073 // Value read from /proc/PID/status, field VmSwap.
4074 optional int64 swap_in_bytes = 8;
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004075
4076 // Anonymous page size plus swap size. Values are read from /proc/PID/status.
4077 optional int32 anon_rss_and_swap_in_kilobytes = 9;
Rafal Slawik08621582018-10-15 14:53:07 +01004078}
4079
4080/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004081 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004082 *
4083 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4084 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004085 *
4086 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004087 */
4088message ProcessMemoryHighWaterMark {
4089 // The uid if available. -1 means not available.
4090 optional int32 uid = 1 [(is_uid) = true];
4091
Rafal Slawikda51b932018-12-13 16:31:33 +00004092 // The process name.
4093 // Usually package name or process cmdline.
4094 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004095 optional string process_name = 2;
4096
4097 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4098 // /proc/PID/status.
4099 optional int64 rss_high_water_mark_in_bytes = 3;
4100}
4101
4102/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004103 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004104 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004105message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004106 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004107}
4108
4109/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004110 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004111 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004112message SystemUptime {
4113 // Milliseconds since the system was booted.
4114 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4115 // for external input).
4116 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004117 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004118}
4119
4120/*
4121 * Reads from /proc/uid_concurrent_active_time which has the format:
4122 * active: X (X is # cores)
4123 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4124 * [uid1]: [time-0] [time-1] [time-2] ... ...
4125 * ...
4126 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4127 * The file contains a monotonically increasing count of time for a single boot.
4128 */
4129message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004130 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004131 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004132}
4133
4134/**
4135 * Reads from /proc/uid_concurrent_policy_time which has the format:
4136 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4137 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4138 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4139 * ...
4140 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4141 * The file contains a monotonically increasing count of time for a single boot.
4142 */
4143message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004144 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004145 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004146 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004147}
4148
4149/*
4150 * Pulls free disk space, for data, system partition and temporary directory.
4151 */
4152message DiskSpace {
4153 // available bytes in data partition
4154 optional uint64 data_available_bytes = 1;
4155 // available bytes in system partition
4156 optional uint64 system_available_bytes = 2;
4157 // available bytes in download cache or temp directories
4158 optional uint64 temp_available_bytes = 3;
4159}
Tej Singhbf972d92018-01-10 20:51:13 -08004160
4161/**
4162 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004163 *
4164 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004165 */
4166message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004167 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004168}
4169
4170/**
4171 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004172 * Pulled from:
4173 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004174 */
4175message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004176 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004177}
4178
4179/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004180 * Pulls battery voltage.
4181 * Pulled from:
4182 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4183 */
4184message BatteryVoltage {
4185 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004186 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004187}
4188
4189/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004190 * Pulls battery level (percent full, from 0 to 100).
4191 *
4192 * Pulled from:
4193 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4194 */
4195message BatteryLevel {
4196 // Battery level. Should be in [0, 100].
4197 optional int32 battery_level = 1;
4198}
4199
4200/**
Tej Singhd89137e2018-03-26 14:51:40 -07004201 * Pulls the temperature of various parts of the device.
4202 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004203 *
Maggie White442b6312019-04-05 16:26:44 -07004204 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004205 */
4206message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004207 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004208 optional android.os.TemperatureTypeEnum sensor_location = 1;
4209
4210 // The name of the temperature source. Eg. CPU0
4211 optional string sensor_name = 2;
4212
Tej Singhd89137e2018-03-26 14:51:40 -07004213 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004214 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004215 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004216
4217 // Relative severity of the throttling, see enum definition.
4218 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004219}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004220
4221/**
4222 * Pulls the statistics of calls to Binder.
4223 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004224 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4225 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004226 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004227 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004228 */
4229message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004230 // UID of the process responsible for the binder transaction. It will be set if the process
4231 // executing the binder transaction attribute the transaction to another uid using
4232 // Binder.setThreadWorkSource().
4233 //
4234 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004235 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004236 // UID of the process executing the binder transaction.
4237 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004238 // Fully qualified class name of the API call.
4239 //
4240 // This is a system server class name.
4241 //
4242 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4243 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4244 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4245 // commonly used APIs.
4246 optional string service_class_name = 2;
4247 // Method name of the API call. It can also be a transaction code if we cannot
4248 // resolve it to a name. See Binder#getTransactionName.
4249 //
4250 // This is a system server method name.
4251 optional string service_method_name = 3;
4252 // Total number of API calls.
4253 optional int64 call_count = 4;
4254 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4255 optional bool screen_interactive = 13;
4256 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4257 // call_count will be equal to recorded_call_count.
4258 //
4259 // If recorded_call_count is different than call_count, it means data collection has been
4260 // sampled. All the fields below will be sampled in this case.
4261 optional int64 recorded_call_count = 12;
4262 // Number of exceptions thrown by the API.
4263 optional int64 recorded_exception_count = 5;
4264 // Total latency of all API calls.
4265 // Average can be computed using total_latency_micros / recorded_call_count.
4266 optional int64 recorded_total_latency_micros = 6;
4267 // Maximum latency of one API call.
4268 optional int64 recorded_max_latency_micros = 7;
4269 // Total CPU usage of all API calls.
4270 // Average can be computed using total_cpu_micros / recorded_call_count.
4271 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4272 optional int64 recorded_total_cpu_micros = 8;
4273 // Maximum CPU usage of one API call.
4274 optional int64 recorded_max_cpu_micros = 9;
4275 // Maximum parcel reply size of one API call.
4276 optional int64 recorded_max_reply_size_bytes = 10;
4277 // Maximum parcel request size of one API call.
4278 optional int64 recorded_max_request_size_bytes = 11;
4279}
4280
4281/**
4282 * Pulls the statistics of exceptions during calls to Binder.
4283 *
4284 * Binder stats are cumulative from boot unless somebody reset the data using
4285 * > adb shell dumpsys binder_calls_stats --reset
4286 */
4287message BinderCallsExceptions {
4288 // Exception class name, e.g. java.lang.IllegalArgumentException.
4289 //
4290 // This is an exception class name thrown by the system server.
4291 optional string exception_class_name = 1;
4292 // Total number of exceptions.
4293 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004294}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004295
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004296/**
4297 * Pulls the statistics of message dispatching on HandlerThreads.
4298 *
4299 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4300 * config on the device.
4301 *
4302 * Next tag: 11
4303 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004304message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004305 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004306 optional int32 uid = 1 [(is_uid) = true];
4307
4308 // Fully qualified class name of the handler target class.
4309 //
4310 // This field does not contain PII. This is a system server class name.
4311 optional string handler_class_name = 2;
4312
4313 // The name of the thread that runs the Looper.
4314 //
4315 // This field does not contain PII. This is a system server thread name.
4316 optional string looper_thread_name = 3;
4317
4318 // The name of the dispatched message.
4319 //
4320 // This field does not contain PII. This is a system server constant or class
4321 // name.
4322 optional string message_name = 4;
4323
4324 // Total number of successfully dispatched messages.
4325 optional int64 message_count = 5;
4326
4327 // Total number of messages that failed dispatching.
4328 optional int64 exception_count = 6;
4329
4330 // Total number of processed messages we have data recorded for. If we
4331 // collected data for all the messages, message_count will be equal to
4332 // recorded_message_count.
4333 //
4334 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004335 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004336 optional int64 recorded_message_count = 7;
4337
4338 // Total latency of all processed messages.
4339 // Average can be computed using recorded_total_latency_micros /
4340 // recorded_message_count.
4341 optional int64 recorded_total_latency_micros = 8;
4342
4343 // Total CPU usage of all processed message.
4344 // Average can be computed using recorded_total_cpu_micros /
4345 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004346 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004347 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004348
4349 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4350 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004351
4352 // Max recorded CPU usage of all processed messages.
4353 optional int64 recorded_max_cpu_micros = 11;
4354
4355 // Max recorded latency of all processed messages.
4356 optional int64 recorded_max_latency_micros = 12;
4357
4358 // Total number of messages we tracked the dispatching delay for. If we
4359 // collected data for all the messages, message_count will be equal to
4360 // recorded_delay_message_count.
4361 //
4362 // If recorded_delay_message_count is different than message_count, it means data
4363 // collection has been sampled or/and not all messages specified the target dispatch time.
4364 // The fields below will be sampled in this case.
4365 optional int64 recorded_delay_message_count = 13;
4366
4367 // Total dispatching delay of all processed messages.
4368 // Calculated as a difference between the target dispatching time (Message.when)
4369 // and the actual dispatching time.
4370 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4371 optional int64 recorded_total_delay_millis = 14;
4372
4373 // Max dispatching delay of all processed messages.
4374 // Calculated as a difference between the target dispatching time (Message.when)
4375 // and the actual dispatching time.
4376 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004377}
Tej Singh86dc9db2018-09-06 00:39:57 +00004378
4379/**
4380 * Pulls disk information, such as write speed and latency.
4381 */
4382message DiskStats {
4383 // Time taken to open, write 512B to, and close a file.
4384 // -1 if error performing the check.
4385 optional int64 data_write_latency_millis = 1;
4386
4387 optional bool file_based_encryption = 2;
4388
4389 // Recent disk write speed in kB/s.
4390 // -1 if error querying storageed.
4391 // 0 if data is unavailable.
4392 optional int32 recent_disk_write_speed = 3;
4393}
4394
4395
4396/**
4397 * Free and total bytes of the Data, Cache, and System partition.
4398 */
4399message DirectoryUsage {
4400 enum Directory {
4401 UNKNOWN = 0;
4402 DATA = 1;
4403 CACHE = 2;
4404 SYSTEM = 3;
4405 }
4406 optional Directory directory = 1;
4407 optional int64 free_bytes = 2;
4408 optional int64 total_bytes = 3;
4409}
4410
4411
4412/**
4413 * Size of an application: apk size, data size, and cache size.
4414 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4415 * Information is only reported for apps with the primary user (user 0).
4416 * Sizes are aggregated by package name.
4417 */
4418message AppSize {
4419 // Including uids will involve modifying diskstats logic.
4420 optional string package_name = 1;
4421 // App size in bytes. -1 if unavailable.
4422 optional int64 app_size_bytes = 2;
4423 // App data size in bytes. -1 if unavailable.
4424 optional int64 app_data_size_bytes = 3;
4425 // App cache size in bytes. -1 if unavailable.
4426 optional int64 app_cache_size_bytes = 4;
4427 // Time that the cache file was produced.
4428 // Uses System.currentTimeMillis(), which is wall clock time.
4429 optional int64 cache_time_millis = 5;
4430}
4431
4432
4433/**
4434 * Size of a particular category. Eg: photos, videos.
4435 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4436 */
4437message CategorySize {
4438 enum Category {
4439 UNKNOWN = 0;
4440 APP_SIZE = 1;
4441 APP_DATA_SIZE = 2;
4442 APP_CACHE_SIZE = 3;
4443 PHOTOS = 4;
4444 VIDEOS = 5;
4445 AUDIO = 6;
4446 DOWNLOADS = 7;
4447 SYSTEM = 8;
4448 OTHER = 9;
4449 }
4450 optional Category category = 1;
4451 // Category size in bytes.
4452 optional int64 size_bytes = 2;
4453 // Time that the cache file was produced.
4454 // Uses System.currentTimeMillis(), which is wall clock time.
4455 optional int64 cache_time_millis = 3;
4456}
Tej Singhd6d6d772018-09-05 17:41:25 -07004457
4458/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004459 * Pulls per uid I/O stats. The stats are cumulative since boot.
4460 *
4461 * Read/write bytes are I/O events from a storage device
4462 * Read/write chars are data requested by read/write syscalls, and can be
4463 * satisfied by caching.
4464 *
4465 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4466 */
4467message DiskIo {
4468 optional int32 uid = 1 [(is_uid) = true];
4469 optional int64 fg_chars_read = 2;
4470 optional int64 fg_chars_write = 3;
4471 optional int64 fg_bytes_read = 4;
4472 optional int64 fg_bytes_write = 5;
4473 optional int64 bg_chars_read = 6;
4474 optional int64 bg_chars_write = 7;
4475 optional int64 bg_bytes_read = 8;
4476 optional int64 bg_bytes_write = 9;
4477 optional int64 fg_fsync = 10;
4478 optional int64 bg_fsync= 11;
4479}
4480
4481
4482/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004483 * Pulls the number of fingerprints for each user.
4484 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004485 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004486 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004487message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004488 // The associated user. Eg: 0 for owners, 10+ for others.
4489 // Defined in android/os/UserHandle.java
4490 optional int32 user = 1;
4491 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004492 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004493}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004494
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004495/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004496 * Pulls the number of faces for each user.
4497 *
4498 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4499 */
4500message NumFacesEnrolled {
4501 // The associated user. Eg: 0 for owners, 10+ for others.
4502 // Defined in android/os/UserHandle.java
4503 optional int32 user = 1;
4504 // Number of faces registered to that user.
4505 optional int32 num_faces_enrolled = 2;
4506}
4507/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004508 * A mapping of role holder -> role
4509 */
4510message RoleHolder {
4511 // uid of the role holder
4512 optional int32 uid = 1 [(is_uid) = true];
4513
4514 // package name of the role holder
4515 optional string package_name = 2;
4516
4517 // the role held
4518 optional string role = 3;
4519}
4520
Yangsteraf9aee72018-10-12 09:26:16 -07004521message AggStats {
4522 optional int64 min = 1;
4523
4524 optional int64 average = 2;
4525
4526 optional int64 max = 3;
4527}
4528
4529message ProcessStatsStateProto {
4530 optional android.service.procstats.ScreenState screen_state = 1;
4531
4532 optional android.service.procstats.MemoryState memory_state = 2;
4533
4534 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4535 // and not frameworks/base/core/java/android/app/ActivityManager.java
4536 optional android.service.procstats.ProcessState process_state = 3;
4537
4538 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004539 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004540
4541 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004542 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004543
4544 // # of samples taken
4545 optional int32 sample_size = 5;
4546
4547 // PSS is memory reserved for this process
4548 optional AggStats pss = 6;
4549
4550 // USS is memory shared between processes, divided evenly for accounting
4551 optional AggStats uss = 7;
4552
4553 // RSS is memory resident for this process
4554 optional AggStats rss = 8;
4555}
4556
4557// Next Tag: 7
4558message ProcessStatsProto {
4559 // Name of process.
4560 optional string process = 1;
4561
4562 // Uid of the process.
4563 optional int32 uid = 2;
4564
4565 // Information about how often kills occurred
4566 message Kill {
4567 // Count of excessive CPU kills
4568 optional int32 cpu = 1;
4569
4570 // Count of kills when cached
4571 optional int32 cached = 2;
4572
4573 // PSS stats during cached kill
4574 optional AggStats cached_pss = 3;
4575 }
4576 optional Kill kill = 3;
4577
4578 // Time and memory spent in various states.
4579 repeated ProcessStatsStateProto states = 5;
4580
4581 // Total time process has been running... screen_state, memory_state, and process_state
4582 // will not be set.
4583 optional ProcessStatsStateProto total_running_state = 6;
4584}
4585
4586message PackageServiceOperationStatsProto {
4587 // Operate enum: Started, Foreground, Bound, Executing
4588 optional android.service.procstats.ServiceOperationState operation = 1;
4589
4590 // Number of times the service was in this operation.
4591 optional int32 count = 2;
4592
4593 // Information about a state the service can be in.
4594 message StateStats {
4595 // Screen state enum.
4596 optional android.service.procstats.ScreenState screen_state = 1;
4597 // Memory state enum.
4598 optional android.service.procstats.MemoryState memory_state = 2;
4599
4600 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004601 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004602 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004603 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004604 }
4605 repeated StateStats state_stats = 3;
4606}
4607
4608message PackageServiceStatsProto {
4609 // Name of service component.
4610 optional string service_name = 1;
4611
4612 // The operation stats.
4613 // The package_name, package_uid, package_version, service_name will not be set to save space.
4614 repeated PackageServiceOperationStatsProto operation_stats = 2;
4615}
4616
4617message PackageAssociationSourceProcessStatsProto {
4618 // Uid of the process.
4619 optional int32 process_uid = 1;
4620 // Process name.
4621 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004622 // Package name.
4623 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004624 // Total count of the times this association appeared.
4625 optional int32 total_count = 3;
4626
4627 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004628 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004629
4630 // Total count of the times this association became actively impacting its target process.
4631 optional int32 active_count = 5;
4632
4633 // Information on one source in this association.
4634 message StateStats {
4635 // Process state enum.
4636 optional android.service.procstats.ProcessState process_state = 1;
4637 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004638 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004639 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004640 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004641 }
4642 repeated StateStats active_state_stats = 6;
4643}
4644
4645message PackageAssociationProcessStatsProto {
4646 // Name of the target component.
4647 optional string component_name = 1;
4648 // Information on one source in this association.
4649 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4650}
4651
4652
4653message ProcessStatsPackageProto {
4654 // Name of package.
4655 optional string package = 1;
4656
4657 // Uid of the package.
4658 optional int32 uid = 2;
4659
4660 // Version of the package.
4661 optional int64 version = 3;
4662
4663 // Stats for each process running with the package loaded in to it.
4664 repeated ProcessStatsProto process_stats = 4;
4665
4666 // Stats for each of the package's services.
4667 repeated PackageServiceStatsProto service_stats = 5;
4668
4669 // Stats for each association with the package.
4670 repeated PackageAssociationProcessStatsProto association_stats = 6;
4671}
4672
4673message ProcessStatsSectionProto {
4674 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004675 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004676
4677 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004678 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004679
4680 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004681 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004682
4683 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004684 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004685
4686 // System runtime library. e.g. "libdvm.so", "libart.so".
4687 optional string runtime = 5;
4688
4689 // whether kernel reports swapped pss.
4690 optional bool has_swapped_pss = 6;
4691
4692 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4693 enum Status {
4694 STATUS_UNKNOWN = 0;
4695 STATUS_COMPLETE = 1;
4696 STATUS_PARTIAL = 2;
4697 STATUS_SHUTDOWN = 3;
4698 STATUS_SYSPROPS = 4;
4699 }
4700 repeated Status status = 7;
4701
Chenjie Yub2ecc792019-01-17 10:27:26 -08004702 // Number of pages available of various types and sizes, representation fragmentation.
4703 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4704
Yangsteraf9aee72018-10-12 09:26:16 -07004705 // Stats for each process.
4706 repeated ProcessStatsProto process_stats = 8;
4707
4708 // Stats for each package.
4709 repeated ProcessStatsPackageProto package_stats = 9;
4710}
4711
Chenjie Yub2ecc792019-01-17 10:27:26 -08004712message ProcessStatsAvailablePagesProto {
4713 // Node these pages are in (as per /proc/pagetypeinfo)
4714 optional int32 node = 1;
4715
4716 // Zone these pages are in (as per /proc/pagetypeinfo)
4717 optional string zone = 2;
4718
4719 // Label for the type of these pages (as per /proc/pagetypeinfo)
4720 optional string label = 3;
4721
4722 // Distribution of number of pages available by order size. First entry in array is
4723 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4724 repeated int32 pages_per_order = 4;
4725}
4726
Chenjie Yu12e5e672018-09-14 15:54:59 -07004727/**
4728 * Pulled from ProcessStatsService.java
4729 */
4730message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004731 optional ProcessStatsSectionProto proc_stats_section = 1;
4732}
4733
Chenjie Yuf910b7802019-01-11 16:08:20 -08004734/**
4735 * Pulled from ProcessStatsService.java
4736 */
4737message ProcStatsPkgProc {
4738 optional ProcessStatsSectionProto proc_stats_section = 1;
4739}
4740
Yangsteraf9aee72018-10-12 09:26:16 -07004741message PowerProfileProto {
4742 optional double cpu_suspend = 1;
4743
4744 optional double cpu_idle = 2;
4745
4746 optional double cpu_active = 3;
4747
4748 message CpuCluster {
4749 optional int32 id = 1;
4750 optional double cluster_power = 2;
4751 optional int32 cores = 3;
4752 repeated int64 speed = 4;
4753 repeated double core_power = 5;
4754 }
4755
4756 repeated CpuCluster cpu_cluster = 40;
4757
4758 optional double wifi_scan = 4;
4759
4760 optional double wifi_on = 5;
4761
4762 optional double wifi_active = 6;
4763
4764 optional double wifi_controller_idle = 7;
4765
4766 optional double wifi_controller_rx = 8;
4767
4768 optional double wifi_controller_tx = 9;
4769
4770 repeated double wifi_controller_tx_levels = 10;
4771
4772 optional double wifi_controller_operating_voltage = 11;
4773
4774 optional double bluetooth_controller_idle = 12;
4775
4776 optional double bluetooth_controller_rx = 13;
4777
4778 optional double bluetooth_controller_tx = 14;
4779
4780 optional double bluetooth_controller_operating_voltage = 15;
4781
4782 optional double modem_controller_sleep = 16;
4783
4784 optional double modem_controller_idle = 17;
4785
4786 optional double modem_controller_rx = 18;
4787
4788 repeated double modem_controller_tx = 19;
4789
4790 optional double modem_controller_operating_voltage = 20;
4791
4792 optional double gps_on = 21;
4793
4794 repeated double gps_signal_quality_based = 22;
4795
4796 optional double gps_operating_voltage = 23;
4797
4798 optional double bluetooth_on = 24;
4799
4800 optional double bluetooth_active = 25;
4801
4802 optional double bluetooth_at_cmd = 26;
4803
4804 optional double ambient_display = 27;
4805
4806 optional double screen_on = 28;
4807
4808 optional double radio_on = 29;
4809
4810 optional double radio_scanning = 30;
4811
4812 optional double radio_active = 31;
4813
4814 optional double screen_full = 32;
4815
4816 optional double audio = 33;
4817
4818 optional double video = 34;
4819
4820 optional double flashlight = 35;
4821
4822 optional double memory = 36;
4823
4824 optional double camera = 37;
4825
4826 optional double wifi_batched_scan = 38;
4827
4828 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004829}
Chenjie Yuab530202018-09-26 12:39:20 -07004830
4831/**
4832 * power_profile.xml and other constants for power model calculations.
4833 * Pulled from PowerProfile.java
4834 */
4835message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004836 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004837}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004838
4839/**
arangelovd5db50e2018-10-12 20:24:39 +01004840 * Logs when a user restriction was added or removed.
4841 *
4842 * Logged from:
4843 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4844 */
4845message UserRestrictionChanged {
4846 // The raw string of the user restriction as defined in UserManager.
4847 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4848 optional string restriction = 1;
4849 // Whether the restriction is enabled or disabled.
4850 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004851}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004852
4853/**
4854 * Pulls process user time and system time. Puller takes a snapshot of all pids
4855 * in the system and returns cpu stats for those that are working at the time.
4856 * Dead pids will be dropped. Kernel processes are excluded.
4857 * Min cool-down is 5 sec.
4858 */
4859message ProcessCpuTime {
4860 optional int32 uid = 1 [(is_uid) = true];
4861
4862 optional string process_name = 2;
4863 // Process cpu time in user space, cumulative from boot/process start
4864 optional int64 user_time_millis = 3;
4865 // Process cpu time in system space, cumulative from boot/process start
4866 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004867}
Misha Wagner5a51e002018-10-03 15:04:09 +01004868
4869/**
4870 * Pulls the CPU usage for each thread.
4871 *
4872 * Read from /proc/$PID/task/$TID/time_in_state files.
4873 *
4874 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4875 * time_in_state files not being present on some phones, have not been addressed. These should be
4876 * considered before a public release.
4877 */
4878message CpuTimePerThreadFreq {
4879 // UID that owns the process.
4880 optional int32 uid = 1 [(is_uid) = true];
4881 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004882 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004883 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004884 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004885 // Name of the process taken from `/proc/$PID/cmdline`.
4886 optional string process_name = 4;
4887 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4888 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004889
4890 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4891 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4892 // frequencies are given here as the alternative is sending eight separate atoms. This method
4893 // significantly reduces the amount of data created
4894 optional int32 frequency1_khz = 6;
4895 optional int32 time1_millis = 7;
4896 optional int32 frequency2_khz = 8;
4897 optional int32 time2_millis = 9;
4898 optional int32 frequency3_khz = 10;
4899 optional int32 time3_millis = 11;
4900 optional int32 frequency4_khz = 12;
4901 optional int32 time4_millis = 13;
4902 optional int32 frequency5_khz = 14;
4903 optional int32 time5_millis = 15;
4904 optional int32 frequency6_khz = 16;
4905 optional int32 time6_millis = 17;
4906 optional int32 frequency7_khz = 18;
4907 optional int32 time7_millis = 19;
4908 optional int32 frequency8_khz = 20;
4909 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004910}
Bookatz75ee60422018-11-09 12:27:37 -08004911
4912/**
Bookatz366a4432018-11-20 09:42:33 -08004913 * Pulls information about the device's build.
4914 */
4915message BuildInformation {
4916 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4917 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4918 optional string fingerprint = 1;
4919
4920 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4921 optional string brand = 2;
4922
4923 // Build.PRODUCT. The name of the overall product.
4924 optional string product = 3;
4925
4926 // Build.DEVICE. The name of the industrial design.
4927 optional string device = 4;
4928
4929 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4930 optional string version_release = 5;
4931
4932 // Build.ID. E.g. a label like "M4-rc20".
4933 optional string id = 6;
4934
4935 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4936 // represent this build.
4937 optional string version_incremental = 7;
4938
4939 // Build.TYPE. The type of build, like "user" or "eng".
4940 optional string type = 8;
4941
4942 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4943 optional string tags = 9;
4944}
4945
4946/**
Adam He420947c2019-01-23 15:59:09 -08004947 * Logs information about mismatched caller for content capture.
4948 *
4949 * Logged from:
4950 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
4951 */
4952message ContentCaptureCallerMismatchReported {
4953 optional string intended_package = 1;
4954 optional string calling_package = 2;
4955}
4956
4957/**
4958 * Logs information about content capture service events.
4959 *
4960 * Logged from:
4961 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4962 */
4963message ContentCaptureServiceEvents {
4964 // The type of event.
4965 enum Event {
4966 UNKNOWN = 0;
4967 ON_CONNECTED = 1;
4968 ON_DISCONNECTED = 2;
4969 SET_WHITELIST = 3;
4970 SET_DISABLED = 4;
4971 ON_USER_DATA_REMOVED = 5;
4972 }
4973 optional Event event = 1;
4974 // component/package of content capture service.
4975 optional string service_info = 2;
4976 // component/package of target.
4977 // it's a concatenated list of component/package for SET_WHITELIST event
4978 // separated by " ".
4979 optional string target_info = 3;
4980}
4981
4982/**
4983 * Logs information about content capture session events.
4984 *
4985 * Logged from:
4986 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4987 */
4988message ContentCaptureSessionEvents {
4989 // The type of event.
4990 enum Event {
4991 UNKNOWN = 0;
4992 ON_SESSION_STARTED = 1;
4993 ON_SESSION_FINISHED = 2;
4994 SESSION_NOT_CREATED = 3;
4995 }
4996 optional int32 session_id = 1;
4997 optional Event event = 2;
4998 // (n/a on session finished)
4999 optional int32 state_flags = 3;
5000 // component/package of content capture service.
5001 optional string service_info = 4;
5002 // component/package of app.
5003 // (n/a on session finished)
5004 optional string app_info = 5;
5005 optional bool is_child_session = 6;
5006}
5007
5008/**
5009 * Logs information about session being flushed.
5010 *
5011 * Logged from:
5012 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5013 */
5014message ContentCaptureFlushed {
5015 optional int32 session_id = 1;
5016 // component/package of content capture service.
5017 optional string service_info = 2;
5018 // component/package of app.
5019 optional string app_info = 3;
5020 // session start/finish events
5021 optional int32 child_session_started = 4;
5022 optional int32 child_session_finished = 5;
5023 // count of view events.
5024 optional int32 view_appeared_count = 6;
5025 optional int32 view_disappeared_count = 7;
5026 optional int32 view_text_changed_count = 8;
5027
5028 // Flush stats.
5029 optional int32 max_events = 9;
5030 optional int32 idle_flush_freq = 10;
5031 optional int32 text_flush_freq = 11;
5032 optional int32 flush_reason = 12;
5033}
5034
5035/**
Bookatz75ee60422018-11-09 12:27:37 -08005036 * Pulls on-device BatteryStats power use calculations for the overall device.
5037 */
5038message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005039 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5040 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5041 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5042 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005043}
5044
5045/**
5046 * Pulls on-device BatteryStats power use calculations broken down by uid.
5047 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5048 * that is attributed to non-uid items. They must all be included to get the total power use.
5049 */
5050message DeviceCalculatedPowerBlameUid {
5051 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5052 optional int32 uid = 1 [(is_uid) = true];
5053
Bookatz3dbc13a2018-12-21 12:16:51 -08005054 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5055 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5056 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005057}
5058
5059/**
5060 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5061 * drain type.
5062 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5063 * is attributed uids. They must all be included to get the total power use.
5064 */
5065message DeviceCalculatedPowerBlameOther {
5066 // The type of item whose power use is being reported.
5067 enum DrainType {
5068 AMBIENT_DISPLAY = 0;
5069 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5070 BLUETOOTH = 2;
5071 CAMERA = 3;
5072 // Cell-standby
5073 CELL = 4;
5074 FLASHLIGHT = 5;
5075 IDLE = 6;
5076 MEMORY = 7;
5077 // Amount that total computed drain exceeded the drain estimated using the
5078 // battery level changes and capacity.
5079 OVERCOUNTED = 8;
5080 PHONE = 9;
5081 SCREEN = 10;
5082 // Amount that total computed drain was below the drain estimated using the
5083 // battery level changes and capacity.
5084 UNACCOUNTED = 11;
5085 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5086 WIFI = 13;
5087 }
5088 optional DrainType drain_type = 1;
5089
Bookatz3dbc13a2018-12-21 12:16:51 -08005090 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5091 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5092 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005093}
arangelov4e994062018-11-13 16:12:38 +00005094
5095/**
5096 * Logs device policy features.
5097 *
5098 * Logged from:
5099 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5100 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5101 */
5102message DevicePolicyEvent {
5103 // The event id - unique for each event.
5104 optional android.stats.devicepolicy.EventId event_id = 1;
5105 // The admin package name.
5106 optional string admin_package_name = 2;
5107 // A generic integer parameter.
5108 optional int32 integer_value = 3;
5109 // A generic boolean parameter.
5110 optional bool boolean_value = 4;
5111 // A parameter specifying a time period in milliseconds.
5112 optional uint64 time_period_millis = 5;
5113 // A parameter specifying a list of package names, bundle extras or string parameters.
5114 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5115}
shawnlinea5b66b2018-11-13 15:05:29 +08005116
5117/**
5118 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5119 *
5120 * Logged from:
5121 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5122 */
5123message DocsUILaunchReported {
5124 optional android.stats.docsui.LaunchAction launch_action = 1;
5125 optional bool has_initial_uri = 2;
5126 optional android.stats.docsui.MimeType mime_type = 3;
5127 optional android.stats.docsui.Root initial_root = 4;
5128}
5129
5130/**
5131 * Logs root/app visited event in file managers/picker. Call this when the user
5132 * taps on root/app in hamburger menu.
5133 *
5134 * Logged from:
5135 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5136 */
5137message DocsUIRootVisitedReported {
5138 optional android.stats.docsui.ContextScope scope = 1;
5139 optional android.stats.docsui.Root root = 2;
5140}
5141
5142/**
5143 * Logs file operation stats. Call this when a file operation has completed.
5144 *
5145 * Logged from:
5146 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5147 */
5148message DocsUIFileOperationReported {
5149 optional android.stats.docsui.Provider provider = 1;
5150 optional android.stats.docsui.FileOperation file_op = 2;
5151}
5152
5153/**
5154 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5155 * mode.
5156 *
5157 * Logged from:
5158 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5159 */
5160message DocsUIFileOperationCopyMoveModeReported {
5161 optional android.stats.docsui.FileOperation file_op = 1;
5162 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5163}
5164
5165
5166/**
5167 * Logs file sub operation stats. Call this when a file operation has failed.
5168 *
5169 * Logged from:
5170 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5171 */
5172message DocsUIFileOperationFailureReported {
5173 optional android.stats.docsui.Authority authority = 1;
5174 optional android.stats.docsui.SubFileOperation sub_op = 2;
5175}
5176
5177/**
5178* Logs the cancellation of a file operation. Call this when a job is canceled
5179*
5180* Logged from:
5181* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5182*/
5183message DocsUIFileOperationCanceledReported {
5184 optional android.stats.docsui.FileOperation file_op = 1;
5185}
5186
5187/**
5188 * Logs startup time in milliseconds.
5189 *
5190 * Logged from:
5191 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5192 */
5193message DocsUIStartupMsReported {
5194 optional int32 startup_millis = 1;
5195}
5196
5197/**
5198 * Logs the action that was started by user.
5199 *
5200 * Logged from:
5201 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5202 */
5203message DocsUIUserActionReported {
5204 optional android.stats.docsui.UserAction action = 1;
5205}
5206
5207/**
5208 * Logs the invalid type when invalid scoped access is requested.
5209 *
5210 * Logged from:
5211 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5212 */
5213message DocsUIInvalidScopedAccessRequestReported {
5214 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005215}
Ben Murdochbab399f62018-12-06 11:01:38 +00005216
5217/**
shawnlina75e82d2019-01-07 10:31:12 +08005218 * Logs the package name that launches docsui picker mode.
5219 *
5220 * Logged from:
5221 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5222 */
5223message DocsUIPickerLaunchedFromReported {
5224 optional string package_name = 1;
5225}
5226
5227/**
5228 * Logs the search type.
5229 *
5230 * Logged from:
5231 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5232 */
5233message DocsUISearchTypeReported {
5234 optional android.stats.docsui.SearchType search_type = 1;
5235}
5236
5237/**
5238 * Logs the search mode.
5239 *
5240 * Logged from:
5241 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5242 */
5243message DocsUISearchModeReported {
5244 optional android.stats.docsui.SearchMode search_mode = 1;
5245}
5246
5247/**
5248 * Logs the pick result information.
5249 *
5250 * Logged from:
5251 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5252 */
5253message DocsUIPickResultReported {
5254 optional int32 total_action_count = 1;
5255 optional int64 duration_millis = 2;
5256 optional int32 file_count= 3;
5257 optional bool is_searching = 4;
5258 optional android.stats.docsui.Root picked_from = 5;
5259 optional android.stats.docsui.MimeType mime_type = 6;
5260 optional int32 repeatedly_pick_times = 7;
5261}
5262
5263/**
Ben Murdochbab399f62018-12-06 11:01:38 +00005264 * Logs when an app's memory is compacted.
5265 *
5266 * Logged from:
5267 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5268 */
5269message AppCompacted {
5270 // The pid of the process being compacted.
5271 optional int32 pid = 1;
5272
5273 // The name of the process being compacted.
5274 optional string process_name = 2;
5275
5276 // The type of compaction.
5277 enum Action {
5278 UNKNOWN = 0;
5279 SOME = 1;
5280 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005281 PERSISTENT = 3;
5282 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00005283 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005284 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00005285
5286 // Total RSS in kilobytes consumed by the process prior to compaction.
5287 optional int64 before_rss_total_kilobytes = 4;
5288
5289 // File RSS in kilobytes consumed by the process prior to compaction.
5290 optional int64 before_rss_file_kilobytes = 5;
5291
5292 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5293 optional int64 before_rss_anon_kilobytes = 6;
5294
5295 // Swap in kilobytes consumed by the process prior to compaction.
5296 optional int64 before_swap_kilobytes = 7;
5297
5298 // Total RSS in kilobytes consumed by the process after compaction.
5299 optional int64 after_rss_total_kilobytes = 8;
5300
5301 // File RSS in kilobytes consumed by the process after compaction.
5302 optional int64 after_rss_file_kilobytes = 9;
5303
5304 // Anonymous RSS in kilobytes consumed by the process after compaction.
5305 optional int64 after_rss_anon_kilobytes = 10;
5306
5307 // Swap in kilobytes consumed by the process after compaction.
5308 optional int64 after_swap_kilobytes = 11;
5309
5310 // The time taken to perform compaction in milliseconds.
5311 optional int64 time_to_compact_millis = 12;
5312
5313 // The last compaction action performed for this app.
5314 optional Action last_action = 13;
5315
Ben Murdoch01720b82018-12-19 18:03:44 +00005316 // The last time that compaction was attempted on this process in milliseconds
5317 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5318 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00005319
Ben Murdoch885c21b2019-03-15 18:02:04 +00005320 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005321 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00005322
5323 // The process state at the time of compaction.
5324 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005325
5326 // Free ZRAM in kilobytes before compaction.
5327 optional int64 before_zram_free_kilobytes = 17;
5328
5329 // Free ZRAM in kilobytes after compaction.
5330 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00005331}
lifr157fc552018-12-12 16:38:04 +08005332
5333/**
lifrb6b90b62019-03-29 00:40:17 +08005334 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5335 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5336 *
lifr1f74b052019-04-16 22:16:30 +08005337 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5338 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5339 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5340 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005341 */
5342message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08005343 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005344
lifr1f74b052019-04-16 22:16:30 +08005345 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005346
5347 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005348 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005349
lifr1f74b052019-04-16 22:16:30 +08005350 // Only valid for event_type = EVENT_GETADDRINFO.
5351 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005352
lifr1f74b052019-04-16 22:16:30 +08005353 // Flags passed to android_res_nsend() defined in multinetwork.h
5354 // Only valid for event_type = EVENT_RESNSEND.
5355 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005356
lifrad9becc2019-05-20 11:04:41 +08005357 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005358
5359 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08005360 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005361
5362 // Additional pass-through fields opaque to statsd.
5363 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08005364 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08005365
5366 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
5367 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08005368}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005369
5370/**
5371 * Logs when a data stall event occurs.
5372 *
5373 * Log from:
5374 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5375 */
5376message DataStallEvent {
5377 // Data stall evaluation type.
5378 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5379 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5380 optional int32 evaluation_type = 1;
5381 // See definition in data_stall_event.proto.
5382 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5383 // See definition in data_stall_event.proto.
5384 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5385 // See definition in data_stall_event.proto.
5386 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5387 // See definition in data_stall_event.proto.
5388 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5389 // See definition in data_stall_event.proto.
5390 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5391}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005392
5393/*
5394 * Logs when RescueParty resets some set of experiment flags.
5395 *
5396 * Logged from:
5397 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5398 */
5399message RescuePartyResetReported {
5400 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5401 optional int32 rescue_level = 1;
5402}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005403
5404/**
5405 * Logs when signed config is received from an APK, and if that config was applied successfully.
5406 * Logged from:
5407 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5408 */
5409message SignedConfigReported {
5410 enum Type {
5411 UNKNOWN_TYPE = 0;
5412 GLOBAL_SETTINGS = 1;
5413 }
5414 optional Type type = 1;
5415
5416 // The final status of the signed config received.
5417 enum Status {
5418 UNKNOWN_STATUS = 0;
5419 APPLIED = 1;
5420 BASE64_FAILURE_CONFIG = 2;
5421 BASE64_FAILURE_SIGNATURE = 3;
5422 SECURITY_EXCEPTION = 4;
5423 INVALID_CONFIG = 5;
5424 OLD_CONFIG = 6;
5425 SIGNATURE_CHECK_FAILED = 7;
5426 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005427 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005428 }
5429 optional Status status = 2;
5430
5431 // The version of the signed config processed.
5432 optional int32 version = 3;
5433
5434 // The package name that the config was extracted from.
5435 optional string from_package = 4;
5436
5437 enum Key {
5438 NO_KEY = 0;
5439 DEBUG = 1;
5440 PRODUCTION = 2;
5441 }
5442 // Which key was used to verify the config.
5443 optional Key verified_with = 5;
5444}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005445
5446/*
5447 * Logs GNSS Network-Initiated (NI) location events.
5448 *
5449 * Logged from:
5450 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5451 */
5452message GnssNiEventReported {
5453 // The type of GnssNiEvent.
5454 enum EventType {
5455 UNKNOWN = 0;
5456 NI_REQUEST = 1;
5457 NI_RESPONSE = 2;
5458 }
5459 optional EventType event_type = 1;
5460
5461 // An ID generated by HAL to associate NI notifications and UI responses.
5462 optional int32 notification_id = 2;
5463
5464 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005465 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005466
5467 // NI requires notification.
5468 optional bool need_notify = 4;
5469
5470 // NI requires verification.
5471 optional bool need_verify = 5;
5472
5473 // NI requires privacy override, no notification/minimal trace.
5474 optional bool privacy_override = 6;
5475
5476 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5477 // seconds.
5478 optional int32 timeout = 7;
5479
5480 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005481 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005482
5483 // String representing the requester of the network inititated location request.
5484 optional string requestor_id = 9;
5485
5486 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5487 // network initiated location request.
5488 optional string text = 10;
5489
5490 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005491 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005492
5493 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005494 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005495
5496 // True if SUPL ES is enabled.
5497 optional bool is_supl_es_enabled = 13;
5498
5499 // True if GNSS location is enabled.
5500 optional bool is_location_enabled = 14;
5501
5502 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005503 optional android.server.location.GnssUserResponseType user_response = 15;
5504}
5505
5506/**
5507 * Logs GNSS non-framework (NFW) location notification.
5508 *
5509 * Logged from:
5510 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5511 */
5512message GnssNfwNotificationReported {
5513 // Package name of the Android proxy application representing the non-framework entity that
5514 // requested location. Set to empty string if unknown.
5515 optional string proxy_app_package_name = 1;
5516
5517 // Protocol stack that initiated the non-framework location request.
5518 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5519
5520 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5521 // set to empty string. This field is opaque to the framework and used for logging purposes.
5522 optional string other_protocol_stack_name = 3;
5523
5524 // Source initiating/receiving the location information.
5525 optional android.server.location.NfwRequestor requestor = 4;
5526
5527 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5528 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5529 // and used for logging purposes.
5530 optional string requestor_id = 5;
5531
5532 // Indicates whether location information was provided for this request.
5533 optional android.server.location.NfwResponseType response_type = 6;
5534
5535 // True if the device is in user initiated emergency session.
5536 optional bool in_emergency_mode = 7;
5537
5538 // True if cached location is provided.
5539 optional bool is_cached_location = 8;
5540
5541 // True if proxy app permission mismatch between framework and GNSS HAL.
5542 optional bool is_permission_mismatched = 9;
5543}
5544
5545/**
5546 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5547 *
5548 * Logged from:
5549 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5550 */
5551message GnssConfigurationReported {
5552 // SUPL host name.
5553 optional string supl_host = 1;
5554
5555 // SUPL port number.
5556 optional int32 supl_port = 2;
5557
5558 // C2K host name.
5559 optional string c2k_host = 3;
5560
5561 // C2K port number.
5562 optional int32 c2k_port = 4;
5563
5564 // The SUPL version requested by Carrier.
5565 optional int32 supl_ver = 5;
5566
5567 // The SUPL mode.
5568 optional android.server.location.SuplMode supl_mode = 6;
5569
5570 // True if NI emergency SUPL restrictions is enabled.
5571 optional bool supl_es = 7;
5572
5573 // LTE Positioning Profile settings
5574 optional android.server.location.LppProfile lpp_profile = 8;
5575
5576 // Positioning protocol on A-Glonass system.
5577 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5578
5579 // True if emergency PDN is used. Otherwise, regular PDN is used.
5580 optional bool use_emergency_pdn_for_emergency_supl= 10;
5581
5582 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5583 optional android.server.location.GpsLock gps_lock = 11;
5584
5585 // Number of seconds to extend the emergency session duration post emergency call.
5586 optional int32 es_extension_sec = 12;
5587
5588 // The full list of package names of proxy Android applications representing the non-framework
5589 // location access entities (on/off the device) for which the framework user has granted
5590 // non-framework location access permission. The package names are concatenated in one string
5591 // with spaces as separators.
5592 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005593}
Jack Yu95b64f32018-12-13 18:26:11 +08005594
5595/**
5596 * Logs when a NFC device's error occurred.
5597 * Logged from:
5598 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5599 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5600 */
5601message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005602 enum Type {
5603 UNKNOWN = 0;
5604 CMD_TIMEOUT = 1;
5605 ERROR_NOTIFICATION = 2;
5606 AID_OVERFLOW = 3;
5607 }
5608 optional Type type = 1;
5609 // If it's nci cmd timeout, log the timeout command.
5610 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005611
Alex Salod7c3eef2019-01-25 14:43:27 -08005612 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005613}
5614
5615/**
5616 * Logs when a NFC device's state changed event
5617 * Logged from:
5618 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5619 */
5620message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005621 enum State {
5622 UNKNOWN = 0;
5623 OFF = 1;
5624 ON = 2;
5625 ON_LOCKED = 3; // Secure Nfc enabled.
5626 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5627 }
5628 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005629}
5630
5631/**
5632 * Logs when a NFC Beam Transaction occurred.
5633 * Logged from:
5634 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5635 */
5636message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005637 enum Operation {
5638 UNKNOWN = 0;
5639 SEND = 1;
5640 RECEIVE = 2;
5641 }
5642 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005643}
5644
5645/**
5646 * Logs when a NFC Card Emulation Transaction occurred.
5647 * Logged from:
5648 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5649 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5650 */
5651message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005652 enum Category {
5653 UNKNOWN = 0;
5654 HCE_PAYMENT = 1;
5655 HCE_OTHER = 2;
5656 OFFHOST = 3;
5657 }
5658 // Transaction belongs to HCE payment or HCE other category, or offhost.
5659 optional Category category = 1;
5660 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5661 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005662}
5663
5664/**
5665 * Logs when a NFC Tag event occurred.
5666 * Logged from:
5667 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5668 */
5669message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005670 enum Type {
5671 UNKNOWN = 0;
5672 URL = 1;
5673 BT_PAIRING = 2;
5674 PROVISION = 3;
5675 WIFI_CONNECT = 4;
5676 APP_LAUNCH = 5;
5677 OTHERS = 6;
5678 }
5679 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005680}
5681
5682/**
5683 * Logs when Hce transaction triggered
5684 * Logged from:
5685 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5686 */
5687message NfcHceTransactionOccurred {
5688 // The latency period(in microseconds) it took for the first HCE data
5689 // exchange.
5690 optional uint32 latency_micros = 1;
5691}
5692
5693/**
5694 * Logs when SecureElement state event changed
5695 * Logged from:
5696 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5697 */
5698message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005699 enum State {
5700 UNKNOWN = 0;
5701 INITIALIZED = 1;
5702 DISCONNECTED = 2;
5703 CONNECTED = 3;
5704 HALCRASH = 4;
5705 }
5706 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005707
Alex Salod7c3eef2019-01-25 14:43:27 -08005708 optional string state_change_reason = 2;
5709 // SIMx or eSEx.
5710 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005711}
5712
5713/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005714 * Information about a permission grant request
5715 */
5716message PermissionGrantRequestResultReported {
5717 // unique value identifying an API call. A API call might result in multiple of these atoms
5718 optional int64 request_id = 1;
5719
5720 // UID of package requesting the permission grant
5721 optional int32 requesting_uid = 2 [(is_uid) = true];
5722
5723 // Name of package requesting the permission grant
5724 optional string requesting_package_name = 3;
5725
5726 // The permission to be granted
5727 optional string permission_name = 4;
5728
5729 // If the permission was explicitly requested via the API or added by the system
5730 optional bool is_implicit = 5;
5731
5732 enum Result {
5733 UNDEFINED = 0;
5734 // permission request was ignored
5735 IGNORED = 1;
5736 // permission request was ignored because it was user fixed
5737 IGNORED_USER_FIXED = 2;
5738 // permission request was ignored because it was policy fixed
5739 IGNORED_POLICY_FIXED = 3;
5740 // permission was granted by user action
5741 USER_GRANTED = 4;
5742 // permission was automatically granted
5743 AUTO_GRANTED = 5;
5744 // permission was denied by user action
5745 USER_DENIED = 6;
5746 // permission was denied with prejudice by the user
5747 USER_DENIED_WITH_PREJUDICE = 7;
5748 // permission was automatically denied
5749 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07005750 // permission request was ignored because permission is restricted
5751 IGNORED_RESTRICTED_PERMISSION = 9;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005752 }
5753 // The result of the permission grant
5754 optional Result result = 6;
5755}
5756
5757/**
Jack Yu95b64f32018-12-13 18:26:11 +08005758 * Logs when Omapi API used
5759 * Logged from:
5760 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5761 */
5762message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005763 enum Operation {
5764 UNKNOWN = 0;
5765 OPEN_CHANNEL = 1;
5766 }
5767 optional Operation operation = 1;
5768 // SIMx or eSEx.
5769 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005770
Alex Salod7c3eef2019-01-25 14:43:27 -08005771 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005772}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005773
5774/**
Alex Saloa060aee2019-01-21 14:36:41 -08005775 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5776 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005777 * Logged from:
5778 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5779 */
5780message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005781 optional int64 dispatch_latency_millis = 1;
5782}
5783
5784/**
5785 * Logs AttentionManagerService attention check result.
5786 *
5787 * Logged from:
5788 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5789 */
5790message AttentionManagerServiceResultReported {
5791 // See core/java/android/service/attention/AttentionService.java
5792 enum AttentionCheckResult {
5793 UNKNOWN = 20;
5794 ATTENTION_SUCCESS_ABSENT = 0;
5795 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07005796 ATTENTION_FAILURE_UNKNOWN = 2;
5797 ATTENTION_FAILURE_CANCELLED = 3;
5798 ATTENTION_FAILURE_PREEMPTED = 4;
5799 ATTENTION_FAILURE_TIMED_OUT = 5;
5800 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08005801 }
5802 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005803}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005804
5805/**
5806 * Logs when an adb connection changes state.
5807 *
5808 * Logged from:
5809 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5810 */
5811message AdbConnectionChanged {
5812 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5813 // previously selected for this system.
5814 optional int64 last_connection_time_millis = 1;
5815
5816 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5817 // to reconnect via adb without user interaction.
5818 optional int64 auth_window_millis = 2;
5819
5820 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5821 optional android.debug.AdbConnectionStateEnum state = 3;
5822
5823 // True if the 'always allow' option was selected for this system.
5824 optional bool always_allow = 4;
5825}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005826
5827/*
5828 * Logs the reported speech DSP status.
5829 *
5830 * Logged from:
5831 * Vendor audio implementation.
5832 */
5833message SpeechDspStatReported {
5834 // The total Speech DSP uptime in milliseconds.
5835 optional int32 total_uptime_millis = 1;
5836 // The total Speech DSP downtime in milliseconds.
5837 optional int32 total_downtime_millis = 2;
5838 optional int32 total_crash_count = 3;
5839 optional int32 total_recover_count = 4;
5840}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005841
5842/**
5843 * Logs USB connector contaminant status.
5844 *
5845 * Logged from: USB Service.
5846 */
5847message UsbContaminantReported {
5848 optional string id = 1;
5849 optional android.service.usb.ContaminantPresenceStatus status = 2;
5850}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005851
5852/**
5853 * This atom is for debugging purpose.
5854 */
5855message DebugElapsedClock {
5856 // Monotically increasing value for each pull.
5857 optional int64 pull_count = 1;
5858 // Time from System.elapsedRealtime.
5859 optional int64 elapsed_clock_millis = 2;
5860 // Time from System.elapsedRealtime.
5861 optional int64 same_elapsed_clock_millis = 3;
5862 // Diff between current elapsed time and elapsed time from previous pull.
5863 optional int64 elapsed_clock_diff_millis = 4;
5864
5865 enum Type {
5866 TYPE_UNKNOWN = 0;
5867 ALWAYS_PRESENT = 1;
5868 PRESENT_ON_ODD_PULLS = 2;
5869 }
5870 // Type of behavior for the pulled data.
5871 optional Type type = 5;
5872}
5873
5874/**
5875 * This atom is for debugging purpose.
5876 */
5877message DebugFailingElapsedClock {
5878 // Monotically increasing value for each pull.
5879 optional int64 pull_count = 1;
5880 // Time from System.elapsedRealtime.
5881 optional int64 elapsed_clock_millis = 2;
5882 // Time from System.elapsedRealtime.
5883 optional int64 same_elapsed_clock_millis = 3;
5884 // Diff between current elapsed time and elapsed time from previous pull.
5885 optional int64 elapsed_clock_diff_millis = 4;
5886}
Steven Wuacef6bb2019-01-23 14:21:17 -05005887
5888/** Logs System UI bubbles event changed.
5889 *
5890 * Logged from:
5891 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5892 */
5893message BubbleUIChanged {
5894
5895 // The app package that is posting the bubble.
5896 optional string package_name = 1;
5897
5898 // The notification channel that is posting the bubble.
5899 optional string notification_channel = 2;
5900
5901 // The notification id associated with the posted bubble.
5902 optional int32 notification_id = 3;
5903
5904 // The position of the bubble within the bubble stack.
5905 optional int32 position = 4;
5906
5907 // The total number of bubbles within the bubble stack.
5908 optional int32 total_number = 5;
5909
5910 // User interactions with the bubble.
5911 enum Action {
5912 UNKNOWN = 0;
5913 POSTED = 1;
5914 UPDATED = 2;
5915 EXPANDED = 3;
5916 COLLAPSED = 4;
5917 DISMISSED = 5;
5918 STACK_DISMISSED = 6;
5919 STACK_MOVED = 7;
5920 HEADER_GO_TO_APP = 8;
5921 HEADER_GO_TO_SETTINGS = 9;
5922 PERMISSION_OPT_IN = 10;
5923 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005924 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005925 SWIPE_LEFT = 13;
5926 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005927 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04005928 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05005929 }
5930 optional Action action = 6;
5931
5932 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5933 optional float normalized_x_position = 7;
5934 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04005935
5936 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
5937 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04005938
5939 // Whether the bubble is an on-going one.
5940 optional bool is_ongoing = 10;
5941
5942 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07005943 // This is deprecated and the value should be ignored.
5944 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05005945}
Kweku Adams8845d012018-12-11 20:06:45 -08005946
5947/**
Steven Wu552f63f2019-02-05 13:41:36 -05005948 * Logs System UI bubbles developer errors.
5949 *
5950 * Logged from:
5951 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5952 */
5953message BubbleDeveloperErrorReported {
5954
5955 // The app package that is posting the bubble.
5956 optional string package_name = 1;
5957
5958 // Bubble developer error type enums.
5959 enum Error {
5960 UNKNOWN = 0;
5961 ACTIVITY_INFO_MISSING = 1;
5962 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5963 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5964 }
5965 optional Error error = 2 [default = UNKNOWN];
5966}
5967
5968/**
Kweku Adams8845d012018-12-11 20:06:45 -08005969 * Logs that a constraint for a scheduled job has changed.
5970 *
5971 * Logged from:
5972 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5973 */
5974message ScheduledJobConstraintChanged {
5975 repeated AttributionNode attribution_node = 1;
5976
5977 // Name of the job.
5978 optional string job_name = 2;
5979
5980 optional com.android.server.job.ConstraintEnum constraint = 3;
5981
5982 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08005983 UNKNOWN = 0;
5984 UNSATISFIED = 1;
5985 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08005986 }
5987 optional State state = 4;
5988}
Alex Salod7c3eef2019-01-25 14:43:27 -08005989
5990/**
5991 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5992 * returns true.
5993 *
5994 * Logged from:
5995 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5996 */
5997message ScreenTimeoutExtensionReported {
5998 // Describes how many times in a row did the power manager reset the screen off timeout.
5999 optional uint32 consecutive_timeout_extended_count = 1;
6000}
Hui Yu885aca12019-01-10 17:11:34 -08006001
6002/*
6003* Logs number of milliseconds it takes to start a process.
6004* The definition of app process start time is from the app launch time to
6005* the time that Zygote finished forking the app process and loaded the
6006* application package's java classes.
6007
6008* This metric is different from AppStartOccurred which is for foreground
6009* activity only.
6010
6011* ProcessStartTime can report all processes (both foreground and background)
6012* start time.
6013*
6014* Logged from:
6015* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6016*/
6017message ProcessStartTime {
6018 // The uid of the ProcessRecord.
6019 optional int32 uid = 1 [(is_uid) = true];
6020
6021 // The process pid.
6022 optional int32 pid = 2;
6023
6024 // The process name.
6025 // Usually package name, "system" for system server.
6026 // Provided by ActivityManagerService.
6027 optional string process_name = 3;
6028
6029 enum StartType {
6030 UNKNOWN = 0;
6031 WARM = 1;
6032 HOT = 2;
6033 COLD = 3;
6034 }
6035
6036 // The start type.
6037 optional StartType type = 4;
6038
6039 // The elapsed realtime at the start of the process.
6040 optional int64 process_start_time_millis = 5;
6041
6042 // Number of milliseconds it takes to reach bind application.
6043 optional int32 bind_application_delay_millis = 6;
6044
6045 // Number of milliseconds it takes to finish start of the process.
6046 optional int32 process_start_delay_millis = 7;
6047
6048 // hostingType field in ProcessRecord, the component type such as "activity",
6049 // "service", "content provider", "broadcast" or other strings.
6050 optional string hosting_type = 8;
6051
6052 // hostingNameStr field in ProcessRecord. The component class name that runs
6053 // in this process.
6054 optional string hosting_name = 9;
6055}
6056
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006057/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006058 * Track Media Codec usage
6059 * Logged from:
6060 * frameworks/av/media/libstagefright/MediaCodec.cpp
6061 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6062 */
6063message MediametricsCodecReported {
6064 optional int64 timestamp_nanos = 1;
6065 optional string package_name = 2;
6066 optional int64 package_version_code = 3;
6067 optional int64 media_apex_version = 4;
6068
6069 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6070}
6071
6072/**
6073 * Track Media Extractor (pulling video/audio streams out of containers) usage
6074 * Logged from:
6075 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6076 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6077 */
6078message MediametricsExtractorReported {
6079 optional int64 timestamp_nanos = 1;
6080 optional string package_name = 2;
6081 optional int64 package_version_code = 3;
6082 optional int64 media_apex_version = 4;
6083
6084 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6085}
6086
6087/**
6088 * Track how we arbitrate between microphone/input requests.
6089 * Logged from
6090 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6091 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6092 */
6093message MediametricsAudiopolicyReported {
6094 optional int64 timestamp_nanos = 1;
6095 optional string package_name = 2;
6096 optional int64 package_version_code = 3;
6097 optional int64 media_apex_version = 4;
6098
6099 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6100}
6101
6102/**
6103 * Track how we arbitrate between microphone requests.
6104 * Logged from
6105 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6106 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6107 */
6108message MediametricsAudiorecordReported {
6109 optional int64 timestamp_nanos = 1;
6110 optional string package_name = 2;
6111 optional int64 package_version_code = 3;
6112 optional int64 media_apex_version = 4;
6113
6114 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6115}
6116
6117/**
6118 * Track how we arbitrate between microphone/input requests.
6119 * Logged from
6120 * frameworks/av/media/libnblog/ReportPerformance.cpp
6121 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6122 */
6123message MediametricsAudiothreadReported {
6124 optional int64 timestamp_nanos = 1;
6125 optional string package_name = 2;
6126 optional int64 package_version_code = 3;
6127 optional int64 media_apex_version = 4;
6128
6129 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6130}
6131
6132/**
6133 * Track how we arbitrate between microphone/input requests.
6134 * Logged from
6135 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6136 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6137 */
6138message MediametricsAudiotrackReported {
6139 optional int64 timestamp_nanos = 1;
6140 optional string package_name = 2;
6141 optional int64 package_version_code = 3;
6142 optional int64 media_apex_version = 4;
6143
6144 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6145}
6146
6147/**
6148 * Track information about DRM framework performance
6149 * Logged from
6150 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6151 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6152 */
6153message MediametricsMediadrmReported {
6154 optional int64 timestamp_nanos = 1;
6155 optional string package_name = 2;
6156 optional int64 package_version_code = 3;
6157 optional int64 media_apex_version = 4;
6158
6159 // vendor+description tell about which DRM plugin is in use on this device
6160 optional string vendor = 5;
6161 optional string description = 6;
6162 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6163 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6164}
6165
6166/**
6167 * Track information about the widevine DRM plugin performance
6168 * Logged from
6169 * vendor/widevine/libwvdrmengine/cdm/metrics
6170 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6171 */
6172message MediametricsDrmWidevineReported {
6173 optional int64 timestamp_nanos = 1;
6174 optional string package_name = 2;
6175 optional int64 package_version_code = 3;
6176 optional int64 media_apex_version = 4;
6177
6178 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6179}
6180
6181/**
6182 * Track information about recordings (e.g. camcorder)
6183 * Logged from
6184 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6185 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6186 */
6187message MediametricsRecorderReported {
6188 optional int64 timestamp_nanos = 1;
6189 optional string package_name = 2;
6190 optional int64 package_version_code = 3;
6191 optional int64 media_apex_version = 4;
6192
6193 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6194}
6195
6196/**
6197 * Track Media Player usage
6198 * Logged from:
6199 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6200 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6201 */
6202message MediametricsNuPlayerReported {
6203 optional int64 timestamp_nanos = 1;
6204 optional string package_name = 2;
6205 optional int64 package_version_code = 3;
6206 optional int64 media_apex_version = 4;
6207
6208 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6209}
6210
6211/**
Robert Shiha4beed32019-08-19 14:15:23 -07006212 * Track Legacy DRM usage
6213 * Logged from
6214 * frameworks/av/drm/drmserver/DrmManager.cpp
6215 */
6216message MediametricsDrmManagerReported {
6217 optional int64 timestamp_nanos = 1;
6218 optional string package_name = 2;
6219 optional int64 package_version_code = 3;
6220 optional int64 media_apex_version = 4;
6221
6222 enum Method {
6223 METHOD_NOT_FOUND = -1;
6224 GET_CONSTRAINTS = 0;
6225 GET_METADATA = 1;
6226 CAN_HANDLE = 2;
6227 PROCESS_DRM_INFO = 3;
6228 ACQUIRE_DRM_INFO = 4;
6229 SAVE_RIGHTS = 5;
6230 GET_ORIGINAL_MIME_TYPE = 6;
6231 GET_DRM_OBJECT_TYPE = 7;
6232 CHECK_RIGHTS_STATUS = 8;
6233 REMOVE_RIGHTS = 9;
6234 REMOVE_ALL_RIGHTS = 10;
6235 OPEN_CONVERT_SESSION = 11;
6236 OPEN_DECRYPT_SESSION = 12;
6237 }
6238
6239 // plugin_id+description inform which Legacy DRM plugins are still in use on device
6240 optional string plugin_id = 5;
6241 optional string description = 6;
6242 optional Method method = 7;
6243 optional string mime_types = 8;
6244}
6245
6246/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006247 * State of a dangerous permission requested by a package
6248 */
6249message DangerousPermissionState {
6250 // Name of the permission
6251 optional string permission_name = 1;
6252
6253 // Uid of the package
6254 optional int32 uid = 2 [(is_uid) = true];
6255
6256 // Package requesting the permission
6257 optional string package_name = 3;
6258
6259 // If the permission is granted to the uid
6260 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01006261
6262 // Permission flags as per android.content.pm.PermissionFlags
6263 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006264}
6265
Michael Groover4a0ca942019-01-24 17:41:25 -08006266/**
6267 * Logs when a package is denied access to a device identifier based on the new access requirements.
6268 *
6269 * Logged from:
6270 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6271 */
6272message DeviceIdentifierAccessDenied {
6273 // The name of the package denied access to the requested device identifier.
6274 optional string package_name = 1;
6275
6276 // The name of the device identifier method the package attempted to invoke.
6277 optional string method_name = 2;
6278
6279 // True if the package is preinstalled.
6280 optional bool is_preinstalled = 3;
6281
6282 // True if the package is privileged.
6283 optional bool is_priv_app = 4;
6284}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006285
6286/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006287 * Pulls the ongoing mainline install train version code.
6288 * Pulled from StatsCompanionService
6289 */
6290message TrainInfo {
6291 optional int64 train_version_code = 1;
6292
6293 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006294
6295 optional string train_name = 3;
6296
6297 enum Status {
6298 UNKNOWN = 0;
6299 INSTALL_REQUESTED = 1;
6300 INSTALL_STARTED = 2;
6301 INSTALL_STAGED_NOT_READY = 3;
6302 INSTALL_STAGED_READY = 4;
6303 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006304 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6305 // and INSTALL_FAILURE_COMMIT.
6306 INSTALL_FAILURE = 6 [deprecated = true];
6307 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006308 INSTALL_CANCELLED = 7;
6309 INSTALLER_ROLLBACK_REQUESTED = 8;
6310 INSTALLER_ROLLBACK_INITIATED = 9;
6311 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6312 INSTALLER_ROLLBACK_STAGED = 11;
6313 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6314 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6315 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6316 INSTALLER_ROLLBACK_SUCCESS = 15;
6317 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006318 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6319 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6320 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6321 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6322 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6323 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006324 INSTALL_FAILURE_DOWNLOAD = 23;
6325 INSTALL_FAILURE_STATE_MISMATCH = 24;
6326 INSTALL_FAILURE_COMMIT = 25;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006327 }
6328 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006329}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006330
6331/**
6332 * Logs the gesture stage changed event.
6333 *
6334 * Logged from:
6335 * frameworks/base/packages/SystemUI/
6336 */
6337message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006338 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006339}
6340
6341/**
6342 * Logs the feedback type.
6343 *
6344 * Logged from:
6345 * frameworks/base/packages/SystemUI/
6346 */
6347message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006348 // Whether or not the gesture was used.
6349 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006350}
6351
6352/**
6353 * Logs the progress.
6354 *
6355 * Logged from:
6356 * frameworks/base/packages/SystemUI/
6357 */
6358message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006359 // [0,100] progress for the assist gesture.
6360 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006361}
Neil Fullerdb14b482019-02-05 19:44:44 +00006362
6363/*
6364 * Information about the time zone data on a device.
6365 */
6366message TimeZoneDataInfo {
6367 // A version identifier for the data set on device. e.g. "2018i"
6368 optional string tzdb_version = 1;
6369}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006370
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006371/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006372 * Logs the GPU stats global health information.
6373 *
6374 * Logged from:
6375 * frameworks/native/services/gpuservice/gpustats/
6376 */
6377message GpuStatsGlobalInfo {
6378 // Package name of the gpu driver.
6379 optional string driver_package_name = 1;
6380
6381 // Version name of the gpu driver.
6382 optional string driver_version_name = 2;
6383
6384 // Version code of the gpu driver.
6385 optional int64 driver_version_code = 3;
6386
6387 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
6388 optional int64 driver_build_time = 4;
6389
6390 // Total count of the gl driver gets loaded.
6391 optional int64 gl_loading_count = 5;
6392
6393 // Total count of the gl driver fails to be loaded.
6394 optional int64 gl_loading_failure_count = 6;
6395
6396 // Total count of the Vulkan driver gets loaded.
6397 optional int64 vk_loading_count = 7;
6398
6399 // Total count of the Vulkan driver fails to be loaded.
6400 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07006401
6402 // Api version of the system Vulkan driver.
6403 optional int32 vulkan_version = 9;
6404
6405 // Api version of the system CPU Vulkan driver.
6406 optional int32 cpu_vulkan_version = 10;
6407
6408 // Api version of the system GLES driver.
6409 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006410
6411 // Total count of the angle driver gets loaded.
6412 optional int64 angle_loading_count = 12;
6413
6414 // Total count of the angle driver fails to be loaded.
6415 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006416}
6417
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006418/**
6419 * GPU driver loading time info.
6420 */
6421message GpuDriverLoadingTime {
6422 // List of all the driver loading times for this app. The list size is
6423 // capped at 50.
6424 repeated int64 driver_loading_time = 1;
6425}
6426
6427/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006428 * Logs the GPU stats per app health information.
6429 *
6430 * Logged from:
6431 * frameworks/native/services/gpuservice/gpustats/
6432 */
6433message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006434 // Package name of the application that loads the gpu driver. Total number
6435 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006436 optional string app_package_name = 1;
6437
6438 // Version code of the gpu driver this app loads.
6439 optional int64 driver_version_code = 2;
6440
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006441 // gl driver loading time info.
6442 optional GpuDriverLoadingTime gl_driver_loading_time = 3
6443 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006444
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006445 // Vulkan driver loading time info.
6446 optional GpuDriverLoadingTime vk_driver_loading_time = 4
6447 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006448
6449 // Angle driver loading time info.
6450 optional GpuDriverLoadingTime angle_driver_loading_time = 5
6451 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07006452
6453 // CPU Vulkan implementation is in use.
6454 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07006455
6456 // App is not doing pre-rotation correctly.
6457 optional bool false_prerotation = 7;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006458}
Rafal Slawikd4e87572019-03-12 13:08:38 +00006459
6460/*
6461 * Logs the size of the system ion heap.
6462 *
6463 * Pulled from StatsCompanionService.
6464 */
6465message SystemIonHeapSize {
6466 // Size of the system ion heap in bytes.
6467 optional int64 size_in_bytes = 1;
6468}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006469
Rafal Slawik77987ed2019-06-17 12:28:23 +01006470/*
6471 * Logs the per-process size of the system ion heap.
6472 *
6473 * Pulled from StatsCompanionService.
6474 */
6475message ProcessSystemIonHeapSize {
6476 // The uid if available. -1 means not available.
6477 optional int32 uid = 1 [(is_uid) = true];
6478
6479 // The process name (from /proc/PID/cmdline).
6480 optional string process_name = 2;
6481
6482 // Sum of sizes of all allocations.
6483 optional int32 total_size_in_kilobytes = 3;
6484
6485 // Number of allocations.
6486 optional int32 allocation_count = 4;
6487
6488 // Size of the largest allocation.
6489 optional int32 max_size_in_kilobytes = 5;
6490}
6491
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006492/**
6493 * Push network stack events.
6494 *
6495 * Log from:
6496 * frameworks/base/packages/NetworkStack/
6497 */
6498message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08006499 // The id that indicates the event reported from NetworkStack.
6500 optional int32 event_id = 1;
6501 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006502 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
6503}
Carmen Agimofa769c152019-03-04 14:39:14 +00006504
6505/**
6506 * Logs the apps that are installed on the external storage.
6507 * Pulled from:
6508 * StatsCompanionService
6509 */
6510message AppsOnExternalStorageInfo {
6511 // The type of the external storage.
6512 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
6513 // The name of the package that is installed on the external storage.
6514 optional string package_name = 2;
6515}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07006516
6517/**
6518 * Logs the settings related to Face.
6519 * Logged from:
6520 * frameworks/base/services/core/java/com/android/server/stats
6521 */
6522message FaceSettings {
6523 // Whether or not face unlock is allowed on Keyguard.
6524 optional bool unlock_keyguard_enabled = 1;
6525 // Whether or not face unlock dismisses the Keyguard.
6526 optional bool unlock_dismisses_keyguard = 2;
6527 // Whether or not face unlock requires attention.
6528 optional bool unlock_attention_required = 3;
6529 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
6530 optional bool unlock_app_enabled = 4;
6531 // Whether or not face unlock always requires user confirmation.
6532 optional bool unlock_always_require_confirmation = 5;
6533 // Whether or not a diverse set of poses are required during enrollment.
6534 optional bool unlock_diversity_required = 6;
6535}
Maggie White442b6312019-04-05 16:26:44 -07006536
6537/**
6538 * Logs cooling devices maintained by the kernel.
6539 *
6540 * Pulled from StatsCompanionService.java
6541 */
6542message CoolingDevice {
6543 // The type of cooling device being reported. Eg. CPU, GPU...
6544 optional android.os.CoolingTypeEnum device_location = 1;
6545 // The name of the cooling device source. Eg. CPU0
6546 optional string device_name = 2;
6547 // Current throttle state of the cooling device. The value can any unsigned
6548 // integer between 0 and max_state defined in its driver. 0 means device is
6549 // not in throttling, higher value means deeper throttling.
6550 optional int32 state = 3;
6551}
Ben Blount763a5d52019-04-10 11:48:58 -07006552
6553/**
6554 * Intelligence has several counter-type events that don't warrant a
6555 * full separate atom. These are primarily API call counters but also include
6556 * counters for feature usage and specific failure modes.
6557 *
6558 * Logged from the Intelligence mainline module.
6559 */
6560message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07006561 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07006562 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07006563 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07006564 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07006565 // How many times the event occured (to report a batch of high frequency events).
6566 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07006567 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07006568 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07006569}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07006570
6571/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07006572 * Logs when Car Power state changed.
6573 *
6574 * Logged from:
6575 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6576 */
6577message CarPowerStateChanged {
6578 // States come from CpmsState in CarPowerManagementService.java.
6579 enum State {
6580 WAIT_FOR_VHAL = 0;
6581 ON = 1;
6582 SHUTDOWN_PREPARE = 2;
6583 WAIT_FOR_FINISH = 3;
6584 SUSPEND = 4;
6585 SIMULATE_SLEEP = 5;
6586 }
6587 optional State state = 1;
6588}
6589
6590/**
6591 * Logs whether GarageMode is entered.
6592 *
6593 * Logged from:
6594 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6595 */
6596message GarageModeInfo {
6597 // Whether GarageMode is entered.
6598 optional bool is_garage_mode = 1;
6599}
Martijn Coenencd95d462019-04-25 17:09:45 +02006600
6601/**
6602 * Historical app ops data per package.
6603 */
6604message AppOps {
6605 // Uid of the package requesting the op
6606 optional int32 uid = 1 [(is_uid) = true];
6607
6608 // Nmae of the package performing the op
6609 optional string package_name = 2;
6610
6611 // operation id; maps to the OP_* constants in AppOpsManager.java
6612 optional int32 op_id = 3;
6613
6614 // The number of times the op was granted while the app was in the
6615 // foreground (only for trusted requests)
6616 optional int64 trusted_foreground_granted_count = 4;
6617
6618 // The number of times the op was granted while the app was in the
6619 // background (only for trusted requests)
6620 optional int64 trusted_background_granted_count = 5;
6621
6622 // The number of times the op was rejected while the app was in the
6623 // foreground (only for trusted requests)
6624 optional int64 trusted_foreground_rejected_count = 6;
6625
6626 // The number of times the op was rejected while the app was in the
6627 // background (only for trusted requests)
6628 optional int64 trusted_background_rejected_count = 7;
6629
6630 // For long-running operations, total duration of the operation
6631 // while the app was in the foreground (only for trusted requests)
6632 optional int64 trusted_foreground_duration_millis = 8;
6633
6634 // For long-running operations, total duration of the operation
6635 // while the app was in the background (only for trusted requests)
6636 optional int64 trusted_background_duration_millis = 9;
6637}
Hongyi Zhang700137e2019-05-23 21:19:36 -07006638
6639/**
6640 * Location Manager API Usage information(e.g. API under usage,
6641 * API call's parameters).
6642 * Logged from:
6643 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
6644 */
6645message LocationManagerApiUsageReported {
6646
6647 // Indicating if usage starts or usage ends.
6648 optional android.stats.location.UsageState state = 1;
6649
6650 // LocationManagerService's API in use.
6651 // We can identify which API from LocationManager is
6652 // invoking current LMS API by the combination of
6653 // API parameter(e.g. is_listener_null, is_intent_null,
6654 // is_location_request_null)
6655 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
6656
6657 // Name of the package calling the API.
6658 optional string calling_package_name = 3;
6659
6660 // Type of the location provider.
6661 optional android.stats.location.ProviderType provider = 4;
6662
6663 // Quality of the location request
6664 optional android.stats.location.LocationRequestQuality quality = 5;
6665
6666 // The desired interval for active location updates, in milliseconds.
6667 // Bucketized to reduce cardinality.
6668 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
6669
6670 // Minimum distance between location updates, in meters.
6671 // Bucketized to reduce cardinality.
6672 optional android.stats.location.SmallestDisplacementBucket
6673 bucketized_smallest_displacement = 7;
6674
6675 // The number of location updates.
6676 optional int64 num_updates = 8;
6677
6678 // The request expiration time, in millisecond since boot.
6679 // Bucketized to reduce cardinality.
6680 optional android.stats.location.ExpirationBucket
6681 bucketized_expire_in = 9;
6682
6683 // Type of Callback passed in for this API.
6684 optional android.stats.location.CallbackType callback_type = 10;
6685
6686 // The radius of the central point of the alert
6687 // region, in meters. Only for API REQUEST_GEOFENCE.
6688 // Bucketized to reduce cardinality.
6689 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
6690
6691 // Activity Importance of API caller.
6692 // Categorized to 3 types that are interesting from location's perspective.
6693 optional android.stats.location.ActivityImportance activiy_importance = 12;
6694}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01006695
6696/**
6697 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
6698 */
6699message ReviewPermissionsFragmentResultReported {
6700 // unique value identifying a permission group change. A permission group change might result
6701 // in multiple of these atoms
6702 optional int64 change_id = 1;
6703
6704 // UID of package the permission belongs to
6705 optional int32 uid = 2 [(is_uid) = true];
6706
6707 // Name of package the permission belongs to
6708 optional string package_name = 3;
6709
6710 // The permission to be granted
6711 optional string permission_name = 4;
6712
6713 // The result of the permission grant
6714 optional bool permission_granted = 5;
6715}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01006716
6717/**
6718* Information about results of permission upgrade by RuntimePermissionsUpgradeController
6719* Logged from: RuntimePermissionUpdgradeController
6720*/
6721message RuntimePermissionsUpgradeResult {
6722 // Permission granted as result of upgrade
6723 optional string permission_name = 1;
6724
6725 // UID of package granted permission
6726 optional int32 uid = 2 [(is_uid) = true];
6727
6728 // Name of package granted permission
6729 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01006730}
6731
6732/**
6733* Information about a buttons presented in GrantPermissionsActivty and choice made by user
6734*/
6735message GrantPermissionsActivityButtonActions {
6736 // Permission granted as result of upgrade
6737 optional string permission_group_name = 1;
6738
6739 // UID of package granted permission
6740 optional int32 uid = 2 [(is_uid) = true];
6741
6742 // Name of package requesting permission
6743 optional string package_name = 3;
6744
6745 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
6746 // LABEL_ constants in GrantPermissionActivity.java
6747 optional int32 buttons_presented = 4;
6748
6749 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
6750 optional int32 button_clicked = 5;
6751}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01006752
6753/**
6754 * Information about LocationAccessCheck notification presented to user
6755 */
6756message LocationAccessCheckNotificationAction {
6757
6758 // id which identifies single session of user interacting with permission controller
6759 optional int64 session_id = 1;
6760
6761 // Uid of package for which location access check is presented
6762 optional int32 package_uid = 2;
6763
6764 // Name of package for which location access check is presented
6765 optional string package_name = 3;
6766
6767 enum Result {
6768 UNDEFINED = 0;
6769 // notification was presented to the user
6770 NOTIFICATION_PRESENTED = 1;
6771 // notification was declined by the user
6772 NOTIFICATION_DECLINED = 2;
6773 // notification was clicked by the user
6774 NOTIFICATION_CLICKED = 3;
6775 }
6776
6777 // View / interaction recorded
6778 optional Result result = 4;
6779}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01006780
6781/**
6782 * Information about a permission grant or revoke made by user inside AppPermissionFragment
6783 */
6784message AppPermissionFragmentActionReported {
6785 // id which identifies single session of user interacting with permission controller
6786 optional int64 session_id = 1;
6787
6788 // unique value identifying a permission group change. A permission group change might result
6789 // in multiple of these atoms
6790 optional int64 change_id = 2;
6791
6792 // UID of package the permission belongs to
6793 optional int32 uid = 3 [(is_uid) = true];
6794
6795 // Name of package the permission belongs to
6796 optional string package_name = 4;
6797
6798 // The permission to be granted
6799 optional string permission_name = 5;
6800
6801 // The result of the permission grant
6802 optional bool permission_granted = 6;
6803}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01006804
6805/**
6806* Information about a AppPermissionFragment viewed by user
6807*/
6808message AppPermissionFragmentViewed {
6809 // id which identifies single session of user interacting with permission controller
6810 optional int64 session_id = 1;
6811
6812 // UID of package for which permissions are viewed
6813 optional int32 uid = 2 [(is_uid) = true];
6814
6815 // Name of package for which permissions are viewed
6816 optional string package_name = 3;
6817
6818 // Permission group viewed
6819 optional string permission_group_name = 4;
6820}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01006821
6822/**
6823* Information about a AppPermissionsFragment viewed by user
6824*/
6825message AppPermissionsFragmentViewed {
6826 // id which identifies single session of user interacting with permission controller
6827 optional int64 session_id = 1;
6828
6829 // id which identifies single view as every view might have several logging records
6830 // with different package information attached
6831 optional int64 view_id = 2;
6832
6833 // Permission group viewed
6834 optional string permission_group_name = 3;
6835
6836 // UID of package for which permissions are viewed
6837 optional int32 uid = 4 [(is_uid) = true];
6838
6839 // Name of package for which permissions are viewed
6840 optional string package_name = 5;
6841
6842 // Category in which permission is included
6843 enum Category {
6844 UNDEFINED = 0;
6845 ALLOWED = 1;
6846 ALLOWED_FOREGROUND = 2;
6847 DENIED = 3;
6848 }
6849 optional Category category = 6;
6850}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01006851
6852/**
6853* Information about a PermissionAppsFragment viewed by user.
6854* Logged from ui/handheld/PermissionAppsFragment.java
6855*/
6856message PermissionAppsFragmentViewed {
6857 // id which identifies single session of user interacting with permission controller
6858 optional int64 session_id = 1;
6859
6860 // id which identifies single view as every view might have several logging records
6861 // with different package information attached
6862 optional int64 view_id = 2;
6863
6864 // Permission group viewed
6865 optional string permission_group_name = 3;
6866
6867 // UID of package for which permissions are viewed
6868 optional int32 uid = 4 [(is_uid) = true];
6869
6870 // Name of package for which permissions are viewed
6871 optional string package_name = 5;
6872
6873 // Category in which app is included
6874 enum Category {
6875 UNDEFINED = 0;
6876 ALLOWED = 1;
6877 ALLOWED_FOREGROUND = 2;
6878 DENIED = 3;
6879 }
6880 optional Category category = 6;
6881}
Tony Make2b1b672019-07-29 16:59:47 +01006882
6883/**
6884 * Logs when there is a smart selection related event.
6885 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
6886 * Logged from: TextClassifierEventLogger.java
6887 */
6888message TextSelectionEvent {
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 // Relative word index of the start of the selection.
6908 optional int32 relative_word_start_index = 7;
6909
6910 // Relative word (exclusive) index of the end of the selection.
6911 optional int32 relative_word_end_index = 8;
6912
6913 // Relative word index of the start of the smart selection.
6914 optional int32 relative_suggested_word_start_index = 9;
6915
6916 // Relative word (exclusive) index of the end of the smart selection.
6917 optional int32 relative_suggested_word_end_index = 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 smart linkify related event.
6925 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
6926 * Logged from: TextClassifierEventLogger.java
6927 */
6928message TextLinkifyEvent {
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 // Index of this event in a session.
6942 optional int32 event_index = 5;
6943
6944 // Entity type that is involved.
6945 optional string entity_type = 6;
6946
6947 // Number of links detected.
6948 optional int32 num_links = 7;
6949
6950 // The total length of all links.
6951 optional int32 linked_text_length = 8;
6952
6953 // Length of input text.
6954 optional int32 text_length = 9;
6955
6956 // Time spent on generating links in ms.
6957 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01006958
6959 // Name of source package.
6960 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01006961}
6962
6963/**
6964 * Logs when there is a conversation actions related event.
6965 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
6966 * Logged from: TextClassifierEventLogger.java
6967 */
6968message ConversationActionsEvent {
6969 // A session ID.
6970 optional string session_id = 1;
6971
6972 // Event type of this event.
6973 optional android.stats.textclassifier.EventType event_type = 2;
6974
6975 // Name of the model that is involved in this event.
6976 optional string model_name = 3;
6977
6978 // Type of widget that was involved in triggering this event.
6979 optional android.stats.textclassifier.WidgetType widget_type = 4;
6980
6981 // The first entity type that is involved.
6982 optional string first_entity_type = 5;
6983
6984 // The second entity type that is involved.
6985 optional string second_entity_type = 6;
6986
6987 // The third entity type that is involved.
6988 optional string third_entity_type = 7;
6989
6990 // The score of the first entity type.
6991 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01006992
6993 // Name of source package.
6994 optional string package_name = 9;
Tony Make2b1b672019-07-29 16:59:47 +01006995}
6996
6997/**
6998 * Logs when there is a language detection related event.
6999 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7000 * Logged from: TextClassifierEventLogger.java
7001 */
7002message LanguageDetectionEvent {
7003 // A session ID.
7004 optional string session_id = 1;
7005
7006 // Event type of this event.
7007 optional android.stats.textclassifier.EventType event_type = 2;
7008
7009 // Name of the model that is involved in this event.
7010 optional string model_name = 3;
7011
7012 // Type of widget that was involved in triggering this event.
7013 optional android.stats.textclassifier.WidgetType widget_type = 4;
7014
7015 // Detected language.
7016 optional string language_tag = 5;
7017
7018 // Score of the detected language.
7019 optional float score = 6;
7020
7021 // Position of this action.
7022 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01007023
7024 // Name of source package.
7025 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01007026}
Tianjie Xu167c3db2019-07-22 14:25:14 -07007027
7028/**
7029 * Information about an OTA update attempt by update_engine.
7030 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7031 */
7032message UpdateEngineUpdateAttemptReported {
7033 // The number of attempts for the update engine to apply a given payload.
7034 optional int32 attempt_number = 1;
7035
7036 optional android.stats.otaupdate.PayloadType payload_type = 2;
7037
7038 // The total time in minutes for the update engine to apply a given payload.
7039 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
7040 // it's increased when the system is sleeping.
7041 optional int32 duration_boottime_in_minutes = 3;
7042
7043 // The total time in minutes for the update engine to apply a given payload.
7044 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
7045 // and it's not increased when the system is sleeping.
7046 optional int32 duration_monotonic_in_minutes = 4;
7047
7048 // The size of the payload in MiBs.
7049 optional int32 payload_size_mib = 5;
7050
7051 // The attempt result reported by the update engine for an OTA update.
7052 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
7053
7054 // The error code reported by the update engine after an OTA update attempt
7055 // on A/B devices.
7056 optional android.stats.otaupdate.ErrorCode error_code = 7;
7057
7058 // The build fingerprint of the source system. The value is read from a
7059 // system property when the device takes the update. e.g.
7060 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
7061 optional string source_fingerprint = 8;
7062}
7063
7064/**
7065 * Information about all the attempts the device make before finishing the
7066 * successful update.
7067 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7068 */
7069message UpdateEngineSuccessfulUpdateReported {
7070 // The number of attempts for the update engine to apply the payload for a
7071 // successful update.
7072 optional int32 attempt_count = 1;
7073
7074 optional android.stats.otaupdate.PayloadType payload_type = 2;
7075
7076 optional int32 payload_size_mib = 3;
7077
7078 // The total number of bytes downloaded by update_engine since the last
7079 // successful update.
7080 optional int32 total_bytes_downloaded_mib = 4;
7081
7082 // The ratio in percentage of the over-downloaded bytes compared to the
7083 // total bytes needed to successfully install the update. e.g. 200 if we
7084 // download 200MiB in total for a 100MiB package.
7085 optional int32 download_overhead_percentage = 5;
7086
7087 // The total time in minutes for the update engine to apply the payload for a
7088 // successful update.
7089 optional int32 total_duration_minutes = 6;
7090
7091 // The number of reboot of the device during a successful update.
7092 optional int32 reboot_count = 7;
7093}
Alec Mourie088e762019-07-02 13:10:55 -07007094
7095/**
7096 * Global display pipeline metrics reported by SurfaceFlinger.
7097 * Pulled from:
7098 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7099 */
7100message SurfaceflingerStatsGlobalInfo {
7101 // Total number of frames presented during the tracing period
7102 optional int64 total_frames = 1;
7103 // Total number of frames missed
7104 optional int64 missed_frames = 2;
7105 // Total number of frames that fell back to client composition
7106 optional int64 client_composition_frames = 3;
7107 // Total time the display was turned on
7108 optional int64 display_on_millis = 4;
7109 // Total time that was spent performing animations.
7110 // This is derived from the present-to-present layer histogram
7111 optional int64 animation_millis = 5;
7112}
7113
7114/**
7115 * Per-layer display pipeline metrics reported by SurfaceFlinger.
7116 * The number of layers uploaded will be restricted due to size limitations.
7117 * Pulled from:
7118 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7119 */
7120message SurfaceflingerStatsLayerInfo {
7121 // The layer for this set of metrics
7122 // For now we can infer that the package name is included in the layer
7123 // name.
7124 optional string layer_name = 1;
7125 // Total number of frames presented
7126 optional int64 total_frames = 2;
7127 // Total number of dropped frames while latching a buffer for this layer.
7128 optional int64 dropped_frames = 3;
7129 // Set of timings measured between successive presentation timestamps.
7130 optional FrameTimingHistogram present_to_present = 4
7131 [(android.os.statsd.log_mode) = MODE_BYTES];
7132 // Set of timings measured from when an app queued a buffer for
7133 // presentation, until the buffer was actually presented to the
7134 // display.
7135 optional FrameTimingHistogram post_to_present = 5
7136 [(android.os.statsd.log_mode) = MODE_BYTES];
7137 // Set of timings measured from when a buffer is ready to be presented,
7138 // until the buffer was actually presented to the display.
7139 optional FrameTimingHistogram acquire_to_present = 6
7140 [(android.os.statsd.log_mode) = MODE_BYTES];
7141 // Set of timings measured from when a buffer was latched by
7142 // SurfaceFlinger, until the buffer was presented to the display
7143 optional FrameTimingHistogram latch_to_present = 7
7144 [(android.os.statsd.log_mode) = MODE_BYTES];
7145 // Set of timings measured from the desired presentation to the actual
7146 // presentation time
7147 optional FrameTimingHistogram desired_to_present = 8
7148 [(android.os.statsd.log_mode) = MODE_BYTES];
7149 // Set of timings measured from when an app queued a buffer for
7150 // presentation, until the buffer was ready to be presented.
7151 optional FrameTimingHistogram post_to_acquire = 9
7152 [(android.os.statsd.log_mode) = MODE_BYTES];
7153}
7154
7155/**
7156 * Histogram of frame counts bucketed by time in milliseconds.
7157 * Because of size limitations, we hard-cap the number of buckets, with
7158 * buckets for corresponding to larger milliseconds being less precise.
7159 */
7160message FrameTimingHistogram {
7161 // Timings in milliseconds that describes a set of histogram buckets
7162 repeated int32 time_millis_buckets = 1;
7163 // Number of frames that match to each time_millis, i.e. the bucket
7164 // contents
7165 // It's required that len(time_millis) == len(frame_count)
7166 repeated int64 frame_counts = 2;
7167}
Emilian Peev6729f372019-08-29 09:14:09 -07007168
7169
7170/**
7171 * Information about camera facing and API level usage.
7172 * Logged from:
7173 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
7174 */
7175message CameraActionEvent {
7176 // Camera session duration
7177 optional int64 duration = 1;
7178
7179 // Camera API level used
7180 optional int32 api_level = 2;
7181
7182 // Name of client package
7183 optional string package_name = 3;
7184
7185 // Camera facing
7186 enum Facing {
7187 UNKNOWN = 0;
7188 BACK = 1;
7189 FRONT = 2;
7190 EXTERNAL = 3;
7191 }
7192 optional Facing facing = 4;
7193}