blob: 2bacfbc57395974d30fde0457e62f0f28523d309 [file] [log] [blame]
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -07001/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070018
19package android.os.statsd;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070020option java_package = "com.android.os";
Stefan Lafonae2df012017-11-14 09:17:21 -080021option java_outer_classname = "AtomsProto";
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -070022
Yao Chen9c1debe2018-02-19 14:39:19 -080023import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
Bookatzdb026a22018-01-10 19:01:56 -080024import "frameworks/base/core/proto/android/app/enums.proto";
Tej Singh33a412b2018-03-16 18:43:59 -070025import "frameworks/base/core/proto/android/app/job/enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070026import "frameworks/base/core/proto/android/app/settings_enums.proto";
Jack Hec27040a2019-01-09 20:54:41 -080027import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto";
Tej Singh5d991e12018-03-09 19:48:11 -080028import "frameworks/base/core/proto/android/bluetooth/enums.proto";
Jack Heab86dbd22018-12-18 15:43:27 -080029import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
Jack Hed9837c82019-01-09 01:19:13 -080030import "frameworks/base/core/proto/android/bluetooth/hfp/enums.proto";
Jack He1021a612019-01-20 21:22:46 -080031import "frameworks/base/core/proto/android/bluetooth/smp/enums.proto";
Michael Groover9e7b06e2018-12-28 19:55:51 -080032import "frameworks/base/core/proto/android/debug/enums.proto";
Kevin Chyn1741a072019-01-17 11:54:40 -080033import "frameworks/base/core/proto/android/hardware/biometrics/enums.proto";
joshmccloskey8c3322e2019-01-09 18:25:57 -080034import "frameworks/base/core/proto/android/hardware/sensor/assist/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080035import "frameworks/base/core/proto/android/net/networkcapabilities.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080036import "frameworks/base/core/proto/android/os/enums.proto";
Chiachang Wangf6bedc22019-01-14 11:54:32 +080037import "frameworks/base/core/proto/android/server/connectivity/data_stall_event.proto";
Bookatz8bdae8d2018-01-16 11:24:30 -080038import "frameworks/base/core/proto/android/server/enums.proto";
Kweku Adams8845d012018-12-11 20:06:45 -080039import "frameworks/base/core/proto/android/server/job/enums.proto";
Bookatz48d362e2018-11-06 15:49:08 -080040import "frameworks/base/core/proto/android/server/location/enums.proto";
Yangsteraf9aee72018-10-12 09:26:16 -070041import "frameworks/base/core/proto/android/service/procstats_enum.proto";
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -080042import "frameworks/base/core/proto/android/service/usb.proto";
Chiachang Wang0e88ebf2019-03-21 10:18:07 +080043import "frameworks/base/core/proto/android/stats/connectivity/network_stack.proto";
lifr1f74b052019-04-16 22:16:30 +080044import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.proto";
Bookatz11257ca2018-12-05 18:22:39 -080045import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
46import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
Ben Blount763a5d52019-04-10 11:48:58 -070047import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
48import "frameworks/base/core/proto/android/stats/enums.proto";
49import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
Yao Chen8c433862018-10-24 14:09:20 -070050import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
Hongyi Zhang700137e2019-05-23 21:19:36 -070051import "frameworks/base/core/proto/android/stats/location/location_enums.proto";
Ray Essick8ab04df2019-02-15 11:01:02 -080052import "frameworks/base/core/proto/android/stats/mediametrics/mediametrics.proto";
Jeff Sharkey6bd21572019-11-15 20:45:33 -070053import "frameworks/base/core/proto/android/stats/mediaprovider/mediaprovider_enums.proto";
Carmen Agimof6688a352019-01-30 19:36:04 +000054import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
Hyunyoung Song80adf6be2019-01-30 09:59:30 -080055import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080056import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080057import "frameworks/base/core/proto/android/telephony/enums.proto";
58import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080059import "frameworks/base/core/proto/android/wifi/enums.proto";
Tony Make2b1b672019-07-29 16:59:47 +010060import "frameworks/base/core/proto/android/stats/textclassifier/textclassifier_enums.proto";
Tianjie Xu167c3db2019-07-22 14:25:14 -070061import "frameworks/base/core/proto/android/stats/otaupdate/updateengine_enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080062
Yao Chend54f9dd2017-10-17 17:37:48 +000063/**
Stefan Lafonae2df012017-11-14 09:17:21 -080064 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000065 * raw stats log events from the Android system, also known as "atoms."
66 *
67 * This field contains a single oneof with all of the available messages.
68 * The stats-log-api-gen tool runs as part of the Android build and
69 * generates the android.util.StatsLog class, which contains the constants
70 * and methods that Android uses to log.
71 *
Stefan Lafonae2df012017-11-14 09:17:21 -080072 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000073 * Instead, statsd on Android constructs these messages synthetically,
74 * in the format defined here and in stats_log.proto.
75 */
Stefan Lafonae2df012017-11-14 09:17:21 -080076message Atom {
77 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070078 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070079 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
80 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070081 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070082 BleScanResultReceived ble_scan_result_received = 4;
83 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080084 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070085 SyncStateChanged sync_state_changed = 7;
86 ScheduledJobStateChanged scheduled_job_state_changed = 8;
87 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070088 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080089 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
90 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
91 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070092 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
93 MemoryFactorStateChanged memory_factor_state_changed = 15;
94 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
95 CachedKillReported cached_kill_reported = 17;
96 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070097 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080098 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
99 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
100 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -0700101 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800102 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -0700103 CameraStateChanged camera_state_changed = 25;
104 FlashlightStateChanged flashlight_state_changed = 26;
105 UidProcessStateChanged uid_process_state_changed = 27;
106 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
107 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -0700108 BatteryLevelChanged battery_level_changed = 30;
109 ChargingStateChanged charging_state_changed = 31;
110 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -0700111 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800112 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -0700113 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
114 KernelWakeupReported kernel_wakeup_reported = 36;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800115 WifiLockStateChanged wifi_lock_state_changed = 37 [(module) = "wifi"];
116 WifiSignalStrengthChanged wifi_signal_strength_changed = 38 [(module) = "wifi"];
117 WifiScanStateChanged wifi_scan_state_changed = 39 [(module) = "wifi"];
Bookatze5885242017-10-24 20:10:31 -0700118 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700119 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700120 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700121 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900122 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700123 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800124 AnomalyDetected anomaly_detected = 46;
Andrei Oneada01ea52019-01-30 15:28:36 +0000125 AppBreadcrumbReported app_breadcrumb_reported = 47 [(allow_from_any_uid) = true];
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800126 AppStartOccurred app_start_occurred = 48;
127 AppStartCanceled app_start_canceled = 49;
128 AppStartFullyDrawn app_start_fully_drawn = 50;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800129 LmkKillOccurred lmk_kill_occurred = 51;
Chenjie Yu52cacc62017-12-08 18:11:45 -0800130 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800131 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53 [(module) = "wifi"];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800132 LmkStateChanged lmk_state_changed = 54;
133 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800134 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800135 BootSequenceReported boot_sequence_reported = 57;
Andrei Oneada01ea52019-01-30 15:28:36 +0000136 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -0800137 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800138 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800139 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800140 KeyguardStateChanged keyguard_state_changed = 62;
141 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
142 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800143 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800144 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800145 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
146 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800147 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700148 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800149 SpeakerImpedanceReported speaker_impedance_reported = 71;
150 HardwareFailed hardware_failed = 72;
151 PhysicalDropDetected physical_drop_detected = 73;
152 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800153 MobileConnectionStateChanged mobile_connection_state_changed = 75;
154 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700155 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800156 AppCrashOccurred app_crash_occurred = 78;
157 ANROccurred anr_occurred = 79;
158 WTFOccurred wtf_occurred = 80;
159 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700160 GenericAtom generic_atom = 82;
jianjin6eada302019-02-28 11:25:57 -0800161 KeyValuePairsAtom key_value_pairs_atom = 83 [(allow_from_any_uid) = true];
Bookatza7020bd2018-08-28 16:29:35 -0700162 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700163 DeferredJobStatsReported deferred_job_stats_reported = 85;
Tej Singha72344992019-04-17 18:55:08 -0700164 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Kevin Chyn1741a072019-01-17 11:54:40 -0800165 BiometricAcquired biometric_acquired = 87;
166 BiometricAuthenticated biometric_authenticated = 88;
167 BiometricErrorOccurred biometric_error_occurred = 89;
Will Brockmanfbaa7912019-10-24 15:15:09 -0400168 UiEventReported ui_event_reported = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700169 BatteryHealthSnapshot battery_health_snapshot = 91;
170 SlowIo slow_io = 92;
171 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700172 PhoneServiceStateChanged phone_service_state_changed = 94;
173 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100174 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700175 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700176 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700177 // TODO: service state change is very noisy shortly after boot, as well
178 // as at other transitions - coming out of doze, device plugged in, etc.
179 // Consider removing this if it becomes a problem
180 ServiceStateChanged service_state_changed = 99;
181 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800182 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800183 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000184 DevicePolicyEvent device_policy_event = 103;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800185 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104 [(module) = "docsui"];
186 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported =
187 105 [(module) = "docsui"];
188 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106 [(module) = "docsui"];
189 DocsUIFileOperationReported docs_ui_provider_file_op = 107 [(module) = "docsui"];
190 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request =
191 108 [(module) = "docsui"];
192 DocsUILaunchReported docs_ui_launch_reported = 109 [(module) = "docsui"];
193 DocsUIRootVisitedReported docs_ui_root_visited = 110 [(module) = "docsui"];
194 DocsUIStartupMsReported docs_ui_startup_ms = 111 [(module) = "docsui"];
195 DocsUIUserActionReported docs_ui_user_action_reported = 112 [(module) = "docsui"];
Bookatzda1798c2018-12-13 14:16:00 -0800196 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
197 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f62018-12-06 11:01:38 +0000198 AppCompacted app_compacted = 115;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800199 NetworkDnsEventReported network_dns_event_reported = 116 [(module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800200 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800201 117 [(module) = "docsui"];
202 DocsUIPickResultReported docs_ui_pick_result_reported = 118 [(module) = "docsui"];
203 DocsUISearchModeReported docs_ui_search_mode_reported = 119 [(module) = "docsui"];
204 DocsUISearchTypeReported docs_ui_search_type_reported = 120 [(module) = "docsui"];
205 DataStallEvent data_stall_event = 121 [(module) = "network_stack"];
Christian Brunschenf86039e2018-12-21 12:26:14 +0000206 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000207 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800208 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800209 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800210 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
211 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000212 AppDowngraded app_downgraded = 128;
213 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
214 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800215 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
216 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800217 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800218 NfcErrorOccurred nfc_error_occurred = 134;
219 NfcStateChanged nfc_state_changed = 135;
220 NfcBeamOccurred nfc_beam_occurred = 136;
221 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
222 NfcTagOccurred nfc_tag_occurred = 138;
223 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
224 SeStateChanged se_state_changed = 140;
225 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800226 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800227 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800228 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800229 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800230 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800231 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyne5a37fb2019-02-08 13:10:36 -0800232 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500233 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800234 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Jack Hec27040a2019-01-09 20:54:41 -0800235 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
236 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
237 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
238 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
239 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
240 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
241 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
242 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
243 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He1021a612019-01-20 21:22:46 -0800244 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
245 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
Jack Heaea26982019-04-04 11:19:48 -0700246 BluetoothDeviceInfoReported bluetooth_device_info_reported = 162;
Jack He1021a612019-01-20 21:22:46 -0800247 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
248 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
249 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
250 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
251 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Alex Salod7c3eef2019-01-25 14:43:27 -0800252 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800253 ProcessStartTime process_start_time = 169;
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700254 PermissionGrantRequestResultReported permission_grant_request_result_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800255 170 [(module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800256 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Michael Groover4a0ca942019-01-24 17:41:25 -0800257 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Steven Wu552f63f2019-02-05 13:41:36 -0500258 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
joshmccloskey8c3322e2019-01-09 18:25:57 -0800259 AssistGestureStageReported assist_gesture_stage_reported = 174;
260 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
261 AssistGestureProgressReported assist_gesture_progress_reported = 176;
Philip Quinn0eded622019-01-29 12:46:28 -0800262 TouchGestureClassified touch_gesture_classified = 177;
Andrei Onea4ad6d0c2019-02-08 13:54:12 +0000263 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800264 StyleUIChanged style_ui_changed = 179 [(module) = "style"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700265 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800266 180 [(module) = "permissioncontroller"];
Carmen Agimof6688a352019-01-30 19:36:04 +0000267 AppInstallOnExternalStorageReported app_install_on_external_storage_reported = 181;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800268 NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
Carmen Agimof6dcc5032019-03-01 16:20:09 +0000269 AppMovedStorageReported app_moved_storage_reported = 183;
joshmccloskey6f952b22019-03-25 20:59:35 -0700270 BiometricEnrolled biometric_enrolled = 184;
jianjin8f2dee02019-03-29 14:03:08 -0700271 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185;
272 TombStoneOccurred tomb_stone_occurred = 186;
Jack He71426802019-04-02 13:32:52 -0700273 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported = 187;
Ben Blount763a5d52019-04-10 11:48:58 -0700274 IntelligenceEventReported intelligence_event_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800275 188 [(module) = "intelligence"];
Tej Singha72344992019-04-17 18:55:08 -0700276 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed = 189;
Hai Zhang5d3328d2019-04-13 21:25:06 +0800277 RoleRequestResultReported role_request_result_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800278 190 [(module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800279 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
280 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
281 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
282 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
283 MediametricsCodecReported mediametrics_codec_reported = 195;
284 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
285 MediametricsExtractorReported mediametrics_extractor_reported = 197;
286 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
287 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
288 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700289 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Yuncheol Heod1a85d22019-05-08 17:13:42 -0700290 CarPowerStateChanged car_power_state_changed = 203;
291 GarageModeInfo garage_mode_info = 204;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800292 TestAtomReported test_atom_reported = 205 [(module) = "cts"];
Adam He420947c2019-01-23 15:59:09 -0800293 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported = 206;
294 ContentCaptureServiceEvents content_capture_service_events = 207;
295 ContentCaptureSessionEvents content_capture_session_events = 208;
296 ContentCaptureFlushed content_capture_flushed = 209;
Hongyi Zhang700137e2019-05-23 21:19:36 -0700297 LocationManagerApiUsageReported location_manager_api_usage_reported = 210;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100298 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800299 211 [(module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100300 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800301 212 [(module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100302 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800303 213 [(module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100304 LocationAccessCheckNotificationAction location_access_check_notification_action =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800305 214 [(module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100306 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800307 215 [(module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100308 AppPermissionFragmentViewed app_permission_fragment_viewed =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800309 216 [(module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100310 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800311 217 [(module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100312 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800313 218 [(module) = "permissioncontroller"];
314 TextSelectionEvent text_selection_event = 219 [(module) = "textclassifier"];
315 TextLinkifyEvent text_linkify_event = 220 [(module) = "textclassifier"];
316 ConversationActionsEvent conversation_actions_event = 221 [(module) = "textclassifier"];
317 LanguageDetectionEvent language_detection_event = 222 [(module) = "textclassifier"];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -0700318 ExclusionRectStateChanged exclusion_rect_state_changed = 223;
319 BackGesture back_gesture_reported_reported = 224;
Tianjie Xu167c3db2019-07-22 14:25:14 -0700320 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
321 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Emilian Peev6729f372019-08-29 09:14:09 -0700322 CameraActionEvent camera_action_event = 227;
atrost01a20932019-08-28 15:40:37 +0100323 AppCompatibilityChangeReported app_compatibility_change_reported =
324 228 [(allow_from_any_uid) = true];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800325 PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
Mark Tabrya824a642019-11-05 12:26:12 -0800326 VmsClientConnectionStateChanged vms_client_connection_state_changed = 230;
Blake Kragten212edc72019-10-15 13:26:50 -0700327 GpsLocationStatusReported gps_location_status_reported = 231;
328 GpsTimeToFirstFixReported gps_time_to_first_fix_reported = 232;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800329 MediaProviderScanEvent media_provider_scan_event = 233 [(module) = "mediaprovider"];
330 MediaProviderDeletionEvent media_provider_deletion_event = 234 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700331 MediaProviderPermissionEvent media_provider_permission_event =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800332 235 [(module) = "mediaprovider"];
333 MediaProviderSchemaChange media_provider_schema_change = 236 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700334 MediaProviderIdleMaintenance media_provider_idle_maintenance =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800335 237 [(module) = "mediaprovider"];
Kenny Root4eacaaa2020-01-08 20:48:13 -0800336 RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238;
Yao Chend54f9dd2017-10-17 17:37:48 +0000337 }
David Chenc8a43242017-10-17 16:23:28 -0700338
David Chen6e3e6cb2018-01-03 16:14:06 -0800339 // Pulled events will start at field 10000.
Stan Iliev637ba5e2019-08-16 13:43:08 -0400340 // Next: 10069
David Chenc8a43242017-10-17 16:23:28 -0700341 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800342 WifiBytesTransfer wifi_bytes_transfer = 10000;
343 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
344 MobileBytesTransfer mobile_bytes_transfer = 10002;
345 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800346 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800347 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800348 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800349 CpuTimePerFreq cpu_time_per_freq = 10008;
350 CpuTimePerUid cpu_time_per_uid = 10009;
351 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800352 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800353 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800354 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800355 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800356 SystemElapsedRealtime system_elapsed_realtime = 10014;
357 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800358 CpuActiveTime cpu_active_time = 10016;
359 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000360 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800361 RemainingBatteryCapacity remaining_battery_capacity = 10019;
362 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800363 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100364 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100365 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100366 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000367 DiskStats disk_stats = 10025;
368 DirectoryUsage directory_usage = 10026;
369 AppSize app_size = 10027;
370 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700371 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700372 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800373 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700374 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700375 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800376 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700377 ProcessCpuTime process_cpu_time = 10035;
Misha Wagner5a51e002018-10-03 15:04:09 +0100378 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700379 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee60422018-11-09 12:27:37 -0800380 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
381 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
382 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000383 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800384 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800385 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800386 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000387 DebugElapsedClock debug_elapsed_clock = 10046;
388 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800389 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800390 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800391 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800392 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000393 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000394 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800395 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
396 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000397 SystemIonHeapSize system_ion_heap_size = 10056;
Carmen Agimofa769c152019-03-04 14:39:14 +0000398 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700399 FaceSettings face_settings = 10058;
Maggie White442b6312019-04-05 16:26:44 -0700400 CoolingDevice cooling_device = 10059;
Martijn Coenencd95d462019-04-25 17:09:45 +0200401 AppOps app_ops = 10060;
Rafal Slawik77987ed2019-06-17 12:28:23 +0100402 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061;
Alec Mourie088e762019-07-02 13:10:55 -0700403 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
404 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Rafal Slawik7efcefb2019-09-20 11:16:20 +0100405 ProcessMemorySnapshot process_memory_snapshot = 10064;
Mark Tabrya824a642019-11-05 12:26:12 -0800406 VmsClientStats vms_client_stats = 10065;
Chris Wrencdea3b72019-11-22 16:58:17 -0500407 NotificationRemoteViews notification_remote_views = 10066;
Stanislav Zholninccb82e42019-11-29 18:59:49 +0000408 DangerousPermissionStateSampled dangerous_permission_state_sampled = 10067;
Stan Iliev637ba5e2019-08-16 13:43:08 -0400409 GraphicsStats graphics_stats = 10068;
David Chenc8a43242017-10-17 16:23:28 -0700410 }
yroa1fe77c2018-02-26 14:22:54 -0800411
Bookatz76aafcf2018-09-17 16:17:10 -0700412 // DO NOT USE field numbers above 100,000 in AOSP.
413 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
414 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100415
416 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700417}
418
Yao Chend54f9dd2017-10-17 17:37:48 +0000419/**
Yangster-mac20877162017-12-22 17:19:39 -0800420 * This proto represents a node of an attribution chain.
421 * Note: All attribution chains are represented as a repeated field of type
422 * AttributionNode. It is understood that in such arrays, the order is that
423 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000424 */
Yangster-mac20877162017-12-22 17:19:39 -0800425message AttributionNode {
426 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800427 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800428
Yangster-mac20877162017-12-22 17:19:39 -0800429 // The (optional) string tag for an element in the attribution chain. If the
430 // element has no tag, it is encoded as an empty string.
431 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700432}
433
Yangster-mac48b3d622018-08-18 12:38:11 -0700434message KeyValuePair {
435 optional int32 key = 1;
436 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700437 int32 value_int = 2;
438 int64 value_long = 3;
439 string value_str = 4;
440 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700441 }
442}
443
444message KeyValuePairsAtom {
445 optional int32 uid = 1;
446 repeated KeyValuePair pairs = 2;
447}
448
Yao Chend54f9dd2017-10-17 17:37:48 +0000449/*
450 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800451 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000452 *
453 * RULES:
454 * - The field ids for each atom must start at 1, and count upwards by 1.
455 * Skipping field ids is not allowed.
456 * - These form an API, so renaming, renumbering or removing fields is
457 * not allowed between android releases. (This is not currently enforced,
458 * but there will be a tool to enforce this restriction).
459 * - The types must be built-in protocol buffer types, namely, no sub-messages
460 * are allowed (yet). The bytes type is also not allowed.
461 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800462 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000463 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800464 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000465 * - A field that is a uid should be a string field, tagged with the [xxx]
466 * annotation. The generated code on android will be represented by UIDs,
467 * and those UIDs will be translated in xxx to those strings.
468 *
469 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700470 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000471 * - If there is a UID, it goes first. Think in an object-oriented fashion.
472 * *****************************************************************************
473 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700474
Yao Chend54f9dd2017-10-17 17:37:48 +0000475/**
Tej Singha72344992019-04-17 18:55:08 -0700476 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700477 * Logs when the Thermal service HAL notifies the throttling start/stop events.
478 *
479 * Logged from:
480 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
481 */
482message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700483 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700484 optional android.os.TemperatureTypeEnum sensor_type = 1;
485
Maggie White442b6312019-04-05 16:26:44 -0700486 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700487 enum State {
488 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700489 START = 1; // START indicated that throttling was triggered.
490 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700491 }
Yangster-mace16189a2018-08-26 12:20:16 -0700492 optional State state = 2;
493
494 optional float temperature = 3;
495}
496
497/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000498 * Logs when the screen state changes.
499 *
500 * Logged from:
501 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
502 */
503message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800504 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700505 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700506}
Yao Chend54f9dd2017-10-17 17:37:48 +0000507
508/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700509 * Logs that the process state of the uid, as determined by ActivityManager
510 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000511 *
512 * Logged from:
513 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
514 */
Bookatzc1a050a2017-10-10 15:49:28 -0700515message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700516 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000517
Bookatzdb026a22018-01-10 19:01:56 -0800518 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700519 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000520}
521
522/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700523 * Logs process state change of a process, as per the activity manager.
524 *
525 * Logged from:
526 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
527 */
528message ProcessStateChanged {
529 optional int32 uid = 1;
530 optional string process_name = 2;
531 optional string package_name = 3;
532 // TODO: remove this when validation is done
533 optional int64 version = 5;
534 // The state, from frameworks/base/core/proto/android/app/enums.proto.
535 optional android.app.ProcessStateEnum state = 4;
536}
537
538/**
539 * Logs when ActivityManagerService sleep state is changed.
540 *
541 * Logged from:
542 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
543 */
544message ActivityManagerSleepStateChanged {
545 // TODO: import frameworks proto
546 enum State {
547 UNKNOWN = 0;
548 ASLEEP = 1;
549 AWAKE = 2;
550 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700551 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700552}
553
554/**
555 * Logs when system memory state changes.
556 *
557 * Logged from:
558 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
559 */
560message MemoryFactorStateChanged {
561 // TODO: import frameworks proto
562 enum State {
563 MEMORY_UNKNOWN = 0;
564 NORMAL = 1; // normal.
565 MODERATE = 2; // moderate memory pressure.
566 LOW = 3; // low memory.
567 CRITICAL = 4; // critical memory.
568
569 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700570 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700571}
572
573/**
574 * Logs when app is using too much cpu, according to ActivityManagerService.
575 *
576 * Logged from:
577 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
578 */
579message ExcessiveCpuUsageReported {
580 optional int32 uid = 1;
581 optional string process_name = 2;
582 optional string package_name = 3;
583 // package version. TODO: remove this when validation is done
584 optional int64 version = 4;
585}
586
587/**
588 * Logs when a cached process is killed, along with its pss.
589 *
590 * Logged from:
591 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
592 */
593message CachedKillReported {
594 optional int32 uid = 1;
595 optional string process_name = 2;
596 optional string package_name = 3;
597 // TODO: remove this when validation is done
598 optional int64 version = 5;
599 optional int64 pss = 4;
600}
601
602/**
603 * Logs when memory stats of a process is reported.
604 *
605 * Logged from:
606 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
607 */
608message ProcessMemoryStatReported {
609 optional int32 uid = 1;
610 optional string process_name = 2;
611 optional string package_name = 3;
612 //TODO: remove this when validation is done
613 optional int64 version = 9;
614 optional int64 pss = 4;
615 optional int64 uss = 5;
616 optional int64 rss = 6;
617 enum Type {
618 ADD_PSS_INTERNAL_SINGLE = 0;
619 ADD_PSS_INTERNAL_ALL_MEM = 1;
620 ADD_PSS_INTERNAL_ALL_POLL = 2;
621 ADD_PSS_EXTERNAL = 3;
622 ADD_PSS_EXTERNAL_SLOW = 4;
623 }
624 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800625 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700626}
627
628/**
Bookatzc1a050a2017-10-10 15:49:28 -0700629 * Logs that a process started, finished, crashed, or ANRed.
630 *
631 * Logged from:
632 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
633 */
634message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700635 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700636
David Chen0b5c90c2018-01-25 16:51:49 -0800637 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800638 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700639
Bookatzddccf0a2017-11-28 16:48:14 -0800640 // What lifecycle state the process changed to.
641 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800642 enum State {
643 FINISHED = 0;
644 STARTED = 1;
645 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800646 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800647 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700648}
649
Bookatzc1a050a2017-10-10 15:49:28 -0700650/**
651 * Logs when the ble scan state changes.
652 *
653 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700654 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700655 */
656message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800657 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700658
659 enum State {
660 OFF = 0;
661 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700662 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
663 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700664 }
665 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700666
Bookatze5ec0b42018-03-26 13:34:56 -0700667 // Does the scan have a filter.
668 optional bool is_filtered = 3;
669 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
670 optional bool is_first_match = 4;
671 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
672 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700673}
674
675/**
676 * Logs reporting of a ble scan finding results.
677 *
678 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700679 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700680 */
Bookatzae6738e2018-09-13 11:38:56 -0700681// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700682message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800683 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700684
685 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800686 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700687}
688
689/**
690 * Logs when a sensor state changes.
691 *
692 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700693 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700694 */
695message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800696 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700697
Bookatzc1a050a2017-10-10 15:49:28 -0700698 // The id (int) of the sensor.
699 optional int32 sensor_id = 2;
700
701 enum State {
702 OFF = 0;
703 ON = 1;
704 }
705 optional State state = 3;
706}
707
Bookatzc1a050a2017-10-10 15:49:28 -0700708/**
709 * Logs when GPS state changes.
710 *
711 * Logged from:
712 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
713 */
714message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800715 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700716
717 enum State {
718 OFF = 0;
719 ON = 1;
720 }
721 optional State state = 2;
722}
723
Bookatz48d362e2018-11-06 15:49:08 -0800724/**
725 * Logs when GPS signal quality.
726 *
727 * Logged from:
728 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
729 */
730message GpsSignalQualityChanged {
731 optional android.server.location.GpsSignalQualityEnum level = 1;
732}
733
Blake Kragten212edc72019-10-15 13:26:50 -0700734/**
735 * Gps location status report
736 *
737 * Logged from:
738 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
739 */
740message GpsLocationStatusReported {
741 // Boolean stating if location was acquired
742 optional bool location_success = 1;
743}
744
745/**
746 * Gps log time to first fix report
747 *
748 * Logged from:
749 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
750 */
751message GpsTimeToFirstFixReported {
752 // int32 reporting the time to first fix in milliseconds
753 optional int32 time_to_first_fix_millis = 1;
754}
Bookatzc1a050a2017-10-10 15:49:28 -0700755
756/**
757 * Logs when a sync manager sync state changes.
758 *
759 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700760 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700761 */
762message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800763 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700764
David Chen0b5c90c2018-01-25 16:51:49 -0800765 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800766 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700767
768 enum State {
769 OFF = 0;
770 ON = 1;
771 }
772 optional State state = 3;
773}
774
Yangster-mac96353002018-09-05 11:18:55 -0700775/*
776 * Deferred job stats.
777 *
778 * Logged from:
779 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
780*/
781message DeferredJobStatsReported {
782 repeated AttributionNode attribution_node = 1;
783
784 // Number of jobs deferred.
785 optional int32 num_jobs_deferred = 2;
786
787 // Time since the last job runs.
788 optional int64 time_since_last_job_millis = 3;
789}
790
Bookatzc1a050a2017-10-10 15:49:28 -0700791/**
792 * Logs when a job scheduler job state changes.
793 *
794 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700795 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700796 */
797message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800798 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700799
800 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800801 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700802
803 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800804 FINISHED = 0;
805 STARTED = 1;
806 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700807 }
808 optional State state = 3;
809
Tej Singh33a412b2018-03-16 18:43:59 -0700810 // The reason a job has stopped.
811 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700812 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700813 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100814
815 // The standby bucket of the app that scheduled the job. These match the framework constants
816 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
817 // already assigned 0.
818 enum Bucket {
819 UNKNOWN = -1;
820 ACTIVE = 0;
821 WORKING_SET = 1;
822 FREQUENT = 2;
823 RARE = 3;
824 NEVER = 4;
825 }
826 optional Bucket standby_bucket = 5 [default = UNKNOWN];
827
828 // The job id (as assigned by the app).
829 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700830}
831
832/**
833 * Logs when the audio state changes.
834 *
835 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700836 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700837 */
838message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800839 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700840
841 enum State {
842 OFF = 0;
843 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700844 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
845 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700846 }
847 optional State state = 2;
848}
849
850/**
851 * Logs when the video codec state changes.
852 *
853 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700854 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700855 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800856message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800857 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700858
859 enum State {
860 OFF = 0;
861 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700862 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
863 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700864 }
865 optional State state = 2;
866}
867
868/**
869 * Logs when the flashlight state changes.
870 *
871 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700872 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700873 */
874message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800875 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700876
877 enum State {
878 OFF = 0;
879 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700880 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
881 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700882 }
883 optional State state = 2;
884}
885
886/**
887 * Logs when the camera state changes.
888 *
889 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700890 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700891 */
892message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800893 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700894
895 enum State {
896 OFF = 0;
897 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700898 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
899 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700900 }
901 optional State state = 2;
902}
903
904/**
905 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000906 *
907 * Logged from:
908 * TODO
909 */
Bookatzd6746242017-10-24 18:39:35 -0700910message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800911 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000912
Bookatz1a1b0462018-01-12 11:47:03 -0800913 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
914 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700915 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700916
917 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
918 optional string tag = 3;
919
920 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800921 RELEASE = 0;
922 ACQUIRE = 1;
923 CHANGE_RELEASE = 2;
924 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700925 }
926 optional State state = 4;
927}
928
929/**
Bookatzc1a050a2017-10-10 15:49:28 -0700930 * Logs when a partial wakelock is considered 'long' (over 1 min).
931 *
932 * Logged from:
933 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
934 */
935message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800936 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700937
Yao Chend54f9dd2017-10-17 17:37:48 +0000938 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
939 optional string tag = 2;
940
Bookatzc1a050a2017-10-10 15:49:28 -0700941 // TODO: I have no idea what this is.
942 optional string history_tag = 3;
943
944 enum State {
945 OFF = 0;
946 ON = 1;
947 }
948 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000949}
950
Bookatzc1a050a2017-10-10 15:49:28 -0700951/**
Bookatza66083f2018-09-20 17:24:00 -0700952 * Logs when the device is interactive, according to the PowerManager Notifier.
953 *
954 * Logged from:
955 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
956 */
957message InteractiveStateChanged {
958 enum State {
959 OFF = 0;
960 ON = 1;
961 }
962 optional State state = 1;
963}
964
965/**
Bookatzc1a050a2017-10-10 15:49:28 -0700966 * Logs Battery Saver state change.
967 *
968 * Logged from:
969 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
970 */
971message BatterySaverModeStateChanged {
972 enum State {
973 OFF = 0;
974 ON = 1;
975 }
976 optional State state = 1;
977}
978
979/**
980 * Logs Doze mode state change.
981 *
982 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800983 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700984 */
985message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800986 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800987}
988
989
990/**
991 * Logs state change of Doze mode including maintenance windows.
992 *
993 * Logged from:
994 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
995 */
996message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800997 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700998}
999
1000/**
1001 * Logs screen brightness level.
1002 *
1003 * Logged from:
1004 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1005 */
1006message ScreenBrightnessChanged {
1007 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1008 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001009}
1010
1011/**
1012 * Logs battery level (percent full, from 0 to 100).
1013 *
1014 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001015 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001016 */
1017message BatteryLevelChanged {
1018 // Battery level. Should be in [0, 100].
1019 optional int32 battery_level = 1;
1020}
1021
1022/**
1023 * Logs change in charging status of the device.
1024 *
1025 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001026 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001027 */
1028message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001029 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1030 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001031}
1032
1033/**
1034 * Logs whether the device is plugged in, and what power source it is using.
1035 *
1036 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001037 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001038 */
1039message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001040 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1041 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001042}
1043
Bookatz8c6571b2017-10-24 15:04:41 -07001044/**
1045 * Logs when an app's wakeup alarm fires.
1046 *
1047 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001048 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001049 */
1050message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001051 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001052
1053 // Name of the wakeup alarm.
1054 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001055
1056 // Name of source package (for historical reasons, since BatteryStats tracked it).
1057 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001058
1059 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1060 enum Bucket {
1061 UNKNOWN = 0;
1062 EXEMPTED = 5;
1063 ACTIVE = 10;
1064 WORKING_SET = 20;
1065 FREQUENT = 30;
1066 RARE = 40;
1067 NEVER = 50;
1068 }
1069 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1070 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001071}
1072
1073/**
1074 * Logs when an an app causes the mobile radio to change state.
1075 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1076 *
1077 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001078 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001079 */
1080message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001081 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001082
Bookatz1a1b0462018-01-12 11:47:03 -08001083 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1084 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001085}
1086
1087/**
1088 * Logs when an an app causes the wifi radio to change state.
1089 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1090 *
1091 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001092 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001093 */
1094message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001095 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001096
Bookatz1a1b0462018-01-12 11:47:03 -08001097 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1098 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001099}
1100
1101/**
1102 * Logs kernel wakeup reasons and aborts.
1103 *
1104 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001105 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001106 */
1107message KernelWakeupReported {
1108 // Name of the kernel wakeup reason (or abort).
1109 optional string wakeup_reason_name = 1;
1110
1111 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001112 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001113}
1114
1115/**
Bookatzda1798c2018-12-13 14:16:00 -08001116 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001117 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001118 *
1119 * Logged from:
1120 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1121 */
1122message WifiEnabledStateChanged {
1123 enum State {
1124 OFF = 0;
1125 ON = 1;
1126 }
1127 optional State state = 1;
1128}
1129
1130/**
1131 * 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 -08001132 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1133 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001134 *
1135 * Logged from:
1136 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1137 */
1138message WifiRunningStateChanged {
1139 repeated AttributionNode attribution_node = 1;
1140
1141 enum State {
1142 OFF = 0;
1143 ON = 1;
1144 }
1145 optional State state = 2;
1146}
1147
1148/**
Bookatze5885242017-10-24 20:10:31 -07001149 * Logs wifi locks held by an app.
1150 *
1151 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001152 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001153 */
1154message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001155 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001156
1157 enum State {
1158 OFF = 0;
1159 ON = 1;
1160 }
1161 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001162
1163 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1164 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001165}
1166
1167/**
1168 * Logs wifi signal strength changes.
1169 *
1170 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001171 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001172 */
1173message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001174 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1175 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001176}
1177
1178/**
1179 * Logs wifi scans performed by an app.
1180 *
1181 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001182 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001183 */
1184message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001185 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001186
1187 enum State {
1188 OFF = 0;
1189 ON = 1;
1190 }
1191 optional State state = 2;
1192}
1193
1194/**
Tej Singh4503e102018-01-04 14:35:01 -08001195 * Logs wifi multicast locks held by an app
1196 *
1197 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001198 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001199 */
1200message WifiMulticastLockStateChanged {
1201 repeated AttributionNode attribution_node = 1;
1202
1203 enum State {
1204 OFF = 0;
1205 ON = 1;
1206 }
1207 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001208
1209 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001210}
1211
1212/**
Tej Singh1ea42892018-01-19 09:27:00 -08001213 * Logs shutdown reason and duration on next boot.
1214 *
1215 * Logged from:
1216 * frameworks/base/core/java/com/android/server/BootReceiver.java
1217 */
1218message ShutdownSequenceReported {
1219 // True if shutdown is for a reboot. Default: false if we do not know.
1220 optional bool reboot = 1;
1221
1222 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1223 optional string reason = 2;
1224
1225 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1226 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001227 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001228
1229 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001230 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001231}
1232
Tej Singh6483ea42018-01-25 17:45:49 -08001233
1234/**
1235 * Logs boot reason and duration.
1236 *
1237 * Logged from:
1238 * system/core/bootstat/bootstat.cpp
1239 */
1240message BootSequenceReported {
1241 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1242 // Default: "<EMPTY>" if not available.
1243 optional string bootloader_reason = 1;
1244
1245 // Reason for system boot. Eg. bootloader, reboot,userrequested
1246 // Default: "<EMPTY>" if not available.
1247 optional string system_reason = 2;
1248
1249 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001250 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001251
1252 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001253 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001254
1255 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001256 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001257
1258 // Time since last boot in ms. Default: 0 if not available.
1259 optional int64 time_since_last_boot = 6;
1260}
1261
Tej Singhc477d9c2018-02-05 18:31:39 -08001262
1263/**
1264 * Logs call state and disconnect cause (if applicable).
1265 *
1266 * Logged from:
1267 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1268 */
1269message CallStateChanged {
1270 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1271 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1272 optional android.telecom.CallStateEnum call_state = 1;
1273
1274 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1275 // This value is only applicable when the call_state is DISCONNECTED, and
1276 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1277 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1278 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1279
1280 // True if the call is self-managed, which are apps that use the
1281 // telecom infrastructure to make their own calls.
1282 optional bool self_managed = 3;
1283
1284 // True if call is external. External calls are calls on connected Wear
1285 // devices but show up in Telecom so the user can pull them onto the device.
1286 optional bool external_call = 4;
1287}
1288
Tej Singh1ea42892018-01-19 09:27:00 -08001289/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001290 * Logs keyguard state. The keyguard is the lock screen.
1291 *
1292 * Logged from:
1293 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1294 */
1295message KeyguardStateChanged {
1296 enum State {
1297 UNKNOWN = 0;
1298 // The keyguard is hidden when the phone is unlocked.
1299 HIDDEN = 1;
1300 // The keyguard is shown when the phone is locked (screen turns off).
1301 SHOWN= 2;
1302 // The keyguard is occluded when something is overlaying the keyguard.
1303 // Eg. Opening the camera while on the lock screen.
1304 OCCLUDED = 3;
1305 }
1306 optional State state = 1;
1307}
1308
1309/**
1310 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1311 * prompts the user to enter a password (pattern, pin, etc).
1312 *
1313 * Logged from:
1314 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1315 */
1316
1317message KeyguardBouncerStateChanged {
1318 enum State {
1319 UNKNOWN = 0;
1320 // Bouncer is hidden, either as a result of successfully entering the
1321 // password, screen timing out, or user going back to lock screen.
1322 HIDDEN = 1;
1323 // This is when the user is being prompted to enter the password.
1324 SHOWN = 2;
1325 }
1326 optional State state = 1;
1327}
1328
1329/**
1330 * Logs the result of entering a password into the keyguard bouncer.
1331 *
1332 * Logged from:
1333 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1334 */
1335message KeyguardBouncerPasswordEntered {
1336 enum BouncerResult {
1337 UNKNOWN = 0;
1338 // The password entered was incorrect.
1339 FAILURE = 1;
1340 // The password entered was correct.
1341 SUCCESS = 2;
1342 }
1343 optional BouncerResult result = 1;
1344}
1345
Tej Singha883b372018-02-15 11:30:01 -08001346/*
1347 * Logs changes to the configuration of the device. The configuration is defined
1348 * in frameworks/base/core/java/android/content/res/Configuration.java
1349 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1350 * Please go there to interpret the possible values each field can be.
1351 *
1352 * Logged from:
1353 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1354 */
1355message ResourceConfigurationChanged {
1356 // Bit mask of color capabilities of the screen.
1357 // Contains information about the color gamut and hdr mode of the screen.
1358 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001359 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001360
1361 // The target screen density being rendered to.
1362 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001363 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001364
1365 // Current user preference for the scaling factor for fonts,
1366 // relative to the base density scaling.
1367 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001368 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001369
1370 // Flag indicating whether the hard keyboard is hidden.
1371 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001372 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001373
1374 // The type of keyboard attached to the device.
1375 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1376 optional int32 keyboard = 5;
1377
1378 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1379 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001380 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001381
1382 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1383 // 0 if undefined.
1384 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1385 optional int32 mcc = 7;
1386
1387 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1388 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1389 // MNC_ZERO symbol defined in Configuration.java.
1390 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1391 optional int32 mnc = 8;
1392
1393 // The kind of navigation available on the device.
1394 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1395 optional int32 navigation = 9;
1396
1397 // Flag indicating whether the navigation is available.
1398 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001399 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001400
1401 // Overall orientation of the screen.
1402 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1403 optional int32 orientation = 11;
1404
1405 // The current height of the available screen space, in dp units.
1406 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001407 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001408
1409 // Bit mask of overall layout of the screen.
1410 // Contains information about screen size, whether the screen is wider/taller
1411 // than normal, whether the screen layout is right-tl-left or left-to-right,
1412 // and whether the screen has a rounded shape.
1413 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001414 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001415
1416 // Current width of the available screen space, in dp units.
1417 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001418 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001419
1420 // The smallest screen size an application will see in normal operation.
1421 // This is the smallest value of both screenWidthDp and screenHeightDp
1422 // in portrait and landscape.
1423 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001424 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001425
1426 // The type of touch screen attached to the device.
1427 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1428 optional int32 touchscreen = 16;
1429
1430 // Bit mask of the ui mode.
1431 // Contains information about the overall ui mode of the device.
1432 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1433 // Also contains information about whether the device is in night mode.
1434 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001435 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001436}
1437
Tej Singheee317b2018-03-07 19:28:05 -08001438
1439/**
1440 * Logs changes in the connection state of the mobile radio.
1441 *
1442 * Logged from:
1443 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1444 */
1445message MobileConnectionStateChanged {
1446 // States are from the state machine DataConnection.java.
1447 enum State {
1448 UNKNOWN = 0;
1449 // The connection is inactive, or disconnected.
1450 INACTIVE = 1;
1451 // The connection is being activated, or connecting.
1452 ACTIVATING = 2;
1453 // The connection is active, or connected.
1454 ACTIVE = 3;
1455 // The connection is disconnecting.
1456 DISCONNECTING = 4;
1457 // The connection is disconnecting after creating a connection.
1458 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1459 }
1460 optional State state = 1;
1461 // For multi-sim phones, this distinguishes between the sim cards.
1462 optional int32 sim_slot_index = 2;
1463 // Used to identify the connection. Starts at 0 and increments by 1 for
1464 // every new network created. Resets whenever the device reboots.
1465 optional int32 data_connection_id = 3;
1466 // A bitmask for the capabilities of this connection.
1467 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1468 // Default value (if we have no information): 0
1469 optional int64 capabilities = 4;
1470 // If this connection has internet.
1471 // This just checks if the DEFAULT bit of capabilities is set.
1472 optional bool has_internet = 5;
1473}
1474
1475/**
1476 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1477 *
1478 * Logged from:
1479 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1480 */
1481message MobileRadioTechnologyChanged {
1482 optional android.telephony.NetworkTypeEnum state = 1;
1483 // For multi-sim phones, this distinguishes between the sim cards.
1484 optional int32 sim_slot_index = 2;
1485}
1486
Andrew Chantb56388b2018-03-22 21:07:33 -07001487/**
1488 * Logs the VID and PID of any connected USB devices.
1489 *
1490 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1491 *
1492 * Logged by Vendor.
1493 */
1494message UsbDeviceAttached {
1495 optional int32 vid = 1;
1496 optional int32 pid = 2;
1497 optional bool has_audio = 3;
1498 optional bool has_hid = 4;
1499 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001500 enum State {
1501 STATE_DISCONNECTED = 0;
1502 STATE_CONNECTED = 1;
1503 }
1504 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001505 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001506}
1507
Tej Singheee317b2018-03-07 19:28:05 -08001508
Tej Singhdd7bd352018-02-09 19:33:15 -08001509/**
Tej Singh5d991e12018-03-09 19:48:11 -08001510 * Logs when Bluetooth is enabled and disabled.
1511 *
1512 * Logged from:
1513 * services/core/java/com/android/server/BluetoothManagerService.java
1514 */
1515message BluetoothEnabledStateChanged {
1516 repeated AttributionNode attribution_node = 1;
1517 // Whether or not bluetooth is enabled on the device.
1518 enum State {
1519 UNKNOWN = 0;
1520 ENABLED = 1;
1521 DISABLED = 2;
1522 }
1523 optional State state = 2;
1524 // The reason for being enabled/disabled.
1525 // Eg. Airplane mode, crash, application request.
1526 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1527 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001528 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001529}
1530
1531/**
Jack Hed9837c82019-01-09 01:19:13 -08001532 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001533 *
1534 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001535 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1536 *
1537 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001538 */
1539message BluetoothConnectionStateChanged {
1540 // The state of the connection.
1541 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1542 optional android.bluetooth.ConnectionStateEnum state = 1;
1543 // An identifier that can be used to match connect and disconnect events.
1544 // Currently is last two bytes of a hash of a device level ID and
1545 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001546 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001547 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001548 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1549 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001550 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001551 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001552 // An identifier that can be used to match events for this device.
1553 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1554 // Salt: Randomly generated 256 bit value
1555 // Hash algorithm: HMAC-SHA256
1556 // Size: 32 byte
1557 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001558 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001559}
1560
1561/**
1562 * Logs when a Bluetooth device connects and disconnects over ACL
1563 *
1564 * Logged from:
1565 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1566 *
1567 * Next Tag: 3
1568 */
1569message BluetoothAclConnectionStateChanged {
1570 // An identifier that can be used to match events for this device.
1571 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1572 // Salt: Randomly generated 256 bit value
1573 // Hash algorithm: HMAC-SHA256
1574 // Size: 32 byte
1575 // Default: null or empty if the device identifier is not known
1576 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1577 // The state of the connection.
1578 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1579 optional android.bluetooth.ConnectionStateEnum state = 2;
1580}
1581
1582/**
1583 * Logs when a Bluetooth device connects and disconnects over SCO
1584 *
1585 * Logged from:
1586 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1587 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1588 *
1589 * Next Tag: 4
1590 */
1591message BluetoothScoConnectionStateChanged {
1592 // An identifier that can be used to match events for this device.
1593 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1594 // Salt: Randomly generated 256 bit value
1595 // Hash algorithm: HMAC-SHA256
1596 // Size: 32 byte
1597 // Default: null or empty if the device identifier is not known
1598 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1599 // The state of the connection.
1600 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1601 optional android.bluetooth.ConnectionStateEnum state = 2;
1602 // Codec used for this SCO connection
1603 // Default: UNKNOWN
1604 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001605}
1606
Jack Hec27040a2019-01-09 20:54:41 -08001607/**
1608 * Logged when active device of a profile changes
1609 *
1610 * Logged from:
1611 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1612 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1613 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1614 */
1615message BluetoothActiveDeviceChanged {
1616 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1617 // From android.bluetooth.BluetoothProfile
1618 optional int32 bt_profile = 1;
1619 // An identifier that can be used to match events for this new active device.
1620 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1621 // Salt: Randomly generated 256 bit value
1622 // Hash algorithm: HMAC-SHA256
1623 // Size: 32 byte
1624 // Default: null or empty if there is no active device for this profile
1625 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1626}
1627
Jack Heab86dbd22018-12-18 15:43:27 -08001628// Logs when there is an event affecting Bluetooth device's link layer connection.
1629// - This event is triggered when there is a related HCI command or event
1630// - Users of this metrics can deduce Bluetooth device's connection state from these events
1631// - HCI commands are logged before the command is sent, after receiving command status, and after
1632// receiving command complete
1633// - HCI events are logged when they arrive
1634//
1635// Low level log from system/bt
1636//
1637// Bluetooth classic commands:
1638// - CMD_CREATE_CONNECTION
1639// - CMD_DISCONNECT
1640// - CMD_CREATE_CONNECTION_CANCEL
1641// - CMD_ACCEPT_CONNECTION_REQUEST
1642// - CMD_REJECT_CONNECTION_REQUEST
1643// - CMD_SETUP_ESCO_CONNECTION
1644// - CMD_ACCEPT_ESCO_CONNECTION
1645// - CMD_REJECT_ESCO_CONNECTION
1646// - CMD_ENH_SETUP_ESCO_CONNECTION
1647// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1648//
1649// Bluetooth low energy commands:
1650// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1651// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1652// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1653// - CMD_BLE_CLEAR_WHITE_LIST
1654// - CMD_BLE_ADD_WHITE_LIST
1655// - CMD_BLE_REMOVE_WHITE_LIST
1656//
1657// Bluetooth classic events:
1658// - EVT_CONNECTION_COMP
1659// - EVT_CONNECTION_REQUEST
1660// - EVT_DISCONNECTION_COMP
1661// - EVT_ESCO_CONNECTION_COMP
1662// - EVT_ESCO_CONNECTION_CHANGED
1663//
1664// Bluetooth low energy meta events:
1665// - BLE_EVT_CONN_COMPLETE_EVT
1666// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1667//
1668// Next tag: 10
1669message BluetoothLinkLayerConnectionEvent {
1670 // An identifier that can be used to match events for this device.
1671 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1672 // Salt: Randomly generated 256 bit value
1673 // Hash algorithm: HMAC-SHA256
1674 // Size: 32 byte
1675 // Default: null or empty if the device identifier is not known
1676 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1677 // Connection handle of this connection if available
1678 // Range: 0x0000 - 0x0EFF (12 bits)
1679 // Default: 0xFFFF if the handle is unknown
1680 optional int32 connection_handle = 2;
1681 // Direction of the link
1682 // Default: DIRECTION_UNKNOWN
1683 optional android.bluetooth.DirectionEnum direction = 3;
1684 // Type of this link
1685 // Default: LINK_TYPE_UNKNOWN
1686 optional android.bluetooth.LinkTypeEnum type = 4;
1687
1688 // Reason metadata for this link layer connection event, rules for interpretation:
1689 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1690 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1691 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1692 // set and valid, ignore hci_ble_event
1693
1694 // HCI command associated with this event
1695 // Default: CMD_UNKNOWN
1696 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1697 // HCI event associated with this event
1698 // Default: EVT_UNKNOWN
1699 optional android.bluetooth.hci.EventEnum hci_event = 6;
1700 // HCI BLE meta event associated with this event
1701 // Default: BLE_EVT_UNKNOWN
1702 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1703 // HCI command status code if this is triggerred by hci_cmd
1704 // Default: STATUS_UNKNOWN
1705 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1706 // HCI reason code associated with this event
1707 // Default: STATUS_UNKNOWN
1708 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1709}
1710
Howard Roe103fe22019-01-17 16:52:16 -08001711/**
1712 * Logs when a module is rolled back by Watchdog.
1713 *
1714 * Logged from: Rollback Manager
1715 */
1716message WatchdogRollbackOccurred {
1717 enum RollbackType {
1718 UNKNOWN = 0;
1719 ROLLBACK_INITIATE = 1;
1720 ROLLBACK_SUCCESS = 2;
1721 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001722 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001723 }
1724 optional RollbackType rollback_type = 1;
1725
1726 optional string package_name = 2;
1727
1728 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001729
1730 enum RollbackReasonType {
1731 REASON_UNKNOWN = 0;
1732 REASON_NATIVE_CRASH = 1;
1733 REASON_EXPLICIT_HEALTH_CHECK = 2;
1734 REASON_APP_CRASH = 3;
1735 REASON_APP_NOT_RESPONDING = 4;
1736 }
1737 optional RollbackReasonType rollback_reason = 4;
1738
1739 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1740 // is initiated. Empty if the package is unknown.
1741 optional string failing_package_name = 5;
Howard Roe103fe22019-01-17 16:52:16 -08001742}
1743
Jack Hec27040a2019-01-09 20:54:41 -08001744/**
1745 * Logs when there is a change in Bluetooth A2DP playback state
1746 *
1747 * Logged from:
1748 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1749 */
1750message BluetoothA2dpPlaybackStateChanged {
1751 // An identifier that can be used to match events for this device.
1752 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1753 // Salt: Randomly generated 256 bit value
1754 // Hash algorithm: HMAC-SHA256
1755 // Size: 32 byte
1756 // Default: null or empty if the device identifier is not known
1757 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1758 // Current playback state
1759 // Default: PLAYBACK_STATE_UNKNOWN
1760 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1761 // Current audio coding mode
1762 // Default: AUDIO_CODING_MODE_UNKNOWN
1763 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1764}
1765
1766/**
1767 * Logs when there is a change in A2DP codec config for a particular remote device
1768 *
1769 * Logged from:
1770 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1771 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1772 */
1773message BluetoothA2dpCodecConfigChanged {
1774 // An identifier that can be used to match events for this device.
1775 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1776 // Salt: Randomly generated 256 bit value
1777 // Hash algorithm: HMAC-SHA256
1778 // Size: 32 byte
1779 // Default: null or empty if the device identifier is not known
1780 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1781 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1782 // Default SOURCE_CODEC_TYPE_INVALID
1783 optional int32 codec_type = 2;
1784 // Codec priroity, the higher the more preferred, -1 for disabled
1785 // Default: CODEC_PRIORITY_DEFAULT
1786 optional int32 codec_priority = 3;
1787 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1788 // Default: SAMPLE_RATE_NONE
1789 optional int32 sample_rate = 4;
1790 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1791 // Default: BITS_PER_SAMPLE_NONE
1792 optional int32 bits_per_sample = 5;
1793 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1794 // Default: CHANNEL_MODE_NONE
1795 optional int32 channel_mode = 6;
1796 // Codec specific values
1797 // Default 0
1798 optional int64 codec_specific_1 = 7;
1799 optional int64 codec_specific_2 = 8;
1800 optional int64 codec_specific_3 = 9;
1801 optional int64 codec_specific_4 = 10;
1802}
1803
1804/**
1805 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1806 * Each codec's capability is logged separately due to statsd restriction
1807 *
1808 * Logged from:
1809 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1810 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1811 */
1812message BluetoothA2dpCodecCapabilityChanged {
1813 // An identifier that can be used to match events for this device.
1814 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1815 // Salt: Randomly generated 256 bit value
1816 // Hash algorithm: HMAC-SHA256
1817 // Size: 32 byte
1818 // Default: null or empty if the device identifier is not known
1819 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1820 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1821 // Default SOURCE_CODEC_TYPE_INVALID
1822 optional int32 codec_type = 2;
1823 // Codec priroity, the higher the more preferred, -1 for disabled
1824 // Default: CODEC_PRIORITY_DEFAULT
1825 optional int32 codec_priority = 3;
1826 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1827 // in BluetoothCodecConfig
1828 // Default: empty and SAMPLE_RATE_NONE for individual item
1829 optional int32 sample_rate = 4;
1830 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1831 // in BluetoothCodecConfig
1832 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1833 optional int32 bits_per_sample = 5;
1834 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1835 // BluetoothCodecConfig
1836 // Default: empty and CHANNEL_MODE_NONE for individual item
1837 optional int32 channel_mode = 6;
1838 // Codec specific values
1839 // Default 0
1840 optional int64 codec_specific_1 = 7;
1841 optional int64 codec_specific_2 = 8;
1842 optional int64 codec_specific_3 = 9;
1843 optional int64 codec_specific_4 = 10;
1844}
1845
1846/**
1847 * Logs when A2DP failed to read from PCM source.
1848 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1849 *
1850 * Logged from:
1851 * system/bt
1852 */
1853message BluetoothA2dpAudioUnderrunReported {
1854 // An identifier that can be used to match events for this device.
1855 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1856 // Salt: Randomly generated 256 bit value
1857 // Hash algorithm: HMAC-SHA256
1858 // Size: 32 byte
1859 // Default: null or empty if the device identifier is not known
1860 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1861 // Encoding interval in nanoseconds
1862 // Default: 0
1863 optional int64 encoding_interval_nanos = 2;
1864 // Number of bytes of PCM data that could not be read from the source
1865 // Default: 0
1866 optional int32 num_missing_pcm_bytes = 3;
1867}
1868
1869/**
1870 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1871 * buffer queue is full and we have to drop data
1872 *
1873 * Logged from:
1874 * system/bt
1875 */
1876message BluetoothA2dpAudioOverrunReported {
1877 // An identifier that can be used to match events for this device.
1878 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1879 // Salt: Randomly generated 256 bit value
1880 // Hash algorithm: HMAC-SHA256
1881 // Size: 32 byte
1882 // Default: null or empty if the device identifier is not known
1883 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1884 // Encoding interval in nanoseconds
1885 // Default: 0
1886 optional int64 encoding_interval_nanos = 2;
1887 // Number of buffers dropped in this event
1888 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1889 // Default: 0
1890 optional int32 num_dropped_buffers = 3;
1891 // Number of encoded buffers dropped in this event
1892 // Default 0
1893 optional int32 num_dropped_encoded_frames = 4;
1894 // Number of encoded bytes dropped in this event
1895 // Default: 0
1896 optional int32 num_dropped_encoded_bytes = 5;
1897}
1898
1899/**
1900 * Logs when we receive reports regarding a device's RSSI value
1901 *
1902 * Logged from:
1903 * system/bt
1904 */
1905message BluetoothDeviceRssiReported {
1906 // An identifier that can be used to match events for this device.
1907 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1908 // Salt: Randomly generated 256 bit value
1909 // Hash algorithm: HMAC-SHA256
1910 // Size: 32 byte
1911 // Default: null or empty if the device identifier is not known
1912 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1913 // Connection handle of this connection if available
1914 // Range: 0x0000 - 0x0EFF (12 bits)
1915 // Default: 0xFFFF if the handle is unknown
1916 optional int32 connection_handle = 2;
1917 // HCI command status code if this is triggerred by hci_cmd
1918 // Default: STATUS_UNKNOWN
1919 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1920 // BR/EDR
1921 // Range: -128 ≤ N ≤ 127 (signed integer)
1922 // Units: dB
1923 // LE:
1924 // Range: -127 to 20, 127 (signed integer)
1925 // Units: dBm
1926 // Invalid when an out of range value is reported
1927 optional int32 rssi = 4;
1928}
1929
1930/**
1931 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1932 *
1933 * Logged from:
1934 * system/bt
1935 */
1936message BluetoothDeviceFailedContactCounterReported {
1937 // An identifier that can be used to match events for this device.
1938 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1939 // Salt: Randomly generated 256 bit value
1940 // Hash algorithm: HMAC-SHA256
1941 // Size: 32 byte
1942 // Default: null or empty if the device identifier is not known
1943 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1944 // Connection handle of this connection if available
1945 // Range: 0x0000 - 0x0EFF (12 bits)
1946 // Default: 0xFFFF if the handle is unknown
1947 optional int32 connection_handle = 2;
1948 // HCI command status code if this is triggerred by hci_cmd
1949 // Default: STATUS_UNKNOWN
1950 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1951 // Number of consecutive failed contacts for a connection corresponding to the Handle
1952 // Range: uint16_t, 0-0xFFFF
1953 // Default: 0xFFFFF
1954 optional int32 failed_contact_counter = 4;
1955}
1956
1957/**
1958 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1959 *
1960 * Logged from:
1961 * system/bt
1962 */
1963message BluetoothDeviceTxPowerLevelReported {
1964 // An identifier that can be used to match events for this device.
1965 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1966 // Salt: Randomly generated 256 bit value
1967 // Hash algorithm: HMAC-SHA256
1968 // Size: 32 byte
1969 // Default: null or empty if the device identifier is not known
1970 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1971 // Connection handle of this connection if available
1972 // Range: 0x0000 - 0x0EFF (12 bits)
1973 // Default: 0xFFFF if the handle is unknown
1974 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001975 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001976 // Default: STATUS_UNKNOWN
1977 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1978 // Range: -30 ≤ N ≤ 20
1979 // Units: dBm
1980 // Invalid when an out of range value is reported
1981 optional int32 transmit_power_level = 4;
1982}
Jack Heab86dbd22018-12-18 15:43:27 -08001983
Tej Singh5d991e12018-03-09 19:48:11 -08001984/**
Jack He1021a612019-01-20 21:22:46 -08001985 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1986 * receiving an HCI command from the host
1987 *
1988 * Logged from: system/bt
1989 */
1990message BluetoothHciTimeoutReported {
1991 // HCI command associated with this event
1992 // Default: CMD_UNKNOWN
1993 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1994}
1995
1996/**
1997 * Logs when we receive Bluetooth Link Quality Report event from the controller
1998 * See Android Bluetooth HCI specification for more details
1999 *
2000 * Note: all count and bytes field are counted since last event
2001 *
2002 * Logged from: system/bt
2003 */
2004message BluetoothQualityReportReported {
2005 // Quality report ID
2006 // Original type: uint8_t
2007 // Default: BQR_ID_UNKNOWN
2008 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2009 // Packet type of the connection
2010 // Original type: uint8_t
2011 // Default: BQR_PACKET_TYPE_UNKNOWN
2012 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2013 // Connection handle of the connection
2014 // Original type: uint16_t
2015 optional int32 connection_handle = 3;
2016 // Performing Role for the connection
2017 // Original type: uint8_t
2018 optional int32 connection_role = 4;
2019 // Current Transmit Power Level for the connection. This value is the same as the controller's
2020 // response to the HCI_Read_Transmit_Power_Level HCI command
2021 // Original type: uint8_t
2022 optional int32 tx_power_level = 5;
2023 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2024 // absolute receiver signal strength value
2025 // Original type: int8_t
2026 optional int32 rssi = 6;
2027 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2028 // channels used by the link currently
2029 // Original type: uint8_t
2030 optional int32 snr = 7;
2031 // Indicates the number of unused channels in AFH_channel_map
2032 // Original type: uint8_t
2033 optional int32 unused_afh_channel_count = 8;
2034 // Indicates the number of the channels which are interfered and quality is bad but are still
2035 // selected for AFH
2036 // Original type: uint8_t
2037 optional int32 afh_select_unideal_channel_count = 9;
2038 // Current Link Supervision Timeout Setting
2039 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2040 // Original type: uint16_t
2041 optional int32 lsto = 10;
2042 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2043 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2044 // 0x01 (Piconet Clock)
2045 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2046 // Original type: uint32_t
2047 optional int64 connection_piconet_clock = 11;
2048 // The count of retransmission
2049 // Original type: uint32_t
2050 optional int64 retransmission_count = 12;
2051 // The count of no RX
2052 // Original type: uint32_t
2053 optional int64 no_rx_count = 13;
2054 // The count of NAK (Negative Acknowledge)
2055 // Original type: uint32_t
2056 optional int64 nak_count = 14;
2057 // Controller timestamp of last TX ACK
2058 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2059 // Original type: uint32_t
2060 optional int64 last_tx_ack_timestamp = 15;
2061 // The count of Flow-off (STOP)
2062 // Original type: uint32_t
2063 optional int64 flow_off_count = 16;
2064 // Controller timestamp of last Flow-on (GO)
2065 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2066 // Original type: uint32_t
2067 optional int64 last_flow_on_timestamp = 17;
2068 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2069 // Original type: uint32_t
2070 optional int64 buffer_overflow_bytes = 18;
2071 // Buffer underflow count (in byte) since last event
2072 // Original type: uint32_t
2073 optional int64 buffer_underflow_bytes = 19;
2074}
2075
2076/**
2077 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2078 *
2079 * Notes:
2080 * - Each event can be partially filled as we might learn different pieces of device
2081 * information at different time
2082 * - Multiple device info events can be combined to give more complete picture
2083 * - When multiple device info events tries to describe the same information, the
2084 * later one wins
2085 *
2086 * Logged from:
2087 * packages/apps/Bluetooth
2088 */
Jack Heaea26982019-04-04 11:19:48 -07002089message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002090 // An identifier that can be used to match events for this device.
2091 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2092 // Salt: Randomly generated 256 bit value
2093 // Hash algorithm: HMAC-SHA256
2094 // Size: 32 byte
2095 // Default: null or empty if the device identifier is not known
2096 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2097 // Where is this device info obtained from
2098 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2099 // Name of the data source
2100 // For EXTERNAL: package name of the data source
2101 // For INTERNAL: null for general case, component name otherwise
2102 optional string source_name = 3;
2103 // Name of the manufacturer of this device
2104 optional string manufacturer = 4;
2105 // Model of this device
2106 optional string model = 5;
2107 // Hardware version of this device
2108 optional string hardware_version = 6;
2109 // Software version of this device
2110 optional string software_version = 7;
2111}
2112
2113/**
2114 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2115 * device, as documented by the Bluetooth Core HCI specification
2116 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2117 * Vol 2, Part E, Page 1118
2118 *
2119 * Logged from:
2120 * system/bt
2121 */
2122message BluetoothRemoteVersionInfoReported {
2123 // Connection handle of the connection
2124 // Original type: uint16_t
2125 optional int32 connection_handle = 1;
2126 // HCI command status code
2127 // Default: STATUS_UNKNOWN
2128 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2129 // 1 byte Version of current LMP in the remote controller
2130 optional int32 lmp_version = 3;
2131 // 2 bytes LMP manufacturer code of the remote controller
2132 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2133 optional int32 lmp_manufacturer_code = 4;
2134 // 4 bytes subversion of the LMP in the remote controller
2135 optional int32 lmp_subversion = 5;
2136}
2137
2138/**
2139 * Logs when certain Bluetooth SDP attributes are discovered
2140 * Constant definitions are from:
2141 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2142 *
2143 * Current logged attributes:
2144 * - BluetoothProfileDescriptorList
2145 * - Supported Features Bitmask
2146 *
2147 * Logged from:
2148 * system/bt
2149 */
2150message BluetoothSdpAttributeReported {
2151 // An identifier that can be used to match events for this device.
2152 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2153 // Salt: Randomly generated 256 bit value
2154 // Hash algorithm: HMAC-SHA256
2155 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2156 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2157 // Original type: uint16_t
2158 optional int32 protocol_uuid = 2;
2159 // Short form UUIDs used to identify Bluetooth SDP attribute types
2160 // Original type: uint16_t
2161 optional int32 attribute_id = 3;
2162 // Attribute value for the particular attribute
2163 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2164}
2165
2166/**
2167 * Logs when bond state of a Bluetooth device changes
2168 *
2169 * Logged from:
2170 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2171 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2172 */
2173message BluetoothBondStateChanged {
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 // Preferred transport type to remote dual mode device
2182 // Default: TRANSPORT_AUTO means no preference
2183 optional android.bluetooth.TransportTypeEnum transport = 2;
2184 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2185 // Default: UNKNOWN
2186 optional android.bluetooth.DeviceTypeEnum type = 3;
2187 // Current bond state (NONE, BONDING, BONDED)
2188 // Default: BOND_STATE_UNKNOWN
2189 optional android.bluetooth.BondStateEnum bond_state = 4;
2190 // Bonding sub state
2191 // Default: BOND_SUB_STATE_UNKNOWN
2192 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2193 // Unbond Reason
2194 // Default: UNBOND_REASON_UNKNOWN
2195 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2196}
2197
2198/**
2199 * Logs there is an event related Bluetooth classic pairing
2200 *
2201 * Logged from:
2202 * system/bt
2203 */
2204message BluetoothClassicPairingEventReported {
2205 // An identifier that can be used to match events for this device.
2206 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2207 // Salt: Randomly generated 256 bit value
2208 // Hash algorithm: HMAC-SHA256
2209 // Size: 32 byte
2210 // Default: null or empty if the device identifier is not known
2211 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2212 // Connection handle of this connection if available
2213 // Range: 0x0000 - 0x0EFF (12 bits)
2214 // Default: 0xFFFF if the handle is unknown
2215 optional int32 connection_handle = 2;
2216 // HCI command associated with this event
2217 // Default: CMD_UNKNOWN
2218 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2219 // HCI event associated with this event
2220 // Default: EVT_UNKNOWN
2221 optional android.bluetooth.hci.EventEnum hci_event = 4;
2222 // HCI command status code if this is triggerred by hci_cmd
2223 // Default: STATUS_UNKNOWN
2224 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2225 // HCI reason code associated with this event
2226 // Default: STATUS_UNKNOWN
2227 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002228 // A status value related to this specific event
2229 // Default: 0
2230 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002231}
2232
2233/**
2234 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2235 *
2236 * Logged from:
2237 * system/bt
2238 */
2239message BluetoothSmpPairingEventReported {
2240 // An identifier that can be used to match events for this device.
2241 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2242 // Salt: Randomly generated 256 bit value
2243 // Hash algorithm: HMAC-SHA256
2244 // Size: 32 byte
2245 // Default: null or empty if the device identifier is not known
2246 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2247 // SMP command sent or received over L2CAP
2248 // Default: CMD_UNKNOWN
2249 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2250 // Whether this command is sent or received
2251 // Default: DIRECTION_UNKNOWN
2252 optional android.bluetooth.DirectionEnum direction = 3;
2253 // SMP failure reason code
2254 // Default: PAIRING_FAIL_REASON_DEFAULT
2255 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2256}
2257
2258/**
Jack He815cdba2019-01-30 17:24:55 -08002259 * Logs when a Bluetooth socket’s connection state changed
2260 *
2261 * Logged from:
2262 * system/bt
2263 */
2264message BluetoothSocketConnectionStateChanged {
2265 // An identifier that can be used to match events for this device.
2266 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2267 // Salt: Randomly generated 256 bit value
2268 // Hash algorithm: HMAC-SHA256
2269 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002270 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002271 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002272 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002273 // Default 0 when unknown or don't care
2274 optional int32 port = 2;
2275 // Socket type as mentioned in
2276 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2277 // Default: SOCKET_TYPE_UNKNOWN
2278 optional android.bluetooth.SocketTypeEnum type = 3;
2279 // Socket connection state
2280 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2281 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2282 // Number of bytes sent to remote device during this connection
2283 optional int64 tx_bytes = 5;
2284 // Number of bytes received from remote device during this connection
2285 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002286 // Socket owner's UID
2287 optional int32 uid = 7 [(is_uid) = true];
2288 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2289 // |port| must be spawned by |server_port|
2290 // Default 0 when unknown or don't care
2291 optional int32 server_port = 8;
2292 // Whether this is a server listener socket
2293 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002294}
2295
2296/**
Jack He71426802019-04-02 13:32:52 -07002297 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2298 *
2299 * Logged from:
2300 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2301 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2302 *
2303 */
2304message BluetoothClassOfDeviceReported {
2305 // An identifier that can be used to match events for this device.
2306 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2307 // Salt: Randomly generated 256 bit value
2308 // Hash algorithm: HMAC-SHA256
2309 // Size: 32 byte
2310 // Default: null or empty if this is a server listener socket
2311 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2312 // Class of Device (CoD) value including both Major, Minor device class and service class
2313 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2314 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2315 // Default: 0
2316 optional int32 class_of_device = 2;
2317}
2318
2319/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002320 * Logs when something is plugged into or removed from the USB-C connector.
2321 *
2322 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002323 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002324 */
2325message UsbConnectorStateChanged {
2326 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002327 STATE_DISCONNECTED = 0;
2328 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002329 }
2330 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002331 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002332 // Last active session in ms.
2333 // 0 when the port is in connected state.
2334 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002335}
2336
2337/**
2338 * Logs the reported speaker impedance.
2339 *
2340 * Logged from:
2341 * Vendor audio implementation.
2342 */
2343message SpeakerImpedanceReported {
2344 optional int32 speaker_location = 1;
2345 optional int32 impedance = 2;
2346}
2347
2348/**
2349 * Logs the report of a failed hardware.
2350 *
2351 * Logged from:
2352 * Vendor HALs.
2353 *
2354 */
2355message HardwareFailed {
2356 enum HardwareType {
2357 HARDWARE_FAILED_UNKNOWN = 0;
2358 HARDWARE_FAILED_MICROPHONE = 1;
2359 HARDWARE_FAILED_CODEC = 2;
2360 HARDWARE_FAILED_SPEAKER = 3;
2361 HARDWARE_FAILED_FINGERPRINT = 4;
2362 }
2363 optional HardwareType hardware_type = 1;
2364
Maggie White6dcd8572019-01-31 14:11:50 -08002365 /**
2366 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002367 * the same hardware_type. The specific locations are vendor defined integers,
2368 * referring to board-specific numbering schemes.
2369 */
2370 optional int32 hardware_location = 2;
2371
Maggie White6dcd8572019-01-31 14:11:50 -08002372 /**
2373 * failure_code is specific to the HardwareType of the failed hardware.
2374 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002375 */
Maggie White6dcd8572019-01-31 14:11:50 -08002376 enum HardwareErrorCode {
2377 UNKNOWN = 0;
2378 COMPLETE = 1;
2379 SPEAKER_HIGH_Z = 2;
2380 SPEAKER_SHORT = 3;
2381 FINGERPRINT_SENSOR_BROKEN = 4;
2382 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002383 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002384 }
2385 optional int32 failure_code = 3;
2386}
2387
2388/**
2389 * Log an event when the device has been physically dropped.
2390 * Reported from the /vendor partition.
2391 */
2392message PhysicalDropDetected {
2393 // Confidence that the event was actually a drop, 0 -> 100
2394 optional int32 confidence_pctg = 1;
2395 // Peak acceleration of the drop, in 1/1000s of a g.
2396 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002397 // Duration of freefall in ms
2398 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002399}
2400
2401/**
2402 * Log bucketed battery charge cycles.
2403 *
2404 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002405 * a given charge point. For example, if 10 cycle buckets are
2406 * initialized, bucket 1 is the lowest 1/10th of the battery,
2407 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002408 *
2409 * Logged from:
2410 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2411 */
2412message ChargeCyclesReported {
2413 optional int32 cycle_bucket_1 = 1;
2414 optional int32 cycle_bucket_2 = 2;
2415 optional int32 cycle_bucket_3 = 3;
2416 optional int32 cycle_bucket_4 = 4;
2417 optional int32 cycle_bucket_5 = 5;
2418 optional int32 cycle_bucket_6 = 6;
2419 optional int32 cycle_bucket_7 = 7;
2420 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002421 optional int32 cycle_bucket_9 = 9;
2422 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002423}
2424
2425/**
Howard Roa46b6582018-09-18 16:45:02 -07002426 * Log battery health snapshot.
2427 *
2428 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2429 * are snapshotted periodically over 24hrs.
2430 */
2431message BatteryHealthSnapshot {
2432 enum BatterySnapshotType {
2433 UNKNOWN = 0;
2434 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2435 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2436 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2437 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2438 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2439 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2440 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2441 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2442 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2443 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2444 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2445 }
2446 optional BatterySnapshotType type = 1;
2447 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002448 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002449 // Voltage Battery Voltage, in microVolts.
2450 optional int32 voltage_micro_volt = 3;
2451 // Current Battery current, in microAmps.
2452 optional int32 current_micro_amps = 4;
2453 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2454 optional int32 open_circuit_micro_volt = 5;
2455 // Resistance Battery Resistance, in microOhms.
2456 optional int32 resistance_micro_ohm = 6;
2457 // Level Battery Level, as % of full.
2458 optional int32 level_percent = 7;
2459}
2460
2461/**
2462 * Log slow I/O operations on the primary storage.
2463 */
2464message SlowIo {
2465 // Classifications of IO Operations.
2466 enum IoOperation {
2467 UNKNOWN = 0;
2468 READ = 1;
2469 WRITE = 2;
2470 UNMAP = 3;
2471 SYNC = 4;
2472 }
2473 optional IoOperation operation = 1;
2474
2475 // The number of slow IO operations of this type over 24 hours.
2476 optional int32 count = 2;
2477}
2478
2479/**
2480 * Log battery caused shutdown with the last recorded voltage.
2481 */
2482message BatteryCausedShutdown {
2483 // The last recorded battery voltage prior to shutdown.
2484 optional int32 last_recorded_micro_volt = 1;
2485}
2486
2487/**
Tej Singha72344992019-04-17 18:55:08 -07002488 * Logs when ThermalService receives throttling events.
2489 *
2490 * Logged from:
2491 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2492 */
2493message ThermalThrottlingSeverityStateChanged {
2494 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2495 optional android.os.TemperatureTypeEnum sensor_type = 1;
2496
2497 // The name of the temperature source. Eg. CPU0
2498 optional string sensor_name = 2;
2499
2500 // Temperature in tenths of a degree C.
2501 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2502 optional int32 temperature_deci_celsius = 3;
2503
2504 // Relative severity of the throttling, see enum definition.
2505 optional android.os.ThrottlingSeverityEnum severity = 4;
2506}
2507
2508/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002509 * Logs the duration of a davey (jank of >=700ms) when it occurs
2510 *
2511 * Logged from:
2512 * frameworks/base/libs/hwui/JankTracker.cpp
2513 */
2514message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002515 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002516 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002517
Tej Singhbb8554a2018-01-26 11:59:14 -08002518 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002519 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002520}
2521
2522/**
Bookatze5885242017-10-24 20:10:31 -07002523 * Logs phone signal strength changes.
2524 *
2525 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002526 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002527 */
2528message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002529 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2530 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002531}
2532
Yangster4ccebea2018-10-09 17:09:02 -07002533
2534/**
2535 * Logs when the phone state, sim state or signal strength changes
2536 *
2537 * Logged from:
2538 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2539 */
2540message PhoneServiceStateChanged {
2541 optional android.telephony.ServiceStateEnum state = 1;
2542 optional android.telephony.SimStateEnum sim_state = 2;
2543 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2544}
2545
2546/**
2547 * Logs when the phone becomes on or off.
2548 *
2549 * Logged from:
2550 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2551 */
2552message PhoneStateChanged {
2553 enum State {
2554 OFF = 0;
2555 ON = 1;
2556 }
2557 optional State state = 1;
2558}
2559
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002560message BackGesture {
2561 enum BackType {
2562 DEFAULT_BACK_TYPE = 0;
2563 COMPLETED = 1;
2564 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2565 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2566 INCOMPLETE = 4;
2567 }
2568 optional BackType type = 1;
2569
2570 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2571 enum WindowHorizontalLocation {
2572 DEFAULT_LOCATION = 0;
2573 LEFT = 1;
2574 RIGHT = 2;
2575 }
2576 optional WindowHorizontalLocation x_location = 3;
2577}
2578
2579message ExclusionRectStateChanged {
2580 optional string component_name = 1; // if not available, simply packageName
2581 optional int32 requested_height = 2; // px
2582 optional int32 rejected_height = 3; // px
2583
2584 enum WindowHorizontalLocation {
2585 DEFAULT_LOCATION = 0;
2586 LEFT = 1;
2587 RIGHT = 2;
2588 }
2589 optional WindowHorizontalLocation x_location = 4;
2590 optional bool landscape = 5;
2591 optional bool splitscreen = 6;
2592 optional int32 duration_millis = 7;
2593}
2594
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002595message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002596 optional android.stats.launcher.LauncherAction action = 1;
2597 optional android.stats.launcher.LauncherState src_state = 2;
2598 optional android.stats.launcher.LauncherState dst_state = 3;
2599 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002600 optional bool is_swipe_up_enabled = 5;
2601}
2602
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002603message StyleUIChanged {
2604 optional android.stats.style.Action action = 1;
2605 optional int32 color_package_hash = 2;
2606 optional int32 font_package_hash = 3;
2607 optional int32 shape_package_hash = 4;
2608 optional int32 clock_package_hash = 5;
2609 optional int32 launcher_grid = 6;
2610 optional int32 wallpaper_category_hash = 7;
2611 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002612 optional int32 color_preference = 9;
2613 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002614}
2615
David Chenc28b2bb2017-10-24 12:52:52 -07002616/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002617 * Logs when Settings UI has changed.
2618 *
2619 * Logged from:
2620 * packages/apps/Settings
2621 */
2622message SettingsUIChanged {
2623 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002624 * Where this SettingsUIChange event comes from. For example, if
2625 * it's a PAGE_VISIBLE event, where the page is opened from.
2626 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002627 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002628
2629 /**
2630 * What the UI action is.
2631 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002632 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002633
2634 /**
2635 * Where the action is happening
2636 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002637 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002638
2639 /**
2640 * What preference changed in this event.
2641 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002642 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002643
2644 /**
2645 * The new value of the changed preference.
2646 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002647 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002648}
2649
2650/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002651 * Logs basic timing information about touch events.
2652 * Reported at most every 5 minutes while device is being interacted with.
2653 *
2654 * Logged from:
2655 * frameworks/native/services/inputflinger
2656 */
2657message TouchEventReported {
2658 /**
2659 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002660 * and the standard deviation of the time spent processing touchscreen events
2661 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002662 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002663 * On supported devices, the starting point is taken during the hard interrupt inside the
2664 * kernel touch driver. On all other devices, the starting point is taken inside
2665 * the kernel's input event subsystem upon receipt of the input event.
2666 * The ending point is taken inside InputDispatcher, just after the input event
2667 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002668 */
2669 // Minimum value
2670 optional float latency_min_micros = 1;
2671 // Maximum value
2672 optional float latency_max_micros = 2;
2673 // Average value
2674 optional float latency_mean_micros = 3;
2675 // Standard deviation
2676 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002677 // Number of touch events (input_event) in this report
2678 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002679}
2680
2681/**
Philip Quinn0eded622019-01-29 12:46:28 -08002682 * Logs gesture classification and timing information for touch events.
2683 *
2684 * Logged from:
2685 * frameworks/base/core/java/android/view/GestureDetector.java
2686 * frameworks/base/core/java/android/view/View.java
2687 */
2688message TouchGestureClassified {
2689 // The source of the classification (e.g. Java class name).
2690 optional string source = 1;
2691
2692 enum Classification {
2693 UNKNOWN_CLASSIFICATION = 0;
2694 SINGLE_TAP = 1;
2695 DOUBLE_TAP = 2;
2696 LONG_PRESS = 3;
2697 DEEP_PRESS = 4;
2698 SCROLL = 5;
2699 }
2700 // The classification of the gesture.
2701 optional Classification classification = 2;
2702
2703 // The interval from the start of a touch event stream until the
2704 // classification was made.
2705 optional int32 latency_millis = 3;
2706
2707 // The distance from the location of the first touch event to the
2708 // location of the touch event when the classification was made.
2709 optional float displacement_px = 4;
2710}
2711
2712/**
David Chenc28b2bb2017-10-24 12:52:52 -07002713 * Logs that a setting was updated.
2714 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002715 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002716 * The tag and is_default allow resetting of settings to default values based on the specified
2717 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2718 */
2719message SettingChanged {
2720 // The name of the setting.
2721 optional string setting = 1;
2722
2723 // The change being imposed on this setting. May represent a number, eg "3".
2724 optional string value = 2;
2725
2726 // The new value of this setting. For most settings, this is same as value. For some settings,
2727 // value is +X or -X where X represents an element in a set. For example, if the previous value
2728 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2729 // The +/- feature is currently only used for location_providers_allowed.
2730 optional string new_value = 3;
2731
2732 // The previous value of this setting.
2733 optional string prev_value = 4;
2734
2735 // The tag used with the is_default for resetting sets of settings. This is generally null.
2736 optional string tag = 5;
2737
Bookatz90867622018-01-31 15:05:57 -08002738 // True if this setting with tag should be resettable.
2739 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002740
David Chenbd789912018-03-16 17:19:55 -07002741 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002742 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002743
2744 enum ChangeReason {
2745 UPDATED = 1; // Updated can be an insertion or an update.
2746 DELETED = 2;
2747 }
2748 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002749}
Chenjie Yub3dda412017-10-24 13:41:59 -07002750
Chenjie Yu05013b32017-11-21 10:21:41 -08002751/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002752 * Logs activity going to foreground or background
2753 *
2754 * Logged from:
2755 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2756 */
2757message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002758 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002759 optional string pkg_name = 2;
2760 optional string class_name = 3;
2761
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002762 enum State {
2763 BACKGROUND = 0;
2764 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002765 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002766 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002767}
David Chenc8a43242017-10-17 16:23:28 -07002768
2769/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002770 * Logs when a volume entered low Storage state.
2771 * Logged from:
2772 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2773 */
2774message LowStorageStateChanged {
2775 // Volume that ran out of storage.
2776 optional string volume_description = 1;
2777
2778 enum State {
2779 UNKNOWN = 0;
2780 OFF = 1;
2781 ON = 2;
2782 }
2783 optional State state = 2;
2784}
2785
2786/**
2787 * Logs when an app is downgraded.
2788 * Logged from:
2789 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2790 */
2791message AppDowngraded {
2792 optional string package_name = 1;
2793 // Size of the package (all data) before being downgraded.
2794 optional int64 size_in_bytes_before = 2;
2795 // Size of the package (all data) after being downgraded.
2796 optional int64 size_in_bytes_after = 3;
2797
2798 optional bool aggressive = 4;
2799}
2800
2801/**
2802 * Logs when an app is optimized after being downgraded.
2803 * Logged from:
2804 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2805 */
2806message AppOptimizedAfterDowngraded {
2807 optional string package_name = 1;
2808}
2809
2810/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002811 * Logs whenever an app is installed on external storage.
2812 * Logged from:
2813 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2814 */
2815message AppInstallOnExternalStorageReported {
2816 // The type of external storage.
2817 optional android.stats.storage.ExternalStorageType storage_type = 1;
2818 // The name of the package that is installed on the sd card.
2819 optional string package_name = 2;
2820}
2821
2822/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002823 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002824 * Logged from:
2825 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2826 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002827message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002828 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002829
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002830 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002831
2832 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002833 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002834 optional string process_name = 3;
2835
2836 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002837 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002838
2839 optional string package_name = 5;
2840
2841 enum InstantApp {
2842 UNAVAILABLE = 0;
2843 FALSE = 1;
2844 TRUE = 2;
2845 }
2846 optional InstantApp is_instant_app = 6;
2847
2848 enum ForegroundState {
2849 UNKNOWN = 0;
2850 BACKGROUND = 1;
2851 FOREGROUND = 2;
2852 }
2853 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002854
2855 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002856}
David Chen9e3808c2017-11-20 17:25:34 -08002857
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002858/**
2859 * Logs when a WTF (What a Terrible Failure) happened.
2860 * Logged from:
2861 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2862 */
2863message WTFOccurred {
2864 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002865
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002866 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002867
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002868 // The name of the process.
2869 // system_server if it is not by an app
2870 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002871
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002872 // The pid if available. -1 means not available.
2873 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002874
2875 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002876}
2877
2878/**
2879 * Logs when system server reports low memory.
2880 * Logged from:
2881 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2882 */
2883message LowMemReported {
2884}
2885
2886/**
2887 * Logs when an app ANR (App Not Responding) occurs.
2888 * Logged from:
2889 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2890 */
2891message ANROccurred {
2892 optional int32 uid = 1 [(is_uid) = true];
2893
2894 optional string process_name = 2;
2895
2896 optional string short_component_name = 3;
2897
2898 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002899
2900 enum InstantApp {
2901 UNAVAILABLE = 0;
2902 FALSE = 1;
2903 TRUE = 2;
2904 }
2905 optional InstantApp is_instant_app = 5;
2906
2907 enum ForegroundState {
2908 UNKNOWN = 0;
2909 BACKGROUND = 1;
2910 FOREGROUND = 2;
2911 }
2912 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002913
2914 optional android.server.ErrorSource error_source = 7;
2915
2916 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002917}
2918
Bookatza7020bd2018-08-28 16:29:35 -07002919/**
2920 * Logs when the vibrator state changes.
2921 * Logged from:
2922 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2923 */
2924message VibratorStateChanged {
2925 repeated AttributionNode attribution_node = 1;
2926
2927 enum State {
2928 OFF = 0;
2929 ON = 1;
2930 }
2931 optional State state = 2;
2932
2933 // Duration (in milliseconds) requested to keep the vibrator on.
2934 // Only applicable for State == ON.
2935 optional int64 duration_millis = 3;
2936}
2937
David Chen0a368b22017-12-06 16:28:16 -08002938/*
2939 * Allows other apps to push events into statsd.
2940 * Logged from:
2941 * frameworks/base/core/java/android/util/StatsLog.java
2942 */
David Chen0b5c90c2018-01-25 16:51:49 -08002943message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002944 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002945 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002946
2947 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2948 optional int32 label = 2;
2949
2950 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2951 // predicates for the metrics).
2952 enum State {
2953 UNKNOWN = 0;
2954 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2955 STOP = 2;
2956 START = 3;
2957 }
2958 optional State state = 3;
2959}
2960
David Chen9e3808c2017-11-20 17:25:34 -08002961/**
Bookatz7948c872018-09-04 12:58:33 -07002962 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2963 * For example, this could be due to the user manually changing the time.
2964 *
2965 * Logged from:
2966 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2967 */
2968message WallClockTimeShifted {
2969 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2970 optional int64 wall_clock_timestamp_millis = 1;
2971}
2972
2973/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002974 * Logs when statsd detects an anomaly.
2975 *
2976 * Logged from:
2977 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2978 */
2979message AnomalyDetected {
2980 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002981 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002982
Yangster-mac94e197c2018-01-02 16:03:03 -08002983 // Id of the config whose anomaly detection alert fired.
2984 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002985
Yangster-mac94e197c2018-01-02 16:03:03 -08002986 // Id of the alert (i.e. name of the anomaly that was detected).
2987 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002988}
2989
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002990message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002991 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002992 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002993
2994 // The app package name.
2995 optional string pkg_name = 2;
2996
2997 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002998 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002999 WARM = 1;
3000 HOT = 2;
3001 COLD = 3;
3002 }
3003 // The transition type.
3004 optional TransitionType type = 3;
3005
3006 // The activity name.
3007 optional string activity_name = 4;
3008
3009 // The name of the calling app. Empty if not set.
3010 optional string calling_pkg_name = 5;
3011
3012 // Whether the app is an instant app.
3013 optional bool is_instant_app = 6;
3014
3015 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003016 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003017
Bookatz80d11a02018-01-16 10:46:35 -08003018 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003019
David Chen0b5c90c2018-01-25 16:51:49 -08003020 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003021 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003022 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003023 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003024 optional int32 bind_application_delay_millis = 11;
3025 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003026
3027 // Empty if not set.
3028 optional string launch_token = 13;
3029
Calin Juravle759fbda2018-02-20 19:52:30 +00003030 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003031 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003032
3033 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003034 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003035}
3036
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003037message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003038 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003039 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003040
3041 // The app package name.
3042 optional string pkg_name = 2;
3043
3044 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003045 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003046 WARM = 1;
3047 HOT = 2;
3048 COLD = 3;
3049 }
3050 // The transition type.
3051 optional TransitionType type = 3;
3052
3053 // The activity name.
3054 optional string activity_name = 4;
3055}
3056
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003057message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003058 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003059 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003060
3061 // The app package name.
3062 optional string pkg_name = 2;
3063
3064 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003065 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003066 WITH_BUNDLE = 1;
3067 WITHOUT_BUNDLE = 2;
3068 }
3069 // The transition type.
3070 optional TransitionType type = 3;
3071
3072 // The activity name.
3073 optional string activity_name = 4;
3074
3075 optional bool transition_process_running = 5;
3076
3077 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003078 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003079}
3080
Bookatz8fcd09a2017-12-18 13:01:10 -08003081/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003082 * Logs a picture-in-picture action
3083 * Logged from:
3084 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3085 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3086 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3087 */
3088message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003089 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003090 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003091
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003092 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003093
Chenjie Yu52cacc62017-12-08 18:11:45 -08003094 enum State {
3095 ENTERED = 1;
3096 EXPANDED_TO_FULL_SCREEN = 2;
3097 MINIMIZED = 3;
3098 DISMISSED = 4;
3099 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003100 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003101}
3102
3103/**
Chenjie Yue8904192017-12-08 19:12:57 -08003104 * Logs overlay action
3105 * Logged from:
3106 * services/core/java/com/android/server/wm/Session.java
3107 */
3108message OverlayStateChanged {
tsaichristine10978642019-09-10 14:12:49 -07003109 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003110
tsaichristine10978642019-09-10 14:12:49 -07003111 optional string package_name = 2 [(state_field_option).option = PRIMARY];
Chenjie Yue8904192017-12-08 19:12:57 -08003112
3113 optional bool using_alert_window = 3;
3114
3115 enum State {
3116 ENTERED = 1;
3117 EXITED = 2;
3118 }
tsaichristine10978642019-09-10 14:12:49 -07003119 optional State state = 4 [(state_field_option).option = EXCLUSIVE];
Chenjie Yue8904192017-12-08 19:12:57 -08003120}
3121
Chenjie Yuccfe6452018-01-30 11:33:21 -08003122/*
3123 * Logs foreground service starts and stops.
3124 * Note that this is not when a service starts or stops, but when it is
3125 * considered foreground.
3126 * Logged from
3127 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3128 */
3129message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003130 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003131 // package_name + "/" + class_name
3132 optional string short_name = 2;
3133
3134 enum State {
3135 ENTER = 1;
3136 EXIT = 2;
3137 }
3138 optional State state = 3;
3139}
3140
Chenjie Yue8904192017-12-08 19:12:57 -08003141/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003142 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3143 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3144 * attributed back to the parent (host) uid. One example is Chrome.
3145 *
3146 * Logged from:
3147 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3148 */
3149message IsolatedUidChanged {
3150 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003151 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003152 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003153 optional int32 parent_uid = 1;
3154
3155 optional int32 isolated_uid = 2;
3156
3157 // We expect an isolated uid to be removed before if it's used for another parent uid.
3158 enum Event {
3159 REMOVED = 0;
3160 CREATED = 1;
3161 }
3162 optional Event event = 3;
3163}
3164
3165/*
3166 * Logs the reception of an incoming network packet causing the main system to wake up for
3167 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3168 * and processed by WakeupController.cpp.
3169 */
3170message PacketWakeupOccurred {
3171 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3172 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003173 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003174 // The interface name on which the packet was received.
3175 optional string iface = 2;
3176 // The ethertype value of the packet.
3177 optional int32 ethertype = 3;
3178 // String representation of the destination MAC address of the packet.
3179 optional string destination_hardware_address = 4;
3180 // String representation of the source address of the packet if this was an IP packet.
3181 optional string source_ip = 5;
3182 // String representation of the destination address of the packet if this was an IP packet.
3183 optional string destination_ip = 6;
3184 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3185 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3186 // families.
3187 optional int32 ip_next_header = 7;
3188 // The source port if this was a TCP or UDP packet.
3189 optional int32 source_port = 8;
3190 // The destination port if this was a TCP or UDP packet.
3191 optional int32 destination_port = 9;
3192}
3193
3194/*
3195 * Logs the memory stats for an app on startup.
3196 * Logged from:
3197 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3198 */
3199message AppStartMemoryStateCaptured {
3200 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003201 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003202
3203 // The process name.
3204 optional string process_name = 2;
3205
3206 // The activity name.
3207 optional string activity_name = 3;
3208
3209 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003210 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003211
3212 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003213 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003214
3215 // RSS
3216 optional int64 rss_in_bytes = 6;
3217
3218 // CACHE
3219 optional int64 cache_in_bytes = 7;
3220
3221 // SWAP
3222 optional int64 swap_in_bytes = 8;
3223}
3224
3225/*
3226 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3227 * for LMK event.
3228 * Logged from:
3229 * system/core/lmkd/lmkd.c
3230 */
3231message LmkStateChanged {
3232 enum State {
3233 UNKNOWN = 0;
3234 START = 1;
3235 STOP = 2;
3236 }
3237 optional State state = 1;
3238}
3239
3240/*
3241 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3242 * Logged from:
3243 * system/core/lmkd/lmkd.c
3244 */
3245message LmkKillOccurred {
3246 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003247 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003248
3249 // The process name.
3250 optional string process_name = 2;
3251
3252 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003253 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003254
3255 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003256 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003257
3258 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003259 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003260
3261 // RSS
3262 optional int64 rss_in_bytes = 6;
3263
3264 // CACHE
3265 optional int64 cache_in_bytes = 7;
3266
3267 // SWAP
3268 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003269
3270 // The elapsed real time of start of the process.
3271 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003272
3273 // Min oom adj score considered by lmkd.
3274 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003275}
3276
Rajeev Kumar51b54602018-03-01 12:18:26 -08003277/*
3278 * Logs when the ActivityManagerService detects that an app died.
3279 *
3280 * Logged from:
3281 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3282 */
3283message AppDied {
3284 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003285 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003286}
3287
Howard Ro21a039c2018-08-06 14:55:47 -07003288/**
3289 * An atom for generic metrics logging. Available from Android Q.
3290 */
3291message GenericAtom {
3292 // The uid of the application that sent this custom atom.
3293 optional int32 uid = 1 [(is_uid) = true];
3294
3295 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003296 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003297}
3298
Tej Singhd6d6d772018-09-05 17:41:25 -07003299/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003300 * Atom for simple logging of user interaction and impression events, such as "the user touched
3301 * this button" or "this dialog was displayed".
3302 * Keep the UI event stream clean: don't use for system or background events.
3303 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
3304 */
3305message UiEventReported {
3306 // The event_id.
3307 optional int32 event_id = 1;
3308 // The event's source or target uid and package, if applicable.
3309 // For example, the package posting a notification, or the destination package of a share.
3310 optional int32 uid = 2 [(is_uid) = true];
3311 optional string package_name = 3;
3312}
3313
3314/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003315 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003316 *
3317 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003318 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003319 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003320message BiometricAcquired {
3321 // Biometric modality that was acquired.
3322 optional android.hardware.biometrics.ModalityEnum modality = 1;
3323 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3324 optional int32 user = 2;
3325 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3326 optional bool is_crypto = 3;
3327 // Action that the device is performing. Acquired messages are only expected for enroll and
3328 // authenticate. Other actions may indicate an error.
3329 optional android.hardware.biometrics.ActionEnum action = 4;
3330 // The client that this acquisition was received for.
3331 optional android.hardware.biometrics.ClientEnum client = 5;
3332 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3333 optional int32 acquire_info = 6;
3334 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3335 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003336 // Dictates if this message should trigger additional debugging.
3337 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003338}
3339
3340/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003341 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003342 *
3343 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003344 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003345 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003346message BiometricAuthenticated {
3347 // Biometric modality that was used.
3348 optional android.hardware.biometrics.ModalityEnum modality = 1;
3349 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3350 optional int32 user = 2;
3351 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3352 // storage.
3353 optional bool is_crypto = 3;
3354 // The client that this acquisition was received for.
3355 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003356 // If authentication requires user confirmation. See BiometricPrompt's
3357 // setRequireConfirmation(bool) method.
3358 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003359
Kevin Chyn1741a072019-01-17 11:54:40 -08003360 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003361 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003362 REJECTED = 1;
3363 PENDING_CONFIRMATION = 2;
3364 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003365 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003366
3367 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003368 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003369 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3370 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3371 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3372 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003373 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003374 // Dictates if this message should trigger additional debugging.
3375 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003376}
3377
3378/**
3379 * Logs when a biometric error occurs.
3380 *
3381 * Logged from:
3382 * frameworks/base/services/core/java/com/android/server/biometrics
3383 */
3384message BiometricErrorOccurred {
3385 // Biometric modality that was used.
3386 optional android.hardware.biometrics.ModalityEnum modality = 1;
3387 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3388 optional int32 user = 2;
3389 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3390 optional bool is_crypto = 3;
3391 // Action that the device is performing.
3392 optional android.hardware.biometrics.ActionEnum action = 4;
3393 // The client that this acquisition was received for.
3394 optional android.hardware.biometrics.ClientEnum client = 5;
3395 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3396 // are unique to modality.
3397 optional int32 error_info = 6;
3398 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3399 // by the vendor and not specified by the HIDL interface.
3400 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003401 // Dictates if this message should trigger additional debugging.
3402 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003403 // Time spent during the authentication attempt.
3404 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003405}
3406
3407/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003408 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003409 * Logged from:
3410 * frameworks/base/services/core/java/com/android/server/biometrics
3411 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003412message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003413 // Biometric modality.
3414 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003415 // Type of issue detected.
3416 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003417 // Dictates if this message should trigger additional debugging.
3418 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003419}
Howard Ro688ae182018-09-25 00:09:36 -07003420
joshmccloskey6f952b22019-03-25 20:59:35 -07003421/**
3422 * Logs when a biometric enrollment occurs.
3423 *
3424 * Logged from:
3425 * frameworks/base/services/core/java/com/android/server/biometrics
3426 */
3427message BiometricEnrolled {
3428 // Biometric modality that was used.
3429 optional android.hardware.biometrics.ModalityEnum modality = 1;
3430 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3431 optional int32 user = 2;
3432 // The amount of time the enrollment took in milliseconds.
3433 optional int64 latency_millis = 3;
3434 // Whether or not the enrollment was successful.
3435 optional bool success = 4;
3436}
3437
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003438/*
Tej Singh0d176952019-01-16 19:10:54 -08003439 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003440 */
Tej Singh0d176952019-01-16 19:10:54 -08003441message FlagFlipUpdateOccurred {
3442 // If the event is from a flag config package, specify the package name.
3443 optional string flag_flip_package_name = 1;
3444
3445 // The order id of the package
3446 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003447}
3448
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003449/**
3450 * Potential experiment ids that goes with a train install.
3451 */
3452message TrainExperimentIds {
3453 repeated int64 experiment_id = 1;
3454}
3455
Yangster-macb89807e2018-11-15 21:10:57 -08003456/*
3457 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003458 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003459 */
3460message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003461 // Name of the train.
3462 optional string train_name = 1;
3463 // Version code for a "train" of packages that need to be installed atomically
3464 optional int64 train_version_code = 2;
3465 // After installation of this package, device requires a restart.
3466 optional bool requires_staging = 3;
3467 // Rollback should be enabled for this install.
3468 optional bool rollback_enabled = 4;
3469 // Requires low latency monitoring if possible.
3470 optional bool requires_low_latency_monitor = 5;
3471
Yangster-macb89807e2018-11-15 21:10:57 -08003472 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003473 UNKNOWN = 0;
3474 INSTALL_REQUESTED = 1;
3475 INSTALL_STARTED = 2;
3476 INSTALL_STAGED_NOT_READY = 3;
3477 INSTALL_STAGED_READY = 4;
3478 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003479 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3480 // and INSTALL_FAILURE_COMMIT.
3481 INSTALL_FAILURE = 6 [deprecated = true];
3482 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003483 INSTALL_CANCELLED = 7;
3484 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003485 INSTALLER_ROLLBACK_INITIATED = 9;
3486 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3487 INSTALLER_ROLLBACK_STAGED = 11;
3488 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3489 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3490 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3491 INSTALLER_ROLLBACK_SUCCESS = 15;
3492 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003493 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3494 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3495 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3496 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3497 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3498 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003499 INSTALL_FAILURE_DOWNLOAD = 23;
3500 INSTALL_FAILURE_STATE_MISMATCH = 24;
3501 INSTALL_FAILURE_COMMIT = 25;
Yangster-macb89807e2018-11-15 21:10:57 -08003502 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003503 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003504 // Possible experiment ids for monitoring this push.
3505 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3506 // user id
3507 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003508}
3509
Tej Singhc9203082019-05-03 13:42:23 -07003510/* Test atom, is not logged anywhere */
3511message TestAtomReported {
3512 repeated AttributionNode attribution_node = 1;
3513 optional int32 int_field = 2;
3514 optional int64 long_field = 3;
3515 optional float float_field = 4;
3516 optional string string_field = 5;
3517 optional bool boolean_field = 6;
3518 enum State {
3519 UNKNOWN = 0;
3520 OFF = 1;
3521 ON = 2;
3522 }
3523 optional State state = 7;
3524 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3525}
3526
Maggie Whitefc1aa592018-11-28 21:55:23 -08003527/** Represents USB port overheat event. */
3528message UsbPortOverheatEvent {
3529 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3530 optional int32 plug_temperature_deci_c = 1;
3531
3532 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3533 optional int32 max_temperature_deci_c = 2;
3534
3535 /* Time between USB plug event and overheat threshold trip, in seconds. */
3536 optional int32 time_to_overheat_secs = 3;
3537
3538 /* Time between overheat threshold trip and hysteresis, in seconds. */
3539 optional int32 time_to_hysteresis_secs = 4;
3540
3541 /* Time between hysteresis and active mitigation ending, in seconds. */
3542 optional int32 time_to_inactive_secs = 5;
3543};
3544
Maggie White8735b852019-01-18 11:40:49 -08003545/**
3546 * Logs total effective full charge and discharge cycles on a battery.
3547 * Here are some examples of one effective cycle:
3548 * 1) the battery charges from 0% to 100% and drains back to 0%,
3549 * 2) charging from 50% to 100% and draining back to 50% twice.
3550 * Pulled from:
3551 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3552 */
3553message BatteryCycleCount {
3554 /* Number of total charge and discharge cycles on the system battery. */
3555 optional int32 cycle_count = 1;
3556}
3557
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003558/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003559 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3560 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003561 * Pulled from:
3562 * StatsCompanionService
3563 */
3564
Carmen Agimof12dec122019-03-06 16:14:38 +00003565message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003566
Carmen Agimof12dec122019-03-06 16:14:38 +00003567 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003568 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003569 PUBLIC = 1;
3570 PRIVATE = 2;
3571 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003572 }
3573
Carmen Agimof12dec122019-03-06 16:14:38 +00003574 // The type of external storage.
3575 optional android.stats.storage.ExternalStorageType storage_type = 1;
3576 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3577 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003578 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003579 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003580}
3581
Yangster-macb89807e2018-11-15 21:10:57 -08003582/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003583 * Logs when a connection becomes available and lost.
3584 * Logged in StatsCompanionService.java
3585 */
3586message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003587 // Id of the network.
3588 optional int32 net_id = 1;
3589
3590 enum State {
3591 UNKNOWN = 0;
3592 CONNECTED = 1;
3593 DISCONNECTED = 2;
3594 }
3595 // Connected state of a network.
3596 optional State state = 2;
3597}
3598
3599/**
3600 * Logs when a service starts and stops.
3601 * Logged from:
3602 * services/core/java/com/android/server/am/ActiveServices.java
3603 */
3604message ServiceStateChanged {
3605
3606 optional int32 uid = 1 [(is_uid) = true];
3607
3608 optional string package_name = 2;
3609
3610 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003611
3612 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003613 START = 1;
3614 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003615 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003616
3617 optional State state = 4;
3618}
3619
3620/**
3621 * Logs when a service is launched.
3622 * Logged from:
3623 * services/core/java/com/android/server/am/ActiveServices.java
3624 */
3625message ServiceLaunchReported {
3626
3627 optional int32 uid = 1 [(is_uid) = true];
3628
3629 optional string package_name = 2;
3630
3631 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003632}
Howard Ro688ae182018-09-25 00:09:36 -07003633
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003634/**
3635 * Logs when a hidden API is used.
3636 *
3637 * Logged from:
3638 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3639 */
3640message HiddenApiUsed {
3641 // The uid of the app making the hidden access.
3642 optional int32 uid = 1 [(is_uid) = true];
3643
3644 // Signature of the method or field accessed.
3645 optional string signature = 2;
3646
3647 enum AccessMethod {
3648 NONE = 0;
3649 REFLECTION = 1;
3650 JNI = 2;
3651 LINKING = 3;
3652 }
3653
3654 // Type of access.
3655 optional AccessMethod access_method = 3;
3656
3657 // Whether the access was prevented or not.
3658 optional bool access_denied = 4;
3659}
3660
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003661/**
3662 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3663 * - When user sees privacy chip
3664 * - When user clicks privacy chip
3665 * - How does the user exit the Privacy Dialog
3666 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003667 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3668 */
3669message PrivacyIndicatorsInteracted {
3670
3671 enum Type {
3672 UNKNOWN = 0;
3673 CHIP_VIEWED = 1;
3674 CHIP_CLICKED = 2;
3675 DIALOG_PRIVACY_SETTINGS = 3;
3676 DIALOG_DISMISS = 4;
3677 DIALOG_LINE_ITEM = 5;
3678 }
3679
3680 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3681
3682 // Used if the type is LINE_ITEM
3683 optional string package_name = 2;
3684}
3685
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003686/**
3687 * Logs information about a package that is moved from the internal to external storage and vice
3688 * versa.
3689 * It logs the package name, the type of the external storage where the package is installed
3690 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3691 * and the move type: if it's from internal to external or the other way around.
3692 *
3693 * Logged from:
3694 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3695 */
3696message AppMovedStorageReported {
3697 enum MoveType {
3698 UNKNOWN = 0;
3699 TO_EXTERNAL = 1;
3700 TO_INTERNAL = 2;
3701 }
3702 // The type of the external storage.
3703 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3704 // The type of move.
3705 optional MoveType move_type = 2;
3706 // The name of the package that was moved.
3707 optional string package_name = 3;
3708}
3709
jianjin8f2dee02019-03-29 14:03:08 -07003710/**
3711 * Logs when system server watchdog occurs.
3712 * Logged from:
3713 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3714 */
3715message SystemServerWatchdogOccurred {
3716 optional string subject = 1;
3717}
3718
3719/**
3720 * Logs when new file added to tombstones.
3721 * Logged from:
3722 * frameworks/base/core/java/com/android/server/BootReceiver.java
3723 */
3724message TombStoneOccurred {
3725}
3726
Hai Zhang5d3328d2019-04-13 21:25:06 +08003727/*
3728 * Information about a role request
3729 *
3730 * Logged from:
3731 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3732 */
3733message RoleRequestResultReported {
3734 // UID of application requesting the role
3735 optional int32 requesting_uid = 1;
3736
3737 // Package name of application requesting the role
3738 optional string requesting_package_name = 2;
3739
3740 // The role to be granted
3741 optional string role_name = 3;
3742
3743 // The count of applications qualifying for the role
3744 optional int32 qualifying_count = 4;
3745
3746 // UID of application current granted the role
3747 optional int32 current_uid = 5;
3748
3749 // Package name of application current granted the role
3750 optional string current_package_name = 6;
3751
3752 // UID of another application that user chose to grant the role to, instead of the requesting
3753 // application
3754 optional int32 granted_another_uid = 7;
3755
3756 // Package name of another application that user chose to grant the role to, instead of the
3757 // requesting application
3758 optional string granted_another_package_name = 8;
3759
3760 enum Result {
3761 UNDEFINED = 0;
3762 // role request was ignored
3763 IGNORED = 1;
3764 // role request was ignored because it's already granted
3765 IGNORED_ALREADY_GRANTED = 2;
3766 // role request was ignored because the application isn't qualified
3767 IGNORED_NOT_QUALIFIED = 3;
3768 // role request was ignored because user said it should be always denied
3769 IGNORED_USER_ALWAYS_DENIED = 4;
3770 // role was granted by user action
3771 USER_GRANTED = 5;
3772 // role was denied by user action
3773 USER_DENIED = 6;
3774 // role was denied by user granting another application the role
3775 USER_DENIED_GRANTED_ANOTHER = 7;
3776 // role was denied and set to be always denied by the user
3777 USER_DENIED_WITH_ALWAYS = 8;
3778 }
3779 // The result of the role request
3780 optional Result result = 9;
3781}
3782
Mark Tabrya824a642019-11-05 12:26:12 -08003783/**
3784 * Logs when a Vehicle Maps Service client's connection state has changed
3785 *
3786 * Logged from:
3787 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
3788 */
3789message VmsClientConnectionStateChanged {
3790 // The UID of the VMS client app
3791 optional int32 uid = 1 [(is_uid) = true];
3792
3793 enum State {
3794 UNKNOWN = 0;
3795 // Attempting to connect to the client
3796 CONNECTING = 1;
3797 // Client connection established
3798 CONNECTED = 2;
3799 // Client connection closed unexpectedly
3800 DISCONNECTED = 3;
3801 // Client connection closed by VMS
3802 TERMINATED = 4;
3803 // Error establishing the client connection
3804 CONNECTION_ERROR = 5;
3805 }
3806
3807 optional State state = 2;
3808}
3809
Jeff Sharkey6bd21572019-11-15 20:45:33 -07003810/**
3811 * Logs when MediaProvider has successfully finished scanning a storage volume.
3812 *
3813 * Logged from:
3814 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
3815 */
3816message MediaProviderScanEvent {
3817 enum Reason {
3818 // Scan triggered due to unknown reason
3819 UNKNOWN = 0;
3820 // Scan triggered due to storage volume being mounted
3821 MOUNTED = 1;
3822 // Scan triggered due to explicit user action or app request
3823 DEMAND = 2;
3824 // Scan triggered due to idle maintenance
3825 IDLE = 3;
3826 }
3827
3828 // Volume type that this event pertains to
3829 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3830 // Reason why this scan was triggered
3831 optional Reason reason = 2;
3832 // Total number of files scanned
3833 optional int64 item_count = 3;
3834 // Duration of scan, normalized per file
3835 optional float normalized_duration_millis = 4;
3836 // Number of database inserts, normalized per file
3837 optional float normalized_insert_count = 5;
3838 // Number of database updates, normalized per file
3839 optional float normalized_update_count = 6;
3840 // Number of database deletes, normalized per file
3841 optional float normalized_delete_count = 7;
3842}
3843
3844/**
3845 * Logs when an app has asked MediaProvider to delete media belonging to the user.
3846 *
3847 * Logged from:
3848 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
3849 */
3850message MediaProviderDeletionEvent {
3851 // Volume type that this event pertains to
3852 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3853 // Device timestamp when this deletion event occurred
3854 optional int64 timestamp_millis = 2;
3855 // App that requested deletion
3856 optional string package_name = 3;
3857 // Number of items that were deleted
3858 optional int32 item_count = 4;
3859}
3860
3861/**
3862 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
3863 *
3864 * Logged from:
3865 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
3866 */
3867message MediaProviderPermissionEvent {
3868 enum Result {
3869 UNKNOWN = 0;
3870 USER_GRANTED = 1;
3871 AUTO_GRANTED = 2;
3872 USER_DENIED = 3;
3873 USER_DENIED_WITH_PREJUDICE = 4;
3874 AUTO_DENIED = 5;
3875 }
3876
3877 // Volume type that this event pertains to
3878 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3879 // Device timestamp when this permission event occurred
3880 optional int64 timestamp_millis = 2;
3881 // App that requested permission
3882 optional string package_name = 3;
3883 // Number of items that were requested
3884 optional int32 item_count = 4;
3885 // Result of this request
3886 optional Result result = 5;
3887}
3888
3889/**
3890 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
3891 *
3892 * Logged from:
3893 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
3894 */
3895message MediaProviderSchemaChange {
3896 // Volume type that this event pertains to
3897 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3898 // Old database version code
3899 optional int32 version_from = 2;
3900 // New database version code
3901 optional int32 version_to = 3;
3902 // Total number of files in database
3903 optional int64 item_count = 4;
3904 // Duration of schema change, normalized per file
3905 optional float normalized_duration_millis = 5;
3906}
3907
3908/**
3909 * Logs when MediaProvider has finished an idle maintenance job.
3910 *
3911 * Logged from:
3912 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
3913 */
3914message MediaProviderIdleMaintenance {
3915 // Volume type that this event pertains to
3916 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3917
3918 // Total number of files in database
3919 optional int64 item_count = 2;
3920 // Duration of idle maintenance, normalized per file
3921 optional float normalized_duration_millis = 3;
3922 // Number of thumbnails found to be stale, normalized per file
3923 optional float normalized_stale_thumbnails = 4;
3924 // Number of items found to be expired, normalized per file
3925 optional float normalized_expired_media = 5;
3926}
3927
Chenjie Yubbcbc602018-02-05 16:51:52 -08003928//////////////////////////////////////////////////////////////////////
3929// Pulled atoms below this line //
3930//////////////////////////////////////////////////////////////////////
3931
3932/**
David Chenc8a43242017-10-17 16:23:28 -07003933 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3934 *
3935 * Pulled from:
3936 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3937 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003938message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003939 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003940
3941 optional int64 rx_bytes = 2;
3942
3943 optional int64 rx_packets = 3;
3944
3945 optional int64 tx_bytes = 4;
3946
3947 optional int64 tx_packets = 5;
3948}
3949
3950/**
3951 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3952 *
3953 * Pulled from:
3954 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3955 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003956message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003957 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003958
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003959 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3960 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003961
3962 optional int64 rx_bytes = 3;
3963
3964 optional int64 rx_packets = 4;
3965
3966 optional int64 tx_bytes = 5;
3967
3968 optional int64 tx_packets = 6;
3969}
3970
3971/**
3972 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3973 *
3974 * Pulled from:
3975 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3976 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003977message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003978 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003979
3980 optional int64 rx_bytes = 2;
3981
3982 optional int64 rx_packets = 3;
3983
3984 optional int64 tx_bytes = 4;
3985
3986 optional int64 tx_packets = 5;
3987}
3988
3989/**
3990 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3991 *
3992 * Pulled from:
3993 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3994 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003995message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003996 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003997
Yao Chenc40a19d2018-03-15 16:48:25 -07003998 // 1 denotes foreground and 0 denotes background. This is called Set in
3999 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004000 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004001
4002 optional int64 rx_bytes = 3;
4003
4004 optional int64 rx_packets = 4;
4005
4006 optional int64 tx_bytes = 5;
4007
4008 optional int64 tx_packets = 6;
4009}
4010
4011/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004012 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4013 *
4014 * Pulled from:
4015 * StatsCompanionService
4016 */
4017message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004018 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004019
4020 optional int64 rx_bytes = 2;
4021
4022 optional int64 tx_bytes = 3;
4023}
4024
4025/**
David Chenc8a43242017-10-17 16:23:28 -07004026 * Pulls the kernel wakelock durations. This atom is adapted from
4027 * android/internal/os/KernelWakelockStats.java
4028 *
4029 * Pulled from:
4030 * StatsCompanionService using KernelWakelockReader.
4031 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004032message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004033 optional string name = 1;
4034
4035 optional int32 count = 2;
4036
4037 optional int32 version = 3;
4038
Yangster-maca8a30442018-10-13 23:46:34 -07004039 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004040}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004041
Chenjie Yu05013b32017-11-21 10:21:41 -08004042/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004043 * Pulls low power state information. If power.stats HAL is not available, this
4044 * includes platform and subsystem sleep state information,
4045 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4046 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004047 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004048 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004049 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4050 * as defined in:
4051 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004052 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004053message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004054 // Subsystem name
4055 optional string subsystem_name = 1;
4056 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4057 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004058 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4059 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004060 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004061 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004062 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004063 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004064 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004065}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004066
Chenjie Yu05013b32017-11-21 10:21:41 -08004067/**
Bookatz92da2832018-11-01 18:10:03 -07004068 * Pulls on-device power measurement information.
4069 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4070 * Pulled from:
4071 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4072 */
4073message OnDevicePowerMeasurement {
4074 // Name of the subsystem (to which the rail belongs).
4075 optional string subsystem_name = 1;
4076
4077 // Rail name. The rail lies within the subsystem.
4078 optional string rail_name = 2;
4079
4080 // Time (in ms since boot) at which the rail energy value was measured.
4081 // This may differ slightly from the time that statsd logs this information.
4082 optional uint64 measurement_timestamp_millis = 3;
4083
4084 // Accumulated energy used via the rail since device boot in uWs.
4085 optional uint64 energy_microwatt_secs = 4;
4086}
4087
4088/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004089 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004090 * Pulls the time the cpu spend on the frequency index. Frequency index
4091 * starts from highest to lowest. The value should be monotonically
4092 * increasing since boot. However, if there is a cpu
4093 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004094 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004095message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004096 optional uint32 cluster = 1;
4097 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004098 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004099}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004100
Chenjie Yu05013b32017-11-21 10:21:41 -08004101/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004102 * Pulls Cpu Time Per Uid.
4103 * Note that isolated process uid time should be attributed to host uids.
4104 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004105message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004106 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004107 optional uint64 user_time_micros = 2;
4108 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004109}
4110
4111/**
4112 * Pulls Cpu Time Per Uid per frequency.
4113 * Note that isolated process uid time should be attributed to host uids.
4114 * For each uid, we order the time by descending frequencies.
4115 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004116message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004117 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004118 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004119 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004120}
Hugo Benichi884970e2017-11-14 22:42:46 +09004121
Chenjie Yu05013b32017-11-21 10:21:41 -08004122/**
4123 * Pulls Wifi Controller Activity Energy Info
4124 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004125message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004126 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004127 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004128 // stack reported state
4129 // TODO: replace this with proto enum
4130 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004131 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004132 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004133 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004134 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004135 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004136 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004137 // product of current(mA), voltage(V) and time(ms)
4138 optional uint64 controller_energy_used = 6;
4139}
4140
4141/**
4142 * Pulls Modem Activity Energy Info
4143 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004144message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004145 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004146 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004147 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004148 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004149 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004150 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004151 /**
4152 * Tx power index
4153 * index 0 = tx_power < 0dBm
4154 * index 1 = 0dBm < tx_power < 5dBm
4155 * index 2 = 5dBm < tx_power < 15dBm
4156 * index 3 = 15dBm < tx_power < 20dBm
4157 * index 4 = tx_power > 20dBm
4158 */
4159 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004160 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004161 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004162 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004163 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004164 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004165 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004166 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004167 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004168 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004169 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004170 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004171 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004172 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004173}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004174
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004175/**
4176 * Pulls Bluetooth Activity Energy Info
4177 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4178 */
4179message BluetoothActivityInfo {
4180 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004181 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004182 // bluetooth stack state
4183 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004184 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004185 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004186 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004187 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004188 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004189 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004190 // product of current(mA), voltage(V) and time(ms)
4191 optional uint64 energy_used = 6;
4192}
4193
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004194/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004195 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004196 *
4197 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004198 */
4199message ProcessMemoryState {
4200 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004201 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004202
4203 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004204 // Usually package name, "system" for system server.
4205 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004206 optional string process_name = 2;
4207
Rafal Slawikda51b932018-12-13 16:31:33 +00004208 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004209 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004210
4211 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004212 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004213
4214 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004215 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004216
Rajeev Kumar90235992018-01-29 11:06:48 -08004217 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004218 // Value is read from memory.stat, field total_rss if per-app memory
4219 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004220 optional int64 rss_in_bytes = 6;
4221
4222 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004223 // Value is read from memory.stat, field total_cache if per-app memory
4224 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004225 optional int64 cache_in_bytes = 7;
4226
4227 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004228 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004229 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004230 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004231
Rafal Slawik203c3db2019-09-25 19:53:01 +01004232 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004233 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004234
Rafal Slawik203c3db2019-09-25 19:53:01 +01004235 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4236 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004237
Rafal Slawik203c3db2019-09-25 19:53:01 +01004238 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4239 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004240}
4241
4242/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004243 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004244 *
4245 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4246 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004247 *
4248 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004249 */
4250message ProcessMemoryHighWaterMark {
4251 // The uid if available. -1 means not available.
4252 optional int32 uid = 1 [(is_uid) = true];
4253
Rafal Slawikda51b932018-12-13 16:31:33 +00004254 // The process name.
4255 // Usually package name or process cmdline.
4256 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004257 optional string process_name = 2;
4258
Rafal Slawik239b6802019-09-09 18:46:01 +01004259 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4260 // computed by converting kilobytes to bytes.
4261 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4262
Rafal Slawik3bea8952018-11-15 12:39:33 +00004263 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4264 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004265 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004266}
4267
4268/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004269 * Logs the memory stats for a process.
4270 *
4271 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4272 * and for selected native processes.
4273 */
4274message ProcessMemorySnapshot {
4275 // The uid if available. -1 means not available.
4276 optional int32 uid = 1 [(is_uid) = true];
4277
4278 // The process name.
4279 // Usually package name or process cmdline.
4280 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4281 optional string process_name = 2;
4282
4283 // The pid of the process.
4284 // Allows to disambiguate instances of the process.
4285 optional int32 pid = 3;
4286
4287 // The current OOM score adjustment value.
4288 // Read from ProcessRecord for managed processes.
4289 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4290 optional int32 oom_score_adj = 4;
4291
4292 // The current RSS of the process.
4293 // VmRSS from /proc/pid/status.
4294 optional int32 rss_in_kilobytes = 5;
4295
4296 // The current anon RSS of the process.
4297 // RssAnon from /proc/pid/status.
4298 optional int32 anon_rss_in_kilobytes = 6;
4299
4300 // The current swap size of the process.
4301 // VmSwap from /proc/pid/status.
4302 optional int32 swap_in_kilobytes = 7;
4303
4304 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4305 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4306}
4307
4308/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004309 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004310 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004311message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004312 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004313}
4314
4315/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004316 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004317 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004318message SystemUptime {
4319 // Milliseconds since the system was booted.
4320 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4321 // for external input).
4322 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004323 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004324}
4325
4326/*
4327 * Reads from /proc/uid_concurrent_active_time which has the format:
4328 * active: X (X is # cores)
4329 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4330 * [uid1]: [time-0] [time-1] [time-2] ... ...
4331 * ...
4332 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4333 * The file contains a monotonically increasing count of time for a single boot.
4334 */
4335message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004336 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004337 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004338}
4339
4340/**
4341 * Reads from /proc/uid_concurrent_policy_time which has the format:
4342 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4343 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4344 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4345 * ...
4346 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4347 * The file contains a monotonically increasing count of time for a single boot.
4348 */
4349message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004350 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004351 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004352 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004353}
4354
4355/*
4356 * Pulls free disk space, for data, system partition and temporary directory.
4357 */
4358message DiskSpace {
4359 // available bytes in data partition
4360 optional uint64 data_available_bytes = 1;
4361 // available bytes in system partition
4362 optional uint64 system_available_bytes = 2;
4363 // available bytes in download cache or temp directories
4364 optional uint64 temp_available_bytes = 3;
4365}
Tej Singhbf972d92018-01-10 20:51:13 -08004366
4367/**
4368 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004369 *
4370 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004371 */
4372message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004373 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004374}
4375
4376/**
4377 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004378 * Pulled from:
4379 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004380 */
4381message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004382 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004383}
4384
4385/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004386 * Pulls battery voltage.
4387 * Pulled from:
4388 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4389 */
4390message BatteryVoltage {
4391 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004392 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004393}
4394
4395/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004396 * Pulls battery level (percent full, from 0 to 100).
4397 *
4398 * Pulled from:
4399 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4400 */
4401message BatteryLevel {
4402 // Battery level. Should be in [0, 100].
4403 optional int32 battery_level = 1;
4404}
4405
4406/**
Tej Singhd89137e2018-03-26 14:51:40 -07004407 * Pulls the temperature of various parts of the device.
4408 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004409 *
Maggie White442b6312019-04-05 16:26:44 -07004410 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004411 */
4412message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004413 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004414 optional android.os.TemperatureTypeEnum sensor_location = 1;
4415
4416 // The name of the temperature source. Eg. CPU0
4417 optional string sensor_name = 2;
4418
Tej Singhd89137e2018-03-26 14:51:40 -07004419 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004420 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004421 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004422
4423 // Relative severity of the throttling, see enum definition.
4424 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004425}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004426
4427/**
4428 * Pulls the statistics of calls to Binder.
4429 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004430 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4431 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004432 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004433 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004434 */
4435message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004436 // UID of the process responsible for the binder transaction. It will be set if the process
4437 // executing the binder transaction attribute the transaction to another uid using
4438 // Binder.setThreadWorkSource().
4439 //
4440 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004441 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004442 // UID of the process executing the binder transaction.
4443 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004444 // Fully qualified class name of the API call.
4445 //
4446 // This is a system server class name.
4447 //
4448 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4449 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4450 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4451 // commonly used APIs.
4452 optional string service_class_name = 2;
4453 // Method name of the API call. It can also be a transaction code if we cannot
4454 // resolve it to a name. See Binder#getTransactionName.
4455 //
4456 // This is a system server method name.
4457 optional string service_method_name = 3;
4458 // Total number of API calls.
4459 optional int64 call_count = 4;
4460 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4461 optional bool screen_interactive = 13;
4462 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4463 // call_count will be equal to recorded_call_count.
4464 //
4465 // If recorded_call_count is different than call_count, it means data collection has been
4466 // sampled. All the fields below will be sampled in this case.
4467 optional int64 recorded_call_count = 12;
4468 // Number of exceptions thrown by the API.
4469 optional int64 recorded_exception_count = 5;
4470 // Total latency of all API calls.
4471 // Average can be computed using total_latency_micros / recorded_call_count.
4472 optional int64 recorded_total_latency_micros = 6;
4473 // Maximum latency of one API call.
4474 optional int64 recorded_max_latency_micros = 7;
4475 // Total CPU usage of all API calls.
4476 // Average can be computed using total_cpu_micros / recorded_call_count.
4477 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4478 optional int64 recorded_total_cpu_micros = 8;
4479 // Maximum CPU usage of one API call.
4480 optional int64 recorded_max_cpu_micros = 9;
4481 // Maximum parcel reply size of one API call.
4482 optional int64 recorded_max_reply_size_bytes = 10;
4483 // Maximum parcel request size of one API call.
4484 optional int64 recorded_max_request_size_bytes = 11;
4485}
4486
4487/**
4488 * Pulls the statistics of exceptions during calls to Binder.
4489 *
4490 * Binder stats are cumulative from boot unless somebody reset the data using
4491 * > adb shell dumpsys binder_calls_stats --reset
4492 */
4493message BinderCallsExceptions {
4494 // Exception class name, e.g. java.lang.IllegalArgumentException.
4495 //
4496 // This is an exception class name thrown by the system server.
4497 optional string exception_class_name = 1;
4498 // Total number of exceptions.
4499 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004500}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004501
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004502/**
4503 * Pulls the statistics of message dispatching on HandlerThreads.
4504 *
4505 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4506 * config on the device.
4507 *
4508 * Next tag: 11
4509 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004510message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004511 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004512 optional int32 uid = 1 [(is_uid) = true];
4513
4514 // Fully qualified class name of the handler target class.
4515 //
4516 // This field does not contain PII. This is a system server class name.
4517 optional string handler_class_name = 2;
4518
4519 // The name of the thread that runs the Looper.
4520 //
4521 // This field does not contain PII. This is a system server thread name.
4522 optional string looper_thread_name = 3;
4523
4524 // The name of the dispatched message.
4525 //
4526 // This field does not contain PII. This is a system server constant or class
4527 // name.
4528 optional string message_name = 4;
4529
4530 // Total number of successfully dispatched messages.
4531 optional int64 message_count = 5;
4532
4533 // Total number of messages that failed dispatching.
4534 optional int64 exception_count = 6;
4535
4536 // Total number of processed messages we have data recorded for. If we
4537 // collected data for all the messages, message_count will be equal to
4538 // recorded_message_count.
4539 //
4540 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004541 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004542 optional int64 recorded_message_count = 7;
4543
4544 // Total latency of all processed messages.
4545 // Average can be computed using recorded_total_latency_micros /
4546 // recorded_message_count.
4547 optional int64 recorded_total_latency_micros = 8;
4548
4549 // Total CPU usage of all processed message.
4550 // Average can be computed using recorded_total_cpu_micros /
4551 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004552 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004553 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004554
4555 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4556 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004557
4558 // Max recorded CPU usage of all processed messages.
4559 optional int64 recorded_max_cpu_micros = 11;
4560
4561 // Max recorded latency of all processed messages.
4562 optional int64 recorded_max_latency_micros = 12;
4563
4564 // Total number of messages we tracked the dispatching delay for. If we
4565 // collected data for all the messages, message_count will be equal to
4566 // recorded_delay_message_count.
4567 //
4568 // If recorded_delay_message_count is different than message_count, it means data
4569 // collection has been sampled or/and not all messages specified the target dispatch time.
4570 // The fields below will be sampled in this case.
4571 optional int64 recorded_delay_message_count = 13;
4572
4573 // Total dispatching delay of all processed messages.
4574 // Calculated as a difference between the target dispatching time (Message.when)
4575 // and the actual dispatching time.
4576 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4577 optional int64 recorded_total_delay_millis = 14;
4578
4579 // Max dispatching delay of all processed messages.
4580 // Calculated as a difference between the target dispatching time (Message.when)
4581 // and the actual dispatching time.
4582 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004583}
Tej Singh86dc9db2018-09-06 00:39:57 +00004584
4585/**
4586 * Pulls disk information, such as write speed and latency.
4587 */
4588message DiskStats {
4589 // Time taken to open, write 512B to, and close a file.
4590 // -1 if error performing the check.
4591 optional int64 data_write_latency_millis = 1;
4592
4593 optional bool file_based_encryption = 2;
4594
4595 // Recent disk write speed in kB/s.
4596 // -1 if error querying storageed.
4597 // 0 if data is unavailable.
4598 optional int32 recent_disk_write_speed = 3;
4599}
4600
4601
4602/**
4603 * Free and total bytes of the Data, Cache, and System partition.
4604 */
4605message DirectoryUsage {
4606 enum Directory {
4607 UNKNOWN = 0;
4608 DATA = 1;
4609 CACHE = 2;
4610 SYSTEM = 3;
4611 }
4612 optional Directory directory = 1;
4613 optional int64 free_bytes = 2;
4614 optional int64 total_bytes = 3;
4615}
4616
4617
4618/**
4619 * Size of an application: apk size, data size, and cache size.
4620 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4621 * Information is only reported for apps with the primary user (user 0).
4622 * Sizes are aggregated by package name.
4623 */
4624message AppSize {
4625 // Including uids will involve modifying diskstats logic.
4626 optional string package_name = 1;
4627 // App size in bytes. -1 if unavailable.
4628 optional int64 app_size_bytes = 2;
4629 // App data size in bytes. -1 if unavailable.
4630 optional int64 app_data_size_bytes = 3;
4631 // App cache size in bytes. -1 if unavailable.
4632 optional int64 app_cache_size_bytes = 4;
4633 // Time that the cache file was produced.
4634 // Uses System.currentTimeMillis(), which is wall clock time.
4635 optional int64 cache_time_millis = 5;
4636}
4637
4638
4639/**
4640 * Size of a particular category. Eg: photos, videos.
4641 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4642 */
4643message CategorySize {
4644 enum Category {
4645 UNKNOWN = 0;
4646 APP_SIZE = 1;
4647 APP_DATA_SIZE = 2;
4648 APP_CACHE_SIZE = 3;
4649 PHOTOS = 4;
4650 VIDEOS = 5;
4651 AUDIO = 6;
4652 DOWNLOADS = 7;
4653 SYSTEM = 8;
4654 OTHER = 9;
4655 }
4656 optional Category category = 1;
4657 // Category size in bytes.
4658 optional int64 size_bytes = 2;
4659 // Time that the cache file was produced.
4660 // Uses System.currentTimeMillis(), which is wall clock time.
4661 optional int64 cache_time_millis = 3;
4662}
Tej Singhd6d6d772018-09-05 17:41:25 -07004663
4664/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004665 * Pulls per uid I/O stats. The stats are cumulative since boot.
4666 *
4667 * Read/write bytes are I/O events from a storage device
4668 * Read/write chars are data requested by read/write syscalls, and can be
4669 * satisfied by caching.
4670 *
4671 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4672 */
4673message DiskIo {
4674 optional int32 uid = 1 [(is_uid) = true];
4675 optional int64 fg_chars_read = 2;
4676 optional int64 fg_chars_write = 3;
4677 optional int64 fg_bytes_read = 4;
4678 optional int64 fg_bytes_write = 5;
4679 optional int64 bg_chars_read = 6;
4680 optional int64 bg_chars_write = 7;
4681 optional int64 bg_bytes_read = 8;
4682 optional int64 bg_bytes_write = 9;
4683 optional int64 fg_fsync = 10;
4684 optional int64 bg_fsync= 11;
4685}
4686
4687
4688/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004689 * Pulls the number of fingerprints for each user.
4690 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004691 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004692 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004693message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004694 // The associated user. Eg: 0 for owners, 10+ for others.
4695 // Defined in android/os/UserHandle.java
4696 optional int32 user = 1;
4697 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004698 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004699}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004700
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004701/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004702 * Pulls the number of faces for each user.
4703 *
4704 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4705 */
4706message NumFacesEnrolled {
4707 // The associated user. Eg: 0 for owners, 10+ for others.
4708 // Defined in android/os/UserHandle.java
4709 optional int32 user = 1;
4710 // Number of faces registered to that user.
4711 optional int32 num_faces_enrolled = 2;
4712}
4713/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004714 * A mapping of role holder -> role
4715 */
4716message RoleHolder {
4717 // uid of the role holder
4718 optional int32 uid = 1 [(is_uid) = true];
4719
4720 // package name of the role holder
4721 optional string package_name = 2;
4722
4723 // the role held
4724 optional string role = 3;
4725}
4726
Yangsteraf9aee72018-10-12 09:26:16 -07004727message AggStats {
4728 optional int64 min = 1;
4729
4730 optional int64 average = 2;
4731
4732 optional int64 max = 3;
4733}
4734
4735message ProcessStatsStateProto {
4736 optional android.service.procstats.ScreenState screen_state = 1;
4737
4738 optional android.service.procstats.MemoryState memory_state = 2;
4739
4740 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4741 // and not frameworks/base/core/java/android/app/ActivityManager.java
4742 optional android.service.procstats.ProcessState process_state = 3;
4743
4744 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004745 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004746
4747 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004748 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004749
4750 // # of samples taken
4751 optional int32 sample_size = 5;
4752
4753 // PSS is memory reserved for this process
4754 optional AggStats pss = 6;
4755
4756 // USS is memory shared between processes, divided evenly for accounting
4757 optional AggStats uss = 7;
4758
4759 // RSS is memory resident for this process
4760 optional AggStats rss = 8;
4761}
4762
4763// Next Tag: 7
4764message ProcessStatsProto {
4765 // Name of process.
4766 optional string process = 1;
4767
4768 // Uid of the process.
4769 optional int32 uid = 2;
4770
4771 // Information about how often kills occurred
4772 message Kill {
4773 // Count of excessive CPU kills
4774 optional int32 cpu = 1;
4775
4776 // Count of kills when cached
4777 optional int32 cached = 2;
4778
4779 // PSS stats during cached kill
4780 optional AggStats cached_pss = 3;
4781 }
4782 optional Kill kill = 3;
4783
4784 // Time and memory spent in various states.
4785 repeated ProcessStatsStateProto states = 5;
4786
4787 // Total time process has been running... screen_state, memory_state, and process_state
4788 // will not be set.
4789 optional ProcessStatsStateProto total_running_state = 6;
4790}
4791
4792message PackageServiceOperationStatsProto {
4793 // Operate enum: Started, Foreground, Bound, Executing
4794 optional android.service.procstats.ServiceOperationState operation = 1;
4795
4796 // Number of times the service was in this operation.
4797 optional int32 count = 2;
4798
4799 // Information about a state the service can be in.
4800 message StateStats {
4801 // Screen state enum.
4802 optional android.service.procstats.ScreenState screen_state = 1;
4803 // Memory state enum.
4804 optional android.service.procstats.MemoryState memory_state = 2;
4805
4806 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004807 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004808 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004809 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004810 }
4811 repeated StateStats state_stats = 3;
4812}
4813
4814message PackageServiceStatsProto {
4815 // Name of service component.
4816 optional string service_name = 1;
4817
4818 // The operation stats.
4819 // The package_name, package_uid, package_version, service_name will not be set to save space.
4820 repeated PackageServiceOperationStatsProto operation_stats = 2;
4821}
4822
4823message PackageAssociationSourceProcessStatsProto {
4824 // Uid of the process.
4825 optional int32 process_uid = 1;
4826 // Process name.
4827 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004828 // Package name.
4829 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004830 // Total count of the times this association appeared.
4831 optional int32 total_count = 3;
4832
4833 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004834 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004835
4836 // Total count of the times this association became actively impacting its target process.
4837 optional int32 active_count = 5;
4838
4839 // Information on one source in this association.
4840 message StateStats {
4841 // Process state enum.
4842 optional android.service.procstats.ProcessState process_state = 1;
4843 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004844 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004845 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004846 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004847 }
4848 repeated StateStats active_state_stats = 6;
4849}
4850
4851message PackageAssociationProcessStatsProto {
4852 // Name of the target component.
4853 optional string component_name = 1;
4854 // Information on one source in this association.
4855 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4856}
4857
4858
4859message ProcessStatsPackageProto {
4860 // Name of package.
4861 optional string package = 1;
4862
4863 // Uid of the package.
4864 optional int32 uid = 2;
4865
4866 // Version of the package.
4867 optional int64 version = 3;
4868
4869 // Stats for each process running with the package loaded in to it.
4870 repeated ProcessStatsProto process_stats = 4;
4871
4872 // Stats for each of the package's services.
4873 repeated PackageServiceStatsProto service_stats = 5;
4874
4875 // Stats for each association with the package.
4876 repeated PackageAssociationProcessStatsProto association_stats = 6;
4877}
4878
4879message ProcessStatsSectionProto {
4880 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004881 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004882
4883 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004884 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004885
4886 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004887 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004888
4889 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004890 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004891
4892 // System runtime library. e.g. "libdvm.so", "libart.so".
4893 optional string runtime = 5;
4894
4895 // whether kernel reports swapped pss.
4896 optional bool has_swapped_pss = 6;
4897
4898 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4899 enum Status {
4900 STATUS_UNKNOWN = 0;
4901 STATUS_COMPLETE = 1;
4902 STATUS_PARTIAL = 2;
4903 STATUS_SHUTDOWN = 3;
4904 STATUS_SYSPROPS = 4;
4905 }
4906 repeated Status status = 7;
4907
Chenjie Yub2ecc792019-01-17 10:27:26 -08004908 // Number of pages available of various types and sizes, representation fragmentation.
4909 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4910
Yangsteraf9aee72018-10-12 09:26:16 -07004911 // Stats for each process.
4912 repeated ProcessStatsProto process_stats = 8;
4913
4914 // Stats for each package.
4915 repeated ProcessStatsPackageProto package_stats = 9;
4916}
4917
Chenjie Yub2ecc792019-01-17 10:27:26 -08004918message ProcessStatsAvailablePagesProto {
4919 // Node these pages are in (as per /proc/pagetypeinfo)
4920 optional int32 node = 1;
4921
4922 // Zone these pages are in (as per /proc/pagetypeinfo)
4923 optional string zone = 2;
4924
4925 // Label for the type of these pages (as per /proc/pagetypeinfo)
4926 optional string label = 3;
4927
4928 // Distribution of number of pages available by order size. First entry in array is
4929 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4930 repeated int32 pages_per_order = 4;
4931}
4932
Chenjie Yu12e5e672018-09-14 15:54:59 -07004933/**
4934 * Pulled from ProcessStatsService.java
4935 */
4936message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004937 optional ProcessStatsSectionProto proc_stats_section = 1;
4938}
4939
Chenjie Yuf910b7802019-01-11 16:08:20 -08004940/**
4941 * Pulled from ProcessStatsService.java
4942 */
4943message ProcStatsPkgProc {
4944 optional ProcessStatsSectionProto proc_stats_section = 1;
4945}
4946
Chris Wrencdea3b72019-11-22 16:58:17 -05004947// Next Tag: 2
4948message PackageRemoteViewInfoProto {
4949 optional string package_name = 1;
4950 // add per-package additional info here (like channels)
4951}
4952
4953// Next Tag: 2
4954message NotificationRemoteViewsProto {
4955 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
4956}
4957
4958/**
4959 * Pulled from NotificationManagerService.java
4960 */
4961message NotificationRemoteViews {
4962 optional NotificationRemoteViewsProto notification_remote_views = 1;
4963}
4964
Yangsteraf9aee72018-10-12 09:26:16 -07004965message PowerProfileProto {
4966 optional double cpu_suspend = 1;
4967
4968 optional double cpu_idle = 2;
4969
4970 optional double cpu_active = 3;
4971
4972 message CpuCluster {
4973 optional int32 id = 1;
4974 optional double cluster_power = 2;
4975 optional int32 cores = 3;
4976 repeated int64 speed = 4;
4977 repeated double core_power = 5;
4978 }
4979
4980 repeated CpuCluster cpu_cluster = 40;
4981
4982 optional double wifi_scan = 4;
4983
4984 optional double wifi_on = 5;
4985
4986 optional double wifi_active = 6;
4987
4988 optional double wifi_controller_idle = 7;
4989
4990 optional double wifi_controller_rx = 8;
4991
4992 optional double wifi_controller_tx = 9;
4993
4994 repeated double wifi_controller_tx_levels = 10;
4995
4996 optional double wifi_controller_operating_voltage = 11;
4997
4998 optional double bluetooth_controller_idle = 12;
4999
5000 optional double bluetooth_controller_rx = 13;
5001
5002 optional double bluetooth_controller_tx = 14;
5003
5004 optional double bluetooth_controller_operating_voltage = 15;
5005
5006 optional double modem_controller_sleep = 16;
5007
5008 optional double modem_controller_idle = 17;
5009
5010 optional double modem_controller_rx = 18;
5011
5012 repeated double modem_controller_tx = 19;
5013
5014 optional double modem_controller_operating_voltage = 20;
5015
5016 optional double gps_on = 21;
5017
5018 repeated double gps_signal_quality_based = 22;
5019
5020 optional double gps_operating_voltage = 23;
5021
5022 optional double bluetooth_on = 24;
5023
5024 optional double bluetooth_active = 25;
5025
5026 optional double bluetooth_at_cmd = 26;
5027
5028 optional double ambient_display = 27;
5029
5030 optional double screen_on = 28;
5031
5032 optional double radio_on = 29;
5033
5034 optional double radio_scanning = 30;
5035
5036 optional double radio_active = 31;
5037
5038 optional double screen_full = 32;
5039
5040 optional double audio = 33;
5041
5042 optional double video = 34;
5043
5044 optional double flashlight = 35;
5045
5046 optional double memory = 36;
5047
5048 optional double camera = 37;
5049
5050 optional double wifi_batched_scan = 38;
5051
5052 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005053}
Chenjie Yuab530202018-09-26 12:39:20 -07005054
5055/**
5056 * power_profile.xml and other constants for power model calculations.
5057 * Pulled from PowerProfile.java
5058 */
5059message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005060 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005061}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005062
5063/**
arangelovd5db50e2018-10-12 20:24:39 +01005064 * Logs when a user restriction was added or removed.
5065 *
5066 * Logged from:
5067 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5068 */
5069message UserRestrictionChanged {
5070 // The raw string of the user restriction as defined in UserManager.
5071 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5072 optional string restriction = 1;
5073 // Whether the restriction is enabled or disabled.
5074 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005075}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005076
5077/**
5078 * Pulls process user time and system time. Puller takes a snapshot of all pids
5079 * in the system and returns cpu stats for those that are working at the time.
5080 * Dead pids will be dropped. Kernel processes are excluded.
5081 * Min cool-down is 5 sec.
5082 */
5083message ProcessCpuTime {
5084 optional int32 uid = 1 [(is_uid) = true];
5085
5086 optional string process_name = 2;
5087 // Process cpu time in user space, cumulative from boot/process start
5088 optional int64 user_time_millis = 3;
5089 // Process cpu time in system space, cumulative from boot/process start
5090 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005091}
Misha Wagner5a51e002018-10-03 15:04:09 +01005092
5093/**
5094 * Pulls the CPU usage for each thread.
5095 *
5096 * Read from /proc/$PID/task/$TID/time_in_state files.
5097 *
5098 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5099 * time_in_state files not being present on some phones, have not been addressed. These should be
5100 * considered before a public release.
5101 */
5102message CpuTimePerThreadFreq {
5103 // UID that owns the process.
5104 optional int32 uid = 1 [(is_uid) = true];
5105 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005106 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005107 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005108 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005109 // Name of the process taken from `/proc/$PID/cmdline`.
5110 optional string process_name = 4;
5111 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5112 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005113
5114 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5115 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5116 // frequencies are given here as the alternative is sending eight separate atoms. This method
5117 // significantly reduces the amount of data created
5118 optional int32 frequency1_khz = 6;
5119 optional int32 time1_millis = 7;
5120 optional int32 frequency2_khz = 8;
5121 optional int32 time2_millis = 9;
5122 optional int32 frequency3_khz = 10;
5123 optional int32 time3_millis = 11;
5124 optional int32 frequency4_khz = 12;
5125 optional int32 time4_millis = 13;
5126 optional int32 frequency5_khz = 14;
5127 optional int32 time5_millis = 15;
5128 optional int32 frequency6_khz = 16;
5129 optional int32 time6_millis = 17;
5130 optional int32 frequency7_khz = 18;
5131 optional int32 time7_millis = 19;
5132 optional int32 frequency8_khz = 20;
5133 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005134}
Bookatz75ee60422018-11-09 12:27:37 -08005135
5136/**
Bookatz366a4432018-11-20 09:42:33 -08005137 * Pulls information about the device's build.
5138 */
5139message BuildInformation {
5140 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5141 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5142 optional string fingerprint = 1;
5143
5144 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5145 optional string brand = 2;
5146
5147 // Build.PRODUCT. The name of the overall product.
5148 optional string product = 3;
5149
5150 // Build.DEVICE. The name of the industrial design.
5151 optional string device = 4;
5152
5153 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5154 optional string version_release = 5;
5155
5156 // Build.ID. E.g. a label like "M4-rc20".
5157 optional string id = 6;
5158
5159 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5160 // represent this build.
5161 optional string version_incremental = 7;
5162
5163 // Build.TYPE. The type of build, like "user" or "eng".
5164 optional string type = 8;
5165
5166 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5167 optional string tags = 9;
5168}
5169
5170/**
Adam He420947c2019-01-23 15:59:09 -08005171 * Logs information about mismatched caller for content capture.
5172 *
5173 * Logged from:
5174 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5175 */
5176message ContentCaptureCallerMismatchReported {
5177 optional string intended_package = 1;
5178 optional string calling_package = 2;
5179}
5180
5181/**
5182 * Logs information about content capture service events.
5183 *
5184 * Logged from:
5185 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5186 */
5187message ContentCaptureServiceEvents {
5188 // The type of event.
5189 enum Event {
5190 UNKNOWN = 0;
5191 ON_CONNECTED = 1;
5192 ON_DISCONNECTED = 2;
5193 SET_WHITELIST = 3;
5194 SET_DISABLED = 4;
5195 ON_USER_DATA_REMOVED = 5;
5196 }
5197 optional Event event = 1;
5198 // component/package of content capture service.
5199 optional string service_info = 2;
5200 // component/package of target.
5201 // it's a concatenated list of component/package for SET_WHITELIST event
5202 // separated by " ".
5203 optional string target_info = 3;
5204}
5205
5206/**
5207 * Logs information about content capture session events.
5208 *
5209 * Logged from:
5210 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5211 */
5212message ContentCaptureSessionEvents {
5213 // The type of event.
5214 enum Event {
5215 UNKNOWN = 0;
5216 ON_SESSION_STARTED = 1;
5217 ON_SESSION_FINISHED = 2;
5218 SESSION_NOT_CREATED = 3;
5219 }
5220 optional int32 session_id = 1;
5221 optional Event event = 2;
5222 // (n/a on session finished)
5223 optional int32 state_flags = 3;
5224 // component/package of content capture service.
5225 optional string service_info = 4;
5226 // component/package of app.
5227 // (n/a on session finished)
5228 optional string app_info = 5;
5229 optional bool is_child_session = 6;
5230}
5231
5232/**
5233 * Logs information about session being flushed.
5234 *
5235 * Logged from:
5236 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5237 */
5238message ContentCaptureFlushed {
5239 optional int32 session_id = 1;
5240 // component/package of content capture service.
5241 optional string service_info = 2;
5242 // component/package of app.
5243 optional string app_info = 3;
5244 // session start/finish events
5245 optional int32 child_session_started = 4;
5246 optional int32 child_session_finished = 5;
5247 // count of view events.
5248 optional int32 view_appeared_count = 6;
5249 optional int32 view_disappeared_count = 7;
5250 optional int32 view_text_changed_count = 8;
5251
5252 // Flush stats.
5253 optional int32 max_events = 9;
5254 optional int32 idle_flush_freq = 10;
5255 optional int32 text_flush_freq = 11;
5256 optional int32 flush_reason = 12;
5257}
5258
5259/**
Bookatz75ee60422018-11-09 12:27:37 -08005260 * Pulls on-device BatteryStats power use calculations for the overall device.
5261 */
5262message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005263 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5264 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5265 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5266 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005267}
5268
5269/**
5270 * Pulls on-device BatteryStats power use calculations broken down by uid.
5271 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5272 * that is attributed to non-uid items. They must all be included to get the total power use.
5273 */
5274message DeviceCalculatedPowerBlameUid {
5275 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5276 optional int32 uid = 1 [(is_uid) = true];
5277
Bookatz3dbc13a2018-12-21 12:16:51 -08005278 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5279 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5280 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005281}
5282
5283/**
5284 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5285 * drain type.
5286 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5287 * is attributed uids. They must all be included to get the total power use.
5288 */
5289message DeviceCalculatedPowerBlameOther {
5290 // The type of item whose power use is being reported.
5291 enum DrainType {
5292 AMBIENT_DISPLAY = 0;
5293 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5294 BLUETOOTH = 2;
5295 CAMERA = 3;
5296 // Cell-standby
5297 CELL = 4;
5298 FLASHLIGHT = 5;
5299 IDLE = 6;
5300 MEMORY = 7;
5301 // Amount that total computed drain exceeded the drain estimated using the
5302 // battery level changes and capacity.
5303 OVERCOUNTED = 8;
5304 PHONE = 9;
5305 SCREEN = 10;
5306 // Amount that total computed drain was below the drain estimated using the
5307 // battery level changes and capacity.
5308 UNACCOUNTED = 11;
5309 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5310 WIFI = 13;
5311 }
5312 optional DrainType drain_type = 1;
5313
Bookatz3dbc13a2018-12-21 12:16:51 -08005314 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5315 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5316 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005317}
arangelov4e994062018-11-13 16:12:38 +00005318
5319/**
5320 * Logs device policy features.
5321 *
5322 * Logged from:
5323 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5324 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5325 */
5326message DevicePolicyEvent {
5327 // The event id - unique for each event.
5328 optional android.stats.devicepolicy.EventId event_id = 1;
5329 // The admin package name.
5330 optional string admin_package_name = 2;
5331 // A generic integer parameter.
5332 optional int32 integer_value = 3;
5333 // A generic boolean parameter.
5334 optional bool boolean_value = 4;
5335 // A parameter specifying a time period in milliseconds.
5336 optional uint64 time_period_millis = 5;
5337 // A parameter specifying a list of package names, bundle extras or string parameters.
5338 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5339}
shawnlinea5b66b2018-11-13 15:05:29 +08005340
5341/**
5342 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5343 *
5344 * Logged from:
5345 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5346 */
5347message DocsUILaunchReported {
5348 optional android.stats.docsui.LaunchAction launch_action = 1;
5349 optional bool has_initial_uri = 2;
5350 optional android.stats.docsui.MimeType mime_type = 3;
5351 optional android.stats.docsui.Root initial_root = 4;
5352}
5353
5354/**
5355 * Logs root/app visited event in file managers/picker. Call this when the user
5356 * taps on root/app in hamburger menu.
5357 *
5358 * Logged from:
5359 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5360 */
5361message DocsUIRootVisitedReported {
5362 optional android.stats.docsui.ContextScope scope = 1;
5363 optional android.stats.docsui.Root root = 2;
5364}
5365
5366/**
5367 * Logs file operation stats. Call this when a file operation has completed.
5368 *
5369 * Logged from:
5370 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5371 */
5372message DocsUIFileOperationReported {
5373 optional android.stats.docsui.Provider provider = 1;
5374 optional android.stats.docsui.FileOperation file_op = 2;
5375}
5376
5377/**
5378 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5379 * mode.
5380 *
5381 * Logged from:
5382 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5383 */
5384message DocsUIFileOperationCopyMoveModeReported {
5385 optional android.stats.docsui.FileOperation file_op = 1;
5386 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5387}
5388
5389
5390/**
5391 * Logs file sub operation stats. Call this when a file operation has failed.
5392 *
5393 * Logged from:
5394 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5395 */
5396message DocsUIFileOperationFailureReported {
5397 optional android.stats.docsui.Authority authority = 1;
5398 optional android.stats.docsui.SubFileOperation sub_op = 2;
5399}
5400
5401/**
5402* Logs the cancellation of a file operation. Call this when a job is canceled
5403*
5404* Logged from:
5405* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5406*/
5407message DocsUIFileOperationCanceledReported {
5408 optional android.stats.docsui.FileOperation file_op = 1;
5409}
5410
5411/**
5412 * Logs startup time in milliseconds.
5413 *
5414 * Logged from:
5415 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5416 */
5417message DocsUIStartupMsReported {
5418 optional int32 startup_millis = 1;
5419}
5420
5421/**
5422 * Logs the action that was started by user.
5423 *
5424 * Logged from:
5425 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5426 */
5427message DocsUIUserActionReported {
5428 optional android.stats.docsui.UserAction action = 1;
5429}
5430
5431/**
5432 * Logs the invalid type when invalid scoped access is requested.
5433 *
5434 * Logged from:
5435 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5436 */
5437message DocsUIInvalidScopedAccessRequestReported {
5438 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005439}
Ben Murdochbab399f62018-12-06 11:01:38 +00005440
5441/**
shawnlina75e82d2019-01-07 10:31:12 +08005442 * Logs the package name that launches docsui picker mode.
5443 *
5444 * Logged from:
5445 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5446 */
5447message DocsUIPickerLaunchedFromReported {
5448 optional string package_name = 1;
5449}
5450
5451/**
5452 * Logs the search type.
5453 *
5454 * Logged from:
5455 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5456 */
5457message DocsUISearchTypeReported {
5458 optional android.stats.docsui.SearchType search_type = 1;
5459}
5460
5461/**
5462 * Logs the search mode.
5463 *
5464 * Logged from:
5465 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5466 */
5467message DocsUISearchModeReported {
5468 optional android.stats.docsui.SearchMode search_mode = 1;
5469}
5470
5471/**
5472 * Logs the pick result information.
5473 *
5474 * Logged from:
5475 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5476 */
5477message DocsUIPickResultReported {
5478 optional int32 total_action_count = 1;
5479 optional int64 duration_millis = 2;
5480 optional int32 file_count= 3;
5481 optional bool is_searching = 4;
5482 optional android.stats.docsui.Root picked_from = 5;
5483 optional android.stats.docsui.MimeType mime_type = 6;
5484 optional int32 repeatedly_pick_times = 7;
5485}
5486
5487/**
Ben Murdochbab399f62018-12-06 11:01:38 +00005488 * Logs when an app's memory is compacted.
5489 *
5490 * Logged from:
5491 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5492 */
5493message AppCompacted {
5494 // The pid of the process being compacted.
5495 optional int32 pid = 1;
5496
5497 // The name of the process being compacted.
5498 optional string process_name = 2;
5499
5500 // The type of compaction.
5501 enum Action {
5502 UNKNOWN = 0;
5503 SOME = 1;
5504 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005505 PERSISTENT = 3;
5506 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00005507 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005508 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00005509
5510 // Total RSS in kilobytes consumed by the process prior to compaction.
5511 optional int64 before_rss_total_kilobytes = 4;
5512
5513 // File RSS in kilobytes consumed by the process prior to compaction.
5514 optional int64 before_rss_file_kilobytes = 5;
5515
5516 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5517 optional int64 before_rss_anon_kilobytes = 6;
5518
5519 // Swap in kilobytes consumed by the process prior to compaction.
5520 optional int64 before_swap_kilobytes = 7;
5521
5522 // Total RSS in kilobytes consumed by the process after compaction.
5523 optional int64 after_rss_total_kilobytes = 8;
5524
5525 // File RSS in kilobytes consumed by the process after compaction.
5526 optional int64 after_rss_file_kilobytes = 9;
5527
5528 // Anonymous RSS in kilobytes consumed by the process after compaction.
5529 optional int64 after_rss_anon_kilobytes = 10;
5530
5531 // Swap in kilobytes consumed by the process after compaction.
5532 optional int64 after_swap_kilobytes = 11;
5533
5534 // The time taken to perform compaction in milliseconds.
5535 optional int64 time_to_compact_millis = 12;
5536
5537 // The last compaction action performed for this app.
5538 optional Action last_action = 13;
5539
Ben Murdoch01720b82018-12-19 18:03:44 +00005540 // The last time that compaction was attempted on this process in milliseconds
5541 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5542 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00005543
Ben Murdoch885c21b2019-03-15 18:02:04 +00005544 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005545 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00005546
5547 // The process state at the time of compaction.
5548 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005549
5550 // Free ZRAM in kilobytes before compaction.
5551 optional int64 before_zram_free_kilobytes = 17;
5552
5553 // Free ZRAM in kilobytes after compaction.
5554 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00005555}
lifr157fc552018-12-12 16:38:04 +08005556
5557/**
lifrb6b90b62019-03-29 00:40:17 +08005558 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5559 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5560 *
lifr1f74b052019-04-16 22:16:30 +08005561 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5562 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5563 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5564 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005565 */
5566message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08005567 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005568
lifr1f74b052019-04-16 22:16:30 +08005569 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005570
5571 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005572 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005573
lifr1f74b052019-04-16 22:16:30 +08005574 // Only valid for event_type = EVENT_GETADDRINFO.
5575 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005576
lifr1f74b052019-04-16 22:16:30 +08005577 // Flags passed to android_res_nsend() defined in multinetwork.h
5578 // Only valid for event_type = EVENT_RESNSEND.
5579 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005580
lifrad9becc2019-05-20 11:04:41 +08005581 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005582
5583 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08005584 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005585
5586 // Additional pass-through fields opaque to statsd.
5587 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08005588 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08005589
5590 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
5591 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08005592}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005593
5594/**
5595 * Logs when a data stall event occurs.
5596 *
5597 * Log from:
5598 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5599 */
5600message DataStallEvent {
5601 // Data stall evaluation type.
5602 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5603 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5604 optional int32 evaluation_type = 1;
5605 // See definition in data_stall_event.proto.
5606 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5607 // See definition in data_stall_event.proto.
5608 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5609 // See definition in data_stall_event.proto.
5610 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5611 // See definition in data_stall_event.proto.
5612 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5613 // See definition in data_stall_event.proto.
5614 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5615}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005616
5617/*
5618 * Logs when RescueParty resets some set of experiment flags.
5619 *
5620 * Logged from:
5621 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5622 */
5623message RescuePartyResetReported {
5624 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5625 optional int32 rescue_level = 1;
5626}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005627
5628/**
5629 * Logs when signed config is received from an APK, and if that config was applied successfully.
5630 * Logged from:
5631 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5632 */
5633message SignedConfigReported {
5634 enum Type {
5635 UNKNOWN_TYPE = 0;
5636 GLOBAL_SETTINGS = 1;
5637 }
5638 optional Type type = 1;
5639
5640 // The final status of the signed config received.
5641 enum Status {
5642 UNKNOWN_STATUS = 0;
5643 APPLIED = 1;
5644 BASE64_FAILURE_CONFIG = 2;
5645 BASE64_FAILURE_SIGNATURE = 3;
5646 SECURITY_EXCEPTION = 4;
5647 INVALID_CONFIG = 5;
5648 OLD_CONFIG = 6;
5649 SIGNATURE_CHECK_FAILED = 7;
5650 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005651 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005652 }
5653 optional Status status = 2;
5654
5655 // The version of the signed config processed.
5656 optional int32 version = 3;
5657
5658 // The package name that the config was extracted from.
5659 optional string from_package = 4;
5660
5661 enum Key {
5662 NO_KEY = 0;
5663 DEBUG = 1;
5664 PRODUCTION = 2;
5665 }
5666 // Which key was used to verify the config.
5667 optional Key verified_with = 5;
5668}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005669
5670/*
5671 * Logs GNSS Network-Initiated (NI) location events.
5672 *
5673 * Logged from:
5674 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5675 */
5676message GnssNiEventReported {
5677 // The type of GnssNiEvent.
5678 enum EventType {
5679 UNKNOWN = 0;
5680 NI_REQUEST = 1;
5681 NI_RESPONSE = 2;
5682 }
5683 optional EventType event_type = 1;
5684
5685 // An ID generated by HAL to associate NI notifications and UI responses.
5686 optional int32 notification_id = 2;
5687
5688 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005689 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005690
5691 // NI requires notification.
5692 optional bool need_notify = 4;
5693
5694 // NI requires verification.
5695 optional bool need_verify = 5;
5696
5697 // NI requires privacy override, no notification/minimal trace.
5698 optional bool privacy_override = 6;
5699
5700 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5701 // seconds.
5702 optional int32 timeout = 7;
5703
5704 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005705 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005706
5707 // String representing the requester of the network inititated location request.
5708 optional string requestor_id = 9;
5709
5710 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5711 // network initiated location request.
5712 optional string text = 10;
5713
5714 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005715 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005716
5717 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005718 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005719
5720 // True if SUPL ES is enabled.
5721 optional bool is_supl_es_enabled = 13;
5722
5723 // True if GNSS location is enabled.
5724 optional bool is_location_enabled = 14;
5725
5726 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005727 optional android.server.location.GnssUserResponseType user_response = 15;
5728}
5729
5730/**
5731 * Logs GNSS non-framework (NFW) location notification.
5732 *
5733 * Logged from:
5734 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5735 */
5736message GnssNfwNotificationReported {
5737 // Package name of the Android proxy application representing the non-framework entity that
5738 // requested location. Set to empty string if unknown.
5739 optional string proxy_app_package_name = 1;
5740
5741 // Protocol stack that initiated the non-framework location request.
5742 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5743
5744 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5745 // set to empty string. This field is opaque to the framework and used for logging purposes.
5746 optional string other_protocol_stack_name = 3;
5747
5748 // Source initiating/receiving the location information.
5749 optional android.server.location.NfwRequestor requestor = 4;
5750
5751 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5752 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5753 // and used for logging purposes.
5754 optional string requestor_id = 5;
5755
5756 // Indicates whether location information was provided for this request.
5757 optional android.server.location.NfwResponseType response_type = 6;
5758
5759 // True if the device is in user initiated emergency session.
5760 optional bool in_emergency_mode = 7;
5761
5762 // True if cached location is provided.
5763 optional bool is_cached_location = 8;
5764
5765 // True if proxy app permission mismatch between framework and GNSS HAL.
5766 optional bool is_permission_mismatched = 9;
5767}
5768
5769/**
5770 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5771 *
5772 * Logged from:
5773 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5774 */
5775message GnssConfigurationReported {
5776 // SUPL host name.
5777 optional string supl_host = 1;
5778
5779 // SUPL port number.
5780 optional int32 supl_port = 2;
5781
5782 // C2K host name.
5783 optional string c2k_host = 3;
5784
5785 // C2K port number.
5786 optional int32 c2k_port = 4;
5787
5788 // The SUPL version requested by Carrier.
5789 optional int32 supl_ver = 5;
5790
5791 // The SUPL mode.
5792 optional android.server.location.SuplMode supl_mode = 6;
5793
5794 // True if NI emergency SUPL restrictions is enabled.
5795 optional bool supl_es = 7;
5796
5797 // LTE Positioning Profile settings
5798 optional android.server.location.LppProfile lpp_profile = 8;
5799
5800 // Positioning protocol on A-Glonass system.
5801 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5802
5803 // True if emergency PDN is used. Otherwise, regular PDN is used.
5804 optional bool use_emergency_pdn_for_emergency_supl= 10;
5805
5806 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5807 optional android.server.location.GpsLock gps_lock = 11;
5808
5809 // Number of seconds to extend the emergency session duration post emergency call.
5810 optional int32 es_extension_sec = 12;
5811
5812 // The full list of package names of proxy Android applications representing the non-framework
5813 // location access entities (on/off the device) for which the framework user has granted
5814 // non-framework location access permission. The package names are concatenated in one string
5815 // with spaces as separators.
5816 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005817}
Jack Yu95b64f32018-12-13 18:26:11 +08005818
5819/**
5820 * Logs when a NFC device's error occurred.
5821 * Logged from:
5822 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5823 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5824 */
5825message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005826 enum Type {
5827 UNKNOWN = 0;
5828 CMD_TIMEOUT = 1;
5829 ERROR_NOTIFICATION = 2;
5830 AID_OVERFLOW = 3;
5831 }
5832 optional Type type = 1;
5833 // If it's nci cmd timeout, log the timeout command.
5834 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005835
Alex Salod7c3eef2019-01-25 14:43:27 -08005836 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005837}
5838
5839/**
5840 * Logs when a NFC device's state changed event
5841 * Logged from:
5842 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5843 */
5844message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005845 enum State {
5846 UNKNOWN = 0;
5847 OFF = 1;
5848 ON = 2;
5849 ON_LOCKED = 3; // Secure Nfc enabled.
5850 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5851 }
5852 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005853}
5854
5855/**
5856 * Logs when a NFC Beam Transaction occurred.
5857 * Logged from:
5858 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5859 */
5860message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005861 enum Operation {
5862 UNKNOWN = 0;
5863 SEND = 1;
5864 RECEIVE = 2;
5865 }
5866 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005867}
5868
5869/**
5870 * Logs when a NFC Card Emulation Transaction occurred.
5871 * Logged from:
5872 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5873 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5874 */
5875message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005876 enum Category {
5877 UNKNOWN = 0;
5878 HCE_PAYMENT = 1;
5879 HCE_OTHER = 2;
5880 OFFHOST = 3;
5881 }
5882 // Transaction belongs to HCE payment or HCE other category, or offhost.
5883 optional Category category = 1;
5884 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5885 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005886}
5887
5888/**
5889 * Logs when a NFC Tag event occurred.
5890 * Logged from:
5891 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5892 */
5893message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005894 enum Type {
5895 UNKNOWN = 0;
5896 URL = 1;
5897 BT_PAIRING = 2;
5898 PROVISION = 3;
5899 WIFI_CONNECT = 4;
5900 APP_LAUNCH = 5;
5901 OTHERS = 6;
5902 }
5903 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005904}
5905
5906/**
5907 * Logs when Hce transaction triggered
5908 * Logged from:
5909 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5910 */
5911message NfcHceTransactionOccurred {
5912 // The latency period(in microseconds) it took for the first HCE data
5913 // exchange.
5914 optional uint32 latency_micros = 1;
5915}
5916
5917/**
5918 * Logs when SecureElement state event changed
5919 * Logged from:
5920 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5921 */
5922message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005923 enum State {
5924 UNKNOWN = 0;
5925 INITIALIZED = 1;
5926 DISCONNECTED = 2;
5927 CONNECTED = 3;
5928 HALCRASH = 4;
5929 }
5930 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005931
Alex Salod7c3eef2019-01-25 14:43:27 -08005932 optional string state_change_reason = 2;
5933 // SIMx or eSEx.
5934 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005935}
5936
5937/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005938 * Information about a permission grant request
5939 */
5940message PermissionGrantRequestResultReported {
5941 // unique value identifying an API call. A API call might result in multiple of these atoms
5942 optional int64 request_id = 1;
5943
5944 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00005945 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005946
5947 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00005948 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005949
5950 // The permission to be granted
5951 optional string permission_name = 4;
5952
5953 // If the permission was explicitly requested via the API or added by the system
5954 optional bool is_implicit = 5;
5955
5956 enum Result {
5957 UNDEFINED = 0;
5958 // permission request was ignored
5959 IGNORED = 1;
5960 // permission request was ignored because it was user fixed
5961 IGNORED_USER_FIXED = 2;
5962 // permission request was ignored because it was policy fixed
5963 IGNORED_POLICY_FIXED = 3;
5964 // permission was granted by user action
5965 USER_GRANTED = 4;
5966 // permission was automatically granted
5967 AUTO_GRANTED = 5;
5968 // permission was denied by user action
5969 USER_DENIED = 6;
5970 // permission was denied with prejudice by the user
5971 USER_DENIED_WITH_PREJUDICE = 7;
5972 // permission was automatically denied
5973 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07005974 // permission request was ignored because permission is restricted
5975 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01005976 // one time permission was granted by user action
5977 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00005978 // user ignored request by leaving the request screen without choosing any option
5979 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08005980 // user granted the permission after being linked to settings
5981 USER_GRANTED_IN_SETTINGS = 12;
5982 // user denied the permission after being linked to settings
5983 USER_DENIED_IN_SETTINGS = 13;
5984 // user denied the permission with prejudice after being linked to settings
5985 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
5986 // permission was automatically revoked after one-time permission expired
5987 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005988 }
5989 // The result of the permission grant
5990 optional Result result = 6;
5991}
5992
5993/**
Jack Yu95b64f32018-12-13 18:26:11 +08005994 * Logs when Omapi API used
5995 * Logged from:
5996 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5997 */
5998message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005999 enum Operation {
6000 UNKNOWN = 0;
6001 OPEN_CHANNEL = 1;
6002 }
6003 optional Operation operation = 1;
6004 // SIMx or eSEx.
6005 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006006
Alex Salod7c3eef2019-01-25 14:43:27 -08006007 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006008}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006009
6010/**
Alex Saloa060aee2019-01-21 14:36:41 -08006011 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6012 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006013 * Logged from:
6014 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6015 */
6016message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006017 optional int64 dispatch_latency_millis = 1;
6018}
6019
6020/**
6021 * Logs AttentionManagerService attention check result.
6022 *
6023 * Logged from:
6024 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6025 */
6026message AttentionManagerServiceResultReported {
6027 // See core/java/android/service/attention/AttentionService.java
6028 enum AttentionCheckResult {
6029 UNKNOWN = 20;
6030 ATTENTION_SUCCESS_ABSENT = 0;
6031 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006032 ATTENTION_FAILURE_UNKNOWN = 2;
6033 ATTENTION_FAILURE_CANCELLED = 3;
6034 ATTENTION_FAILURE_PREEMPTED = 4;
6035 ATTENTION_FAILURE_TIMED_OUT = 5;
6036 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006037 }
6038 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006039}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006040
6041/**
6042 * Logs when an adb connection changes state.
6043 *
6044 * Logged from:
6045 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6046 */
6047message AdbConnectionChanged {
6048 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6049 // previously selected for this system.
6050 optional int64 last_connection_time_millis = 1;
6051
6052 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6053 // to reconnect via adb without user interaction.
6054 optional int64 auth_window_millis = 2;
6055
6056 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6057 optional android.debug.AdbConnectionStateEnum state = 3;
6058
6059 // True if the 'always allow' option was selected for this system.
6060 optional bool always_allow = 4;
6061}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006062
6063/*
6064 * Logs the reported speech DSP status.
6065 *
6066 * Logged from:
6067 * Vendor audio implementation.
6068 */
6069message SpeechDspStatReported {
6070 // The total Speech DSP uptime in milliseconds.
6071 optional int32 total_uptime_millis = 1;
6072 // The total Speech DSP downtime in milliseconds.
6073 optional int32 total_downtime_millis = 2;
6074 optional int32 total_crash_count = 3;
6075 optional int32 total_recover_count = 4;
6076}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006077
6078/**
6079 * Logs USB connector contaminant status.
6080 *
6081 * Logged from: USB Service.
6082 */
6083message UsbContaminantReported {
6084 optional string id = 1;
6085 optional android.service.usb.ContaminantPresenceStatus status = 2;
6086}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006087
6088/**
6089 * This atom is for debugging purpose.
6090 */
6091message DebugElapsedClock {
6092 // Monotically increasing value for each pull.
6093 optional int64 pull_count = 1;
6094 // Time from System.elapsedRealtime.
6095 optional int64 elapsed_clock_millis = 2;
6096 // Time from System.elapsedRealtime.
6097 optional int64 same_elapsed_clock_millis = 3;
6098 // Diff between current elapsed time and elapsed time from previous pull.
6099 optional int64 elapsed_clock_diff_millis = 4;
6100
6101 enum Type {
6102 TYPE_UNKNOWN = 0;
6103 ALWAYS_PRESENT = 1;
6104 PRESENT_ON_ODD_PULLS = 2;
6105 }
6106 // Type of behavior for the pulled data.
6107 optional Type type = 5;
6108}
6109
6110/**
6111 * This atom is for debugging purpose.
6112 */
6113message DebugFailingElapsedClock {
6114 // Monotically increasing value for each pull.
6115 optional int64 pull_count = 1;
6116 // Time from System.elapsedRealtime.
6117 optional int64 elapsed_clock_millis = 2;
6118 // Time from System.elapsedRealtime.
6119 optional int64 same_elapsed_clock_millis = 3;
6120 // Diff between current elapsed time and elapsed time from previous pull.
6121 optional int64 elapsed_clock_diff_millis = 4;
6122}
Steven Wuacef6bb2019-01-23 14:21:17 -05006123
6124/** Logs System UI bubbles event changed.
6125 *
6126 * Logged from:
6127 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6128 */
6129message BubbleUIChanged {
6130
6131 // The app package that is posting the bubble.
6132 optional string package_name = 1;
6133
6134 // The notification channel that is posting the bubble.
6135 optional string notification_channel = 2;
6136
6137 // The notification id associated with the posted bubble.
6138 optional int32 notification_id = 3;
6139
6140 // The position of the bubble within the bubble stack.
6141 optional int32 position = 4;
6142
6143 // The total number of bubbles within the bubble stack.
6144 optional int32 total_number = 5;
6145
6146 // User interactions with the bubble.
6147 enum Action {
6148 UNKNOWN = 0;
6149 POSTED = 1;
6150 UPDATED = 2;
6151 EXPANDED = 3;
6152 COLLAPSED = 4;
6153 DISMISSED = 5;
6154 STACK_DISMISSED = 6;
6155 STACK_MOVED = 7;
6156 HEADER_GO_TO_APP = 8;
6157 HEADER_GO_TO_SETTINGS = 9;
6158 PERMISSION_OPT_IN = 10;
6159 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006160 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006161 SWIPE_LEFT = 13;
6162 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006163 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04006164 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006165 }
6166 optional Action action = 6;
6167
6168 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6169 optional float normalized_x_position = 7;
6170 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006171
6172 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6173 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006174
6175 // Whether the bubble is an on-going one.
6176 optional bool is_ongoing = 10;
6177
6178 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006179 // This is deprecated and the value should be ignored.
6180 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006181}
Kweku Adams8845d012018-12-11 20:06:45 -08006182
6183/**
Steven Wu552f63f2019-02-05 13:41:36 -05006184 * Logs System UI bubbles developer errors.
6185 *
6186 * Logged from:
6187 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6188 */
6189message BubbleDeveloperErrorReported {
6190
6191 // The app package that is posting the bubble.
6192 optional string package_name = 1;
6193
6194 // Bubble developer error type enums.
6195 enum Error {
6196 UNKNOWN = 0;
6197 ACTIVITY_INFO_MISSING = 1;
6198 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6199 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6200 }
6201 optional Error error = 2 [default = UNKNOWN];
6202}
6203
6204/**
Kweku Adams8845d012018-12-11 20:06:45 -08006205 * Logs that a constraint for a scheduled job has changed.
6206 *
6207 * Logged from:
6208 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6209 */
6210message ScheduledJobConstraintChanged {
6211 repeated AttributionNode attribution_node = 1;
6212
6213 // Name of the job.
6214 optional string job_name = 2;
6215
6216 optional com.android.server.job.ConstraintEnum constraint = 3;
6217
6218 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006219 UNKNOWN = 0;
6220 UNSATISFIED = 1;
6221 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006222 }
6223 optional State state = 4;
6224}
Alex Salod7c3eef2019-01-25 14:43:27 -08006225
6226/**
6227 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6228 * returns true.
6229 *
6230 * Logged from:
6231 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6232 */
6233message ScreenTimeoutExtensionReported {
6234 // Describes how many times in a row did the power manager reset the screen off timeout.
6235 optional uint32 consecutive_timeout_extended_count = 1;
6236}
Hui Yu885aca12019-01-10 17:11:34 -08006237
6238/*
6239* Logs number of milliseconds it takes to start a process.
6240* The definition of app process start time is from the app launch time to
6241* the time that Zygote finished forking the app process and loaded the
6242* application package's java classes.
6243
6244* This metric is different from AppStartOccurred which is for foreground
6245* activity only.
6246
6247* ProcessStartTime can report all processes (both foreground and background)
6248* start time.
6249*
6250* Logged from:
6251* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6252*/
6253message ProcessStartTime {
6254 // The uid of the ProcessRecord.
6255 optional int32 uid = 1 [(is_uid) = true];
6256
6257 // The process pid.
6258 optional int32 pid = 2;
6259
6260 // The process name.
6261 // Usually package name, "system" for system server.
6262 // Provided by ActivityManagerService.
6263 optional string process_name = 3;
6264
6265 enum StartType {
6266 UNKNOWN = 0;
6267 WARM = 1;
6268 HOT = 2;
6269 COLD = 3;
6270 }
6271
6272 // The start type.
6273 optional StartType type = 4;
6274
6275 // The elapsed realtime at the start of the process.
6276 optional int64 process_start_time_millis = 5;
6277
6278 // Number of milliseconds it takes to reach bind application.
6279 optional int32 bind_application_delay_millis = 6;
6280
6281 // Number of milliseconds it takes to finish start of the process.
6282 optional int32 process_start_delay_millis = 7;
6283
6284 // hostingType field in ProcessRecord, the component type such as "activity",
6285 // "service", "content provider", "broadcast" or other strings.
6286 optional string hosting_type = 8;
6287
6288 // hostingNameStr field in ProcessRecord. The component class name that runs
6289 // in this process.
6290 optional string hosting_name = 9;
6291}
6292
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006293/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006294 * Track Media Codec usage
6295 * Logged from:
6296 * frameworks/av/media/libstagefright/MediaCodec.cpp
6297 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6298 */
6299message MediametricsCodecReported {
6300 optional int64 timestamp_nanos = 1;
6301 optional string package_name = 2;
6302 optional int64 package_version_code = 3;
6303 optional int64 media_apex_version = 4;
6304
6305 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6306}
6307
6308/**
6309 * Track Media Extractor (pulling video/audio streams out of containers) usage
6310 * Logged from:
6311 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6312 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6313 */
6314message MediametricsExtractorReported {
6315 optional int64 timestamp_nanos = 1;
6316 optional string package_name = 2;
6317 optional int64 package_version_code = 3;
6318 optional int64 media_apex_version = 4;
6319
6320 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6321}
6322
6323/**
6324 * Track how we arbitrate between microphone/input requests.
6325 * Logged from
6326 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6327 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6328 */
6329message MediametricsAudiopolicyReported {
6330 optional int64 timestamp_nanos = 1;
6331 optional string package_name = 2;
6332 optional int64 package_version_code = 3;
6333 optional int64 media_apex_version = 4;
6334
6335 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6336}
6337
6338/**
6339 * Track how we arbitrate between microphone requests.
6340 * Logged from
6341 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6342 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6343 */
6344message MediametricsAudiorecordReported {
6345 optional int64 timestamp_nanos = 1;
6346 optional string package_name = 2;
6347 optional int64 package_version_code = 3;
6348 optional int64 media_apex_version = 4;
6349
6350 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6351}
6352
6353/**
6354 * Track how we arbitrate between microphone/input requests.
6355 * Logged from
6356 * frameworks/av/media/libnblog/ReportPerformance.cpp
6357 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6358 */
6359message MediametricsAudiothreadReported {
6360 optional int64 timestamp_nanos = 1;
6361 optional string package_name = 2;
6362 optional int64 package_version_code = 3;
6363 optional int64 media_apex_version = 4;
6364
6365 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6366}
6367
6368/**
6369 * Track how we arbitrate between microphone/input requests.
6370 * Logged from
6371 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6372 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6373 */
6374message MediametricsAudiotrackReported {
6375 optional int64 timestamp_nanos = 1;
6376 optional string package_name = 2;
6377 optional int64 package_version_code = 3;
6378 optional int64 media_apex_version = 4;
6379
6380 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6381}
6382
6383/**
6384 * Track information about DRM framework performance
6385 * Logged from
6386 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6387 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6388 */
6389message MediametricsMediadrmReported {
6390 optional int64 timestamp_nanos = 1;
6391 optional string package_name = 2;
6392 optional int64 package_version_code = 3;
6393 optional int64 media_apex_version = 4;
6394
6395 // vendor+description tell about which DRM plugin is in use on this device
6396 optional string vendor = 5;
6397 optional string description = 6;
6398 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6399 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6400}
6401
6402/**
6403 * Track information about the widevine DRM plugin performance
6404 * Logged from
6405 * vendor/widevine/libwvdrmengine/cdm/metrics
6406 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6407 */
6408message MediametricsDrmWidevineReported {
6409 optional int64 timestamp_nanos = 1;
6410 optional string package_name = 2;
6411 optional int64 package_version_code = 3;
6412 optional int64 media_apex_version = 4;
6413
6414 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6415}
6416
6417/**
6418 * Track information about recordings (e.g. camcorder)
6419 * Logged from
6420 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6421 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6422 */
6423message MediametricsRecorderReported {
6424 optional int64 timestamp_nanos = 1;
6425 optional string package_name = 2;
6426 optional int64 package_version_code = 3;
6427 optional int64 media_apex_version = 4;
6428
6429 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6430}
6431
6432/**
6433 * Track Media Player usage
6434 * Logged from:
6435 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6436 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6437 */
6438message MediametricsNuPlayerReported {
6439 optional int64 timestamp_nanos = 1;
6440 optional string package_name = 2;
6441 optional int64 package_version_code = 3;
6442 optional int64 media_apex_version = 4;
6443
6444 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6445}
6446
6447/**
Robert Shiha4beed32019-08-19 14:15:23 -07006448 * Track Legacy DRM usage
6449 * Logged from
6450 * frameworks/av/drm/drmserver/DrmManager.cpp
6451 */
6452message MediametricsDrmManagerReported {
6453 optional int64 timestamp_nanos = 1;
6454 optional string package_name = 2;
6455 optional int64 package_version_code = 3;
6456 optional int64 media_apex_version = 4;
6457
6458 enum Method {
6459 METHOD_NOT_FOUND = -1;
6460 GET_CONSTRAINTS = 0;
6461 GET_METADATA = 1;
6462 CAN_HANDLE = 2;
6463 PROCESS_DRM_INFO = 3;
6464 ACQUIRE_DRM_INFO = 4;
6465 SAVE_RIGHTS = 5;
6466 GET_ORIGINAL_MIME_TYPE = 6;
6467 GET_DRM_OBJECT_TYPE = 7;
6468 CHECK_RIGHTS_STATUS = 8;
6469 REMOVE_RIGHTS = 9;
6470 REMOVE_ALL_RIGHTS = 10;
6471 OPEN_CONVERT_SESSION = 11;
6472 OPEN_DECRYPT_SESSION = 12;
6473 }
6474
6475 // plugin_id+description inform which Legacy DRM plugins are still in use on device
6476 optional string plugin_id = 5;
6477 optional string description = 6;
6478 optional Method method = 7;
6479 optional string mime_types = 8;
6480}
6481
6482/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006483 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00006484 * Pulled from: StatsCompanionService
6485*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006486message DangerousPermissionState {
6487 // Name of the permission
6488 optional string permission_name = 1;
6489
6490 // Uid of the package
6491 optional int32 uid = 2 [(is_uid) = true];
6492
6493 // Package requesting the permission
6494 optional string package_name = 3;
6495
6496 // If the permission is granted to the uid
6497 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01006498
6499 // Permission flags as per android.content.pm.PermissionFlags
6500 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006501}
6502
Michael Groover4a0ca942019-01-24 17:41:25 -08006503/**
6504 * Logs when a package is denied access to a device identifier based on the new access requirements.
6505 *
6506 * Logged from:
6507 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6508 */
6509message DeviceIdentifierAccessDenied {
6510 // The name of the package denied access to the requested device identifier.
6511 optional string package_name = 1;
6512
6513 // The name of the device identifier method the package attempted to invoke.
6514 optional string method_name = 2;
6515
6516 // True if the package is preinstalled.
6517 optional bool is_preinstalled = 3;
6518
6519 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08006520 // Starting from Android 11, this boolean is not set and will always be false.
6521 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08006522}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006523
6524/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006525 * Pulls the ongoing mainline install train version code.
6526 * Pulled from StatsCompanionService
6527 */
6528message TrainInfo {
6529 optional int64 train_version_code = 1;
6530
6531 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006532
6533 optional string train_name = 3;
6534
6535 enum Status {
6536 UNKNOWN = 0;
6537 INSTALL_REQUESTED = 1;
6538 INSTALL_STARTED = 2;
6539 INSTALL_STAGED_NOT_READY = 3;
6540 INSTALL_STAGED_READY = 4;
6541 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006542 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6543 // and INSTALL_FAILURE_COMMIT.
6544 INSTALL_FAILURE = 6 [deprecated = true];
6545 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006546 INSTALL_CANCELLED = 7;
6547 INSTALLER_ROLLBACK_REQUESTED = 8;
6548 INSTALLER_ROLLBACK_INITIATED = 9;
6549 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6550 INSTALLER_ROLLBACK_STAGED = 11;
6551 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6552 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6553 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6554 INSTALLER_ROLLBACK_SUCCESS = 15;
6555 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006556 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6557 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6558 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6559 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6560 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6561 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006562 INSTALL_FAILURE_DOWNLOAD = 23;
6563 INSTALL_FAILURE_STATE_MISMATCH = 24;
6564 INSTALL_FAILURE_COMMIT = 25;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006565 }
6566 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006567}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006568
6569/**
6570 * Logs the gesture stage changed event.
6571 *
6572 * Logged from:
6573 * frameworks/base/packages/SystemUI/
6574 */
6575message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006576 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006577}
6578
6579/**
6580 * Logs the feedback type.
6581 *
6582 * Logged from:
6583 * frameworks/base/packages/SystemUI/
6584 */
6585message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006586 // Whether or not the gesture was used.
6587 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006588}
6589
6590/**
6591 * Logs the progress.
6592 *
6593 * Logged from:
6594 * frameworks/base/packages/SystemUI/
6595 */
6596message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006597 // [0,100] progress for the assist gesture.
6598 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006599}
Neil Fullerdb14b482019-02-05 19:44:44 +00006600
6601/*
6602 * Information about the time zone data on a device.
6603 */
6604message TimeZoneDataInfo {
6605 // A version identifier for the data set on device. e.g. "2018i"
6606 optional string tzdb_version = 1;
6607}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006608
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006609/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006610 * Logs the GPU stats global health information.
6611 *
6612 * Logged from:
6613 * frameworks/native/services/gpuservice/gpustats/
6614 */
6615message GpuStatsGlobalInfo {
6616 // Package name of the gpu driver.
6617 optional string driver_package_name = 1;
6618
6619 // Version name of the gpu driver.
6620 optional string driver_version_name = 2;
6621
6622 // Version code of the gpu driver.
6623 optional int64 driver_version_code = 3;
6624
6625 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
6626 optional int64 driver_build_time = 4;
6627
6628 // Total count of the gl driver gets loaded.
6629 optional int64 gl_loading_count = 5;
6630
6631 // Total count of the gl driver fails to be loaded.
6632 optional int64 gl_loading_failure_count = 6;
6633
6634 // Total count of the Vulkan driver gets loaded.
6635 optional int64 vk_loading_count = 7;
6636
6637 // Total count of the Vulkan driver fails to be loaded.
6638 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07006639
6640 // Api version of the system Vulkan driver.
6641 optional int32 vulkan_version = 9;
6642
6643 // Api version of the system CPU Vulkan driver.
6644 optional int32 cpu_vulkan_version = 10;
6645
6646 // Api version of the system GLES driver.
6647 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006648
6649 // Total count of the angle driver gets loaded.
6650 optional int64 angle_loading_count = 12;
6651
6652 // Total count of the angle driver fails to be loaded.
6653 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006654}
6655
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006656/**
6657 * GPU driver loading time info.
6658 */
6659message GpuDriverLoadingTime {
6660 // List of all the driver loading times for this app. The list size is
6661 // capped at 50.
6662 repeated int64 driver_loading_time = 1;
6663}
6664
6665/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006666 * Logs the GPU stats per app health information.
6667 *
6668 * Logged from:
6669 * frameworks/native/services/gpuservice/gpustats/
6670 */
6671message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006672 // Package name of the application that loads the gpu driver. Total number
6673 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006674 optional string app_package_name = 1;
6675
6676 // Version code of the gpu driver this app loads.
6677 optional int64 driver_version_code = 2;
6678
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006679 // gl driver loading time info.
6680 optional GpuDriverLoadingTime gl_driver_loading_time = 3
6681 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006682
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006683 // Vulkan driver loading time info.
6684 optional GpuDriverLoadingTime vk_driver_loading_time = 4
6685 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006686
6687 // Angle driver loading time info.
6688 optional GpuDriverLoadingTime angle_driver_loading_time = 5
6689 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07006690
6691 // CPU Vulkan implementation is in use.
6692 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07006693
6694 // App is not doing pre-rotation correctly.
6695 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08006696
6697 // App creates GLESv1 context.
6698 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006699}
Rafal Slawikd4e87572019-03-12 13:08:38 +00006700
6701/*
6702 * Logs the size of the system ion heap.
6703 *
6704 * Pulled from StatsCompanionService.
6705 */
6706message SystemIonHeapSize {
6707 // Size of the system ion heap in bytes.
6708 optional int64 size_in_bytes = 1;
6709}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006710
Rafal Slawik77987ed2019-06-17 12:28:23 +01006711/*
6712 * Logs the per-process size of the system ion heap.
6713 *
6714 * Pulled from StatsCompanionService.
6715 */
6716message ProcessSystemIonHeapSize {
6717 // The uid if available. -1 means not available.
6718 optional int32 uid = 1 [(is_uid) = true];
6719
6720 // The process name (from /proc/PID/cmdline).
6721 optional string process_name = 2;
6722
6723 // Sum of sizes of all allocations.
6724 optional int32 total_size_in_kilobytes = 3;
6725
6726 // Number of allocations.
6727 optional int32 allocation_count = 4;
6728
6729 // Size of the largest allocation.
6730 optional int32 max_size_in_kilobytes = 5;
6731}
6732
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006733/**
6734 * Push network stack events.
6735 *
6736 * Log from:
6737 * frameworks/base/packages/NetworkStack/
6738 */
6739message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08006740 // The id that indicates the event reported from NetworkStack.
6741 optional int32 event_id = 1;
6742 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006743 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
6744}
Carmen Agimofa769c152019-03-04 14:39:14 +00006745
6746/**
6747 * Logs the apps that are installed on the external storage.
6748 * Pulled from:
6749 * StatsCompanionService
6750 */
6751message AppsOnExternalStorageInfo {
6752 // The type of the external storage.
6753 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
6754 // The name of the package that is installed on the external storage.
6755 optional string package_name = 2;
6756}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07006757
6758/**
6759 * Logs the settings related to Face.
6760 * Logged from:
6761 * frameworks/base/services/core/java/com/android/server/stats
6762 */
6763message FaceSettings {
6764 // Whether or not face unlock is allowed on Keyguard.
6765 optional bool unlock_keyguard_enabled = 1;
6766 // Whether or not face unlock dismisses the Keyguard.
6767 optional bool unlock_dismisses_keyguard = 2;
6768 // Whether or not face unlock requires attention.
6769 optional bool unlock_attention_required = 3;
6770 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
6771 optional bool unlock_app_enabled = 4;
6772 // Whether or not face unlock always requires user confirmation.
6773 optional bool unlock_always_require_confirmation = 5;
6774 // Whether or not a diverse set of poses are required during enrollment.
6775 optional bool unlock_diversity_required = 6;
6776}
Maggie White442b6312019-04-05 16:26:44 -07006777
6778/**
6779 * Logs cooling devices maintained by the kernel.
6780 *
6781 * Pulled from StatsCompanionService.java
6782 */
6783message CoolingDevice {
6784 // The type of cooling device being reported. Eg. CPU, GPU...
6785 optional android.os.CoolingTypeEnum device_location = 1;
6786 // The name of the cooling device source. Eg. CPU0
6787 optional string device_name = 2;
6788 // Current throttle state of the cooling device. The value can any unsigned
6789 // integer between 0 and max_state defined in its driver. 0 means device is
6790 // not in throttling, higher value means deeper throttling.
6791 optional int32 state = 3;
6792}
Ben Blount763a5d52019-04-10 11:48:58 -07006793
6794/**
6795 * Intelligence has several counter-type events that don't warrant a
6796 * full separate atom. These are primarily API call counters but also include
6797 * counters for feature usage and specific failure modes.
6798 *
6799 * Logged from the Intelligence mainline module.
6800 */
6801message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07006802 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07006803 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07006804 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07006805 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07006806 // How many times the event occured (to report a batch of high frequency events).
6807 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07006808 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07006809 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07006810}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07006811
6812/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07006813 * Logs when Car Power state changed.
6814 *
6815 * Logged from:
6816 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6817 */
6818message CarPowerStateChanged {
6819 // States come from CpmsState in CarPowerManagementService.java.
6820 enum State {
6821 WAIT_FOR_VHAL = 0;
6822 ON = 1;
6823 SHUTDOWN_PREPARE = 2;
6824 WAIT_FOR_FINISH = 3;
6825 SUSPEND = 4;
6826 SIMULATE_SLEEP = 5;
6827 }
6828 optional State state = 1;
6829}
6830
6831/**
6832 * Logs whether GarageMode is entered.
6833 *
6834 * Logged from:
6835 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6836 */
6837message GarageModeInfo {
6838 // Whether GarageMode is entered.
6839 optional bool is_garage_mode = 1;
6840}
Martijn Coenencd95d462019-04-25 17:09:45 +02006841
6842/**
6843 * Historical app ops data per package.
6844 */
6845message AppOps {
6846 // Uid of the package requesting the op
6847 optional int32 uid = 1 [(is_uid) = true];
6848
6849 // Nmae of the package performing the op
6850 optional string package_name = 2;
6851
6852 // operation id; maps to the OP_* constants in AppOpsManager.java
6853 optional int32 op_id = 3;
6854
6855 // The number of times the op was granted while the app was in the
6856 // foreground (only for trusted requests)
6857 optional int64 trusted_foreground_granted_count = 4;
6858
6859 // The number of times the op was granted while the app was in the
6860 // background (only for trusted requests)
6861 optional int64 trusted_background_granted_count = 5;
6862
6863 // The number of times the op was rejected while the app was in the
6864 // foreground (only for trusted requests)
6865 optional int64 trusted_foreground_rejected_count = 6;
6866
6867 // The number of times the op was rejected while the app was in the
6868 // background (only for trusted requests)
6869 optional int64 trusted_background_rejected_count = 7;
6870
6871 // For long-running operations, total duration of the operation
6872 // while the app was in the foreground (only for trusted requests)
6873 optional int64 trusted_foreground_duration_millis = 8;
6874
6875 // For long-running operations, total duration of the operation
6876 // while the app was in the background (only for trusted requests)
6877 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00006878
6879 // Whether AppOps is guarded by Runtime permission
6880 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02006881}
Hongyi Zhang700137e2019-05-23 21:19:36 -07006882
6883/**
6884 * Location Manager API Usage information(e.g. API under usage,
6885 * API call's parameters).
6886 * Logged from:
6887 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
6888 */
6889message LocationManagerApiUsageReported {
6890
6891 // Indicating if usage starts or usage ends.
6892 optional android.stats.location.UsageState state = 1;
6893
6894 // LocationManagerService's API in use.
6895 // We can identify which API from LocationManager is
6896 // invoking current LMS API by the combination of
6897 // API parameter(e.g. is_listener_null, is_intent_null,
6898 // is_location_request_null)
6899 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
6900
6901 // Name of the package calling the API.
6902 optional string calling_package_name = 3;
6903
6904 // Type of the location provider.
6905 optional android.stats.location.ProviderType provider = 4;
6906
6907 // Quality of the location request
6908 optional android.stats.location.LocationRequestQuality quality = 5;
6909
6910 // The desired interval for active location updates, in milliseconds.
6911 // Bucketized to reduce cardinality.
6912 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
6913
6914 // Minimum distance between location updates, in meters.
6915 // Bucketized to reduce cardinality.
6916 optional android.stats.location.SmallestDisplacementBucket
6917 bucketized_smallest_displacement = 7;
6918
6919 // The number of location updates.
6920 optional int64 num_updates = 8;
6921
6922 // The request expiration time, in millisecond since boot.
6923 // Bucketized to reduce cardinality.
6924 optional android.stats.location.ExpirationBucket
6925 bucketized_expire_in = 9;
6926
6927 // Type of Callback passed in for this API.
6928 optional android.stats.location.CallbackType callback_type = 10;
6929
6930 // The radius of the central point of the alert
6931 // region, in meters. Only for API REQUEST_GEOFENCE.
6932 // Bucketized to reduce cardinality.
6933 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
6934
6935 // Activity Importance of API caller.
6936 // Categorized to 3 types that are interesting from location's perspective.
6937 optional android.stats.location.ActivityImportance activiy_importance = 12;
6938}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01006939
6940/**
6941 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
6942 */
6943message ReviewPermissionsFragmentResultReported {
6944 // unique value identifying a permission group change. A permission group change might result
6945 // in multiple of these atoms
6946 optional int64 change_id = 1;
6947
6948 // UID of package the permission belongs to
6949 optional int32 uid = 2 [(is_uid) = true];
6950
6951 // Name of package the permission belongs to
6952 optional string package_name = 3;
6953
6954 // The permission to be granted
6955 optional string permission_name = 4;
6956
6957 // The result of the permission grant
6958 optional bool permission_granted = 5;
6959}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01006960
6961/**
6962* Information about results of permission upgrade by RuntimePermissionsUpgradeController
6963* Logged from: RuntimePermissionUpdgradeController
6964*/
6965message RuntimePermissionsUpgradeResult {
6966 // Permission granted as result of upgrade
6967 optional string permission_name = 1;
6968
6969 // UID of package granted permission
6970 optional int32 uid = 2 [(is_uid) = true];
6971
6972 // Name of package granted permission
6973 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01006974}
6975
6976/**
6977* Information about a buttons presented in GrantPermissionsActivty and choice made by user
6978*/
6979message GrantPermissionsActivityButtonActions {
6980 // Permission granted as result of upgrade
6981 optional string permission_group_name = 1;
6982
6983 // UID of package granted permission
6984 optional int32 uid = 2 [(is_uid) = true];
6985
6986 // Name of package requesting permission
6987 optional string package_name = 3;
6988
6989 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
6990 // LABEL_ constants in GrantPermissionActivity.java
6991 optional int32 buttons_presented = 4;
6992
6993 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
6994 optional int32 button_clicked = 5;
6995}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01006996
6997/**
6998 * Information about LocationAccessCheck notification presented to user
6999 */
7000message LocationAccessCheckNotificationAction {
7001
7002 // id which identifies single session of user interacting with permission controller
7003 optional int64 session_id = 1;
7004
7005 // Uid of package for which location access check is presented
7006 optional int32 package_uid = 2;
7007
7008 // Name of package for which location access check is presented
7009 optional string package_name = 3;
7010
7011 enum Result {
7012 UNDEFINED = 0;
7013 // notification was presented to the user
7014 NOTIFICATION_PRESENTED = 1;
7015 // notification was declined by the user
7016 NOTIFICATION_DECLINED = 2;
7017 // notification was clicked by the user
7018 NOTIFICATION_CLICKED = 3;
7019 }
7020
7021 // View / interaction recorded
7022 optional Result result = 4;
7023}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007024
7025/**
7026 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7027 */
7028message AppPermissionFragmentActionReported {
7029 // id which identifies single session of user interacting with permission controller
7030 optional int64 session_id = 1;
7031
7032 // unique value identifying a permission group change. A permission group change might result
7033 // in multiple of these atoms
7034 optional int64 change_id = 2;
7035
7036 // UID of package the permission belongs to
7037 optional int32 uid = 3 [(is_uid) = true];
7038
7039 // Name of package the permission belongs to
7040 optional string package_name = 4;
7041
7042 // The permission to be granted
7043 optional string permission_name = 5;
7044
7045 // The result of the permission grant
7046 optional bool permission_granted = 6;
7047}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007048
7049/**
7050* Information about a AppPermissionFragment viewed by user
7051*/
7052message AppPermissionFragmentViewed {
7053 // id which identifies single session of user interacting with permission controller
7054 optional int64 session_id = 1;
7055
7056 // UID of package for which permissions are viewed
7057 optional int32 uid = 2 [(is_uid) = true];
7058
7059 // Name of package for which permissions are viewed
7060 optional string package_name = 3;
7061
7062 // Permission group viewed
7063 optional string permission_group_name = 4;
7064}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007065
7066/**
7067* Information about a AppPermissionsFragment viewed by user
7068*/
7069message AppPermissionsFragmentViewed {
7070 // id which identifies single session of user interacting with permission controller
7071 optional int64 session_id = 1;
7072
7073 // id which identifies single view as every view might have several logging records
7074 // with different package information attached
7075 optional int64 view_id = 2;
7076
7077 // Permission group viewed
7078 optional string permission_group_name = 3;
7079
7080 // UID of package for which permissions are viewed
7081 optional int32 uid = 4 [(is_uid) = true];
7082
7083 // Name of package for which permissions are viewed
7084 optional string package_name = 5;
7085
7086 // Category in which permission is included
7087 enum Category {
7088 UNDEFINED = 0;
7089 ALLOWED = 1;
7090 ALLOWED_FOREGROUND = 2;
7091 DENIED = 3;
7092 }
7093 optional Category category = 6;
7094}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007095
7096/**
7097* Information about a PermissionAppsFragment viewed by user.
7098* Logged from ui/handheld/PermissionAppsFragment.java
7099*/
7100message PermissionAppsFragmentViewed {
7101 // id which identifies single session of user interacting with permission controller
7102 optional int64 session_id = 1;
7103
7104 // id which identifies single view as every view might have several logging records
7105 // with different package information attached
7106 optional int64 view_id = 2;
7107
7108 // Permission group viewed
7109 optional string permission_group_name = 3;
7110
7111 // UID of package for which permissions are viewed
7112 optional int32 uid = 4 [(is_uid) = true];
7113
7114 // Name of package for which permissions are viewed
7115 optional string package_name = 5;
7116
7117 // Category in which app is included
7118 enum Category {
7119 UNDEFINED = 0;
7120 ALLOWED = 1;
7121 ALLOWED_FOREGROUND = 2;
7122 DENIED = 3;
7123 }
7124 optional Category category = 6;
7125}
Tony Make2b1b672019-07-29 16:59:47 +01007126
7127/**
7128 * Logs when there is a smart selection related event.
7129 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7130 * Logged from: TextClassifierEventLogger.java
7131 */
7132message TextSelectionEvent {
7133 // A session ID.
7134 optional string session_id = 1;
7135
7136 // Event type of this event.
7137 optional android.stats.textclassifier.EventType event_type = 2;
7138
Tony Mak9c84bd22019-12-09 07:27:25 +00007139 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007140 optional string model_name = 3;
7141
7142 // Type of widget that was involved in triggering this event.
7143 optional android.stats.textclassifier.WidgetType widget_type = 4;
7144
7145 // Index of this event in a session.
7146 optional int32 event_index = 5;
7147
7148 // Entity type that is involved.
7149 optional string entity_type = 6;
7150
7151 // Relative word index of the start of the selection.
7152 optional int32 relative_word_start_index = 7;
7153
7154 // Relative word (exclusive) index of the end of the selection.
7155 optional int32 relative_word_end_index = 8;
7156
7157 // Relative word index of the start of the smart selection.
7158 optional int32 relative_suggested_word_start_index = 9;
7159
7160 // Relative word (exclusive) index of the end of the smart selection.
7161 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007162
7163 // Name of source package.
7164 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007165}
7166
7167/**
7168 * Logs when there is a smart linkify related event.
7169 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7170 * Logged from: TextClassifierEventLogger.java
7171 */
7172message TextLinkifyEvent {
7173 // A session ID.
7174 optional string session_id = 1;
7175
7176 // Event type of this event.
7177 optional android.stats.textclassifier.EventType event_type = 2;
7178
Tony Mak9c84bd22019-12-09 07:27:25 +00007179 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007180 optional string model_name = 3;
7181
7182 // Type of widget that was involved in triggering this event.
7183 optional android.stats.textclassifier.WidgetType widget_type = 4;
7184
7185 // Index of this event in a session.
7186 optional int32 event_index = 5;
7187
7188 // Entity type that is involved.
7189 optional string entity_type = 6;
7190
7191 // Number of links detected.
7192 optional int32 num_links = 7;
7193
7194 // The total length of all links.
7195 optional int32 linked_text_length = 8;
7196
7197 // Length of input text.
7198 optional int32 text_length = 9;
7199
7200 // Time spent on generating links in ms.
7201 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007202
7203 // Name of source package.
7204 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007205}
7206
7207/**
7208 * Logs when there is a conversation actions related event.
7209 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7210 * Logged from: TextClassifierEventLogger.java
7211 */
7212message ConversationActionsEvent {
7213 // A session ID.
7214 optional string session_id = 1;
7215
7216 // Event type of this event.
7217 optional android.stats.textclassifier.EventType event_type = 2;
7218
Tony Mak9c84bd22019-12-09 07:27:25 +00007219 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007220 optional string model_name = 3;
7221
7222 // Type of widget that was involved in triggering this event.
7223 optional android.stats.textclassifier.WidgetType widget_type = 4;
7224
7225 // The first entity type that is involved.
7226 optional string first_entity_type = 5;
7227
7228 // The second entity type that is involved.
7229 optional string second_entity_type = 6;
7230
7231 // The third entity type that is involved.
7232 optional string third_entity_type = 7;
7233
7234 // The score of the first entity type.
7235 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01007236
7237 // Name of source package.
7238 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00007239
7240 // Name of the annotator model that is involved in this event.
7241 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01007242}
7243
7244/**
7245 * Logs when there is a language detection related event.
7246 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7247 * Logged from: TextClassifierEventLogger.java
7248 */
7249message LanguageDetectionEvent {
7250 // A session ID.
7251 optional string session_id = 1;
7252
7253 // Event type of this event.
7254 optional android.stats.textclassifier.EventType event_type = 2;
7255
Tony Mak9c84bd22019-12-09 07:27:25 +00007256 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007257 optional string model_name = 3;
7258
7259 // Type of widget that was involved in triggering this event.
7260 optional android.stats.textclassifier.WidgetType widget_type = 4;
7261
7262 // Detected language.
7263 optional string language_tag = 5;
7264
7265 // Score of the detected language.
7266 optional float score = 6;
7267
7268 // Position of this action.
7269 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01007270
7271 // Name of source package.
7272 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01007273}
Tianjie Xu167c3db2019-07-22 14:25:14 -07007274
7275/**
7276 * Information about an OTA update attempt by update_engine.
7277 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7278 */
7279message UpdateEngineUpdateAttemptReported {
7280 // The number of attempts for the update engine to apply a given payload.
7281 optional int32 attempt_number = 1;
7282
7283 optional android.stats.otaupdate.PayloadType payload_type = 2;
7284
7285 // The total time in minutes for the update engine to apply a given payload.
7286 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
7287 // it's increased when the system is sleeping.
7288 optional int32 duration_boottime_in_minutes = 3;
7289
7290 // The total time in minutes for the update engine to apply a given payload.
7291 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
7292 // and it's not increased when the system is sleeping.
7293 optional int32 duration_monotonic_in_minutes = 4;
7294
7295 // The size of the payload in MiBs.
7296 optional int32 payload_size_mib = 5;
7297
7298 // The attempt result reported by the update engine for an OTA update.
7299 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
7300
7301 // The error code reported by the update engine after an OTA update attempt
7302 // on A/B devices.
7303 optional android.stats.otaupdate.ErrorCode error_code = 7;
7304
7305 // The build fingerprint of the source system. The value is read from a
7306 // system property when the device takes the update. e.g.
7307 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
7308 optional string source_fingerprint = 8;
7309}
7310
7311/**
7312 * Information about all the attempts the device make before finishing the
7313 * successful update.
7314 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7315 */
7316message UpdateEngineSuccessfulUpdateReported {
7317 // The number of attempts for the update engine to apply the payload for a
7318 // successful update.
7319 optional int32 attempt_count = 1;
7320
7321 optional android.stats.otaupdate.PayloadType payload_type = 2;
7322
7323 optional int32 payload_size_mib = 3;
7324
7325 // The total number of bytes downloaded by update_engine since the last
7326 // successful update.
7327 optional int32 total_bytes_downloaded_mib = 4;
7328
7329 // The ratio in percentage of the over-downloaded bytes compared to the
7330 // total bytes needed to successfully install the update. e.g. 200 if we
7331 // download 200MiB in total for a 100MiB package.
7332 optional int32 download_overhead_percentage = 5;
7333
7334 // The total time in minutes for the update engine to apply the payload for a
7335 // successful update.
7336 optional int32 total_duration_minutes = 6;
7337
7338 // The number of reboot of the device during a successful update.
7339 optional int32 reboot_count = 7;
7340}
Alec Mourie088e762019-07-02 13:10:55 -07007341
7342/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08007343 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
7344 * key to indicate whether it was successful or not.
7345 *
7346 * Logged from:
7347 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
7348 */
7349message RebootEscrowRecoveryReported {
7350 optional bool successful = 1;
7351}
7352
7353/**
Alec Mourie088e762019-07-02 13:10:55 -07007354 * Global display pipeline metrics reported by SurfaceFlinger.
7355 * Pulled from:
7356 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7357 */
7358message SurfaceflingerStatsGlobalInfo {
7359 // Total number of frames presented during the tracing period
7360 optional int64 total_frames = 1;
7361 // Total number of frames missed
7362 optional int64 missed_frames = 2;
7363 // Total number of frames that fell back to client composition
7364 optional int64 client_composition_frames = 3;
7365 // Total time the display was turned on
7366 optional int64 display_on_millis = 4;
7367 // Total time that was spent performing animations.
7368 // This is derived from the present-to-present layer histogram
7369 optional int64 animation_millis = 5;
7370}
7371
7372/**
7373 * Per-layer display pipeline metrics reported by SurfaceFlinger.
7374 * The number of layers uploaded will be restricted due to size limitations.
7375 * Pulled from:
7376 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7377 */
7378message SurfaceflingerStatsLayerInfo {
7379 // The layer for this set of metrics
7380 // For now we can infer that the package name is included in the layer
7381 // name.
7382 optional string layer_name = 1;
7383 // Total number of frames presented
7384 optional int64 total_frames = 2;
7385 // Total number of dropped frames while latching a buffer for this layer.
7386 optional int64 dropped_frames = 3;
7387 // Set of timings measured between successive presentation timestamps.
7388 optional FrameTimingHistogram present_to_present = 4
7389 [(android.os.statsd.log_mode) = MODE_BYTES];
7390 // Set of timings measured from when an app queued a buffer for
7391 // presentation, until the buffer was actually presented to the
7392 // display.
7393 optional FrameTimingHistogram post_to_present = 5
7394 [(android.os.statsd.log_mode) = MODE_BYTES];
7395 // Set of timings measured from when a buffer is ready to be presented,
7396 // until the buffer was actually presented to the display.
7397 optional FrameTimingHistogram acquire_to_present = 6
7398 [(android.os.statsd.log_mode) = MODE_BYTES];
7399 // Set of timings measured from when a buffer was latched by
7400 // SurfaceFlinger, until the buffer was presented to the display
7401 optional FrameTimingHistogram latch_to_present = 7
7402 [(android.os.statsd.log_mode) = MODE_BYTES];
7403 // Set of timings measured from the desired presentation to the actual
7404 // presentation time
7405 optional FrameTimingHistogram desired_to_present = 8
7406 [(android.os.statsd.log_mode) = MODE_BYTES];
7407 // Set of timings measured from when an app queued a buffer for
7408 // presentation, until the buffer was ready to be presented.
7409 optional FrameTimingHistogram post_to_acquire = 9
7410 [(android.os.statsd.log_mode) = MODE_BYTES];
7411}
7412
7413/**
7414 * Histogram of frame counts bucketed by time in milliseconds.
7415 * Because of size limitations, we hard-cap the number of buckets, with
7416 * buckets for corresponding to larger milliseconds being less precise.
7417 */
7418message FrameTimingHistogram {
7419 // Timings in milliseconds that describes a set of histogram buckets
7420 repeated int32 time_millis_buckets = 1;
7421 // Number of frames that match to each time_millis, i.e. the bucket
7422 // contents
7423 // It's required that len(time_millis) == len(frame_count)
7424 repeated int64 frame_counts = 2;
7425}
Emilian Peev6729f372019-08-29 09:14:09 -07007426
Emilian Peev6729f372019-08-29 09:14:09 -07007427/**
7428 * Information about camera facing and API level usage.
7429 * Logged from:
7430 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
7431 */
7432message CameraActionEvent {
7433 // Camera session duration
7434 optional int64 duration = 1;
7435
7436 // Camera API level used
7437 optional int32 api_level = 2;
7438
7439 // Name of client package
7440 optional string package_name = 3;
7441
7442 // Camera facing
7443 enum Facing {
7444 UNKNOWN = 0;
7445 BACK = 1;
7446 FRONT = 2;
7447 EXTERNAL = 3;
7448 }
7449 optional Facing facing = 4;
7450}
atrost01a20932019-08-28 15:40:37 +01007451
7452/**
7453 * Logs when a compatibility change is affecting an app.
7454 *
7455 * Logged from:
7456 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
7457 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
7458 */
7459message AppCompatibilityChangeReported {
7460 // The UID of the app being affected by the compatibilty change.
7461 optional int32 uid = 1 [(is_uid) = true];
7462
7463 // The ID of the change affecting the app.
7464 optional int64 change_id = 2;
7465
7466 enum State {
7467 UNKNOWN_STATE = 0;
7468 ENABLED = 1;
7469 DISABLED = 2;
7470 LOGGED = 3;
7471 }
7472
7473 // The state of the change - if logged from gating whether it was enabled or disabled, or just
7474 // logged otherwise.
7475 optional State state = 3;
7476
7477 enum Source {
7478 UNKNOWN_SOURCE = 0;
7479 APP_PROCESS = 1;
7480 SYSTEM_SERVER = 2;
7481 }
7482
7483 // Where it was logged from.
7484 optional Source source = 4;
7485
7486}
Hector Dearman40579f62019-11-01 13:19:30 +00007487
7488/**
7489 * Logged from
7490 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
7491 */
7492message PerfettoUploaded {
7493 enum Event {
7494 PERFETTO_UNDEFINED = 0;
7495 PERFETTO_TRACE_BEGIN = 1;
7496 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
7497 PERFETTO_ON_CONNECT = 3;
7498 PERFETTO_ON_TRACING_DISABLED = 4;
7499 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
7500 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
7501 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
7502 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
7503 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
7504 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
7505 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
7506 PERFETTO_TRIGGER_BEGIN = 12;
7507 PERFETTO_TRIGGER_SUCCESS = 13;
7508 PERFETTO_TRIGGER_FAILURE = 14;
7509 PERFETTO_HIT_GUARDRAILS = 15;
7510 PERFETTO_ON_TIMEOUT = 16;
7511 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
7512 }
7513
7514 // Which stage of the pipeline we are reporting from.
7515 optional Event event = 1;
7516
7517 // UUID matching the one set inside the SystemInfo trace packet.
7518 optional int64 trace_uuid_lsb = 2;
7519 optional int64 trace_uuid_msb = 3;
7520}
Mark Tabrya824a642019-11-05 12:26:12 -08007521
7522/**
7523 * Pulls client metrics on data transferred via Vehicle Maps Service.
7524 * Metrics are keyed by uid + layer.
7525 *
7526 * Pulled from:
7527 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
7528 */
7529message VmsClientStats {
7530 // UID of the VMS client app
7531 optional int32 uid = 1 [(is_uid) = true];
7532
7533 // VMS layer definition
7534 optional int32 layer_type = 2;
7535 optional int32 layer_channel = 3;
7536 optional int32 layer_version = 4;
7537
7538 // Bytes and packets sent by the client for the layer
7539 optional int64 tx_bytes = 5;
7540 optional int64 tx_packets = 6;
7541
7542 // Bytes and packets received by the client for the layer
7543 optional int64 rx_bytes = 7;
7544 optional int64 rx_packets = 8;
7545
7546 // Bytes and packets dropped due to client error
7547 optional int64 dropped_bytes = 9;
7548 optional int64 dropped_packets = 10;
7549}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007550
7551/**
7552 * State of a dangerous permission requested by a package - sampled
7553 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
7554*/
7555message DangerousPermissionStateSampled {
7556 // Name of the permission
7557 optional string permission_name = 1;
7558
7559 // Uid of the package
7560 optional int32 uid = 2 [(is_uid) = true];
7561
7562 // If the permission is granted to the uid
7563 optional bool is_granted = 3;
7564
7565 // Permission flags as per android.content.pm.PermissionFlags
7566 optional int32 permission_flags = 4;
7567}
7568
Stan Iliev637ba5e2019-08-16 13:43:08 -04007569/**
7570 * HWUI renders pipeline type: GL (0) or Vulkan (1).
7571 */
7572enum PipelineType {
7573 GL = 0;
7574 VULKAN = 1;
7575}
7576
7577/**
7578 * HWUI stats for a given app.
7579 */
7580message GraphicsStats {
7581 // The package name of the app
7582 optional string package_name = 1;
7583
7584 // The version code of the app
7585 optional int64 version_code = 2;
7586
7587 // The start & end timestamps in UTC as
7588 // milliseconds since January 1, 1970
7589 // Compatible with java.util.Date#setTime()
7590 optional int64 stats_start = 3;
7591
7592 optional int64 stats_end = 4;
7593
7594 // HWUI renders pipeline type: GL or Vulkan.
7595 optional PipelineType pipeline = 5;
7596
7597 // Distinct frame count.
7598 optional int32 total_frames = 6;
7599
7600 // Number of "missed vsync" events.
7601 optional int32 missed_vsync_count = 7;
7602
7603 // Number of frames in triple-buffering scenario (high input latency)
7604 optional int32 high_input_latency_count = 8;
7605
7606 // Number of "slow UI thread" events.
7607 optional int32 slow_ui_thread_count = 9;
7608
7609 // Number of "slow bitmap upload" events.
7610 optional int32 slow_bitmap_upload_count = 10;
7611
7612 // Number of "slow draw" events.
7613 optional int32 slow_draw_count = 11;
7614
7615 // Number of frames that missed their deadline (aka, visibly janked)
7616 optional int32 missed_deadline_count = 12;
7617
7618 // The frame time histogram for the package
7619 optional FrameTimingHistogram cpu_histogram = 13
7620 [(android.os.statsd.log_mode) = MODE_BYTES];
7621
7622 // The gpu frame time histogram for the package
7623 optional FrameTimingHistogram gpu_histogram = 14
7624 [(android.os.statsd.log_mode) = MODE_BYTES];
7625
7626 // UI mainline module version.
7627 optional int64 version_ui_module = 15;
7628
7629 // If true, these are HWUI stats for up to a 24h period for a given app from today.
7630 // If false, these are HWUI stats for a 24h period for a given app from the last complete
7631 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
7632 // more apps are running / rendering.
7633 optional bool is_today = 16;
7634}