blob: 8c94e29877c8549ba60d783df39eda217dd46363 [file] [log] [blame]
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070018
19package android.os.statsd;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070020option java_package = "com.android.os";
Stefan Lafonae2df012017-11-14 09:17:21 -080021option java_outer_classname = "AtomsProto";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070022
Yao Chen9c1debe2018-02-19 14:39:19 -080023import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
Bookatzdb026a22018-01-10 19:01:56 -080024import "frameworks/base/core/proto/android/app/enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070025import "frameworks/base/core/proto/android/app/job/enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070026import "frameworks/base/core/proto/android/app/settings_enums.proto";
Jack Hec27040a2019-01-09 20:54:41 -080027import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080028import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack Heab86dbd22018-12-18 15:43:27 -080029import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080030import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Jack He1021a612019-01-20 21:22:46 -080031import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto";
Michael Groover9e7b06e2018-12-28 19:55:51 -080032import "frameworks/base/core/proto/android/debug/enums.proto";
Kevin Chyn1741a072019-01-17 11:54:40 -080033import "frameworks/base/core/proto/android/hardware/biometrics/enums.proto";
joshmccloskey8c3322e2019-01-09 18:25:57 -080034import "frameworks/base/core/proto/android/hardware/sensor/assist/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080035import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080036import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080037import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080038import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080039import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080040import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070041import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080042import "frameworks/base/core/proto/android/service/usb.proto";
Chiachang Wang0e88ebf2019-03-21 10:18:07 +080043import "frameworks/base/core/proto/android/stats/connectivity/network_stack.proto";
lifra2e19c02019-04-16 22:16:30 +080044import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.proto";
Bookatz11257ca2018-12-05 18:22:39 -080045import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
46import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070047import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
48import "frameworks/base/core/proto/android/stats/enums.proto";
49import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070050import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Hongyi Zhang700137e2019-05-23 21:19:36 -070051import "frameworks/base/core/proto/android/stats/location/location_enums.proto";
Ray Essick8ab04df2019-02-15 11:01:02 -080052import "frameworks/base/core/proto/android/stats/mediametrics/mediametrics.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000053import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080054import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080055import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080056import "frameworks/base/core/proto/android/telephony/enums.proto";
57import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080058import "frameworks/base/core/proto/android/wifi/enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080059
Yao Chend54f9dd2017-10-17 17:37:48 +000060/**
Stefan Lafonae2df012017-11-14 09:17:21 -080061 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000062 * raw stats log events from the Android system, also known as "atoms."
63 *
64 * This field contains a single oneof with all of the available messages.
65 * The stats-log-api-gen tool runs as part of the Android build and
66 * generates the android.util.StatsLog class, which contains the constants
67 * and methods that Android uses to log.
68 *
Stefan Lafonae2df012017-11-14 09:17:21 -080069 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000070 * Instead, statsd on Android constructs these messages synthetically,
71 * in the format defined here and in stats_log.proto.
72 */
Stefan Lafonae2df012017-11-14 09:17:21 -080073message Atom {
74 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070075 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070076 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
77 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070078 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070079 BleScanResultReceived ble_scan_result_received = 4;
80 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080081 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070082 SyncStateChanged sync_state_changed = 7;
83 ScheduledJobStateChanged scheduled_job_state_changed = 8;
84 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070085 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080086 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
87 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
88 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070089 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
90 MemoryFactorStateChanged memory_factor_state_changed = 15;
91 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
92 CachedKillReported cached_kill_reported = 17;
93 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070094 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080095 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
96 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
97 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -070098 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -080099 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -0700100 CameraStateChanged camera_state_changed = 25;
101 FlashlightStateChanged flashlight_state_changed = 26;
102 UidProcessStateChanged uid_process_state_changed = 27;
103 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
104 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -0700105 BatteryLevelChanged battery_level_changed = 30;
106 ChargingStateChanged charging_state_changed = 31;
107 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -0700108 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800109 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -0700110 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
111 KernelWakeupReported kernel_wakeup_reported = 36;
Bookatze5885242017-10-24 20:10:31 -0700112 WifiLockStateChanged wifi_lock_state_changed = 37;
113 WifiSignalStrengthChanged wifi_signal_strength_changed = 38;
114 WifiScanStateChanged wifi_scan_state_changed = 39;
115 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700116 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700117 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700118 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900119 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700120 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800121 AnomalyDetected anomaly_detected = 46;
Andrei Oneada01ea52019-01-30 15:28:36 +0000122 AppBreadcrumbReported app_breadcrumb_reported = 47 [(allow_from_any_uid) = true];
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800123 AppStartOccurred app_start_occurred = 48;
124 AppStartCanceled app_start_canceled = 49;
125 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800126 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800127 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Tej Singh4503e102018-01-04 14:35:01 -0800128 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800129 LmkStateChanged lmk_state_changed = 54;
130 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800131 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800132 BootSequenceReported boot_sequence_reported = 57;
Andrei Oneada01ea52019-01-30 15:28:36 +0000133 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -0800134 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800135 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800136 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800137 KeyguardStateChanged keyguard_state_changed = 62;
138 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
139 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800140 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800141 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800142 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
143 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800144 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700145 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800146 SpeakerImpedanceReported speaker_impedance_reported = 71;
147 HardwareFailed hardware_failed = 72;
148 PhysicalDropDetected physical_drop_detected = 73;
149 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800150 MobileConnectionStateChanged mobile_connection_state_changed = 75;
151 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700152 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800153 AppCrashOccurred app_crash_occurred = 78;
154 ANROccurred anr_occurred = 79;
155 WTFOccurred wtf_occurred = 80;
156 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700157 GenericAtom generic_atom = 82;
jianjin6eada302019-02-28 11:25:57 -0800158 KeyValuePairsAtom key_value_pairs_atom = 83 [(allow_from_any_uid) = true];
Bookatza7020bd2018-08-28 16:29:35 -0700159 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700160 DeferredJobStatsReported deferred_job_stats_reported = 85;
Tej Singha72344992019-04-17 18:55:08 -0700161 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Kevin Chyn1741a072019-01-17 11:54:40 -0800162 BiometricAcquired biometric_acquired = 87;
163 BiometricAuthenticated biometric_authenticated = 88;
164 BiometricErrorOccurred biometric_error_occurred = 89;
Howard Ro0db82032019-04-07 18:43:34 -0700165 // Atom number 90 is available for use.
Howard Roa46b6582018-09-18 16:45:02 -0700166 BatteryHealthSnapshot battery_health_snapshot = 91;
167 SlowIo slow_io = 92;
168 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700169 PhoneServiceStateChanged phone_service_state_changed = 94;
170 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100171 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700172 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700173 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700174 // TODO: service state change is very noisy shortly after boot, as well
175 // as at other transitions - coming out of doze, device plugged in, etc.
176 // Consider removing this if it becomes a problem
177 ServiceStateChanged service_state_changed = 99;
178 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800179 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800180 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000181 DevicePolicyEvent device_policy_event = 103;
shawnlin9a1392a2019-04-09 16:21:17 +0800182 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled =
183 104 [(log_from_module) = "docsui"];
184 DocsUIFileOperationCopyMoveModeReported
185 docs_ui_file_op_copy_move_mode_reported =
186 105 [(log_from_module) = "docsui"];
187 DocsUIFileOperationFailureReported docs_ui_file_op_failure =
188 106 [(log_from_module) = "docsui"];
189 DocsUIFileOperationReported docs_ui_provider_file_op =
190 107 [(log_from_module) = "docsui"];
191 DocsUIInvalidScopedAccessRequestReported
192 docs_ui_invalid_scoped_access_request =
193 108 [(log_from_module) = "docsui"];
194 DocsUILaunchReported docs_ui_launch_reported =
195 109 [(log_from_module) = "docsui"];
196 DocsUIRootVisitedReported docs_ui_root_visited =
197 110 [(log_from_module) = "docsui"];
198 DocsUIStartupMsReported docs_ui_startup_ms =
199 111 [(log_from_module) = "docsui"];
200 DocsUIUserActionReported docs_ui_user_action_reported =
201 112 [(log_from_module) = "docsui"];
Bookatzda1798c2018-12-13 14:16:00 -0800202 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
203 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f62018-12-06 11:01:38 +0000204 AppCompacted app_compacted = 115;
lifre82d8f62019-03-25 20:33:21 +0800205 NetworkDnsEventReported network_dns_event_reported = 116 [(log_from_module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800206 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
207 117 [(log_from_module) = "docsui"];
208 DocsUIPickResultReported docs_ui_pick_result_reported =
209 118 [(log_from_module) = "docsui"];
210 DocsUISearchModeReported docs_ui_search_mode_reported =
211 119 [(log_from_module) = "docsui"];
212 DocsUISearchTypeReported docs_ui_search_type_reported =
213 120 [(log_from_module) = "docsui"];
Chiachang Wange512b262019-04-11 21:24:28 +0800214 DataStallEvent data_stall_event = 121 [(log_from_module) = "network_stack"];
Christian Brunschenf86039e2018-12-21 12:26:14 +0000215 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000216 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800217 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800218 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800219 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
220 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000221 AppDowngraded app_downgraded = 128;
222 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
223 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800224 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
225 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800226 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800227 NfcErrorOccurred nfc_error_occurred = 134;
228 NfcStateChanged nfc_state_changed = 135;
229 NfcBeamOccurred nfc_beam_occurred = 136;
230 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
231 NfcTagOccurred nfc_tag_occurred = 138;
232 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
233 SeStateChanged se_state_changed = 140;
234 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800235 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800236 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800237 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800238 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800239 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800240 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyne5a37fb2019-02-08 13:10:36 -0800241 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500242 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800243 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Jack Hec27040a2019-01-09 20:54:41 -0800244 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
245 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
246 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
247 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
248 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
249 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
250 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
251 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
252 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He1021a612019-01-20 21:22:46 -0800253 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
254 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
Jack Heaea26982019-04-04 11:19:48 -0700255 BluetoothDeviceInfoReported bluetooth_device_info_reported = 162;
Jack He1021a612019-01-20 21:22:46 -0800256 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
257 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
258 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
259 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
260 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Alex Salod7c3eef2019-01-25 14:43:27 -0800261 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800262 ProcessStartTime process_start_time = 169;
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700263 PermissionGrantRequestResultReported permission_grant_request_result_reported =
264 170 [(log_from_module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800265 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Michael Groover4a0ca942019-01-24 17:41:25 -0800266 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Steven Wu552f63f2019-02-05 13:41:36 -0500267 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
joshmccloskey8c3322e2019-01-09 18:25:57 -0800268 AssistGestureStageReported assist_gesture_stage_reported = 174;
269 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
270 AssistGestureProgressReported assist_gesture_progress_reported = 176;
Philip Quinn0eded622019-01-29 12:46:28 -0800271 TouchGestureClassified touch_gesture_classified = 177;
Andrei Onea4ad6d0c2019-02-08 13:54:12 +0000272 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true];
Kunhung Li286c52f2019-05-21 20:10:43 +0800273 StyleUIChanged style_ui_changed = 179 [(log_from_module) = "style"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700274 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Tej Singha72344992019-04-17 18:55:08 -0700275 180 [(log_from_module) = "permissioncontroller"];
Carmen Agimof6688a352019-01-30 19:36:04 +0000276 AppInstallOnExternalStorageReported app_install_on_external_storage_reported = 181;
Chiachang Wange512b262019-04-11 21:24:28 +0800277 NetworkStackReported network_stack_reported = 182 [(log_from_module) = "network_stack"];
Carmen Agimof6dcc5032019-03-01 16:20:09 +0000278 AppMovedStorageReported app_moved_storage_reported = 183;
joshmccloskey6f952b22019-03-25 20:59:35 -0700279 BiometricEnrolled biometric_enrolled = 184;
jianjin8f2dee02019-03-29 14:03:08 -0700280 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185;
281 TombStoneOccurred tomb_stone_occurred = 186;
Jack He71426802019-04-02 13:32:52 -0700282 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported = 187;
Ben Blount763a5d52019-04-10 11:48:58 -0700283 IntelligenceEventReported intelligence_event_reported =
284 188 [(log_from_module) = "intelligence"];
Tej Singha72344992019-04-17 18:55:08 -0700285 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed = 189;
Hai Zhang5d3328d2019-04-13 21:25:06 +0800286 RoleRequestResultReported role_request_result_reported =
287 190 [(log_from_module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800288 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
289 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
290 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
291 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
292 MediametricsCodecReported mediametrics_codec_reported = 195;
293 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
294 MediametricsExtractorReported mediametrics_extractor_reported = 197;
295 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
296 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
297 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Yuncheol Heod1a85d22019-05-08 17:13:42 -0700298 CarPowerStateChanged car_power_state_changed = 203;
299 GarageModeInfo garage_mode_info = 204;
Tej Singhc9203082019-05-03 13:42:23 -0700300 TestAtomReported test_atom_reported = 205 [(log_from_module) = "cts"];
Adam Heff2185342019-01-23 15:59:09 -0800301 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported = 206;
302 ContentCaptureServiceEvents content_capture_service_events = 207;
303 ContentCaptureSessionEvents content_capture_session_events = 208;
304 ContentCaptureFlushed content_capture_flushed = 209;
Hongyi Zhang700137e2019-05-23 21:19:36 -0700305 LocationManagerApiUsageReported location_manager_api_usage_reported = 210;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100306 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
307 211 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100308 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
309 212 [(log_from_module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100310 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
311 213 [(log_from_module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100312 LocationAccessCheckNotificationAction location_access_check_notification_action =
313 214 [(log_from_module) = "permissioncontroller"];
Yao Chend54f9dd2017-10-17 17:37:48 +0000314 }
David Chenc8a43242017-10-17 16:23:28 -0700315
David Chen6e3e6cb2018-01-03 16:14:06 -0800316 // Pulled events will start at field 10000.
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700317 // Next: 10059
David Chenc8a43242017-10-17 16:23:28 -0700318 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800319 WifiBytesTransfer wifi_bytes_transfer = 10000;
320 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
321 MobileBytesTransfer mobile_bytes_transfer = 10002;
322 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800323 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800324 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800325 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800326 CpuTimePerFreq cpu_time_per_freq = 10008;
327 CpuTimePerUid cpu_time_per_uid = 10009;
328 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800329 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800330 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800331 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800332 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800333 SystemElapsedRealtime system_elapsed_realtime = 10014;
334 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800335 CpuActiveTime cpu_active_time = 10016;
336 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000337 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800338 RemainingBatteryCapacity remaining_battery_capacity = 10019;
339 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800340 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100341 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100342 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100343 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000344 DiskStats disk_stats = 10025;
345 DirectoryUsage directory_usage = 10026;
346 AppSize app_size = 10027;
347 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700348 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700349 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800350 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700351 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700352 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800353 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700354 ProcessCpuTime process_cpu_time = 10035;
Rafal Slawik08621582018-10-15 14:53:07 +0100355 NativeProcessMemoryState native_process_memory_state = 10036;
Misha Wagner5a51e002018-10-03 15:04:09 +0100356 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700357 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee60422018-11-09 12:27:37 -0800358 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
359 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
360 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000361 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800362 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800363 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800364 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000365 DebugElapsedClock debug_elapsed_clock = 10046;
366 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800367 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800368 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800369 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800370 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000371 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000372 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800373 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
374 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000375 SystemIonHeapSize system_ion_heap_size = 10056;
Carmen Agimofa769c152019-03-04 14:39:14 +0000376 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700377 FaceSettings face_settings = 10058;
Maggie White442b6312019-04-05 16:26:44 -0700378 CoolingDevice cooling_device = 10059;
Martijn Coenencd95d462019-04-25 17:09:45 +0200379 AppOps app_ops = 10060;
David Chenc8a43242017-10-17 16:23:28 -0700380 }
yroa1fe77c2018-02-26 14:22:54 -0800381
Bookatz76aafcf2018-09-17 16:17:10 -0700382 // DO NOT USE field numbers above 100,000 in AOSP.
383 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
384 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700385}
386
Yao Chend54f9dd2017-10-17 17:37:48 +0000387/**
Yangster-mac20877162017-12-22 17:19:39 -0800388 * This proto represents a node of an attribution chain.
389 * Note: All attribution chains are represented as a repeated field of type
390 * AttributionNode. It is understood that in such arrays, the order is that
391 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000392 */
Yangster-mac20877162017-12-22 17:19:39 -0800393message AttributionNode {
394 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800395 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800396
Yangster-mac20877162017-12-22 17:19:39 -0800397 // The (optional) string tag for an element in the attribution chain. If the
398 // element has no tag, it is encoded as an empty string.
399 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700400}
401
Yangster-mac48b3d622018-08-18 12:38:11 -0700402message KeyValuePair {
403 optional int32 key = 1;
404 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700405 int32 value_int = 2;
406 int64 value_long = 3;
407 string value_str = 4;
408 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700409 }
410}
411
412message KeyValuePairsAtom {
413 optional int32 uid = 1;
414 repeated KeyValuePair pairs = 2;
415}
416
Yao Chend54f9dd2017-10-17 17:37:48 +0000417/*
418 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800419 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000420 *
421 * RULES:
422 * - The field ids for each atom must start at 1, and count upwards by 1.
423 * Skipping field ids is not allowed.
424 * - These form an API, so renaming, renumbering or removing fields is
425 * not allowed between android releases. (This is not currently enforced,
426 * but there will be a tool to enforce this restriction).
427 * - The types must be built-in protocol buffer types, namely, no sub-messages
428 * are allowed (yet). The bytes type is also not allowed.
429 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800430 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000431 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800432 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000433 * - A field that is a uid should be a string field, tagged with the [xxx]
434 * annotation. The generated code on android will be represented by UIDs,
435 * and those UIDs will be translated in xxx to those strings.
436 *
437 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700438 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000439 * - If there is a UID, it goes first. Think in an object-oriented fashion.
440 * *****************************************************************************
441 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700442
Yao Chend54f9dd2017-10-17 17:37:48 +0000443/**
Tej Singha72344992019-04-17 18:55:08 -0700444 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700445 * Logs when the Thermal service HAL notifies the throttling start/stop events.
446 *
447 * Logged from:
448 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
449 */
450message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700451 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700452 optional android.os.TemperatureTypeEnum sensor_type = 1;
453
Maggie White442b6312019-04-05 16:26:44 -0700454 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700455 enum State {
456 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700457 START = 1; // START indicated that throttling was triggered.
458 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700459 }
Yangster-mace16189a2018-08-26 12:20:16 -0700460 optional State state = 2;
461
462 optional float temperature = 3;
463}
464
465/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000466 * Logs when the screen state changes.
467 *
468 * Logged from:
469 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
470 */
471message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800472 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700473 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700474}
Yao Chend54f9dd2017-10-17 17:37:48 +0000475
476/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700477 * Logs that the process state of the uid, as determined by ActivityManager
478 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000479 *
480 * Logged from:
481 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
482 */
Bookatzc1a050a2017-10-10 15:49:28 -0700483message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700484 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000485
Bookatzdb026a22018-01-10 19:01:56 -0800486 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700487 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000488}
489
490/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700491 * Logs process state change of a process, as per the activity manager.
492 *
493 * Logged from:
494 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
495 */
496message ProcessStateChanged {
497 optional int32 uid = 1;
498 optional string process_name = 2;
499 optional string package_name = 3;
500 // TODO: remove this when validation is done
501 optional int64 version = 5;
502 // The state, from frameworks/base/core/proto/android/app/enums.proto.
503 optional android.app.ProcessStateEnum state = 4;
504}
505
506/**
507 * Logs when ActivityManagerService sleep state is changed.
508 *
509 * Logged from:
510 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
511 */
512message ActivityManagerSleepStateChanged {
513 // TODO: import frameworks proto
514 enum State {
515 UNKNOWN = 0;
516 ASLEEP = 1;
517 AWAKE = 2;
518 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700519 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700520}
521
522/**
523 * Logs when system memory state changes.
524 *
525 * Logged from:
526 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
527 */
528message MemoryFactorStateChanged {
529 // TODO: import frameworks proto
530 enum State {
531 MEMORY_UNKNOWN = 0;
532 NORMAL = 1; // normal.
533 MODERATE = 2; // moderate memory pressure.
534 LOW = 3; // low memory.
535 CRITICAL = 4; // critical memory.
536
537 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700538 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700539}
540
541/**
542 * Logs when app is using too much cpu, according to ActivityManagerService.
543 *
544 * Logged from:
545 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
546 */
547message ExcessiveCpuUsageReported {
548 optional int32 uid = 1;
549 optional string process_name = 2;
550 optional string package_name = 3;
551 // package version. TODO: remove this when validation is done
552 optional int64 version = 4;
553}
554
555/**
556 * Logs when a cached process is killed, along with its pss.
557 *
558 * Logged from:
559 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
560 */
561message CachedKillReported {
562 optional int32 uid = 1;
563 optional string process_name = 2;
564 optional string package_name = 3;
565 // TODO: remove this when validation is done
566 optional int64 version = 5;
567 optional int64 pss = 4;
568}
569
570/**
571 * Logs when memory stats of a process is reported.
572 *
573 * Logged from:
574 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
575 */
576message ProcessMemoryStatReported {
577 optional int32 uid = 1;
578 optional string process_name = 2;
579 optional string package_name = 3;
580 //TODO: remove this when validation is done
581 optional int64 version = 9;
582 optional int64 pss = 4;
583 optional int64 uss = 5;
584 optional int64 rss = 6;
585 enum Type {
586 ADD_PSS_INTERNAL_SINGLE = 0;
587 ADD_PSS_INTERNAL_ALL_MEM = 1;
588 ADD_PSS_INTERNAL_ALL_POLL = 2;
589 ADD_PSS_EXTERNAL = 3;
590 ADD_PSS_EXTERNAL_SLOW = 4;
591 }
592 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800593 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700594}
595
596/**
Bookatzc1a050a2017-10-10 15:49:28 -0700597 * Logs that a process started, finished, crashed, or ANRed.
598 *
599 * Logged from:
600 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
601 */
602message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700603 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700604
David Chen0b5c90c2018-01-25 16:51:49 -0800605 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800606 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700607
Bookatzddccf0a2017-11-28 16:48:14 -0800608 // What lifecycle state the process changed to.
609 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800610 enum State {
611 FINISHED = 0;
612 STARTED = 1;
613 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800614 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800615 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700616}
617
Bookatzc1a050a2017-10-10 15:49:28 -0700618/**
619 * Logs when the ble scan state changes.
620 *
621 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700622 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700623 */
624message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800625 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700626
627 enum State {
628 OFF = 0;
629 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700630 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
631 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700632 }
633 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700634
Bookatze5ec0b42018-03-26 13:34:56 -0700635 // Does the scan have a filter.
636 optional bool is_filtered = 3;
637 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
638 optional bool is_first_match = 4;
639 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
640 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700641}
642
643/**
644 * Logs reporting of a ble scan finding results.
645 *
646 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700647 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700648 */
Bookatzae6738e2018-09-13 11:38:56 -0700649// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700650message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800651 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700652
653 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800654 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700655}
656
657/**
658 * Logs when a sensor state changes.
659 *
660 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700661 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700662 */
663message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800664 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700665
Bookatzc1a050a2017-10-10 15:49:28 -0700666 // The id (int) of the sensor.
667 optional int32 sensor_id = 2;
668
669 enum State {
670 OFF = 0;
671 ON = 1;
672 }
673 optional State state = 3;
674}
675
Bookatzc1a050a2017-10-10 15:49:28 -0700676/**
677 * Logs when GPS state changes.
678 *
679 * Logged from:
680 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
681 */
682message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800683 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700684
685 enum State {
686 OFF = 0;
687 ON = 1;
688 }
689 optional State state = 2;
690}
691
Bookatz48d362e2018-11-06 15:49:08 -0800692/**
693 * Logs when GPS signal quality.
694 *
695 * Logged from:
696 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
697 */
698message GpsSignalQualityChanged {
699 optional android.server.location.GpsSignalQualityEnum level = 1;
700}
701
Bookatzc1a050a2017-10-10 15:49:28 -0700702
703/**
704 * Logs when a sync manager sync state changes.
705 *
706 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700707 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700708 */
709message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800710 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700711
David Chen0b5c90c2018-01-25 16:51:49 -0800712 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800713 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700714
715 enum State {
716 OFF = 0;
717 ON = 1;
718 }
719 optional State state = 3;
720}
721
Yangster-mac96353002018-09-05 11:18:55 -0700722/*
723 * Deferred job stats.
724 *
725 * Logged from:
726 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
727*/
728message DeferredJobStatsReported {
729 repeated AttributionNode attribution_node = 1;
730
731 // Number of jobs deferred.
732 optional int32 num_jobs_deferred = 2;
733
734 // Time since the last job runs.
735 optional int64 time_since_last_job_millis = 3;
736}
737
Bookatzc1a050a2017-10-10 15:49:28 -0700738/**
739 * Logs when a job scheduler job state changes.
740 *
741 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700742 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700743 */
744message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800745 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700746
747 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800748 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700749
750 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800751 FINISHED = 0;
752 STARTED = 1;
753 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700754 }
755 optional State state = 3;
756
Tej Singh33a412b2018-03-16 18:43:59 -0700757 // The reason a job has stopped.
758 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700759 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700760 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100761
762 // The standby bucket of the app that scheduled the job. These match the framework constants
763 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
764 // already assigned 0.
765 enum Bucket {
766 UNKNOWN = -1;
767 ACTIVE = 0;
768 WORKING_SET = 1;
769 FREQUENT = 2;
770 RARE = 3;
771 NEVER = 4;
772 }
773 optional Bucket standby_bucket = 5 [default = UNKNOWN];
774
775 // The job id (as assigned by the app).
776 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700777}
778
779/**
780 * Logs when the audio state changes.
781 *
782 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700783 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700784 */
785message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800786 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700787
788 enum State {
789 OFF = 0;
790 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700791 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
792 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700793 }
794 optional State state = 2;
795}
796
797/**
798 * Logs when the video codec state changes.
799 *
800 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700801 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700802 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800803message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800804 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700805
806 enum State {
807 OFF = 0;
808 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700809 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
810 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700811 }
812 optional State state = 2;
813}
814
815/**
816 * Logs when the flashlight state changes.
817 *
818 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700819 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700820 */
821message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800822 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700823
824 enum State {
825 OFF = 0;
826 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700827 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
828 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700829 }
830 optional State state = 2;
831}
832
833/**
834 * Logs when the camera state changes.
835 *
836 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700837 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700838 */
839message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800840 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700841
842 enum State {
843 OFF = 0;
844 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700845 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
846 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700847 }
848 optional State state = 2;
849}
850
851/**
852 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000853 *
854 * Logged from:
855 * TODO
856 */
Bookatzd6746242017-10-24 18:39:35 -0700857message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800858 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000859
Bookatz1a1b0462018-01-12 11:47:03 -0800860 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
861 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700862 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700863
864 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
865 optional string tag = 3;
866
867 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800868 RELEASE = 0;
869 ACQUIRE = 1;
870 CHANGE_RELEASE = 2;
871 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700872 }
873 optional State state = 4;
874}
875
876/**
Bookatzc1a050a2017-10-10 15:49:28 -0700877 * Logs when a partial wakelock is considered 'long' (over 1 min).
878 *
879 * Logged from:
880 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
881 */
882message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800883 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700884
Yao Chend54f9dd2017-10-17 17:37:48 +0000885 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
886 optional string tag = 2;
887
Bookatzc1a050a2017-10-10 15:49:28 -0700888 // TODO: I have no idea what this is.
889 optional string history_tag = 3;
890
891 enum State {
892 OFF = 0;
893 ON = 1;
894 }
895 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000896}
897
Bookatzc1a050a2017-10-10 15:49:28 -0700898/**
Bookatza66083f2018-09-20 17:24:00 -0700899 * Logs when the device is interactive, according to the PowerManager Notifier.
900 *
901 * Logged from:
902 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
903 */
904message InteractiveStateChanged {
905 enum State {
906 OFF = 0;
907 ON = 1;
908 }
909 optional State state = 1;
910}
911
912/**
Bookatzc1a050a2017-10-10 15:49:28 -0700913 * Logs Battery Saver state change.
914 *
915 * Logged from:
916 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
917 */
918message BatterySaverModeStateChanged {
919 enum State {
920 OFF = 0;
921 ON = 1;
922 }
923 optional State state = 1;
924}
925
926/**
927 * Logs Doze mode state change.
928 *
929 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800930 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700931 */
932message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800933 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800934}
935
936
937/**
938 * Logs state change of Doze mode including maintenance windows.
939 *
940 * Logged from:
941 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
942 */
943message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800944 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700945}
946
947/**
948 * Logs screen brightness level.
949 *
950 * Logged from:
951 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
952 */
953message ScreenBrightnessChanged {
954 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
955 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700956}
957
958/**
959 * Logs battery level (percent full, from 0 to 100).
960 *
961 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700962 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700963 */
964message BatteryLevelChanged {
965 // Battery level. Should be in [0, 100].
966 optional int32 battery_level = 1;
967}
968
969/**
970 * Logs change in charging status of the device.
971 *
972 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700973 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700974 */
975message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800976 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
977 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700978}
979
980/**
981 * Logs whether the device is plugged in, and what power source it is using.
982 *
983 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700984 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -0700985 */
986message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800987 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
988 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700989}
990
Bookatz8c6571b2017-10-24 15:04:41 -0700991/**
992 * Logs when an app's wakeup alarm fires.
993 *
994 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -0700995 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -0700996 */
997message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -0800998 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800999
1000 // Name of the wakeup alarm.
1001 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001002
1003 // Name of source package (for historical reasons, since BatteryStats tracked it).
1004 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001005
1006 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1007 enum Bucket {
1008 UNKNOWN = 0;
1009 EXEMPTED = 5;
1010 ACTIVE = 10;
1011 WORKING_SET = 20;
1012 FREQUENT = 30;
1013 RARE = 40;
1014 NEVER = 50;
1015 }
1016 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1017 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001018}
1019
1020/**
1021 * Logs when an an app causes the mobile radio to change state.
1022 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1023 *
1024 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001025 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001026 */
1027message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001028 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001029
Bookatz1a1b0462018-01-12 11:47:03 -08001030 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1031 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001032}
1033
1034/**
1035 * Logs when an an app causes the wifi radio to change state.
1036 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1037 *
1038 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001039 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001040 */
1041message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001042 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001043
Bookatz1a1b0462018-01-12 11:47:03 -08001044 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1045 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001046}
1047
1048/**
1049 * Logs kernel wakeup reasons and aborts.
1050 *
1051 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001052 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001053 */
1054message KernelWakeupReported {
1055 // Name of the kernel wakeup reason (or abort).
1056 optional string wakeup_reason_name = 1;
1057
1058 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001059 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001060}
1061
1062/**
Bookatzda1798c2018-12-13 14:16:00 -08001063 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001064 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001065 *
1066 * Logged from:
1067 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1068 */
1069message WifiEnabledStateChanged {
1070 enum State {
1071 OFF = 0;
1072 ON = 1;
1073 }
1074 optional State state = 1;
1075}
1076
1077/**
1078 * 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 -08001079 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1080 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001081 *
1082 * Logged from:
1083 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1084 */
1085message WifiRunningStateChanged {
1086 repeated AttributionNode attribution_node = 1;
1087
1088 enum State {
1089 OFF = 0;
1090 ON = 1;
1091 }
1092 optional State state = 2;
1093}
1094
1095/**
Bookatze5885242017-10-24 20:10:31 -07001096 * Logs wifi locks held by an app.
1097 *
1098 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001099 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001100 */
1101message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001102 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001103
1104 enum State {
1105 OFF = 0;
1106 ON = 1;
1107 }
1108 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001109
1110 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1111 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001112}
1113
1114/**
1115 * Logs wifi signal strength changes.
1116 *
1117 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001118 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001119 */
1120message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001121 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1122 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001123}
1124
1125/**
1126 * Logs wifi scans performed by an app.
1127 *
1128 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001129 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001130 */
1131message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001132 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001133
1134 enum State {
1135 OFF = 0;
1136 ON = 1;
1137 }
1138 optional State state = 2;
1139}
1140
1141/**
Tej Singh4503e102018-01-04 14:35:01 -08001142 * Logs wifi multicast locks held by an app
1143 *
1144 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001145 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001146 */
1147message WifiMulticastLockStateChanged {
1148 repeated AttributionNode attribution_node = 1;
1149
1150 enum State {
1151 OFF = 0;
1152 ON = 1;
1153 }
1154 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001155
1156 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001157}
1158
1159/**
Tej Singh1ea42892018-01-19 09:27:00 -08001160 * Logs shutdown reason and duration on next boot.
1161 *
1162 * Logged from:
1163 * frameworks/base/core/java/com/android/server/BootReceiver.java
1164 */
1165message ShutdownSequenceReported {
1166 // True if shutdown is for a reboot. Default: false if we do not know.
1167 optional bool reboot = 1;
1168
1169 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1170 optional string reason = 2;
1171
1172 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1173 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001174 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001175
1176 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001177 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001178}
1179
Tej Singh6483ea42018-01-25 17:45:49 -08001180
1181/**
1182 * Logs boot reason and duration.
1183 *
1184 * Logged from:
1185 * system/core/bootstat/bootstat.cpp
1186 */
1187message BootSequenceReported {
1188 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1189 // Default: "<EMPTY>" if not available.
1190 optional string bootloader_reason = 1;
1191
1192 // Reason for system boot. Eg. bootloader, reboot,userrequested
1193 // Default: "<EMPTY>" if not available.
1194 optional string system_reason = 2;
1195
1196 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001197 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001198
1199 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001200 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001201
1202 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001203 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001204
1205 // Time since last boot in ms. Default: 0 if not available.
1206 optional int64 time_since_last_boot = 6;
1207}
1208
Tej Singhc477d9c2018-02-05 18:31:39 -08001209
1210/**
1211 * Logs call state and disconnect cause (if applicable).
1212 *
1213 * Logged from:
1214 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1215 */
1216message CallStateChanged {
1217 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1218 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1219 optional android.telecom.CallStateEnum call_state = 1;
1220
1221 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1222 // This value is only applicable when the call_state is DISCONNECTED, and
1223 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1224 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1225 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1226
1227 // True if the call is self-managed, which are apps that use the
1228 // telecom infrastructure to make their own calls.
1229 optional bool self_managed = 3;
1230
1231 // True if call is external. External calls are calls on connected Wear
1232 // devices but show up in Telecom so the user can pull them onto the device.
1233 optional bool external_call = 4;
1234}
1235
Tej Singh1ea42892018-01-19 09:27:00 -08001236/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001237 * Logs keyguard state. The keyguard is the lock screen.
1238 *
1239 * Logged from:
1240 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1241 */
1242message KeyguardStateChanged {
1243 enum State {
1244 UNKNOWN = 0;
1245 // The keyguard is hidden when the phone is unlocked.
1246 HIDDEN = 1;
1247 // The keyguard is shown when the phone is locked (screen turns off).
1248 SHOWN= 2;
1249 // The keyguard is occluded when something is overlaying the keyguard.
1250 // Eg. Opening the camera while on the lock screen.
1251 OCCLUDED = 3;
1252 }
1253 optional State state = 1;
1254}
1255
1256/**
1257 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1258 * prompts the user to enter a password (pattern, pin, etc).
1259 *
1260 * Logged from:
1261 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1262 */
1263
1264message KeyguardBouncerStateChanged {
1265 enum State {
1266 UNKNOWN = 0;
1267 // Bouncer is hidden, either as a result of successfully entering the
1268 // password, screen timing out, or user going back to lock screen.
1269 HIDDEN = 1;
1270 // This is when the user is being prompted to enter the password.
1271 SHOWN = 2;
1272 }
1273 optional State state = 1;
1274}
1275
1276/**
1277 * Logs the result of entering a password into the keyguard bouncer.
1278 *
1279 * Logged from:
1280 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1281 */
1282message KeyguardBouncerPasswordEntered {
1283 enum BouncerResult {
1284 UNKNOWN = 0;
1285 // The password entered was incorrect.
1286 FAILURE = 1;
1287 // The password entered was correct.
1288 SUCCESS = 2;
1289 }
1290 optional BouncerResult result = 1;
1291}
1292
Tej Singha883b372018-02-15 11:30:01 -08001293/*
1294 * Logs changes to the configuration of the device. The configuration is defined
1295 * in frameworks/base/core/java/android/content/res/Configuration.java
1296 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1297 * Please go there to interpret the possible values each field can be.
1298 *
1299 * Logged from:
1300 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1301 */
1302message ResourceConfigurationChanged {
1303 // Bit mask of color capabilities of the screen.
1304 // Contains information about the color gamut and hdr mode of the screen.
1305 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001306 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001307
1308 // The target screen density being rendered to.
1309 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001310 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001311
1312 // Current user preference for the scaling factor for fonts,
1313 // relative to the base density scaling.
1314 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001315 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001316
1317 // Flag indicating whether the hard keyboard is hidden.
1318 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001319 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001320
1321 // The type of keyboard attached to the device.
1322 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1323 optional int32 keyboard = 5;
1324
1325 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1326 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001327 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001328
1329 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1330 // 0 if undefined.
1331 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1332 optional int32 mcc = 7;
1333
1334 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1335 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1336 // MNC_ZERO symbol defined in Configuration.java.
1337 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1338 optional int32 mnc = 8;
1339
1340 // The kind of navigation available on the device.
1341 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1342 optional int32 navigation = 9;
1343
1344 // Flag indicating whether the navigation is available.
1345 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001346 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001347
1348 // Overall orientation of the screen.
1349 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1350 optional int32 orientation = 11;
1351
1352 // The current height of the available screen space, in dp units.
1353 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001354 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001355
1356 // Bit mask of overall layout of the screen.
1357 // Contains information about screen size, whether the screen is wider/taller
1358 // than normal, whether the screen layout is right-tl-left or left-to-right,
1359 // and whether the screen has a rounded shape.
1360 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001361 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001362
1363 // Current width of the available screen space, in dp units.
1364 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001365 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001366
1367 // The smallest screen size an application will see in normal operation.
1368 // This is the smallest value of both screenWidthDp and screenHeightDp
1369 // in portrait and landscape.
1370 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001371 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001372
1373 // The type of touch screen attached to the device.
1374 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1375 optional int32 touchscreen = 16;
1376
1377 // Bit mask of the ui mode.
1378 // Contains information about the overall ui mode of the device.
1379 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1380 // Also contains information about whether the device is in night mode.
1381 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001382 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001383}
1384
Tej Singheee317b2018-03-07 19:28:05 -08001385
1386/**
1387 * Logs changes in the connection state of the mobile radio.
1388 *
1389 * Logged from:
1390 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1391 */
1392message MobileConnectionStateChanged {
1393 // States are from the state machine DataConnection.java.
1394 enum State {
1395 UNKNOWN = 0;
1396 // The connection is inactive, or disconnected.
1397 INACTIVE = 1;
1398 // The connection is being activated, or connecting.
1399 ACTIVATING = 2;
1400 // The connection is active, or connected.
1401 ACTIVE = 3;
1402 // The connection is disconnecting.
1403 DISCONNECTING = 4;
1404 // The connection is disconnecting after creating a connection.
1405 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1406 }
1407 optional State state = 1;
1408 // For multi-sim phones, this distinguishes between the sim cards.
1409 optional int32 sim_slot_index = 2;
1410 // Used to identify the connection. Starts at 0 and increments by 1 for
1411 // every new network created. Resets whenever the device reboots.
1412 optional int32 data_connection_id = 3;
1413 // A bitmask for the capabilities of this connection.
1414 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1415 // Default value (if we have no information): 0
1416 optional int64 capabilities = 4;
1417 // If this connection has internet.
1418 // This just checks if the DEFAULT bit of capabilities is set.
1419 optional bool has_internet = 5;
1420}
1421
1422/**
1423 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1424 *
1425 * Logged from:
1426 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1427 */
1428message MobileRadioTechnologyChanged {
1429 optional android.telephony.NetworkTypeEnum state = 1;
1430 // For multi-sim phones, this distinguishes between the sim cards.
1431 optional int32 sim_slot_index = 2;
1432}
1433
Andrew Chantb56388b2018-03-22 21:07:33 -07001434/**
1435 * Logs the VID and PID of any connected USB devices.
1436 *
1437 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1438 *
1439 * Logged by Vendor.
1440 */
1441message UsbDeviceAttached {
1442 optional int32 vid = 1;
1443 optional int32 pid = 2;
1444 optional bool has_audio = 3;
1445 optional bool has_hid = 4;
1446 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001447 enum State {
1448 STATE_DISCONNECTED = 0;
1449 STATE_CONNECTED = 1;
1450 }
1451 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001452 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001453}
1454
Tej Singheee317b2018-03-07 19:28:05 -08001455
Tej Singhdd7bd352018-02-09 19:33:15 -08001456/**
Tej Singh5d991e12018-03-09 19:48:11 -08001457 * Logs when Bluetooth is enabled and disabled.
1458 *
1459 * Logged from:
1460 * services/core/java/com/android/server/BluetoothManagerService.java
1461 */
1462message BluetoothEnabledStateChanged {
1463 repeated AttributionNode attribution_node = 1;
1464 // Whether or not bluetooth is enabled on the device.
1465 enum State {
1466 UNKNOWN = 0;
1467 ENABLED = 1;
1468 DISABLED = 2;
1469 }
1470 optional State state = 2;
1471 // The reason for being enabled/disabled.
1472 // Eg. Airplane mode, crash, application request.
1473 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1474 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001475 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001476}
1477
1478/**
Jack Hed9837c82019-01-09 01:19:13 -08001479 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001480 *
1481 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001482 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1483 *
1484 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001485 */
1486message BluetoothConnectionStateChanged {
1487 // The state of the connection.
1488 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1489 optional android.bluetooth.ConnectionStateEnum state = 1;
1490 // An identifier that can be used to match connect and disconnect events.
1491 // Currently is last two bytes of a hash of a device level ID and
1492 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001493 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001494 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001495 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1496 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001497 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001498 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001499 // An identifier that can be used to match events for this device.
1500 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1501 // Salt: Randomly generated 256 bit value
1502 // Hash algorithm: HMAC-SHA256
1503 // Size: 32 byte
1504 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001505 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001506}
1507
1508/**
1509 * Logs when a Bluetooth device connects and disconnects over ACL
1510 *
1511 * Logged from:
1512 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1513 *
1514 * Next Tag: 3
1515 */
1516message BluetoothAclConnectionStateChanged {
1517 // An identifier that can be used to match events for this device.
1518 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1519 // Salt: Randomly generated 256 bit value
1520 // Hash algorithm: HMAC-SHA256
1521 // Size: 32 byte
1522 // Default: null or empty if the device identifier is not known
1523 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1524 // The state of the connection.
1525 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1526 optional android.bluetooth.ConnectionStateEnum state = 2;
1527}
1528
1529/**
1530 * Logs when a Bluetooth device connects and disconnects over SCO
1531 *
1532 * Logged from:
1533 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1534 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1535 *
1536 * Next Tag: 4
1537 */
1538message BluetoothScoConnectionStateChanged {
1539 // An identifier that can be used to match events for this device.
1540 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1541 // Salt: Randomly generated 256 bit value
1542 // Hash algorithm: HMAC-SHA256
1543 // Size: 32 byte
1544 // Default: null or empty if the device identifier is not known
1545 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1546 // The state of the connection.
1547 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1548 optional android.bluetooth.ConnectionStateEnum state = 2;
1549 // Codec used for this SCO connection
1550 // Default: UNKNOWN
1551 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001552}
1553
Jack Hec27040a2019-01-09 20:54:41 -08001554/**
1555 * Logged when active device of a profile changes
1556 *
1557 * Logged from:
1558 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1559 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1560 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1561 */
1562message BluetoothActiveDeviceChanged {
1563 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1564 // From android.bluetooth.BluetoothProfile
1565 optional int32 bt_profile = 1;
1566 // An identifier that can be used to match events for this new active device.
1567 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1568 // Salt: Randomly generated 256 bit value
1569 // Hash algorithm: HMAC-SHA256
1570 // Size: 32 byte
1571 // Default: null or empty if there is no active device for this profile
1572 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1573}
1574
Jack Heab86dbd22018-12-18 15:43:27 -08001575// Logs when there is an event affecting Bluetooth device's link layer connection.
1576// - This event is triggered when there is a related HCI command or event
1577// - Users of this metrics can deduce Bluetooth device's connection state from these events
1578// - HCI commands are logged before the command is sent, after receiving command status, and after
1579// receiving command complete
1580// - HCI events are logged when they arrive
1581//
1582// Low level log from system/bt
1583//
1584// Bluetooth classic commands:
1585// - CMD_CREATE_CONNECTION
1586// - CMD_DISCONNECT
1587// - CMD_CREATE_CONNECTION_CANCEL
1588// - CMD_ACCEPT_CONNECTION_REQUEST
1589// - CMD_REJECT_CONNECTION_REQUEST
1590// - CMD_SETUP_ESCO_CONNECTION
1591// - CMD_ACCEPT_ESCO_CONNECTION
1592// - CMD_REJECT_ESCO_CONNECTION
1593// - CMD_ENH_SETUP_ESCO_CONNECTION
1594// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1595//
1596// Bluetooth low energy commands:
1597// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1598// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1599// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1600// - CMD_BLE_CLEAR_WHITE_LIST
1601// - CMD_BLE_ADD_WHITE_LIST
1602// - CMD_BLE_REMOVE_WHITE_LIST
1603//
1604// Bluetooth classic events:
1605// - EVT_CONNECTION_COMP
1606// - EVT_CONNECTION_REQUEST
1607// - EVT_DISCONNECTION_COMP
1608// - EVT_ESCO_CONNECTION_COMP
1609// - EVT_ESCO_CONNECTION_CHANGED
1610//
1611// Bluetooth low energy meta events:
1612// - BLE_EVT_CONN_COMPLETE_EVT
1613// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1614//
1615// Next tag: 10
1616message BluetoothLinkLayerConnectionEvent {
1617 // An identifier that can be used to match events for this device.
1618 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1619 // Salt: Randomly generated 256 bit value
1620 // Hash algorithm: HMAC-SHA256
1621 // Size: 32 byte
1622 // Default: null or empty if the device identifier is not known
1623 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1624 // Connection handle of this connection if available
1625 // Range: 0x0000 - 0x0EFF (12 bits)
1626 // Default: 0xFFFF if the handle is unknown
1627 optional int32 connection_handle = 2;
1628 // Direction of the link
1629 // Default: DIRECTION_UNKNOWN
1630 optional android.bluetooth.DirectionEnum direction = 3;
1631 // Type of this link
1632 // Default: LINK_TYPE_UNKNOWN
1633 optional android.bluetooth.LinkTypeEnum type = 4;
1634
1635 // Reason metadata for this link layer connection event, rules for interpretation:
1636 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1637 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1638 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1639 // set and valid, ignore hci_ble_event
1640
1641 // HCI command associated with this event
1642 // Default: CMD_UNKNOWN
1643 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1644 // HCI event associated with this event
1645 // Default: EVT_UNKNOWN
1646 optional android.bluetooth.hci.EventEnum hci_event = 6;
1647 // HCI BLE meta event associated with this event
1648 // Default: BLE_EVT_UNKNOWN
1649 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1650 // HCI command status code if this is triggerred by hci_cmd
1651 // Default: STATUS_UNKNOWN
1652 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1653 // HCI reason code associated with this event
1654 // Default: STATUS_UNKNOWN
1655 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1656}
1657
Howard Roe103fe22019-01-17 16:52:16 -08001658/**
1659 * Logs when a module is rolled back by Watchdog.
1660 *
1661 * Logged from: Rollback Manager
1662 */
1663message WatchdogRollbackOccurred {
1664 enum RollbackType {
1665 UNKNOWN = 0;
1666 ROLLBACK_INITIATE = 1;
1667 ROLLBACK_SUCCESS = 2;
1668 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001669 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001670 }
1671 optional RollbackType rollback_type = 1;
1672
1673 optional string package_name = 2;
1674
1675 optional int32 package_version_code = 3;
1676}
1677
Jack Hec27040a2019-01-09 20:54:41 -08001678/**
1679 * Logs when there is a change in Bluetooth A2DP playback state
1680 *
1681 * Logged from:
1682 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1683 */
1684message BluetoothA2dpPlaybackStateChanged {
1685 // An identifier that can be used to match events for this device.
1686 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1687 // Salt: Randomly generated 256 bit value
1688 // Hash algorithm: HMAC-SHA256
1689 // Size: 32 byte
1690 // Default: null or empty if the device identifier is not known
1691 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1692 // Current playback state
1693 // Default: PLAYBACK_STATE_UNKNOWN
1694 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1695 // Current audio coding mode
1696 // Default: AUDIO_CODING_MODE_UNKNOWN
1697 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1698}
1699
1700/**
1701 * Logs when there is a change in A2DP codec config for a particular remote device
1702 *
1703 * Logged from:
1704 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1705 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1706 */
1707message BluetoothA2dpCodecConfigChanged {
1708 // An identifier that can be used to match events for this device.
1709 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1710 // Salt: Randomly generated 256 bit value
1711 // Hash algorithm: HMAC-SHA256
1712 // Size: 32 byte
1713 // Default: null or empty if the device identifier is not known
1714 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1715 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1716 // Default SOURCE_CODEC_TYPE_INVALID
1717 optional int32 codec_type = 2;
1718 // Codec priroity, the higher the more preferred, -1 for disabled
1719 // Default: CODEC_PRIORITY_DEFAULT
1720 optional int32 codec_priority = 3;
1721 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1722 // Default: SAMPLE_RATE_NONE
1723 optional int32 sample_rate = 4;
1724 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1725 // Default: BITS_PER_SAMPLE_NONE
1726 optional int32 bits_per_sample = 5;
1727 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1728 // Default: CHANNEL_MODE_NONE
1729 optional int32 channel_mode = 6;
1730 // Codec specific values
1731 // Default 0
1732 optional int64 codec_specific_1 = 7;
1733 optional int64 codec_specific_2 = 8;
1734 optional int64 codec_specific_3 = 9;
1735 optional int64 codec_specific_4 = 10;
1736}
1737
1738/**
1739 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1740 * Each codec's capability is logged separately due to statsd restriction
1741 *
1742 * Logged from:
1743 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1744 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1745 */
1746message BluetoothA2dpCodecCapabilityChanged {
1747 // An identifier that can be used to match events for this device.
1748 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1749 // Salt: Randomly generated 256 bit value
1750 // Hash algorithm: HMAC-SHA256
1751 // Size: 32 byte
1752 // Default: null or empty if the device identifier is not known
1753 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1754 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1755 // Default SOURCE_CODEC_TYPE_INVALID
1756 optional int32 codec_type = 2;
1757 // Codec priroity, the higher the more preferred, -1 for disabled
1758 // Default: CODEC_PRIORITY_DEFAULT
1759 optional int32 codec_priority = 3;
1760 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1761 // in BluetoothCodecConfig
1762 // Default: empty and SAMPLE_RATE_NONE for individual item
1763 optional int32 sample_rate = 4;
1764 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1765 // in BluetoothCodecConfig
1766 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1767 optional int32 bits_per_sample = 5;
1768 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1769 // BluetoothCodecConfig
1770 // Default: empty and CHANNEL_MODE_NONE for individual item
1771 optional int32 channel_mode = 6;
1772 // Codec specific values
1773 // Default 0
1774 optional int64 codec_specific_1 = 7;
1775 optional int64 codec_specific_2 = 8;
1776 optional int64 codec_specific_3 = 9;
1777 optional int64 codec_specific_4 = 10;
1778}
1779
1780/**
1781 * Logs when A2DP failed to read from PCM source.
1782 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1783 *
1784 * Logged from:
1785 * system/bt
1786 */
1787message BluetoothA2dpAudioUnderrunReported {
1788 // An identifier that can be used to match events for this device.
1789 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1790 // Salt: Randomly generated 256 bit value
1791 // Hash algorithm: HMAC-SHA256
1792 // Size: 32 byte
1793 // Default: null or empty if the device identifier is not known
1794 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1795 // Encoding interval in nanoseconds
1796 // Default: 0
1797 optional int64 encoding_interval_nanos = 2;
1798 // Number of bytes of PCM data that could not be read from the source
1799 // Default: 0
1800 optional int32 num_missing_pcm_bytes = 3;
1801}
1802
1803/**
1804 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1805 * buffer queue is full and we have to drop data
1806 *
1807 * Logged from:
1808 * system/bt
1809 */
1810message BluetoothA2dpAudioOverrunReported {
1811 // An identifier that can be used to match events for this device.
1812 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1813 // Salt: Randomly generated 256 bit value
1814 // Hash algorithm: HMAC-SHA256
1815 // Size: 32 byte
1816 // Default: null or empty if the device identifier is not known
1817 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1818 // Encoding interval in nanoseconds
1819 // Default: 0
1820 optional int64 encoding_interval_nanos = 2;
1821 // Number of buffers dropped in this event
1822 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1823 // Default: 0
1824 optional int32 num_dropped_buffers = 3;
1825 // Number of encoded buffers dropped in this event
1826 // Default 0
1827 optional int32 num_dropped_encoded_frames = 4;
1828 // Number of encoded bytes dropped in this event
1829 // Default: 0
1830 optional int32 num_dropped_encoded_bytes = 5;
1831}
1832
1833/**
1834 * Logs when we receive reports regarding a device's RSSI value
1835 *
1836 * Logged from:
1837 * system/bt
1838 */
1839message BluetoothDeviceRssiReported {
1840 // An identifier that can be used to match events for this device.
1841 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1842 // Salt: Randomly generated 256 bit value
1843 // Hash algorithm: HMAC-SHA256
1844 // Size: 32 byte
1845 // Default: null or empty if the device identifier is not known
1846 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1847 // Connection handle of this connection if available
1848 // Range: 0x0000 - 0x0EFF (12 bits)
1849 // Default: 0xFFFF if the handle is unknown
1850 optional int32 connection_handle = 2;
1851 // HCI command status code if this is triggerred by hci_cmd
1852 // Default: STATUS_UNKNOWN
1853 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1854 // BR/EDR
1855 // Range: -128 ≤ N ≤ 127 (signed integer)
1856 // Units: dB
1857 // LE:
1858 // Range: -127 to 20, 127 (signed integer)
1859 // Units: dBm
1860 // Invalid when an out of range value is reported
1861 optional int32 rssi = 4;
1862}
1863
1864/**
1865 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1866 *
1867 * Logged from:
1868 * system/bt
1869 */
1870message BluetoothDeviceFailedContactCounterReported {
1871 // An identifier that can be used to match events for this device.
1872 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1873 // Salt: Randomly generated 256 bit value
1874 // Hash algorithm: HMAC-SHA256
1875 // Size: 32 byte
1876 // Default: null or empty if the device identifier is not known
1877 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1878 // Connection handle of this connection if available
1879 // Range: 0x0000 - 0x0EFF (12 bits)
1880 // Default: 0xFFFF if the handle is unknown
1881 optional int32 connection_handle = 2;
1882 // HCI command status code if this is triggerred by hci_cmd
1883 // Default: STATUS_UNKNOWN
1884 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1885 // Number of consecutive failed contacts for a connection corresponding to the Handle
1886 // Range: uint16_t, 0-0xFFFF
1887 // Default: 0xFFFFF
1888 optional int32 failed_contact_counter = 4;
1889}
1890
1891/**
1892 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1893 *
1894 * Logged from:
1895 * system/bt
1896 */
1897message BluetoothDeviceTxPowerLevelReported {
1898 // An identifier that can be used to match events for this device.
1899 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1900 // Salt: Randomly generated 256 bit value
1901 // Hash algorithm: HMAC-SHA256
1902 // Size: 32 byte
1903 // Default: null or empty if the device identifier is not known
1904 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1905 // Connection handle of this connection if available
1906 // Range: 0x0000 - 0x0EFF (12 bits)
1907 // Default: 0xFFFF if the handle is unknown
1908 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001909 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001910 // Default: STATUS_UNKNOWN
1911 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1912 // Range: -30 ≤ N ≤ 20
1913 // Units: dBm
1914 // Invalid when an out of range value is reported
1915 optional int32 transmit_power_level = 4;
1916}
Jack Heab86dbd22018-12-18 15:43:27 -08001917
Tej Singh5d991e12018-03-09 19:48:11 -08001918/**
Jack He1021a612019-01-20 21:22:46 -08001919 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1920 * receiving an HCI command from the host
1921 *
1922 * Logged from: system/bt
1923 */
1924message BluetoothHciTimeoutReported {
1925 // HCI command associated with this event
1926 // Default: CMD_UNKNOWN
1927 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1928}
1929
1930/**
1931 * Logs when we receive Bluetooth Link Quality Report event from the controller
1932 * See Android Bluetooth HCI specification for more details
1933 *
1934 * Note: all count and bytes field are counted since last event
1935 *
1936 * Logged from: system/bt
1937 */
1938message BluetoothQualityReportReported {
1939 // Quality report ID
1940 // Original type: uint8_t
1941 // Default: BQR_ID_UNKNOWN
1942 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1943 // Packet type of the connection
1944 // Original type: uint8_t
1945 // Default: BQR_PACKET_TYPE_UNKNOWN
1946 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
1947 // Connection handle of the connection
1948 // Original type: uint16_t
1949 optional int32 connection_handle = 3;
1950 // Performing Role for the connection
1951 // Original type: uint8_t
1952 optional int32 connection_role = 4;
1953 // Current Transmit Power Level for the connection. This value is the same as the controller's
1954 // response to the HCI_Read_Transmit_Power_Level HCI command
1955 // Original type: uint8_t
1956 optional int32 tx_power_level = 5;
1957 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
1958 // absolute receiver signal strength value
1959 // Original type: int8_t
1960 optional int32 rssi = 6;
1961 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
1962 // channels used by the link currently
1963 // Original type: uint8_t
1964 optional int32 snr = 7;
1965 // Indicates the number of unused channels in AFH_channel_map
1966 // Original type: uint8_t
1967 optional int32 unused_afh_channel_count = 8;
1968 // Indicates the number of the channels which are interfered and quality is bad but are still
1969 // selected for AFH
1970 // Original type: uint8_t
1971 optional int32 afh_select_unideal_channel_count = 9;
1972 // Current Link Supervision Timeout Setting
1973 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1974 // Original type: uint16_t
1975 optional int32 lsto = 10;
1976 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
1977 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
1978 // 0x01 (Piconet Clock)
1979 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1980 // Original type: uint32_t
1981 optional int64 connection_piconet_clock = 11;
1982 // The count of retransmission
1983 // Original type: uint32_t
1984 optional int64 retransmission_count = 12;
1985 // The count of no RX
1986 // Original type: uint32_t
1987 optional int64 no_rx_count = 13;
1988 // The count of NAK (Negative Acknowledge)
1989 // Original type: uint32_t
1990 optional int64 nak_count = 14;
1991 // Controller timestamp of last TX ACK
1992 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
1993 // Original type: uint32_t
1994 optional int64 last_tx_ack_timestamp = 15;
1995 // The count of Flow-off (STOP)
1996 // Original type: uint32_t
1997 optional int64 flow_off_count = 16;
1998 // Controller timestamp of last Flow-on (GO)
1999 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2000 // Original type: uint32_t
2001 optional int64 last_flow_on_timestamp = 17;
2002 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2003 // Original type: uint32_t
2004 optional int64 buffer_overflow_bytes = 18;
2005 // Buffer underflow count (in byte) since last event
2006 // Original type: uint32_t
2007 optional int64 buffer_underflow_bytes = 19;
2008}
2009
2010/**
2011 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2012 *
2013 * Notes:
2014 * - Each event can be partially filled as we might learn different pieces of device
2015 * information at different time
2016 * - Multiple device info events can be combined to give more complete picture
2017 * - When multiple device info events tries to describe the same information, the
2018 * later one wins
2019 *
2020 * Logged from:
2021 * packages/apps/Bluetooth
2022 */
Jack Heaea26982019-04-04 11:19:48 -07002023message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002024 // An identifier that can be used to match events for this device.
2025 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2026 // Salt: Randomly generated 256 bit value
2027 // Hash algorithm: HMAC-SHA256
2028 // Size: 32 byte
2029 // Default: null or empty if the device identifier is not known
2030 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2031 // Where is this device info obtained from
2032 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2033 // Name of the data source
2034 // For EXTERNAL: package name of the data source
2035 // For INTERNAL: null for general case, component name otherwise
2036 optional string source_name = 3;
2037 // Name of the manufacturer of this device
2038 optional string manufacturer = 4;
2039 // Model of this device
2040 optional string model = 5;
2041 // Hardware version of this device
2042 optional string hardware_version = 6;
2043 // Software version of this device
2044 optional string software_version = 7;
2045}
2046
2047/**
2048 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2049 * device, as documented by the Bluetooth Core HCI specification
2050 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2051 * Vol 2, Part E, Page 1118
2052 *
2053 * Logged from:
2054 * system/bt
2055 */
2056message BluetoothRemoteVersionInfoReported {
2057 // Connection handle of the connection
2058 // Original type: uint16_t
2059 optional int32 connection_handle = 1;
2060 // HCI command status code
2061 // Default: STATUS_UNKNOWN
2062 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2063 // 1 byte Version of current LMP in the remote controller
2064 optional int32 lmp_version = 3;
2065 // 2 bytes LMP manufacturer code of the remote controller
2066 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2067 optional int32 lmp_manufacturer_code = 4;
2068 // 4 bytes subversion of the LMP in the remote controller
2069 optional int32 lmp_subversion = 5;
2070}
2071
2072/**
2073 * Logs when certain Bluetooth SDP attributes are discovered
2074 * Constant definitions are from:
2075 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2076 *
2077 * Current logged attributes:
2078 * - BluetoothProfileDescriptorList
2079 * - Supported Features Bitmask
2080 *
2081 * Logged from:
2082 * system/bt
2083 */
2084message BluetoothSdpAttributeReported {
2085 // An identifier that can be used to match events for this device.
2086 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2087 // Salt: Randomly generated 256 bit value
2088 // Hash algorithm: HMAC-SHA256
2089 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2090 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2091 // Original type: uint16_t
2092 optional int32 protocol_uuid = 2;
2093 // Short form UUIDs used to identify Bluetooth SDP attribute types
2094 // Original type: uint16_t
2095 optional int32 attribute_id = 3;
2096 // Attribute value for the particular attribute
2097 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2098}
2099
2100/**
2101 * Logs when bond state of a Bluetooth device changes
2102 *
2103 * Logged from:
2104 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2105 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2106 */
2107message BluetoothBondStateChanged {
2108 // An identifier that can be used to match events for this device.
2109 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2110 // Salt: Randomly generated 256 bit value
2111 // Hash algorithm: HMAC-SHA256
2112 // Size: 32 byte
2113 // Default: null or empty if the device identifier is not known
2114 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2115 // Preferred transport type to remote dual mode device
2116 // Default: TRANSPORT_AUTO means no preference
2117 optional android.bluetooth.TransportTypeEnum transport = 2;
2118 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2119 // Default: UNKNOWN
2120 optional android.bluetooth.DeviceTypeEnum type = 3;
2121 // Current bond state (NONE, BONDING, BONDED)
2122 // Default: BOND_STATE_UNKNOWN
2123 optional android.bluetooth.BondStateEnum bond_state = 4;
2124 // Bonding sub state
2125 // Default: BOND_SUB_STATE_UNKNOWN
2126 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2127 // Unbond Reason
2128 // Default: UNBOND_REASON_UNKNOWN
2129 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2130}
2131
2132/**
2133 * Logs there is an event related Bluetooth classic pairing
2134 *
2135 * Logged from:
2136 * system/bt
2137 */
2138message BluetoothClassicPairingEventReported {
2139 // An identifier that can be used to match events for this device.
2140 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2141 // Salt: Randomly generated 256 bit value
2142 // Hash algorithm: HMAC-SHA256
2143 // Size: 32 byte
2144 // Default: null or empty if the device identifier is not known
2145 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2146 // Connection handle of this connection if available
2147 // Range: 0x0000 - 0x0EFF (12 bits)
2148 // Default: 0xFFFF if the handle is unknown
2149 optional int32 connection_handle = 2;
2150 // HCI command associated with this event
2151 // Default: CMD_UNKNOWN
2152 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2153 // HCI event associated with this event
2154 // Default: EVT_UNKNOWN
2155 optional android.bluetooth.hci.EventEnum hci_event = 4;
2156 // HCI command status code if this is triggerred by hci_cmd
2157 // Default: STATUS_UNKNOWN
2158 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2159 // HCI reason code associated with this event
2160 // Default: STATUS_UNKNOWN
2161 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002162 // A status value related to this specific event
2163 // Default: 0
2164 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002165}
2166
2167/**
2168 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2169 *
2170 * Logged from:
2171 * system/bt
2172 */
2173message BluetoothSmpPairingEventReported {
2174 // An identifier that can be used to match events for this device.
2175 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2176 // Salt: Randomly generated 256 bit value
2177 // Hash algorithm: HMAC-SHA256
2178 // Size: 32 byte
2179 // Default: null or empty if the device identifier is not known
2180 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2181 // SMP command sent or received over L2CAP
2182 // Default: CMD_UNKNOWN
2183 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2184 // Whether this command is sent or received
2185 // Default: DIRECTION_UNKNOWN
2186 optional android.bluetooth.DirectionEnum direction = 3;
2187 // SMP failure reason code
2188 // Default: PAIRING_FAIL_REASON_DEFAULT
2189 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2190}
2191
2192/**
Jack He815cdba2019-01-30 17:24:55 -08002193 * Logs when a Bluetooth socket’s connection state changed
2194 *
2195 * Logged from:
2196 * system/bt
2197 */
2198message BluetoothSocketConnectionStateChanged {
2199 // An identifier that can be used to match events for this device.
2200 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2201 // Salt: Randomly generated 256 bit value
2202 // Hash algorithm: HMAC-SHA256
2203 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002204 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002205 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002206 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002207 // Default 0 when unknown or don't care
2208 optional int32 port = 2;
2209 // Socket type as mentioned in
2210 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2211 // Default: SOCKET_TYPE_UNKNOWN
2212 optional android.bluetooth.SocketTypeEnum type = 3;
2213 // Socket connection state
2214 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2215 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2216 // Number of bytes sent to remote device during this connection
2217 optional int64 tx_bytes = 5;
2218 // Number of bytes received from remote device during this connection
2219 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002220 // Socket owner's UID
2221 optional int32 uid = 7 [(is_uid) = true];
2222 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2223 // |port| must be spawned by |server_port|
2224 // Default 0 when unknown or don't care
2225 optional int32 server_port = 8;
2226 // Whether this is a server listener socket
2227 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002228}
2229
2230/**
Jack He71426802019-04-02 13:32:52 -07002231 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2232 *
2233 * Logged from:
2234 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2235 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2236 *
2237 */
2238message BluetoothClassOfDeviceReported {
2239 // An identifier that can be used to match events for this device.
2240 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2241 // Salt: Randomly generated 256 bit value
2242 // Hash algorithm: HMAC-SHA256
2243 // Size: 32 byte
2244 // Default: null or empty if this is a server listener socket
2245 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2246 // Class of Device (CoD) value including both Major, Minor device class and service class
2247 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2248 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2249 // Default: 0
2250 optional int32 class_of_device = 2;
2251}
2252
2253/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002254 * Logs when something is plugged into or removed from the USB-C connector.
2255 *
2256 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002257 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002258 */
2259message UsbConnectorStateChanged {
2260 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002261 STATE_DISCONNECTED = 0;
2262 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002263 }
2264 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002265 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002266 // Last active session in ms.
2267 // 0 when the port is in connected state.
2268 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002269}
2270
2271/**
2272 * Logs the reported speaker impedance.
2273 *
2274 * Logged from:
2275 * Vendor audio implementation.
2276 */
2277message SpeakerImpedanceReported {
2278 optional int32 speaker_location = 1;
2279 optional int32 impedance = 2;
2280}
2281
2282/**
2283 * Logs the report of a failed hardware.
2284 *
2285 * Logged from:
2286 * Vendor HALs.
2287 *
2288 */
2289message HardwareFailed {
2290 enum HardwareType {
2291 HARDWARE_FAILED_UNKNOWN = 0;
2292 HARDWARE_FAILED_MICROPHONE = 1;
2293 HARDWARE_FAILED_CODEC = 2;
2294 HARDWARE_FAILED_SPEAKER = 3;
2295 HARDWARE_FAILED_FINGERPRINT = 4;
2296 }
2297 optional HardwareType hardware_type = 1;
2298
Maggie White6dcd8572019-01-31 14:11:50 -08002299 /**
2300 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002301 * the same hardware_type. The specific locations are vendor defined integers,
2302 * referring to board-specific numbering schemes.
2303 */
2304 optional int32 hardware_location = 2;
2305
Maggie White6dcd8572019-01-31 14:11:50 -08002306 /**
2307 * failure_code is specific to the HardwareType of the failed hardware.
2308 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002309 */
Maggie White6dcd8572019-01-31 14:11:50 -08002310 enum HardwareErrorCode {
2311 UNKNOWN = 0;
2312 COMPLETE = 1;
2313 SPEAKER_HIGH_Z = 2;
2314 SPEAKER_SHORT = 3;
2315 FINGERPRINT_SENSOR_BROKEN = 4;
2316 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002317 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002318 }
2319 optional int32 failure_code = 3;
2320}
2321
2322/**
2323 * Log an event when the device has been physically dropped.
2324 * Reported from the /vendor partition.
2325 */
2326message PhysicalDropDetected {
2327 // Confidence that the event was actually a drop, 0 -> 100
2328 optional int32 confidence_pctg = 1;
2329 // Peak acceleration of the drop, in 1/1000s of a g.
2330 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002331 // Duration of freefall in ms
2332 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002333}
2334
2335/**
2336 * Log bucketed battery charge cycles.
2337 *
2338 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002339 * a given charge point. For example, if 10 cycle buckets are
2340 * initialized, bucket 1 is the lowest 1/10th of the battery,
2341 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002342 *
2343 * Logged from:
2344 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2345 */
2346message ChargeCyclesReported {
2347 optional int32 cycle_bucket_1 = 1;
2348 optional int32 cycle_bucket_2 = 2;
2349 optional int32 cycle_bucket_3 = 3;
2350 optional int32 cycle_bucket_4 = 4;
2351 optional int32 cycle_bucket_5 = 5;
2352 optional int32 cycle_bucket_6 = 6;
2353 optional int32 cycle_bucket_7 = 7;
2354 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002355 optional int32 cycle_bucket_9 = 9;
2356 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002357}
2358
2359/**
Howard Roa46b6582018-09-18 16:45:02 -07002360 * Log battery health snapshot.
2361 *
2362 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2363 * are snapshotted periodically over 24hrs.
2364 */
2365message BatteryHealthSnapshot {
2366 enum BatterySnapshotType {
2367 UNKNOWN = 0;
2368 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2369 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2370 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2371 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2372 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2373 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2374 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2375 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2376 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2377 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2378 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2379 }
2380 optional BatterySnapshotType type = 1;
2381 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002382 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002383 // Voltage Battery Voltage, in microVolts.
2384 optional int32 voltage_micro_volt = 3;
2385 // Current Battery current, in microAmps.
2386 optional int32 current_micro_amps = 4;
2387 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2388 optional int32 open_circuit_micro_volt = 5;
2389 // Resistance Battery Resistance, in microOhms.
2390 optional int32 resistance_micro_ohm = 6;
2391 // Level Battery Level, as % of full.
2392 optional int32 level_percent = 7;
2393}
2394
2395/**
2396 * Log slow I/O operations on the primary storage.
2397 */
2398message SlowIo {
2399 // Classifications of IO Operations.
2400 enum IoOperation {
2401 UNKNOWN = 0;
2402 READ = 1;
2403 WRITE = 2;
2404 UNMAP = 3;
2405 SYNC = 4;
2406 }
2407 optional IoOperation operation = 1;
2408
2409 // The number of slow IO operations of this type over 24 hours.
2410 optional int32 count = 2;
2411}
2412
2413/**
2414 * Log battery caused shutdown with the last recorded voltage.
2415 */
2416message BatteryCausedShutdown {
2417 // The last recorded battery voltage prior to shutdown.
2418 optional int32 last_recorded_micro_volt = 1;
2419}
2420
2421/**
Tej Singha72344992019-04-17 18:55:08 -07002422 * Logs when ThermalService receives throttling events.
2423 *
2424 * Logged from:
2425 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2426 */
2427message ThermalThrottlingSeverityStateChanged {
2428 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2429 optional android.os.TemperatureTypeEnum sensor_type = 1;
2430
2431 // The name of the temperature source. Eg. CPU0
2432 optional string sensor_name = 2;
2433
2434 // Temperature in tenths of a degree C.
2435 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2436 optional int32 temperature_deci_celsius = 3;
2437
2438 // Relative severity of the throttling, see enum definition.
2439 optional android.os.ThrottlingSeverityEnum severity = 4;
2440}
2441
2442/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002443 * Logs the duration of a davey (jank of >=700ms) when it occurs
2444 *
2445 * Logged from:
2446 * frameworks/base/libs/hwui/JankTracker.cpp
2447 */
2448message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002449 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002450 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002451
Tej Singhbb8554a2018-01-26 11:59:14 -08002452 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002453 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002454}
2455
2456/**
Bookatze5885242017-10-24 20:10:31 -07002457 * Logs phone signal strength changes.
2458 *
2459 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002460 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002461 */
2462message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002463 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2464 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002465}
2466
Yangster4ccebea2018-10-09 17:09:02 -07002467
2468/**
2469 * Logs when the phone state, sim state or signal strength changes
2470 *
2471 * Logged from:
2472 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2473 */
2474message PhoneServiceStateChanged {
2475 optional android.telephony.ServiceStateEnum state = 1;
2476 optional android.telephony.SimStateEnum sim_state = 2;
2477 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2478}
2479
2480/**
2481 * Logs when the phone becomes on or off.
2482 *
2483 * Logged from:
2484 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2485 */
2486message PhoneStateChanged {
2487 enum State {
2488 OFF = 0;
2489 ON = 1;
2490 }
2491 optional State state = 1;
2492}
2493
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002494message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002495 optional android.stats.launcher.LauncherAction action = 1;
2496 optional android.stats.launcher.LauncherState src_state = 2;
2497 optional android.stats.launcher.LauncherState dst_state = 3;
2498 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002499 optional bool is_swipe_up_enabled = 5;
2500}
2501
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002502message StyleUIChanged {
2503 optional android.stats.style.Action action = 1;
2504 optional int32 color_package_hash = 2;
2505 optional int32 font_package_hash = 3;
2506 optional int32 shape_package_hash = 4;
2507 optional int32 clock_package_hash = 5;
2508 optional int32 launcher_grid = 6;
2509 optional int32 wallpaper_category_hash = 7;
2510 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002511 optional int32 color_preference = 9;
2512 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002513}
2514
David Chenc28b2bb2017-10-24 12:52:52 -07002515/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002516 * Logs when Settings UI has changed.
2517 *
2518 * Logged from:
2519 * packages/apps/Settings
2520 */
2521message SettingsUIChanged {
2522 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002523 * Where this SettingsUIChange event comes from. For example, if
2524 * it's a PAGE_VISIBLE event, where the page is opened from.
2525 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002526 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002527
2528 /**
2529 * What the UI action is.
2530 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002531 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002532
2533 /**
2534 * Where the action is happening
2535 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002536 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002537
2538 /**
2539 * What preference changed in this event.
2540 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002541 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002542
2543 /**
2544 * The new value of the changed preference.
2545 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002546 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002547}
2548
2549/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002550 * Logs basic timing information about touch events.
2551 * Reported at most every 5 minutes while device is being interacted with.
2552 *
2553 * Logged from:
2554 * frameworks/native/services/inputflinger
2555 */
2556message TouchEventReported {
2557 /**
2558 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
2559 * and the standard deviation of latency between the kernel and framework
2560 * for touchscreen events. The units are microseconds.
2561 *
2562 * The number is measured as the difference between the time at which
2563 * the input event was received in the evdev driver,
2564 * and the time at which the input event was received in EventHub.
2565 */
2566 // Minimum value
2567 optional float latency_min_micros = 1;
2568 // Maximum value
2569 optional float latency_max_micros = 2;
2570 // Average value
2571 optional float latency_mean_micros = 3;
2572 // Standard deviation
2573 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002574 // Number of touch events (input_event) in this report
2575 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002576}
2577
2578/**
Philip Quinn0eded622019-01-29 12:46:28 -08002579 * Logs gesture classification and timing information for touch events.
2580 *
2581 * Logged from:
2582 * frameworks/base/core/java/android/view/GestureDetector.java
2583 * frameworks/base/core/java/android/view/View.java
2584 */
2585message TouchGestureClassified {
2586 // The source of the classification (e.g. Java class name).
2587 optional string source = 1;
2588
2589 enum Classification {
2590 UNKNOWN_CLASSIFICATION = 0;
2591 SINGLE_TAP = 1;
2592 DOUBLE_TAP = 2;
2593 LONG_PRESS = 3;
2594 DEEP_PRESS = 4;
2595 SCROLL = 5;
2596 }
2597 // The classification of the gesture.
2598 optional Classification classification = 2;
2599
2600 // The interval from the start of a touch event stream until the
2601 // classification was made.
2602 optional int32 latency_millis = 3;
2603
2604 // The distance from the location of the first touch event to the
2605 // location of the touch event when the classification was made.
2606 optional float displacement_px = 4;
2607}
2608
2609/**
David Chenc28b2bb2017-10-24 12:52:52 -07002610 * Logs that a setting was updated.
2611 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002612 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002613 * The tag and is_default allow resetting of settings to default values based on the specified
2614 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2615 */
2616message SettingChanged {
2617 // The name of the setting.
2618 optional string setting = 1;
2619
2620 // The change being imposed on this setting. May represent a number, eg "3".
2621 optional string value = 2;
2622
2623 // The new value of this setting. For most settings, this is same as value. For some settings,
2624 // value is +X or -X where X represents an element in a set. For example, if the previous value
2625 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2626 // The +/- feature is currently only used for location_providers_allowed.
2627 optional string new_value = 3;
2628
2629 // The previous value of this setting.
2630 optional string prev_value = 4;
2631
2632 // The tag used with the is_default for resetting sets of settings. This is generally null.
2633 optional string tag = 5;
2634
Bookatz90867622018-01-31 15:05:57 -08002635 // True if this setting with tag should be resettable.
2636 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002637
David Chenbd789912018-03-16 17:19:55 -07002638 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002639 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002640
2641 enum ChangeReason {
2642 UPDATED = 1; // Updated can be an insertion or an update.
2643 DELETED = 2;
2644 }
2645 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002646}
Chenjie Yub3dda412017-10-24 13:41:59 -07002647
Chenjie Yu05013b32017-11-21 10:21:41 -08002648/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002649 * Logs activity going to foreground or background
2650 *
2651 * Logged from:
2652 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2653 */
2654message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002655 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002656 optional string pkg_name = 2;
2657 optional string class_name = 3;
2658
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002659 enum State {
2660 BACKGROUND = 0;
2661 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002662 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002663 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002664}
David Chenc8a43242017-10-17 16:23:28 -07002665
2666/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002667 * Logs when a volume entered low Storage state.
2668 * Logged from:
2669 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2670 */
2671message LowStorageStateChanged {
2672 // Volume that ran out of storage.
2673 optional string volume_description = 1;
2674
2675 enum State {
2676 UNKNOWN = 0;
2677 OFF = 1;
2678 ON = 2;
2679 }
2680 optional State state = 2;
2681}
2682
2683/**
2684 * Logs when an app is downgraded.
2685 * Logged from:
2686 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2687 */
2688message AppDowngraded {
2689 optional string package_name = 1;
2690 // Size of the package (all data) before being downgraded.
2691 optional int64 size_in_bytes_before = 2;
2692 // Size of the package (all data) after being downgraded.
2693 optional int64 size_in_bytes_after = 3;
2694
2695 optional bool aggressive = 4;
2696}
2697
2698/**
2699 * Logs when an app is optimized after being downgraded.
2700 * Logged from:
2701 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2702 */
2703message AppOptimizedAfterDowngraded {
2704 optional string package_name = 1;
2705}
2706
2707/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002708 * Logs whenever an app is installed on external storage.
2709 * Logged from:
2710 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2711 */
2712message AppInstallOnExternalStorageReported {
2713 // The type of external storage.
2714 optional android.stats.storage.ExternalStorageType storage_type = 1;
2715 // The name of the package that is installed on the sd card.
2716 optional string package_name = 2;
2717}
2718
2719/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002720 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002721 * Logged from:
2722 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2723 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002724message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002725 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002726
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002727 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002728
2729 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002730 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002731 optional string process_name = 3;
2732
2733 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002734 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002735
2736 optional string package_name = 5;
2737
2738 enum InstantApp {
2739 UNAVAILABLE = 0;
2740 FALSE = 1;
2741 TRUE = 2;
2742 }
2743 optional InstantApp is_instant_app = 6;
2744
2745 enum ForegroundState {
2746 UNKNOWN = 0;
2747 BACKGROUND = 1;
2748 FOREGROUND = 2;
2749 }
2750 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002751
2752 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002753}
David Chen9e3808c2017-11-20 17:25:34 -08002754
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002755/**
2756 * Logs when a WTF (What a Terrible Failure) happened.
2757 * Logged from:
2758 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2759 */
2760message WTFOccurred {
2761 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002762
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002763 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002764
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002765 // The name of the process.
2766 // system_server if it is not by an app
2767 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002768
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002769 // The pid if available. -1 means not available.
2770 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002771
2772 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002773}
2774
2775/**
2776 * Logs when system server reports low memory.
2777 * Logged from:
2778 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2779 */
2780message LowMemReported {
2781}
2782
2783/**
2784 * Logs when an app ANR (App Not Responding) occurs.
2785 * Logged from:
2786 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2787 */
2788message ANROccurred {
2789 optional int32 uid = 1 [(is_uid) = true];
2790
2791 optional string process_name = 2;
2792
2793 optional string short_component_name = 3;
2794
2795 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002796
2797 enum InstantApp {
2798 UNAVAILABLE = 0;
2799 FALSE = 1;
2800 TRUE = 2;
2801 }
2802 optional InstantApp is_instant_app = 5;
2803
2804 enum ForegroundState {
2805 UNKNOWN = 0;
2806 BACKGROUND = 1;
2807 FOREGROUND = 2;
2808 }
2809 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002810
2811 optional android.server.ErrorSource error_source = 7;
2812
2813 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002814}
2815
Bookatza7020bd2018-08-28 16:29:35 -07002816/**
2817 * Logs when the vibrator state changes.
2818 * Logged from:
2819 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2820 */
2821message VibratorStateChanged {
2822 repeated AttributionNode attribution_node = 1;
2823
2824 enum State {
2825 OFF = 0;
2826 ON = 1;
2827 }
2828 optional State state = 2;
2829
2830 // Duration (in milliseconds) requested to keep the vibrator on.
2831 // Only applicable for State == ON.
2832 optional int64 duration_millis = 3;
2833}
2834
David Chen0a368b22017-12-06 16:28:16 -08002835/*
2836 * Allows other apps to push events into statsd.
2837 * Logged from:
2838 * frameworks/base/core/java/android/util/StatsLog.java
2839 */
David Chen0b5c90c2018-01-25 16:51:49 -08002840message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002841 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002842 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002843
2844 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2845 optional int32 label = 2;
2846
2847 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2848 // predicates for the metrics).
2849 enum State {
2850 UNKNOWN = 0;
2851 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2852 STOP = 2;
2853 START = 3;
2854 }
2855 optional State state = 3;
2856}
2857
David Chen9e3808c2017-11-20 17:25:34 -08002858/**
Bookatz7948c872018-09-04 12:58:33 -07002859 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2860 * For example, this could be due to the user manually changing the time.
2861 *
2862 * Logged from:
2863 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2864 */
2865message WallClockTimeShifted {
2866 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2867 optional int64 wall_clock_timestamp_millis = 1;
2868}
2869
2870/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002871 * Logs when statsd detects an anomaly.
2872 *
2873 * Logged from:
2874 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2875 */
2876message AnomalyDetected {
2877 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002878 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002879
Yangster-mac94e197c2018-01-02 16:03:03 -08002880 // Id of the config whose anomaly detection alert fired.
2881 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002882
Yangster-mac94e197c2018-01-02 16:03:03 -08002883 // Id of the alert (i.e. name of the anomaly that was detected).
2884 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002885}
2886
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002887message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002888 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002889 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002890
2891 // The app package name.
2892 optional string pkg_name = 2;
2893
2894 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002895 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002896 WARM = 1;
2897 HOT = 2;
2898 COLD = 3;
2899 }
2900 // The transition type.
2901 optional TransitionType type = 3;
2902
2903 // The activity name.
2904 optional string activity_name = 4;
2905
2906 // The name of the calling app. Empty if not set.
2907 optional string calling_pkg_name = 5;
2908
2909 // Whether the app is an instant app.
2910 optional bool is_instant_app = 6;
2911
2912 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08002913 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002914
Bookatz80d11a02018-01-16 10:46:35 -08002915 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002916
David Chen0b5c90c2018-01-25 16:51:49 -08002917 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002918 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002919 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002920 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08002921 optional int32 bind_application_delay_millis = 11;
2922 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002923
2924 // Empty if not set.
2925 optional string launch_token = 13;
2926
Calin Juravle759fbda2018-02-20 19:52:30 +00002927 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002928 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00002929
2930 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07002931 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002932}
2933
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002934message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002935 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002936 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002937
2938 // The app package name.
2939 optional string pkg_name = 2;
2940
2941 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002942 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002943 WARM = 1;
2944 HOT = 2;
2945 COLD = 3;
2946 }
2947 // The transition type.
2948 optional TransitionType type = 3;
2949
2950 // The activity name.
2951 optional string activity_name = 4;
2952}
2953
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002954message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002955 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002956 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002957
2958 // The app package name.
2959 optional string pkg_name = 2;
2960
2961 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002962 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002963 WITH_BUNDLE = 1;
2964 WITHOUT_BUNDLE = 2;
2965 }
2966 // The transition type.
2967 optional TransitionType type = 3;
2968
2969 // The activity name.
2970 optional string activity_name = 4;
2971
2972 optional bool transition_process_running = 5;
2973
2974 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08002975 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002976}
2977
Bookatz8fcd09a2017-12-18 13:01:10 -08002978/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08002979 * Logs a picture-in-picture action
2980 * Logged from:
2981 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2982 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
2983 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
2984 */
2985message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002986 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07002987 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08002988
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002989 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002990
Chenjie Yu52cacc62017-12-08 18:11:45 -08002991 enum State {
2992 ENTERED = 1;
2993 EXPANDED_TO_FULL_SCREEN = 2;
2994 MINIMIZED = 3;
2995 DISMISSED = 4;
2996 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08002997 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08002998}
2999
3000/**
Chenjie Yue8904192017-12-08 19:12:57 -08003001 * Logs overlay action
3002 * Logged from:
3003 * services/core/java/com/android/server/wm/Session.java
3004 */
3005message OverlayStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003006 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003007
3008 optional string package_name = 2;
3009
3010 optional bool using_alert_window = 3;
3011
3012 enum State {
3013 ENTERED = 1;
3014 EXITED = 2;
3015 }
3016 optional State state = 4;
3017}
3018
Chenjie Yuccfe6452018-01-30 11:33:21 -08003019/*
3020 * Logs foreground service starts and stops.
3021 * Note that this is not when a service starts or stops, but when it is
3022 * considered foreground.
3023 * Logged from
3024 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3025 */
3026message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003027 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003028 // package_name + "/" + class_name
3029 optional string short_name = 2;
3030
3031 enum State {
3032 ENTER = 1;
3033 EXIT = 2;
3034 }
3035 optional State state = 3;
3036}
3037
Chenjie Yue8904192017-12-08 19:12:57 -08003038/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003039 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3040 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3041 * attributed back to the parent (host) uid. One example is Chrome.
3042 *
3043 * Logged from:
3044 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3045 */
3046message IsolatedUidChanged {
3047 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003048 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003049 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003050 optional int32 parent_uid = 1;
3051
3052 optional int32 isolated_uid = 2;
3053
3054 // We expect an isolated uid to be removed before if it's used for another parent uid.
3055 enum Event {
3056 REMOVED = 0;
3057 CREATED = 1;
3058 }
3059 optional Event event = 3;
3060}
3061
3062/*
3063 * Logs the reception of an incoming network packet causing the main system to wake up for
3064 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3065 * and processed by WakeupController.cpp.
3066 */
3067message PacketWakeupOccurred {
3068 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3069 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003070 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003071 // The interface name on which the packet was received.
3072 optional string iface = 2;
3073 // The ethertype value of the packet.
3074 optional int32 ethertype = 3;
3075 // String representation of the destination MAC address of the packet.
3076 optional string destination_hardware_address = 4;
3077 // String representation of the source address of the packet if this was an IP packet.
3078 optional string source_ip = 5;
3079 // String representation of the destination address of the packet if this was an IP packet.
3080 optional string destination_ip = 6;
3081 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3082 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3083 // families.
3084 optional int32 ip_next_header = 7;
3085 // The source port if this was a TCP or UDP packet.
3086 optional int32 source_port = 8;
3087 // The destination port if this was a TCP or UDP packet.
3088 optional int32 destination_port = 9;
3089}
3090
3091/*
3092 * Logs the memory stats for an app on startup.
3093 * Logged from:
3094 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3095 */
3096message AppStartMemoryStateCaptured {
3097 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003098 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003099
3100 // The process name.
3101 optional string process_name = 2;
3102
3103 // The activity name.
3104 optional string activity_name = 3;
3105
3106 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003107 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003108
3109 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003110 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003111
3112 // RSS
3113 optional int64 rss_in_bytes = 6;
3114
3115 // CACHE
3116 optional int64 cache_in_bytes = 7;
3117
3118 // SWAP
3119 optional int64 swap_in_bytes = 8;
3120}
3121
3122/*
3123 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3124 * for LMK event.
3125 * Logged from:
3126 * system/core/lmkd/lmkd.c
3127 */
3128message LmkStateChanged {
3129 enum State {
3130 UNKNOWN = 0;
3131 START = 1;
3132 STOP = 2;
3133 }
3134 optional State state = 1;
3135}
3136
3137/*
3138 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3139 * Logged from:
3140 * system/core/lmkd/lmkd.c
3141 */
3142message LmkKillOccurred {
3143 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003144 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003145
3146 // The process name.
3147 optional string process_name = 2;
3148
3149 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003150 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003151
3152 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003153 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003154
3155 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003156 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003157
3158 // RSS
3159 optional int64 rss_in_bytes = 6;
3160
3161 // CACHE
3162 optional int64 cache_in_bytes = 7;
3163
3164 // SWAP
3165 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003166
3167 // The elapsed real time of start of the process.
3168 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003169
3170 // Min oom adj score considered by lmkd.
3171 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003172}
3173
Rajeev Kumar51b54602018-03-01 12:18:26 -08003174/*
3175 * Logs when the ActivityManagerService detects that an app died.
3176 *
3177 * Logged from:
3178 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3179 */
3180message AppDied {
3181 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003182 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003183}
3184
Howard Ro21a039c2018-08-06 14:55:47 -07003185/**
3186 * An atom for generic metrics logging. Available from Android Q.
3187 */
3188message GenericAtom {
3189 // The uid of the application that sent this custom atom.
3190 optional int32 uid = 1 [(is_uid) = true];
3191
3192 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003193 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003194}
3195
Tej Singhd6d6d772018-09-05 17:41:25 -07003196/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003197 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003198 *
3199 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003200 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003201 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003202message BiometricAcquired {
3203 // Biometric modality that was acquired.
3204 optional android.hardware.biometrics.ModalityEnum modality = 1;
3205 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3206 optional int32 user = 2;
3207 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3208 optional bool is_crypto = 3;
3209 // Action that the device is performing. Acquired messages are only expected for enroll and
3210 // authenticate. Other actions may indicate an error.
3211 optional android.hardware.biometrics.ActionEnum action = 4;
3212 // The client that this acquisition was received for.
3213 optional android.hardware.biometrics.ClientEnum client = 5;
3214 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3215 optional int32 acquire_info = 6;
3216 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3217 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003218 // Dictates if this message should trigger additional debugging.
3219 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003220}
3221
3222/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003223 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003224 *
3225 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003226 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003227 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003228message BiometricAuthenticated {
3229 // Biometric modality that was used.
3230 optional android.hardware.biometrics.ModalityEnum modality = 1;
3231 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3232 optional int32 user = 2;
3233 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3234 // storage.
3235 optional bool is_crypto = 3;
3236 // The client that this acquisition was received for.
3237 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003238 // If authentication requires user confirmation. See BiometricPrompt's
3239 // setRequireConfirmation(bool) method.
3240 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003241
Kevin Chyn1741a072019-01-17 11:54:40 -08003242 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003243 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003244 REJECTED = 1;
3245 PENDING_CONFIRMATION = 2;
3246 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003247 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003248
3249 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003250 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003251 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3252 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3253 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3254 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003255 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003256 // Dictates if this message should trigger additional debugging.
3257 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003258}
3259
3260/**
3261 * Logs when a biometric error occurs.
3262 *
3263 * Logged from:
3264 * frameworks/base/services/core/java/com/android/server/biometrics
3265 */
3266message BiometricErrorOccurred {
3267 // Biometric modality that was used.
3268 optional android.hardware.biometrics.ModalityEnum modality = 1;
3269 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3270 optional int32 user = 2;
3271 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3272 optional bool is_crypto = 3;
3273 // Action that the device is performing.
3274 optional android.hardware.biometrics.ActionEnum action = 4;
3275 // The client that this acquisition was received for.
3276 optional android.hardware.biometrics.ClientEnum client = 5;
3277 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3278 // are unique to modality.
3279 optional int32 error_info = 6;
3280 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3281 // by the vendor and not specified by the HIDL interface.
3282 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003283 // Dictates if this message should trigger additional debugging.
3284 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003285}
3286
3287/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003288 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003289 * Logged from:
3290 * frameworks/base/services/core/java/com/android/server/biometrics
3291 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003292message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003293 // Biometric modality.
3294 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003295 // Type of issue detected.
3296 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003297 // Dictates if this message should trigger additional debugging.
3298 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003299}
Howard Ro688ae182018-09-25 00:09:36 -07003300
joshmccloskey6f952b22019-03-25 20:59:35 -07003301/**
3302 * Logs when a biometric enrollment occurs.
3303 *
3304 * Logged from:
3305 * frameworks/base/services/core/java/com/android/server/biometrics
3306 */
3307message BiometricEnrolled {
3308 // Biometric modality that was used.
3309 optional android.hardware.biometrics.ModalityEnum modality = 1;
3310 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3311 optional int32 user = 2;
3312 // The amount of time the enrollment took in milliseconds.
3313 optional int64 latency_millis = 3;
3314 // Whether or not the enrollment was successful.
3315 optional bool success = 4;
3316}
3317
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003318/*
Tej Singh0d176952019-01-16 19:10:54 -08003319 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003320 */
Tej Singh0d176952019-01-16 19:10:54 -08003321message FlagFlipUpdateOccurred {
3322 // If the event is from a flag config package, specify the package name.
3323 optional string flag_flip_package_name = 1;
3324
3325 // The order id of the package
3326 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003327}
3328
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003329/**
3330 * Potential experiment ids that goes with a train install.
3331 */
3332message TrainExperimentIds {
3333 repeated int64 experiment_id = 1;
3334}
3335
Yangster-macb89807e2018-11-15 21:10:57 -08003336/*
3337 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003338 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003339 */
3340message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003341 // Name of the train.
3342 optional string train_name = 1;
3343 // Version code for a "train" of packages that need to be installed atomically
3344 optional int64 train_version_code = 2;
3345 // After installation of this package, device requires a restart.
3346 optional bool requires_staging = 3;
3347 // Rollback should be enabled for this install.
3348 optional bool rollback_enabled = 4;
3349 // Requires low latency monitoring if possible.
3350 optional bool requires_low_latency_monitor = 5;
3351
Yangster-macb89807e2018-11-15 21:10:57 -08003352 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003353 UNKNOWN = 0;
3354 INSTALL_REQUESTED = 1;
3355 INSTALL_STARTED = 2;
3356 INSTALL_STAGED_NOT_READY = 3;
3357 INSTALL_STAGED_READY = 4;
3358 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003359 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3360 // and INSTALL_FAILURE_COMMIT.
3361 INSTALL_FAILURE = 6 [deprecated = true];
3362 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003363 INSTALL_CANCELLED = 7;
3364 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003365 INSTALLER_ROLLBACK_INITIATED = 9;
3366 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3367 INSTALLER_ROLLBACK_STAGED = 11;
3368 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3369 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3370 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3371 INSTALLER_ROLLBACK_SUCCESS = 15;
3372 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003373 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3374 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3375 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3376 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3377 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3378 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003379 INSTALL_FAILURE_DOWNLOAD = 23;
3380 INSTALL_FAILURE_STATE_MISMATCH = 24;
3381 INSTALL_FAILURE_COMMIT = 25;
Yangster-macb89807e2018-11-15 21:10:57 -08003382 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003383 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003384 // Possible experiment ids for monitoring this push.
3385 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3386 // user id
3387 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003388}
3389
Tej Singhc9203082019-05-03 13:42:23 -07003390/* Test atom, is not logged anywhere */
3391message TestAtomReported {
3392 repeated AttributionNode attribution_node = 1;
3393 optional int32 int_field = 2;
3394 optional int64 long_field = 3;
3395 optional float float_field = 4;
3396 optional string string_field = 5;
3397 optional bool boolean_field = 6;
3398 enum State {
3399 UNKNOWN = 0;
3400 OFF = 1;
3401 ON = 2;
3402 }
3403 optional State state = 7;
3404 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3405}
3406
Maggie Whitefc1aa592018-11-28 21:55:23 -08003407/** Represents USB port overheat event. */
3408message UsbPortOverheatEvent {
3409 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3410 optional int32 plug_temperature_deci_c = 1;
3411
3412 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3413 optional int32 max_temperature_deci_c = 2;
3414
3415 /* Time between USB plug event and overheat threshold trip, in seconds. */
3416 optional int32 time_to_overheat_secs = 3;
3417
3418 /* Time between overheat threshold trip and hysteresis, in seconds. */
3419 optional int32 time_to_hysteresis_secs = 4;
3420
3421 /* Time between hysteresis and active mitigation ending, in seconds. */
3422 optional int32 time_to_inactive_secs = 5;
3423};
3424
Maggie White8735b852019-01-18 11:40:49 -08003425/**
3426 * Logs total effective full charge and discharge cycles on a battery.
3427 * Here are some examples of one effective cycle:
3428 * 1) the battery charges from 0% to 100% and drains back to 0%,
3429 * 2) charging from 50% to 100% and draining back to 50% twice.
3430 * Pulled from:
3431 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3432 */
3433message BatteryCycleCount {
3434 /* Number of total charge and discharge cycles on the system battery. */
3435 optional int32 cycle_count = 1;
3436}
3437
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003438/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003439 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3440 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003441 * Pulled from:
3442 * StatsCompanionService
3443 */
3444
Carmen Agimof12dec122019-03-06 16:14:38 +00003445message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003446
Carmen Agimof12dec122019-03-06 16:14:38 +00003447 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003448 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003449 PUBLIC = 1;
3450 PRIVATE = 2;
3451 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003452 }
3453
Carmen Agimof12dec122019-03-06 16:14:38 +00003454 // The type of external storage.
3455 optional android.stats.storage.ExternalStorageType storage_type = 1;
3456 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3457 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003458 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003459 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003460}
3461
Yangster-macb89807e2018-11-15 21:10:57 -08003462/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003463 * Logs when a connection becomes available and lost.
3464 * Logged in StatsCompanionService.java
3465 */
3466message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003467 // Id of the network.
3468 optional int32 net_id = 1;
3469
3470 enum State {
3471 UNKNOWN = 0;
3472 CONNECTED = 1;
3473 DISCONNECTED = 2;
3474 }
3475 // Connected state of a network.
3476 optional State state = 2;
3477}
3478
3479/**
3480 * Logs when a service starts and stops.
3481 * Logged from:
3482 * services/core/java/com/android/server/am/ActiveServices.java
3483 */
3484message ServiceStateChanged {
3485
3486 optional int32 uid = 1 [(is_uid) = true];
3487
3488 optional string package_name = 2;
3489
3490 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003491
3492 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003493 START = 1;
3494 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003495 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003496
3497 optional State state = 4;
3498}
3499
3500/**
3501 * Logs when a service is launched.
3502 * Logged from:
3503 * services/core/java/com/android/server/am/ActiveServices.java
3504 */
3505message ServiceLaunchReported {
3506
3507 optional int32 uid = 1 [(is_uid) = true];
3508
3509 optional string package_name = 2;
3510
3511 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003512}
Howard Ro688ae182018-09-25 00:09:36 -07003513
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003514/**
3515 * Logs when a hidden API is used.
3516 *
3517 * Logged from:
3518 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3519 */
3520message HiddenApiUsed {
3521 // The uid of the app making the hidden access.
3522 optional int32 uid = 1 [(is_uid) = true];
3523
3524 // Signature of the method or field accessed.
3525 optional string signature = 2;
3526
3527 enum AccessMethod {
3528 NONE = 0;
3529 REFLECTION = 1;
3530 JNI = 2;
3531 LINKING = 3;
3532 }
3533
3534 // Type of access.
3535 optional AccessMethod access_method = 3;
3536
3537 // Whether the access was prevented or not.
3538 optional bool access_denied = 4;
3539}
3540
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003541/**
3542 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3543 * - When user sees privacy chip
3544 * - When user clicks privacy chip
3545 * - How does the user exit the Privacy Dialog
3546 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003547 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3548 */
3549message PrivacyIndicatorsInteracted {
3550
3551 enum Type {
3552 UNKNOWN = 0;
3553 CHIP_VIEWED = 1;
3554 CHIP_CLICKED = 2;
3555 DIALOG_PRIVACY_SETTINGS = 3;
3556 DIALOG_DISMISS = 4;
3557 DIALOG_LINE_ITEM = 5;
3558 }
3559
3560 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3561
3562 // Used if the type is LINE_ITEM
3563 optional string package_name = 2;
3564}
3565
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003566/**
3567 * Logs information about a package that is moved from the internal to external storage and vice
3568 * versa.
3569 * It logs the package name, the type of the external storage where the package is installed
3570 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3571 * and the move type: if it's from internal to external or the other way around.
3572 *
3573 * Logged from:
3574 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3575 */
3576message AppMovedStorageReported {
3577 enum MoveType {
3578 UNKNOWN = 0;
3579 TO_EXTERNAL = 1;
3580 TO_INTERNAL = 2;
3581 }
3582 // The type of the external storage.
3583 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3584 // The type of move.
3585 optional MoveType move_type = 2;
3586 // The name of the package that was moved.
3587 optional string package_name = 3;
3588}
3589
jianjin8f2dee02019-03-29 14:03:08 -07003590/**
3591 * Logs when system server watchdog occurs.
3592 * Logged from:
3593 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3594 */
3595message SystemServerWatchdogOccurred {
3596 optional string subject = 1;
3597}
3598
3599/**
3600 * Logs when new file added to tombstones.
3601 * Logged from:
3602 * frameworks/base/core/java/com/android/server/BootReceiver.java
3603 */
3604message TombStoneOccurred {
3605}
3606
Hai Zhang5d3328d2019-04-13 21:25:06 +08003607/*
3608 * Information about a role request
3609 *
3610 * Logged from:
3611 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3612 */
3613message RoleRequestResultReported {
3614 // UID of application requesting the role
3615 optional int32 requesting_uid = 1;
3616
3617 // Package name of application requesting the role
3618 optional string requesting_package_name = 2;
3619
3620 // The role to be granted
3621 optional string role_name = 3;
3622
3623 // The count of applications qualifying for the role
3624 optional int32 qualifying_count = 4;
3625
3626 // UID of application current granted the role
3627 optional int32 current_uid = 5;
3628
3629 // Package name of application current granted the role
3630 optional string current_package_name = 6;
3631
3632 // UID of another application that user chose to grant the role to, instead of the requesting
3633 // application
3634 optional int32 granted_another_uid = 7;
3635
3636 // Package name of another application that user chose to grant the role to, instead of the
3637 // requesting application
3638 optional string granted_another_package_name = 8;
3639
3640 enum Result {
3641 UNDEFINED = 0;
3642 // role request was ignored
3643 IGNORED = 1;
3644 // role request was ignored because it's already granted
3645 IGNORED_ALREADY_GRANTED = 2;
3646 // role request was ignored because the application isn't qualified
3647 IGNORED_NOT_QUALIFIED = 3;
3648 // role request was ignored because user said it should be always denied
3649 IGNORED_USER_ALWAYS_DENIED = 4;
3650 // role was granted by user action
3651 USER_GRANTED = 5;
3652 // role was denied by user action
3653 USER_DENIED = 6;
3654 // role was denied by user granting another application the role
3655 USER_DENIED_GRANTED_ANOTHER = 7;
3656 // role was denied and set to be always denied by the user
3657 USER_DENIED_WITH_ALWAYS = 8;
3658 }
3659 // The result of the role request
3660 optional Result result = 9;
3661}
3662
Chenjie Yubbcbc602018-02-05 16:51:52 -08003663//////////////////////////////////////////////////////////////////////
3664// Pulled atoms below this line //
3665//////////////////////////////////////////////////////////////////////
3666
3667/**
David Chenc8a43242017-10-17 16:23:28 -07003668 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3669 *
3670 * Pulled from:
3671 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3672 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003673message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003674 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003675
3676 optional int64 rx_bytes = 2;
3677
3678 optional int64 rx_packets = 3;
3679
3680 optional int64 tx_bytes = 4;
3681
3682 optional int64 tx_packets = 5;
3683}
3684
3685/**
3686 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3687 *
3688 * Pulled from:
3689 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3690 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003691message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003692 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003693
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003694 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3695 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003696
3697 optional int64 rx_bytes = 3;
3698
3699 optional int64 rx_packets = 4;
3700
3701 optional int64 tx_bytes = 5;
3702
3703 optional int64 tx_packets = 6;
3704}
3705
3706/**
3707 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3708 *
3709 * Pulled from:
3710 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3711 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003712message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003713 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003714
3715 optional int64 rx_bytes = 2;
3716
3717 optional int64 rx_packets = 3;
3718
3719 optional int64 tx_bytes = 4;
3720
3721 optional int64 tx_packets = 5;
3722}
3723
3724/**
3725 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3726 *
3727 * Pulled from:
3728 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3729 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003730message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003731 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003732
Yao Chenc40a19d2018-03-15 16:48:25 -07003733 // 1 denotes foreground and 0 denotes background. This is called Set in
3734 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003735 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003736
3737 optional int64 rx_bytes = 3;
3738
3739 optional int64 rx_packets = 4;
3740
3741 optional int64 tx_bytes = 5;
3742
3743 optional int64 tx_packets = 6;
3744}
3745
3746/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003747 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
3748 *
3749 * Pulled from:
3750 * StatsCompanionService
3751 */
3752message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003753 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003754
3755 optional int64 rx_bytes = 2;
3756
3757 optional int64 tx_bytes = 3;
3758}
3759
3760/**
David Chenc8a43242017-10-17 16:23:28 -07003761 * Pulls the kernel wakelock durations. This atom is adapted from
3762 * android/internal/os/KernelWakelockStats.java
3763 *
3764 * Pulled from:
3765 * StatsCompanionService using KernelWakelockReader.
3766 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003767message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07003768 optional string name = 1;
3769
3770 optional int32 count = 2;
3771
3772 optional int32 version = 3;
3773
Yangster-maca8a30442018-10-13 23:46:34 -07003774 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07003775}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003776
Chenjie Yu05013b32017-11-21 10:21:41 -08003777/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003778 * Pulls low power state information. If power.stats HAL is not available, this
3779 * includes platform and subsystem sleep state information,
3780 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
3781 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003782 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003783 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003784 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
3785 * as defined in:
3786 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07003787 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003788message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08003789 // Subsystem name
3790 optional string subsystem_name = 1;
3791 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
3792 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08003793 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
3794 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003795 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003796 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08003797 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08003798 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08003799 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07003800}
Chenjie Yu7f8def92017-11-03 09:33:15 -07003801
Chenjie Yu05013b32017-11-21 10:21:41 -08003802/**
Bookatz92da2832018-11-01 18:10:03 -07003803 * Pulls on-device power measurement information.
3804 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
3805 * Pulled from:
3806 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
3807 */
3808message OnDevicePowerMeasurement {
3809 // Name of the subsystem (to which the rail belongs).
3810 optional string subsystem_name = 1;
3811
3812 // Rail name. The rail lies within the subsystem.
3813 optional string rail_name = 2;
3814
3815 // Time (in ms since boot) at which the rail energy value was measured.
3816 // This may differ slightly from the time that statsd logs this information.
3817 optional uint64 measurement_timestamp_millis = 3;
3818
3819 // Accumulated energy used via the rail since device boot in uWs.
3820 optional uint64 energy_microwatt_secs = 4;
3821}
3822
3823/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07003824 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08003825 * Pulls the time the cpu spend on the frequency index. Frequency index
3826 * starts from highest to lowest. The value should be monotonically
3827 * increasing since boot. However, if there is a cpu
3828 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07003829 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003830message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07003831 optional uint32 cluster = 1;
3832 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003833 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07003834}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003835
Chenjie Yu05013b32017-11-21 10:21:41 -08003836/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003837 * Pulls Cpu Time Per Uid.
3838 * Note that isolated process uid time should be attributed to host uids.
3839 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003840message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07003841 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00003842 optional uint64 user_time_micros = 2;
3843 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003844}
3845
3846/**
3847 * Pulls Cpu Time Per Uid per frequency.
3848 * Note that isolated process uid time should be attributed to host uids.
3849 * For each uid, we order the time by descending frequencies.
3850 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003851message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07003852 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08003853 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08003854 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08003855}
Hugo Benichi884970e2017-11-14 22:42:46 +09003856
Chenjie Yu05013b32017-11-21 10:21:41 -08003857/**
3858 * Pulls Wifi Controller Activity Energy Info
3859 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003860message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003861 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003862 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08003863 // stack reported state
3864 // TODO: replace this with proto enum
3865 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003866 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003867 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003868 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003869 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003870 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003871 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003872 // product of current(mA), voltage(V) and time(ms)
3873 optional uint64 controller_energy_used = 6;
3874}
3875
3876/**
3877 * Pulls Modem Activity Energy Info
3878 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003879message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08003880 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003881 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07003882 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08003883 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003884 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003885 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08003886 /**
3887 * Tx power index
3888 * index 0 = tx_power < 0dBm
3889 * index 1 = 0dBm < tx_power < 5dBm
3890 * index 2 = 5dBm < tx_power < 15dBm
3891 * index 3 = 15dBm < tx_power < 20dBm
3892 * index 4 = tx_power > 20dBm
3893 */
3894 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08003895 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08003896 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08003897 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08003898 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08003899 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08003900 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08003901 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08003902 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08003903 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08003904 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08003905 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08003906 // product of current(mA), voltage(V) and time(ms)
3907 optional uint64 energy_used = 10;
Joe Onorato62c220b2017-11-18 20:32:56 -08003908}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003909
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003910/**
3911 * Pulls Bluetooth Activity Energy Info
3912 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
3913 */
3914message BluetoothActivityInfo {
3915 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08003916 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003917 // bluetooth stack state
3918 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07003919 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003920 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07003921 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003922 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07003923 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08003924 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08003925 // product of current(mA), voltage(V) and time(ms)
3926 optional uint64 energy_used = 6;
3927}
3928
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08003929/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003930 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00003931 *
3932 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003933 */
3934message ProcessMemoryState {
3935 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003936 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003937
3938 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003939 // Usually package name, "system" for system server.
3940 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003941 optional string process_name = 2;
3942
Rafal Slawikda51b932018-12-13 16:31:33 +00003943 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07003944 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003945
3946 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003947 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003948
3949 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003950 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003951
Rajeev Kumar90235992018-01-29 11:06:48 -08003952 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003953 // Value is read from /proc/PID/stat, field 24. Or from memory.stat, field
3954 // total_rss if per-app memory cgroups are enabled.
Rajeev Kumar90235992018-01-29 11:06:48 -08003955 optional int64 rss_in_bytes = 6;
3956
3957 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00003958 // Value is read from memory.stat, field total_cache if per-app memory
3959 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08003960 optional int64 cache_in_bytes = 7;
3961
3962 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00003963 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik44af3b32019-04-16 13:16:15 +01003964 // cgroups are enabled. Otherwise, VmSwap from /proc/PID/status.
Rajeev Kumar90235992018-01-29 11:06:48 -08003965 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01003966
Rafal Slawikd03ae422018-11-20 11:27:45 +00003967 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003968 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00003969
3970 // Elapsed real time when the process started.
3971 // Value is read from /proc/PID/stat, field 22. 0 if read from per-app memory cgroups.
3972 optional int64 start_time_nanos = 10;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08003973}
3974
3975/*
Rafal Slawik08621582018-10-15 14:53:07 +01003976 * Logs the memory stats for a native process (from procfs).
Rafal Slawikda51b932018-12-13 16:31:33 +00003977 *
3978 * Pulled from StatsCompanionService for selected native processes.
Rafal Slawik08621582018-10-15 14:53:07 +01003979 */
3980message NativeProcessMemoryState {
Rafal Slawikbf67d072018-10-23 11:07:54 +01003981 // The uid if available. -1 means not available.
3982 optional int32 uid = 1 [(is_uid) = true];
Rafal Slawik08621582018-10-15 14:53:07 +01003983
Rafal Slawikbf67d072018-10-23 11:07:54 +01003984 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00003985 // Value read from /proc/PID/cmdline.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003986 optional string process_name = 2;
Rafal Slawik08621582018-10-15 14:53:07 +01003987
Rafal Slawikbf67d072018-10-23 11:07:54 +01003988 // # of page-faults
3989 optional int64 page_fault = 3;
Rafal Slawik08621582018-10-15 14:53:07 +01003990
Rafal Slawikbf67d072018-10-23 11:07:54 +01003991 // # of major page-faults
3992 optional int64 page_major_fault = 4;
Rafal Slawik08621582018-10-15 14:53:07 +01003993
Rafal Slawikbf67d072018-10-23 11:07:54 +01003994 // RSS
Rafal Slawikda51b932018-12-13 16:31:33 +00003995 // Value read from /proc/PID/stat, field 24.
Rafal Slawikbf67d072018-10-23 11:07:54 +01003996 optional int64 rss_in_bytes = 5;
Rafal Slawik08621582018-10-15 14:53:07 +01003997
Rafal Slawikd03ae422018-11-20 11:27:45 +00003998 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always 0.
Rafal Slawik3bea8952018-11-15 12:39:33 +00003999 optional int64 rss_high_watermark_in_bytes = 6 [deprecated = true];
Rafal Slawikbf67d072018-10-23 11:07:54 +01004000
4001 // Elapsed real time when the process started.
4002 // Value is read from /proc/PID/stat, field 22.
4003 optional int64 start_time_nanos = 7;
Rafal Slawik44af3b32019-04-16 13:16:15 +01004004
4005 // SWAP
4006 // Value read from /proc/PID/status, field VmSwap.
4007 optional int64 swap_in_bytes = 8;
Rafal Slawik08621582018-10-15 14:53:07 +01004008}
4009
4010/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004011 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004012 *
4013 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4014 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004015 *
4016 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004017 */
4018message ProcessMemoryHighWaterMark {
4019 // The uid if available. -1 means not available.
4020 optional int32 uid = 1 [(is_uid) = true];
4021
Rafal Slawikda51b932018-12-13 16:31:33 +00004022 // The process name.
4023 // Usually package name or process cmdline.
4024 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004025 optional string process_name = 2;
4026
4027 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4028 // /proc/PID/status.
4029 optional int64 rss_high_water_mark_in_bytes = 3;
4030}
4031
4032/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004033 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004034 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004035message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004036 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004037}
4038
4039/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004040 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004041 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004042message SystemUptime {
4043 // Milliseconds since the system was booted.
4044 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4045 // for external input).
4046 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004047 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004048}
4049
4050/*
4051 * Reads from /proc/uid_concurrent_active_time which has the format:
4052 * active: X (X is # cores)
4053 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4054 * [uid1]: [time-0] [time-1] [time-2] ... ...
4055 * ...
4056 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4057 * The file contains a monotonically increasing count of time for a single boot.
4058 */
4059message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004060 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004061 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004062}
4063
4064/**
4065 * Reads from /proc/uid_concurrent_policy_time which has the format:
4066 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4067 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4068 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4069 * ...
4070 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4071 * The file contains a monotonically increasing count of time for a single boot.
4072 */
4073message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004074 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004075 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004076 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004077}
4078
4079/*
4080 * Pulls free disk space, for data, system partition and temporary directory.
4081 */
4082message DiskSpace {
4083 // available bytes in data partition
4084 optional uint64 data_available_bytes = 1;
4085 // available bytes in system partition
4086 optional uint64 system_available_bytes = 2;
4087 // available bytes in download cache or temp directories
4088 optional uint64 temp_available_bytes = 3;
4089}
Tej Singhbf972d92018-01-10 20:51:13 -08004090
4091/**
4092 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004093 *
4094 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004095 */
4096message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004097 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004098}
4099
4100/**
4101 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004102 * Pulled from:
4103 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004104 */
4105message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004106 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004107}
4108
4109/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004110 * Pulls battery voltage.
4111 * Pulled from:
4112 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4113 */
4114message BatteryVoltage {
4115 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004116 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004117}
4118
4119/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004120 * Pulls battery level (percent full, from 0 to 100).
4121 *
4122 * Pulled from:
4123 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4124 */
4125message BatteryLevel {
4126 // Battery level. Should be in [0, 100].
4127 optional int32 battery_level = 1;
4128}
4129
4130/**
Tej Singhd89137e2018-03-26 14:51:40 -07004131 * Pulls the temperature of various parts of the device.
4132 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004133 *
Maggie White442b6312019-04-05 16:26:44 -07004134 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004135 */
4136message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004137 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004138 optional android.os.TemperatureTypeEnum sensor_location = 1;
4139
4140 // The name of the temperature source. Eg. CPU0
4141 optional string sensor_name = 2;
4142
Tej Singhd89137e2018-03-26 14:51:40 -07004143 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004144 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004145 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004146
4147 // Relative severity of the throttling, see enum definition.
4148 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004149}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004150
4151/**
4152 * Pulls the statistics of calls to Binder.
4153 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004154 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4155 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004156 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004157 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004158 */
4159message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004160 // UID of the process responsible for the binder transaction. It will be set if the process
4161 // executing the binder transaction attribute the transaction to another uid using
4162 // Binder.setThreadWorkSource().
4163 //
4164 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004165 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004166 // UID of the process executing the binder transaction.
4167 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004168 // Fully qualified class name of the API call.
4169 //
4170 // This is a system server class name.
4171 //
4172 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4173 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4174 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4175 // commonly used APIs.
4176 optional string service_class_name = 2;
4177 // Method name of the API call. It can also be a transaction code if we cannot
4178 // resolve it to a name. See Binder#getTransactionName.
4179 //
4180 // This is a system server method name.
4181 optional string service_method_name = 3;
4182 // Total number of API calls.
4183 optional int64 call_count = 4;
4184 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4185 optional bool screen_interactive = 13;
4186 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4187 // call_count will be equal to recorded_call_count.
4188 //
4189 // If recorded_call_count is different than call_count, it means data collection has been
4190 // sampled. All the fields below will be sampled in this case.
4191 optional int64 recorded_call_count = 12;
4192 // Number of exceptions thrown by the API.
4193 optional int64 recorded_exception_count = 5;
4194 // Total latency of all API calls.
4195 // Average can be computed using total_latency_micros / recorded_call_count.
4196 optional int64 recorded_total_latency_micros = 6;
4197 // Maximum latency of one API call.
4198 optional int64 recorded_max_latency_micros = 7;
4199 // Total CPU usage of all API calls.
4200 // Average can be computed using total_cpu_micros / recorded_call_count.
4201 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4202 optional int64 recorded_total_cpu_micros = 8;
4203 // Maximum CPU usage of one API call.
4204 optional int64 recorded_max_cpu_micros = 9;
4205 // Maximum parcel reply size of one API call.
4206 optional int64 recorded_max_reply_size_bytes = 10;
4207 // Maximum parcel request size of one API call.
4208 optional int64 recorded_max_request_size_bytes = 11;
4209}
4210
4211/**
4212 * Pulls the statistics of exceptions during calls to Binder.
4213 *
4214 * Binder stats are cumulative from boot unless somebody reset the data using
4215 * > adb shell dumpsys binder_calls_stats --reset
4216 */
4217message BinderCallsExceptions {
4218 // Exception class name, e.g. java.lang.IllegalArgumentException.
4219 //
4220 // This is an exception class name thrown by the system server.
4221 optional string exception_class_name = 1;
4222 // Total number of exceptions.
4223 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004224}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004225
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004226/**
4227 * Pulls the statistics of message dispatching on HandlerThreads.
4228 *
4229 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4230 * config on the device.
4231 *
4232 * Next tag: 11
4233 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004234message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004235 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004236 optional int32 uid = 1 [(is_uid) = true];
4237
4238 // Fully qualified class name of the handler target class.
4239 //
4240 // This field does not contain PII. This is a system server class name.
4241 optional string handler_class_name = 2;
4242
4243 // The name of the thread that runs the Looper.
4244 //
4245 // This field does not contain PII. This is a system server thread name.
4246 optional string looper_thread_name = 3;
4247
4248 // The name of the dispatched message.
4249 //
4250 // This field does not contain PII. This is a system server constant or class
4251 // name.
4252 optional string message_name = 4;
4253
4254 // Total number of successfully dispatched messages.
4255 optional int64 message_count = 5;
4256
4257 // Total number of messages that failed dispatching.
4258 optional int64 exception_count = 6;
4259
4260 // Total number of processed messages we have data recorded for. If we
4261 // collected data for all the messages, message_count will be equal to
4262 // recorded_message_count.
4263 //
4264 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004265 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004266 optional int64 recorded_message_count = 7;
4267
4268 // Total latency of all processed messages.
4269 // Average can be computed using recorded_total_latency_micros /
4270 // recorded_message_count.
4271 optional int64 recorded_total_latency_micros = 8;
4272
4273 // Total CPU usage of all processed message.
4274 // Average can be computed using recorded_total_cpu_micros /
4275 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004276 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004277 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004278
4279 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4280 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004281
4282 // Max recorded CPU usage of all processed messages.
4283 optional int64 recorded_max_cpu_micros = 11;
4284
4285 // Max recorded latency of all processed messages.
4286 optional int64 recorded_max_latency_micros = 12;
4287
4288 // Total number of messages we tracked the dispatching delay for. If we
4289 // collected data for all the messages, message_count will be equal to
4290 // recorded_delay_message_count.
4291 //
4292 // If recorded_delay_message_count is different than message_count, it means data
4293 // collection has been sampled or/and not all messages specified the target dispatch time.
4294 // The fields below will be sampled in this case.
4295 optional int64 recorded_delay_message_count = 13;
4296
4297 // Total dispatching delay of all processed messages.
4298 // Calculated as a difference between the target dispatching time (Message.when)
4299 // and the actual dispatching time.
4300 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4301 optional int64 recorded_total_delay_millis = 14;
4302
4303 // Max dispatching delay of all processed messages.
4304 // Calculated as a difference between the target dispatching time (Message.when)
4305 // and the actual dispatching time.
4306 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004307}
Tej Singh86dc9db2018-09-06 00:39:57 +00004308
4309/**
4310 * Pulls disk information, such as write speed and latency.
4311 */
4312message DiskStats {
4313 // Time taken to open, write 512B to, and close a file.
4314 // -1 if error performing the check.
4315 optional int64 data_write_latency_millis = 1;
4316
4317 optional bool file_based_encryption = 2;
4318
4319 // Recent disk write speed in kB/s.
4320 // -1 if error querying storageed.
4321 // 0 if data is unavailable.
4322 optional int32 recent_disk_write_speed = 3;
4323}
4324
4325
4326/**
4327 * Free and total bytes of the Data, Cache, and System partition.
4328 */
4329message DirectoryUsage {
4330 enum Directory {
4331 UNKNOWN = 0;
4332 DATA = 1;
4333 CACHE = 2;
4334 SYSTEM = 3;
4335 }
4336 optional Directory directory = 1;
4337 optional int64 free_bytes = 2;
4338 optional int64 total_bytes = 3;
4339}
4340
4341
4342/**
4343 * Size of an application: apk size, data size, and cache size.
4344 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4345 * Information is only reported for apps with the primary user (user 0).
4346 * Sizes are aggregated by package name.
4347 */
4348message AppSize {
4349 // Including uids will involve modifying diskstats logic.
4350 optional string package_name = 1;
4351 // App size in bytes. -1 if unavailable.
4352 optional int64 app_size_bytes = 2;
4353 // App data size in bytes. -1 if unavailable.
4354 optional int64 app_data_size_bytes = 3;
4355 // App cache size in bytes. -1 if unavailable.
4356 optional int64 app_cache_size_bytes = 4;
4357 // Time that the cache file was produced.
4358 // Uses System.currentTimeMillis(), which is wall clock time.
4359 optional int64 cache_time_millis = 5;
4360}
4361
4362
4363/**
4364 * Size of a particular category. Eg: photos, videos.
4365 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4366 */
4367message CategorySize {
4368 enum Category {
4369 UNKNOWN = 0;
4370 APP_SIZE = 1;
4371 APP_DATA_SIZE = 2;
4372 APP_CACHE_SIZE = 3;
4373 PHOTOS = 4;
4374 VIDEOS = 5;
4375 AUDIO = 6;
4376 DOWNLOADS = 7;
4377 SYSTEM = 8;
4378 OTHER = 9;
4379 }
4380 optional Category category = 1;
4381 // Category size in bytes.
4382 optional int64 size_bytes = 2;
4383 // Time that the cache file was produced.
4384 // Uses System.currentTimeMillis(), which is wall clock time.
4385 optional int64 cache_time_millis = 3;
4386}
Tej Singhd6d6d772018-09-05 17:41:25 -07004387
4388/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004389 * Pulls per uid I/O stats. The stats are cumulative since boot.
4390 *
4391 * Read/write bytes are I/O events from a storage device
4392 * Read/write chars are data requested by read/write syscalls, and can be
4393 * satisfied by caching.
4394 *
4395 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4396 */
4397message DiskIo {
4398 optional int32 uid = 1 [(is_uid) = true];
4399 optional int64 fg_chars_read = 2;
4400 optional int64 fg_chars_write = 3;
4401 optional int64 fg_bytes_read = 4;
4402 optional int64 fg_bytes_write = 5;
4403 optional int64 bg_chars_read = 6;
4404 optional int64 bg_chars_write = 7;
4405 optional int64 bg_bytes_read = 8;
4406 optional int64 bg_bytes_write = 9;
4407 optional int64 fg_fsync = 10;
4408 optional int64 bg_fsync= 11;
4409}
4410
4411
4412/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004413 * Pulls the number of fingerprints for each user.
4414 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004415 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004416 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004417message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004418 // The associated user. Eg: 0 for owners, 10+ for others.
4419 // Defined in android/os/UserHandle.java
4420 optional int32 user = 1;
4421 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004422 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004423}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004424
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004425/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004426 * Pulls the number of faces for each user.
4427 *
4428 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4429 */
4430message NumFacesEnrolled {
4431 // The associated user. Eg: 0 for owners, 10+ for others.
4432 // Defined in android/os/UserHandle.java
4433 optional int32 user = 1;
4434 // Number of faces registered to that user.
4435 optional int32 num_faces_enrolled = 2;
4436}
4437/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004438 * A mapping of role holder -> role
4439 */
4440message RoleHolder {
4441 // uid of the role holder
4442 optional int32 uid = 1 [(is_uid) = true];
4443
4444 // package name of the role holder
4445 optional string package_name = 2;
4446
4447 // the role held
4448 optional string role = 3;
4449}
4450
Yangsteraf9aee72018-10-12 09:26:16 -07004451message AggStats {
4452 optional int64 min = 1;
4453
4454 optional int64 average = 2;
4455
4456 optional int64 max = 3;
4457}
4458
4459message ProcessStatsStateProto {
4460 optional android.service.procstats.ScreenState screen_state = 1;
4461
4462 optional android.service.procstats.MemoryState memory_state = 2;
4463
4464 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4465 // and not frameworks/base/core/java/android/app/ActivityManager.java
4466 optional android.service.procstats.ProcessState process_state = 3;
4467
4468 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004469 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004470
4471 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004472 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004473
4474 // # of samples taken
4475 optional int32 sample_size = 5;
4476
4477 // PSS is memory reserved for this process
4478 optional AggStats pss = 6;
4479
4480 // USS is memory shared between processes, divided evenly for accounting
4481 optional AggStats uss = 7;
4482
4483 // RSS is memory resident for this process
4484 optional AggStats rss = 8;
4485}
4486
4487// Next Tag: 7
4488message ProcessStatsProto {
4489 // Name of process.
4490 optional string process = 1;
4491
4492 // Uid of the process.
4493 optional int32 uid = 2;
4494
4495 // Information about how often kills occurred
4496 message Kill {
4497 // Count of excessive CPU kills
4498 optional int32 cpu = 1;
4499
4500 // Count of kills when cached
4501 optional int32 cached = 2;
4502
4503 // PSS stats during cached kill
4504 optional AggStats cached_pss = 3;
4505 }
4506 optional Kill kill = 3;
4507
4508 // Time and memory spent in various states.
4509 repeated ProcessStatsStateProto states = 5;
4510
4511 // Total time process has been running... screen_state, memory_state, and process_state
4512 // will not be set.
4513 optional ProcessStatsStateProto total_running_state = 6;
4514}
4515
4516message PackageServiceOperationStatsProto {
4517 // Operate enum: Started, Foreground, Bound, Executing
4518 optional android.service.procstats.ServiceOperationState operation = 1;
4519
4520 // Number of times the service was in this operation.
4521 optional int32 count = 2;
4522
4523 // Information about a state the service can be in.
4524 message StateStats {
4525 // Screen state enum.
4526 optional android.service.procstats.ScreenState screen_state = 1;
4527 // Memory state enum.
4528 optional android.service.procstats.MemoryState memory_state = 2;
4529
4530 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004531 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004532 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004533 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004534 }
4535 repeated StateStats state_stats = 3;
4536}
4537
4538message PackageServiceStatsProto {
4539 // Name of service component.
4540 optional string service_name = 1;
4541
4542 // The operation stats.
4543 // The package_name, package_uid, package_version, service_name will not be set to save space.
4544 repeated PackageServiceOperationStatsProto operation_stats = 2;
4545}
4546
4547message PackageAssociationSourceProcessStatsProto {
4548 // Uid of the process.
4549 optional int32 process_uid = 1;
4550 // Process name.
4551 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004552 // Package name.
4553 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004554 // Total count of the times this association appeared.
4555 optional int32 total_count = 3;
4556
4557 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004558 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004559
4560 // Total count of the times this association became actively impacting its target process.
4561 optional int32 active_count = 5;
4562
4563 // Information on one source in this association.
4564 message StateStats {
4565 // Process state enum.
4566 optional android.service.procstats.ProcessState process_state = 1;
4567 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004568 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004569 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004570 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004571 }
4572 repeated StateStats active_state_stats = 6;
4573}
4574
4575message PackageAssociationProcessStatsProto {
4576 // Name of the target component.
4577 optional string component_name = 1;
4578 // Information on one source in this association.
4579 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4580}
4581
4582
4583message ProcessStatsPackageProto {
4584 // Name of package.
4585 optional string package = 1;
4586
4587 // Uid of the package.
4588 optional int32 uid = 2;
4589
4590 // Version of the package.
4591 optional int64 version = 3;
4592
4593 // Stats for each process running with the package loaded in to it.
4594 repeated ProcessStatsProto process_stats = 4;
4595
4596 // Stats for each of the package's services.
4597 repeated PackageServiceStatsProto service_stats = 5;
4598
4599 // Stats for each association with the package.
4600 repeated PackageAssociationProcessStatsProto association_stats = 6;
4601}
4602
4603message ProcessStatsSectionProto {
4604 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004605 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004606
4607 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004608 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004609
4610 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004611 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004612
4613 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004614 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004615
4616 // System runtime library. e.g. "libdvm.so", "libart.so".
4617 optional string runtime = 5;
4618
4619 // whether kernel reports swapped pss.
4620 optional bool has_swapped_pss = 6;
4621
4622 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4623 enum Status {
4624 STATUS_UNKNOWN = 0;
4625 STATUS_COMPLETE = 1;
4626 STATUS_PARTIAL = 2;
4627 STATUS_SHUTDOWN = 3;
4628 STATUS_SYSPROPS = 4;
4629 }
4630 repeated Status status = 7;
4631
Chenjie Yub2ecc792019-01-17 10:27:26 -08004632 // Number of pages available of various types and sizes, representation fragmentation.
4633 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4634
Yangsteraf9aee72018-10-12 09:26:16 -07004635 // Stats for each process.
4636 repeated ProcessStatsProto process_stats = 8;
4637
4638 // Stats for each package.
4639 repeated ProcessStatsPackageProto package_stats = 9;
4640}
4641
Chenjie Yub2ecc792019-01-17 10:27:26 -08004642message ProcessStatsAvailablePagesProto {
4643 // Node these pages are in (as per /proc/pagetypeinfo)
4644 optional int32 node = 1;
4645
4646 // Zone these pages are in (as per /proc/pagetypeinfo)
4647 optional string zone = 2;
4648
4649 // Label for the type of these pages (as per /proc/pagetypeinfo)
4650 optional string label = 3;
4651
4652 // Distribution of number of pages available by order size. First entry in array is
4653 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4654 repeated int32 pages_per_order = 4;
4655}
4656
Chenjie Yu12e5e672018-09-14 15:54:59 -07004657/**
4658 * Pulled from ProcessStatsService.java
4659 */
4660message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004661 optional ProcessStatsSectionProto proc_stats_section = 1;
4662}
4663
Chenjie Yuf910b7802019-01-11 16:08:20 -08004664/**
4665 * Pulled from ProcessStatsService.java
4666 */
4667message ProcStatsPkgProc {
4668 optional ProcessStatsSectionProto proc_stats_section = 1;
4669}
4670
Yangsteraf9aee72018-10-12 09:26:16 -07004671message PowerProfileProto {
4672 optional double cpu_suspend = 1;
4673
4674 optional double cpu_idle = 2;
4675
4676 optional double cpu_active = 3;
4677
4678 message CpuCluster {
4679 optional int32 id = 1;
4680 optional double cluster_power = 2;
4681 optional int32 cores = 3;
4682 repeated int64 speed = 4;
4683 repeated double core_power = 5;
4684 }
4685
4686 repeated CpuCluster cpu_cluster = 40;
4687
4688 optional double wifi_scan = 4;
4689
4690 optional double wifi_on = 5;
4691
4692 optional double wifi_active = 6;
4693
4694 optional double wifi_controller_idle = 7;
4695
4696 optional double wifi_controller_rx = 8;
4697
4698 optional double wifi_controller_tx = 9;
4699
4700 repeated double wifi_controller_tx_levels = 10;
4701
4702 optional double wifi_controller_operating_voltage = 11;
4703
4704 optional double bluetooth_controller_idle = 12;
4705
4706 optional double bluetooth_controller_rx = 13;
4707
4708 optional double bluetooth_controller_tx = 14;
4709
4710 optional double bluetooth_controller_operating_voltage = 15;
4711
4712 optional double modem_controller_sleep = 16;
4713
4714 optional double modem_controller_idle = 17;
4715
4716 optional double modem_controller_rx = 18;
4717
4718 repeated double modem_controller_tx = 19;
4719
4720 optional double modem_controller_operating_voltage = 20;
4721
4722 optional double gps_on = 21;
4723
4724 repeated double gps_signal_quality_based = 22;
4725
4726 optional double gps_operating_voltage = 23;
4727
4728 optional double bluetooth_on = 24;
4729
4730 optional double bluetooth_active = 25;
4731
4732 optional double bluetooth_at_cmd = 26;
4733
4734 optional double ambient_display = 27;
4735
4736 optional double screen_on = 28;
4737
4738 optional double radio_on = 29;
4739
4740 optional double radio_scanning = 30;
4741
4742 optional double radio_active = 31;
4743
4744 optional double screen_full = 32;
4745
4746 optional double audio = 33;
4747
4748 optional double video = 34;
4749
4750 optional double flashlight = 35;
4751
4752 optional double memory = 36;
4753
4754 optional double camera = 37;
4755
4756 optional double wifi_batched_scan = 38;
4757
4758 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07004759}
Chenjie Yuab530202018-09-26 12:39:20 -07004760
4761/**
4762 * power_profile.xml and other constants for power model calculations.
4763 * Pulled from PowerProfile.java
4764 */
4765message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07004766 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07004767}
Chenjie Yub35b5f72018-10-13 23:25:11 -07004768
4769/**
arangelovd5db50e2018-10-12 20:24:39 +01004770 * Logs when a user restriction was added or removed.
4771 *
4772 * Logged from:
4773 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
4774 */
4775message UserRestrictionChanged {
4776 // The raw string of the user restriction as defined in UserManager.
4777 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
4778 optional string restriction = 1;
4779 // Whether the restriction is enabled or disabled.
4780 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07004781}
Yangster-mac308ea0c2018-10-22 13:10:25 -07004782
4783/**
4784 * Pulls process user time and system time. Puller takes a snapshot of all pids
4785 * in the system and returns cpu stats for those that are working at the time.
4786 * Dead pids will be dropped. Kernel processes are excluded.
4787 * Min cool-down is 5 sec.
4788 */
4789message ProcessCpuTime {
4790 optional int32 uid = 1 [(is_uid) = true];
4791
4792 optional string process_name = 2;
4793 // Process cpu time in user space, cumulative from boot/process start
4794 optional int64 user_time_millis = 3;
4795 // Process cpu time in system space, cumulative from boot/process start
4796 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01004797}
Misha Wagner5a51e002018-10-03 15:04:09 +01004798
4799/**
4800 * Pulls the CPU usage for each thread.
4801 *
4802 * Read from /proc/$PID/task/$TID/time_in_state files.
4803 *
4804 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
4805 * time_in_state files not being present on some phones, have not been addressed. These should be
4806 * considered before a public release.
4807 */
4808message CpuTimePerThreadFreq {
4809 // UID that owns the process.
4810 optional int32 uid = 1 [(is_uid) = true];
4811 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004812 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01004813 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00004814 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01004815 // Name of the process taken from `/proc/$PID/cmdline`.
4816 optional string process_name = 4;
4817 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
4818 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00004819
4820 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
4821 // are given in KHz, and time is given in milliseconds since the thread started. All eight
4822 // frequencies are given here as the alternative is sending eight separate atoms. This method
4823 // significantly reduces the amount of data created
4824 optional int32 frequency1_khz = 6;
4825 optional int32 time1_millis = 7;
4826 optional int32 frequency2_khz = 8;
4827 optional int32 time2_millis = 9;
4828 optional int32 frequency3_khz = 10;
4829 optional int32 time3_millis = 11;
4830 optional int32 frequency4_khz = 12;
4831 optional int32 time4_millis = 13;
4832 optional int32 frequency5_khz = 14;
4833 optional int32 time5_millis = 15;
4834 optional int32 frequency6_khz = 16;
4835 optional int32 time6_millis = 17;
4836 optional int32 frequency7_khz = 18;
4837 optional int32 time7_millis = 19;
4838 optional int32 frequency8_khz = 20;
4839 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01004840}
Bookatz75ee60422018-11-09 12:27:37 -08004841
4842/**
Bookatz366a4432018-11-20 09:42:33 -08004843 * Pulls information about the device's build.
4844 */
4845message BuildInformation {
4846 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
4847 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
4848 optional string fingerprint = 1;
4849
4850 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
4851 optional string brand = 2;
4852
4853 // Build.PRODUCT. The name of the overall product.
4854 optional string product = 3;
4855
4856 // Build.DEVICE. The name of the industrial design.
4857 optional string device = 4;
4858
4859 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
4860 optional string version_release = 5;
4861
4862 // Build.ID. E.g. a label like "M4-rc20".
4863 optional string id = 6;
4864
4865 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
4866 // represent this build.
4867 optional string version_incremental = 7;
4868
4869 // Build.TYPE. The type of build, like "user" or "eng".
4870 optional string type = 8;
4871
4872 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
4873 optional string tags = 9;
4874}
4875
4876/**
Adam Heff2185342019-01-23 15:59:09 -08004877 * Logs information about mismatched caller for content capture.
4878 *
4879 * Logged from:
4880 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
4881 */
4882message ContentCaptureCallerMismatchReported {
4883 optional string intended_package = 1;
4884 optional string calling_package = 2;
4885}
4886
4887/**
4888 * Logs information about content capture service events.
4889 *
4890 * Logged from:
4891 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4892 */
4893message ContentCaptureServiceEvents {
4894 // The type of event.
4895 enum Event {
4896 UNKNOWN = 0;
4897 ON_CONNECTED = 1;
4898 ON_DISCONNECTED = 2;
4899 SET_WHITELIST = 3;
4900 SET_DISABLED = 4;
4901 ON_USER_DATA_REMOVED = 5;
4902 }
4903 optional Event event = 1;
4904 // component/package of content capture service.
4905 optional string service_info = 2;
4906 // component/package of target.
4907 // it's a concatenated list of component/package for SET_WHITELIST event
4908 // separated by " ".
4909 optional string target_info = 3;
4910}
4911
4912/**
4913 * Logs information about content capture session events.
4914 *
4915 * Logged from:
4916 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4917 */
4918message ContentCaptureSessionEvents {
4919 // The type of event.
4920 enum Event {
4921 UNKNOWN = 0;
4922 ON_SESSION_STARTED = 1;
4923 ON_SESSION_FINISHED = 2;
4924 SESSION_NOT_CREATED = 3;
4925 }
4926 optional int32 session_id = 1;
4927 optional Event event = 2;
4928 // (n/a on session finished)
4929 optional int32 state_flags = 3;
4930 // component/package of content capture service.
4931 optional string service_info = 4;
4932 // component/package of app.
4933 // (n/a on session finished)
4934 optional string app_info = 5;
4935 optional bool is_child_session = 6;
4936}
4937
4938/**
4939 * Logs information about session being flushed.
4940 *
4941 * Logged from:
4942 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
4943 */
4944message ContentCaptureFlushed {
4945 optional int32 session_id = 1;
4946 // component/package of content capture service.
4947 optional string service_info = 2;
4948 // component/package of app.
4949 optional string app_info = 3;
4950 // session start/finish events
4951 optional int32 child_session_started = 4;
4952 optional int32 child_session_finished = 5;
4953 // count of view events.
4954 optional int32 view_appeared_count = 6;
4955 optional int32 view_disappeared_count = 7;
4956 optional int32 view_text_changed_count = 8;
4957
4958 // Flush stats.
4959 optional int32 max_events = 9;
4960 optional int32 idle_flush_freq = 10;
4961 optional int32 text_flush_freq = 11;
4962 optional int32 flush_reason = 12;
4963}
4964
4965/**
Bookatz75ee60422018-11-09 12:27:37 -08004966 * Pulls on-device BatteryStats power use calculations for the overall device.
4967 */
4968message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08004969 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4970 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4971 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
4972 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08004973}
4974
4975/**
4976 * Pulls on-device BatteryStats power use calculations broken down by uid.
4977 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
4978 * that is attributed to non-uid items. They must all be included to get the total power use.
4979 */
4980message DeviceCalculatedPowerBlameUid {
4981 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
4982 optional int32 uid = 1 [(is_uid) = true];
4983
Bookatz3dbc13a2018-12-21 12:16:51 -08004984 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
4985 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
4986 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08004987}
4988
4989/**
4990 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
4991 * drain type.
4992 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
4993 * is attributed uids. They must all be included to get the total power use.
4994 */
4995message DeviceCalculatedPowerBlameOther {
4996 // The type of item whose power use is being reported.
4997 enum DrainType {
4998 AMBIENT_DISPLAY = 0;
4999 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5000 BLUETOOTH = 2;
5001 CAMERA = 3;
5002 // Cell-standby
5003 CELL = 4;
5004 FLASHLIGHT = 5;
5005 IDLE = 6;
5006 MEMORY = 7;
5007 // Amount that total computed drain exceeded the drain estimated using the
5008 // battery level changes and capacity.
5009 OVERCOUNTED = 8;
5010 PHONE = 9;
5011 SCREEN = 10;
5012 // Amount that total computed drain was below the drain estimated using the
5013 // battery level changes and capacity.
5014 UNACCOUNTED = 11;
5015 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5016 WIFI = 13;
5017 }
5018 optional DrainType drain_type = 1;
5019
Bookatz3dbc13a2018-12-21 12:16:51 -08005020 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5021 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5022 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005023}
arangelov4e994062018-11-13 16:12:38 +00005024
5025/**
5026 * Logs device policy features.
5027 *
5028 * Logged from:
5029 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5030 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5031 */
5032message DevicePolicyEvent {
5033 // The event id - unique for each event.
5034 optional android.stats.devicepolicy.EventId event_id = 1;
5035 // The admin package name.
5036 optional string admin_package_name = 2;
5037 // A generic integer parameter.
5038 optional int32 integer_value = 3;
5039 // A generic boolean parameter.
5040 optional bool boolean_value = 4;
5041 // A parameter specifying a time period in milliseconds.
5042 optional uint64 time_period_millis = 5;
5043 // A parameter specifying a list of package names, bundle extras or string parameters.
5044 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5045}
shawnlinea5b66b2018-11-13 15:05:29 +08005046
5047/**
5048 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5049 *
5050 * Logged from:
5051 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5052 */
5053message DocsUILaunchReported {
5054 optional android.stats.docsui.LaunchAction launch_action = 1;
5055 optional bool has_initial_uri = 2;
5056 optional android.stats.docsui.MimeType mime_type = 3;
5057 optional android.stats.docsui.Root initial_root = 4;
5058}
5059
5060/**
5061 * Logs root/app visited event in file managers/picker. Call this when the user
5062 * taps on root/app in hamburger menu.
5063 *
5064 * Logged from:
5065 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5066 */
5067message DocsUIRootVisitedReported {
5068 optional android.stats.docsui.ContextScope scope = 1;
5069 optional android.stats.docsui.Root root = 2;
5070}
5071
5072/**
5073 * Logs file operation stats. Call this when a file operation has completed.
5074 *
5075 * Logged from:
5076 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5077 */
5078message DocsUIFileOperationReported {
5079 optional android.stats.docsui.Provider provider = 1;
5080 optional android.stats.docsui.FileOperation file_op = 2;
5081}
5082
5083/**
5084 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5085 * mode.
5086 *
5087 * Logged from:
5088 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5089 */
5090message DocsUIFileOperationCopyMoveModeReported {
5091 optional android.stats.docsui.FileOperation file_op = 1;
5092 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5093}
5094
5095
5096/**
5097 * Logs file sub operation stats. Call this when a file operation has failed.
5098 *
5099 * Logged from:
5100 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5101 */
5102message DocsUIFileOperationFailureReported {
5103 optional android.stats.docsui.Authority authority = 1;
5104 optional android.stats.docsui.SubFileOperation sub_op = 2;
5105}
5106
5107/**
5108* Logs the cancellation of a file operation. Call this when a job is canceled
5109*
5110* Logged from:
5111* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5112*/
5113message DocsUIFileOperationCanceledReported {
5114 optional android.stats.docsui.FileOperation file_op = 1;
5115}
5116
5117/**
5118 * Logs startup time in milliseconds.
5119 *
5120 * Logged from:
5121 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5122 */
5123message DocsUIStartupMsReported {
5124 optional int32 startup_millis = 1;
5125}
5126
5127/**
5128 * Logs the action that was started by user.
5129 *
5130 * Logged from:
5131 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5132 */
5133message DocsUIUserActionReported {
5134 optional android.stats.docsui.UserAction action = 1;
5135}
5136
5137/**
5138 * Logs the invalid type when invalid scoped access is requested.
5139 *
5140 * Logged from:
5141 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5142 */
5143message DocsUIInvalidScopedAccessRequestReported {
5144 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005145}
Ben Murdochbab399f62018-12-06 11:01:38 +00005146
5147/**
shawnlina75e82d2019-01-07 10:31:12 +08005148 * Logs the package name that launches docsui picker mode.
5149 *
5150 * Logged from:
5151 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5152 */
5153message DocsUIPickerLaunchedFromReported {
5154 optional string package_name = 1;
5155}
5156
5157/**
5158 * Logs the search type.
5159 *
5160 * Logged from:
5161 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5162 */
5163message DocsUISearchTypeReported {
5164 optional android.stats.docsui.SearchType search_type = 1;
5165}
5166
5167/**
5168 * Logs the search mode.
5169 *
5170 * Logged from:
5171 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5172 */
5173message DocsUISearchModeReported {
5174 optional android.stats.docsui.SearchMode search_mode = 1;
5175}
5176
5177/**
5178 * Logs the pick result information.
5179 *
5180 * Logged from:
5181 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5182 */
5183message DocsUIPickResultReported {
5184 optional int32 total_action_count = 1;
5185 optional int64 duration_millis = 2;
5186 optional int32 file_count= 3;
5187 optional bool is_searching = 4;
5188 optional android.stats.docsui.Root picked_from = 5;
5189 optional android.stats.docsui.MimeType mime_type = 6;
5190 optional int32 repeatedly_pick_times = 7;
5191}
5192
5193/**
Ben Murdochbab399f62018-12-06 11:01:38 +00005194 * Logs when an app's memory is compacted.
5195 *
5196 * Logged from:
5197 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5198 */
5199message AppCompacted {
5200 // The pid of the process being compacted.
5201 optional int32 pid = 1;
5202
5203 // The name of the process being compacted.
5204 optional string process_name = 2;
5205
5206 // The type of compaction.
5207 enum Action {
5208 UNKNOWN = 0;
5209 SOME = 1;
5210 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005211 PERSISTENT = 3;
5212 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00005213 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005214 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00005215
5216 // Total RSS in kilobytes consumed by the process prior to compaction.
5217 optional int64 before_rss_total_kilobytes = 4;
5218
5219 // File RSS in kilobytes consumed by the process prior to compaction.
5220 optional int64 before_rss_file_kilobytes = 5;
5221
5222 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5223 optional int64 before_rss_anon_kilobytes = 6;
5224
5225 // Swap in kilobytes consumed by the process prior to compaction.
5226 optional int64 before_swap_kilobytes = 7;
5227
5228 // Total RSS in kilobytes consumed by the process after compaction.
5229 optional int64 after_rss_total_kilobytes = 8;
5230
5231 // File RSS in kilobytes consumed by the process after compaction.
5232 optional int64 after_rss_file_kilobytes = 9;
5233
5234 // Anonymous RSS in kilobytes consumed by the process after compaction.
5235 optional int64 after_rss_anon_kilobytes = 10;
5236
5237 // Swap in kilobytes consumed by the process after compaction.
5238 optional int64 after_swap_kilobytes = 11;
5239
5240 // The time taken to perform compaction in milliseconds.
5241 optional int64 time_to_compact_millis = 12;
5242
5243 // The last compaction action performed for this app.
5244 optional Action last_action = 13;
5245
Ben Murdoch01720b82018-12-19 18:03:44 +00005246 // The last time that compaction was attempted on this process in milliseconds
5247 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5248 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00005249
Ben Murdoch885c21b2019-03-15 18:02:04 +00005250 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005251 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00005252
5253 // The process state at the time of compaction.
5254 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005255
5256 // Free ZRAM in kilobytes before compaction.
5257 optional int64 before_zram_free_kilobytes = 17;
5258
5259 // Free ZRAM in kilobytes after compaction.
5260 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00005261}
lifr157fc552018-12-12 16:38:04 +08005262
5263/**
lifrb6b90b62019-03-29 00:40:17 +08005264 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5265 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5266 *
lifra2e19c02019-04-16 22:16:30 +08005267 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5268 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5269 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5270 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005271 */
5272message NetworkDnsEventReported {
lifra2e19c02019-04-16 22:16:30 +08005273 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005274
lifra2e19c02019-04-16 22:16:30 +08005275 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005276
5277 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005278 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005279
lifra2e19c02019-04-16 22:16:30 +08005280 // Only valid for event_type = EVENT_GETADDRINFO.
5281 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005282
lifra2e19c02019-04-16 22:16:30 +08005283 // Flags passed to android_res_nsend() defined in multinetwork.h
5284 // Only valid for event_type = EVENT_RESNSEND.
5285 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005286
lifra2e19c02019-04-16 22:16:30 +08005287 optional android.stats.dnsresolver.Transport network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005288
5289 // The DNS over TLS mode on a specific netId.
lifra2e19c02019-04-16 22:16:30 +08005290 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005291
5292 // Additional pass-through fields opaque to statsd.
5293 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifra2e19c02019-04-16 22:16:30 +08005294 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr157fc552018-12-12 16:38:04 +08005295}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005296
5297/**
5298 * Logs when a data stall event occurs.
5299 *
5300 * Log from:
5301 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5302 */
5303message DataStallEvent {
5304 // Data stall evaluation type.
5305 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5306 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5307 optional int32 evaluation_type = 1;
5308 // See definition in data_stall_event.proto.
5309 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5310 // See definition in data_stall_event.proto.
5311 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5312 // See definition in data_stall_event.proto.
5313 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5314 // See definition in data_stall_event.proto.
5315 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5316 // See definition in data_stall_event.proto.
5317 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5318}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005319
5320/*
5321 * Logs when RescueParty resets some set of experiment flags.
5322 *
5323 * Logged from:
5324 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5325 */
5326message RescuePartyResetReported {
5327 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5328 optional int32 rescue_level = 1;
5329}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005330
5331/**
5332 * Logs when signed config is received from an APK, and if that config was applied successfully.
5333 * Logged from:
5334 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5335 */
5336message SignedConfigReported {
5337 enum Type {
5338 UNKNOWN_TYPE = 0;
5339 GLOBAL_SETTINGS = 1;
5340 }
5341 optional Type type = 1;
5342
5343 // The final status of the signed config received.
5344 enum Status {
5345 UNKNOWN_STATUS = 0;
5346 APPLIED = 1;
5347 BASE64_FAILURE_CONFIG = 2;
5348 BASE64_FAILURE_SIGNATURE = 3;
5349 SECURITY_EXCEPTION = 4;
5350 INVALID_CONFIG = 5;
5351 OLD_CONFIG = 6;
5352 SIGNATURE_CHECK_FAILED = 7;
5353 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005354 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005355 }
5356 optional Status status = 2;
5357
5358 // The version of the signed config processed.
5359 optional int32 version = 3;
5360
5361 // The package name that the config was extracted from.
5362 optional string from_package = 4;
5363
5364 enum Key {
5365 NO_KEY = 0;
5366 DEBUG = 1;
5367 PRODUCTION = 2;
5368 }
5369 // Which key was used to verify the config.
5370 optional Key verified_with = 5;
5371}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005372
5373/*
5374 * Logs GNSS Network-Initiated (NI) location events.
5375 *
5376 * Logged from:
5377 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5378 */
5379message GnssNiEventReported {
5380 // The type of GnssNiEvent.
5381 enum EventType {
5382 UNKNOWN = 0;
5383 NI_REQUEST = 1;
5384 NI_RESPONSE = 2;
5385 }
5386 optional EventType event_type = 1;
5387
5388 // An ID generated by HAL to associate NI notifications and UI responses.
5389 optional int32 notification_id = 2;
5390
5391 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005392 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005393
5394 // NI requires notification.
5395 optional bool need_notify = 4;
5396
5397 // NI requires verification.
5398 optional bool need_verify = 5;
5399
5400 // NI requires privacy override, no notification/minimal trace.
5401 optional bool privacy_override = 6;
5402
5403 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5404 // seconds.
5405 optional int32 timeout = 7;
5406
5407 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005408 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005409
5410 // String representing the requester of the network inititated location request.
5411 optional string requestor_id = 9;
5412
5413 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5414 // network initiated location request.
5415 optional string text = 10;
5416
5417 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005418 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005419
5420 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005421 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005422
5423 // True if SUPL ES is enabled.
5424 optional bool is_supl_es_enabled = 13;
5425
5426 // True if GNSS location is enabled.
5427 optional bool is_location_enabled = 14;
5428
5429 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005430 optional android.server.location.GnssUserResponseType user_response = 15;
5431}
5432
5433/**
5434 * Logs GNSS non-framework (NFW) location notification.
5435 *
5436 * Logged from:
5437 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5438 */
5439message GnssNfwNotificationReported {
5440 // Package name of the Android proxy application representing the non-framework entity that
5441 // requested location. Set to empty string if unknown.
5442 optional string proxy_app_package_name = 1;
5443
5444 // Protocol stack that initiated the non-framework location request.
5445 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5446
5447 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5448 // set to empty string. This field is opaque to the framework and used for logging purposes.
5449 optional string other_protocol_stack_name = 3;
5450
5451 // Source initiating/receiving the location information.
5452 optional android.server.location.NfwRequestor requestor = 4;
5453
5454 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5455 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5456 // and used for logging purposes.
5457 optional string requestor_id = 5;
5458
5459 // Indicates whether location information was provided for this request.
5460 optional android.server.location.NfwResponseType response_type = 6;
5461
5462 // True if the device is in user initiated emergency session.
5463 optional bool in_emergency_mode = 7;
5464
5465 // True if cached location is provided.
5466 optional bool is_cached_location = 8;
5467
5468 // True if proxy app permission mismatch between framework and GNSS HAL.
5469 optional bool is_permission_mismatched = 9;
5470}
5471
5472/**
5473 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5474 *
5475 * Logged from:
5476 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5477 */
5478message GnssConfigurationReported {
5479 // SUPL host name.
5480 optional string supl_host = 1;
5481
5482 // SUPL port number.
5483 optional int32 supl_port = 2;
5484
5485 // C2K host name.
5486 optional string c2k_host = 3;
5487
5488 // C2K port number.
5489 optional int32 c2k_port = 4;
5490
5491 // The SUPL version requested by Carrier.
5492 optional int32 supl_ver = 5;
5493
5494 // The SUPL mode.
5495 optional android.server.location.SuplMode supl_mode = 6;
5496
5497 // True if NI emergency SUPL restrictions is enabled.
5498 optional bool supl_es = 7;
5499
5500 // LTE Positioning Profile settings
5501 optional android.server.location.LppProfile lpp_profile = 8;
5502
5503 // Positioning protocol on A-Glonass system.
5504 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5505
5506 // True if emergency PDN is used. Otherwise, regular PDN is used.
5507 optional bool use_emergency_pdn_for_emergency_supl= 10;
5508
5509 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5510 optional android.server.location.GpsLock gps_lock = 11;
5511
5512 // Number of seconds to extend the emergency session duration post emergency call.
5513 optional int32 es_extension_sec = 12;
5514
5515 // The full list of package names of proxy Android applications representing the non-framework
5516 // location access entities (on/off the device) for which the framework user has granted
5517 // non-framework location access permission. The package names are concatenated in one string
5518 // with spaces as separators.
5519 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005520}
Jack Yu95b64f32018-12-13 18:26:11 +08005521
5522/**
5523 * Logs when a NFC device's error occurred.
5524 * Logged from:
5525 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5526 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5527 */
5528message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005529 enum Type {
5530 UNKNOWN = 0;
5531 CMD_TIMEOUT = 1;
5532 ERROR_NOTIFICATION = 2;
5533 AID_OVERFLOW = 3;
5534 }
5535 optional Type type = 1;
5536 // If it's nci cmd timeout, log the timeout command.
5537 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005538
Alex Salod7c3eef2019-01-25 14:43:27 -08005539 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005540}
5541
5542/**
5543 * Logs when a NFC device's state changed event
5544 * Logged from:
5545 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5546 */
5547message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005548 enum State {
5549 UNKNOWN = 0;
5550 OFF = 1;
5551 ON = 2;
5552 ON_LOCKED = 3; // Secure Nfc enabled.
5553 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5554 }
5555 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005556}
5557
5558/**
5559 * Logs when a NFC Beam Transaction occurred.
5560 * Logged from:
5561 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5562 */
5563message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005564 enum Operation {
5565 UNKNOWN = 0;
5566 SEND = 1;
5567 RECEIVE = 2;
5568 }
5569 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005570}
5571
5572/**
5573 * Logs when a NFC Card Emulation Transaction occurred.
5574 * Logged from:
5575 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5576 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5577 */
5578message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005579 enum Category {
5580 UNKNOWN = 0;
5581 HCE_PAYMENT = 1;
5582 HCE_OTHER = 2;
5583 OFFHOST = 3;
5584 }
5585 // Transaction belongs to HCE payment or HCE other category, or offhost.
5586 optional Category category = 1;
5587 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5588 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005589}
5590
5591/**
5592 * Logs when a NFC Tag event occurred.
5593 * Logged from:
5594 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5595 */
5596message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005597 enum Type {
5598 UNKNOWN = 0;
5599 URL = 1;
5600 BT_PAIRING = 2;
5601 PROVISION = 3;
5602 WIFI_CONNECT = 4;
5603 APP_LAUNCH = 5;
5604 OTHERS = 6;
5605 }
5606 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005607}
5608
5609/**
5610 * Logs when Hce transaction triggered
5611 * Logged from:
5612 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5613 */
5614message NfcHceTransactionOccurred {
5615 // The latency period(in microseconds) it took for the first HCE data
5616 // exchange.
5617 optional uint32 latency_micros = 1;
5618}
5619
5620/**
5621 * Logs when SecureElement state event changed
5622 * Logged from:
5623 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5624 */
5625message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005626 enum State {
5627 UNKNOWN = 0;
5628 INITIALIZED = 1;
5629 DISCONNECTED = 2;
5630 CONNECTED = 3;
5631 HALCRASH = 4;
5632 }
5633 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005634
Alex Salod7c3eef2019-01-25 14:43:27 -08005635 optional string state_change_reason = 2;
5636 // SIMx or eSEx.
5637 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005638}
5639
5640/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005641 * Information about a permission grant request
5642 */
5643message PermissionGrantRequestResultReported {
5644 // unique value identifying an API call. A API call might result in multiple of these atoms
5645 optional int64 request_id = 1;
5646
5647 // UID of package requesting the permission grant
5648 optional int32 requesting_uid = 2 [(is_uid) = true];
5649
5650 // Name of package requesting the permission grant
5651 optional string requesting_package_name = 3;
5652
5653 // The permission to be granted
5654 optional string permission_name = 4;
5655
5656 // If the permission was explicitly requested via the API or added by the system
5657 optional bool is_implicit = 5;
5658
5659 enum Result {
5660 UNDEFINED = 0;
5661 // permission request was ignored
5662 IGNORED = 1;
5663 // permission request was ignored because it was user fixed
5664 IGNORED_USER_FIXED = 2;
5665 // permission request was ignored because it was policy fixed
5666 IGNORED_POLICY_FIXED = 3;
5667 // permission was granted by user action
5668 USER_GRANTED = 4;
5669 // permission was automatically granted
5670 AUTO_GRANTED = 5;
5671 // permission was denied by user action
5672 USER_DENIED = 6;
5673 // permission was denied with prejudice by the user
5674 USER_DENIED_WITH_PREJUDICE = 7;
5675 // permission was automatically denied
5676 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07005677 // permission request was ignored because permission is restricted
5678 IGNORED_RESTRICTED_PERMISSION = 9;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005679 }
5680 // The result of the permission grant
5681 optional Result result = 6;
5682}
5683
5684/**
Jack Yu95b64f32018-12-13 18:26:11 +08005685 * Logs when Omapi API used
5686 * Logged from:
5687 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5688 */
5689message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005690 enum Operation {
5691 UNKNOWN = 0;
5692 OPEN_CHANNEL = 1;
5693 }
5694 optional Operation operation = 1;
5695 // SIMx or eSEx.
5696 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005697
Alex Salod7c3eef2019-01-25 14:43:27 -08005698 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005699}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005700
5701/**
Alex Saloa060aee2019-01-21 14:36:41 -08005702 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
5703 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005704 * Logged from:
5705 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
5706 */
5707message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08005708 optional int64 dispatch_latency_millis = 1;
5709}
5710
5711/**
5712 * Logs AttentionManagerService attention check result.
5713 *
5714 * Logged from:
5715 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
5716 */
5717message AttentionManagerServiceResultReported {
5718 // See core/java/android/service/attention/AttentionService.java
5719 enum AttentionCheckResult {
5720 UNKNOWN = 20;
5721 ATTENTION_SUCCESS_ABSENT = 0;
5722 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07005723 ATTENTION_FAILURE_UNKNOWN = 2;
5724 ATTENTION_FAILURE_CANCELLED = 3;
5725 ATTENTION_FAILURE_PREEMPTED = 4;
5726 ATTENTION_FAILURE_TIMED_OUT = 5;
5727 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08005728 }
5729 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08005730}
Michael Groover9e7b06e2018-12-28 19:55:51 -08005731
5732/**
5733 * Logs when an adb connection changes state.
5734 *
5735 * Logged from:
5736 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
5737 */
5738message AdbConnectionChanged {
5739 // The last time this system connected via adb, or 0 if the 'always allow' option was not
5740 // previously selected for this system.
5741 optional int64 last_connection_time_millis = 1;
5742
5743 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
5744 // to reconnect via adb without user interaction.
5745 optional int64 auth_window_millis = 2;
5746
5747 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
5748 optional android.debug.AdbConnectionStateEnum state = 3;
5749
5750 // True if the 'always allow' option was selected for this system.
5751 optional bool always_allow = 4;
5752}
Carter Hsub8fd1e92019-01-11 15:24:45 +08005753
5754/*
5755 * Logs the reported speech DSP status.
5756 *
5757 * Logged from:
5758 * Vendor audio implementation.
5759 */
5760message SpeechDspStatReported {
5761 // The total Speech DSP uptime in milliseconds.
5762 optional int32 total_uptime_millis = 1;
5763 // The total Speech DSP downtime in milliseconds.
5764 optional int32 total_downtime_millis = 2;
5765 optional int32 total_crash_count = 3;
5766 optional int32 total_recover_count = 4;
5767}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08005768
5769/**
5770 * Logs USB connector contaminant status.
5771 *
5772 * Logged from: USB Service.
5773 */
5774message UsbContaminantReported {
5775 optional string id = 1;
5776 optional android.service.usb.ContaminantPresenceStatus status = 2;
5777}
Olivier Gaillard18d452202019-01-22 15:03:41 +00005778
5779/**
5780 * This atom is for debugging purpose.
5781 */
5782message DebugElapsedClock {
5783 // Monotically increasing value for each pull.
5784 optional int64 pull_count = 1;
5785 // Time from System.elapsedRealtime.
5786 optional int64 elapsed_clock_millis = 2;
5787 // Time from System.elapsedRealtime.
5788 optional int64 same_elapsed_clock_millis = 3;
5789 // Diff between current elapsed time and elapsed time from previous pull.
5790 optional int64 elapsed_clock_diff_millis = 4;
5791
5792 enum Type {
5793 TYPE_UNKNOWN = 0;
5794 ALWAYS_PRESENT = 1;
5795 PRESENT_ON_ODD_PULLS = 2;
5796 }
5797 // Type of behavior for the pulled data.
5798 optional Type type = 5;
5799}
5800
5801/**
5802 * This atom is for debugging purpose.
5803 */
5804message DebugFailingElapsedClock {
5805 // Monotically increasing value for each pull.
5806 optional int64 pull_count = 1;
5807 // Time from System.elapsedRealtime.
5808 optional int64 elapsed_clock_millis = 2;
5809 // Time from System.elapsedRealtime.
5810 optional int64 same_elapsed_clock_millis = 3;
5811 // Diff between current elapsed time and elapsed time from previous pull.
5812 optional int64 elapsed_clock_diff_millis = 4;
5813}
Steven Wuacef6bb2019-01-23 14:21:17 -05005814
5815/** Logs System UI bubbles event changed.
5816 *
5817 * Logged from:
5818 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
5819 */
5820message BubbleUIChanged {
5821
5822 // The app package that is posting the bubble.
5823 optional string package_name = 1;
5824
5825 // The notification channel that is posting the bubble.
5826 optional string notification_channel = 2;
5827
5828 // The notification id associated with the posted bubble.
5829 optional int32 notification_id = 3;
5830
5831 // The position of the bubble within the bubble stack.
5832 optional int32 position = 4;
5833
5834 // The total number of bubbles within the bubble stack.
5835 optional int32 total_number = 5;
5836
5837 // User interactions with the bubble.
5838 enum Action {
5839 UNKNOWN = 0;
5840 POSTED = 1;
5841 UPDATED = 2;
5842 EXPANDED = 3;
5843 COLLAPSED = 4;
5844 DISMISSED = 5;
5845 STACK_DISMISSED = 6;
5846 STACK_MOVED = 7;
5847 HEADER_GO_TO_APP = 8;
5848 HEADER_GO_TO_SETTINGS = 9;
5849 PERMISSION_OPT_IN = 10;
5850 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05005851 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05005852 SWIPE_LEFT = 13;
5853 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05005854 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04005855 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05005856 }
5857 optional Action action = 6;
5858
5859 // Normalized screen position of the bubble stack. The range is between 0 and 1.
5860 optional float normalized_x_position = 7;
5861 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04005862
5863 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
5864 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04005865
5866 // Whether the bubble is an on-going one.
5867 optional bool is_ongoing = 10;
5868
5869 // Whether the bubble is produced by an app running in foreground.
5870 optional bool is_foreground = 11;
Steven Wuacef6bb2019-01-23 14:21:17 -05005871}
Kweku Adams8845d012018-12-11 20:06:45 -08005872
5873/**
Steven Wu552f63f2019-02-05 13:41:36 -05005874 * Logs System UI bubbles developer errors.
5875 *
5876 * Logged from:
5877 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
5878 */
5879message BubbleDeveloperErrorReported {
5880
5881 // The app package that is posting the bubble.
5882 optional string package_name = 1;
5883
5884 // Bubble developer error type enums.
5885 enum Error {
5886 UNKNOWN = 0;
5887 ACTIVITY_INFO_MISSING = 1;
5888 ACTIVITY_INFO_NOT_RESIZABLE = 2;
5889 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
5890 }
5891 optional Error error = 2 [default = UNKNOWN];
5892}
5893
5894/**
Kweku Adams8845d012018-12-11 20:06:45 -08005895 * Logs that a constraint for a scheduled job has changed.
5896 *
5897 * Logged from:
5898 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
5899 */
5900message ScheduledJobConstraintChanged {
5901 repeated AttributionNode attribution_node = 1;
5902
5903 // Name of the job.
5904 optional string job_name = 2;
5905
5906 optional com.android.server.job.ConstraintEnum constraint = 3;
5907
5908 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08005909 UNKNOWN = 0;
5910 UNSATISFIED = 1;
5911 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08005912 }
5913 optional State state = 4;
5914}
Alex Salod7c3eef2019-01-25 14:43:27 -08005915
5916/**
5917 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
5918 * returns true.
5919 *
5920 * Logged from:
5921 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
5922 */
5923message ScreenTimeoutExtensionReported {
5924 // Describes how many times in a row did the power manager reset the screen off timeout.
5925 optional uint32 consecutive_timeout_extended_count = 1;
5926}
Hui Yu885aca12019-01-10 17:11:34 -08005927
5928/*
5929* Logs number of milliseconds it takes to start a process.
5930* The definition of app process start time is from the app launch time to
5931* the time that Zygote finished forking the app process and loaded the
5932* application package's java classes.
5933
5934* This metric is different from AppStartOccurred which is for foreground
5935* activity only.
5936
5937* ProcessStartTime can report all processes (both foreground and background)
5938* start time.
5939*
5940* Logged from:
5941* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5942*/
5943message ProcessStartTime {
5944 // The uid of the ProcessRecord.
5945 optional int32 uid = 1 [(is_uid) = true];
5946
5947 // The process pid.
5948 optional int32 pid = 2;
5949
5950 // The process name.
5951 // Usually package name, "system" for system server.
5952 // Provided by ActivityManagerService.
5953 optional string process_name = 3;
5954
5955 enum StartType {
5956 UNKNOWN = 0;
5957 WARM = 1;
5958 HOT = 2;
5959 COLD = 3;
5960 }
5961
5962 // The start type.
5963 optional StartType type = 4;
5964
5965 // The elapsed realtime at the start of the process.
5966 optional int64 process_start_time_millis = 5;
5967
5968 // Number of milliseconds it takes to reach bind application.
5969 optional int32 bind_application_delay_millis = 6;
5970
5971 // Number of milliseconds it takes to finish start of the process.
5972 optional int32 process_start_delay_millis = 7;
5973
5974 // hostingType field in ProcessRecord, the component type such as "activity",
5975 // "service", "content provider", "broadcast" or other strings.
5976 optional string hosting_type = 8;
5977
5978 // hostingNameStr field in ProcessRecord. The component class name that runs
5979 // in this process.
5980 optional string hosting_name = 9;
5981}
5982
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08005983/**
Ray Essick8ab04df2019-02-15 11:01:02 -08005984 * Track Media Codec usage
5985 * Logged from:
5986 * frameworks/av/media/libstagefright/MediaCodec.cpp
5987 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
5988 */
5989message MediametricsCodecReported {
5990 optional int64 timestamp_nanos = 1;
5991 optional string package_name = 2;
5992 optional int64 package_version_code = 3;
5993 optional int64 media_apex_version = 4;
5994
5995 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
5996}
5997
5998/**
5999 * Track Media Extractor (pulling video/audio streams out of containers) usage
6000 * Logged from:
6001 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6002 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6003 */
6004message MediametricsExtractorReported {
6005 optional int64 timestamp_nanos = 1;
6006 optional string package_name = 2;
6007 optional int64 package_version_code = 3;
6008 optional int64 media_apex_version = 4;
6009
6010 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6011}
6012
6013/**
6014 * Track how we arbitrate between microphone/input requests.
6015 * Logged from
6016 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6017 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6018 */
6019message MediametricsAudiopolicyReported {
6020 optional int64 timestamp_nanos = 1;
6021 optional string package_name = 2;
6022 optional int64 package_version_code = 3;
6023 optional int64 media_apex_version = 4;
6024
6025 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6026}
6027
6028/**
6029 * Track how we arbitrate between microphone requests.
6030 * Logged from
6031 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6032 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6033 */
6034message MediametricsAudiorecordReported {
6035 optional int64 timestamp_nanos = 1;
6036 optional string package_name = 2;
6037 optional int64 package_version_code = 3;
6038 optional int64 media_apex_version = 4;
6039
6040 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6041}
6042
6043/**
6044 * Track how we arbitrate between microphone/input requests.
6045 * Logged from
6046 * frameworks/av/media/libnblog/ReportPerformance.cpp
6047 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6048 */
6049message MediametricsAudiothreadReported {
6050 optional int64 timestamp_nanos = 1;
6051 optional string package_name = 2;
6052 optional int64 package_version_code = 3;
6053 optional int64 media_apex_version = 4;
6054
6055 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6056}
6057
6058/**
6059 * Track how we arbitrate between microphone/input requests.
6060 * Logged from
6061 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6062 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6063 */
6064message MediametricsAudiotrackReported {
6065 optional int64 timestamp_nanos = 1;
6066 optional string package_name = 2;
6067 optional int64 package_version_code = 3;
6068 optional int64 media_apex_version = 4;
6069
6070 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6071}
6072
6073/**
6074 * Track information about DRM framework performance
6075 * Logged from
6076 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6077 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6078 */
6079message MediametricsMediadrmReported {
6080 optional int64 timestamp_nanos = 1;
6081 optional string package_name = 2;
6082 optional int64 package_version_code = 3;
6083 optional int64 media_apex_version = 4;
6084
6085 // vendor+description tell about which DRM plugin is in use on this device
6086 optional string vendor = 5;
6087 optional string description = 6;
6088 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6089 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6090}
6091
6092/**
6093 * Track information about the widevine DRM plugin performance
6094 * Logged from
6095 * vendor/widevine/libwvdrmengine/cdm/metrics
6096 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6097 */
6098message MediametricsDrmWidevineReported {
6099 optional int64 timestamp_nanos = 1;
6100 optional string package_name = 2;
6101 optional int64 package_version_code = 3;
6102 optional int64 media_apex_version = 4;
6103
6104 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6105}
6106
6107/**
6108 * Track information about recordings (e.g. camcorder)
6109 * Logged from
6110 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6111 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6112 */
6113message MediametricsRecorderReported {
6114 optional int64 timestamp_nanos = 1;
6115 optional string package_name = 2;
6116 optional int64 package_version_code = 3;
6117 optional int64 media_apex_version = 4;
6118
6119 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6120}
6121
6122/**
6123 * Track Media Player usage
6124 * Logged from:
6125 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6126 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6127 */
6128message MediametricsNuPlayerReported {
6129 optional int64 timestamp_nanos = 1;
6130 optional string package_name = 2;
6131 optional int64 package_version_code = 3;
6132 optional int64 media_apex_version = 4;
6133
6134 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6135}
6136
6137/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006138 * State of a dangerous permission requested by a package
6139 */
6140message DangerousPermissionState {
6141 // Name of the permission
6142 optional string permission_name = 1;
6143
6144 // Uid of the package
6145 optional int32 uid = 2 [(is_uid) = true];
6146
6147 // Package requesting the permission
6148 optional string package_name = 3;
6149
6150 // If the permission is granted to the uid
6151 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01006152
6153 // Permission flags as per android.content.pm.PermissionFlags
6154 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006155}
6156
Michael Groover4a0ca942019-01-24 17:41:25 -08006157/**
6158 * Logs when a package is denied access to a device identifier based on the new access requirements.
6159 *
6160 * Logged from:
6161 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6162 */
6163message DeviceIdentifierAccessDenied {
6164 // The name of the package denied access to the requested device identifier.
6165 optional string package_name = 1;
6166
6167 // The name of the device identifier method the package attempted to invoke.
6168 optional string method_name = 2;
6169
6170 // True if the package is preinstalled.
6171 optional bool is_preinstalled = 3;
6172
6173 // True if the package is privileged.
6174 optional bool is_priv_app = 4;
6175}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006176
6177/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006178 * Pulls the ongoing mainline install train version code.
6179 * Pulled from StatsCompanionService
6180 */
6181message TrainInfo {
6182 optional int64 train_version_code = 1;
6183
6184 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006185
6186 optional string train_name = 3;
6187
6188 enum Status {
6189 UNKNOWN = 0;
6190 INSTALL_REQUESTED = 1;
6191 INSTALL_STARTED = 2;
6192 INSTALL_STAGED_NOT_READY = 3;
6193 INSTALL_STAGED_READY = 4;
6194 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006195 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6196 // and INSTALL_FAILURE_COMMIT.
6197 INSTALL_FAILURE = 6 [deprecated = true];
6198 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006199 INSTALL_CANCELLED = 7;
6200 INSTALLER_ROLLBACK_REQUESTED = 8;
6201 INSTALLER_ROLLBACK_INITIATED = 9;
6202 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6203 INSTALLER_ROLLBACK_STAGED = 11;
6204 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6205 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6206 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6207 INSTALLER_ROLLBACK_SUCCESS = 15;
6208 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006209 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6210 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6211 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6212 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6213 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6214 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006215 INSTALL_FAILURE_DOWNLOAD = 23;
6216 INSTALL_FAILURE_STATE_MISMATCH = 24;
6217 INSTALL_FAILURE_COMMIT = 25;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006218 }
6219 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006220}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006221
6222/**
6223 * Logs the gesture stage changed event.
6224 *
6225 * Logged from:
6226 * frameworks/base/packages/SystemUI/
6227 */
6228message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006229 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006230}
6231
6232/**
6233 * Logs the feedback type.
6234 *
6235 * Logged from:
6236 * frameworks/base/packages/SystemUI/
6237 */
6238message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006239 // Whether or not the gesture was used.
6240 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006241}
6242
6243/**
6244 * Logs the progress.
6245 *
6246 * Logged from:
6247 * frameworks/base/packages/SystemUI/
6248 */
6249message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006250 // [0,100] progress for the assist gesture.
6251 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006252}
Neil Fullerdb14b482019-02-05 19:44:44 +00006253
6254/*
6255 * Information about the time zone data on a device.
6256 */
6257message TimeZoneDataInfo {
6258 // A version identifier for the data set on device. e.g. "2018i"
6259 optional string tzdb_version = 1;
6260}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006261
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006262/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006263 * Logs the GPU stats global health information.
6264 *
6265 * Logged from:
6266 * frameworks/native/services/gpuservice/gpustats/
6267 */
6268message GpuStatsGlobalInfo {
6269 // Package name of the gpu driver.
6270 optional string driver_package_name = 1;
6271
6272 // Version name of the gpu driver.
6273 optional string driver_version_name = 2;
6274
6275 // Version code of the gpu driver.
6276 optional int64 driver_version_code = 3;
6277
6278 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
6279 optional int64 driver_build_time = 4;
6280
6281 // Total count of the gl driver gets loaded.
6282 optional int64 gl_loading_count = 5;
6283
6284 // Total count of the gl driver fails to be loaded.
6285 optional int64 gl_loading_failure_count = 6;
6286
6287 // Total count of the Vulkan driver gets loaded.
6288 optional int64 vk_loading_count = 7;
6289
6290 // Total count of the Vulkan driver fails to be loaded.
6291 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07006292
6293 // Api version of the system Vulkan driver.
6294 optional int32 vulkan_version = 9;
6295
6296 // Api version of the system CPU Vulkan driver.
6297 optional int32 cpu_vulkan_version = 10;
6298
6299 // Api version of the system GLES driver.
6300 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006301
6302 // Total count of the angle driver gets loaded.
6303 optional int64 angle_loading_count = 12;
6304
6305 // Total count of the angle driver fails to be loaded.
6306 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006307}
6308
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006309/**
6310 * GPU driver loading time info.
6311 */
6312message GpuDriverLoadingTime {
6313 // List of all the driver loading times for this app. The list size is
6314 // capped at 50.
6315 repeated int64 driver_loading_time = 1;
6316}
6317
6318/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006319 * Logs the GPU stats per app health information.
6320 *
6321 * Logged from:
6322 * frameworks/native/services/gpuservice/gpustats/
6323 */
6324message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006325 // Package name of the application that loads the gpu driver. Total number
6326 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006327 optional string app_package_name = 1;
6328
6329 // Version code of the gpu driver this app loads.
6330 optional int64 driver_version_code = 2;
6331
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006332 // gl driver loading time info.
6333 optional GpuDriverLoadingTime gl_driver_loading_time = 3
6334 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006335
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006336 // Vulkan driver loading time info.
6337 optional GpuDriverLoadingTime vk_driver_loading_time = 4
6338 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006339
6340 // Angle driver loading time info.
6341 optional GpuDriverLoadingTime angle_driver_loading_time = 5
6342 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07006343
6344 // CPU Vulkan implementation is in use.
6345 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006346}
Rafal Slawikd4e87572019-03-12 13:08:38 +00006347
6348/*
6349 * Logs the size of the system ion heap.
6350 *
6351 * Pulled from StatsCompanionService.
6352 */
6353message SystemIonHeapSize {
6354 // Size of the system ion heap in bytes.
6355 optional int64 size_in_bytes = 1;
6356}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006357
6358/**
6359 * Push network stack events.
6360 *
6361 * Log from:
6362 * frameworks/base/packages/NetworkStack/
6363 */
6364message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08006365 // The id that indicates the event reported from NetworkStack.
6366 optional int32 event_id = 1;
6367 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006368 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
6369}
Carmen Agimofa769c152019-03-04 14:39:14 +00006370
6371/**
6372 * Logs the apps that are installed on the external storage.
6373 * Pulled from:
6374 * StatsCompanionService
6375 */
6376message AppsOnExternalStorageInfo {
6377 // The type of the external storage.
6378 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
6379 // The name of the package that is installed on the external storage.
6380 optional string package_name = 2;
6381}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07006382
6383/**
6384 * Logs the settings related to Face.
6385 * Logged from:
6386 * frameworks/base/services/core/java/com/android/server/stats
6387 */
6388message FaceSettings {
6389 // Whether or not face unlock is allowed on Keyguard.
6390 optional bool unlock_keyguard_enabled = 1;
6391 // Whether or not face unlock dismisses the Keyguard.
6392 optional bool unlock_dismisses_keyguard = 2;
6393 // Whether or not face unlock requires attention.
6394 optional bool unlock_attention_required = 3;
6395 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
6396 optional bool unlock_app_enabled = 4;
6397 // Whether or not face unlock always requires user confirmation.
6398 optional bool unlock_always_require_confirmation = 5;
6399 // Whether or not a diverse set of poses are required during enrollment.
6400 optional bool unlock_diversity_required = 6;
6401}
Maggie White442b6312019-04-05 16:26:44 -07006402
6403/**
6404 * Logs cooling devices maintained by the kernel.
6405 *
6406 * Pulled from StatsCompanionService.java
6407 */
6408message CoolingDevice {
6409 // The type of cooling device being reported. Eg. CPU, GPU...
6410 optional android.os.CoolingTypeEnum device_location = 1;
6411 // The name of the cooling device source. Eg. CPU0
6412 optional string device_name = 2;
6413 // Current throttle state of the cooling device. The value can any unsigned
6414 // integer between 0 and max_state defined in its driver. 0 means device is
6415 // not in throttling, higher value means deeper throttling.
6416 optional int32 state = 3;
6417}
Ben Blount763a5d52019-04-10 11:48:58 -07006418
6419/**
6420 * Intelligence has several counter-type events that don't warrant a
6421 * full separate atom. These are primarily API call counters but also include
6422 * counters for feature usage and specific failure modes.
6423 *
6424 * Logged from the Intelligence mainline module.
6425 */
6426message IntelligenceEventReported {
6427 optional android.stats.intelligence.EventType event_id = 1;
6428 optional android.stats.intelligence.Status status = 2;
6429}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07006430
6431/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07006432 * Logs when Car Power state changed.
6433 *
6434 * Logged from:
6435 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6436 */
6437message CarPowerStateChanged {
6438 // States come from CpmsState in CarPowerManagementService.java.
6439 enum State {
6440 WAIT_FOR_VHAL = 0;
6441 ON = 1;
6442 SHUTDOWN_PREPARE = 2;
6443 WAIT_FOR_FINISH = 3;
6444 SUSPEND = 4;
6445 SIMULATE_SLEEP = 5;
6446 }
6447 optional State state = 1;
6448}
6449
6450/**
6451 * Logs whether GarageMode is entered.
6452 *
6453 * Logged from:
6454 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6455 */
6456message GarageModeInfo {
6457 // Whether GarageMode is entered.
6458 optional bool is_garage_mode = 1;
6459}
Martijn Coenencd95d462019-04-25 17:09:45 +02006460
6461/**
6462 * Historical app ops data per package.
6463 */
6464message AppOps {
6465 // Uid of the package requesting the op
6466 optional int32 uid = 1 [(is_uid) = true];
6467
6468 // Nmae of the package performing the op
6469 optional string package_name = 2;
6470
6471 // operation id; maps to the OP_* constants in AppOpsManager.java
6472 optional int32 op_id = 3;
6473
6474 // The number of times the op was granted while the app was in the
6475 // foreground (only for trusted requests)
6476 optional int64 trusted_foreground_granted_count = 4;
6477
6478 // The number of times the op was granted while the app was in the
6479 // background (only for trusted requests)
6480 optional int64 trusted_background_granted_count = 5;
6481
6482 // The number of times the op was rejected while the app was in the
6483 // foreground (only for trusted requests)
6484 optional int64 trusted_foreground_rejected_count = 6;
6485
6486 // The number of times the op was rejected while the app was in the
6487 // background (only for trusted requests)
6488 optional int64 trusted_background_rejected_count = 7;
6489
6490 // For long-running operations, total duration of the operation
6491 // while the app was in the foreground (only for trusted requests)
6492 optional int64 trusted_foreground_duration_millis = 8;
6493
6494 // For long-running operations, total duration of the operation
6495 // while the app was in the background (only for trusted requests)
6496 optional int64 trusted_background_duration_millis = 9;
6497}
Hongyi Zhang700137e2019-05-23 21:19:36 -07006498
6499/**
6500 * Location Manager API Usage information(e.g. API under usage,
6501 * API call's parameters).
6502 * Logged from:
6503 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
6504 */
6505message LocationManagerApiUsageReported {
6506
6507 // Indicating if usage starts or usage ends.
6508 optional android.stats.location.UsageState state = 1;
6509
6510 // LocationManagerService's API in use.
6511 // We can identify which API from LocationManager is
6512 // invoking current LMS API by the combination of
6513 // API parameter(e.g. is_listener_null, is_intent_null,
6514 // is_location_request_null)
6515 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
6516
6517 // Name of the package calling the API.
6518 optional string calling_package_name = 3;
6519
6520 // Type of the location provider.
6521 optional android.stats.location.ProviderType provider = 4;
6522
6523 // Quality of the location request
6524 optional android.stats.location.LocationRequestQuality quality = 5;
6525
6526 // The desired interval for active location updates, in milliseconds.
6527 // Bucketized to reduce cardinality.
6528 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
6529
6530 // Minimum distance between location updates, in meters.
6531 // Bucketized to reduce cardinality.
6532 optional android.stats.location.SmallestDisplacementBucket
6533 bucketized_smallest_displacement = 7;
6534
6535 // The number of location updates.
6536 optional int64 num_updates = 8;
6537
6538 // The request expiration time, in millisecond since boot.
6539 // Bucketized to reduce cardinality.
6540 optional android.stats.location.ExpirationBucket
6541 bucketized_expire_in = 9;
6542
6543 // Type of Callback passed in for this API.
6544 optional android.stats.location.CallbackType callback_type = 10;
6545
6546 // The radius of the central point of the alert
6547 // region, in meters. Only for API REQUEST_GEOFENCE.
6548 // Bucketized to reduce cardinality.
6549 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
6550
6551 // Activity Importance of API caller.
6552 // Categorized to 3 types that are interesting from location's perspective.
6553 optional android.stats.location.ActivityImportance activiy_importance = 12;
6554}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01006555
6556/**
6557 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
6558 */
6559message ReviewPermissionsFragmentResultReported {
6560 // unique value identifying a permission group change. A permission group change might result
6561 // in multiple of these atoms
6562 optional int64 change_id = 1;
6563
6564 // UID of package the permission belongs to
6565 optional int32 uid = 2 [(is_uid) = true];
6566
6567 // Name of package the permission belongs to
6568 optional string package_name = 3;
6569
6570 // The permission to be granted
6571 optional string permission_name = 4;
6572
6573 // The result of the permission grant
6574 optional bool permission_granted = 5;
6575}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01006576
6577/**
6578* Information about results of permission upgrade by RuntimePermissionsUpgradeController
6579* Logged from: RuntimePermissionUpdgradeController
6580*/
6581message RuntimePermissionsUpgradeResult {
6582 // Permission granted as result of upgrade
6583 optional string permission_name = 1;
6584
6585 // UID of package granted permission
6586 optional int32 uid = 2 [(is_uid) = true];
6587
6588 // Name of package granted permission
6589 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01006590}
6591
6592/**
6593* Information about a buttons presented in GrantPermissionsActivty and choice made by user
6594*/
6595message GrantPermissionsActivityButtonActions {
6596 // Permission granted as result of upgrade
6597 optional string permission_group_name = 1;
6598
6599 // UID of package granted permission
6600 optional int32 uid = 2 [(is_uid) = true];
6601
6602 // Name of package requesting permission
6603 optional string package_name = 3;
6604
6605 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
6606 // LABEL_ constants in GrantPermissionActivity.java
6607 optional int32 buttons_presented = 4;
6608
6609 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
6610 optional int32 button_clicked = 5;
6611}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01006612
6613/**
6614 * Information about LocationAccessCheck notification presented to user
6615 */
6616message LocationAccessCheckNotificationAction {
6617
6618 // id which identifies single session of user interacting with permission controller
6619 optional int64 session_id = 1;
6620
6621 // Uid of package for which location access check is presented
6622 optional int32 package_uid = 2;
6623
6624 // Name of package for which location access check is presented
6625 optional string package_name = 3;
6626
6627 enum Result {
6628 UNDEFINED = 0;
6629 // notification was presented to the user
6630 NOTIFICATION_PRESENTED = 1;
6631 // notification was declined by the user
6632 NOTIFICATION_DECLINED = 2;
6633 // notification was clicked by the user
6634 NOTIFICATION_CLICKED = 3;
6635 }
6636
6637 // View / interaction recorded
6638 optional Result result = 4;
6639}