blob: d9083886f8177a6a6567096b972198b8383fd66f [file] [log] [blame]
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070018
19package android.os.statsd;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070020option java_package = "com.android.os";
Stefan Lafonae2df012017-11-14 09:17:21 -080021option java_outer_classname = "AtomsProto";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070022
Yao Chen9c1debe2018-02-19 14:39:19 -080023import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
Bookatzdb026a22018-01-10 19:01:56 -080024import "frameworks/base/core/proto/android/app/enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070025import "frameworks/base/core/proto/android/app/job/enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070026import "frameworks/base/core/proto/android/app/settings_enums.proto";
Jack Hec27040a2019-01-09 20:54:41 -080027import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080028import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack Heab86dbd22018-12-18 15:43:27 -080029import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080030import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Jack He1021a612019-01-20 21:22:46 -080031import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto";
Michael Groover9e7b06e2018-12-28 19:55:51 -080032import "frameworks/base/core/proto/android/debug/enums.proto";
Kevin Chyn1741a072019-01-17 11:54:40 -080033import "frameworks/base/core/proto/android/hardware/biometrics/enums.proto";
joshmccloskey8c3322e2019-01-09 18:25:57 -080034import "frameworks/base/core/proto/android/hardware/sensor/assist/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080035import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080036import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080037import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080038import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080039import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080040import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070041import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080042import "frameworks/base/core/proto/android/service/usb.proto";
Chiachang Wang0e88ebf2019-03-21 10:18:07 +080043import "frameworks/base/core/proto/android/stats/connectivity/network_stack.proto";
lifra2e19c02019-04-16 22:16:30 +080044import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.proto";
Bookatz11257ca2018-12-05 18:22:39 -080045import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
46import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070047import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
48import "frameworks/base/core/proto/android/stats/enums.proto";
49import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070050import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Hongyi Zhang700137e2019-05-23 21:19:36 -070051import "frameworks/base/core/proto/android/stats/location/location_enums.proto";
Ray Essick8ab04df2019-02-15 11:01:02 -080052import "frameworks/base/core/proto/android/stats/mediametrics/mediametrics.proto";
Tianjie Xuac6ffdb2019-07-22 14:25:14 -070053import "frameworks/base/core/proto/android/stats/otaupdate/updateengine_enums.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000054import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080055import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080056import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080057import "frameworks/base/core/proto/android/telephony/enums.proto";
58import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080059import "frameworks/base/core/proto/android/wifi/enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080060
Yao Chend54f9dd2017-10-17 17:37:48 +000061/**
Stefan Lafonae2df012017-11-14 09:17:21 -080062 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000063 * raw stats log events from the Android system, also known as "atoms."
64 *
65 * This field contains a single oneof with all of the available messages.
66 * The stats-log-api-gen tool runs as part of the Android build and
67 * generates the android.util.StatsLog class, which contains the constants
68 * and methods that Android uses to log.
69 *
Stefan Lafonae2df012017-11-14 09:17:21 -080070 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000071 * Instead, statsd on Android constructs these messages synthetically,
72 * in the format defined here and in stats_log.proto.
73 */
Stefan Lafonae2df012017-11-14 09:17:21 -080074message Atom {
75 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070076 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070077 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
78 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070079 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070080 BleScanResultReceived ble_scan_result_received = 4;
81 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080082 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070083 SyncStateChanged sync_state_changed = 7;
84 ScheduledJobStateChanged scheduled_job_state_changed = 8;
85 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070086 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080087 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
88 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
89 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070090 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
91 MemoryFactorStateChanged memory_factor_state_changed = 15;
92 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
93 CachedKillReported cached_kill_reported = 17;
94 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070095 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080096 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
97 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
98 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070099 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800100 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -0700101 CameraStateChanged camera_state_changed = 25;
102 FlashlightStateChanged flashlight_state_changed = 26;
103 UidProcessStateChanged uid_process_state_changed = 27;
104 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
105 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -0700106 BatteryLevelChanged battery_level_changed = 30;
107 ChargingStateChanged charging_state_changed = 31;
108 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -0700109 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800110 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -0700111 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
112 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -0700113 WifiLockStateChanged wifi_lock_state_changed = 37;
114 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
115 WifiScanStateChanged wifi_scan_state_changed = 39;
116 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700117 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700118 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700119 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900120 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700121 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800122 AnomalyDetected anomaly_detected = 46;
Andrei Oneada01ea52019-01-30 15:28:36 +0000123 AppBreadcrumbReported app_breadcrumb_reported = 47 [(allow_from_any_uid) = true];
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800124 AppStartOccurred app_start_occurred = 48;
125 AppStartCanceled app_start_canceled = 49;
126 AppStartFullyDrawn app_start_fully_drawn = 50;
Muhammad Qureshif3440092019-12-20 06:55:57 -0800127 LmkKillOccurred lmk_kill_occurred = 51 [(log_from_module) = "lmkd"];
Chenjie Yu52cacc62017-12-08 18:11:45 -0800128 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800129 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Muhammad Qureshif3440092019-12-20 06:55:57 -0800130 LmkStateChanged lmk_state_changed = 54 [(log_from_module) = "lmkd"];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800131 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800132 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800133 BootSequenceReported boot_sequence_reported = 57;
Andrei Oneada01ea52019-01-30 15:28:36 +0000134 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -0800135 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800136 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800137 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800138 KeyguardStateChanged keyguard_state_changed = 62;
139 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
140 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800141 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800142 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800143 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
144 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800145 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700146 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800147 SpeakerImpedanceReported speaker_impedance_reported = 71;
148 HardwareFailed hardware_failed = 72;
149 PhysicalDropDetected physical_drop_detected = 73;
150 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800151 MobileConnectionStateChanged mobile_connection_state_changed = 75;
152 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700153 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800154 AppCrashOccurred app_crash_occurred = 78;
155 ANROccurred anr_occurred = 79;
156 WTFOccurred wtf_occurred = 80;
157 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700158 GenericAtom generic_atom = 82;
jianjin6eada302019-02-28 11:25:57 -0800159 KeyValuePairsAtom key_value_pairs_atom = 83 [(allow_from_any_uid) = true];
Bookatza7020bd2018-08-28 16:29:35 -0700160 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700161 DeferredJobStatsReported deferred_job_stats_reported = 85;
Tej Singha72344992019-04-17 18:55:08 -0700162 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Kevin Chyn1741a072019-01-17 11:54:40 -0800163 BiometricAcquired biometric_acquired = 87;
164 BiometricAuthenticated biometric_authenticated = 88;
165 BiometricErrorOccurred biometric_error_occurred = 89;
Howard Ro0db82032019-04-07 18:43:34 -0700166 // Atom number 90 is available for use.
Howard Roa46b6582018-09-18 16:45:02 -0700167 BatteryHealthSnapshot battery_health_snapshot = 91;
168 SlowIo slow_io = 92;
169 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700170 PhoneServiceStateChanged phone_service_state_changed = 94;
171 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100172 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700173 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700174 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700175 // TODO: service state change is very noisy shortly after boot, as well
176 // as at other transitions - coming out of doze, device plugged in, etc.
177 // Consider removing this if it becomes a problem
178 ServiceStateChanged service_state_changed = 99;
179 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800180 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800181 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000182 DevicePolicyEvent device_policy_event = 103;
shawnlin9a1392a2019-04-09 16:21:17 +0800183 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled =
184 104 [(log_from_module) = "docsui"];
185 DocsUIFileOperationCopyMoveModeReported
186 docs_ui_file_op_copy_move_mode_reported =
187 105 [(log_from_module) = "docsui"];
188 DocsUIFileOperationFailureReported docs_ui_file_op_failure =
189 106 [(log_from_module) = "docsui"];
190 DocsUIFileOperationReported docs_ui_provider_file_op =
191 107 [(log_from_module) = "docsui"];
192 DocsUIInvalidScopedAccessRequestReported
193 docs_ui_invalid_scoped_access_request =
194 108 [(log_from_module) = "docsui"];
195 DocsUILaunchReported docs_ui_launch_reported =
196 109 [(log_from_module) = "docsui"];
197 DocsUIRootVisitedReported docs_ui_root_visited =
198 110 [(log_from_module) = "docsui"];
199 DocsUIStartupMsReported docs_ui_startup_ms =
200 111 [(log_from_module) = "docsui"];
201 DocsUIUserActionReported docs_ui_user_action_reported =
202 112 [(log_from_module) = "docsui"];
Bookatzda1798c2018-12-13 14:16:00 -0800203 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
204 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f2018-12-06 11:01:38 +0000205 AppCompacted app_compacted = 115;
lifre82d8f62019-03-25 20:33:21 +0800206 NetworkDnsEventReported network_dns_event_reported = 116 [(log_from_module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800207 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
208 117 [(log_from_module) = "docsui"];
209 DocsUIPickResultReported docs_ui_pick_result_reported =
210 118 [(log_from_module) = "docsui"];
211 DocsUISearchModeReported docs_ui_search_mode_reported =
212 119 [(log_from_module) = "docsui"];
213 DocsUISearchTypeReported docs_ui_search_type_reported =
214 120 [(log_from_module) = "docsui"];
Chiachang Wange512b262019-04-11 21:24:28 +0800215 DataStallEvent data_stall_event = 121 [(log_from_module) = "network_stack"];
Christian Brunschenf86039e2018-12-21 12:26:14 +0000216 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000217 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800218 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800219 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800220 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
221 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000222 AppDowngraded app_downgraded = 128;
223 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
224 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800225 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
226 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800227 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800228 NfcErrorOccurred nfc_error_occurred = 134;
229 NfcStateChanged nfc_state_changed = 135;
230 NfcBeamOccurred nfc_beam_occurred = 136;
231 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
232 NfcTagOccurred nfc_tag_occurred = 138;
233 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
234 SeStateChanged se_state_changed = 140;
235 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800236 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800237 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800238 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800239 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800240 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800241 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyne5a37fb2019-02-08 13:10:36 -0800242 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500243 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800244 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Jack Hec27040a2019-01-09 20:54:41 -0800245 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
246 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
247 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
248 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
249 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
250 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
251 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
252 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
253 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He1021a612019-01-20 21:22:46 -0800254 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
255 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
Jack Heaea26982019-04-04 11:19:48 -0700256 BluetoothDeviceInfoReported bluetooth_device_info_reported = 162;
Jack He1021a612019-01-20 21:22:46 -0800257 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
258 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
259 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
260 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
261 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Alex Salod7c3eef2019-01-25 14:43:27 -0800262 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800263 ProcessStartTime process_start_time = 169;
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700264 PermissionGrantRequestResultReported permission_grant_request_result_reported =
265 170 [(log_from_module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800266 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Michael Groover4a0ca942019-01-24 17:41:25 -0800267 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Steven Wu552f63f2019-02-05 13:41:36 -0500268 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
joshmccloskey8c3322e2019-01-09 18:25:57 -0800269 AssistGestureStageReported assist_gesture_stage_reported = 174;
270 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
271 AssistGestureProgressReported assist_gesture_progress_reported = 176;
Philip Quinn0eded622019-01-29 12:46:28 -0800272 TouchGestureClassified touch_gesture_classified = 177;
Andrei Onea4ad6d0c2019-02-08 13:54:12 +0000273 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true];
Kunhung Li286c52f2019-05-21 20:10:43 +0800274 StyleUIChanged style_ui_changed = 179 [(log_from_module) = "style"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700275 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Tej Singha72344992019-04-17 18:55:08 -0700276 180 [(log_from_module) = "permissioncontroller"];
Carmen Agimof6688a352019-01-30 19:36:04 +0000277 AppInstallOnExternalStorageReported app_install_on_external_storage_reported = 181;
Chiachang Wange512b262019-04-11 21:24:28 +0800278 NetworkStackReported network_stack_reported = 182 [(log_from_module) = "network_stack"];
Carmen Agimof6dcc5032019-03-01 16:20:09 +0000279 AppMovedStorageReported app_moved_storage_reported = 183;
joshmccloskey6f952b22019-03-25 20:59:35 -0700280 BiometricEnrolled biometric_enrolled = 184;
jianjin8f2dee02019-03-29 14:03:08 -0700281 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185;
282 TombStoneOccurred tomb_stone_occurred = 186;
Jack He71426802019-04-02 13:32:52 -0700283 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported = 187;
Ben Blount763a5d52019-04-10 11:48:58 -0700284 IntelligenceEventReported intelligence_event_reported =
285 188 [(log_from_module) = "intelligence"];
Tej Singha72344992019-04-17 18:55:08 -0700286 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed = 189;
Hai Zhang5d3328d2019-04-13 21:25:06 +0800287 RoleRequestResultReported role_request_result_reported =
288 190 [(log_from_module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800289 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
290 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
291 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
292 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
293 MediametricsCodecReported mediametrics_codec_reported = 195;
294 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
295 MediametricsExtractorReported mediametrics_extractor_reported = 197;
296 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
297 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
298 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Yuncheol Heod1a85d22019-05-08 17:13:42 -0700299 CarPowerStateChanged car_power_state_changed = 203;
300 GarageModeInfo garage_mode_info = 204;
Tej Singhc9203082019-05-03 13:42:23 -0700301 TestAtomReported test_atom_reported = 205 [(log_from_module) = "cts"];
Adam Heff2185342019-01-23 15:59:09 -0800302 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported = 206;
303 ContentCaptureServiceEvents content_capture_service_events = 207;
304 ContentCaptureSessionEvents content_capture_session_events = 208;
305 ContentCaptureFlushed content_capture_flushed = 209;
Hongyi Zhang700137e2019-05-23 21:19:36 -0700306 LocationManagerApiUsageReported location_manager_api_usage_reported = 210;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100307 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
308 211 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100309 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
310 212 [(log_from_module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100311 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
312 213 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100313 LocationAccessCheckNotificationAction location_access_check_notification_action =
314 214 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100315 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
316 215 [(log_from_module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100317 AppPermissionFragmentViewed app_permission_fragment_viewed =
318 216 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100319 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
320 217 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100321 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
322 218 [(log_from_module) = "permissioncontroller"];
Hyunyoung Songf1b935e2019-07-09 09:19:25 -0700323 ExclusionRectStateChanged exclusion_rect_state_changed = 223;
324 BackGesture back_gesture_reported_reported = 224;
atrost1516d522019-08-28 15:40:37 +0100325
Tianjie Xuac6ffdb2019-07-22 14:25:14 -0700326 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
327 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
atrost1516d522019-08-28 15:40:37 +0100328 AppCompatibilityChangeReported app_compatibility_change_reported =
329 228 [(allow_from_any_uid) = true];
Hector Dearman25af7732019-11-19 16:28:59 +0000330 PerfettoUploaded perfetto_uploaded =
331 229 [(log_from_module) = "perfetto"];
Yao Chend54f9dd2017-10-17 17:37:48 +0000332 }
David Chenc8a43242017-10-17 16:23:28 -0700333
David Chen6e3e6cb2018-01-03 16:14:06 -0800334 // Pulled events will start at field 10000.
Rafal Slawik6d44d6d2019-06-17 12:28:23 +0100335 // Next: 10062
David Chenc8a43242017-10-17 16:23:28 -0700336 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800337 WifiBytesTransfer wifi_bytes_transfer = 10000;
338 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
339 MobileBytesTransfer mobile_bytes_transfer = 10002;
340 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800341 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800342 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800343 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800344 CpuTimePerFreq cpu_time_per_freq = 10008;
345 CpuTimePerUid cpu_time_per_uid = 10009;
346 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800347 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800348 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800349 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800350 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800351 SystemElapsedRealtime system_elapsed_realtime = 10014;
352 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800353 CpuActiveTime cpu_active_time = 10016;
354 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000355 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800356 RemainingBatteryCapacity remaining_battery_capacity = 10019;
357 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800358 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100359 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100360 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100361 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000362 DiskStats disk_stats = 10025;
363 DirectoryUsage directory_usage = 10026;
364 AppSize app_size = 10027;
365 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700366 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700367 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800368 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700369 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700370 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800371 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700372 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100373 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100374 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700375 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee60422018-11-09 12:27:37 -0800376 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
377 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
378 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000379 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800380 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800381 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800382 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000383 DebugElapsedClock debug_elapsed_clock = 10046;
384 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800385 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800386 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800387 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800388 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000389 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000390 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800391 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
392 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000393 SystemIonHeapSize system_ion_heap_size = 10056;
Carmen Agimofa769c152019-03-04 14:39:14 +0000394 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700395 FaceSettings face_settings = 10058;
Maggie White442b6312019-04-05 16:26:44 -0700396 CoolingDevice cooling_device = 10059;
Martijn Coenencd95d462019-04-25 17:09:45 +0200397 AppOps app_ops = 10060;
Rafal Slawik6d44d6d2019-06-17 12:28:23 +0100398 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061;
David Chenc8a43242017-10-17 16:23:28 -0700399 }
yroa1fe77c2018-02-26 14:22:54 -0800400
Bookatz76aafcf2018-09-17 16:17:10 -0700401 // DO NOT USE field numbers above 100,000 in AOSP.
402 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
403 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700404}
405
Yao Chend54f9dd2017-10-17 17:37:48 +0000406/**
Yangster-mac20877162017-12-22 17:19:39 -0800407 * This proto represents a node of an attribution chain.
408 * Note: All attribution chains are represented as a repeated field of type
409 * AttributionNode. It is understood that in such arrays, the order is that
410 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000411 */
Yangster-mac20877162017-12-22 17:19:39 -0800412message AttributionNode {
413 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800414 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800415
Yangster-mac20877162017-12-22 17:19:39 -0800416 // The (optional) string tag for an element in the attribution chain. If the
417 // element has no tag, it is encoded as an empty string.
418 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700419}
420
Yangster-mac48b3d622018-08-18 12:38:11 -0700421message KeyValuePair {
422 optional int32 key = 1;
423 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700424 int32 value_int = 2;
425 int64 value_long = 3;
426 string value_str = 4;
427 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700428 }
429}
430
431message KeyValuePairsAtom {
432 optional int32 uid = 1;
433 repeated KeyValuePair pairs = 2;
434}
435
Yao Chend54f9dd2017-10-17 17:37:48 +0000436/*
437 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800438 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000439 *
440 * RULES:
441 * - The field ids for each atom must start at 1, and count upwards by 1.
442 * Skipping field ids is not allowed.
443 * - These form an API, so renaming, renumbering or removing fields is
444 * not allowed between android releases. (This is not currently enforced,
445 * but there will be a tool to enforce this restriction).
446 * - The types must be built-in protocol buffer types, namely, no sub-messages
447 * are allowed (yet). The bytes type is also not allowed.
448 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800449 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000450 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800451 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000452 * - A field that is a uid should be a string field, tagged with the [xxx]
453 * annotation. The generated code on android will be represented by UIDs,
454 * and those UIDs will be translated in xxx to those strings.
455 *
456 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700457 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000458 * - If there is a UID, it goes first. Think in an object-oriented fashion.
459 * *****************************************************************************
460 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700461
Yao Chend54f9dd2017-10-17 17:37:48 +0000462/**
Tej Singha72344992019-04-17 18:55:08 -0700463 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700464 * Logs when the Thermal service HAL notifies the throttling start/stop events.
465 *
466 * Logged from:
467 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
468 */
469message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700470 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700471 optional android.os.TemperatureTypeEnum sensor_type = 1;
472
Maggie White442b6312019-04-05 16:26:44 -0700473 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700474 enum State {
475 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700476 START = 1; // START indicated that throttling was triggered.
477 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700478 }
Yangster-mace16189a2018-08-26 12:20:16 -0700479 optional State state = 2;
480
481 optional float temperature = 3;
482}
483
484/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000485 * Logs when the screen state changes.
486 *
487 * Logged from:
488 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
489 */
490message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800491 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700492 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700493}
Yao Chend54f9dd2017-10-17 17:37:48 +0000494
495/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700496 * Logs that the process state of the uid, as determined by ActivityManager
497 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000498 *
499 * Logged from:
500 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
501 */
Bookatzc1a050a2017-10-10 15:49:28 -0700502message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700503 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000504
Bookatzdb026a22018-01-10 19:01:56 -0800505 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700506 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000507}
508
509/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700510 * Logs process state change of a process, as per the activity manager.
511 *
512 * Logged from:
513 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
514 */
515message ProcessStateChanged {
516 optional int32 uid = 1;
517 optional string process_name = 2;
518 optional string package_name = 3;
519 // TODO: remove this when validation is done
520 optional int64 version = 5;
521 // The state, from frameworks/base/core/proto/android/app/enums.proto.
522 optional android.app.ProcessStateEnum state = 4;
523}
524
525/**
526 * Logs when ActivityManagerService sleep state is changed.
527 *
528 * Logged from:
529 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
530 */
531message ActivityManagerSleepStateChanged {
532 // TODO: import frameworks proto
533 enum State {
534 UNKNOWN = 0;
535 ASLEEP = 1;
536 AWAKE = 2;
537 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700538 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700539}
540
541/**
542 * Logs when system memory state changes.
543 *
544 * Logged from:
545 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
546 */
547message MemoryFactorStateChanged {
548 // TODO: import frameworks proto
549 enum State {
550 MEMORY_UNKNOWN = 0;
551 NORMAL = 1; // normal.
552 MODERATE = 2; // moderate memory pressure.
553 LOW = 3; // low memory.
554 CRITICAL = 4; // critical memory.
555
556 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700557 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700558}
559
560/**
561 * Logs when app is using too much cpu, according to ActivityManagerService.
562 *
563 * Logged from:
564 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
565 */
566message ExcessiveCpuUsageReported {
567 optional int32 uid = 1;
568 optional string process_name = 2;
569 optional string package_name = 3;
570 // package version. TODO: remove this when validation is done
571 optional int64 version = 4;
572}
573
574/**
575 * Logs when a cached process is killed, along with its pss.
576 *
577 * Logged from:
578 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
579 */
580message CachedKillReported {
581 optional int32 uid = 1;
582 optional string process_name = 2;
583 optional string package_name = 3;
584 // TODO: remove this when validation is done
585 optional int64 version = 5;
586 optional int64 pss = 4;
587}
588
589/**
590 * Logs when memory stats of a process is reported.
591 *
592 * Logged from:
593 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
594 */
595message ProcessMemoryStatReported {
596 optional int32 uid = 1;
597 optional string process_name = 2;
598 optional string package_name = 3;
599 //TODO: remove this when validation is done
600 optional int64 version = 9;
601 optional int64 pss = 4;
602 optional int64 uss = 5;
603 optional int64 rss = 6;
604 enum Type {
605 ADD_PSS_INTERNAL_SINGLE = 0;
606 ADD_PSS_INTERNAL_ALL_MEM = 1;
607 ADD_PSS_INTERNAL_ALL_POLL = 2;
608 ADD_PSS_EXTERNAL = 3;
609 ADD_PSS_EXTERNAL_SLOW = 4;
610 }
611 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800612 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700613}
614
615/**
Bookatzc1a050a2017-10-10 15:49:28 -0700616 * Logs that a process started, finished, crashed, or ANRed.
617 *
618 * Logged from:
619 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
620 */
621message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700622 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700623
David Chen0b5c90c2018-01-25 16:51:49 -0800624 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800625 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700626
Bookatzddccf0a2017-11-28 16:48:14 -0800627 // What lifecycle state the process changed to.
628 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800629 enum State {
630 FINISHED = 0;
631 STARTED = 1;
632 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800633 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800634 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700635}
636
Bookatzc1a050a2017-10-10 15:49:28 -0700637/**
638 * Logs when the ble scan state changes.
639 *
640 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700641 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700642 */
643message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800644 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700645
646 enum State {
647 OFF = 0;
648 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700649 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
650 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700651 }
652 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700653
Bookatze5ec0b42018-03-26 13:34:56 -0700654 // Does the scan have a filter.
655 optional bool is_filtered = 3;
656 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
657 optional bool is_first_match = 4;
658 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
659 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700660}
661
662/**
663 * Logs reporting of a ble scan finding results.
664 *
665 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700666 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700667 */
Bookatzae6738e2018-09-13 11:38:56 -0700668// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700669message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800670 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700671
672 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800673 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700674}
675
676/**
677 * Logs when a sensor state changes.
678 *
679 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700680 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700681 */
682message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800683 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700684
Bookatzc1a050a2017-10-10 15:49:28 -0700685 // The id (int) of the sensor.
686 optional int32 sensor_id = 2;
687
688 enum State {
689 OFF = 0;
690 ON = 1;
691 }
692 optional State state = 3;
693}
694
Bookatzc1a050a2017-10-10 15:49:28 -0700695/**
696 * Logs when GPS state changes.
697 *
698 * Logged from:
699 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
700 */
701message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800702 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700703
704 enum State {
705 OFF = 0;
706 ON = 1;
707 }
708 optional State state = 2;
709}
710
Bookatz48d362e2018-11-06 15:49:08 -0800711/**
712 * Logs when GPS signal quality.
713 *
714 * Logged from:
715 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
716 */
717message GpsSignalQualityChanged {
718 optional android.server.location.GpsSignalQualityEnum level = 1;
719}
720
Bookatzc1a050a2017-10-10 15:49:28 -0700721
722/**
723 * Logs when a sync manager sync state changes.
724 *
725 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700726 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700727 */
728message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800729 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700730
David Chen0b5c90c2018-01-25 16:51:49 -0800731 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800732 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700733
734 enum State {
735 OFF = 0;
736 ON = 1;
737 }
738 optional State state = 3;
739}
740
Yangster-mac96353002018-09-05 11:18:55 -0700741/*
742 * Deferred job stats.
743 *
744 * Logged from:
745 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
746*/
747message DeferredJobStatsReported {
748 repeated AttributionNode attribution_node = 1;
749
750 // Number of jobs deferred.
751 optional int32 num_jobs_deferred = 2;
752
753 // Time since the last job runs.
754 optional int64 time_since_last_job_millis = 3;
755}
756
Bookatzc1a050a2017-10-10 15:49:28 -0700757/**
758 * Logs when a job scheduler job state changes.
759 *
760 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700761 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700762 */
763message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800764 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700765
766 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800767 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700768
769 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800770 FINISHED = 0;
771 STARTED = 1;
772 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700773 }
774 optional State state = 3;
775
Tej Singh33a412b2018-03-16 18:43:59 -0700776 // The reason a job has stopped.
777 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700778 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700779 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100780
781 // The standby bucket of the app that scheduled the job. These match the framework constants
782 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
783 // already assigned 0.
784 enum Bucket {
785 UNKNOWN = -1;
786 ACTIVE = 0;
787 WORKING_SET = 1;
788 FREQUENT = 2;
789 RARE = 3;
790 NEVER = 4;
791 }
792 optional Bucket standby_bucket = 5 [default = UNKNOWN];
793
794 // The job id (as assigned by the app).
795 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700796}
797
798/**
799 * Logs when the audio state changes.
800 *
801 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700802 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700803 */
804message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800805 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700806
807 enum State {
808 OFF = 0;
809 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700810 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
811 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700812 }
813 optional State state = 2;
814}
815
816/**
817 * Logs when the video codec state changes.
818 *
819 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700820 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700821 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800822message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800823 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700824
825 enum State {
826 OFF = 0;
827 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700828 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
829 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700830 }
831 optional State state = 2;
832}
833
834/**
835 * Logs when the flashlight state changes.
836 *
837 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700838 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700839 */
840message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800841 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700842
843 enum State {
844 OFF = 0;
845 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700846 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
847 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700848 }
849 optional State state = 2;
850}
851
852/**
853 * Logs when the camera state changes.
854 *
855 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700856 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700857 */
858message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800859 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700860
861 enum State {
862 OFF = 0;
863 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700864 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
865 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700866 }
867 optional State state = 2;
868}
869
870/**
871 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000872 *
873 * Logged from:
874 * TODO
875 */
Bookatzd6746242017-10-24 18:39:35 -0700876message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800877 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000878
Bookatz1a1b0462018-01-12 11:47:03 -0800879 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
880 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700881 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700882
883 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
884 optional string tag = 3;
885
886 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800887 RELEASE = 0;
888 ACQUIRE = 1;
889 CHANGE_RELEASE = 2;
890 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700891 }
892 optional State state = 4;
893}
894
895/**
Bookatzc1a050a2017-10-10 15:49:28 -0700896 * Logs when a partial wakelock is considered 'long' (over 1 min).
897 *
898 * Logged from:
899 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
900 */
901message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800902 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700903
Yao Chend54f9dd2017-10-17 17:37:48 +0000904 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
905 optional string tag = 2;
906
Bookatzc1a050a2017-10-10 15:49:28 -0700907 // TODO: I have no idea what this is.
908 optional string history_tag = 3;
909
910 enum State {
911 OFF = 0;
912 ON = 1;
913 }
914 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000915}
916
Bookatzc1a050a2017-10-10 15:49:28 -0700917/**
Bookatza66083f2018-09-20 17:24:00 -0700918 * Logs when the device is interactive, according to the PowerManager Notifier.
919 *
920 * Logged from:
921 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
922 */
923message InteractiveStateChanged {
924 enum State {
925 OFF = 0;
926 ON = 1;
927 }
928 optional State state = 1;
929}
930
931/**
Bookatzc1a050a2017-10-10 15:49:28 -0700932 * Logs Battery Saver state change.
933 *
934 * Logged from:
935 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
936 */
937message BatterySaverModeStateChanged {
938 enum State {
939 OFF = 0;
940 ON = 1;
941 }
942 optional State state = 1;
943}
944
945/**
946 * Logs Doze mode state change.
947 *
948 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800949 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700950 */
951message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800952 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800953}
954
955
956/**
957 * Logs state change of Doze mode including maintenance windows.
958 *
959 * Logged from:
960 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
961 */
962message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800963 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700964}
965
966/**
967 * Logs screen brightness level.
968 *
969 * Logged from:
970 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
971 */
972message ScreenBrightnessChanged {
973 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
974 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700975}
976
977/**
978 * Logs battery level (percent full, from 0 to 100).
979 *
980 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700981 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700982 */
983message BatteryLevelChanged {
984 // Battery level. Should be in [0, 100].
985 optional int32 battery_level = 1;
986}
987
988/**
989 * Logs change in charging status of the device.
990 *
991 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700992 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700993 */
994message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800995 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
996 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700997}
998
999/**
1000 * Logs whether the device is plugged in, and what power source it is using.
1001 *
1002 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001003 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001004 */
1005message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001006 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1007 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001008}
1009
Bookatz8c6571b2017-10-24 15:04:41 -07001010/**
1011 * Logs when an app's wakeup alarm fires.
1012 *
1013 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001014 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001015 */
1016message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001017 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001018
1019 // Name of the wakeup alarm.
1020 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001021
1022 // Name of source package (for historical reasons, since BatteryStats tracked it).
1023 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001024
1025 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1026 enum Bucket {
1027 UNKNOWN = 0;
1028 EXEMPTED = 5;
1029 ACTIVE = 10;
1030 WORKING_SET = 20;
1031 FREQUENT = 30;
1032 RARE = 40;
1033 NEVER = 50;
1034 }
1035 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1036 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001037}
1038
1039/**
1040 * Logs when an an app causes the mobile radio to change state.
1041 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1042 *
1043 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001044 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001045 */
1046message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001047 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001048
Bookatz1a1b0462018-01-12 11:47:03 -08001049 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1050 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001051}
1052
1053/**
1054 * Logs when an an app causes the wifi radio to change state.
1055 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1056 *
1057 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001058 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001059 */
1060message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001061 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001062
Bookatz1a1b0462018-01-12 11:47:03 -08001063 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1064 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001065}
1066
1067/**
1068 * Logs kernel wakeup reasons and aborts.
1069 *
1070 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001071 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001072 */
1073message KernelWakeupReported {
1074 // Name of the kernel wakeup reason (or abort).
1075 optional string wakeup_reason_name = 1;
1076
1077 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001078 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001079}
1080
1081/**
Bookatzda1798c2018-12-13 14:16:00 -08001082 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001083 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001084 *
1085 * Logged from:
1086 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1087 */
1088message WifiEnabledStateChanged {
1089 enum State {
1090 OFF = 0;
1091 ON = 1;
1092 }
1093 optional State state = 1;
1094}
1095
1096/**
1097 * 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 -08001098 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1099 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001100 *
1101 * Logged from:
1102 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1103 */
1104message WifiRunningStateChanged {
1105 repeated AttributionNode attribution_node = 1;
1106
1107 enum State {
1108 OFF = 0;
1109 ON = 1;
1110 }
1111 optional State state = 2;
1112}
1113
1114/**
Bookatze5885242017-10-24 20:10:31 -07001115 * Logs wifi locks held by an app.
1116 *
1117 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001118 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001119 */
1120message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001121 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001122
1123 enum State {
1124 OFF = 0;
1125 ON = 1;
1126 }
1127 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001128
1129 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1130 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001131}
1132
1133/**
1134 * Logs wifi signal strength changes.
1135 *
1136 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001137 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001138 */
1139message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001140 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1141 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001142}
1143
1144/**
1145 * Logs wifi scans performed by an app.
1146 *
1147 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001148 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001149 */
1150message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001151 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001152
1153 enum State {
1154 OFF = 0;
1155 ON = 1;
1156 }
1157 optional State state = 2;
1158}
1159
1160/**
Tej Singh4503e102018-01-04 14:35:01 -08001161 * Logs wifi multicast locks held by an app
1162 *
1163 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001164 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001165 */
1166message WifiMulticastLockStateChanged {
1167 repeated AttributionNode attribution_node = 1;
1168
1169 enum State {
1170 OFF = 0;
1171 ON = 1;
1172 }
1173 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001174
1175 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001176}
1177
1178/**
Tej Singh1ea42892018-01-19 09:27:00 -08001179 * Logs shutdown reason and duration on next boot.
1180 *
1181 * Logged from:
1182 * frameworks/base/core/java/com/android/server/BootReceiver.java
1183 */
1184message ShutdownSequenceReported {
1185 // True if shutdown is for a reboot. Default: false if we do not know.
1186 optional bool reboot = 1;
1187
1188 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1189 optional string reason = 2;
1190
1191 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1192 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001193 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001194
1195 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001196 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001197}
1198
Tej Singh6483ea42018-01-25 17:45:49 -08001199
1200/**
1201 * Logs boot reason and duration.
1202 *
1203 * Logged from:
1204 * system/core/bootstat/bootstat.cpp
1205 */
1206message BootSequenceReported {
1207 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1208 // Default: "<EMPTY>" if not available.
1209 optional string bootloader_reason = 1;
1210
1211 // Reason for system boot. Eg. bootloader, reboot,userrequested
1212 // Default: "<EMPTY>" if not available.
1213 optional string system_reason = 2;
1214
1215 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001216 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001217
1218 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001219 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001220
1221 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001222 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001223
1224 // Time since last boot in ms. Default: 0 if not available.
1225 optional int64 time_since_last_boot = 6;
1226}
1227
Tej Singhc477d9c2018-02-05 18:31:39 -08001228
1229/**
1230 * Logs call state and disconnect cause (if applicable).
1231 *
1232 * Logged from:
1233 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1234 */
1235message CallStateChanged {
1236 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1237 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1238 optional android.telecom.CallStateEnum call_state = 1;
1239
1240 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1241 // This value is only applicable when the call_state is DISCONNECTED, and
1242 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1243 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1244 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1245
1246 // True if the call is self-managed, which are apps that use the
1247 // telecom infrastructure to make their own calls.
1248 optional bool self_managed = 3;
1249
1250 // True if call is external. External calls are calls on connected Wear
1251 // devices but show up in Telecom so the user can pull them onto the device.
1252 optional bool external_call = 4;
1253}
1254
Tej Singh1ea42892018-01-19 09:27:00 -08001255/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001256 * Logs keyguard state. The keyguard is the lock screen.
1257 *
1258 * Logged from:
1259 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1260 */
1261message KeyguardStateChanged {
1262 enum State {
1263 UNKNOWN = 0;
1264 // The keyguard is hidden when the phone is unlocked.
1265 HIDDEN = 1;
1266 // The keyguard is shown when the phone is locked (screen turns off).
1267 SHOWN= 2;
1268 // The keyguard is occluded when something is overlaying the keyguard.
1269 // Eg. Opening the camera while on the lock screen.
1270 OCCLUDED = 3;
1271 }
1272 optional State state = 1;
1273}
1274
1275/**
1276 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1277 * prompts the user to enter a password (pattern, pin, etc).
1278 *
1279 * Logged from:
1280 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1281 */
1282
1283message KeyguardBouncerStateChanged {
1284 enum State {
1285 UNKNOWN = 0;
1286 // Bouncer is hidden, either as a result of successfully entering the
1287 // password, screen timing out, or user going back to lock screen.
1288 HIDDEN = 1;
1289 // This is when the user is being prompted to enter the password.
1290 SHOWN = 2;
1291 }
1292 optional State state = 1;
1293}
1294
1295/**
1296 * Logs the result of entering a password into the keyguard bouncer.
1297 *
1298 * Logged from:
1299 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1300 */
1301message KeyguardBouncerPasswordEntered {
1302 enum BouncerResult {
1303 UNKNOWN = 0;
1304 // The password entered was incorrect.
1305 FAILURE = 1;
1306 // The password entered was correct.
1307 SUCCESS = 2;
1308 }
1309 optional BouncerResult result = 1;
1310}
1311
Tej Singha883b372018-02-15 11:30:01 -08001312/*
1313 * Logs changes to the configuration of the device. The configuration is defined
1314 * in frameworks/base/core/java/android/content/res/Configuration.java
1315 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1316 * Please go there to interpret the possible values each field can be.
1317 *
1318 * Logged from:
1319 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1320 */
1321message ResourceConfigurationChanged {
1322 // Bit mask of color capabilities of the screen.
1323 // Contains information about the color gamut and hdr mode of the screen.
1324 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001325 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001326
1327 // The target screen density being rendered to.
1328 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001329 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001330
1331 // Current user preference for the scaling factor for fonts,
1332 // relative to the base density scaling.
1333 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001334 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001335
1336 // Flag indicating whether the hard keyboard is hidden.
1337 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001338 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001339
1340 // The type of keyboard attached to the device.
1341 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1342 optional int32 keyboard = 5;
1343
1344 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1345 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001346 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001347
1348 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1349 // 0 if undefined.
1350 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1351 optional int32 mcc = 7;
1352
1353 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1354 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1355 // MNC_ZERO symbol defined in Configuration.java.
1356 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1357 optional int32 mnc = 8;
1358
1359 // The kind of navigation available on the device.
1360 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1361 optional int32 navigation = 9;
1362
1363 // Flag indicating whether the navigation is available.
1364 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001365 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001366
1367 // Overall orientation of the screen.
1368 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1369 optional int32 orientation = 11;
1370
1371 // The current height of the available screen space, in dp units.
1372 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001373 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001374
1375 // Bit mask of overall layout of the screen.
1376 // Contains information about screen size, whether the screen is wider/taller
1377 // than normal, whether the screen layout is right-tl-left or left-to-right,
1378 // and whether the screen has a rounded shape.
1379 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001380 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001381
1382 // Current width of the available screen space, in dp units.
1383 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001384 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001385
1386 // The smallest screen size an application will see in normal operation.
1387 // This is the smallest value of both screenWidthDp and screenHeightDp
1388 // in portrait and landscape.
1389 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001390 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001391
1392 // The type of touch screen attached to the device.
1393 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1394 optional int32 touchscreen = 16;
1395
1396 // Bit mask of the ui mode.
1397 // Contains information about the overall ui mode of the device.
1398 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1399 // Also contains information about whether the device is in night mode.
1400 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001401 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001402}
1403
Tej Singheee317b2018-03-07 19:28:05 -08001404
1405/**
1406 * Logs changes in the connection state of the mobile radio.
1407 *
1408 * Logged from:
1409 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1410 */
1411message MobileConnectionStateChanged {
1412 // States are from the state machine DataConnection.java.
1413 enum State {
1414 UNKNOWN = 0;
1415 // The connection is inactive, or disconnected.
1416 INACTIVE = 1;
1417 // The connection is being activated, or connecting.
1418 ACTIVATING = 2;
1419 // The connection is active, or connected.
1420 ACTIVE = 3;
1421 // The connection is disconnecting.
1422 DISCONNECTING = 4;
1423 // The connection is disconnecting after creating a connection.
1424 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1425 }
1426 optional State state = 1;
1427 // For multi-sim phones, this distinguishes between the sim cards.
1428 optional int32 sim_slot_index = 2;
1429 // Used to identify the connection. Starts at 0 and increments by 1 for
1430 // every new network created. Resets whenever the device reboots.
1431 optional int32 data_connection_id = 3;
1432 // A bitmask for the capabilities of this connection.
1433 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1434 // Default value (if we have no information): 0
1435 optional int64 capabilities = 4;
1436 // If this connection has internet.
1437 // This just checks if the DEFAULT bit of capabilities is set.
1438 optional bool has_internet = 5;
1439}
1440
1441/**
1442 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1443 *
1444 * Logged from:
1445 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1446 */
1447message MobileRadioTechnologyChanged {
1448 optional android.telephony.NetworkTypeEnum state = 1;
1449 // For multi-sim phones, this distinguishes between the sim cards.
1450 optional int32 sim_slot_index = 2;
1451}
1452
Andrew Chantb56388b2018-03-22 21:07:33 -07001453/**
1454 * Logs the VID and PID of any connected USB devices.
1455 *
1456 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1457 *
1458 * Logged by Vendor.
1459 */
1460message UsbDeviceAttached {
1461 optional int32 vid = 1;
1462 optional int32 pid = 2;
1463 optional bool has_audio = 3;
1464 optional bool has_hid = 4;
1465 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001466 enum State {
1467 STATE_DISCONNECTED = 0;
1468 STATE_CONNECTED = 1;
1469 }
1470 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001471 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001472}
1473
Tej Singheee317b2018-03-07 19:28:05 -08001474
Tej Singhdd7bd352018-02-09 19:33:15 -08001475/**
Tej Singh5d991e12018-03-09 19:48:11 -08001476 * Logs when Bluetooth is enabled and disabled.
1477 *
1478 * Logged from:
1479 * services/core/java/com/android/server/BluetoothManagerService.java
1480 */
1481message BluetoothEnabledStateChanged {
1482 repeated AttributionNode attribution_node = 1;
1483 // Whether or not bluetooth is enabled on the device.
1484 enum State {
1485 UNKNOWN = 0;
1486 ENABLED = 1;
1487 DISABLED = 2;
1488 }
1489 optional State state = 2;
1490 // The reason for being enabled/disabled.
1491 // Eg. Airplane mode, crash, application request.
1492 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1493 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001494 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001495}
1496
1497/**
Jack Hed9837c82019-01-09 01:19:13 -08001498 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001499 *
1500 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001501 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1502 *
1503 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001504 */
1505message BluetoothConnectionStateChanged {
1506 // The state of the connection.
1507 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1508 optional android.bluetooth.ConnectionStateEnum state = 1;
1509 // An identifier that can be used to match connect and disconnect events.
1510 // Currently is last two bytes of a hash of a device level ID and
1511 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001512 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001513 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001514 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1515 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001516 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001517 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001518 // An identifier that can be used to match events for this device.
1519 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1520 // Salt: Randomly generated 256 bit value
1521 // Hash algorithm: HMAC-SHA256
1522 // Size: 32 byte
1523 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001524 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001525}
1526
1527/**
1528 * Logs when a Bluetooth device connects and disconnects over ACL
1529 *
1530 * Logged from:
1531 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1532 *
1533 * Next Tag: 3
1534 */
1535message BluetoothAclConnectionStateChanged {
1536 // An identifier that can be used to match events for this device.
1537 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1538 // Salt: Randomly generated 256 bit value
1539 // Hash algorithm: HMAC-SHA256
1540 // Size: 32 byte
1541 // Default: null or empty if the device identifier is not known
1542 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1543 // The state of the connection.
1544 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1545 optional android.bluetooth.ConnectionStateEnum state = 2;
1546}
1547
1548/**
1549 * Logs when a Bluetooth device connects and disconnects over SCO
1550 *
1551 * Logged from:
1552 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1553 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1554 *
1555 * Next Tag: 4
1556 */
1557message BluetoothScoConnectionStateChanged {
1558 // An identifier that can be used to match events for this device.
1559 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1560 // Salt: Randomly generated 256 bit value
1561 // Hash algorithm: HMAC-SHA256
1562 // Size: 32 byte
1563 // Default: null or empty if the device identifier is not known
1564 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1565 // The state of the connection.
1566 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1567 optional android.bluetooth.ConnectionStateEnum state = 2;
1568 // Codec used for this SCO connection
1569 // Default: UNKNOWN
1570 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001571}
1572
Jack Hec27040a2019-01-09 20:54:41 -08001573/**
1574 * Logged when active device of a profile changes
1575 *
1576 * Logged from:
1577 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1578 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1579 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1580 */
1581message BluetoothActiveDeviceChanged {
1582 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1583 // From android.bluetooth.BluetoothProfile
1584 optional int32 bt_profile = 1;
1585 // An identifier that can be used to match events for this new active device.
1586 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1587 // Salt: Randomly generated 256 bit value
1588 // Hash algorithm: HMAC-SHA256
1589 // Size: 32 byte
1590 // Default: null or empty if there is no active device for this profile
1591 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1592}
1593
Jack Heab86dbd22018-12-18 15:43:27 -08001594// Logs when there is an event affecting Bluetooth device's link layer connection.
1595// - This event is triggered when there is a related HCI command or event
1596// - Users of this metrics can deduce Bluetooth device's connection state from these events
1597// - HCI commands are logged before the command is sent, after receiving command status, and after
1598// receiving command complete
1599// - HCI events are logged when they arrive
1600//
1601// Low level log from system/bt
1602//
1603// Bluetooth classic commands:
1604// - CMD_CREATE_CONNECTION
1605// - CMD_DISCONNECT
1606// - CMD_CREATE_CONNECTION_CANCEL
1607// - CMD_ACCEPT_CONNECTION_REQUEST
1608// - CMD_REJECT_CONNECTION_REQUEST
1609// - CMD_SETUP_ESCO_CONNECTION
1610// - CMD_ACCEPT_ESCO_CONNECTION
1611// - CMD_REJECT_ESCO_CONNECTION
1612// - CMD_ENH_SETUP_ESCO_CONNECTION
1613// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1614//
1615// Bluetooth low energy commands:
1616// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1617// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1618// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1619// - CMD_BLE_CLEAR_WHITE_LIST
1620// - CMD_BLE_ADD_WHITE_LIST
1621// - CMD_BLE_REMOVE_WHITE_LIST
1622//
1623// Bluetooth classic events:
1624// - EVT_CONNECTION_COMP
1625// - EVT_CONNECTION_REQUEST
1626// - EVT_DISCONNECTION_COMP
1627// - EVT_ESCO_CONNECTION_COMP
1628// - EVT_ESCO_CONNECTION_CHANGED
1629//
1630// Bluetooth low energy meta events:
1631// - BLE_EVT_CONN_COMPLETE_EVT
1632// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1633//
1634// Next tag: 10
1635message BluetoothLinkLayerConnectionEvent {
1636 // An identifier that can be used to match events for this device.
1637 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1638 // Salt: Randomly generated 256 bit value
1639 // Hash algorithm: HMAC-SHA256
1640 // Size: 32 byte
1641 // Default: null or empty if the device identifier is not known
1642 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1643 // Connection handle of this connection if available
1644 // Range: 0x0000 - 0x0EFF (12 bits)
1645 // Default: 0xFFFF if the handle is unknown
1646 optional int32 connection_handle = 2;
1647 // Direction of the link
1648 // Default: DIRECTION_UNKNOWN
1649 optional android.bluetooth.DirectionEnum direction = 3;
1650 // Type of this link
1651 // Default: LINK_TYPE_UNKNOWN
1652 optional android.bluetooth.LinkTypeEnum type = 4;
1653
1654 // Reason metadata for this link layer connection event, rules for interpretation:
1655 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1656 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1657 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1658 // set and valid, ignore hci_ble_event
1659
1660 // HCI command associated with this event
1661 // Default: CMD_UNKNOWN
1662 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1663 // HCI event associated with this event
1664 // Default: EVT_UNKNOWN
1665 optional android.bluetooth.hci.EventEnum hci_event = 6;
1666 // HCI BLE meta event associated with this event
1667 // Default: BLE_EVT_UNKNOWN
1668 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1669 // HCI command status code if this is triggerred by hci_cmd
1670 // Default: STATUS_UNKNOWN
1671 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1672 // HCI reason code associated with this event
1673 // Default: STATUS_UNKNOWN
1674 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1675}
1676
Howard Roe103fe22019-01-17 16:52:16 -08001677/**
1678 * Logs when a module is rolled back by Watchdog.
1679 *
1680 * Logged from: Rollback Manager
1681 */
1682message WatchdogRollbackOccurred {
1683 enum RollbackType {
1684 UNKNOWN = 0;
1685 ROLLBACK_INITIATE = 1;
1686 ROLLBACK_SUCCESS = 2;
1687 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001688 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001689 }
1690 optional RollbackType rollback_type = 1;
1691
1692 optional string package_name = 2;
1693
1694 optional int32 package_version_code = 3;
1695}
1696
Jack Hec27040a2019-01-09 20:54:41 -08001697/**
1698 * Logs when there is a change in Bluetooth A2DP playback state
1699 *
1700 * Logged from:
1701 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1702 */
1703message BluetoothA2dpPlaybackStateChanged {
1704 // An identifier that can be used to match events for this device.
1705 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1706 // Salt: Randomly generated 256 bit value
1707 // Hash algorithm: HMAC-SHA256
1708 // Size: 32 byte
1709 // Default: null or empty if the device identifier is not known
1710 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1711 // Current playback state
1712 // Default: PLAYBACK_STATE_UNKNOWN
1713 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1714 // Current audio coding mode
1715 // Default: AUDIO_CODING_MODE_UNKNOWN
1716 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1717}
1718
1719/**
1720 * Logs when there is a change in A2DP codec config for a particular remote device
1721 *
1722 * Logged from:
1723 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1724 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1725 */
1726message BluetoothA2dpCodecConfigChanged {
1727 // An identifier that can be used to match events for this device.
1728 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1729 // Salt: Randomly generated 256 bit value
1730 // Hash algorithm: HMAC-SHA256
1731 // Size: 32 byte
1732 // Default: null or empty if the device identifier is not known
1733 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1734 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1735 // Default SOURCE_CODEC_TYPE_INVALID
1736 optional int32 codec_type = 2;
1737 // Codec priroity, the higher the more preferred, -1 for disabled
1738 // Default: CODEC_PRIORITY_DEFAULT
1739 optional int32 codec_priority = 3;
1740 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1741 // Default: SAMPLE_RATE_NONE
1742 optional int32 sample_rate = 4;
1743 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1744 // Default: BITS_PER_SAMPLE_NONE
1745 optional int32 bits_per_sample = 5;
1746 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1747 // Default: CHANNEL_MODE_NONE
1748 optional int32 channel_mode = 6;
1749 // Codec specific values
1750 // Default 0
1751 optional int64 codec_specific_1 = 7;
1752 optional int64 codec_specific_2 = 8;
1753 optional int64 codec_specific_3 = 9;
1754 optional int64 codec_specific_4 = 10;
1755}
1756
1757/**
1758 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1759 * Each codec's capability is logged separately due to statsd restriction
1760 *
1761 * Logged from:
1762 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1763 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1764 */
1765message BluetoothA2dpCodecCapabilityChanged {
1766 // An identifier that can be used to match events for this device.
1767 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1768 // Salt: Randomly generated 256 bit value
1769 // Hash algorithm: HMAC-SHA256
1770 // Size: 32 byte
1771 // Default: null or empty if the device identifier is not known
1772 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1773 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1774 // Default SOURCE_CODEC_TYPE_INVALID
1775 optional int32 codec_type = 2;
1776 // Codec priroity, the higher the more preferred, -1 for disabled
1777 // Default: CODEC_PRIORITY_DEFAULT
1778 optional int32 codec_priority = 3;
1779 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1780 // in BluetoothCodecConfig
1781 // Default: empty and SAMPLE_RATE_NONE for individual item
1782 optional int32 sample_rate = 4;
1783 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1784 // in BluetoothCodecConfig
1785 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1786 optional int32 bits_per_sample = 5;
1787 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1788 // BluetoothCodecConfig
1789 // Default: empty and CHANNEL_MODE_NONE for individual item
1790 optional int32 channel_mode = 6;
1791 // Codec specific values
1792 // Default 0
1793 optional int64 codec_specific_1 = 7;
1794 optional int64 codec_specific_2 = 8;
1795 optional int64 codec_specific_3 = 9;
1796 optional int64 codec_specific_4 = 10;
1797}
1798
1799/**
1800 * Logs when A2DP failed to read from PCM source.
1801 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1802 *
1803 * Logged from:
1804 * system/bt
1805 */
1806message BluetoothA2dpAudioUnderrunReported {
1807 // An identifier that can be used to match events for this device.
1808 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1809 // Salt: Randomly generated 256 bit value
1810 // Hash algorithm: HMAC-SHA256
1811 // Size: 32 byte
1812 // Default: null or empty if the device identifier is not known
1813 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1814 // Encoding interval in nanoseconds
1815 // Default: 0
1816 optional int64 encoding_interval_nanos = 2;
1817 // Number of bytes of PCM data that could not be read from the source
1818 // Default: 0
1819 optional int32 num_missing_pcm_bytes = 3;
1820}
1821
1822/**
1823 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1824 * buffer queue is full and we have to drop data
1825 *
1826 * Logged from:
1827 * system/bt
1828 */
1829message BluetoothA2dpAudioOverrunReported {
1830 // An identifier that can be used to match events for this device.
1831 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1832 // Salt: Randomly generated 256 bit value
1833 // Hash algorithm: HMAC-SHA256
1834 // Size: 32 byte
1835 // Default: null or empty if the device identifier is not known
1836 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1837 // Encoding interval in nanoseconds
1838 // Default: 0
1839 optional int64 encoding_interval_nanos = 2;
1840 // Number of buffers dropped in this event
1841 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1842 // Default: 0
1843 optional int32 num_dropped_buffers = 3;
1844 // Number of encoded buffers dropped in this event
1845 // Default 0
1846 optional int32 num_dropped_encoded_frames = 4;
1847 // Number of encoded bytes dropped in this event
1848 // Default: 0
1849 optional int32 num_dropped_encoded_bytes = 5;
1850}
1851
1852/**
1853 * Logs when we receive reports regarding a device's RSSI value
1854 *
1855 * Logged from:
1856 * system/bt
1857 */
1858message BluetoothDeviceRssiReported {
1859 // An identifier that can be used to match events for this device.
1860 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1861 // Salt: Randomly generated 256 bit value
1862 // Hash algorithm: HMAC-SHA256
1863 // Size: 32 byte
1864 // Default: null or empty if the device identifier is not known
1865 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1866 // Connection handle of this connection if available
1867 // Range: 0x0000 - 0x0EFF (12 bits)
1868 // Default: 0xFFFF if the handle is unknown
1869 optional int32 connection_handle = 2;
1870 // HCI command status code if this is triggerred by hci_cmd
1871 // Default: STATUS_UNKNOWN
1872 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1873 // BR/EDR
1874 // Range: -128 ≤ N ≤ 127 (signed integer)
1875 // Units: dB
1876 // LE:
1877 // Range: -127 to 20, 127 (signed integer)
1878 // Units: dBm
1879 // Invalid when an out of range value is reported
1880 optional int32 rssi = 4;
1881}
1882
1883/**
1884 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1885 *
1886 * Logged from:
1887 * system/bt
1888 */
1889message BluetoothDeviceFailedContactCounterReported {
1890 // An identifier that can be used to match events for this device.
1891 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1892 // Salt: Randomly generated 256 bit value
1893 // Hash algorithm: HMAC-SHA256
1894 // Size: 32 byte
1895 // Default: null or empty if the device identifier is not known
1896 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1897 // Connection handle of this connection if available
1898 // Range: 0x0000 - 0x0EFF (12 bits)
1899 // Default: 0xFFFF if the handle is unknown
1900 optional int32 connection_handle = 2;
1901 // HCI command status code if this is triggerred by hci_cmd
1902 // Default: STATUS_UNKNOWN
1903 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1904 // Number of consecutive failed contacts for a connection corresponding to the Handle
1905 // Range: uint16_t, 0-0xFFFF
1906 // Default: 0xFFFFF
1907 optional int32 failed_contact_counter = 4;
1908}
1909
1910/**
1911 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1912 *
1913 * Logged from:
1914 * system/bt
1915 */
1916message BluetoothDeviceTxPowerLevelReported {
1917 // An identifier that can be used to match events for this device.
1918 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1919 // Salt: Randomly generated 256 bit value
1920 // Hash algorithm: HMAC-SHA256
1921 // Size: 32 byte
1922 // Default: null or empty if the device identifier is not known
1923 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1924 // Connection handle of this connection if available
1925 // Range: 0x0000 - 0x0EFF (12 bits)
1926 // Default: 0xFFFF if the handle is unknown
1927 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001928 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001929 // Default: STATUS_UNKNOWN
1930 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1931 // Range: -30 ≤ N ≤ 20
1932 // Units: dBm
1933 // Invalid when an out of range value is reported
1934 optional int32 transmit_power_level = 4;
1935}
Jack Heab86dbd22018-12-18 15:43:27 -08001936
Tej Singh5d991e12018-03-09 19:48:11 -08001937/**
Jack He1021a612019-01-20 21:22:46 -08001938 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1939 * receiving an HCI command from the host
1940 *
1941 * Logged from: system/bt
1942 */
1943message BluetoothHciTimeoutReported {
1944 // HCI command associated with this event
1945 // Default: CMD_UNKNOWN
1946 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1947}
1948
1949/**
1950 * Logs when we receive Bluetooth Link Quality Report event from the controller
1951 * See Android Bluetooth HCI specification for more details
1952 *
1953 * Note: all count and bytes field are counted since last event
1954 *
1955 * Logged from: system/bt
1956 */
1957message BluetoothQualityReportReported {
1958 // Quality report ID
1959 // Original type: uint8_t
1960 // Default: BQR_ID_UNKNOWN
1961 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1962 // Packet type of the connection
1963 // Original type: uint8_t
1964 // Default: BQR_PACKET_TYPE_UNKNOWN
1965 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1966 // Connection handle of the connection
1967 // Original type: uint16_t
1968 optional int32 connection_handle = 3;
1969 // Performing Role for the connection
1970 // Original type: uint8_t
1971 optional int32 connection_role = 4;
1972 // Current Transmit Power Level for the connection. This value is the same as the controller's
1973 // response to the HCI_Read_Transmit_Power_Level HCI command
1974 // Original type: uint8_t
1975 optional int32 tx_power_level = 5;
1976 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1977 // absolute receiver signal strength value
1978 // Original type: int8_t
1979 optional int32 rssi = 6;
1980 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1981 // channels used by the link currently
1982 // Original type: uint8_t
1983 optional int32 snr = 7;
1984 // Indicates the number of unused channels in AFH_channel_map
1985 // Original type: uint8_t
1986 optional int32 unused_afh_channel_count = 8;
1987 // Indicates the number of the channels which are interfered and quality is bad but are still
1988 // selected for AFH
1989 // Original type: uint8_t
1990 optional int32 afh_select_unideal_channel_count = 9;
1991 // Current Link Supervision Timeout Setting
1992 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1993 // Original type: uint16_t
1994 optional int32 lsto = 10;
1995 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1996 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1997 // 0x01 (Piconet Clock)
1998 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1999 // Original type: uint32_t
2000 optional int64 connection_piconet_clock = 11;
2001 // The count of retransmission
2002 // Original type: uint32_t
2003 optional int64 retransmission_count = 12;
2004 // The count of no RX
2005 // Original type: uint32_t
2006 optional int64 no_rx_count = 13;
2007 // The count of NAK (Negative Acknowledge)
2008 // Original type: uint32_t
2009 optional int64 nak_count = 14;
2010 // Controller timestamp of last TX ACK
2011 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2012 // Original type: uint32_t
2013 optional int64 last_tx_ack_timestamp = 15;
2014 // The count of Flow-off (STOP)
2015 // Original type: uint32_t
2016 optional int64 flow_off_count = 16;
2017 // Controller timestamp of last Flow-on (GO)
2018 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2019 // Original type: uint32_t
2020 optional int64 last_flow_on_timestamp = 17;
2021 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2022 // Original type: uint32_t
2023 optional int64 buffer_overflow_bytes = 18;
2024 // Buffer underflow count (in byte) since last event
2025 // Original type: uint32_t
2026 optional int64 buffer_underflow_bytes = 19;
2027}
2028
2029/**
2030 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2031 *
2032 * Notes:
2033 * - Each event can be partially filled as we might learn different pieces of device
2034 * information at different time
2035 * - Multiple device info events can be combined to give more complete picture
2036 * - When multiple device info events tries to describe the same information, the
2037 * later one wins
2038 *
2039 * Logged from:
2040 * packages/apps/Bluetooth
2041 */
Jack Heaea26982019-04-04 11:19:48 -07002042message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002043 // An identifier that can be used to match events for this device.
2044 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2045 // Salt: Randomly generated 256 bit value
2046 // Hash algorithm: HMAC-SHA256
2047 // Size: 32 byte
2048 // Default: null or empty if the device identifier is not known
2049 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2050 // Where is this device info obtained from
2051 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2052 // Name of the data source
2053 // For EXTERNAL: package name of the data source
2054 // For INTERNAL: null for general case, component name otherwise
2055 optional string source_name = 3;
2056 // Name of the manufacturer of this device
2057 optional string manufacturer = 4;
2058 // Model of this device
2059 optional string model = 5;
2060 // Hardware version of this device
2061 optional string hardware_version = 6;
2062 // Software version of this device
2063 optional string software_version = 7;
2064}
2065
2066/**
2067 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2068 * device, as documented by the Bluetooth Core HCI specification
2069 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2070 * Vol 2, Part E, Page 1118
2071 *
2072 * Logged from:
2073 * system/bt
2074 */
2075message BluetoothRemoteVersionInfoReported {
2076 // Connection handle of the connection
2077 // Original type: uint16_t
2078 optional int32 connection_handle = 1;
2079 // HCI command status code
2080 // Default: STATUS_UNKNOWN
2081 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2082 // 1 byte Version of current LMP in the remote controller
2083 optional int32 lmp_version = 3;
2084 // 2 bytes LMP manufacturer code of the remote controller
2085 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2086 optional int32 lmp_manufacturer_code = 4;
2087 // 4 bytes subversion of the LMP in the remote controller
2088 optional int32 lmp_subversion = 5;
2089}
2090
2091/**
2092 * Logs when certain Bluetooth SDP attributes are discovered
2093 * Constant definitions are from:
2094 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2095 *
2096 * Current logged attributes:
2097 * - BluetoothProfileDescriptorList
2098 * - Supported Features Bitmask
2099 *
2100 * Logged from:
2101 * system/bt
2102 */
2103message BluetoothSdpAttributeReported {
2104 // An identifier that can be used to match events for this device.
2105 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2106 // Salt: Randomly generated 256 bit value
2107 // Hash algorithm: HMAC-SHA256
2108 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2109 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2110 // Original type: uint16_t
2111 optional int32 protocol_uuid = 2;
2112 // Short form UUIDs used to identify Bluetooth SDP attribute types
2113 // Original type: uint16_t
2114 optional int32 attribute_id = 3;
2115 // Attribute value for the particular attribute
2116 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2117}
2118
2119/**
2120 * Logs when bond state of a Bluetooth device changes
2121 *
2122 * Logged from:
2123 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2124 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2125 */
2126message BluetoothBondStateChanged {
2127 // An identifier that can be used to match events for this device.
2128 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2129 // Salt: Randomly generated 256 bit value
2130 // Hash algorithm: HMAC-SHA256
2131 // Size: 32 byte
2132 // Default: null or empty if the device identifier is not known
2133 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2134 // Preferred transport type to remote dual mode device
2135 // Default: TRANSPORT_AUTO means no preference
2136 optional android.bluetooth.TransportTypeEnum transport = 2;
2137 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2138 // Default: UNKNOWN
2139 optional android.bluetooth.DeviceTypeEnum type = 3;
2140 // Current bond state (NONE, BONDING, BONDED)
2141 // Default: BOND_STATE_UNKNOWN
2142 optional android.bluetooth.BondStateEnum bond_state = 4;
2143 // Bonding sub state
2144 // Default: BOND_SUB_STATE_UNKNOWN
2145 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2146 // Unbond Reason
2147 // Default: UNBOND_REASON_UNKNOWN
2148 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2149}
2150
2151/**
2152 * Logs there is an event related Bluetooth classic pairing
2153 *
2154 * Logged from:
2155 * system/bt
2156 */
2157message BluetoothClassicPairingEventReported {
2158 // An identifier that can be used to match events for this device.
2159 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2160 // Salt: Randomly generated 256 bit value
2161 // Hash algorithm: HMAC-SHA256
2162 // Size: 32 byte
2163 // Default: null or empty if the device identifier is not known
2164 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2165 // Connection handle of this connection if available
2166 // Range: 0x0000 - 0x0EFF (12 bits)
2167 // Default: 0xFFFF if the handle is unknown
2168 optional int32 connection_handle = 2;
2169 // HCI command associated with this event
2170 // Default: CMD_UNKNOWN
2171 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2172 // HCI event associated with this event
2173 // Default: EVT_UNKNOWN
2174 optional android.bluetooth.hci.EventEnum hci_event = 4;
2175 // HCI command status code if this is triggerred by hci_cmd
2176 // Default: STATUS_UNKNOWN
2177 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2178 // HCI reason code associated with this event
2179 // Default: STATUS_UNKNOWN
2180 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002181 // A status value related to this specific event
2182 // Default: 0
2183 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002184}
2185
2186/**
2187 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2188 *
2189 * Logged from:
2190 * system/bt
2191 */
2192message BluetoothSmpPairingEventReported {
2193 // An identifier that can be used to match events for this device.
2194 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2195 // Salt: Randomly generated 256 bit value
2196 // Hash algorithm: HMAC-SHA256
2197 // Size: 32 byte
2198 // Default: null or empty if the device identifier is not known
2199 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2200 // SMP command sent or received over L2CAP
2201 // Default: CMD_UNKNOWN
2202 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2203 // Whether this command is sent or received
2204 // Default: DIRECTION_UNKNOWN
2205 optional android.bluetooth.DirectionEnum direction = 3;
2206 // SMP failure reason code
2207 // Default: PAIRING_FAIL_REASON_DEFAULT
2208 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2209}
2210
2211/**
Jack He815cdba2019-01-30 17:24:55 -08002212 * Logs when a Bluetooth socket’s connection state changed
2213 *
2214 * Logged from:
2215 * system/bt
2216 */
2217message BluetoothSocketConnectionStateChanged {
2218 // An identifier that can be used to match events for this device.
2219 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2220 // Salt: Randomly generated 256 bit value
2221 // Hash algorithm: HMAC-SHA256
2222 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002223 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002224 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002225 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002226 // Default 0 when unknown or don't care
2227 optional int32 port = 2;
2228 // Socket type as mentioned in
2229 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2230 // Default: SOCKET_TYPE_UNKNOWN
2231 optional android.bluetooth.SocketTypeEnum type = 3;
2232 // Socket connection state
2233 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2234 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2235 // Number of bytes sent to remote device during this connection
2236 optional int64 tx_bytes = 5;
2237 // Number of bytes received from remote device during this connection
2238 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002239 // Socket owner's UID
2240 optional int32 uid = 7 [(is_uid) = true];
2241 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2242 // |port| must be spawned by |server_port|
2243 // Default 0 when unknown or don't care
2244 optional int32 server_port = 8;
2245 // Whether this is a server listener socket
2246 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002247}
2248
2249/**
Jack He71426802019-04-02 13:32:52 -07002250 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2251 *
2252 * Logged from:
2253 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2254 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2255 *
2256 */
2257message BluetoothClassOfDeviceReported {
2258 // An identifier that can be used to match events for this device.
2259 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2260 // Salt: Randomly generated 256 bit value
2261 // Hash algorithm: HMAC-SHA256
2262 // Size: 32 byte
2263 // Default: null or empty if this is a server listener socket
2264 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2265 // Class of Device (CoD) value including both Major, Minor device class and service class
2266 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2267 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2268 // Default: 0
2269 optional int32 class_of_device = 2;
2270}
2271
2272/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002273 * Logs when something is plugged into or removed from the USB-C connector.
2274 *
2275 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002276 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002277 */
2278message UsbConnectorStateChanged {
2279 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002280 STATE_DISCONNECTED = 0;
2281 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002282 }
2283 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002284 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002285 // Last active session in ms.
2286 // 0 when the port is in connected state.
2287 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002288}
2289
2290/**
2291 * Logs the reported speaker impedance.
2292 *
2293 * Logged from:
2294 * Vendor audio implementation.
2295 */
2296message SpeakerImpedanceReported {
2297 optional int32 speaker_location = 1;
2298 optional int32 impedance = 2;
2299}
2300
2301/**
2302 * Logs the report of a failed hardware.
2303 *
2304 * Logged from:
2305 * Vendor HALs.
2306 *
2307 */
2308message HardwareFailed {
2309 enum HardwareType {
2310 HARDWARE_FAILED_UNKNOWN = 0;
2311 HARDWARE_FAILED_MICROPHONE = 1;
2312 HARDWARE_FAILED_CODEC = 2;
2313 HARDWARE_FAILED_SPEAKER = 3;
2314 HARDWARE_FAILED_FINGERPRINT = 4;
2315 }
2316 optional HardwareType hardware_type = 1;
2317
Maggie White6dcd8572019-01-31 14:11:50 -08002318 /**
2319 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002320 * the same hardware_type. The specific locations are vendor defined integers,
2321 * referring to board-specific numbering schemes.
2322 */
2323 optional int32 hardware_location = 2;
2324
Maggie White6dcd8572019-01-31 14:11:50 -08002325 /**
2326 * failure_code is specific to the HardwareType of the failed hardware.
2327 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002328 */
Maggie White6dcd8572019-01-31 14:11:50 -08002329 enum HardwareErrorCode {
2330 UNKNOWN = 0;
2331 COMPLETE = 1;
2332 SPEAKER_HIGH_Z = 2;
2333 SPEAKER_SHORT = 3;
2334 FINGERPRINT_SENSOR_BROKEN = 4;
2335 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002336 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002337 }
2338 optional int32 failure_code = 3;
2339}
2340
2341/**
2342 * Log an event when the device has been physically dropped.
2343 * Reported from the /vendor partition.
2344 */
2345message PhysicalDropDetected {
2346 // Confidence that the event was actually a drop, 0 -> 100
2347 optional int32 confidence_pctg = 1;
2348 // Peak acceleration of the drop, in 1/1000s of a g.
2349 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002350 // Duration of freefall in ms
2351 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002352}
2353
2354/**
2355 * Log bucketed battery charge cycles.
2356 *
2357 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002358 * a given charge point. For example, if 10 cycle buckets are
2359 * initialized, bucket 1 is the lowest 1/10th of the battery,
2360 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002361 *
2362 * Logged from:
2363 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2364 */
2365message ChargeCyclesReported {
2366 optional int32 cycle_bucket_1 = 1;
2367 optional int32 cycle_bucket_2 = 2;
2368 optional int32 cycle_bucket_3 = 3;
2369 optional int32 cycle_bucket_4 = 4;
2370 optional int32 cycle_bucket_5 = 5;
2371 optional int32 cycle_bucket_6 = 6;
2372 optional int32 cycle_bucket_7 = 7;
2373 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002374 optional int32 cycle_bucket_9 = 9;
2375 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002376}
2377
2378/**
Howard Roa46b6582018-09-18 16:45:02 -07002379 * Log battery health snapshot.
2380 *
2381 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2382 * are snapshotted periodically over 24hrs.
2383 */
2384message BatteryHealthSnapshot {
2385 enum BatterySnapshotType {
2386 UNKNOWN = 0;
2387 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2388 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2389 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2390 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2391 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2392 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2393 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2394 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2395 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2396 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2397 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2398 }
2399 optional BatterySnapshotType type = 1;
2400 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002401 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002402 // Voltage Battery Voltage, in microVolts.
2403 optional int32 voltage_micro_volt = 3;
2404 // Current Battery current, in microAmps.
2405 optional int32 current_micro_amps = 4;
2406 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2407 optional int32 open_circuit_micro_volt = 5;
2408 // Resistance Battery Resistance, in microOhms.
2409 optional int32 resistance_micro_ohm = 6;
2410 // Level Battery Level, as % of full.
2411 optional int32 level_percent = 7;
2412}
2413
2414/**
2415 * Log slow I/O operations on the primary storage.
2416 */
2417message SlowIo {
2418 // Classifications of IO Operations.
2419 enum IoOperation {
2420 UNKNOWN = 0;
2421 READ = 1;
2422 WRITE = 2;
2423 UNMAP = 3;
2424 SYNC = 4;
2425 }
2426 optional IoOperation operation = 1;
2427
2428 // The number of slow IO operations of this type over 24 hours.
2429 optional int32 count = 2;
2430}
2431
2432/**
2433 * Log battery caused shutdown with the last recorded voltage.
2434 */
2435message BatteryCausedShutdown {
2436 // The last recorded battery voltage prior to shutdown.
2437 optional int32 last_recorded_micro_volt = 1;
2438}
2439
2440/**
Tej Singha72344992019-04-17 18:55:08 -07002441 * Logs when ThermalService receives throttling events.
2442 *
2443 * Logged from:
2444 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2445 */
2446message ThermalThrottlingSeverityStateChanged {
2447 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2448 optional android.os.TemperatureTypeEnum sensor_type = 1;
2449
2450 // The name of the temperature source. Eg. CPU0
2451 optional string sensor_name = 2;
2452
2453 // Temperature in tenths of a degree C.
2454 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2455 optional int32 temperature_deci_celsius = 3;
2456
2457 // Relative severity of the throttling, see enum definition.
2458 optional android.os.ThrottlingSeverityEnum severity = 4;
2459}
2460
2461/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002462 * Logs the duration of a davey (jank of >=700ms) when it occurs
2463 *
2464 * Logged from:
2465 * frameworks/base/libs/hwui/JankTracker.cpp
2466 */
2467message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002468 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002469 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002470
Tej Singhbb8554a2018-01-26 11:59:14 -08002471 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002472 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002473}
2474
2475/**
Bookatze5885242017-10-24 20:10:31 -07002476 * Logs phone signal strength changes.
2477 *
2478 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002479 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002480 */
2481message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002482 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2483 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002484}
2485
Yangster4ccebea2018-10-09 17:09:02 -07002486
2487/**
2488 * Logs when the phone state, sim state or signal strength changes
2489 *
2490 * Logged from:
2491 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2492 */
2493message PhoneServiceStateChanged {
2494 optional android.telephony.ServiceStateEnum state = 1;
2495 optional android.telephony.SimStateEnum sim_state = 2;
2496 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2497}
2498
2499/**
2500 * Logs when the phone becomes on or off.
2501 *
2502 * Logged from:
2503 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2504 */
2505message PhoneStateChanged {
2506 enum State {
2507 OFF = 0;
2508 ON = 1;
2509 }
2510 optional State state = 1;
2511}
2512
Hyunyoung Songf1b935e2019-07-09 09:19:25 -07002513message BackGesture {
2514 enum BackType {
2515 DEFAULT_BACK_TYPE = 0;
2516 COMPLETED = 1;
2517 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2518 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2519 INCOMPLETE = 4;
2520 }
2521 optional BackType type = 1;
2522
2523 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2524 enum WindowHorizontalLocation {
2525 DEFAULT_LOCATION = 0;
2526 LEFT = 1;
2527 RIGHT = 2;
2528 }
2529 optional WindowHorizontalLocation x_location = 3;
2530}
2531
2532message ExclusionRectStateChanged {
2533 optional string component_name = 1; // if not available, simply packageName
2534 optional int32 requested_height = 2; // px
2535 optional int32 rejected_height = 3; // px
2536
2537 enum WindowHorizontalLocation {
2538 DEFAULT_LOCATION = 0;
2539 LEFT = 1;
2540 RIGHT = 2;
2541 }
2542 optional WindowHorizontalLocation x_location = 4;
2543 optional bool landscape = 5;
2544 optional bool splitscreen = 6;
2545 optional int32 duration_millis = 7;
2546}
2547
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002548message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002549 optional android.stats.launcher.LauncherAction action = 1;
2550 optional android.stats.launcher.LauncherState src_state = 2;
2551 optional android.stats.launcher.LauncherState dst_state = 3;
2552 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002553 optional bool is_swipe_up_enabled = 5;
2554}
2555
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002556message StyleUIChanged {
2557 optional android.stats.style.Action action = 1;
2558 optional int32 color_package_hash = 2;
2559 optional int32 font_package_hash = 3;
2560 optional int32 shape_package_hash = 4;
2561 optional int32 clock_package_hash = 5;
2562 optional int32 launcher_grid = 6;
2563 optional int32 wallpaper_category_hash = 7;
2564 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002565 optional int32 color_preference = 9;
2566 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002567}
2568
David Chenc28b2bb2017-10-24 12:52:52 -07002569/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002570 * Logs when Settings UI has changed.
2571 *
2572 * Logged from:
2573 * packages/apps/Settings
2574 */
2575message SettingsUIChanged {
2576 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002577 * Where this SettingsUIChange event comes from. For example, if
2578 * it's a PAGE_VISIBLE event, where the page is opened from.
2579 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002580 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002581
2582 /**
2583 * What the UI action is.
2584 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002585 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002586
2587 /**
2588 * Where the action is happening
2589 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002590 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002591
2592 /**
2593 * What preference changed in this event.
2594 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002595 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002596
2597 /**
2598 * The new value of the changed preference.
2599 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002600 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002601}
2602
2603/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002604 * Logs basic timing information about touch events.
2605 * Reported at most every 5 minutes while device is being interacted with.
2606 *
2607 * Logged from:
2608 * frameworks/native/services/inputflinger
2609 */
2610message TouchEventReported {
2611 /**
2612 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2613 * and the standard deviation of latency between the kernel and framework
2614 * for touchscreen events. The units are microseconds.
2615 *
2616 * The number is measured as the difference between the time at which
2617 * the input event was received in the evdev driver,
2618 * and the time at which the input event was received in EventHub.
2619 */
2620 // Minimum value
2621 optional float latency_min_micros = 1;
2622 // Maximum value
2623 optional float latency_max_micros = 2;
2624 // Average value
2625 optional float latency_mean_micros = 3;
2626 // Standard deviation
2627 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002628 // Number of touch events (input_event) in this report
2629 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002630}
2631
2632/**
Philip Quinn0eded622019-01-29 12:46:28 -08002633 * Logs gesture classification and timing information for touch events.
2634 *
2635 * Logged from:
2636 * frameworks/base/core/java/android/view/GestureDetector.java
2637 * frameworks/base/core/java/android/view/View.java
2638 */
2639message TouchGestureClassified {
2640 // The source of the classification (e.g. Java class name).
2641 optional string source = 1;
2642
2643 enum Classification {
2644 UNKNOWN_CLASSIFICATION = 0;
2645 SINGLE_TAP = 1;
2646 DOUBLE_TAP = 2;
2647 LONG_PRESS = 3;
2648 DEEP_PRESS = 4;
2649 SCROLL = 5;
2650 }
2651 // The classification of the gesture.
2652 optional Classification classification = 2;
2653
2654 // The interval from the start of a touch event stream until the
2655 // classification was made.
2656 optional int32 latency_millis = 3;
2657
2658 // The distance from the location of the first touch event to the
2659 // location of the touch event when the classification was made.
2660 optional float displacement_px = 4;
2661}
2662
2663/**
David Chenc28b2bb2017-10-24 12:52:52 -07002664 * Logs that a setting was updated.
2665 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002666 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002667 * The tag and is_default allow resetting of settings to default values based on the specified
2668 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2669 */
2670message SettingChanged {
2671 // The name of the setting.
2672 optional string setting = 1;
2673
2674 // The change being imposed on this setting. May represent a number, eg "3".
2675 optional string value = 2;
2676
2677 // The new value of this setting. For most settings, this is same as value. For some settings,
2678 // value is +X or -X where X represents an element in a set. For example, if the previous value
2679 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2680 // The +/- feature is currently only used for location_providers_allowed.
2681 optional string new_value = 3;
2682
2683 // The previous value of this setting.
2684 optional string prev_value = 4;
2685
2686 // The tag used with the is_default for resetting sets of settings. This is generally null.
2687 optional string tag = 5;
2688
Bookatz90867622018-01-31 15:05:57 -08002689 // True if this setting with tag should be resettable.
2690 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002691
David Chenbd789912018-03-16 17:19:55 -07002692 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002693 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002694
2695 enum ChangeReason {
2696 UPDATED = 1; // Updated can be an insertion or an update.
2697 DELETED = 2;
2698 }
2699 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002700}
Chenjie Yub3dda412017-10-24 13:41:59 -07002701
Chenjie Yu05013b32017-11-21 10:21:41 -08002702/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002703 * Logs activity going to foreground or background
2704 *
2705 * Logged from:
2706 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2707 */
2708message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002709 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002710 optional string pkg_name = 2;
2711 optional string class_name = 3;
2712
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002713 enum State {
2714 BACKGROUND = 0;
2715 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002716 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002717 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002718}
David Chenc8a43242017-10-17 16:23:28 -07002719
2720/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002721 * Logs when a volume entered low Storage state.
2722 * Logged from:
2723 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2724 */
2725message LowStorageStateChanged {
2726 // Volume that ran out of storage.
2727 optional string volume_description = 1;
2728
2729 enum State {
2730 UNKNOWN = 0;
2731 OFF = 1;
2732 ON = 2;
2733 }
2734 optional State state = 2;
2735}
2736
2737/**
2738 * Logs when an app is downgraded.
2739 * Logged from:
2740 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2741 */
2742message AppDowngraded {
2743 optional string package_name = 1;
2744 // Size of the package (all data) before being downgraded.
2745 optional int64 size_in_bytes_before = 2;
2746 // Size of the package (all data) after being downgraded.
2747 optional int64 size_in_bytes_after = 3;
2748
2749 optional bool aggressive = 4;
2750}
2751
2752/**
2753 * Logs when an app is optimized after being downgraded.
2754 * Logged from:
2755 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2756 */
2757message AppOptimizedAfterDowngraded {
2758 optional string package_name = 1;
2759}
2760
2761/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002762 * Logs whenever an app is installed on external storage.
2763 * Logged from:
2764 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2765 */
2766message AppInstallOnExternalStorageReported {
2767 // The type of external storage.
2768 optional android.stats.storage.ExternalStorageType storage_type = 1;
2769 // The name of the package that is installed on the sd card.
2770 optional string package_name = 2;
2771}
2772
2773/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002774 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002775 * Logged from:
2776 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2777 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002778message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002779 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002780
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002781 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002782
2783 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002784 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002785 optional string process_name = 3;
2786
2787 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002788 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002789
2790 optional string package_name = 5;
2791
2792 enum InstantApp {
2793 UNAVAILABLE = 0;
2794 FALSE = 1;
2795 TRUE = 2;
2796 }
2797 optional InstantApp is_instant_app = 6;
2798
2799 enum ForegroundState {
2800 UNKNOWN = 0;
2801 BACKGROUND = 1;
2802 FOREGROUND = 2;
2803 }
2804 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002805
2806 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002807}
David Chen9e3808c2017-11-20 17:25:34 -08002808
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002809/**
2810 * Logs when a WTF (What a Terrible Failure) happened.
2811 * Logged from:
2812 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2813 */
2814message WTFOccurred {
2815 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002816
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002817 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002818
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002819 // The name of the process.
2820 // system_server if it is not by an app
2821 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002822
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002823 // The pid if available. -1 means not available.
2824 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002825
2826 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002827}
2828
2829/**
2830 * Logs when system server reports low memory.
2831 * Logged from:
2832 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2833 */
2834message LowMemReported {
2835}
2836
2837/**
2838 * Logs when an app ANR (App Not Responding) occurs.
2839 * Logged from:
2840 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2841 */
2842message ANROccurred {
2843 optional int32 uid = 1 [(is_uid) = true];
2844
2845 optional string process_name = 2;
2846
2847 optional string short_component_name = 3;
2848
2849 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002850
2851 enum InstantApp {
2852 UNAVAILABLE = 0;
2853 FALSE = 1;
2854 TRUE = 2;
2855 }
2856 optional InstantApp is_instant_app = 5;
2857
2858 enum ForegroundState {
2859 UNKNOWN = 0;
2860 BACKGROUND = 1;
2861 FOREGROUND = 2;
2862 }
2863 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002864
2865 optional android.server.ErrorSource error_source = 7;
2866
2867 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002868}
2869
Bookatza7020bd2018-08-28 16:29:35 -07002870/**
2871 * Logs when the vibrator state changes.
2872 * Logged from:
2873 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2874 */
2875message VibratorStateChanged {
2876 repeated AttributionNode attribution_node = 1;
2877
2878 enum State {
2879 OFF = 0;
2880 ON = 1;
2881 }
2882 optional State state = 2;
2883
2884 // Duration (in milliseconds) requested to keep the vibrator on.
2885 // Only applicable for State == ON.
2886 optional int64 duration_millis = 3;
2887}
2888
David Chen0a368b22017-12-06 16:28:16 -08002889/*
2890 * Allows other apps to push events into statsd.
2891 * Logged from:
2892 * frameworks/base/core/java/android/util/StatsLog.java
2893 */
David Chen0b5c90c2018-01-25 16:51:49 -08002894message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002895 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002896 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002897
2898 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2899 optional int32 label = 2;
2900
2901 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2902 // predicates for the metrics).
2903 enum State {
2904 UNKNOWN = 0;
2905 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2906 STOP = 2;
2907 START = 3;
2908 }
2909 optional State state = 3;
2910}
2911
David Chen9e3808c2017-11-20 17:25:34 -08002912/**
Bookatz7948c872018-09-04 12:58:33 -07002913 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2914 * For example, this could be due to the user manually changing the time.
2915 *
2916 * Logged from:
2917 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2918 */
2919message WallClockTimeShifted {
2920 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2921 optional int64 wall_clock_timestamp_millis = 1;
2922}
2923
2924/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002925 * Logs when statsd detects an anomaly.
2926 *
2927 * Logged from:
2928 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2929 */
2930message AnomalyDetected {
2931 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002932 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002933
Yangster-mac94e197c2018-01-02 16:03:03 -08002934 // Id of the config whose anomaly detection alert fired.
2935 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002936
Yangster-mac94e197c2018-01-02 16:03:03 -08002937 // Id of the alert (i.e. name of the anomaly that was detected).
2938 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002939}
2940
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002941message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002942 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002943 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002944
2945 // The app package name.
2946 optional string pkg_name = 2;
2947
2948 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002949 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002950 WARM = 1;
2951 HOT = 2;
2952 COLD = 3;
2953 }
2954 // The transition type.
2955 optional TransitionType type = 3;
2956
2957 // The activity name.
2958 optional string activity_name = 4;
2959
2960 // The name of the calling app. Empty if not set.
2961 optional string calling_pkg_name = 5;
2962
2963 // Whether the app is an instant app.
2964 optional bool is_instant_app = 6;
2965
2966 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002967 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002968
Bookatz80d11a02018-01-16 10:46:35 -08002969 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002970
David Chen0b5c90c2018-01-25 16:51:49 -08002971 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002972 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002973 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002974 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002975 optional int32 bind_application_delay_millis = 11;
2976 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002977
2978 // Empty if not set.
2979 optional string launch_token = 13;
2980
Calin Juravle759fbda2018-02-20 19:52:30 +00002981 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002982 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002983
2984 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002985 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002986}
2987
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002988message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002989 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002990 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002991
2992 // The app package name.
2993 optional string pkg_name = 2;
2994
2995 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002996 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002997 WARM = 1;
2998 HOT = 2;
2999 COLD = 3;
3000 }
3001 // The transition type.
3002 optional TransitionType type = 3;
3003
3004 // The activity name.
3005 optional string activity_name = 4;
3006}
3007
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003008message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003009 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003010 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003011
3012 // The app package name.
3013 optional string pkg_name = 2;
3014
3015 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003016 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003017 WITH_BUNDLE = 1;
3018 WITHOUT_BUNDLE = 2;
3019 }
3020 // The transition type.
3021 optional TransitionType type = 3;
3022
3023 // The activity name.
3024 optional string activity_name = 4;
3025
3026 optional bool transition_process_running = 5;
3027
3028 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003029 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003030}
3031
Bookatz8fcd09a2017-12-18 13:01:10 -08003032/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003033 * Logs a picture-in-picture action
3034 * Logged from:
3035 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3036 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3037 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3038 */
3039message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003040 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003041 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003042
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003043 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003044
Chenjie Yu52cacc62017-12-08 18:11:45 -08003045 enum State {
3046 ENTERED = 1;
3047 EXPANDED_TO_FULL_SCREEN = 2;
3048 MINIMIZED = 3;
3049 DISMISSED = 4;
3050 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003051 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003052}
3053
3054/**
Chenjie Yue8904192017-12-08 19:12:57 -08003055 * Logs overlay action
3056 * Logged from:
3057 * services/core/java/com/android/server/wm/Session.java
3058 */
3059message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003060 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003061
3062 optional string package_name = 2;
3063
3064 optional bool using_alert_window = 3;
3065
3066 enum State {
3067 ENTERED = 1;
3068 EXITED = 2;
3069 }
3070 optional State state = 4;
3071}
3072
Chenjie Yuccfe6452018-01-30 11:33:21 -08003073/*
3074 * Logs foreground service starts and stops.
3075 * Note that this is not when a service starts or stops, but when it is
3076 * considered foreground.
3077 * Logged from
3078 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3079 */
3080message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003081 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003082 // package_name + "/" + class_name
3083 optional string short_name = 2;
3084
3085 enum State {
3086 ENTER = 1;
3087 EXIT = 2;
3088 }
3089 optional State state = 3;
3090}
3091
Chenjie Yue8904192017-12-08 19:12:57 -08003092/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003093 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3094 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3095 * attributed back to the parent (host) uid. One example is Chrome.
3096 *
3097 * Logged from:
3098 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3099 */
3100message IsolatedUidChanged {
3101 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003102 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003103 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003104 optional int32 parent_uid = 1;
3105
3106 optional int32 isolated_uid = 2;
3107
3108 // We expect an isolated uid to be removed before if it's used for another parent uid.
3109 enum Event {
3110 REMOVED = 0;
3111 CREATED = 1;
3112 }
3113 optional Event event = 3;
3114}
3115
3116/*
3117 * Logs the reception of an incoming network packet causing the main system to wake up for
3118 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3119 * and processed by WakeupController.cpp.
3120 */
3121message PacketWakeupOccurred {
3122 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3123 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003124 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003125 // The interface name on which the packet was received.
3126 optional string iface = 2;
3127 // The ethertype value of the packet.
3128 optional int32 ethertype = 3;
3129 // String representation of the destination MAC address of the packet.
3130 optional string destination_hardware_address = 4;
3131 // String representation of the source address of the packet if this was an IP packet.
3132 optional string source_ip = 5;
3133 // String representation of the destination address of the packet if this was an IP packet.
3134 optional string destination_ip = 6;
3135 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3136 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3137 // families.
3138 optional int32 ip_next_header = 7;
3139 // The source port if this was a TCP or UDP packet.
3140 optional int32 source_port = 8;
3141 // The destination port if this was a TCP or UDP packet.
3142 optional int32 destination_port = 9;
3143}
3144
3145/*
3146 * Logs the memory stats for an app on startup.
3147 * Logged from:
3148 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3149 */
3150message AppStartMemoryStateCaptured {
3151 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003152 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003153
3154 // The process name.
3155 optional string process_name = 2;
3156
3157 // The activity name.
3158 optional string activity_name = 3;
3159
3160 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003161 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003162
3163 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003164 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003165
3166 // RSS
3167 optional int64 rss_in_bytes = 6;
3168
3169 // CACHE
3170 optional int64 cache_in_bytes = 7;
3171
3172 // SWAP
3173 optional int64 swap_in_bytes = 8;
3174}
3175
3176/*
3177 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3178 * for LMK event.
3179 * Logged from:
3180 * system/core/lmkd/lmkd.c
3181 */
3182message LmkStateChanged {
3183 enum State {
3184 UNKNOWN = 0;
3185 START = 1;
3186 STOP = 2;
3187 }
3188 optional State state = 1;
3189}
3190
3191/*
3192 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3193 * Logged from:
3194 * system/core/lmkd/lmkd.c
3195 */
3196message LmkKillOccurred {
3197 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003198 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003199
3200 // The process name.
3201 optional string process_name = 2;
3202
3203 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003204 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003205
3206 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003207 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003208
3209 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003210 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003211
3212 // RSS
3213 optional int64 rss_in_bytes = 6;
3214
3215 // CACHE
3216 optional int64 cache_in_bytes = 7;
3217
3218 // SWAP
3219 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003220
3221 // The elapsed real time of start of the process.
3222 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003223
3224 // Min oom adj score considered by lmkd.
3225 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003226}
3227
Rajeev Kumar51b54602018-03-01 12:18:26 -08003228/*
3229 * Logs when the ActivityManagerService detects that an app died.
3230 *
3231 * Logged from:
3232 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3233 */
3234message AppDied {
3235 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003236 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003237}
3238
Howard Ro21a039c2018-08-06 14:55:47 -07003239/**
3240 * An atom for generic metrics logging. Available from Android Q.
3241 */
3242message GenericAtom {
3243 // The uid of the application that sent this custom atom.
3244 optional int32 uid = 1 [(is_uid) = true];
3245
3246 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003247 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003248}
3249
Tej Singhd6d6d772018-09-05 17:41:25 -07003250/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003251 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003252 *
3253 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003254 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003255 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003256message BiometricAcquired {
3257 // Biometric modality that was acquired.
3258 optional android.hardware.biometrics.ModalityEnum modality = 1;
3259 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3260 optional int32 user = 2;
3261 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3262 optional bool is_crypto = 3;
3263 // Action that the device is performing. Acquired messages are only expected for enroll and
3264 // authenticate. Other actions may indicate an error.
3265 optional android.hardware.biometrics.ActionEnum action = 4;
3266 // The client that this acquisition was received for.
3267 optional android.hardware.biometrics.ClientEnum client = 5;
3268 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3269 optional int32 acquire_info = 6;
3270 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3271 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003272 // Dictates if this message should trigger additional debugging.
3273 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003274}
3275
3276/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003277 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003278 *
3279 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003280 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003281 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003282message BiometricAuthenticated {
3283 // Biometric modality that was used.
3284 optional android.hardware.biometrics.ModalityEnum modality = 1;
3285 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3286 optional int32 user = 2;
3287 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3288 // storage.
3289 optional bool is_crypto = 3;
3290 // The client that this acquisition was received for.
3291 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003292 // If authentication requires user confirmation. See BiometricPrompt's
3293 // setRequireConfirmation(bool) method.
3294 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003295
Kevin Chyn1741a072019-01-17 11:54:40 -08003296 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003297 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003298 REJECTED = 1;
3299 PENDING_CONFIRMATION = 2;
3300 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003301 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003302
3303 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003304 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003305 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3306 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3307 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3308 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003309 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003310 // Dictates if this message should trigger additional debugging.
3311 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003312}
3313
3314/**
3315 * Logs when a biometric error occurs.
3316 *
3317 * Logged from:
3318 * frameworks/base/services/core/java/com/android/server/biometrics
3319 */
3320message BiometricErrorOccurred {
3321 // Biometric modality that was used.
3322 optional android.hardware.biometrics.ModalityEnum modality = 1;
3323 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3324 optional int32 user = 2;
3325 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3326 optional bool is_crypto = 3;
3327 // Action that the device is performing.
3328 optional android.hardware.biometrics.ActionEnum action = 4;
3329 // The client that this acquisition was received for.
3330 optional android.hardware.biometrics.ClientEnum client = 5;
3331 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3332 // are unique to modality.
3333 optional int32 error_info = 6;
3334 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3335 // by the vendor and not specified by the HIDL interface.
3336 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003337 // Dictates if this message should trigger additional debugging.
3338 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003339 // Time spent during the authentication attempt.
3340 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003341}
3342
3343/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003344 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003345 * Logged from:
3346 * frameworks/base/services/core/java/com/android/server/biometrics
3347 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003348message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003349 // Biometric modality.
3350 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003351 // Type of issue detected.
3352 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003353 // Dictates if this message should trigger additional debugging.
3354 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003355}
Howard Ro688ae182018-09-25 00:09:36 -07003356
joshmccloskey6f952b22019-03-25 20:59:35 -07003357/**
3358 * Logs when a biometric enrollment occurs.
3359 *
3360 * Logged from:
3361 * frameworks/base/services/core/java/com/android/server/biometrics
3362 */
3363message BiometricEnrolled {
3364 // Biometric modality that was used.
3365 optional android.hardware.biometrics.ModalityEnum modality = 1;
3366 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3367 optional int32 user = 2;
3368 // The amount of time the enrollment took in milliseconds.
3369 optional int64 latency_millis = 3;
3370 // Whether or not the enrollment was successful.
3371 optional bool success = 4;
3372}
3373
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003374/*
Tej Singh0d176952019-01-16 19:10:54 -08003375 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003376 */
Tej Singh0d176952019-01-16 19:10:54 -08003377message FlagFlipUpdateOccurred {
3378 // If the event is from a flag config package, specify the package name.
3379 optional string flag_flip_package_name = 1;
3380
3381 // The order id of the package
3382 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003383}
3384
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003385/**
3386 * Potential experiment ids that goes with a train install.
3387 */
3388message TrainExperimentIds {
3389 repeated int64 experiment_id = 1;
3390}
3391
Yangster-macb89807e2018-11-15 21:10:57 -08003392/*
3393 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003394 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003395 */
3396message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003397 // Name of the train.
3398 optional string train_name = 1;
3399 // Version code for a "train" of packages that need to be installed atomically
3400 optional int64 train_version_code = 2;
3401 // After installation of this package, device requires a restart.
3402 optional bool requires_staging = 3;
3403 // Rollback should be enabled for this install.
3404 optional bool rollback_enabled = 4;
3405 // Requires low latency monitoring if possible.
3406 optional bool requires_low_latency_monitor = 5;
3407
Yangster-macb89807e2018-11-15 21:10:57 -08003408 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003409 UNKNOWN = 0;
3410 INSTALL_REQUESTED = 1;
3411 INSTALL_STARTED = 2;
3412 INSTALL_STAGED_NOT_READY = 3;
3413 INSTALL_STAGED_READY = 4;
3414 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003415 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3416 // and INSTALL_FAILURE_COMMIT.
3417 INSTALL_FAILURE = 6 [deprecated = true];
3418 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003419 INSTALL_CANCELLED = 7;
3420 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003421 INSTALLER_ROLLBACK_INITIATED = 9;
3422 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3423 INSTALLER_ROLLBACK_STAGED = 11;
3424 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3425 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3426 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3427 INSTALLER_ROLLBACK_SUCCESS = 15;
3428 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003429 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3430 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3431 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3432 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3433 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3434 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003435 INSTALL_FAILURE_DOWNLOAD = 23;
3436 INSTALL_FAILURE_STATE_MISMATCH = 24;
3437 INSTALL_FAILURE_COMMIT = 25;
Yangster-macb89807e2018-11-15 21:10:57 -08003438 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003439 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003440 // Possible experiment ids for monitoring this push.
3441 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3442 // user id
3443 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003444}
3445
Tej Singhc9203082019-05-03 13:42:23 -07003446/* Test atom, is not logged anywhere */
3447message TestAtomReported {
3448 repeated AttributionNode attribution_node = 1;
3449 optional int32 int_field = 2;
3450 optional int64 long_field = 3;
3451 optional float float_field = 4;
3452 optional string string_field = 5;
3453 optional bool boolean_field = 6;
3454 enum State {
3455 UNKNOWN = 0;
3456 OFF = 1;
3457 ON = 2;
3458 }
3459 optional State state = 7;
3460 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3461}
3462
Maggie Whitefc1aa592018-11-28 21:55:23 -08003463/** Represents USB port overheat event. */
3464message UsbPortOverheatEvent {
3465 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3466 optional int32 plug_temperature_deci_c = 1;
3467
3468 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3469 optional int32 max_temperature_deci_c = 2;
3470
3471 /* Time between USB plug event and overheat threshold trip, in seconds. */
3472 optional int32 time_to_overheat_secs = 3;
3473
3474 /* Time between overheat threshold trip and hysteresis, in seconds. */
3475 optional int32 time_to_hysteresis_secs = 4;
3476
3477 /* Time between hysteresis and active mitigation ending, in seconds. */
3478 optional int32 time_to_inactive_secs = 5;
3479};
3480
Maggie White8735b852019-01-18 11:40:49 -08003481/**
3482 * Logs total effective full charge and discharge cycles on a battery.
3483 * Here are some examples of one effective cycle:
3484 * 1) the battery charges from 0% to 100% and drains back to 0%,
3485 * 2) charging from 50% to 100% and draining back to 50% twice.
3486 * Pulled from:
3487 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3488 */
3489message BatteryCycleCount {
3490 /* Number of total charge and discharge cycles on the system battery. */
3491 optional int32 cycle_count = 1;
3492}
3493
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003494/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003495 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3496 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003497 * Pulled from:
3498 * StatsCompanionService
3499 */
3500
Carmen Agimof12dec122019-03-06 16:14:38 +00003501message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003502
Carmen Agimof12dec122019-03-06 16:14:38 +00003503 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003504 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003505 PUBLIC = 1;
3506 PRIVATE = 2;
3507 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003508 }
3509
Carmen Agimof12dec122019-03-06 16:14:38 +00003510 // The type of external storage.
3511 optional android.stats.storage.ExternalStorageType storage_type = 1;
3512 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3513 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003514 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003515 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003516}
3517
Yangster-macb89807e2018-11-15 21:10:57 -08003518/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003519 * Logs when a connection becomes available and lost.
3520 * Logged in StatsCompanionService.java
3521 */
3522message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003523 // Id of the network.
3524 optional int32 net_id = 1;
3525
3526 enum State {
3527 UNKNOWN = 0;
3528 CONNECTED = 1;
3529 DISCONNECTED = 2;
3530 }
3531 // Connected state of a network.
3532 optional State state = 2;
3533}
3534
3535/**
3536 * Logs when a service starts and stops.
3537 * Logged from:
3538 * services/core/java/com/android/server/am/ActiveServices.java
3539 */
3540message ServiceStateChanged {
3541
3542 optional int32 uid = 1 [(is_uid) = true];
3543
3544 optional string package_name = 2;
3545
3546 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003547
3548 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003549 START = 1;
3550 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003551 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003552
3553 optional State state = 4;
3554}
3555
3556/**
3557 * Logs when a service is launched.
3558 * Logged from:
3559 * services/core/java/com/android/server/am/ActiveServices.java
3560 */
3561message ServiceLaunchReported {
3562
3563 optional int32 uid = 1 [(is_uid) = true];
3564
3565 optional string package_name = 2;
3566
3567 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003568}
Howard Ro688ae182018-09-25 00:09:36 -07003569
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003570/**
3571 * Logs when a hidden API is used.
3572 *
3573 * Logged from:
3574 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3575 */
3576message HiddenApiUsed {
3577 // The uid of the app making the hidden access.
3578 optional int32 uid = 1 [(is_uid) = true];
3579
3580 // Signature of the method or field accessed.
3581 optional string signature = 2;
3582
3583 enum AccessMethod {
3584 NONE = 0;
3585 REFLECTION = 1;
3586 JNI = 2;
3587 LINKING = 3;
3588 }
3589
3590 // Type of access.
3591 optional AccessMethod access_method = 3;
3592
3593 // Whether the access was prevented or not.
3594 optional bool access_denied = 4;
3595}
3596
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003597/**
3598 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3599 * - When user sees privacy chip
3600 * - When user clicks privacy chip
3601 * - How does the user exit the Privacy Dialog
3602 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003603 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3604 */
3605message PrivacyIndicatorsInteracted {
3606
3607 enum Type {
3608 UNKNOWN = 0;
3609 CHIP_VIEWED = 1;
3610 CHIP_CLICKED = 2;
3611 DIALOG_PRIVACY_SETTINGS = 3;
3612 DIALOG_DISMISS = 4;
3613 DIALOG_LINE_ITEM = 5;
3614 }
3615
3616 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3617
3618 // Used if the type is LINE_ITEM
3619 optional string package_name = 2;
3620}
3621
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003622/**
3623 * Logs information about a package that is moved from the internal to external storage and vice
3624 * versa.
3625 * It logs the package name, the type of the external storage where the package is installed
3626 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3627 * and the move type: if it's from internal to external or the other way around.
3628 *
3629 * Logged from:
3630 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3631 */
3632message AppMovedStorageReported {
3633 enum MoveType {
3634 UNKNOWN = 0;
3635 TO_EXTERNAL = 1;
3636 TO_INTERNAL = 2;
3637 }
3638 // The type of the external storage.
3639 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3640 // The type of move.
3641 optional MoveType move_type = 2;
3642 // The name of the package that was moved.
3643 optional string package_name = 3;
3644}
3645
jianjin8f2dee02019-03-29 14:03:08 -07003646/**
3647 * Logs when system server watchdog occurs.
3648 * Logged from:
3649 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3650 */
3651message SystemServerWatchdogOccurred {
3652 optional string subject = 1;
3653}
3654
3655/**
3656 * Logs when new file added to tombstones.
3657 * Logged from:
3658 * frameworks/base/core/java/com/android/server/BootReceiver.java
3659 */
3660message TombStoneOccurred {
3661}
3662
Hai Zhang5d3328d2019-04-13 21:25:06 +08003663/*
3664 * Information about a role request
3665 *
3666 * Logged from:
3667 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3668 */
3669message RoleRequestResultReported {
3670 // UID of application requesting the role
3671 optional int32 requesting_uid = 1;
3672
3673 // Package name of application requesting the role
3674 optional string requesting_package_name = 2;
3675
3676 // The role to be granted
3677 optional string role_name = 3;
3678
3679 // The count of applications qualifying for the role
3680 optional int32 qualifying_count = 4;
3681
3682 // UID of application current granted the role
3683 optional int32 current_uid = 5;
3684
3685 // Package name of application current granted the role
3686 optional string current_package_name = 6;
3687
3688 // UID of another application that user chose to grant the role to, instead of the requesting
3689 // application
3690 optional int32 granted_another_uid = 7;
3691
3692 // Package name of another application that user chose to grant the role to, instead of the
3693 // requesting application
3694 optional string granted_another_package_name = 8;
3695
3696 enum Result {
3697 UNDEFINED = 0;
3698 // role request was ignored
3699 IGNORED = 1;
3700 // role request was ignored because it's already granted
3701 IGNORED_ALREADY_GRANTED = 2;
3702 // role request was ignored because the application isn't qualified
3703 IGNORED_NOT_QUALIFIED = 3;
3704 // role request was ignored because user said it should be always denied
3705 IGNORED_USER_ALWAYS_DENIED = 4;
3706 // role was granted by user action
3707 USER_GRANTED = 5;
3708 // role was denied by user action
3709 USER_DENIED = 6;
3710 // role was denied by user granting another application the role
3711 USER_DENIED_GRANTED_ANOTHER = 7;
3712 // role was denied and set to be always denied by the user
3713 USER_DENIED_WITH_ALWAYS = 8;
3714 }
3715 // The result of the role request
3716 optional Result result = 9;
3717}
3718
Chenjie Yubbcbc602018-02-05 16:51:52 -08003719//////////////////////////////////////////////////////////////////////
3720// Pulled atoms below this line //
3721//////////////////////////////////////////////////////////////////////
3722
3723/**
David Chenc8a43242017-10-17 16:23:28 -07003724 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3725 *
3726 * Pulled from:
3727 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3728 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003729message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003730 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003731
3732 optional int64 rx_bytes = 2;
3733
3734 optional int64 rx_packets = 3;
3735
3736 optional int64 tx_bytes = 4;
3737
3738 optional int64 tx_packets = 5;
3739}
3740
3741/**
3742 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3743 *
3744 * Pulled from:
3745 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3746 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003747message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003748 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003749
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003750 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3751 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003752
3753 optional int64 rx_bytes = 3;
3754
3755 optional int64 rx_packets = 4;
3756
3757 optional int64 tx_bytes = 5;
3758
3759 optional int64 tx_packets = 6;
3760}
3761
3762/**
3763 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3764 *
3765 * Pulled from:
3766 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3767 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003768message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003769 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003770
3771 optional int64 rx_bytes = 2;
3772
3773 optional int64 rx_packets = 3;
3774
3775 optional int64 tx_bytes = 4;
3776
3777 optional int64 tx_packets = 5;
3778}
3779
3780/**
3781 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3782 *
3783 * Pulled from:
3784 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3785 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003786message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003787 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003788
Yao Chenc40a19d2018-03-15 16:48:25 -07003789 // 1 denotes foreground and 0 denotes background. This is called Set in
3790 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003791 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003792
3793 optional int64 rx_bytes = 3;
3794
3795 optional int64 rx_packets = 4;
3796
3797 optional int64 tx_bytes = 5;
3798
3799 optional int64 tx_packets = 6;
3800}
3801
3802/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003803 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3804 *
3805 * Pulled from:
3806 * StatsCompanionService
3807 */
3808message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003809 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003810
3811 optional int64 rx_bytes = 2;
3812
3813 optional int64 tx_bytes = 3;
3814}
3815
3816/**
David Chenc8a43242017-10-17 16:23:28 -07003817 * Pulls the kernel wakelock durations. This atom is adapted from
3818 * android/internal/os/KernelWakelockStats.java
3819 *
3820 * Pulled from:
3821 * StatsCompanionService using KernelWakelockReader.
3822 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003823message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003824 optional string name = 1;
3825
3826 optional int32 count = 2;
3827
3828 optional int32 version = 3;
3829
Yangster-maca8a30442018-10-13 23:46:34 -07003830 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003831}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003832
Chenjie Yu05013b32017-11-21 10:21:41 -08003833/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003834 * Pulls low power state information. If power.stats HAL is not available, this
3835 * includes platform and subsystem sleep state information,
3836 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3837 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003838 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003839 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003840 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3841 * as defined in:
3842 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003843 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003844message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003845 // Subsystem name
3846 optional string subsystem_name = 1;
3847 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3848 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003849 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3850 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003851 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003852 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003853 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003854 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003855 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003856}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003857
Chenjie Yu05013b32017-11-21 10:21:41 -08003858/**
Bookatz92da2832018-11-01 18:10:03 -07003859 * Pulls on-device power measurement information.
3860 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3861 * Pulled from:
3862 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3863 */
3864message OnDevicePowerMeasurement {
3865 // Name of the subsystem (to which the rail belongs).
3866 optional string subsystem_name = 1;
3867
3868 // Rail name. The rail lies within the subsystem.
3869 optional string rail_name = 2;
3870
3871 // Time (in ms since boot) at which the rail energy value was measured.
3872 // This may differ slightly from the time that statsd logs this information.
3873 optional uint64 measurement_timestamp_millis = 3;
3874
3875 // Accumulated energy used via the rail since device boot in uWs.
3876 optional uint64 energy_microwatt_secs = 4;
3877}
3878
3879/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003880 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003881 * Pulls the time the cpu spend on the frequency index. Frequency index
3882 * starts from highest to lowest. The value should be monotonically
3883 * increasing since boot. However, if there is a cpu
3884 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003885 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003886message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003887 optional uint32 cluster = 1;
3888 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003889 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003890}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003891
Chenjie Yu05013b32017-11-21 10:21:41 -08003892/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003893 * Pulls Cpu Time Per Uid.
3894 * Note that isolated process uid time should be attributed to host uids.
3895 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003896message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003897 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003898 optional uint64 user_time_micros = 2;
3899 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003900}
3901
3902/**
3903 * Pulls Cpu Time Per Uid per frequency.
3904 * Note that isolated process uid time should be attributed to host uids.
3905 * For each uid, we order the time by descending frequencies.
3906 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003907message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003908 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003909 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003910 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003911}
Hugo Benichi884970e2017-11-14 22:42:46 +09003912
Chenjie Yu05013b32017-11-21 10:21:41 -08003913/**
3914 * Pulls Wifi Controller Activity Energy Info
3915 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003916message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003917 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003918 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003919 // stack reported state
3920 // TODO: replace this with proto enum
3921 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003922 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003923 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003924 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003925 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003926 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003927 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003928 // product of current(mA), voltage(V) and time(ms)
3929 optional uint64 controller_energy_used = 6;
3930}
3931
3932/**
3933 * Pulls Modem Activity Energy Info
3934 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003935message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003936 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003937 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003938 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003939 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003940 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003941 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003942 /**
3943 * Tx power index
3944 * index 0 = tx_power < 0dBm
3945 * index 1 = 0dBm < tx_power < 5dBm
3946 * index 2 = 5dBm < tx_power < 15dBm
3947 * index 3 = 15dBm < tx_power < 20dBm
3948 * index 4 = tx_power > 20dBm
3949 */
3950 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003951 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003952 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003953 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003954 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003955 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003956 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003957 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003958 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003959 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003960 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003961 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003962 // product of current(mA), voltage(V) and time(ms)
Chen Xu96637812019-09-07 15:51:22 -07003963 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08003964}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003965
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003966/**
3967 * Pulls Bluetooth Activity Energy Info
3968 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3969 */
3970message BluetoothActivityInfo {
3971 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003972 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003973 // bluetooth stack state
3974 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003975 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003976 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003977 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003978 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003979 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003980 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003981 // product of current(mA), voltage(V) and time(ms)
3982 optional uint64 energy_used = 6;
3983}
3984
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003985/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003986 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003987 *
3988 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003989 */
3990message ProcessMemoryState {
3991 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003992 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003993
3994 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003995 // Usually package name, "system" for system server.
3996 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003997 optional string process_name = 2;
3998
Rafal Slawikda51b932018-12-13 16:31:33 +00003999 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004000 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004001
4002 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004003 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004004
4005 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004006 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004007
Rajeev Kumar90235992018-01-29 11:06:48 -08004008 // RSS
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004009 // Value is read from /proc/PID/status. Or from memory.stat, field
Rafal Slawikda51b932018-12-13 16:31:33 +00004010 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08004011 optional int64 rss_in_bytes = 6;
4012
4013 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004014 // Value is read from memory.stat, field total_cache if per-app memory
4015 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004016 optional int64 cache_in_bytes = 7;
4017
4018 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004019 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik44af3b32019-04-16 13:16:15 +01004020 // cgroups are enabled. Otherwise, VmSwap from /proc/PID/status.
Rajeev Kumar90235992018-01-29 11:06:48 -08004021 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004022
Rafal Slawikd03ae422018-11-20 11:27:45 +00004023 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004024 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004025
4026 // Elapsed real time when the process started.
4027 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
4028 optional int64 start_time_nanos = 10;
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004029
4030 // Anonymous page size plus swap size. Values are read from /proc/PID/status.
4031 optional int32 anon_rss_and_swap_in_kilobytes = 11;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004032}
4033
4034/*
Rafal Slawik08621582018-10-15 14:53:07 +01004035 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00004036 *
4037 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01004038 */
4039message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01004040 // The uid if available. -1 means not available.
4041 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004042
Rafal Slawikbf67d072018-10-23 11:07:54 +01004043 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004044 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01004045 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01004046
Rafal Slawikbf67d072018-10-23 11:07:54 +01004047 // # of page-faults
4048 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01004049
Rafal Slawikbf67d072018-10-23 11:07:54 +01004050 // # of major page-faults
4051 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01004052
Rafal Slawikbf67d072018-10-23 11:07:54 +01004053 // RSS
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004054 // Value read from /proc/PID/status.
Rafal Slawikbf67d072018-10-23 11:07:54 +01004055 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01004056
Rafal Slawikd03ae422018-11-20 11:27:45 +00004057 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004058 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01004059
4060 // Elapsed real time when the process started.
4061 // Value is read from /proc/PID/stat, field 22.
4062 optional int64 start_time_nanos = 7;
Rafal Slawik44af3b32019-04-16 13:16:15 +01004063
4064 // SWAP
4065 // Value read from /proc/PID/status, field VmSwap.
4066 optional int64 swap_in_bytes = 8;
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004067
4068 // Anonymous page size plus swap size. Values are read from /proc/PID/status.
4069 optional int32 anon_rss_and_swap_in_kilobytes = 9;
Rafal Slawik08621582018-10-15 14:53:07 +01004070}
4071
4072/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004073 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004074 *
4075 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4076 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004077 *
4078 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004079 */
4080message ProcessMemoryHighWaterMark {
4081 // The uid if available. -1 means not available.
4082 optional int32 uid = 1 [(is_uid) = true];
4083
Rafal Slawikda51b932018-12-13 16:31:33 +00004084 // The process name.
4085 // Usually package name or process cmdline.
4086 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004087 optional string process_name = 2;
4088
4089 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4090 // /proc/PID/status.
4091 optional int64 rss_high_water_mark_in_bytes = 3;
4092}
4093
4094/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004095 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004096 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004097message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004098 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004099}
4100
4101/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004102 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004103 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004104message SystemUptime {
4105 // Milliseconds since the system was booted.
4106 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4107 // for external input).
4108 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004109 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004110}
4111
4112/*
4113 * Reads from /proc/uid_concurrent_active_time which has the format:
4114 * active: X (X is # cores)
4115 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4116 * [uid1]: [time-0] [time-1] [time-2] ... ...
4117 * ...
4118 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4119 * The file contains a monotonically increasing count of time for a single boot.
4120 */
4121message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004122 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004123 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004124}
4125
4126/**
4127 * Reads from /proc/uid_concurrent_policy_time which has the format:
4128 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4129 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4130 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4131 * ...
4132 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4133 * The file contains a monotonically increasing count of time for a single boot.
4134 */
4135message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004136 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004137 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004138 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004139}
4140
4141/*
4142 * Pulls free disk space, for data, system partition and temporary directory.
4143 */
4144message DiskSpace {
4145 // available bytes in data partition
4146 optional uint64 data_available_bytes = 1;
4147 // available bytes in system partition
4148 optional uint64 system_available_bytes = 2;
4149 // available bytes in download cache or temp directories
4150 optional uint64 temp_available_bytes = 3;
4151}
Tej Singhbf972d92018-01-10 20:51:13 -08004152
4153/**
4154 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004155 *
4156 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004157 */
4158message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004159 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004160}
4161
4162/**
4163 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004164 * Pulled from:
4165 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004166 */
4167message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004168 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004169}
4170
4171/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004172 * Pulls battery voltage.
4173 * Pulled from:
4174 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4175 */
4176message BatteryVoltage {
4177 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004178 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004179}
4180
4181/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004182 * Pulls battery level (percent full, from 0 to 100).
4183 *
4184 * Pulled from:
4185 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4186 */
4187message BatteryLevel {
4188 // Battery level. Should be in [0, 100].
4189 optional int32 battery_level = 1;
4190}
4191
4192/**
Tej Singhd89137e2018-03-26 14:51:40 -07004193 * Pulls the temperature of various parts of the device.
4194 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004195 *
Maggie White442b6312019-04-05 16:26:44 -07004196 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004197 */
4198message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004199 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004200 optional android.os.TemperatureTypeEnum sensor_location = 1;
4201
4202 // The name of the temperature source. Eg. CPU0
4203 optional string sensor_name = 2;
4204
Tej Singhd89137e2018-03-26 14:51:40 -07004205 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004206 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004207 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004208
4209 // Relative severity of the throttling, see enum definition.
4210 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004211}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004212
4213/**
4214 * Pulls the statistics of calls to Binder.
4215 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004216 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4217 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004218 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004219 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004220 */
4221message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004222 // UID of the process responsible for the binder transaction. It will be set if the process
4223 // executing the binder transaction attribute the transaction to another uid using
4224 // Binder.setThreadWorkSource().
4225 //
4226 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004227 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004228 // UID of the process executing the binder transaction.
4229 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004230 // Fully qualified class name of the API call.
4231 //
4232 // This is a system server class name.
4233 //
4234 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4235 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4236 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4237 // commonly used APIs.
4238 optional string service_class_name = 2;
4239 // Method name of the API call. It can also be a transaction code if we cannot
4240 // resolve it to a name. See Binder#getTransactionName.
4241 //
4242 // This is a system server method name.
4243 optional string service_method_name = 3;
4244 // Total number of API calls.
4245 optional int64 call_count = 4;
4246 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4247 optional bool screen_interactive = 13;
4248 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4249 // call_count will be equal to recorded_call_count.
4250 //
4251 // If recorded_call_count is different than call_count, it means data collection has been
4252 // sampled. All the fields below will be sampled in this case.
4253 optional int64 recorded_call_count = 12;
4254 // Number of exceptions thrown by the API.
4255 optional int64 recorded_exception_count = 5;
4256 // Total latency of all API calls.
4257 // Average can be computed using total_latency_micros / recorded_call_count.
4258 optional int64 recorded_total_latency_micros = 6;
4259 // Maximum latency of one API call.
4260 optional int64 recorded_max_latency_micros = 7;
4261 // Total CPU usage of all API calls.
4262 // Average can be computed using total_cpu_micros / recorded_call_count.
4263 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4264 optional int64 recorded_total_cpu_micros = 8;
4265 // Maximum CPU usage of one API call.
4266 optional int64 recorded_max_cpu_micros = 9;
4267 // Maximum parcel reply size of one API call.
4268 optional int64 recorded_max_reply_size_bytes = 10;
4269 // Maximum parcel request size of one API call.
4270 optional int64 recorded_max_request_size_bytes = 11;
4271}
4272
4273/**
4274 * Pulls the statistics of exceptions during calls to Binder.
4275 *
4276 * Binder stats are cumulative from boot unless somebody reset the data using
4277 * > adb shell dumpsys binder_calls_stats --reset
4278 */
4279message BinderCallsExceptions {
4280 // Exception class name, e.g. java.lang.IllegalArgumentException.
4281 //
4282 // This is an exception class name thrown by the system server.
4283 optional string exception_class_name = 1;
4284 // Total number of exceptions.
4285 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004286}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004287
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004288/**
4289 * Pulls the statistics of message dispatching on HandlerThreads.
4290 *
4291 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4292 * config on the device.
4293 *
4294 * Next tag: 11
4295 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004296message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004297 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004298 optional int32 uid = 1 [(is_uid) = true];
4299
4300 // Fully qualified class name of the handler target class.
4301 //
4302 // This field does not contain PII. This is a system server class name.
4303 optional string handler_class_name = 2;
4304
4305 // The name of the thread that runs the Looper.
4306 //
4307 // This field does not contain PII. This is a system server thread name.
4308 optional string looper_thread_name = 3;
4309
4310 // The name of the dispatched message.
4311 //
4312 // This field does not contain PII. This is a system server constant or class
4313 // name.
4314 optional string message_name = 4;
4315
4316 // Total number of successfully dispatched messages.
4317 optional int64 message_count = 5;
4318
4319 // Total number of messages that failed dispatching.
4320 optional int64 exception_count = 6;
4321
4322 // Total number of processed messages we have data recorded for. If we
4323 // collected data for all the messages, message_count will be equal to
4324 // recorded_message_count.
4325 //
4326 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004327 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004328 optional int64 recorded_message_count = 7;
4329
4330 // Total latency of all processed messages.
4331 // Average can be computed using recorded_total_latency_micros /
4332 // recorded_message_count.
4333 optional int64 recorded_total_latency_micros = 8;
4334
4335 // Total CPU usage of all processed message.
4336 // Average can be computed using recorded_total_cpu_micros /
4337 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004338 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004339 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004340
4341 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4342 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004343
4344 // Max recorded CPU usage of all processed messages.
4345 optional int64 recorded_max_cpu_micros = 11;
4346
4347 // Max recorded latency of all processed messages.
4348 optional int64 recorded_max_latency_micros = 12;
4349
4350 // Total number of messages we tracked the dispatching delay for. If we
4351 // collected data for all the messages, message_count will be equal to
4352 // recorded_delay_message_count.
4353 //
4354 // If recorded_delay_message_count is different than message_count, it means data
4355 // collection has been sampled or/and not all messages specified the target dispatch time.
4356 // The fields below will be sampled in this case.
4357 optional int64 recorded_delay_message_count = 13;
4358
4359 // Total dispatching delay of all processed messages.
4360 // Calculated as a difference between the target dispatching time (Message.when)
4361 // and the actual dispatching time.
4362 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4363 optional int64 recorded_total_delay_millis = 14;
4364
4365 // Max dispatching delay of all processed messages.
4366 // Calculated as a difference between the target dispatching time (Message.when)
4367 // and the actual dispatching time.
4368 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004369}
Tej Singh86dc9db2018-09-06 00:39:57 +00004370
4371/**
4372 * Pulls disk information, such as write speed and latency.
4373 */
4374message DiskStats {
4375 // Time taken to open, write 512B to, and close a file.
4376 // -1 if error performing the check.
4377 optional int64 data_write_latency_millis = 1;
4378
4379 optional bool file_based_encryption = 2;
4380
4381 // Recent disk write speed in kB/s.
4382 // -1 if error querying storageed.
4383 // 0 if data is unavailable.
4384 optional int32 recent_disk_write_speed = 3;
4385}
4386
4387
4388/**
4389 * Free and total bytes of the Data, Cache, and System partition.
4390 */
4391message DirectoryUsage {
4392 enum Directory {
4393 UNKNOWN = 0;
4394 DATA = 1;
4395 CACHE = 2;
4396 SYSTEM = 3;
4397 }
4398 optional Directory directory = 1;
4399 optional int64 free_bytes = 2;
4400 optional int64 total_bytes = 3;
4401}
4402
4403
4404/**
4405 * Size of an application: apk size, data size, and cache size.
4406 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4407 * Information is only reported for apps with the primary user (user 0).
4408 * Sizes are aggregated by package name.
4409 */
4410message AppSize {
4411 // Including uids will involve modifying diskstats logic.
4412 optional string package_name = 1;
4413 // App size in bytes. -1 if unavailable.
4414 optional int64 app_size_bytes = 2;
4415 // App data size in bytes. -1 if unavailable.
4416 optional int64 app_data_size_bytes = 3;
4417 // App cache size in bytes. -1 if unavailable.
4418 optional int64 app_cache_size_bytes = 4;
4419 // Time that the cache file was produced.
4420 // Uses System.currentTimeMillis(), which is wall clock time.
4421 optional int64 cache_time_millis = 5;
4422}
4423
4424
4425/**
4426 * Size of a particular category. Eg: photos, videos.
4427 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4428 */
4429message CategorySize {
4430 enum Category {
4431 UNKNOWN = 0;
4432 APP_SIZE = 1;
4433 APP_DATA_SIZE = 2;
4434 APP_CACHE_SIZE = 3;
4435 PHOTOS = 4;
4436 VIDEOS = 5;
4437 AUDIO = 6;
4438 DOWNLOADS = 7;
4439 SYSTEM = 8;
4440 OTHER = 9;
4441 }
4442 optional Category category = 1;
4443 // Category size in bytes.
4444 optional int64 size_bytes = 2;
4445 // Time that the cache file was produced.
4446 // Uses System.currentTimeMillis(), which is wall clock time.
4447 optional int64 cache_time_millis = 3;
4448}
Tej Singhd6d6d772018-09-05 17:41:25 -07004449
4450/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004451 * Pulls per uid I/O stats. The stats are cumulative since boot.
4452 *
4453 * Read/write bytes are I/O events from a storage device
4454 * Read/write chars are data requested by read/write syscalls, and can be
4455 * satisfied by caching.
4456 *
4457 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4458 */
4459message DiskIo {
4460 optional int32 uid = 1 [(is_uid) = true];
4461 optional int64 fg_chars_read = 2;
4462 optional int64 fg_chars_write = 3;
4463 optional int64 fg_bytes_read = 4;
4464 optional int64 fg_bytes_write = 5;
4465 optional int64 bg_chars_read = 6;
4466 optional int64 bg_chars_write = 7;
4467 optional int64 bg_bytes_read = 8;
4468 optional int64 bg_bytes_write = 9;
4469 optional int64 fg_fsync = 10;
4470 optional int64 bg_fsync= 11;
4471}
4472
4473
4474/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004475 * Pulls the number of fingerprints for each user.
4476 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004477 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004478 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004479message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004480 // The associated user. Eg: 0 for owners, 10+ for others.
4481 // Defined in android/os/UserHandle.java
4482 optional int32 user = 1;
4483 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004484 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004485}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004486
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004487/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004488 * Pulls the number of faces for each user.
4489 *
4490 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4491 */
4492message NumFacesEnrolled {
4493 // The associated user. Eg: 0 for owners, 10+ for others.
4494 // Defined in android/os/UserHandle.java
4495 optional int32 user = 1;
4496 // Number of faces registered to that user.
4497 optional int32 num_faces_enrolled = 2;
4498}
4499/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004500 * A mapping of role holder -> role
4501 */
4502message RoleHolder {
4503 // uid of the role holder
4504 optional int32 uid = 1 [(is_uid) = true];
4505
4506 // package name of the role holder
4507 optional string package_name = 2;
4508
4509 // the role held
4510 optional string role = 3;
4511}
4512
Yangsteraf9aee72018-10-12 09:26:16 -07004513message AggStats {
4514 optional int64 min = 1;
4515
4516 optional int64 average = 2;
4517
4518 optional int64 max = 3;
4519}
4520
4521message ProcessStatsStateProto {
4522 optional android.service.procstats.ScreenState screen_state = 1;
4523
4524 optional android.service.procstats.MemoryState memory_state = 2;
4525
4526 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4527 // and not frameworks/base/core/java/android/app/ActivityManager.java
4528 optional android.service.procstats.ProcessState process_state = 3;
4529
4530 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004531 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004532
4533 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004534 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004535
4536 // # of samples taken
4537 optional int32 sample_size = 5;
4538
4539 // PSS is memory reserved for this process
4540 optional AggStats pss = 6;
4541
4542 // USS is memory shared between processes, divided evenly for accounting
4543 optional AggStats uss = 7;
4544
4545 // RSS is memory resident for this process
4546 optional AggStats rss = 8;
4547}
4548
4549// Next Tag: 7
4550message ProcessStatsProto {
4551 // Name of process.
4552 optional string process = 1;
4553
4554 // Uid of the process.
4555 optional int32 uid = 2;
4556
4557 // Information about how often kills occurred
4558 message Kill {
4559 // Count of excessive CPU kills
4560 optional int32 cpu = 1;
4561
4562 // Count of kills when cached
4563 optional int32 cached = 2;
4564
4565 // PSS stats during cached kill
4566 optional AggStats cached_pss = 3;
4567 }
4568 optional Kill kill = 3;
4569
4570 // Time and memory spent in various states.
4571 repeated ProcessStatsStateProto states = 5;
4572
4573 // Total time process has been running... screen_state, memory_state, and process_state
4574 // will not be set.
4575 optional ProcessStatsStateProto total_running_state = 6;
4576}
4577
4578message PackageServiceOperationStatsProto {
4579 // Operate enum: Started, Foreground, Bound, Executing
4580 optional android.service.procstats.ServiceOperationState operation = 1;
4581
4582 // Number of times the service was in this operation.
4583 optional int32 count = 2;
4584
4585 // Information about a state the service can be in.
4586 message StateStats {
4587 // Screen state enum.
4588 optional android.service.procstats.ScreenState screen_state = 1;
4589 // Memory state enum.
4590 optional android.service.procstats.MemoryState memory_state = 2;
4591
4592 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004593 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004594 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004595 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004596 }
4597 repeated StateStats state_stats = 3;
4598}
4599
4600message PackageServiceStatsProto {
4601 // Name of service component.
4602 optional string service_name = 1;
4603
4604 // The operation stats.
4605 // The package_name, package_uid, package_version, service_name will not be set to save space.
4606 repeated PackageServiceOperationStatsProto operation_stats = 2;
4607}
4608
4609message PackageAssociationSourceProcessStatsProto {
4610 // Uid of the process.
4611 optional int32 process_uid = 1;
4612 // Process name.
4613 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004614 // Package name.
4615 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004616 // Total count of the times this association appeared.
4617 optional int32 total_count = 3;
4618
4619 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004620 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004621
4622 // Total count of the times this association became actively impacting its target process.
4623 optional int32 active_count = 5;
4624
4625 // Information on one source in this association.
4626 message StateStats {
4627 // Process state enum.
4628 optional android.service.procstats.ProcessState process_state = 1;
4629 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004630 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004631 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004632 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004633 }
4634 repeated StateStats active_state_stats = 6;
4635}
4636
4637message PackageAssociationProcessStatsProto {
4638 // Name of the target component.
4639 optional string component_name = 1;
4640 // Information on one source in this association.
4641 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4642}
4643
4644
4645message ProcessStatsPackageProto {
4646 // Name of package.
4647 optional string package = 1;
4648
4649 // Uid of the package.
4650 optional int32 uid = 2;
4651
4652 // Version of the package.
4653 optional int64 version = 3;
4654
4655 // Stats for each process running with the package loaded in to it.
4656 repeated ProcessStatsProto process_stats = 4;
4657
4658 // Stats for each of the package's services.
4659 repeated PackageServiceStatsProto service_stats = 5;
4660
4661 // Stats for each association with the package.
4662 repeated PackageAssociationProcessStatsProto association_stats = 6;
4663}
4664
4665message ProcessStatsSectionProto {
4666 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004667 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004668
4669 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004670 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004671
4672 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004673 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004674
4675 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004676 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004677
4678 // System runtime library. e.g. "libdvm.so", "libart.so".
4679 optional string runtime = 5;
4680
4681 // whether kernel reports swapped pss.
4682 optional bool has_swapped_pss = 6;
4683
4684 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4685 enum Status {
4686 STATUS_UNKNOWN = 0;
4687 STATUS_COMPLETE = 1;
4688 STATUS_PARTIAL = 2;
4689 STATUS_SHUTDOWN = 3;
4690 STATUS_SYSPROPS = 4;
4691 }
4692 repeated Status status = 7;
4693
Chenjie Yub2ecc792019-01-17 10:27:26 -08004694 // Number of pages available of various types and sizes, representation fragmentation.
4695 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4696
Yangsteraf9aee72018-10-12 09:26:16 -07004697 // Stats for each process.
4698 repeated ProcessStatsProto process_stats = 8;
4699
4700 // Stats for each package.
4701 repeated ProcessStatsPackageProto package_stats = 9;
4702}
4703
Chenjie Yub2ecc792019-01-17 10:27:26 -08004704message ProcessStatsAvailablePagesProto {
4705 // Node these pages are in (as per /proc/pagetypeinfo)
4706 optional int32 node = 1;
4707
4708 // Zone these pages are in (as per /proc/pagetypeinfo)
4709 optional string zone = 2;
4710
4711 // Label for the type of these pages (as per /proc/pagetypeinfo)
4712 optional string label = 3;
4713
4714 // Distribution of number of pages available by order size. First entry in array is
4715 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4716 repeated int32 pages_per_order = 4;
4717}
4718
Chenjie Yu12e5e672018-09-14 15:54:59 -07004719/**
4720 * Pulled from ProcessStatsService.java
4721 */
4722message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004723 optional ProcessStatsSectionProto proc_stats_section = 1;
4724}
4725
Chenjie Yuf910b7802019-01-11 16:08:20 -08004726/**
4727 * Pulled from ProcessStatsService.java
4728 */
4729message ProcStatsPkgProc {
4730 optional ProcessStatsSectionProto proc_stats_section = 1;
4731}
4732
Yangsteraf9aee72018-10-12 09:26:16 -07004733message PowerProfileProto {
4734 optional double cpu_suspend = 1;
4735
4736 optional double cpu_idle = 2;
4737
4738 optional double cpu_active = 3;
4739
4740 message CpuCluster {
4741 optional int32 id = 1;
4742 optional double cluster_power = 2;
4743 optional int32 cores = 3;
4744 repeated int64 speed = 4;
4745 repeated double core_power = 5;
4746 }
4747
4748 repeated CpuCluster cpu_cluster = 40;
4749
4750 optional double wifi_scan = 4;
4751
4752 optional double wifi_on = 5;
4753
4754 optional double wifi_active = 6;
4755
4756 optional double wifi_controller_idle = 7;
4757
4758 optional double wifi_controller_rx = 8;
4759
4760 optional double wifi_controller_tx = 9;
4761
4762 repeated double wifi_controller_tx_levels = 10;
4763
4764 optional double wifi_controller_operating_voltage = 11;
4765
4766 optional double bluetooth_controller_idle = 12;
4767
4768 optional double bluetooth_controller_rx = 13;
4769
4770 optional double bluetooth_controller_tx = 14;
4771
4772 optional double bluetooth_controller_operating_voltage = 15;
4773
4774 optional double modem_controller_sleep = 16;
4775
4776 optional double modem_controller_idle = 17;
4777
4778 optional double modem_controller_rx = 18;
4779
4780 repeated double modem_controller_tx = 19;
4781
4782 optional double modem_controller_operating_voltage = 20;
4783
4784 optional double gps_on = 21;
4785
4786 repeated double gps_signal_quality_based = 22;
4787
4788 optional double gps_operating_voltage = 23;
4789
4790 optional double bluetooth_on = 24;
4791
4792 optional double bluetooth_active = 25;
4793
4794 optional double bluetooth_at_cmd = 26;
4795
4796 optional double ambient_display = 27;
4797
4798 optional double screen_on = 28;
4799
4800 optional double radio_on = 29;
4801
4802 optional double radio_scanning = 30;
4803
4804 optional double radio_active = 31;
4805
4806 optional double screen_full = 32;
4807
4808 optional double audio = 33;
4809
4810 optional double video = 34;
4811
4812 optional double flashlight = 35;
4813
4814 optional double memory = 36;
4815
4816 optional double camera = 37;
4817
4818 optional double wifi_batched_scan = 38;
4819
4820 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004821}
Chenjie Yuab530202018-09-26 12:39:20 -07004822
4823/**
4824 * power_profile.xml and other constants for power model calculations.
4825 * Pulled from PowerProfile.java
4826 */
4827message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004828 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004829}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004830
4831/**
arangelovd5db50e2018-10-12 20:24:39 +01004832 * Logs when a user restriction was added or removed.
4833 *
4834 * Logged from:
4835 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4836 */
4837message UserRestrictionChanged {
4838 // The raw string of the user restriction as defined in UserManager.
4839 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4840 optional string restriction = 1;
4841 // Whether the restriction is enabled or disabled.
4842 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004843}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004844
4845/**
4846 * Pulls process user time and system time. Puller takes a snapshot of all pids
4847 * in the system and returns cpu stats for those that are working at the time.
4848 * Dead pids will be dropped. Kernel processes are excluded.
4849 * Min cool-down is 5 sec.
4850 */
4851message ProcessCpuTime {
4852 optional int32 uid = 1 [(is_uid) = true];
4853
4854 optional string process_name = 2;
4855 // Process cpu time in user space, cumulative from boot/process start
4856 optional int64 user_time_millis = 3;
4857 // Process cpu time in system space, cumulative from boot/process start
4858 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004859}
Misha Wagner5a51e002018-10-03 15:04:09 +01004860
4861/**
4862 * Pulls the CPU usage for each thread.
4863 *
4864 * Read from /proc/$PID/task/$TID/time_in_state files.
4865 *
4866 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4867 * time_in_state files not being present on some phones, have not been addressed. These should be
4868 * considered before a public release.
4869 */
4870message CpuTimePerThreadFreq {
4871 // UID that owns the process.
4872 optional int32 uid = 1 [(is_uid) = true];
4873 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004874 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004875 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004876 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004877 // Name of the process taken from `/proc/$PID/cmdline`.
4878 optional string process_name = 4;
4879 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4880 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004881
4882 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4883 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4884 // frequencies are given here as the alternative is sending eight separate atoms. This method
4885 // significantly reduces the amount of data created
4886 optional int32 frequency1_khz = 6;
4887 optional int32 time1_millis = 7;
4888 optional int32 frequency2_khz = 8;
4889 optional int32 time2_millis = 9;
4890 optional int32 frequency3_khz = 10;
4891 optional int32 time3_millis = 11;
4892 optional int32 frequency4_khz = 12;
4893 optional int32 time4_millis = 13;
4894 optional int32 frequency5_khz = 14;
4895 optional int32 time5_millis = 15;
4896 optional int32 frequency6_khz = 16;
4897 optional int32 time6_millis = 17;
4898 optional int32 frequency7_khz = 18;
4899 optional int32 time7_millis = 19;
4900 optional int32 frequency8_khz = 20;
4901 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004902}
Bookatz75ee60422018-11-09 12:27:37 -08004903
4904/**
Bookatz366a4432018-11-20 09:42:33 -08004905 * Pulls information about the device's build.
4906 */
4907message BuildInformation {
4908 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4909 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4910 optional string fingerprint = 1;
4911
4912 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4913 optional string brand = 2;
4914
4915 // Build.PRODUCT. The name of the overall product.
4916 optional string product = 3;
4917
4918 // Build.DEVICE. The name of the industrial design.
4919 optional string device = 4;
4920
4921 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4922 optional string version_release = 5;
4923
4924 // Build.ID. E.g. a label like "M4-rc20".
4925 optional string id = 6;
4926
4927 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4928 // represent this build.
4929 optional string version_incremental = 7;
4930
4931 // Build.TYPE. The type of build, like "user" or "eng".
4932 optional string type = 8;
4933
4934 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4935 optional string tags = 9;
4936}
4937
4938/**
Adam Heff2185342019-01-23 15:59:09 -08004939 * Logs information about mismatched caller for content capture.
4940 *
4941 * Logged from:
4942 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
4943 */
4944message ContentCaptureCallerMismatchReported {
4945 optional string intended_package = 1;
4946 optional string calling_package = 2;
4947}
4948
4949/**
4950 * Logs information about content capture service events.
4951 *
4952 * Logged from:
4953 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4954 */
4955message ContentCaptureServiceEvents {
4956 // The type of event.
4957 enum Event {
4958 UNKNOWN = 0;
4959 ON_CONNECTED = 1;
4960 ON_DISCONNECTED = 2;
4961 SET_WHITELIST = 3;
4962 SET_DISABLED = 4;
4963 ON_USER_DATA_REMOVED = 5;
4964 }
4965 optional Event event = 1;
4966 // component/package of content capture service.
4967 optional string service_info = 2;
4968 // component/package of target.
4969 // it's a concatenated list of component/package for SET_WHITELIST event
4970 // separated by " ".
4971 optional string target_info = 3;
4972}
4973
4974/**
4975 * Logs information about content capture session events.
4976 *
4977 * Logged from:
4978 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4979 */
4980message ContentCaptureSessionEvents {
4981 // The type of event.
4982 enum Event {
4983 UNKNOWN = 0;
4984 ON_SESSION_STARTED = 1;
4985 ON_SESSION_FINISHED = 2;
4986 SESSION_NOT_CREATED = 3;
4987 }
4988 optional int32 session_id = 1;
4989 optional Event event = 2;
4990 // (n/a on session finished)
4991 optional int32 state_flags = 3;
4992 // component/package of content capture service.
4993 optional string service_info = 4;
4994 // component/package of app.
4995 // (n/a on session finished)
4996 optional string app_info = 5;
4997 optional bool is_child_session = 6;
4998}
4999
5000/**
5001 * Logs information about session being flushed.
5002 *
5003 * Logged from:
5004 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5005 */
5006message ContentCaptureFlushed {
5007 optional int32 session_id = 1;
5008 // component/package of content capture service.
5009 optional string service_info = 2;
5010 // component/package of app.
5011 optional string app_info = 3;
5012 // session start/finish events
5013 optional int32 child_session_started = 4;
5014 optional int32 child_session_finished = 5;
5015 // count of view events.
5016 optional int32 view_appeared_count = 6;
5017 optional int32 view_disappeared_count = 7;
5018 optional int32 view_text_changed_count = 8;
5019
5020 // Flush stats.
5021 optional int32 max_events = 9;
5022 optional int32 idle_flush_freq = 10;
5023 optional int32 text_flush_freq = 11;
5024 optional int32 flush_reason = 12;
5025}
5026
5027/**
Bookatz75ee60422018-11-09 12:27:37 -08005028 * Pulls on-device BatteryStats power use calculations for the overall device.
5029 */
5030message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005031 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5032 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5033 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5034 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005035}
5036
5037/**
5038 * Pulls on-device BatteryStats power use calculations broken down by uid.
5039 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5040 * that is attributed to non-uid items. They must all be included to get the total power use.
5041 */
5042message DeviceCalculatedPowerBlameUid {
5043 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5044 optional int32 uid = 1 [(is_uid) = true];
5045
Bookatz3dbc13a2018-12-21 12:16:51 -08005046 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5047 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5048 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005049}
5050
5051/**
5052 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5053 * drain type.
5054 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5055 * is attributed uids. They must all be included to get the total power use.
5056 */
5057message DeviceCalculatedPowerBlameOther {
5058 // The type of item whose power use is being reported.
5059 enum DrainType {
5060 AMBIENT_DISPLAY = 0;
5061 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5062 BLUETOOTH = 2;
5063 CAMERA = 3;
5064 // Cell-standby
5065 CELL = 4;
5066 FLASHLIGHT = 5;
5067 IDLE = 6;
5068 MEMORY = 7;
5069 // Amount that total computed drain exceeded the drain estimated using the
5070 // battery level changes and capacity.
5071 OVERCOUNTED = 8;
5072 PHONE = 9;
5073 SCREEN = 10;
5074 // Amount that total computed drain was below the drain estimated using the
5075 // battery level changes and capacity.
5076 UNACCOUNTED = 11;
5077 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5078 WIFI = 13;
5079 }
5080 optional DrainType drain_type = 1;
5081
Bookatz3dbc13a2018-12-21 12:16:51 -08005082 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5083 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5084 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005085}
arangelov4e994062018-11-13 16:12:38 +00005086
5087/**
5088 * Logs device policy features.
5089 *
5090 * Logged from:
5091 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5092 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5093 */
5094message DevicePolicyEvent {
5095 // The event id - unique for each event.
5096 optional android.stats.devicepolicy.EventId event_id = 1;
5097 // The admin package name.
5098 optional string admin_package_name = 2;
5099 // A generic integer parameter.
5100 optional int32 integer_value = 3;
5101 // A generic boolean parameter.
5102 optional bool boolean_value = 4;
5103 // A parameter specifying a time period in milliseconds.
5104 optional uint64 time_period_millis = 5;
5105 // A parameter specifying a list of package names, bundle extras or string parameters.
5106 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5107}
shawnlinea5b66b2018-11-13 15:05:29 +08005108
5109/**
5110 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5111 *
5112 * Logged from:
5113 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5114 */
5115message DocsUILaunchReported {
5116 optional android.stats.docsui.LaunchAction launch_action = 1;
5117 optional bool has_initial_uri = 2;
5118 optional android.stats.docsui.MimeType mime_type = 3;
5119 optional android.stats.docsui.Root initial_root = 4;
5120}
5121
5122/**
5123 * Logs root/app visited event in file managers/picker. Call this when the user
5124 * taps on root/app in hamburger menu.
5125 *
5126 * Logged from:
5127 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5128 */
5129message DocsUIRootVisitedReported {
5130 optional android.stats.docsui.ContextScope scope = 1;
5131 optional android.stats.docsui.Root root = 2;
5132}
5133
5134/**
5135 * Logs file operation stats. Call this when a file operation has completed.
5136 *
5137 * Logged from:
5138 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5139 */
5140message DocsUIFileOperationReported {
5141 optional android.stats.docsui.Provider provider = 1;
5142 optional android.stats.docsui.FileOperation file_op = 2;
5143}
5144
5145/**
5146 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5147 * mode.
5148 *
5149 * Logged from:
5150 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5151 */
5152message DocsUIFileOperationCopyMoveModeReported {
5153 optional android.stats.docsui.FileOperation file_op = 1;
5154 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5155}
5156
5157
5158/**
5159 * Logs file sub operation stats. Call this when a file operation has failed.
5160 *
5161 * Logged from:
5162 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5163 */
5164message DocsUIFileOperationFailureReported {
5165 optional android.stats.docsui.Authority authority = 1;
5166 optional android.stats.docsui.SubFileOperation sub_op = 2;
5167}
5168
5169/**
5170* Logs the cancellation of a file operation. Call this when a job is canceled
5171*
5172* Logged from:
5173* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5174*/
5175message DocsUIFileOperationCanceledReported {
5176 optional android.stats.docsui.FileOperation file_op = 1;
5177}
5178
5179/**
5180 * Logs startup time in milliseconds.
5181 *
5182 * Logged from:
5183 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5184 */
5185message DocsUIStartupMsReported {
5186 optional int32 startup_millis = 1;
5187}
5188
5189/**
5190 * Logs the action that was started by user.
5191 *
5192 * Logged from:
5193 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5194 */
5195message DocsUIUserActionReported {
5196 optional android.stats.docsui.UserAction action = 1;
5197}
5198
5199/**
5200 * Logs the invalid type when invalid scoped access is requested.
5201 *
5202 * Logged from:
5203 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5204 */
5205message DocsUIInvalidScopedAccessRequestReported {
5206 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005207}
Ben Murdochbab399f2018-12-06 11:01:38 +00005208
5209/**
shawnlina75e82d2019-01-07 10:31:12 +08005210 * Logs the package name that launches docsui picker mode.
5211 *
5212 * Logged from:
5213 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5214 */
5215message DocsUIPickerLaunchedFromReported {
5216 optional string package_name = 1;
5217}
5218
5219/**
5220 * Logs the search type.
5221 *
5222 * Logged from:
5223 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5224 */
5225message DocsUISearchTypeReported {
5226 optional android.stats.docsui.SearchType search_type = 1;
5227}
5228
5229/**
5230 * Logs the search mode.
5231 *
5232 * Logged from:
5233 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5234 */
5235message DocsUISearchModeReported {
5236 optional android.stats.docsui.SearchMode search_mode = 1;
5237}
5238
5239/**
5240 * Logs the pick result information.
5241 *
5242 * Logged from:
5243 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5244 */
5245message DocsUIPickResultReported {
5246 optional int32 total_action_count = 1;
5247 optional int64 duration_millis = 2;
5248 optional int32 file_count= 3;
5249 optional bool is_searching = 4;
5250 optional android.stats.docsui.Root picked_from = 5;
5251 optional android.stats.docsui.MimeType mime_type = 6;
5252 optional int32 repeatedly_pick_times = 7;
5253}
5254
5255/**
Ben Murdochbab399f2018-12-06 11:01:38 +00005256 * Logs when an app's memory is compacted.
5257 *
5258 * Logged from:
5259 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5260 */
5261message AppCompacted {
5262 // The pid of the process being compacted.
5263 optional int32 pid = 1;
5264
5265 // The name of the process being compacted.
5266 optional string process_name = 2;
5267
5268 // The type of compaction.
5269 enum Action {
5270 UNKNOWN = 0;
5271 SOME = 1;
5272 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005273 PERSISTENT = 3;
5274 BFGS = 4;
Ben Murdochbab399f2018-12-06 11:01:38 +00005275 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005276 optional Action action = 3;
Ben Murdochbab399f2018-12-06 11:01:38 +00005277
5278 // Total RSS in kilobytes consumed by the process prior to compaction.
5279 optional int64 before_rss_total_kilobytes = 4;
5280
5281 // File RSS in kilobytes consumed by the process prior to compaction.
5282 optional int64 before_rss_file_kilobytes = 5;
5283
5284 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5285 optional int64 before_rss_anon_kilobytes = 6;
5286
5287 // Swap in kilobytes consumed by the process prior to compaction.
5288 optional int64 before_swap_kilobytes = 7;
5289
5290 // Total RSS in kilobytes consumed by the process after compaction.
5291 optional int64 after_rss_total_kilobytes = 8;
5292
5293 // File RSS in kilobytes consumed by the process after compaction.
5294 optional int64 after_rss_file_kilobytes = 9;
5295
5296 // Anonymous RSS in kilobytes consumed by the process after compaction.
5297 optional int64 after_rss_anon_kilobytes = 10;
5298
5299 // Swap in kilobytes consumed by the process after compaction.
5300 optional int64 after_swap_kilobytes = 11;
5301
5302 // The time taken to perform compaction in milliseconds.
5303 optional int64 time_to_compact_millis = 12;
5304
5305 // The last compaction action performed for this app.
5306 optional Action last_action = 13;
5307
Ben Murdoch01720b82018-12-19 18:03:44 +00005308 // The last time that compaction was attempted on this process in milliseconds
5309 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5310 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f2018-12-06 11:01:38 +00005311
Ben Murdoch885c21b2019-03-15 18:02:04 +00005312 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005313 optional int32 oom_score_adj = 15;
Ben Murdochbab399f2018-12-06 11:01:38 +00005314
5315 // The process state at the time of compaction.
5316 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005317
5318 // Free ZRAM in kilobytes before compaction.
5319 optional int64 before_zram_free_kilobytes = 17;
5320
5321 // Free ZRAM in kilobytes after compaction.
5322 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f2018-12-06 11:01:38 +00005323}
lifr157fc552018-12-12 16:38:04 +08005324
5325/**
lifrb6b90b62019-03-29 00:40:17 +08005326 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5327 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5328 *
lifra2e19c02019-04-16 22:16:30 +08005329 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5330 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5331 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5332 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005333 */
5334message NetworkDnsEventReported {
lifra2e19c02019-04-16 22:16:30 +08005335 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005336
lifra2e19c02019-04-16 22:16:30 +08005337 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005338
5339 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005340 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005341
lifra2e19c02019-04-16 22:16:30 +08005342 // Only valid for event_type = EVENT_GETADDRINFO.
5343 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005344
lifra2e19c02019-04-16 22:16:30 +08005345 // Flags passed to android_res_nsend() defined in multinetwork.h
5346 // Only valid for event_type = EVENT_RESNSEND.
5347 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005348
Frank Libe8ecaa2019-06-18 05:45:25 -07005349 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005350
5351 // The DNS over TLS mode on a specific netId.
lifra2e19c02019-04-16 22:16:30 +08005352 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005353
5354 // Additional pass-through fields opaque to statsd.
5355 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifra2e19c02019-04-16 22:16:30 +08005356 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
Frank Li762eb4a2019-07-22 08:13:03 -07005357
5358 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
5359 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08005360}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005361
5362/**
5363 * Logs when a data stall event occurs.
5364 *
5365 * Log from:
5366 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5367 */
5368message DataStallEvent {
5369 // Data stall evaluation type.
5370 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5371 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5372 optional int32 evaluation_type = 1;
5373 // See definition in data_stall_event.proto.
5374 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5375 // See definition in data_stall_event.proto.
5376 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5377 // See definition in data_stall_event.proto.
5378 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5379 // See definition in data_stall_event.proto.
5380 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5381 // See definition in data_stall_event.proto.
5382 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5383}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005384
5385/*
5386 * Logs when RescueParty resets some set of experiment flags.
5387 *
5388 * Logged from:
5389 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5390 */
5391message RescuePartyResetReported {
5392 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5393 optional int32 rescue_level = 1;
5394}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005395
5396/**
5397 * Logs when signed config is received from an APK, and if that config was applied successfully.
5398 * Logged from:
5399 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5400 */
5401message SignedConfigReported {
5402 enum Type {
5403 UNKNOWN_TYPE = 0;
5404 GLOBAL_SETTINGS = 1;
5405 }
5406 optional Type type = 1;
5407
5408 // The final status of the signed config received.
5409 enum Status {
5410 UNKNOWN_STATUS = 0;
5411 APPLIED = 1;
5412 BASE64_FAILURE_CONFIG = 2;
5413 BASE64_FAILURE_SIGNATURE = 3;
5414 SECURITY_EXCEPTION = 4;
5415 INVALID_CONFIG = 5;
5416 OLD_CONFIG = 6;
5417 SIGNATURE_CHECK_FAILED = 7;
5418 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005419 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005420 }
5421 optional Status status = 2;
5422
5423 // The version of the signed config processed.
5424 optional int32 version = 3;
5425
5426 // The package name that the config was extracted from.
5427 optional string from_package = 4;
5428
5429 enum Key {
5430 NO_KEY = 0;
5431 DEBUG = 1;
5432 PRODUCTION = 2;
5433 }
5434 // Which key was used to verify the config.
5435 optional Key verified_with = 5;
5436}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005437
5438/*
5439 * Logs GNSS Network-Initiated (NI) location events.
5440 *
5441 * Logged from:
5442 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5443 */
5444message GnssNiEventReported {
5445 // The type of GnssNiEvent.
5446 enum EventType {
5447 UNKNOWN = 0;
5448 NI_REQUEST = 1;
5449 NI_RESPONSE = 2;
5450 }
5451 optional EventType event_type = 1;
5452
5453 // An ID generated by HAL to associate NI notifications and UI responses.
5454 optional int32 notification_id = 2;
5455
5456 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005457 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005458
5459 // NI requires notification.
5460 optional bool need_notify = 4;
5461
5462 // NI requires verification.
5463 optional bool need_verify = 5;
5464
5465 // NI requires privacy override, no notification/minimal trace.
5466 optional bool privacy_override = 6;
5467
5468 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5469 // seconds.
5470 optional int32 timeout = 7;
5471
5472 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005473 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005474
5475 // String representing the requester of the network inititated location request.
5476 optional string requestor_id = 9;
5477
5478 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5479 // network initiated location request.
5480 optional string text = 10;
5481
5482 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005483 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005484
5485 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005486 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005487
5488 // True if SUPL ES is enabled.
5489 optional bool is_supl_es_enabled = 13;
5490
5491 // True if GNSS location is enabled.
5492 optional bool is_location_enabled = 14;
5493
5494 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005495 optional android.server.location.GnssUserResponseType user_response = 15;
5496}
5497
5498/**
5499 * Logs GNSS non-framework (NFW) location notification.
5500 *
5501 * Logged from:
5502 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5503 */
5504message GnssNfwNotificationReported {
5505 // Package name of the Android proxy application representing the non-framework entity that
5506 // requested location. Set to empty string if unknown.
5507 optional string proxy_app_package_name = 1;
5508
5509 // Protocol stack that initiated the non-framework location request.
5510 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5511
5512 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5513 // set to empty string. This field is opaque to the framework and used for logging purposes.
5514 optional string other_protocol_stack_name = 3;
5515
5516 // Source initiating/receiving the location information.
5517 optional android.server.location.NfwRequestor requestor = 4;
5518
5519 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5520 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5521 // and used for logging purposes.
5522 optional string requestor_id = 5;
5523
5524 // Indicates whether location information was provided for this request.
5525 optional android.server.location.NfwResponseType response_type = 6;
5526
5527 // True if the device is in user initiated emergency session.
5528 optional bool in_emergency_mode = 7;
5529
5530 // True if cached location is provided.
5531 optional bool is_cached_location = 8;
5532
5533 // True if proxy app permission mismatch between framework and GNSS HAL.
5534 optional bool is_permission_mismatched = 9;
5535}
5536
5537/**
5538 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5539 *
5540 * Logged from:
5541 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5542 */
5543message GnssConfigurationReported {
5544 // SUPL host name.
5545 optional string supl_host = 1;
5546
5547 // SUPL port number.
5548 optional int32 supl_port = 2;
5549
5550 // C2K host name.
5551 optional string c2k_host = 3;
5552
5553 // C2K port number.
5554 optional int32 c2k_port = 4;
5555
5556 // The SUPL version requested by Carrier.
5557 optional int32 supl_ver = 5;
5558
5559 // The SUPL mode.
5560 optional android.server.location.SuplMode supl_mode = 6;
5561
5562 // True if NI emergency SUPL restrictions is enabled.
5563 optional bool supl_es = 7;
5564
5565 // LTE Positioning Profile settings
5566 optional android.server.location.LppProfile lpp_profile = 8;
5567
5568 // Positioning protocol on A-Glonass system.
5569 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5570
5571 // True if emergency PDN is used. Otherwise, regular PDN is used.
5572 optional bool use_emergency_pdn_for_emergency_supl= 10;
5573
5574 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5575 optional android.server.location.GpsLock gps_lock = 11;
5576
5577 // Number of seconds to extend the emergency session duration post emergency call.
5578 optional int32 es_extension_sec = 12;
5579
5580 // The full list of package names of proxy Android applications representing the non-framework
5581 // location access entities (on/off the device) for which the framework user has granted
5582 // non-framework location access permission. The package names are concatenated in one string
5583 // with spaces as separators.
5584 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005585}
Jack Yu95b64f32018-12-13 18:26:11 +08005586
5587/**
5588 * Logs when a NFC device's error occurred.
5589 * Logged from:
5590 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5591 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5592 */
5593message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005594 enum Type {
5595 UNKNOWN = 0;
5596 CMD_TIMEOUT = 1;
5597 ERROR_NOTIFICATION = 2;
5598 AID_OVERFLOW = 3;
5599 }
5600 optional Type type = 1;
5601 // If it's nci cmd timeout, log the timeout command.
5602 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005603
Alex Salod7c3eef2019-01-25 14:43:27 -08005604 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005605}
5606
5607/**
5608 * Logs when a NFC device's state changed event
5609 * Logged from:
5610 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5611 */
5612message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005613 enum State {
5614 UNKNOWN = 0;
5615 OFF = 1;
5616 ON = 2;
5617 ON_LOCKED = 3; // Secure Nfc enabled.
5618 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5619 }
5620 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005621}
5622
5623/**
5624 * Logs when a NFC Beam Transaction occurred.
5625 * Logged from:
5626 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5627 */
5628message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005629 enum Operation {
5630 UNKNOWN = 0;
5631 SEND = 1;
5632 RECEIVE = 2;
5633 }
5634 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005635}
5636
5637/**
5638 * Logs when a NFC Card Emulation Transaction occurred.
5639 * Logged from:
5640 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5641 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5642 */
5643message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005644 enum Category {
5645 UNKNOWN = 0;
5646 HCE_PAYMENT = 1;
5647 HCE_OTHER = 2;
5648 OFFHOST = 3;
5649 }
5650 // Transaction belongs to HCE payment or HCE other category, or offhost.
5651 optional Category category = 1;
5652 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5653 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005654}
5655
5656/**
5657 * Logs when a NFC Tag event occurred.
5658 * Logged from:
5659 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5660 */
5661message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005662 enum Type {
5663 UNKNOWN = 0;
5664 URL = 1;
5665 BT_PAIRING = 2;
5666 PROVISION = 3;
5667 WIFI_CONNECT = 4;
5668 APP_LAUNCH = 5;
5669 OTHERS = 6;
5670 }
5671 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005672}
5673
5674/**
5675 * Logs when Hce transaction triggered
5676 * Logged from:
5677 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5678 */
5679message NfcHceTransactionOccurred {
5680 // The latency period(in microseconds) it took for the first HCE data
5681 // exchange.
5682 optional uint32 latency_micros = 1;
5683}
5684
5685/**
5686 * Logs when SecureElement state event changed
5687 * Logged from:
5688 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5689 */
5690message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005691 enum State {
5692 UNKNOWN = 0;
5693 INITIALIZED = 1;
5694 DISCONNECTED = 2;
5695 CONNECTED = 3;
5696 HALCRASH = 4;
5697 }
5698 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005699
Alex Salod7c3eef2019-01-25 14:43:27 -08005700 optional string state_change_reason = 2;
5701 // SIMx or eSEx.
5702 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005703}
5704
5705/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005706 * Information about a permission grant request
5707 */
5708message PermissionGrantRequestResultReported {
5709 // unique value identifying an API call. A API call might result in multiple of these atoms
5710 optional int64 request_id = 1;
5711
5712 // UID of package requesting the permission grant
5713 optional int32 requesting_uid = 2 [(is_uid) = true];
5714
5715 // Name of package requesting the permission grant
5716 optional string requesting_package_name = 3;
5717
5718 // The permission to be granted
5719 optional string permission_name = 4;
5720
5721 // If the permission was explicitly requested via the API or added by the system
5722 optional bool is_implicit = 5;
5723
5724 enum Result {
5725 UNDEFINED = 0;
5726 // permission request was ignored
5727 IGNORED = 1;
5728 // permission request was ignored because it was user fixed
5729 IGNORED_USER_FIXED = 2;
5730 // permission request was ignored because it was policy fixed
5731 IGNORED_POLICY_FIXED = 3;
5732 // permission was granted by user action
5733 USER_GRANTED = 4;
5734 // permission was automatically granted
5735 AUTO_GRANTED = 5;
5736 // permission was denied by user action
5737 USER_DENIED = 6;
5738 // permission was denied with prejudice by the user
5739 USER_DENIED_WITH_PREJUDICE = 7;
5740 // permission was automatically denied
5741 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07005742 // permission request was ignored because permission is restricted
5743 IGNORED_RESTRICTED_PERMISSION = 9;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005744 }
5745 // The result of the permission grant
5746 optional Result result = 6;
5747}
5748
5749/**
Jack Yu95b64f32018-12-13 18:26:11 +08005750 * Logs when Omapi API used
5751 * Logged from:
5752 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5753 */
5754message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005755 enum Operation {
5756 UNKNOWN = 0;
5757 OPEN_CHANNEL = 1;
5758 }
5759 optional Operation operation = 1;
5760 // SIMx or eSEx.
5761 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005762
Alex Salod7c3eef2019-01-25 14:43:27 -08005763 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005764}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005765
5766/**
Alex Saloa060aee2019-01-21 14:36:41 -08005767 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5768 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005769 * Logged from:
5770 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5771 */
5772message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005773 optional int64 dispatch_latency_millis = 1;
5774}
5775
5776/**
5777 * Logs AttentionManagerService attention check result.
5778 *
5779 * Logged from:
5780 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5781 */
5782message AttentionManagerServiceResultReported {
5783 // See core/java/android/service/attention/AttentionService.java
5784 enum AttentionCheckResult {
5785 UNKNOWN = 20;
5786 ATTENTION_SUCCESS_ABSENT = 0;
5787 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07005788 ATTENTION_FAILURE_UNKNOWN = 2;
5789 ATTENTION_FAILURE_CANCELLED = 3;
5790 ATTENTION_FAILURE_PREEMPTED = 4;
5791 ATTENTION_FAILURE_TIMED_OUT = 5;
5792 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08005793 }
5794 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005795}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005796
5797/**
5798 * Logs when an adb connection changes state.
5799 *
5800 * Logged from:
5801 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5802 */
5803message AdbConnectionChanged {
5804 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5805 // previously selected for this system.
5806 optional int64 last_connection_time_millis = 1;
5807
5808 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5809 // to reconnect via adb without user interaction.
5810 optional int64 auth_window_millis = 2;
5811
5812 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5813 optional android.debug.AdbConnectionStateEnum state = 3;
5814
5815 // True if the 'always allow' option was selected for this system.
5816 optional bool always_allow = 4;
5817}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005818
5819/*
5820 * Logs the reported speech DSP status.
5821 *
5822 * Logged from:
5823 * Vendor audio implementation.
5824 */
5825message SpeechDspStatReported {
5826 // The total Speech DSP uptime in milliseconds.
5827 optional int32 total_uptime_millis = 1;
5828 // The total Speech DSP downtime in milliseconds.
5829 optional int32 total_downtime_millis = 2;
5830 optional int32 total_crash_count = 3;
5831 optional int32 total_recover_count = 4;
5832}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005833
5834/**
5835 * Logs USB connector contaminant status.
5836 *
5837 * Logged from: USB Service.
5838 */
5839message UsbContaminantReported {
5840 optional string id = 1;
5841 optional android.service.usb.ContaminantPresenceStatus status = 2;
5842}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005843
5844/**
5845 * This atom is for debugging purpose.
5846 */
5847message DebugElapsedClock {
5848 // Monotically increasing value for each pull.
5849 optional int64 pull_count = 1;
5850 // Time from System.elapsedRealtime.
5851 optional int64 elapsed_clock_millis = 2;
5852 // Time from System.elapsedRealtime.
5853 optional int64 same_elapsed_clock_millis = 3;
5854 // Diff between current elapsed time and elapsed time from previous pull.
5855 optional int64 elapsed_clock_diff_millis = 4;
5856
5857 enum Type {
5858 TYPE_UNKNOWN = 0;
5859 ALWAYS_PRESENT = 1;
5860 PRESENT_ON_ODD_PULLS = 2;
5861 }
5862 // Type of behavior for the pulled data.
5863 optional Type type = 5;
5864}
5865
5866/**
5867 * This atom is for debugging purpose.
5868 */
5869message DebugFailingElapsedClock {
5870 // Monotically increasing value for each pull.
5871 optional int64 pull_count = 1;
5872 // Time from System.elapsedRealtime.
5873 optional int64 elapsed_clock_millis = 2;
5874 // Time from System.elapsedRealtime.
5875 optional int64 same_elapsed_clock_millis = 3;
5876 // Diff between current elapsed time and elapsed time from previous pull.
5877 optional int64 elapsed_clock_diff_millis = 4;
5878}
Steven Wuacef6bb2019-01-23 14:21:17 -05005879
5880/** Logs System UI bubbles event changed.
5881 *
5882 * Logged from:
5883 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5884 */
5885message BubbleUIChanged {
5886
5887 // The app package that is posting the bubble.
5888 optional string package_name = 1;
5889
5890 // The notification channel that is posting the bubble.
5891 optional string notification_channel = 2;
5892
5893 // The notification id associated with the posted bubble.
5894 optional int32 notification_id = 3;
5895
5896 // The position of the bubble within the bubble stack.
5897 optional int32 position = 4;
5898
5899 // The total number of bubbles within the bubble stack.
5900 optional int32 total_number = 5;
5901
5902 // User interactions with the bubble.
5903 enum Action {
5904 UNKNOWN = 0;
5905 POSTED = 1;
5906 UPDATED = 2;
5907 EXPANDED = 3;
5908 COLLAPSED = 4;
5909 DISMISSED = 5;
5910 STACK_DISMISSED = 6;
5911 STACK_MOVED = 7;
5912 HEADER_GO_TO_APP = 8;
5913 HEADER_GO_TO_SETTINGS = 9;
5914 PERMISSION_OPT_IN = 10;
5915 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005916 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005917 SWIPE_LEFT = 13;
5918 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005919 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04005920 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05005921 }
5922 optional Action action = 6;
5923
5924 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5925 optional float normalized_x_position = 7;
5926 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04005927
5928 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
5929 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04005930
5931 // Whether the bubble is an on-going one.
5932 optional bool is_ongoing = 10;
5933
5934 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07005935 // This is deprecated and the value should be ignored.
5936 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05005937}
Kweku Adams8845d012018-12-11 20:06:45 -08005938
5939/**
Steven Wu552f63f2019-02-05 13:41:36 -05005940 * Logs System UI bubbles developer errors.
5941 *
5942 * Logged from:
5943 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5944 */
5945message BubbleDeveloperErrorReported {
5946
5947 // The app package that is posting the bubble.
5948 optional string package_name = 1;
5949
5950 // Bubble developer error type enums.
5951 enum Error {
5952 UNKNOWN = 0;
5953 ACTIVITY_INFO_MISSING = 1;
5954 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5955 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5956 }
5957 optional Error error = 2 [default = UNKNOWN];
5958}
5959
5960/**
Kweku Adams8845d012018-12-11 20:06:45 -08005961 * Logs that a constraint for a scheduled job has changed.
5962 *
5963 * Logged from:
5964 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5965 */
5966message ScheduledJobConstraintChanged {
5967 repeated AttributionNode attribution_node = 1;
5968
5969 // Name of the job.
5970 optional string job_name = 2;
5971
5972 optional com.android.server.job.ConstraintEnum constraint = 3;
5973
5974 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08005975 UNKNOWN = 0;
5976 UNSATISFIED = 1;
5977 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08005978 }
5979 optional State state = 4;
5980}
Alex Salod7c3eef2019-01-25 14:43:27 -08005981
5982/**
5983 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5984 * returns true.
5985 *
5986 * Logged from:
5987 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5988 */
5989message ScreenTimeoutExtensionReported {
5990 // Describes how many times in a row did the power manager reset the screen off timeout.
5991 optional uint32 consecutive_timeout_extended_count = 1;
5992}
Hui Yu885aca12019-01-10 17:11:34 -08005993
5994/*
5995* Logs number of milliseconds it takes to start a process.
5996* The definition of app process start time is from the app launch time to
5997* the time that Zygote finished forking the app process and loaded the
5998* application package's java classes.
5999
6000* This metric is different from AppStartOccurred which is for foreground
6001* activity only.
6002
6003* ProcessStartTime can report all processes (both foreground and background)
6004* start time.
6005*
6006* Logged from:
6007* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6008*/
6009message ProcessStartTime {
6010 // The uid of the ProcessRecord.
6011 optional int32 uid = 1 [(is_uid) = true];
6012
6013 // The process pid.
6014 optional int32 pid = 2;
6015
6016 // The process name.
6017 // Usually package name, "system" for system server.
6018 // Provided by ActivityManagerService.
6019 optional string process_name = 3;
6020
6021 enum StartType {
6022 UNKNOWN = 0;
6023 WARM = 1;
6024 HOT = 2;
6025 COLD = 3;
6026 }
6027
6028 // The start type.
6029 optional StartType type = 4;
6030
6031 // The elapsed realtime at the start of the process.
6032 optional int64 process_start_time_millis = 5;
6033
6034 // Number of milliseconds it takes to reach bind application.
6035 optional int32 bind_application_delay_millis = 6;
6036
6037 // Number of milliseconds it takes to finish start of the process.
6038 optional int32 process_start_delay_millis = 7;
6039
6040 // hostingType field in ProcessRecord, the component type such as "activity",
6041 // "service", "content provider", "broadcast" or other strings.
6042 optional string hosting_type = 8;
6043
6044 // hostingNameStr field in ProcessRecord. The component class name that runs
6045 // in this process.
6046 optional string hosting_name = 9;
6047}
6048
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006049/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006050 * Track Media Codec usage
6051 * Logged from:
6052 * frameworks/av/media/libstagefright/MediaCodec.cpp
6053 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6054 */
6055message MediametricsCodecReported {
6056 optional int64 timestamp_nanos = 1;
6057 optional string package_name = 2;
6058 optional int64 package_version_code = 3;
6059 optional int64 media_apex_version = 4;
6060
6061 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6062}
6063
6064/**
6065 * Track Media Extractor (pulling video/audio streams out of containers) usage
6066 * Logged from:
6067 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6068 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6069 */
6070message MediametricsExtractorReported {
6071 optional int64 timestamp_nanos = 1;
6072 optional string package_name = 2;
6073 optional int64 package_version_code = 3;
6074 optional int64 media_apex_version = 4;
6075
6076 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6077}
6078
6079/**
6080 * Track how we arbitrate between microphone/input requests.
6081 * Logged from
6082 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6083 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6084 */
6085message MediametricsAudiopolicyReported {
6086 optional int64 timestamp_nanos = 1;
6087 optional string package_name = 2;
6088 optional int64 package_version_code = 3;
6089 optional int64 media_apex_version = 4;
6090
6091 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6092}
6093
6094/**
6095 * Track how we arbitrate between microphone requests.
6096 * Logged from
6097 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6098 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6099 */
6100message MediametricsAudiorecordReported {
6101 optional int64 timestamp_nanos = 1;
6102 optional string package_name = 2;
6103 optional int64 package_version_code = 3;
6104 optional int64 media_apex_version = 4;
6105
6106 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6107}
6108
6109/**
6110 * Track how we arbitrate between microphone/input requests.
6111 * Logged from
6112 * frameworks/av/media/libnblog/ReportPerformance.cpp
6113 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6114 */
6115message MediametricsAudiothreadReported {
6116 optional int64 timestamp_nanos = 1;
6117 optional string package_name = 2;
6118 optional int64 package_version_code = 3;
6119 optional int64 media_apex_version = 4;
6120
6121 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6122}
6123
6124/**
6125 * Track how we arbitrate between microphone/input requests.
6126 * Logged from
6127 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6128 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6129 */
6130message MediametricsAudiotrackReported {
6131 optional int64 timestamp_nanos = 1;
6132 optional string package_name = 2;
6133 optional int64 package_version_code = 3;
6134 optional int64 media_apex_version = 4;
6135
6136 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6137}
6138
6139/**
6140 * Track information about DRM framework performance
6141 * Logged from
6142 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6143 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6144 */
6145message MediametricsMediadrmReported {
6146 optional int64 timestamp_nanos = 1;
6147 optional string package_name = 2;
6148 optional int64 package_version_code = 3;
6149 optional int64 media_apex_version = 4;
6150
6151 // vendor+description tell about which DRM plugin is in use on this device
6152 optional string vendor = 5;
6153 optional string description = 6;
6154 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6155 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6156}
6157
6158/**
6159 * Track information about the widevine DRM plugin performance
6160 * Logged from
6161 * vendor/widevine/libwvdrmengine/cdm/metrics
6162 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6163 */
6164message MediametricsDrmWidevineReported {
6165 optional int64 timestamp_nanos = 1;
6166 optional string package_name = 2;
6167 optional int64 package_version_code = 3;
6168 optional int64 media_apex_version = 4;
6169
6170 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6171}
6172
6173/**
6174 * Track information about recordings (e.g. camcorder)
6175 * Logged from
6176 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6177 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6178 */
6179message MediametricsRecorderReported {
6180 optional int64 timestamp_nanos = 1;
6181 optional string package_name = 2;
6182 optional int64 package_version_code = 3;
6183 optional int64 media_apex_version = 4;
6184
6185 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6186}
6187
6188/**
6189 * Track Media Player usage
6190 * Logged from:
6191 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6192 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6193 */
6194message MediametricsNuPlayerReported {
6195 optional int64 timestamp_nanos = 1;
6196 optional string package_name = 2;
6197 optional int64 package_version_code = 3;
6198 optional int64 media_apex_version = 4;
6199
6200 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6201}
6202
6203/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006204 * State of a dangerous permission requested by a package
6205 */
6206message DangerousPermissionState {
6207 // Name of the permission
6208 optional string permission_name = 1;
6209
6210 // Uid of the package
6211 optional int32 uid = 2 [(is_uid) = true];
6212
6213 // Package requesting the permission
6214 optional string package_name = 3;
6215
6216 // If the permission is granted to the uid
6217 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01006218
6219 // Permission flags as per android.content.pm.PermissionFlags
6220 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006221}
6222
Michael Groover4a0ca942019-01-24 17:41:25 -08006223/**
6224 * Logs when a package is denied access to a device identifier based on the new access requirements.
6225 *
6226 * Logged from:
6227 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6228 */
6229message DeviceIdentifierAccessDenied {
6230 // The name of the package denied access to the requested device identifier.
6231 optional string package_name = 1;
6232
6233 // The name of the device identifier method the package attempted to invoke.
6234 optional string method_name = 2;
6235
6236 // True if the package is preinstalled.
6237 optional bool is_preinstalled = 3;
6238
6239 // True if the package is privileged.
6240 optional bool is_priv_app = 4;
6241}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006242
6243/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006244 * Pulls the ongoing mainline install train version code.
6245 * Pulled from StatsCompanionService
6246 */
6247message TrainInfo {
6248 optional int64 train_version_code = 1;
6249
6250 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006251
6252 optional string train_name = 3;
6253
6254 enum Status {
6255 UNKNOWN = 0;
6256 INSTALL_REQUESTED = 1;
6257 INSTALL_STARTED = 2;
6258 INSTALL_STAGED_NOT_READY = 3;
6259 INSTALL_STAGED_READY = 4;
6260 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006261 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6262 // and INSTALL_FAILURE_COMMIT.
6263 INSTALL_FAILURE = 6 [deprecated = true];
6264 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006265 INSTALL_CANCELLED = 7;
6266 INSTALLER_ROLLBACK_REQUESTED = 8;
6267 INSTALLER_ROLLBACK_INITIATED = 9;
6268 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6269 INSTALLER_ROLLBACK_STAGED = 11;
6270 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6271 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6272 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6273 INSTALLER_ROLLBACK_SUCCESS = 15;
6274 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006275 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6276 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6277 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6278 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6279 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6280 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006281 INSTALL_FAILURE_DOWNLOAD = 23;
6282 INSTALL_FAILURE_STATE_MISMATCH = 24;
6283 INSTALL_FAILURE_COMMIT = 25;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006284 }
6285 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006286}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006287
6288/**
6289 * Logs the gesture stage changed event.
6290 *
6291 * Logged from:
6292 * frameworks/base/packages/SystemUI/
6293 */
6294message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006295 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006296}
6297
6298/**
6299 * Logs the feedback type.
6300 *
6301 * Logged from:
6302 * frameworks/base/packages/SystemUI/
6303 */
6304message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006305 // Whether or not the gesture was used.
6306 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006307}
6308
6309/**
6310 * Logs the progress.
6311 *
6312 * Logged from:
6313 * frameworks/base/packages/SystemUI/
6314 */
6315message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006316 // [0,100] progress for the assist gesture.
6317 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006318}
Neil Fullerdb14b482019-02-05 19:44:44 +00006319
6320/*
6321 * Information about the time zone data on a device.
6322 */
6323message TimeZoneDataInfo {
6324 // A version identifier for the data set on device. e.g. "2018i"
6325 optional string tzdb_version = 1;
6326}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006327
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006328/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006329 * Logs the GPU stats global health information.
6330 *
6331 * Logged from:
6332 * frameworks/native/services/gpuservice/gpustats/
6333 */
6334message GpuStatsGlobalInfo {
6335 // Package name of the gpu driver.
6336 optional string driver_package_name = 1;
6337
6338 // Version name of the gpu driver.
6339 optional string driver_version_name = 2;
6340
6341 // Version code of the gpu driver.
6342 optional int64 driver_version_code = 3;
6343
6344 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
6345 optional int64 driver_build_time = 4;
6346
6347 // Total count of the gl driver gets loaded.
6348 optional int64 gl_loading_count = 5;
6349
6350 // Total count of the gl driver fails to be loaded.
6351 optional int64 gl_loading_failure_count = 6;
6352
6353 // Total count of the Vulkan driver gets loaded.
6354 optional int64 vk_loading_count = 7;
6355
6356 // Total count of the Vulkan driver fails to be loaded.
6357 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07006358
6359 // Api version of the system Vulkan driver.
6360 optional int32 vulkan_version = 9;
6361
6362 // Api version of the system CPU Vulkan driver.
6363 optional int32 cpu_vulkan_version = 10;
6364
6365 // Api version of the system GLES driver.
6366 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006367
6368 // Total count of the angle driver gets loaded.
6369 optional int64 angle_loading_count = 12;
6370
6371 // Total count of the angle driver fails to be loaded.
6372 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006373}
6374
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006375/**
6376 * GPU driver loading time info.
6377 */
6378message GpuDriverLoadingTime {
6379 // List of all the driver loading times for this app. The list size is
6380 // capped at 50.
6381 repeated int64 driver_loading_time = 1;
6382}
6383
6384/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006385 * Logs the GPU stats per app health information.
6386 *
6387 * Logged from:
6388 * frameworks/native/services/gpuservice/gpustats/
6389 */
6390message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006391 // Package name of the application that loads the gpu driver. Total number
6392 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006393 optional string app_package_name = 1;
6394
6395 // Version code of the gpu driver this app loads.
6396 optional int64 driver_version_code = 2;
6397
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006398 // gl driver loading time info.
6399 optional GpuDriverLoadingTime gl_driver_loading_time = 3
6400 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006401
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006402 // Vulkan driver loading time info.
6403 optional GpuDriverLoadingTime vk_driver_loading_time = 4
6404 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006405
6406 // Angle driver loading time info.
6407 optional GpuDriverLoadingTime angle_driver_loading_time = 5
6408 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07006409
6410 // CPU Vulkan implementation is in use.
6411 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006412}
Rafal Slawikd4e87572019-03-12 13:08:38 +00006413
6414/*
6415 * Logs the size of the system ion heap.
6416 *
6417 * Pulled from StatsCompanionService.
6418 */
6419message SystemIonHeapSize {
6420 // Size of the system ion heap in bytes.
6421 optional int64 size_in_bytes = 1;
6422}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006423
Rafal Slawik6d44d6d2019-06-17 12:28:23 +01006424/*
6425 * Logs the per-process size of the system ion heap.
6426 *
6427 * Pulled from StatsCompanionService.
6428 */
6429message ProcessSystemIonHeapSize {
6430 // The uid if available. -1 means not available.
6431 optional int32 uid = 1 [(is_uid) = true];
6432
6433 // The process name (from /proc/PID/cmdline).
6434 optional string process_name = 2;
6435
6436 // Sum of sizes of all allocations.
6437 optional int32 total_size_in_kilobytes = 3;
6438
6439 // Number of allocations.
6440 optional int32 allocation_count = 4;
6441
6442 // Size of the largest allocation.
6443 optional int32 max_size_in_kilobytes = 5;
6444}
6445
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006446/**
6447 * Push network stack events.
6448 *
6449 * Log from:
6450 * frameworks/base/packages/NetworkStack/
6451 */
6452message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08006453 // The id that indicates the event reported from NetworkStack.
6454 optional int32 event_id = 1;
6455 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006456 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
6457}
Carmen Agimofa769c152019-03-04 14:39:14 +00006458
6459/**
6460 * Logs the apps that are installed on the external storage.
6461 * Pulled from:
6462 * StatsCompanionService
6463 */
6464message AppsOnExternalStorageInfo {
6465 // The type of the external storage.
6466 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
6467 // The name of the package that is installed on the external storage.
6468 optional string package_name = 2;
6469}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07006470
6471/**
6472 * Logs the settings related to Face.
6473 * Logged from:
6474 * frameworks/base/services/core/java/com/android/server/stats
6475 */
6476message FaceSettings {
6477 // Whether or not face unlock is allowed on Keyguard.
6478 optional bool unlock_keyguard_enabled = 1;
6479 // Whether or not face unlock dismisses the Keyguard.
6480 optional bool unlock_dismisses_keyguard = 2;
6481 // Whether or not face unlock requires attention.
6482 optional bool unlock_attention_required = 3;
6483 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
6484 optional bool unlock_app_enabled = 4;
6485 // Whether or not face unlock always requires user confirmation.
6486 optional bool unlock_always_require_confirmation = 5;
6487 // Whether or not a diverse set of poses are required during enrollment.
6488 optional bool unlock_diversity_required = 6;
6489}
Maggie White442b6312019-04-05 16:26:44 -07006490
6491/**
6492 * Logs cooling devices maintained by the kernel.
6493 *
6494 * Pulled from StatsCompanionService.java
6495 */
6496message CoolingDevice {
6497 // The type of cooling device being reported. Eg. CPU, GPU...
6498 optional android.os.CoolingTypeEnum device_location = 1;
6499 // The name of the cooling device source. Eg. CPU0
6500 optional string device_name = 2;
6501 // Current throttle state of the cooling device. The value can any unsigned
6502 // integer between 0 and max_state defined in its driver. 0 means device is
6503 // not in throttling, higher value means deeper throttling.
6504 optional int32 state = 3;
6505}
Ben Blount763a5d52019-04-10 11:48:58 -07006506
6507/**
6508 * Intelligence has several counter-type events that don't warrant a
6509 * full separate atom. These are primarily API call counters but also include
6510 * counters for feature usage and specific failure modes.
6511 *
6512 * Logged from the Intelligence mainline module.
6513 */
6514message IntelligenceEventReported {
6515 optional android.stats.intelligence.EventType event_id = 1;
6516 optional android.stats.intelligence.Status status = 2;
6517}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07006518
6519/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07006520 * Logs when Car Power state changed.
6521 *
6522 * Logged from:
6523 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6524 */
6525message CarPowerStateChanged {
6526 // States come from CpmsState in CarPowerManagementService.java.
6527 enum State {
6528 WAIT_FOR_VHAL = 0;
6529 ON = 1;
6530 SHUTDOWN_PREPARE = 2;
6531 WAIT_FOR_FINISH = 3;
6532 SUSPEND = 4;
6533 SIMULATE_SLEEP = 5;
6534 }
6535 optional State state = 1;
6536}
6537
6538/**
6539 * Logs whether GarageMode is entered.
6540 *
6541 * Logged from:
6542 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6543 */
6544message GarageModeInfo {
6545 // Whether GarageMode is entered.
6546 optional bool is_garage_mode = 1;
6547}
Martijn Coenencd95d462019-04-25 17:09:45 +02006548
6549/**
6550 * Historical app ops data per package.
6551 */
6552message AppOps {
6553 // Uid of the package requesting the op
6554 optional int32 uid = 1 [(is_uid) = true];
6555
6556 // Nmae of the package performing the op
6557 optional string package_name = 2;
6558
6559 // operation id; maps to the OP_* constants in AppOpsManager.java
6560 optional int32 op_id = 3;
6561
6562 // The number of times the op was granted while the app was in the
6563 // foreground (only for trusted requests)
6564 optional int64 trusted_foreground_granted_count = 4;
6565
6566 // The number of times the op was granted while the app was in the
6567 // background (only for trusted requests)
6568 optional int64 trusted_background_granted_count = 5;
6569
6570 // The number of times the op was rejected while the app was in the
6571 // foreground (only for trusted requests)
6572 optional int64 trusted_foreground_rejected_count = 6;
6573
6574 // The number of times the op was rejected while the app was in the
6575 // background (only for trusted requests)
6576 optional int64 trusted_background_rejected_count = 7;
6577
6578 // For long-running operations, total duration of the operation
6579 // while the app was in the foreground (only for trusted requests)
6580 optional int64 trusted_foreground_duration_millis = 8;
6581
6582 // For long-running operations, total duration of the operation
6583 // while the app was in the background (only for trusted requests)
6584 optional int64 trusted_background_duration_millis = 9;
6585}
Hongyi Zhang700137e2019-05-23 21:19:36 -07006586
6587/**
6588 * Location Manager API Usage information(e.g. API under usage,
6589 * API call's parameters).
6590 * Logged from:
6591 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
6592 */
6593message LocationManagerApiUsageReported {
6594
6595 // Indicating if usage starts or usage ends.
6596 optional android.stats.location.UsageState state = 1;
6597
6598 // LocationManagerService's API in use.
6599 // We can identify which API from LocationManager is
6600 // invoking current LMS API by the combination of
6601 // API parameter(e.g. is_listener_null, is_intent_null,
6602 // is_location_request_null)
6603 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
6604
6605 // Name of the package calling the API.
6606 optional string calling_package_name = 3;
6607
6608 // Type of the location provider.
6609 optional android.stats.location.ProviderType provider = 4;
6610
6611 // Quality of the location request
6612 optional android.stats.location.LocationRequestQuality quality = 5;
6613
6614 // The desired interval for active location updates, in milliseconds.
6615 // Bucketized to reduce cardinality.
6616 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
6617
6618 // Minimum distance between location updates, in meters.
6619 // Bucketized to reduce cardinality.
6620 optional android.stats.location.SmallestDisplacementBucket
6621 bucketized_smallest_displacement = 7;
6622
6623 // The number of location updates.
6624 optional int64 num_updates = 8;
6625
6626 // The request expiration time, in millisecond since boot.
6627 // Bucketized to reduce cardinality.
6628 optional android.stats.location.ExpirationBucket
6629 bucketized_expire_in = 9;
6630
6631 // Type of Callback passed in for this API.
6632 optional android.stats.location.CallbackType callback_type = 10;
6633
6634 // The radius of the central point of the alert
6635 // region, in meters. Only for API REQUEST_GEOFENCE.
6636 // Bucketized to reduce cardinality.
6637 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
6638
6639 // Activity Importance of API caller.
6640 // Categorized to 3 types that are interesting from location's perspective.
6641 optional android.stats.location.ActivityImportance activiy_importance = 12;
6642}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01006643
6644/**
6645 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
6646 */
6647message ReviewPermissionsFragmentResultReported {
6648 // unique value identifying a permission group change. A permission group change might result
6649 // in multiple of these atoms
6650 optional int64 change_id = 1;
6651
6652 // UID of package the permission belongs to
6653 optional int32 uid = 2 [(is_uid) = true];
6654
6655 // Name of package the permission belongs to
6656 optional string package_name = 3;
6657
6658 // The permission to be granted
6659 optional string permission_name = 4;
6660
6661 // The result of the permission grant
6662 optional bool permission_granted = 5;
6663}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01006664
6665/**
6666* Information about results of permission upgrade by RuntimePermissionsUpgradeController
6667* Logged from: RuntimePermissionUpdgradeController
6668*/
6669message RuntimePermissionsUpgradeResult {
6670 // Permission granted as result of upgrade
6671 optional string permission_name = 1;
6672
6673 // UID of package granted permission
6674 optional int32 uid = 2 [(is_uid) = true];
6675
6676 // Name of package granted permission
6677 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01006678}
6679
6680/**
6681* Information about a buttons presented in GrantPermissionsActivty and choice made by user
6682*/
6683message GrantPermissionsActivityButtonActions {
6684 // Permission granted as result of upgrade
6685 optional string permission_group_name = 1;
6686
6687 // UID of package granted permission
6688 optional int32 uid = 2 [(is_uid) = true];
6689
6690 // Name of package requesting permission
6691 optional string package_name = 3;
6692
6693 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
6694 // LABEL_ constants in GrantPermissionActivity.java
6695 optional int32 buttons_presented = 4;
6696
6697 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
6698 optional int32 button_clicked = 5;
6699}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01006700
6701/**
6702 * Information about LocationAccessCheck notification presented to user
6703 */
6704message LocationAccessCheckNotificationAction {
6705
6706 // id which identifies single session of user interacting with permission controller
6707 optional int64 session_id = 1;
6708
6709 // Uid of package for which location access check is presented
6710 optional int32 package_uid = 2;
6711
6712 // Name of package for which location access check is presented
6713 optional string package_name = 3;
6714
6715 enum Result {
6716 UNDEFINED = 0;
6717 // notification was presented to the user
6718 NOTIFICATION_PRESENTED = 1;
6719 // notification was declined by the user
6720 NOTIFICATION_DECLINED = 2;
6721 // notification was clicked by the user
6722 NOTIFICATION_CLICKED = 3;
6723 }
6724
6725 // View / interaction recorded
6726 optional Result result = 4;
6727}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01006728
6729/**
6730 * Information about a permission grant or revoke made by user inside AppPermissionFragment
6731 */
6732message AppPermissionFragmentActionReported {
6733 // id which identifies single session of user interacting with permission controller
6734 optional int64 session_id = 1;
6735
6736 // unique value identifying a permission group change. A permission group change might result
6737 // in multiple of these atoms
6738 optional int64 change_id = 2;
6739
6740 // UID of package the permission belongs to
6741 optional int32 uid = 3 [(is_uid) = true];
6742
6743 // Name of package the permission belongs to
6744 optional string package_name = 4;
6745
6746 // The permission to be granted
6747 optional string permission_name = 5;
6748
6749 // The result of the permission grant
6750 optional bool permission_granted = 6;
6751}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01006752
6753/**
6754* Information about a AppPermissionFragment viewed by user
6755*/
6756message AppPermissionFragmentViewed {
6757 // id which identifies single session of user interacting with permission controller
6758 optional int64 session_id = 1;
6759
6760 // UID of package for which permissions are viewed
6761 optional int32 uid = 2 [(is_uid) = true];
6762
6763 // Name of package for which permissions are viewed
6764 optional string package_name = 3;
6765
6766 // Permission group viewed
6767 optional string permission_group_name = 4;
6768}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01006769
6770/**
6771* Information about a AppPermissionsFragment viewed by user
6772*/
6773message AppPermissionsFragmentViewed {
6774 // id which identifies single session of user interacting with permission controller
6775 optional int64 session_id = 1;
6776
6777 // id which identifies single view as every view might have several logging records
6778 // with different package information attached
6779 optional int64 view_id = 2;
6780
6781 // Permission group viewed
6782 optional string permission_group_name = 3;
6783
6784 // UID of package for which permissions are viewed
6785 optional int32 uid = 4 [(is_uid) = true];
6786
6787 // Name of package for which permissions are viewed
6788 optional string package_name = 5;
6789
6790 // Category in which permission is included
6791 enum Category {
6792 UNDEFINED = 0;
6793 ALLOWED = 1;
6794 ALLOWED_FOREGROUND = 2;
6795 DENIED = 3;
6796 }
6797 optional Category category = 6;
6798}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01006799
6800/**
6801* Information about a PermissionAppsFragment viewed by user.
6802* Logged from ui/handheld/PermissionAppsFragment.java
6803*/
6804message PermissionAppsFragmentViewed {
6805 // id which identifies single session of user interacting with permission controller
6806 optional int64 session_id = 1;
6807
6808 // id which identifies single view as every view might have several logging records
6809 // with different package information attached
6810 optional int64 view_id = 2;
6811
6812 // Permission group viewed
6813 optional string permission_group_name = 3;
6814
6815 // UID of package for which permissions are viewed
6816 optional int32 uid = 4 [(is_uid) = true];
6817
6818 // Name of package for which permissions are viewed
6819 optional string package_name = 5;
6820
6821 // Category in which app is included
6822 enum Category {
6823 UNDEFINED = 0;
6824 ALLOWED = 1;
6825 ALLOWED_FOREGROUND = 2;
6826 DENIED = 3;
6827 }
6828 optional Category category = 6;
6829}
atrost1516d522019-08-28 15:40:37 +01006830
6831/**
6832 * Logs when a compatibility change is affecting an app.
6833 *
6834 * Logged from:
6835 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
6836 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
6837 */
6838message AppCompatibilityChangeReported {
6839 // The UID of the app being affected by the compatibilty change.
6840 optional int32 uid = 1 [(is_uid) = true];
6841
6842 // The ID of the change affecting the app.
6843 optional int64 change_id = 2;
6844
6845 enum State {
6846 UNKNOWN_STATE = 0;
6847 ENABLED = 1;
6848 DISABLED = 2;
6849 LOGGED = 3;
6850 }
6851
6852 // The state of the change - if logged from gating whether it was enabled or disabled, or just
6853 // logged otherwise.
6854 optional State state = 3;
6855
6856 enum Source {
6857 UNKNOWN_SOURCE = 0;
6858 APP_PROCESS = 1;
6859 SYSTEM_SERVER = 2;
6860 }
6861
6862 // Where it was logged from.
6863 optional Source source = 4;
6864
6865}
Hector Dearman25af7732019-11-19 16:28:59 +00006866
6867/**
6868 * Logged from
6869 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
6870 */
6871message PerfettoUploaded {
6872 enum Event {
6873 PERFETTO_UNDEFINED = 0;
6874 PERFETTO_TRACE_BEGIN = 1;
6875 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
6876 PERFETTO_ON_CONNECT = 3;
6877 PERFETTO_ON_TRACING_DISABLED = 4;
6878 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
6879 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
6880 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
6881 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
6882 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
6883 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
6884 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
6885 PERFETTO_TRIGGER_BEGIN = 12;
6886 PERFETTO_TRIGGER_SUCCESS = 13;
6887 PERFETTO_TRIGGER_FAILURE = 14;
6888 PERFETTO_HIT_GUARDRAILS = 15;
6889 PERFETTO_ON_TIMEOUT = 16;
6890 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
6891 }
6892
6893 // Which stage of the pipeline we are reporting from.
6894 optional Event event = 1;
6895
6896 // UUID matching the one set inside the SystemInfo trace packet.
6897 optional int64 trace_uuid_lsb = 2;
6898 optional int64 trace_uuid_msb = 3;
6899}
Tianjie Xuac6ffdb2019-07-22 14:25:14 -07006900
6901/**
6902 * Information about an OTA update attempt by update_engine.
6903 * Logged from platform/system/update_engine/metrics_reporter_android.cc
6904 */
6905message UpdateEngineUpdateAttemptReported {
6906 // The number of attempts for the update engine to apply a given payload.
6907 optional int32 attempt_number = 1;
6908
6909 optional android.stats.otaupdate.PayloadType payload_type = 2;
6910
6911 // The total time in minutes for the update engine to apply a given payload.
6912 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
6913 // it's increased when the system is sleeping.
6914 optional int32 duration_boottime_in_minutes = 3;
6915
6916 // The total time in minutes for the update engine to apply a given payload.
6917 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
6918 // and it's not increased when the system is sleeping.
6919 optional int32 duration_monotonic_in_minutes = 4;
6920
6921 // The size of the payload in MiBs.
6922 optional int32 payload_size_mib = 5;
6923
6924 // The attempt result reported by the update engine for an OTA update.
6925 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
6926
6927 // The error code reported by the update engine after an OTA update attempt
6928 // on A/B devices.
6929 optional android.stats.otaupdate.ErrorCode error_code = 7;
6930
6931 // The build fingerprint of the source system. The value is read from a
6932 // system property when the device takes the update. e.g.
6933 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
6934 optional string source_fingerprint = 8;
6935}
6936
6937/**
6938 * Information about all the attempts the device make before finishing the
6939 * successful update.
6940 * Logged from platform/system/update_engine/metrics_reporter_android.cc
6941 */
6942message UpdateEngineSuccessfulUpdateReported {
6943 // The number of attempts for the update engine to apply the payload for a
6944 // successful update.
6945 optional int32 attempt_count = 1;
6946
6947 optional android.stats.otaupdate.PayloadType payload_type = 2;
6948
6949 optional int32 payload_size_mib = 3;
6950
6951 // The total number of bytes downloaded by update_engine since the last
6952 // successful update.
6953 optional int32 total_bytes_downloaded_mib = 4;
6954
6955 // The ratio in percentage of the over-downloaded bytes compared to the
6956 // total bytes needed to successfully install the update. e.g. 200 if we
6957 // download 200MiB in total for a 100MiB package.
6958 optional int32 download_overhead_percentage = 5;
6959
6960 // The total time in minutes for the update engine to apply the payload for a
6961 // successful update.
6962 optional int32 total_duration_minutes = 6;
6963
6964 // The number of reboot of the device during a successful update.
6965 optional int32 reboot_count = 7;
6966}