blob: 19b9709e1d41c70bee9f61808bb80e4a8500a90c [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"];
Yao Chend54f9dd2017-10-17 17:37:48 +0000336 }
David Chenc8a43242017-10-17 16:23:28 -0700337
David Chen6e3e6cb2018-01-03 16:14:06 -0800338 // Pulled events will start at field 10000.
Stanislav Zholninccb82e42019-11-29 18:59:49 +0000339 // Next: 10068
David Chenc8a43242017-10-17 16:23:28 -0700340 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800341 WifiBytesTransfer wifi_bytes_transfer = 10000;
342 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
343 MobileBytesTransfer mobile_bytes_transfer = 10002;
344 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800345 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800346 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800347 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800348 CpuTimePerFreq cpu_time_per_freq = 10008;
349 CpuTimePerUid cpu_time_per_uid = 10009;
350 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800351 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800352 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800353 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800354 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800355 SystemElapsedRealtime system_elapsed_realtime = 10014;
356 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800357 CpuActiveTime cpu_active_time = 10016;
358 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000359 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800360 RemainingBatteryCapacity remaining_battery_capacity = 10019;
361 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800362 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100363 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100364 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100365 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000366 DiskStats disk_stats = 10025;
367 DirectoryUsage directory_usage = 10026;
368 AppSize app_size = 10027;
369 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700370 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700371 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800372 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700373 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700374 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800375 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700376 ProcessCpuTime process_cpu_time = 10035;
Misha Wagner5a51e002018-10-03 15:04:09 +0100377 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700378 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee60422018-11-09 12:27:37 -0800379 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
380 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
381 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000382 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800383 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800384 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800385 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000386 DebugElapsedClock debug_elapsed_clock = 10046;
387 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800388 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800389 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800390 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800391 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000392 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000393 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800394 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
395 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikd4e87572019-03-12 13:08:38 +0000396 SystemIonHeapSize system_ion_heap_size = 10056;
Carmen Agimofa769c152019-03-04 14:39:14 +0000397 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700398 FaceSettings face_settings = 10058;
Maggie White442b6312019-04-05 16:26:44 -0700399 CoolingDevice cooling_device = 10059;
Martijn Coenencd95d462019-04-25 17:09:45 +0200400 AppOps app_ops = 10060;
Rafal Slawik77987ed2019-06-17 12:28:23 +0100401 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061;
Alec Mourie088e762019-07-02 13:10:55 -0700402 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
403 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Rafal Slawik7efcefb2019-09-20 11:16:20 +0100404 ProcessMemorySnapshot process_memory_snapshot = 10064;
Mark Tabrya824a642019-11-05 12:26:12 -0800405 VmsClientStats vms_client_stats = 10065;
Chris Wrencdea3b72019-11-22 16:58:17 -0500406 NotificationRemoteViews notification_remote_views = 10066;
Stanislav Zholninccb82e42019-11-29 18:59:49 +0000407 DangerousPermissionStateSampled dangerous_permission_state_sampled = 10067;
David Chenc8a43242017-10-17 16:23:28 -0700408 }
yroa1fe77c2018-02-26 14:22:54 -0800409
Bookatz76aafcf2018-09-17 16:17:10 -0700410 // DO NOT USE field numbers above 100,000 in AOSP.
411 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
412 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100413
414 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700415}
416
Yao Chend54f9dd2017-10-17 17:37:48 +0000417/**
Yangster-mac20877162017-12-22 17:19:39 -0800418 * This proto represents a node of an attribution chain.
419 * Note: All attribution chains are represented as a repeated field of type
420 * AttributionNode. It is understood that in such arrays, the order is that
421 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000422 */
Yangster-mac20877162017-12-22 17:19:39 -0800423message AttributionNode {
424 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800425 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800426
Yangster-mac20877162017-12-22 17:19:39 -0800427 // The (optional) string tag for an element in the attribution chain. If the
428 // element has no tag, it is encoded as an empty string.
429 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700430}
431
Yangster-mac48b3d622018-08-18 12:38:11 -0700432message KeyValuePair {
433 optional int32 key = 1;
434 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700435 int32 value_int = 2;
436 int64 value_long = 3;
437 string value_str = 4;
438 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700439 }
440}
441
442message KeyValuePairsAtom {
443 optional int32 uid = 1;
444 repeated KeyValuePair pairs = 2;
445}
446
Yao Chend54f9dd2017-10-17 17:37:48 +0000447/*
448 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800449 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000450 *
451 * RULES:
452 * - The field ids for each atom must start at 1, and count upwards by 1.
453 * Skipping field ids is not allowed.
454 * - These form an API, so renaming, renumbering or removing fields is
455 * not allowed between android releases. (This is not currently enforced,
456 * but there will be a tool to enforce this restriction).
457 * - The types must be built-in protocol buffer types, namely, no sub-messages
458 * are allowed (yet). The bytes type is also not allowed.
459 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800460 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000461 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800462 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000463 * - A field that is a uid should be a string field, tagged with the [xxx]
464 * annotation. The generated code on android will be represented by UIDs,
465 * and those UIDs will be translated in xxx to those strings.
466 *
467 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700468 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000469 * - If there is a UID, it goes first. Think in an object-oriented fashion.
470 * *****************************************************************************
471 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700472
Yao Chend54f9dd2017-10-17 17:37:48 +0000473/**
Tej Singha72344992019-04-17 18:55:08 -0700474 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700475 * Logs when the Thermal service HAL notifies the throttling start/stop events.
476 *
477 * Logged from:
478 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
479 */
480message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700481 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700482 optional android.os.TemperatureTypeEnum sensor_type = 1;
483
Maggie White442b6312019-04-05 16:26:44 -0700484 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700485 enum State {
486 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700487 START = 1; // START indicated that throttling was triggered.
488 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700489 }
Yangster-mace16189a2018-08-26 12:20:16 -0700490 optional State state = 2;
491
492 optional float temperature = 3;
493}
494
495/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000496 * Logs when the screen state changes.
497 *
498 * Logged from:
499 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
500 */
501message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800502 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700503 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700504}
Yao Chend54f9dd2017-10-17 17:37:48 +0000505
506/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700507 * Logs that the process state of the uid, as determined by ActivityManager
508 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000509 *
510 * Logged from:
511 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
512 */
Bookatzc1a050a2017-10-10 15:49:28 -0700513message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700514 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000515
Bookatzdb026a22018-01-10 19:01:56 -0800516 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700517 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000518}
519
520/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700521 * Logs process state change of a process, as per the activity manager.
522 *
523 * Logged from:
524 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
525 */
526message ProcessStateChanged {
527 optional int32 uid = 1;
528 optional string process_name = 2;
529 optional string package_name = 3;
530 // TODO: remove this when validation is done
531 optional int64 version = 5;
532 // The state, from frameworks/base/core/proto/android/app/enums.proto.
533 optional android.app.ProcessStateEnum state = 4;
534}
535
536/**
537 * Logs when ActivityManagerService sleep state is changed.
538 *
539 * Logged from:
540 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
541 */
542message ActivityManagerSleepStateChanged {
543 // TODO: import frameworks proto
544 enum State {
545 UNKNOWN = 0;
546 ASLEEP = 1;
547 AWAKE = 2;
548 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700549 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700550}
551
552/**
553 * Logs when system memory state changes.
554 *
555 * Logged from:
556 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
557 */
558message MemoryFactorStateChanged {
559 // TODO: import frameworks proto
560 enum State {
561 MEMORY_UNKNOWN = 0;
562 NORMAL = 1; // normal.
563 MODERATE = 2; // moderate memory pressure.
564 LOW = 3; // low memory.
565 CRITICAL = 4; // critical memory.
566
567 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700568 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700569}
570
571/**
572 * Logs when app is using too much cpu, according to ActivityManagerService.
573 *
574 * Logged from:
575 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
576 */
577message ExcessiveCpuUsageReported {
578 optional int32 uid = 1;
579 optional string process_name = 2;
580 optional string package_name = 3;
581 // package version. TODO: remove this when validation is done
582 optional int64 version = 4;
583}
584
585/**
586 * Logs when a cached process is killed, along with its pss.
587 *
588 * Logged from:
589 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
590 */
591message CachedKillReported {
592 optional int32 uid = 1;
593 optional string process_name = 2;
594 optional string package_name = 3;
595 // TODO: remove this when validation is done
596 optional int64 version = 5;
597 optional int64 pss = 4;
598}
599
600/**
601 * Logs when memory stats of a process is reported.
602 *
603 * Logged from:
604 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
605 */
606message ProcessMemoryStatReported {
607 optional int32 uid = 1;
608 optional string process_name = 2;
609 optional string package_name = 3;
610 //TODO: remove this when validation is done
611 optional int64 version = 9;
612 optional int64 pss = 4;
613 optional int64 uss = 5;
614 optional int64 rss = 6;
615 enum Type {
616 ADD_PSS_INTERNAL_SINGLE = 0;
617 ADD_PSS_INTERNAL_ALL_MEM = 1;
618 ADD_PSS_INTERNAL_ALL_POLL = 2;
619 ADD_PSS_EXTERNAL = 3;
620 ADD_PSS_EXTERNAL_SLOW = 4;
621 }
622 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800623 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700624}
625
626/**
Bookatzc1a050a2017-10-10 15:49:28 -0700627 * Logs that a process started, finished, crashed, or ANRed.
628 *
629 * Logged from:
630 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
631 */
632message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700633 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700634
David Chen0b5c90c2018-01-25 16:51:49 -0800635 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800636 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700637
Bookatzddccf0a2017-11-28 16:48:14 -0800638 // What lifecycle state the process changed to.
639 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800640 enum State {
641 FINISHED = 0;
642 STARTED = 1;
643 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800644 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800645 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700646}
647
Bookatzc1a050a2017-10-10 15:49:28 -0700648/**
649 * Logs when the ble scan state changes.
650 *
651 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700652 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700653 */
654message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800655 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700656
657 enum State {
658 OFF = 0;
659 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700660 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
661 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700662 }
663 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700664
Bookatze5ec0b42018-03-26 13:34:56 -0700665 // Does the scan have a filter.
666 optional bool is_filtered = 3;
667 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
668 optional bool is_first_match = 4;
669 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
670 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700671}
672
673/**
674 * Logs reporting of a ble scan finding results.
675 *
676 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700677 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700678 */
Bookatzae6738e2018-09-13 11:38:56 -0700679// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700680message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800681 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700682
683 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800684 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700685}
686
687/**
688 * Logs when a sensor state changes.
689 *
690 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700691 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700692 */
693message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800694 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700695
Bookatzc1a050a2017-10-10 15:49:28 -0700696 // The id (int) of the sensor.
697 optional int32 sensor_id = 2;
698
699 enum State {
700 OFF = 0;
701 ON = 1;
702 }
703 optional State state = 3;
704}
705
Bookatzc1a050a2017-10-10 15:49:28 -0700706/**
707 * Logs when GPS state changes.
708 *
709 * Logged from:
710 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
711 */
712message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800713 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700714
715 enum State {
716 OFF = 0;
717 ON = 1;
718 }
719 optional State state = 2;
720}
721
Bookatz48d362e2018-11-06 15:49:08 -0800722/**
723 * Logs when GPS signal quality.
724 *
725 * Logged from:
726 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
727 */
728message GpsSignalQualityChanged {
729 optional android.server.location.GpsSignalQualityEnum level = 1;
730}
731
Blake Kragten212edc72019-10-15 13:26:50 -0700732/**
733 * Gps location status report
734 *
735 * Logged from:
736 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
737 */
738message GpsLocationStatusReported {
739 // Boolean stating if location was acquired
740 optional bool location_success = 1;
741}
742
743/**
744 * Gps log time to first fix report
745 *
746 * Logged from:
747 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
748 */
749message GpsTimeToFirstFixReported {
750 // int32 reporting the time to first fix in milliseconds
751 optional int32 time_to_first_fix_millis = 1;
752}
Bookatzc1a050a2017-10-10 15:49:28 -0700753
754/**
755 * Logs when a sync manager sync state changes.
756 *
757 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700758 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700759 */
760message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800761 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700762
David Chen0b5c90c2018-01-25 16:51:49 -0800763 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800764 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700765
766 enum State {
767 OFF = 0;
768 ON = 1;
769 }
770 optional State state = 3;
771}
772
Yangster-mac96353002018-09-05 11:18:55 -0700773/*
774 * Deferred job stats.
775 *
776 * Logged from:
777 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
778*/
779message DeferredJobStatsReported {
780 repeated AttributionNode attribution_node = 1;
781
782 // Number of jobs deferred.
783 optional int32 num_jobs_deferred = 2;
784
785 // Time since the last job runs.
786 optional int64 time_since_last_job_millis = 3;
787}
788
Bookatzc1a050a2017-10-10 15:49:28 -0700789/**
790 * Logs when a job scheduler job state changes.
791 *
792 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700793 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700794 */
795message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800796 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700797
798 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800799 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700800
801 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800802 FINISHED = 0;
803 STARTED = 1;
804 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700805 }
806 optional State state = 3;
807
Tej Singh33a412b2018-03-16 18:43:59 -0700808 // The reason a job has stopped.
809 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700810 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700811 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100812
813 // The standby bucket of the app that scheduled the job. These match the framework constants
814 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
815 // already assigned 0.
816 enum Bucket {
817 UNKNOWN = -1;
818 ACTIVE = 0;
819 WORKING_SET = 1;
820 FREQUENT = 2;
821 RARE = 3;
822 NEVER = 4;
823 }
824 optional Bucket standby_bucket = 5 [default = UNKNOWN];
825
826 // The job id (as assigned by the app).
827 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700828}
829
830/**
831 * Logs when the audio state changes.
832 *
833 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700834 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700835 */
836message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800837 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700838
839 enum State {
840 OFF = 0;
841 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700842 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
843 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700844 }
845 optional State state = 2;
846}
847
848/**
849 * Logs when the video codec state changes.
850 *
851 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700852 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700853 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800854message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800855 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700856
857 enum State {
858 OFF = 0;
859 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700860 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
861 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700862 }
863 optional State state = 2;
864}
865
866/**
867 * Logs when the flashlight state changes.
868 *
869 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700870 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700871 */
872message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800873 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700874
875 enum State {
876 OFF = 0;
877 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700878 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
879 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700880 }
881 optional State state = 2;
882}
883
884/**
885 * Logs when the camera state changes.
886 *
887 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700888 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700889 */
890message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800891 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700892
893 enum State {
894 OFF = 0;
895 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700896 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
897 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700898 }
899 optional State state = 2;
900}
901
902/**
903 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000904 *
905 * Logged from:
906 * TODO
907 */
Bookatzd6746242017-10-24 18:39:35 -0700908message WakelockStateChanged {
Yangster-mac20877162017-12-22 17:19:39 -0800909 repeated AttributionNode attribution_node = 1;
Yao Chend54f9dd2017-10-17 17:37:48 +0000910
Bookatz1a1b0462018-01-12 11:47:03 -0800911 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
912 // From frameworks/base/core/proto/android/os/enums.proto.
Yangster-maca8a30442018-10-13 23:46:34 -0700913 optional android.os.WakeLockLevelEnum type = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700914
915 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
916 optional string tag = 3;
917
918 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800919 RELEASE = 0;
920 ACQUIRE = 1;
921 CHANGE_RELEASE = 2;
922 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700923 }
924 optional State state = 4;
925}
926
927/**
Bookatzc1a050a2017-10-10 15:49:28 -0700928 * Logs when a partial wakelock is considered 'long' (over 1 min).
929 *
930 * Logged from:
931 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
932 */
933message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800934 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700935
Yao Chend54f9dd2017-10-17 17:37:48 +0000936 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
937 optional string tag = 2;
938
Bookatzc1a050a2017-10-10 15:49:28 -0700939 // TODO: I have no idea what this is.
940 optional string history_tag = 3;
941
942 enum State {
943 OFF = 0;
944 ON = 1;
945 }
946 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000947}
948
Bookatzc1a050a2017-10-10 15:49:28 -0700949/**
Bookatza66083f2018-09-20 17:24:00 -0700950 * Logs when the device is interactive, according to the PowerManager Notifier.
951 *
952 * Logged from:
953 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
954 */
955message InteractiveStateChanged {
956 enum State {
957 OFF = 0;
958 ON = 1;
959 }
960 optional State state = 1;
961}
962
963/**
Bookatzc1a050a2017-10-10 15:49:28 -0700964 * Logs Battery Saver state change.
965 *
966 * Logged from:
967 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
968 */
969message BatterySaverModeStateChanged {
970 enum State {
971 OFF = 0;
972 ON = 1;
973 }
974 optional State state = 1;
975}
976
977/**
978 * Logs Doze mode state change.
979 *
980 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800981 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700982 */
983message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800984 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800985}
986
987
988/**
989 * Logs state change of Doze mode including maintenance windows.
990 *
991 * Logged from:
992 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
993 */
994message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800995 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700996}
997
998/**
999 * Logs screen brightness level.
1000 *
1001 * Logged from:
1002 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1003 */
1004message ScreenBrightnessChanged {
1005 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
1006 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001007}
1008
1009/**
1010 * Logs battery level (percent full, from 0 to 100).
1011 *
1012 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001013 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001014 */
1015message BatteryLevelChanged {
1016 // Battery level. Should be in [0, 100].
1017 optional int32 battery_level = 1;
1018}
1019
1020/**
1021 * Logs change in charging status of the device.
1022 *
1023 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001024 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001025 */
1026message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001027 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1028 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001029}
1030
1031/**
1032 * Logs whether the device is plugged in, and what power source it is using.
1033 *
1034 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001035 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001036 */
1037message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001038 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1039 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001040}
1041
Bookatz8c6571b2017-10-24 15:04:41 -07001042/**
1043 * Logs when an app's wakeup alarm fires.
1044 *
1045 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001046 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001047 */
1048message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001049 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001050
1051 // Name of the wakeup alarm.
1052 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001053
1054 // Name of source package (for historical reasons, since BatteryStats tracked it).
1055 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001056
1057 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1058 enum Bucket {
1059 UNKNOWN = 0;
1060 EXEMPTED = 5;
1061 ACTIVE = 10;
1062 WORKING_SET = 20;
1063 FREQUENT = 30;
1064 RARE = 40;
1065 NEVER = 50;
1066 }
1067 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1068 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001069}
1070
1071/**
1072 * Logs when an an app causes the mobile radio to change state.
1073 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1074 *
1075 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001076 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001077 */
1078message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001079 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001080
Bookatz1a1b0462018-01-12 11:47:03 -08001081 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1082 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001083}
1084
1085/**
1086 * Logs when an an app causes the wifi radio to change state.
1087 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1088 *
1089 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001090 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001091 */
1092message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001093 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001094
Bookatz1a1b0462018-01-12 11:47:03 -08001095 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1096 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001097}
1098
1099/**
1100 * Logs kernel wakeup reasons and aborts.
1101 *
1102 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001103 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001104 */
1105message KernelWakeupReported {
1106 // Name of the kernel wakeup reason (or abort).
1107 optional string wakeup_reason_name = 1;
1108
1109 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001110 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001111}
1112
1113/**
Bookatzda1798c2018-12-13 14:16:00 -08001114 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001115 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001116 *
1117 * Logged from:
1118 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1119 */
1120message WifiEnabledStateChanged {
1121 enum State {
1122 OFF = 0;
1123 ON = 1;
1124 }
1125 optional State state = 1;
1126}
1127
1128/**
1129 * 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 -08001130 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1131 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001132 *
1133 * Logged from:
1134 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1135 */
1136message WifiRunningStateChanged {
1137 repeated AttributionNode attribution_node = 1;
1138
1139 enum State {
1140 OFF = 0;
1141 ON = 1;
1142 }
1143 optional State state = 2;
1144}
1145
1146/**
Bookatze5885242017-10-24 20:10:31 -07001147 * Logs wifi locks held by an app.
1148 *
1149 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001150 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001151 */
1152message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001153 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001154
1155 enum State {
1156 OFF = 0;
1157 ON = 1;
1158 }
1159 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001160
1161 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1162 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001163}
1164
1165/**
1166 * Logs wifi signal strength changes.
1167 *
1168 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001169 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001170 */
1171message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001172 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1173 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001174}
1175
1176/**
1177 * Logs wifi scans performed by an app.
1178 *
1179 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001180 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001181 */
1182message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001183 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001184
1185 enum State {
1186 OFF = 0;
1187 ON = 1;
1188 }
1189 optional State state = 2;
1190}
1191
1192/**
Tej Singh4503e102018-01-04 14:35:01 -08001193 * Logs wifi multicast locks held by an app
1194 *
1195 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001196 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001197 */
1198message WifiMulticastLockStateChanged {
1199 repeated AttributionNode attribution_node = 1;
1200
1201 enum State {
1202 OFF = 0;
1203 ON = 1;
1204 }
1205 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001206
1207 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001208}
1209
1210/**
Tej Singh1ea42892018-01-19 09:27:00 -08001211 * Logs shutdown reason and duration on next boot.
1212 *
1213 * Logged from:
1214 * frameworks/base/core/java/com/android/server/BootReceiver.java
1215 */
1216message ShutdownSequenceReported {
1217 // True if shutdown is for a reboot. Default: false if we do not know.
1218 optional bool reboot = 1;
1219
1220 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1221 optional string reason = 2;
1222
1223 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1224 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001225 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001226
1227 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001228 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001229}
1230
Tej Singh6483ea42018-01-25 17:45:49 -08001231
1232/**
1233 * Logs boot reason and duration.
1234 *
1235 * Logged from:
1236 * system/core/bootstat/bootstat.cpp
1237 */
1238message BootSequenceReported {
1239 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1240 // Default: "<EMPTY>" if not available.
1241 optional string bootloader_reason = 1;
1242
1243 // Reason for system boot. Eg. bootloader, reboot,userrequested
1244 // Default: "<EMPTY>" if not available.
1245 optional string system_reason = 2;
1246
1247 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001248 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001249
1250 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001251 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001252
1253 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001254 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001255
1256 // Time since last boot in ms. Default: 0 if not available.
1257 optional int64 time_since_last_boot = 6;
1258}
1259
Tej Singhc477d9c2018-02-05 18:31:39 -08001260
1261/**
1262 * Logs call state and disconnect cause (if applicable).
1263 *
1264 * Logged from:
1265 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1266 */
1267message CallStateChanged {
1268 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1269 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1270 optional android.telecom.CallStateEnum call_state = 1;
1271
1272 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1273 // This value is only applicable when the call_state is DISCONNECTED, and
1274 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1275 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1276 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1277
1278 // True if the call is self-managed, which are apps that use the
1279 // telecom infrastructure to make their own calls.
1280 optional bool self_managed = 3;
1281
1282 // True if call is external. External calls are calls on connected Wear
1283 // devices but show up in Telecom so the user can pull them onto the device.
1284 optional bool external_call = 4;
1285}
1286
Tej Singh1ea42892018-01-19 09:27:00 -08001287/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001288 * Logs keyguard state. The keyguard is the lock screen.
1289 *
1290 * Logged from:
1291 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1292 */
1293message KeyguardStateChanged {
1294 enum State {
1295 UNKNOWN = 0;
1296 // The keyguard is hidden when the phone is unlocked.
1297 HIDDEN = 1;
1298 // The keyguard is shown when the phone is locked (screen turns off).
1299 SHOWN= 2;
1300 // The keyguard is occluded when something is overlaying the keyguard.
1301 // Eg. Opening the camera while on the lock screen.
1302 OCCLUDED = 3;
1303 }
1304 optional State state = 1;
1305}
1306
1307/**
1308 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1309 * prompts the user to enter a password (pattern, pin, etc).
1310 *
1311 * Logged from:
1312 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1313 */
1314
1315message KeyguardBouncerStateChanged {
1316 enum State {
1317 UNKNOWN = 0;
1318 // Bouncer is hidden, either as a result of successfully entering the
1319 // password, screen timing out, or user going back to lock screen.
1320 HIDDEN = 1;
1321 // This is when the user is being prompted to enter the password.
1322 SHOWN = 2;
1323 }
1324 optional State state = 1;
1325}
1326
1327/**
1328 * Logs the result of entering a password into the keyguard bouncer.
1329 *
1330 * Logged from:
1331 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1332 */
1333message KeyguardBouncerPasswordEntered {
1334 enum BouncerResult {
1335 UNKNOWN = 0;
1336 // The password entered was incorrect.
1337 FAILURE = 1;
1338 // The password entered was correct.
1339 SUCCESS = 2;
1340 }
1341 optional BouncerResult result = 1;
1342}
1343
Tej Singha883b372018-02-15 11:30:01 -08001344/*
1345 * Logs changes to the configuration of the device. The configuration is defined
1346 * in frameworks/base/core/java/android/content/res/Configuration.java
1347 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1348 * Please go there to interpret the possible values each field can be.
1349 *
1350 * Logged from:
1351 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1352 */
1353message ResourceConfigurationChanged {
1354 // Bit mask of color capabilities of the screen.
1355 // Contains information about the color gamut and hdr mode of the screen.
1356 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001357 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001358
1359 // The target screen density being rendered to.
1360 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001361 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001362
1363 // Current user preference for the scaling factor for fonts,
1364 // relative to the base density scaling.
1365 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001366 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001367
1368 // Flag indicating whether the hard keyboard is hidden.
1369 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001370 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001371
1372 // The type of keyboard attached to the device.
1373 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1374 optional int32 keyboard = 5;
1375
1376 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1377 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001378 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001379
1380 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1381 // 0 if undefined.
1382 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1383 optional int32 mcc = 7;
1384
1385 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1386 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1387 // MNC_ZERO symbol defined in Configuration.java.
1388 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1389 optional int32 mnc = 8;
1390
1391 // The kind of navigation available on the device.
1392 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1393 optional int32 navigation = 9;
1394
1395 // Flag indicating whether the navigation is available.
1396 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001397 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001398
1399 // Overall orientation of the screen.
1400 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1401 optional int32 orientation = 11;
1402
1403 // The current height of the available screen space, in dp units.
1404 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001405 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001406
1407 // Bit mask of overall layout of the screen.
1408 // Contains information about screen size, whether the screen is wider/taller
1409 // than normal, whether the screen layout is right-tl-left or left-to-right,
1410 // and whether the screen has a rounded shape.
1411 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001412 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001413
1414 // Current width of the available screen space, in dp units.
1415 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001416 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001417
1418 // The smallest screen size an application will see in normal operation.
1419 // This is the smallest value of both screenWidthDp and screenHeightDp
1420 // in portrait and landscape.
1421 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001422 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001423
1424 // The type of touch screen attached to the device.
1425 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1426 optional int32 touchscreen = 16;
1427
1428 // Bit mask of the ui mode.
1429 // Contains information about the overall ui mode of the device.
1430 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1431 // Also contains information about whether the device is in night mode.
1432 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001433 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001434}
1435
Tej Singheee317b2018-03-07 19:28:05 -08001436
1437/**
1438 * Logs changes in the connection state of the mobile radio.
1439 *
1440 * Logged from:
1441 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1442 */
1443message MobileConnectionStateChanged {
1444 // States are from the state machine DataConnection.java.
1445 enum State {
1446 UNKNOWN = 0;
1447 // The connection is inactive, or disconnected.
1448 INACTIVE = 1;
1449 // The connection is being activated, or connecting.
1450 ACTIVATING = 2;
1451 // The connection is active, or connected.
1452 ACTIVE = 3;
1453 // The connection is disconnecting.
1454 DISCONNECTING = 4;
1455 // The connection is disconnecting after creating a connection.
1456 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1457 }
1458 optional State state = 1;
1459 // For multi-sim phones, this distinguishes between the sim cards.
1460 optional int32 sim_slot_index = 2;
1461 // Used to identify the connection. Starts at 0 and increments by 1 for
1462 // every new network created. Resets whenever the device reboots.
1463 optional int32 data_connection_id = 3;
1464 // A bitmask for the capabilities of this connection.
1465 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1466 // Default value (if we have no information): 0
1467 optional int64 capabilities = 4;
1468 // If this connection has internet.
1469 // This just checks if the DEFAULT bit of capabilities is set.
1470 optional bool has_internet = 5;
1471}
1472
1473/**
1474 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1475 *
1476 * Logged from:
1477 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1478 */
1479message MobileRadioTechnologyChanged {
1480 optional android.telephony.NetworkTypeEnum state = 1;
1481 // For multi-sim phones, this distinguishes between the sim cards.
1482 optional int32 sim_slot_index = 2;
1483}
1484
Andrew Chantb56388b2018-03-22 21:07:33 -07001485/**
1486 * Logs the VID and PID of any connected USB devices.
1487 *
1488 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1489 *
1490 * Logged by Vendor.
1491 */
1492message UsbDeviceAttached {
1493 optional int32 vid = 1;
1494 optional int32 pid = 2;
1495 optional bool has_audio = 3;
1496 optional bool has_hid = 4;
1497 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001498 enum State {
1499 STATE_DISCONNECTED = 0;
1500 STATE_CONNECTED = 1;
1501 }
1502 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001503 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001504}
1505
Tej Singheee317b2018-03-07 19:28:05 -08001506
Tej Singhdd7bd352018-02-09 19:33:15 -08001507/**
Tej Singh5d991e12018-03-09 19:48:11 -08001508 * Logs when Bluetooth is enabled and disabled.
1509 *
1510 * Logged from:
1511 * services/core/java/com/android/server/BluetoothManagerService.java
1512 */
1513message BluetoothEnabledStateChanged {
1514 repeated AttributionNode attribution_node = 1;
1515 // Whether or not bluetooth is enabled on the device.
1516 enum State {
1517 UNKNOWN = 0;
1518 ENABLED = 1;
1519 DISABLED = 2;
1520 }
1521 optional State state = 2;
1522 // The reason for being enabled/disabled.
1523 // Eg. Airplane mode, crash, application request.
1524 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1525 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001526 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001527}
1528
1529/**
Jack Hed9837c82019-01-09 01:19:13 -08001530 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001531 *
1532 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001533 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1534 *
1535 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001536 */
1537message BluetoothConnectionStateChanged {
1538 // The state of the connection.
1539 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1540 optional android.bluetooth.ConnectionStateEnum state = 1;
1541 // An identifier that can be used to match connect and disconnect events.
1542 // Currently is last two bytes of a hash of a device level ID and
1543 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001544 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001545 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001546 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1547 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001548 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001549 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001550 // An identifier that can be used to match events for this device.
1551 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1552 // Salt: Randomly generated 256 bit value
1553 // Hash algorithm: HMAC-SHA256
1554 // Size: 32 byte
1555 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001556 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001557}
1558
1559/**
1560 * Logs when a Bluetooth device connects and disconnects over ACL
1561 *
1562 * Logged from:
1563 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1564 *
1565 * Next Tag: 3
1566 */
1567message BluetoothAclConnectionStateChanged {
1568 // An identifier that can be used to match events for this device.
1569 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1570 // Salt: Randomly generated 256 bit value
1571 // Hash algorithm: HMAC-SHA256
1572 // Size: 32 byte
1573 // Default: null or empty if the device identifier is not known
1574 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1575 // The state of the connection.
1576 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1577 optional android.bluetooth.ConnectionStateEnum state = 2;
1578}
1579
1580/**
1581 * Logs when a Bluetooth device connects and disconnects over SCO
1582 *
1583 * Logged from:
1584 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1585 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1586 *
1587 * Next Tag: 4
1588 */
1589message BluetoothScoConnectionStateChanged {
1590 // An identifier that can be used to match events for this device.
1591 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1592 // Salt: Randomly generated 256 bit value
1593 // Hash algorithm: HMAC-SHA256
1594 // Size: 32 byte
1595 // Default: null or empty if the device identifier is not known
1596 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1597 // The state of the connection.
1598 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1599 optional android.bluetooth.ConnectionStateEnum state = 2;
1600 // Codec used for this SCO connection
1601 // Default: UNKNOWN
1602 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001603}
1604
Jack Hec27040a2019-01-09 20:54:41 -08001605/**
1606 * Logged when active device of a profile changes
1607 *
1608 * Logged from:
1609 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1610 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1611 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1612 */
1613message BluetoothActiveDeviceChanged {
1614 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1615 // From android.bluetooth.BluetoothProfile
1616 optional int32 bt_profile = 1;
1617 // An identifier that can be used to match events for this new active device.
1618 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1619 // Salt: Randomly generated 256 bit value
1620 // Hash algorithm: HMAC-SHA256
1621 // Size: 32 byte
1622 // Default: null or empty if there is no active device for this profile
1623 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1624}
1625
Jack Heab86dbd22018-12-18 15:43:27 -08001626// Logs when there is an event affecting Bluetooth device's link layer connection.
1627// - This event is triggered when there is a related HCI command or event
1628// - Users of this metrics can deduce Bluetooth device's connection state from these events
1629// - HCI commands are logged before the command is sent, after receiving command status, and after
1630// receiving command complete
1631// - HCI events are logged when they arrive
1632//
1633// Low level log from system/bt
1634//
1635// Bluetooth classic commands:
1636// - CMD_CREATE_CONNECTION
1637// - CMD_DISCONNECT
1638// - CMD_CREATE_CONNECTION_CANCEL
1639// - CMD_ACCEPT_CONNECTION_REQUEST
1640// - CMD_REJECT_CONNECTION_REQUEST
1641// - CMD_SETUP_ESCO_CONNECTION
1642// - CMD_ACCEPT_ESCO_CONNECTION
1643// - CMD_REJECT_ESCO_CONNECTION
1644// - CMD_ENH_SETUP_ESCO_CONNECTION
1645// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1646//
1647// Bluetooth low energy commands:
1648// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1649// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1650// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1651// - CMD_BLE_CLEAR_WHITE_LIST
1652// - CMD_BLE_ADD_WHITE_LIST
1653// - CMD_BLE_REMOVE_WHITE_LIST
1654//
1655// Bluetooth classic events:
1656// - EVT_CONNECTION_COMP
1657// - EVT_CONNECTION_REQUEST
1658// - EVT_DISCONNECTION_COMP
1659// - EVT_ESCO_CONNECTION_COMP
1660// - EVT_ESCO_CONNECTION_CHANGED
1661//
1662// Bluetooth low energy meta events:
1663// - BLE_EVT_CONN_COMPLETE_EVT
1664// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1665//
1666// Next tag: 10
1667message BluetoothLinkLayerConnectionEvent {
1668 // An identifier that can be used to match events for this device.
1669 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1670 // Salt: Randomly generated 256 bit value
1671 // Hash algorithm: HMAC-SHA256
1672 // Size: 32 byte
1673 // Default: null or empty if the device identifier is not known
1674 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1675 // Connection handle of this connection if available
1676 // Range: 0x0000 - 0x0EFF (12 bits)
1677 // Default: 0xFFFF if the handle is unknown
1678 optional int32 connection_handle = 2;
1679 // Direction of the link
1680 // Default: DIRECTION_UNKNOWN
1681 optional android.bluetooth.DirectionEnum direction = 3;
1682 // Type of this link
1683 // Default: LINK_TYPE_UNKNOWN
1684 optional android.bluetooth.LinkTypeEnum type = 4;
1685
1686 // Reason metadata for this link layer connection event, rules for interpretation:
1687 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1688 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1689 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1690 // set and valid, ignore hci_ble_event
1691
1692 // HCI command associated with this event
1693 // Default: CMD_UNKNOWN
1694 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1695 // HCI event associated with this event
1696 // Default: EVT_UNKNOWN
1697 optional android.bluetooth.hci.EventEnum hci_event = 6;
1698 // HCI BLE meta event associated with this event
1699 // Default: BLE_EVT_UNKNOWN
1700 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1701 // HCI command status code if this is triggerred by hci_cmd
1702 // Default: STATUS_UNKNOWN
1703 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1704 // HCI reason code associated with this event
1705 // Default: STATUS_UNKNOWN
1706 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1707}
1708
Howard Roe103fe22019-01-17 16:52:16 -08001709/**
1710 * Logs when a module is rolled back by Watchdog.
1711 *
1712 * Logged from: Rollback Manager
1713 */
1714message WatchdogRollbackOccurred {
1715 enum RollbackType {
1716 UNKNOWN = 0;
1717 ROLLBACK_INITIATE = 1;
1718 ROLLBACK_SUCCESS = 2;
1719 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001720 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001721 }
1722 optional RollbackType rollback_type = 1;
1723
1724 optional string package_name = 2;
1725
1726 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001727
1728 enum RollbackReasonType {
1729 REASON_UNKNOWN = 0;
1730 REASON_NATIVE_CRASH = 1;
1731 REASON_EXPLICIT_HEALTH_CHECK = 2;
1732 REASON_APP_CRASH = 3;
1733 REASON_APP_NOT_RESPONDING = 4;
1734 }
1735 optional RollbackReasonType rollback_reason = 4;
1736
1737 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1738 // is initiated. Empty if the package is unknown.
1739 optional string failing_package_name = 5;
Howard Roe103fe22019-01-17 16:52:16 -08001740}
1741
Jack Hec27040a2019-01-09 20:54:41 -08001742/**
1743 * Logs when there is a change in Bluetooth A2DP playback state
1744 *
1745 * Logged from:
1746 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1747 */
1748message BluetoothA2dpPlaybackStateChanged {
1749 // An identifier that can be used to match events for this device.
1750 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1751 // Salt: Randomly generated 256 bit value
1752 // Hash algorithm: HMAC-SHA256
1753 // Size: 32 byte
1754 // Default: null or empty if the device identifier is not known
1755 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1756 // Current playback state
1757 // Default: PLAYBACK_STATE_UNKNOWN
1758 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1759 // Current audio coding mode
1760 // Default: AUDIO_CODING_MODE_UNKNOWN
1761 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1762}
1763
1764/**
1765 * Logs when there is a change in A2DP codec config for a particular remote device
1766 *
1767 * Logged from:
1768 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1769 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1770 */
1771message BluetoothA2dpCodecConfigChanged {
1772 // An identifier that can be used to match events for this device.
1773 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1774 // Salt: Randomly generated 256 bit value
1775 // Hash algorithm: HMAC-SHA256
1776 // Size: 32 byte
1777 // Default: null or empty if the device identifier is not known
1778 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1779 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1780 // Default SOURCE_CODEC_TYPE_INVALID
1781 optional int32 codec_type = 2;
1782 // Codec priroity, the higher the more preferred, -1 for disabled
1783 // Default: CODEC_PRIORITY_DEFAULT
1784 optional int32 codec_priority = 3;
1785 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1786 // Default: SAMPLE_RATE_NONE
1787 optional int32 sample_rate = 4;
1788 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1789 // Default: BITS_PER_SAMPLE_NONE
1790 optional int32 bits_per_sample = 5;
1791 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1792 // Default: CHANNEL_MODE_NONE
1793 optional int32 channel_mode = 6;
1794 // Codec specific values
1795 // Default 0
1796 optional int64 codec_specific_1 = 7;
1797 optional int64 codec_specific_2 = 8;
1798 optional int64 codec_specific_3 = 9;
1799 optional int64 codec_specific_4 = 10;
1800}
1801
1802/**
1803 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1804 * Each codec's capability is logged separately due to statsd restriction
1805 *
1806 * Logged from:
1807 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1808 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1809 */
1810message BluetoothA2dpCodecCapabilityChanged {
1811 // An identifier that can be used to match events for this device.
1812 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1813 // Salt: Randomly generated 256 bit value
1814 // Hash algorithm: HMAC-SHA256
1815 // Size: 32 byte
1816 // Default: null or empty if the device identifier is not known
1817 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1818 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1819 // Default SOURCE_CODEC_TYPE_INVALID
1820 optional int32 codec_type = 2;
1821 // Codec priroity, the higher the more preferred, -1 for disabled
1822 // Default: CODEC_PRIORITY_DEFAULT
1823 optional int32 codec_priority = 3;
1824 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1825 // in BluetoothCodecConfig
1826 // Default: empty and SAMPLE_RATE_NONE for individual item
1827 optional int32 sample_rate = 4;
1828 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1829 // in BluetoothCodecConfig
1830 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1831 optional int32 bits_per_sample = 5;
1832 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1833 // BluetoothCodecConfig
1834 // Default: empty and CHANNEL_MODE_NONE for individual item
1835 optional int32 channel_mode = 6;
1836 // Codec specific values
1837 // Default 0
1838 optional int64 codec_specific_1 = 7;
1839 optional int64 codec_specific_2 = 8;
1840 optional int64 codec_specific_3 = 9;
1841 optional int64 codec_specific_4 = 10;
1842}
1843
1844/**
1845 * Logs when A2DP failed to read from PCM source.
1846 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1847 *
1848 * Logged from:
1849 * system/bt
1850 */
1851message BluetoothA2dpAudioUnderrunReported {
1852 // An identifier that can be used to match events for this device.
1853 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1854 // Salt: Randomly generated 256 bit value
1855 // Hash algorithm: HMAC-SHA256
1856 // Size: 32 byte
1857 // Default: null or empty if the device identifier is not known
1858 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1859 // Encoding interval in nanoseconds
1860 // Default: 0
1861 optional int64 encoding_interval_nanos = 2;
1862 // Number of bytes of PCM data that could not be read from the source
1863 // Default: 0
1864 optional int32 num_missing_pcm_bytes = 3;
1865}
1866
1867/**
1868 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1869 * buffer queue is full and we have to drop data
1870 *
1871 * Logged from:
1872 * system/bt
1873 */
1874message BluetoothA2dpAudioOverrunReported {
1875 // An identifier that can be used to match events for this device.
1876 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1877 // Salt: Randomly generated 256 bit value
1878 // Hash algorithm: HMAC-SHA256
1879 // Size: 32 byte
1880 // Default: null or empty if the device identifier is not known
1881 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1882 // Encoding interval in nanoseconds
1883 // Default: 0
1884 optional int64 encoding_interval_nanos = 2;
1885 // Number of buffers dropped in this event
1886 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1887 // Default: 0
1888 optional int32 num_dropped_buffers = 3;
1889 // Number of encoded buffers dropped in this event
1890 // Default 0
1891 optional int32 num_dropped_encoded_frames = 4;
1892 // Number of encoded bytes dropped in this event
1893 // Default: 0
1894 optional int32 num_dropped_encoded_bytes = 5;
1895}
1896
1897/**
1898 * Logs when we receive reports regarding a device's RSSI value
1899 *
1900 * Logged from:
1901 * system/bt
1902 */
1903message BluetoothDeviceRssiReported {
1904 // An identifier that can be used to match events for this device.
1905 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1906 // Salt: Randomly generated 256 bit value
1907 // Hash algorithm: HMAC-SHA256
1908 // Size: 32 byte
1909 // Default: null or empty if the device identifier is not known
1910 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1911 // Connection handle of this connection if available
1912 // Range: 0x0000 - 0x0EFF (12 bits)
1913 // Default: 0xFFFF if the handle is unknown
1914 optional int32 connection_handle = 2;
1915 // HCI command status code if this is triggerred by hci_cmd
1916 // Default: STATUS_UNKNOWN
1917 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1918 // BR/EDR
1919 // Range: -128 ≤ N ≤ 127 (signed integer)
1920 // Units: dB
1921 // LE:
1922 // Range: -127 to 20, 127 (signed integer)
1923 // Units: dBm
1924 // Invalid when an out of range value is reported
1925 optional int32 rssi = 4;
1926}
1927
1928/**
1929 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1930 *
1931 * Logged from:
1932 * system/bt
1933 */
1934message BluetoothDeviceFailedContactCounterReported {
1935 // An identifier that can be used to match events for this device.
1936 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1937 // Salt: Randomly generated 256 bit value
1938 // Hash algorithm: HMAC-SHA256
1939 // Size: 32 byte
1940 // Default: null or empty if the device identifier is not known
1941 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1942 // Connection handle of this connection if available
1943 // Range: 0x0000 - 0x0EFF (12 bits)
1944 // Default: 0xFFFF if the handle is unknown
1945 optional int32 connection_handle = 2;
1946 // HCI command status code if this is triggerred by hci_cmd
1947 // Default: STATUS_UNKNOWN
1948 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1949 // Number of consecutive failed contacts for a connection corresponding to the Handle
1950 // Range: uint16_t, 0-0xFFFF
1951 // Default: 0xFFFFF
1952 optional int32 failed_contact_counter = 4;
1953}
1954
1955/**
1956 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1957 *
1958 * Logged from:
1959 * system/bt
1960 */
1961message BluetoothDeviceTxPowerLevelReported {
1962 // An identifier that can be used to match events for this device.
1963 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1964 // Salt: Randomly generated 256 bit value
1965 // Hash algorithm: HMAC-SHA256
1966 // Size: 32 byte
1967 // Default: null or empty if the device identifier is not known
1968 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1969 // Connection handle of this connection if available
1970 // Range: 0x0000 - 0x0EFF (12 bits)
1971 // Default: 0xFFFF if the handle is unknown
1972 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001973 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001974 // Default: STATUS_UNKNOWN
1975 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1976 // Range: -30 ≤ N ≤ 20
1977 // Units: dBm
1978 // Invalid when an out of range value is reported
1979 optional int32 transmit_power_level = 4;
1980}
Jack Heab86dbd22018-12-18 15:43:27 -08001981
Tej Singh5d991e12018-03-09 19:48:11 -08001982/**
Jack He1021a612019-01-20 21:22:46 -08001983 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1984 * receiving an HCI command from the host
1985 *
1986 * Logged from: system/bt
1987 */
1988message BluetoothHciTimeoutReported {
1989 // HCI command associated with this event
1990 // Default: CMD_UNKNOWN
1991 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1992}
1993
1994/**
1995 * Logs when we receive Bluetooth Link Quality Report event from the controller
1996 * See Android Bluetooth HCI specification for more details
1997 *
1998 * Note: all count and bytes field are counted since last event
1999 *
2000 * Logged from: system/bt
2001 */
2002message BluetoothQualityReportReported {
2003 // Quality report ID
2004 // Original type: uint8_t
2005 // Default: BQR_ID_UNKNOWN
2006 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
2007 // Packet type of the connection
2008 // Original type: uint8_t
2009 // Default: BQR_PACKET_TYPE_UNKNOWN
2010 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2011 // Connection handle of the connection
2012 // Original type: uint16_t
2013 optional int32 connection_handle = 3;
2014 // Performing Role for the connection
2015 // Original type: uint8_t
2016 optional int32 connection_role = 4;
2017 // Current Transmit Power Level for the connection. This value is the same as the controller's
2018 // response to the HCI_Read_Transmit_Power_Level HCI command
2019 // Original type: uint8_t
2020 optional int32 tx_power_level = 5;
2021 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2022 // absolute receiver signal strength value
2023 // Original type: int8_t
2024 optional int32 rssi = 6;
2025 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2026 // channels used by the link currently
2027 // Original type: uint8_t
2028 optional int32 snr = 7;
2029 // Indicates the number of unused channels in AFH_channel_map
2030 // Original type: uint8_t
2031 optional int32 unused_afh_channel_count = 8;
2032 // Indicates the number of the channels which are interfered and quality is bad but are still
2033 // selected for AFH
2034 // Original type: uint8_t
2035 optional int32 afh_select_unideal_channel_count = 9;
2036 // Current Link Supervision Timeout Setting
2037 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2038 // Original type: uint16_t
2039 optional int32 lsto = 10;
2040 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2041 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2042 // 0x01 (Piconet Clock)
2043 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2044 // Original type: uint32_t
2045 optional int64 connection_piconet_clock = 11;
2046 // The count of retransmission
2047 // Original type: uint32_t
2048 optional int64 retransmission_count = 12;
2049 // The count of no RX
2050 // Original type: uint32_t
2051 optional int64 no_rx_count = 13;
2052 // The count of NAK (Negative Acknowledge)
2053 // Original type: uint32_t
2054 optional int64 nak_count = 14;
2055 // Controller timestamp of last TX ACK
2056 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2057 // Original type: uint32_t
2058 optional int64 last_tx_ack_timestamp = 15;
2059 // The count of Flow-off (STOP)
2060 // Original type: uint32_t
2061 optional int64 flow_off_count = 16;
2062 // Controller timestamp of last Flow-on (GO)
2063 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2064 // Original type: uint32_t
2065 optional int64 last_flow_on_timestamp = 17;
2066 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2067 // Original type: uint32_t
2068 optional int64 buffer_overflow_bytes = 18;
2069 // Buffer underflow count (in byte) since last event
2070 // Original type: uint32_t
2071 optional int64 buffer_underflow_bytes = 19;
2072}
2073
2074/**
2075 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2076 *
2077 * Notes:
2078 * - Each event can be partially filled as we might learn different pieces of device
2079 * information at different time
2080 * - Multiple device info events can be combined to give more complete picture
2081 * - When multiple device info events tries to describe the same information, the
2082 * later one wins
2083 *
2084 * Logged from:
2085 * packages/apps/Bluetooth
2086 */
Jack Heaea26982019-04-04 11:19:48 -07002087message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002088 // An identifier that can be used to match events for this device.
2089 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2090 // Salt: Randomly generated 256 bit value
2091 // Hash algorithm: HMAC-SHA256
2092 // Size: 32 byte
2093 // Default: null or empty if the device identifier is not known
2094 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2095 // Where is this device info obtained from
2096 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2097 // Name of the data source
2098 // For EXTERNAL: package name of the data source
2099 // For INTERNAL: null for general case, component name otherwise
2100 optional string source_name = 3;
2101 // Name of the manufacturer of this device
2102 optional string manufacturer = 4;
2103 // Model of this device
2104 optional string model = 5;
2105 // Hardware version of this device
2106 optional string hardware_version = 6;
2107 // Software version of this device
2108 optional string software_version = 7;
2109}
2110
2111/**
2112 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2113 * device, as documented by the Bluetooth Core HCI specification
2114 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2115 * Vol 2, Part E, Page 1118
2116 *
2117 * Logged from:
2118 * system/bt
2119 */
2120message BluetoothRemoteVersionInfoReported {
2121 // Connection handle of the connection
2122 // Original type: uint16_t
2123 optional int32 connection_handle = 1;
2124 // HCI command status code
2125 // Default: STATUS_UNKNOWN
2126 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2127 // 1 byte Version of current LMP in the remote controller
2128 optional int32 lmp_version = 3;
2129 // 2 bytes LMP manufacturer code of the remote controller
2130 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2131 optional int32 lmp_manufacturer_code = 4;
2132 // 4 bytes subversion of the LMP in the remote controller
2133 optional int32 lmp_subversion = 5;
2134}
2135
2136/**
2137 * Logs when certain Bluetooth SDP attributes are discovered
2138 * Constant definitions are from:
2139 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2140 *
2141 * Current logged attributes:
2142 * - BluetoothProfileDescriptorList
2143 * - Supported Features Bitmask
2144 *
2145 * Logged from:
2146 * system/bt
2147 */
2148message BluetoothSdpAttributeReported {
2149 // An identifier that can be used to match events for this device.
2150 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2151 // Salt: Randomly generated 256 bit value
2152 // Hash algorithm: HMAC-SHA256
2153 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2154 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2155 // Original type: uint16_t
2156 optional int32 protocol_uuid = 2;
2157 // Short form UUIDs used to identify Bluetooth SDP attribute types
2158 // Original type: uint16_t
2159 optional int32 attribute_id = 3;
2160 // Attribute value for the particular attribute
2161 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2162}
2163
2164/**
2165 * Logs when bond state of a Bluetooth device changes
2166 *
2167 * Logged from:
2168 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2169 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2170 */
2171message BluetoothBondStateChanged {
2172 // An identifier that can be used to match events for this device.
2173 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2174 // Salt: Randomly generated 256 bit value
2175 // Hash algorithm: HMAC-SHA256
2176 // Size: 32 byte
2177 // Default: null or empty if the device identifier is not known
2178 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2179 // Preferred transport type to remote dual mode device
2180 // Default: TRANSPORT_AUTO means no preference
2181 optional android.bluetooth.TransportTypeEnum transport = 2;
2182 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2183 // Default: UNKNOWN
2184 optional android.bluetooth.DeviceTypeEnum type = 3;
2185 // Current bond state (NONE, BONDING, BONDED)
2186 // Default: BOND_STATE_UNKNOWN
2187 optional android.bluetooth.BondStateEnum bond_state = 4;
2188 // Bonding sub state
2189 // Default: BOND_SUB_STATE_UNKNOWN
2190 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2191 // Unbond Reason
2192 // Default: UNBOND_REASON_UNKNOWN
2193 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2194}
2195
2196/**
2197 * Logs there is an event related Bluetooth classic pairing
2198 *
2199 * Logged from:
2200 * system/bt
2201 */
2202message BluetoothClassicPairingEventReported {
2203 // An identifier that can be used to match events for this device.
2204 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2205 // Salt: Randomly generated 256 bit value
2206 // Hash algorithm: HMAC-SHA256
2207 // Size: 32 byte
2208 // Default: null or empty if the device identifier is not known
2209 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2210 // Connection handle of this connection if available
2211 // Range: 0x0000 - 0x0EFF (12 bits)
2212 // Default: 0xFFFF if the handle is unknown
2213 optional int32 connection_handle = 2;
2214 // HCI command associated with this event
2215 // Default: CMD_UNKNOWN
2216 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2217 // HCI event associated with this event
2218 // Default: EVT_UNKNOWN
2219 optional android.bluetooth.hci.EventEnum hci_event = 4;
2220 // HCI command status code if this is triggerred by hci_cmd
2221 // Default: STATUS_UNKNOWN
2222 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2223 // HCI reason code associated with this event
2224 // Default: STATUS_UNKNOWN
2225 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002226 // A status value related to this specific event
2227 // Default: 0
2228 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002229}
2230
2231/**
2232 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2233 *
2234 * Logged from:
2235 * system/bt
2236 */
2237message BluetoothSmpPairingEventReported {
2238 // An identifier that can be used to match events for this device.
2239 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2240 // Salt: Randomly generated 256 bit value
2241 // Hash algorithm: HMAC-SHA256
2242 // Size: 32 byte
2243 // Default: null or empty if the device identifier is not known
2244 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2245 // SMP command sent or received over L2CAP
2246 // Default: CMD_UNKNOWN
2247 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2248 // Whether this command is sent or received
2249 // Default: DIRECTION_UNKNOWN
2250 optional android.bluetooth.DirectionEnum direction = 3;
2251 // SMP failure reason code
2252 // Default: PAIRING_FAIL_REASON_DEFAULT
2253 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2254}
2255
2256/**
Jack He815cdba2019-01-30 17:24:55 -08002257 * Logs when a Bluetooth socket’s connection state changed
2258 *
2259 * Logged from:
2260 * system/bt
2261 */
2262message BluetoothSocketConnectionStateChanged {
2263 // An identifier that can be used to match events for this device.
2264 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2265 // Salt: Randomly generated 256 bit value
2266 // Hash algorithm: HMAC-SHA256
2267 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002268 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002269 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002270 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002271 // Default 0 when unknown or don't care
2272 optional int32 port = 2;
2273 // Socket type as mentioned in
2274 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2275 // Default: SOCKET_TYPE_UNKNOWN
2276 optional android.bluetooth.SocketTypeEnum type = 3;
2277 // Socket connection state
2278 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2279 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2280 // Number of bytes sent to remote device during this connection
2281 optional int64 tx_bytes = 5;
2282 // Number of bytes received from remote device during this connection
2283 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002284 // Socket owner's UID
2285 optional int32 uid = 7 [(is_uid) = true];
2286 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2287 // |port| must be spawned by |server_port|
2288 // Default 0 when unknown or don't care
2289 optional int32 server_port = 8;
2290 // Whether this is a server listener socket
2291 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002292}
2293
2294/**
Jack He71426802019-04-02 13:32:52 -07002295 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2296 *
2297 * Logged from:
2298 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2299 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2300 *
2301 */
2302message BluetoothClassOfDeviceReported {
2303 // An identifier that can be used to match events for this device.
2304 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2305 // Salt: Randomly generated 256 bit value
2306 // Hash algorithm: HMAC-SHA256
2307 // Size: 32 byte
2308 // Default: null or empty if this is a server listener socket
2309 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2310 // Class of Device (CoD) value including both Major, Minor device class and service class
2311 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2312 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2313 // Default: 0
2314 optional int32 class_of_device = 2;
2315}
2316
2317/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002318 * Logs when something is plugged into or removed from the USB-C connector.
2319 *
2320 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002321 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002322 */
2323message UsbConnectorStateChanged {
2324 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002325 STATE_DISCONNECTED = 0;
2326 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002327 }
2328 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002329 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002330 // Last active session in ms.
2331 // 0 when the port is in connected state.
2332 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002333}
2334
2335/**
2336 * Logs the reported speaker impedance.
2337 *
2338 * Logged from:
2339 * Vendor audio implementation.
2340 */
2341message SpeakerImpedanceReported {
2342 optional int32 speaker_location = 1;
2343 optional int32 impedance = 2;
2344}
2345
2346/**
2347 * Logs the report of a failed hardware.
2348 *
2349 * Logged from:
2350 * Vendor HALs.
2351 *
2352 */
2353message HardwareFailed {
2354 enum HardwareType {
2355 HARDWARE_FAILED_UNKNOWN = 0;
2356 HARDWARE_FAILED_MICROPHONE = 1;
2357 HARDWARE_FAILED_CODEC = 2;
2358 HARDWARE_FAILED_SPEAKER = 3;
2359 HARDWARE_FAILED_FINGERPRINT = 4;
2360 }
2361 optional HardwareType hardware_type = 1;
2362
Maggie White6dcd8572019-01-31 14:11:50 -08002363 /**
2364 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002365 * the same hardware_type. The specific locations are vendor defined integers,
2366 * referring to board-specific numbering schemes.
2367 */
2368 optional int32 hardware_location = 2;
2369
Maggie White6dcd8572019-01-31 14:11:50 -08002370 /**
2371 * failure_code is specific to the HardwareType of the failed hardware.
2372 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002373 */
Maggie White6dcd8572019-01-31 14:11:50 -08002374 enum HardwareErrorCode {
2375 UNKNOWN = 0;
2376 COMPLETE = 1;
2377 SPEAKER_HIGH_Z = 2;
2378 SPEAKER_SHORT = 3;
2379 FINGERPRINT_SENSOR_BROKEN = 4;
2380 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002381 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002382 }
2383 optional int32 failure_code = 3;
2384}
2385
2386/**
2387 * Log an event when the device has been physically dropped.
2388 * Reported from the /vendor partition.
2389 */
2390message PhysicalDropDetected {
2391 // Confidence that the event was actually a drop, 0 -> 100
2392 optional int32 confidence_pctg = 1;
2393 // Peak acceleration of the drop, in 1/1000s of a g.
2394 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002395 // Duration of freefall in ms
2396 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002397}
2398
2399/**
2400 * Log bucketed battery charge cycles.
2401 *
2402 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002403 * a given charge point. For example, if 10 cycle buckets are
2404 * initialized, bucket 1 is the lowest 1/10th of the battery,
2405 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002406 *
2407 * Logged from:
2408 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2409 */
2410message ChargeCyclesReported {
2411 optional int32 cycle_bucket_1 = 1;
2412 optional int32 cycle_bucket_2 = 2;
2413 optional int32 cycle_bucket_3 = 3;
2414 optional int32 cycle_bucket_4 = 4;
2415 optional int32 cycle_bucket_5 = 5;
2416 optional int32 cycle_bucket_6 = 6;
2417 optional int32 cycle_bucket_7 = 7;
2418 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002419 optional int32 cycle_bucket_9 = 9;
2420 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002421}
2422
2423/**
Howard Roa46b6582018-09-18 16:45:02 -07002424 * Log battery health snapshot.
2425 *
2426 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2427 * are snapshotted periodically over 24hrs.
2428 */
2429message BatteryHealthSnapshot {
2430 enum BatterySnapshotType {
2431 UNKNOWN = 0;
2432 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2433 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2434 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2435 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2436 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2437 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2438 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2439 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2440 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2441 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2442 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2443 }
2444 optional BatterySnapshotType type = 1;
2445 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002446 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002447 // Voltage Battery Voltage, in microVolts.
2448 optional int32 voltage_micro_volt = 3;
2449 // Current Battery current, in microAmps.
2450 optional int32 current_micro_amps = 4;
2451 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2452 optional int32 open_circuit_micro_volt = 5;
2453 // Resistance Battery Resistance, in microOhms.
2454 optional int32 resistance_micro_ohm = 6;
2455 // Level Battery Level, as % of full.
2456 optional int32 level_percent = 7;
2457}
2458
2459/**
2460 * Log slow I/O operations on the primary storage.
2461 */
2462message SlowIo {
2463 // Classifications of IO Operations.
2464 enum IoOperation {
2465 UNKNOWN = 0;
2466 READ = 1;
2467 WRITE = 2;
2468 UNMAP = 3;
2469 SYNC = 4;
2470 }
2471 optional IoOperation operation = 1;
2472
2473 // The number of slow IO operations of this type over 24 hours.
2474 optional int32 count = 2;
2475}
2476
2477/**
2478 * Log battery caused shutdown with the last recorded voltage.
2479 */
2480message BatteryCausedShutdown {
2481 // The last recorded battery voltage prior to shutdown.
2482 optional int32 last_recorded_micro_volt = 1;
2483}
2484
2485/**
Tej Singha72344992019-04-17 18:55:08 -07002486 * Logs when ThermalService receives throttling events.
2487 *
2488 * Logged from:
2489 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2490 */
2491message ThermalThrottlingSeverityStateChanged {
2492 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2493 optional android.os.TemperatureTypeEnum sensor_type = 1;
2494
2495 // The name of the temperature source. Eg. CPU0
2496 optional string sensor_name = 2;
2497
2498 // Temperature in tenths of a degree C.
2499 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2500 optional int32 temperature_deci_celsius = 3;
2501
2502 // Relative severity of the throttling, see enum definition.
2503 optional android.os.ThrottlingSeverityEnum severity = 4;
2504}
2505
2506/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002507 * Logs the duration of a davey (jank of >=700ms) when it occurs
2508 *
2509 * Logged from:
2510 * frameworks/base/libs/hwui/JankTracker.cpp
2511 */
2512message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002513 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002514 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002515
Tej Singhbb8554a2018-01-26 11:59:14 -08002516 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002517 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002518}
2519
2520/**
Bookatze5885242017-10-24 20:10:31 -07002521 * Logs phone signal strength changes.
2522 *
2523 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002524 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002525 */
2526message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002527 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2528 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002529}
2530
Yangster4ccebea2018-10-09 17:09:02 -07002531
2532/**
2533 * Logs when the phone state, sim state or signal strength changes
2534 *
2535 * Logged from:
2536 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2537 */
2538message PhoneServiceStateChanged {
2539 optional android.telephony.ServiceStateEnum state = 1;
2540 optional android.telephony.SimStateEnum sim_state = 2;
2541 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2542}
2543
2544/**
2545 * Logs when the phone becomes on or off.
2546 *
2547 * Logged from:
2548 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2549 */
2550message PhoneStateChanged {
2551 enum State {
2552 OFF = 0;
2553 ON = 1;
2554 }
2555 optional State state = 1;
2556}
2557
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002558message BackGesture {
2559 enum BackType {
2560 DEFAULT_BACK_TYPE = 0;
2561 COMPLETED = 1;
2562 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2563 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2564 INCOMPLETE = 4;
2565 }
2566 optional BackType type = 1;
2567
2568 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2569 enum WindowHorizontalLocation {
2570 DEFAULT_LOCATION = 0;
2571 LEFT = 1;
2572 RIGHT = 2;
2573 }
2574 optional WindowHorizontalLocation x_location = 3;
2575}
2576
2577message ExclusionRectStateChanged {
2578 optional string component_name = 1; // if not available, simply packageName
2579 optional int32 requested_height = 2; // px
2580 optional int32 rejected_height = 3; // px
2581
2582 enum WindowHorizontalLocation {
2583 DEFAULT_LOCATION = 0;
2584 LEFT = 1;
2585 RIGHT = 2;
2586 }
2587 optional WindowHorizontalLocation x_location = 4;
2588 optional bool landscape = 5;
2589 optional bool splitscreen = 6;
2590 optional int32 duration_millis = 7;
2591}
2592
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002593message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002594 optional android.stats.launcher.LauncherAction action = 1;
2595 optional android.stats.launcher.LauncherState src_state = 2;
2596 optional android.stats.launcher.LauncherState dst_state = 3;
2597 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002598 optional bool is_swipe_up_enabled = 5;
2599}
2600
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002601message StyleUIChanged {
2602 optional android.stats.style.Action action = 1;
2603 optional int32 color_package_hash = 2;
2604 optional int32 font_package_hash = 3;
2605 optional int32 shape_package_hash = 4;
2606 optional int32 clock_package_hash = 5;
2607 optional int32 launcher_grid = 6;
2608 optional int32 wallpaper_category_hash = 7;
2609 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002610 optional int32 color_preference = 9;
2611 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002612}
2613
David Chenc28b2bb2017-10-24 12:52:52 -07002614/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002615 * Logs when Settings UI has changed.
2616 *
2617 * Logged from:
2618 * packages/apps/Settings
2619 */
2620message SettingsUIChanged {
2621 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002622 * Where this SettingsUIChange event comes from. For example, if
2623 * it's a PAGE_VISIBLE event, where the page is opened from.
2624 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002625 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002626
2627 /**
2628 * What the UI action is.
2629 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002630 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002631
2632 /**
2633 * Where the action is happening
2634 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002635 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002636
2637 /**
2638 * What preference changed in this event.
2639 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002640 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002641
2642 /**
2643 * The new value of the changed preference.
2644 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002645 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002646}
2647
2648/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002649 * Logs basic timing information about touch events.
2650 * Reported at most every 5 minutes while device is being interacted with.
2651 *
2652 * Logged from:
2653 * frameworks/native/services/inputflinger
2654 */
2655message TouchEventReported {
2656 /**
2657 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002658 * and the standard deviation of the time spent processing touchscreen events
2659 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002660 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002661 * On supported devices, the starting point is taken during the hard interrupt inside the
2662 * kernel touch driver. On all other devices, the starting point is taken inside
2663 * the kernel's input event subsystem upon receipt of the input event.
2664 * The ending point is taken inside InputDispatcher, just after the input event
2665 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002666 */
2667 // Minimum value
2668 optional float latency_min_micros = 1;
2669 // Maximum value
2670 optional float latency_max_micros = 2;
2671 // Average value
2672 optional float latency_mean_micros = 3;
2673 // Standard deviation
2674 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002675 // Number of touch events (input_event) in this report
2676 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002677}
2678
2679/**
Philip Quinn0eded622019-01-29 12:46:28 -08002680 * Logs gesture classification and timing information for touch events.
2681 *
2682 * Logged from:
2683 * frameworks/base/core/java/android/view/GestureDetector.java
2684 * frameworks/base/core/java/android/view/View.java
2685 */
2686message TouchGestureClassified {
2687 // The source of the classification (e.g. Java class name).
2688 optional string source = 1;
2689
2690 enum Classification {
2691 UNKNOWN_CLASSIFICATION = 0;
2692 SINGLE_TAP = 1;
2693 DOUBLE_TAP = 2;
2694 LONG_PRESS = 3;
2695 DEEP_PRESS = 4;
2696 SCROLL = 5;
2697 }
2698 // The classification of the gesture.
2699 optional Classification classification = 2;
2700
2701 // The interval from the start of a touch event stream until the
2702 // classification was made.
2703 optional int32 latency_millis = 3;
2704
2705 // The distance from the location of the first touch event to the
2706 // location of the touch event when the classification was made.
2707 optional float displacement_px = 4;
2708}
2709
2710/**
David Chenc28b2bb2017-10-24 12:52:52 -07002711 * Logs that a setting was updated.
2712 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002713 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002714 * The tag and is_default allow resetting of settings to default values based on the specified
2715 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2716 */
2717message SettingChanged {
2718 // The name of the setting.
2719 optional string setting = 1;
2720
2721 // The change being imposed on this setting. May represent a number, eg "3".
2722 optional string value = 2;
2723
2724 // The new value of this setting. For most settings, this is same as value. For some settings,
2725 // value is +X or -X where X represents an element in a set. For example, if the previous value
2726 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2727 // The +/- feature is currently only used for location_providers_allowed.
2728 optional string new_value = 3;
2729
2730 // The previous value of this setting.
2731 optional string prev_value = 4;
2732
2733 // The tag used with the is_default for resetting sets of settings. This is generally null.
2734 optional string tag = 5;
2735
Bookatz90867622018-01-31 15:05:57 -08002736 // True if this setting with tag should be resettable.
2737 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002738
David Chenbd789912018-03-16 17:19:55 -07002739 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002740 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002741
2742 enum ChangeReason {
2743 UPDATED = 1; // Updated can be an insertion or an update.
2744 DELETED = 2;
2745 }
2746 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002747}
Chenjie Yub3dda412017-10-24 13:41:59 -07002748
Chenjie Yu05013b32017-11-21 10:21:41 -08002749/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002750 * Logs activity going to foreground or background
2751 *
2752 * Logged from:
2753 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2754 */
2755message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002756 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002757 optional string pkg_name = 2;
2758 optional string class_name = 3;
2759
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002760 enum State {
2761 BACKGROUND = 0;
2762 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002763 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002764 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002765}
David Chenc8a43242017-10-17 16:23:28 -07002766
2767/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002768 * Logs when a volume entered low Storage state.
2769 * Logged from:
2770 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2771 */
2772message LowStorageStateChanged {
2773 // Volume that ran out of storage.
2774 optional string volume_description = 1;
2775
2776 enum State {
2777 UNKNOWN = 0;
2778 OFF = 1;
2779 ON = 2;
2780 }
2781 optional State state = 2;
2782}
2783
2784/**
2785 * Logs when an app is downgraded.
2786 * Logged from:
2787 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2788 */
2789message AppDowngraded {
2790 optional string package_name = 1;
2791 // Size of the package (all data) before being downgraded.
2792 optional int64 size_in_bytes_before = 2;
2793 // Size of the package (all data) after being downgraded.
2794 optional int64 size_in_bytes_after = 3;
2795
2796 optional bool aggressive = 4;
2797}
2798
2799/**
2800 * Logs when an app is optimized after being downgraded.
2801 * Logged from:
2802 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2803 */
2804message AppOptimizedAfterDowngraded {
2805 optional string package_name = 1;
2806}
2807
2808/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002809 * Logs whenever an app is installed on external storage.
2810 * Logged from:
2811 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2812 */
2813message AppInstallOnExternalStorageReported {
2814 // The type of external storage.
2815 optional android.stats.storage.ExternalStorageType storage_type = 1;
2816 // The name of the package that is installed on the sd card.
2817 optional string package_name = 2;
2818}
2819
2820/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002821 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002822 * Logged from:
2823 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2824 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002825message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002826 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002827
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002828 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002829
2830 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002831 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002832 optional string process_name = 3;
2833
2834 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002835 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002836
2837 optional string package_name = 5;
2838
2839 enum InstantApp {
2840 UNAVAILABLE = 0;
2841 FALSE = 1;
2842 TRUE = 2;
2843 }
2844 optional InstantApp is_instant_app = 6;
2845
2846 enum ForegroundState {
2847 UNKNOWN = 0;
2848 BACKGROUND = 1;
2849 FOREGROUND = 2;
2850 }
2851 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002852
2853 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002854}
David Chen9e3808c2017-11-20 17:25:34 -08002855
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002856/**
2857 * Logs when a WTF (What a Terrible Failure) happened.
2858 * Logged from:
2859 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2860 */
2861message WTFOccurred {
2862 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002863
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002864 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002865
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002866 // The name of the process.
2867 // system_server if it is not by an app
2868 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002869
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002870 // The pid if available. -1 means not available.
2871 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002872
2873 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002874}
2875
2876/**
2877 * Logs when system server reports low memory.
2878 * Logged from:
2879 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2880 */
2881message LowMemReported {
2882}
2883
2884/**
2885 * Logs when an app ANR (App Not Responding) occurs.
2886 * Logged from:
2887 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2888 */
2889message ANROccurred {
2890 optional int32 uid = 1 [(is_uid) = true];
2891
2892 optional string process_name = 2;
2893
2894 optional string short_component_name = 3;
2895
2896 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002897
2898 enum InstantApp {
2899 UNAVAILABLE = 0;
2900 FALSE = 1;
2901 TRUE = 2;
2902 }
2903 optional InstantApp is_instant_app = 5;
2904
2905 enum ForegroundState {
2906 UNKNOWN = 0;
2907 BACKGROUND = 1;
2908 FOREGROUND = 2;
2909 }
2910 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002911
2912 optional android.server.ErrorSource error_source = 7;
2913
2914 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002915}
2916
Bookatza7020bd2018-08-28 16:29:35 -07002917/**
2918 * Logs when the vibrator state changes.
2919 * Logged from:
2920 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2921 */
2922message VibratorStateChanged {
2923 repeated AttributionNode attribution_node = 1;
2924
2925 enum State {
2926 OFF = 0;
2927 ON = 1;
2928 }
2929 optional State state = 2;
2930
2931 // Duration (in milliseconds) requested to keep the vibrator on.
2932 // Only applicable for State == ON.
2933 optional int64 duration_millis = 3;
2934}
2935
David Chen0a368b22017-12-06 16:28:16 -08002936/*
2937 * Allows other apps to push events into statsd.
2938 * Logged from:
2939 * frameworks/base/core/java/android/util/StatsLog.java
2940 */
David Chen0b5c90c2018-01-25 16:51:49 -08002941message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002942 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002943 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002944
2945 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2946 optional int32 label = 2;
2947
2948 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2949 // predicates for the metrics).
2950 enum State {
2951 UNKNOWN = 0;
2952 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2953 STOP = 2;
2954 START = 3;
2955 }
2956 optional State state = 3;
2957}
2958
David Chen9e3808c2017-11-20 17:25:34 -08002959/**
Bookatz7948c872018-09-04 12:58:33 -07002960 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2961 * For example, this could be due to the user manually changing the time.
2962 *
2963 * Logged from:
2964 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2965 */
2966message WallClockTimeShifted {
2967 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2968 optional int64 wall_clock_timestamp_millis = 1;
2969}
2970
2971/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002972 * Logs when statsd detects an anomaly.
2973 *
2974 * Logged from:
2975 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2976 */
2977message AnomalyDetected {
2978 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002979 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002980
Yangster-mac94e197c2018-01-02 16:03:03 -08002981 // Id of the config whose anomaly detection alert fired.
2982 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002983
Yangster-mac94e197c2018-01-02 16:03:03 -08002984 // Id of the alert (i.e. name of the anomaly that was detected).
2985 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002986}
2987
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002988message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002989 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002990 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002991
2992 // The app package name.
2993 optional string pkg_name = 2;
2994
2995 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002996 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002997 WARM = 1;
2998 HOT = 2;
2999 COLD = 3;
3000 }
3001 // The transition type.
3002 optional TransitionType type = 3;
3003
3004 // The activity name.
3005 optional string activity_name = 4;
3006
3007 // The name of the calling app. Empty if not set.
3008 optional string calling_pkg_name = 5;
3009
3010 // Whether the app is an instant app.
3011 optional bool is_instant_app = 6;
3012
3013 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003014 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003015
Bookatz80d11a02018-01-16 10:46:35 -08003016 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003017
David Chen0b5c90c2018-01-25 16:51:49 -08003018 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003019 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003020 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003021 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003022 optional int32 bind_application_delay_millis = 11;
3023 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003024
3025 // Empty if not set.
3026 optional string launch_token = 13;
3027
Calin Juravle759fbda2018-02-20 19:52:30 +00003028 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003029 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003030
3031 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003032 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003033}
3034
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003035message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003036 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003037 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003038
3039 // The app package name.
3040 optional string pkg_name = 2;
3041
3042 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003043 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003044 WARM = 1;
3045 HOT = 2;
3046 COLD = 3;
3047 }
3048 // The transition type.
3049 optional TransitionType type = 3;
3050
3051 // The activity name.
3052 optional string activity_name = 4;
3053}
3054
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003055message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003056 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003057 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003058
3059 // The app package name.
3060 optional string pkg_name = 2;
3061
3062 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003063 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003064 WITH_BUNDLE = 1;
3065 WITHOUT_BUNDLE = 2;
3066 }
3067 // The transition type.
3068 optional TransitionType type = 3;
3069
3070 // The activity name.
3071 optional string activity_name = 4;
3072
3073 optional bool transition_process_running = 5;
3074
3075 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003076 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003077}
3078
Bookatz8fcd09a2017-12-18 13:01:10 -08003079/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003080 * Logs a picture-in-picture action
3081 * Logged from:
3082 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3083 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3084 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3085 */
3086message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003087 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003088 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003089
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003090 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003091
Chenjie Yu52cacc62017-12-08 18:11:45 -08003092 enum State {
3093 ENTERED = 1;
3094 EXPANDED_TO_FULL_SCREEN = 2;
3095 MINIMIZED = 3;
3096 DISMISSED = 4;
3097 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003098 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003099}
3100
3101/**
Chenjie Yue8904192017-12-08 19:12:57 -08003102 * Logs overlay action
3103 * Logged from:
3104 * services/core/java/com/android/server/wm/Session.java
3105 */
3106message OverlayStateChanged {
tsaichristine10978642019-09-10 14:12:49 -07003107 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003108
tsaichristine10978642019-09-10 14:12:49 -07003109 optional string package_name = 2 [(state_field_option).option = PRIMARY];
Chenjie Yue8904192017-12-08 19:12:57 -08003110
3111 optional bool using_alert_window = 3;
3112
3113 enum State {
3114 ENTERED = 1;
3115 EXITED = 2;
3116 }
tsaichristine10978642019-09-10 14:12:49 -07003117 optional State state = 4 [(state_field_option).option = EXCLUSIVE];
Chenjie Yue8904192017-12-08 19:12:57 -08003118}
3119
Chenjie Yuccfe6452018-01-30 11:33:21 -08003120/*
3121 * Logs foreground service starts and stops.
3122 * Note that this is not when a service starts or stops, but when it is
3123 * considered foreground.
3124 * Logged from
3125 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3126 */
3127message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003128 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003129 // package_name + "/" + class_name
3130 optional string short_name = 2;
3131
3132 enum State {
3133 ENTER = 1;
3134 EXIT = 2;
3135 }
3136 optional State state = 3;
3137}
3138
Chenjie Yue8904192017-12-08 19:12:57 -08003139/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003140 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3141 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3142 * attributed back to the parent (host) uid. One example is Chrome.
3143 *
3144 * Logged from:
3145 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3146 */
3147message IsolatedUidChanged {
3148 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003149 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003150 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003151 optional int32 parent_uid = 1;
3152
3153 optional int32 isolated_uid = 2;
3154
3155 // We expect an isolated uid to be removed before if it's used for another parent uid.
3156 enum Event {
3157 REMOVED = 0;
3158 CREATED = 1;
3159 }
3160 optional Event event = 3;
3161}
3162
3163/*
3164 * Logs the reception of an incoming network packet causing the main system to wake up for
3165 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3166 * and processed by WakeupController.cpp.
3167 */
3168message PacketWakeupOccurred {
3169 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3170 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003171 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003172 // The interface name on which the packet was received.
3173 optional string iface = 2;
3174 // The ethertype value of the packet.
3175 optional int32 ethertype = 3;
3176 // String representation of the destination MAC address of the packet.
3177 optional string destination_hardware_address = 4;
3178 // String representation of the source address of the packet if this was an IP packet.
3179 optional string source_ip = 5;
3180 // String representation of the destination address of the packet if this was an IP packet.
3181 optional string destination_ip = 6;
3182 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3183 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3184 // families.
3185 optional int32 ip_next_header = 7;
3186 // The source port if this was a TCP or UDP packet.
3187 optional int32 source_port = 8;
3188 // The destination port if this was a TCP or UDP packet.
3189 optional int32 destination_port = 9;
3190}
3191
3192/*
3193 * Logs the memory stats for an app on startup.
3194 * Logged from:
3195 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3196 */
3197message AppStartMemoryStateCaptured {
3198 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003199 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003200
3201 // The process name.
3202 optional string process_name = 2;
3203
3204 // The activity name.
3205 optional string activity_name = 3;
3206
3207 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003208 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003209
3210 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003211 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003212
3213 // RSS
3214 optional int64 rss_in_bytes = 6;
3215
3216 // CACHE
3217 optional int64 cache_in_bytes = 7;
3218
3219 // SWAP
3220 optional int64 swap_in_bytes = 8;
3221}
3222
3223/*
3224 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3225 * for LMK event.
3226 * Logged from:
3227 * system/core/lmkd/lmkd.c
3228 */
3229message LmkStateChanged {
3230 enum State {
3231 UNKNOWN = 0;
3232 START = 1;
3233 STOP = 2;
3234 }
3235 optional State state = 1;
3236}
3237
3238/*
3239 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3240 * Logged from:
3241 * system/core/lmkd/lmkd.c
3242 */
3243message LmkKillOccurred {
3244 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003245 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003246
3247 // The process name.
3248 optional string process_name = 2;
3249
3250 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003251 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003252
3253 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003254 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003255
3256 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003257 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003258
3259 // RSS
3260 optional int64 rss_in_bytes = 6;
3261
3262 // CACHE
3263 optional int64 cache_in_bytes = 7;
3264
3265 // SWAP
3266 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003267
3268 // The elapsed real time of start of the process.
3269 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003270
3271 // Min oom adj score considered by lmkd.
3272 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003273}
3274
Rajeev Kumar51b54602018-03-01 12:18:26 -08003275/*
3276 * Logs when the ActivityManagerService detects that an app died.
3277 *
3278 * Logged from:
3279 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3280 */
3281message AppDied {
3282 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003283 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003284}
3285
Howard Ro21a039c2018-08-06 14:55:47 -07003286/**
3287 * An atom for generic metrics logging. Available from Android Q.
3288 */
3289message GenericAtom {
3290 // The uid of the application that sent this custom atom.
3291 optional int32 uid = 1 [(is_uid) = true];
3292
3293 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003294 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003295}
3296
Tej Singhd6d6d772018-09-05 17:41:25 -07003297/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003298 * Atom for simple logging of user interaction and impression events, such as "the user touched
3299 * this button" or "this dialog was displayed".
3300 * Keep the UI event stream clean: don't use for system or background events.
3301 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
3302 */
3303message UiEventReported {
3304 // The event_id.
3305 optional int32 event_id = 1;
3306 // The event's source or target uid and package, if applicable.
3307 // For example, the package posting a notification, or the destination package of a share.
3308 optional int32 uid = 2 [(is_uid) = true];
3309 optional string package_name = 3;
3310}
3311
3312/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003313 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003314 *
3315 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003316 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003317 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003318message BiometricAcquired {
3319 // Biometric modality that was acquired.
3320 optional android.hardware.biometrics.ModalityEnum modality = 1;
3321 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3322 optional int32 user = 2;
3323 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3324 optional bool is_crypto = 3;
3325 // Action that the device is performing. Acquired messages are only expected for enroll and
3326 // authenticate. Other actions may indicate an error.
3327 optional android.hardware.biometrics.ActionEnum action = 4;
3328 // The client that this acquisition was received for.
3329 optional android.hardware.biometrics.ClientEnum client = 5;
3330 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3331 optional int32 acquire_info = 6;
3332 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3333 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003334 // Dictates if this message should trigger additional debugging.
3335 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003336}
3337
3338/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003339 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003340 *
3341 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003342 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003343 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003344message BiometricAuthenticated {
3345 // Biometric modality that was used.
3346 optional android.hardware.biometrics.ModalityEnum modality = 1;
3347 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3348 optional int32 user = 2;
3349 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3350 // storage.
3351 optional bool is_crypto = 3;
3352 // The client that this acquisition was received for.
3353 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003354 // If authentication requires user confirmation. See BiometricPrompt's
3355 // setRequireConfirmation(bool) method.
3356 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003357
Kevin Chyn1741a072019-01-17 11:54:40 -08003358 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003359 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003360 REJECTED = 1;
3361 PENDING_CONFIRMATION = 2;
3362 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003363 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003364
3365 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003366 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003367 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3368 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3369 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3370 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003371 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003372 // Dictates if this message should trigger additional debugging.
3373 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003374}
3375
3376/**
3377 * Logs when a biometric error occurs.
3378 *
3379 * Logged from:
3380 * frameworks/base/services/core/java/com/android/server/biometrics
3381 */
3382message BiometricErrorOccurred {
3383 // Biometric modality that was used.
3384 optional android.hardware.biometrics.ModalityEnum modality = 1;
3385 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3386 optional int32 user = 2;
3387 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3388 optional bool is_crypto = 3;
3389 // Action that the device is performing.
3390 optional android.hardware.biometrics.ActionEnum action = 4;
3391 // The client that this acquisition was received for.
3392 optional android.hardware.biometrics.ClientEnum client = 5;
3393 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3394 // are unique to modality.
3395 optional int32 error_info = 6;
3396 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3397 // by the vendor and not specified by the HIDL interface.
3398 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003399 // Dictates if this message should trigger additional debugging.
3400 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003401 // Time spent during the authentication attempt.
3402 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003403}
3404
3405/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003406 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003407 * Logged from:
3408 * frameworks/base/services/core/java/com/android/server/biometrics
3409 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003410message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003411 // Biometric modality.
3412 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003413 // Type of issue detected.
3414 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003415 // Dictates if this message should trigger additional debugging.
3416 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003417}
Howard Ro688ae182018-09-25 00:09:36 -07003418
joshmccloskey6f952b22019-03-25 20:59:35 -07003419/**
3420 * Logs when a biometric enrollment occurs.
3421 *
3422 * Logged from:
3423 * frameworks/base/services/core/java/com/android/server/biometrics
3424 */
3425message BiometricEnrolled {
3426 // Biometric modality that was used.
3427 optional android.hardware.biometrics.ModalityEnum modality = 1;
3428 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3429 optional int32 user = 2;
3430 // The amount of time the enrollment took in milliseconds.
3431 optional int64 latency_millis = 3;
3432 // Whether or not the enrollment was successful.
3433 optional bool success = 4;
3434}
3435
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003436/*
Tej Singh0d176952019-01-16 19:10:54 -08003437 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003438 */
Tej Singh0d176952019-01-16 19:10:54 -08003439message FlagFlipUpdateOccurred {
3440 // If the event is from a flag config package, specify the package name.
3441 optional string flag_flip_package_name = 1;
3442
3443 // The order id of the package
3444 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003445}
3446
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003447/**
3448 * Potential experiment ids that goes with a train install.
3449 */
3450message TrainExperimentIds {
3451 repeated int64 experiment_id = 1;
3452}
3453
Yangster-macb89807e2018-11-15 21:10:57 -08003454/*
3455 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003456 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003457 */
3458message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003459 // Name of the train.
3460 optional string train_name = 1;
3461 // Version code for a "train" of packages that need to be installed atomically
3462 optional int64 train_version_code = 2;
3463 // After installation of this package, device requires a restart.
3464 optional bool requires_staging = 3;
3465 // Rollback should be enabled for this install.
3466 optional bool rollback_enabled = 4;
3467 // Requires low latency monitoring if possible.
3468 optional bool requires_low_latency_monitor = 5;
3469
Yangster-macb89807e2018-11-15 21:10:57 -08003470 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003471 UNKNOWN = 0;
3472 INSTALL_REQUESTED = 1;
3473 INSTALL_STARTED = 2;
3474 INSTALL_STAGED_NOT_READY = 3;
3475 INSTALL_STAGED_READY = 4;
3476 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003477 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3478 // and INSTALL_FAILURE_COMMIT.
3479 INSTALL_FAILURE = 6 [deprecated = true];
3480 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003481 INSTALL_CANCELLED = 7;
3482 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003483 INSTALLER_ROLLBACK_INITIATED = 9;
3484 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3485 INSTALLER_ROLLBACK_STAGED = 11;
3486 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3487 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3488 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3489 INSTALLER_ROLLBACK_SUCCESS = 15;
3490 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003491 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3492 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3493 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3494 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3495 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3496 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003497 INSTALL_FAILURE_DOWNLOAD = 23;
3498 INSTALL_FAILURE_STATE_MISMATCH = 24;
3499 INSTALL_FAILURE_COMMIT = 25;
Yangster-macb89807e2018-11-15 21:10:57 -08003500 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003501 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003502 // Possible experiment ids for monitoring this push.
3503 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3504 // user id
3505 optional int32 user_id = 8;
Yangster-macb89807e2018-11-15 21:10:57 -08003506}
3507
Tej Singhc9203082019-05-03 13:42:23 -07003508/* Test atom, is not logged anywhere */
3509message TestAtomReported {
3510 repeated AttributionNode attribution_node = 1;
3511 optional int32 int_field = 2;
3512 optional int64 long_field = 3;
3513 optional float float_field = 4;
3514 optional string string_field = 5;
3515 optional bool boolean_field = 6;
3516 enum State {
3517 UNKNOWN = 0;
3518 OFF = 1;
3519 ON = 2;
3520 }
3521 optional State state = 7;
3522 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3523}
3524
Maggie Whitefc1aa592018-11-28 21:55:23 -08003525/** Represents USB port overheat event. */
3526message UsbPortOverheatEvent {
3527 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3528 optional int32 plug_temperature_deci_c = 1;
3529
3530 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3531 optional int32 max_temperature_deci_c = 2;
3532
3533 /* Time between USB plug event and overheat threshold trip, in seconds. */
3534 optional int32 time_to_overheat_secs = 3;
3535
3536 /* Time between overheat threshold trip and hysteresis, in seconds. */
3537 optional int32 time_to_hysteresis_secs = 4;
3538
3539 /* Time between hysteresis and active mitigation ending, in seconds. */
3540 optional int32 time_to_inactive_secs = 5;
3541};
3542
Maggie White8735b852019-01-18 11:40:49 -08003543/**
3544 * Logs total effective full charge and discharge cycles on a battery.
3545 * Here are some examples of one effective cycle:
3546 * 1) the battery charges from 0% to 100% and drains back to 0%,
3547 * 2) charging from 50% to 100% and draining back to 50% twice.
3548 * Pulled from:
3549 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3550 */
3551message BatteryCycleCount {
3552 /* Number of total charge and discharge cycles on the system battery. */
3553 optional int32 cycle_count = 1;
3554}
3555
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003556/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003557 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3558 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003559 * Pulled from:
3560 * StatsCompanionService
3561 */
3562
Carmen Agimof12dec122019-03-06 16:14:38 +00003563message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003564
Carmen Agimof12dec122019-03-06 16:14:38 +00003565 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003566 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003567 PUBLIC = 1;
3568 PRIVATE = 2;
3569 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003570 }
3571
Carmen Agimof12dec122019-03-06 16:14:38 +00003572 // The type of external storage.
3573 optional android.stats.storage.ExternalStorageType storage_type = 1;
3574 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3575 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003576 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003577 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003578}
3579
Yangster-macb89807e2018-11-15 21:10:57 -08003580/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003581 * Logs when a connection becomes available and lost.
3582 * Logged in StatsCompanionService.java
3583 */
3584message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003585 // Id of the network.
3586 optional int32 net_id = 1;
3587
3588 enum State {
3589 UNKNOWN = 0;
3590 CONNECTED = 1;
3591 DISCONNECTED = 2;
3592 }
3593 // Connected state of a network.
3594 optional State state = 2;
3595}
3596
3597/**
3598 * Logs when a service starts and stops.
3599 * Logged from:
3600 * services/core/java/com/android/server/am/ActiveServices.java
3601 */
3602message ServiceStateChanged {
3603
3604 optional int32 uid = 1 [(is_uid) = true];
3605
3606 optional string package_name = 2;
3607
3608 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003609
3610 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003611 START = 1;
3612 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003613 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003614
3615 optional State state = 4;
3616}
3617
3618/**
3619 * Logs when a service is launched.
3620 * Logged from:
3621 * services/core/java/com/android/server/am/ActiveServices.java
3622 */
3623message ServiceLaunchReported {
3624
3625 optional int32 uid = 1 [(is_uid) = true];
3626
3627 optional string package_name = 2;
3628
3629 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003630}
Howard Ro688ae182018-09-25 00:09:36 -07003631
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003632/**
3633 * Logs when a hidden API is used.
3634 *
3635 * Logged from:
3636 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3637 */
3638message HiddenApiUsed {
3639 // The uid of the app making the hidden access.
3640 optional int32 uid = 1 [(is_uid) = true];
3641
3642 // Signature of the method or field accessed.
3643 optional string signature = 2;
3644
3645 enum AccessMethod {
3646 NONE = 0;
3647 REFLECTION = 1;
3648 JNI = 2;
3649 LINKING = 3;
3650 }
3651
3652 // Type of access.
3653 optional AccessMethod access_method = 3;
3654
3655 // Whether the access was prevented or not.
3656 optional bool access_denied = 4;
3657}
3658
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003659/**
3660 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3661 * - When user sees privacy chip
3662 * - When user clicks privacy chip
3663 * - How does the user exit the Privacy Dialog
3664 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003665 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3666 */
3667message PrivacyIndicatorsInteracted {
3668
3669 enum Type {
3670 UNKNOWN = 0;
3671 CHIP_VIEWED = 1;
3672 CHIP_CLICKED = 2;
3673 DIALOG_PRIVACY_SETTINGS = 3;
3674 DIALOG_DISMISS = 4;
3675 DIALOG_LINE_ITEM = 5;
3676 }
3677
3678 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3679
3680 // Used if the type is LINE_ITEM
3681 optional string package_name = 2;
3682}
3683
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003684/**
3685 * Logs information about a package that is moved from the internal to external storage and vice
3686 * versa.
3687 * It logs the package name, the type of the external storage where the package is installed
3688 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3689 * and the move type: if it's from internal to external or the other way around.
3690 *
3691 * Logged from:
3692 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3693 */
3694message AppMovedStorageReported {
3695 enum MoveType {
3696 UNKNOWN = 0;
3697 TO_EXTERNAL = 1;
3698 TO_INTERNAL = 2;
3699 }
3700 // The type of the external storage.
3701 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3702 // The type of move.
3703 optional MoveType move_type = 2;
3704 // The name of the package that was moved.
3705 optional string package_name = 3;
3706}
3707
jianjin8f2dee02019-03-29 14:03:08 -07003708/**
3709 * Logs when system server watchdog occurs.
3710 * Logged from:
3711 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3712 */
3713message SystemServerWatchdogOccurred {
3714 optional string subject = 1;
3715}
3716
3717/**
3718 * Logs when new file added to tombstones.
3719 * Logged from:
3720 * frameworks/base/core/java/com/android/server/BootReceiver.java
3721 */
3722message TombStoneOccurred {
3723}
3724
Hai Zhang5d3328d2019-04-13 21:25:06 +08003725/*
3726 * Information about a role request
3727 *
3728 * Logged from:
3729 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3730 */
3731message RoleRequestResultReported {
3732 // UID of application requesting the role
3733 optional int32 requesting_uid = 1;
3734
3735 // Package name of application requesting the role
3736 optional string requesting_package_name = 2;
3737
3738 // The role to be granted
3739 optional string role_name = 3;
3740
3741 // The count of applications qualifying for the role
3742 optional int32 qualifying_count = 4;
3743
3744 // UID of application current granted the role
3745 optional int32 current_uid = 5;
3746
3747 // Package name of application current granted the role
3748 optional string current_package_name = 6;
3749
3750 // UID of another application that user chose to grant the role to, instead of the requesting
3751 // application
3752 optional int32 granted_another_uid = 7;
3753
3754 // Package name of another application that user chose to grant the role to, instead of the
3755 // requesting application
3756 optional string granted_another_package_name = 8;
3757
3758 enum Result {
3759 UNDEFINED = 0;
3760 // role request was ignored
3761 IGNORED = 1;
3762 // role request was ignored because it's already granted
3763 IGNORED_ALREADY_GRANTED = 2;
3764 // role request was ignored because the application isn't qualified
3765 IGNORED_NOT_QUALIFIED = 3;
3766 // role request was ignored because user said it should be always denied
3767 IGNORED_USER_ALWAYS_DENIED = 4;
3768 // role was granted by user action
3769 USER_GRANTED = 5;
3770 // role was denied by user action
3771 USER_DENIED = 6;
3772 // role was denied by user granting another application the role
3773 USER_DENIED_GRANTED_ANOTHER = 7;
3774 // role was denied and set to be always denied by the user
3775 USER_DENIED_WITH_ALWAYS = 8;
3776 }
3777 // The result of the role request
3778 optional Result result = 9;
3779}
3780
Mark Tabrya824a642019-11-05 12:26:12 -08003781/**
3782 * Logs when a Vehicle Maps Service client's connection state has changed
3783 *
3784 * Logged from:
3785 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
3786 */
3787message VmsClientConnectionStateChanged {
3788 // The UID of the VMS client app
3789 optional int32 uid = 1 [(is_uid) = true];
3790
3791 enum State {
3792 UNKNOWN = 0;
3793 // Attempting to connect to the client
3794 CONNECTING = 1;
3795 // Client connection established
3796 CONNECTED = 2;
3797 // Client connection closed unexpectedly
3798 DISCONNECTED = 3;
3799 // Client connection closed by VMS
3800 TERMINATED = 4;
3801 // Error establishing the client connection
3802 CONNECTION_ERROR = 5;
3803 }
3804
3805 optional State state = 2;
3806}
3807
Jeff Sharkey6bd21572019-11-15 20:45:33 -07003808/**
3809 * Logs when MediaProvider has successfully finished scanning a storage volume.
3810 *
3811 * Logged from:
3812 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
3813 */
3814message MediaProviderScanEvent {
3815 enum Reason {
3816 // Scan triggered due to unknown reason
3817 UNKNOWN = 0;
3818 // Scan triggered due to storage volume being mounted
3819 MOUNTED = 1;
3820 // Scan triggered due to explicit user action or app request
3821 DEMAND = 2;
3822 // Scan triggered due to idle maintenance
3823 IDLE = 3;
3824 }
3825
3826 // Volume type that this event pertains to
3827 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3828 // Reason why this scan was triggered
3829 optional Reason reason = 2;
3830 // Total number of files scanned
3831 optional int64 item_count = 3;
3832 // Duration of scan, normalized per file
3833 optional float normalized_duration_millis = 4;
3834 // Number of database inserts, normalized per file
3835 optional float normalized_insert_count = 5;
3836 // Number of database updates, normalized per file
3837 optional float normalized_update_count = 6;
3838 // Number of database deletes, normalized per file
3839 optional float normalized_delete_count = 7;
3840}
3841
3842/**
3843 * Logs when an app has asked MediaProvider to delete media belonging to the user.
3844 *
3845 * Logged from:
3846 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
3847 */
3848message MediaProviderDeletionEvent {
3849 // Volume type that this event pertains to
3850 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3851 // Device timestamp when this deletion event occurred
3852 optional int64 timestamp_millis = 2;
3853 // App that requested deletion
3854 optional string package_name = 3;
3855 // Number of items that were deleted
3856 optional int32 item_count = 4;
3857}
3858
3859/**
3860 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
3861 *
3862 * Logged from:
3863 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
3864 */
3865message MediaProviderPermissionEvent {
3866 enum Result {
3867 UNKNOWN = 0;
3868 USER_GRANTED = 1;
3869 AUTO_GRANTED = 2;
3870 USER_DENIED = 3;
3871 USER_DENIED_WITH_PREJUDICE = 4;
3872 AUTO_DENIED = 5;
3873 }
3874
3875 // Volume type that this event pertains to
3876 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3877 // Device timestamp when this permission event occurred
3878 optional int64 timestamp_millis = 2;
3879 // App that requested permission
3880 optional string package_name = 3;
3881 // Number of items that were requested
3882 optional int32 item_count = 4;
3883 // Result of this request
3884 optional Result result = 5;
3885}
3886
3887/**
3888 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
3889 *
3890 * Logged from:
3891 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
3892 */
3893message MediaProviderSchemaChange {
3894 // Volume type that this event pertains to
3895 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3896 // Old database version code
3897 optional int32 version_from = 2;
3898 // New database version code
3899 optional int32 version_to = 3;
3900 // Total number of files in database
3901 optional int64 item_count = 4;
3902 // Duration of schema change, normalized per file
3903 optional float normalized_duration_millis = 5;
3904}
3905
3906/**
3907 * Logs when MediaProvider has finished an idle maintenance job.
3908 *
3909 * Logged from:
3910 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
3911 */
3912message MediaProviderIdleMaintenance {
3913 // Volume type that this event pertains to
3914 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3915
3916 // Total number of files in database
3917 optional int64 item_count = 2;
3918 // Duration of idle maintenance, normalized per file
3919 optional float normalized_duration_millis = 3;
3920 // Number of thumbnails found to be stale, normalized per file
3921 optional float normalized_stale_thumbnails = 4;
3922 // Number of items found to be expired, normalized per file
3923 optional float normalized_expired_media = 5;
3924}
3925
Chenjie Yubbcbc602018-02-05 16:51:52 -08003926//////////////////////////////////////////////////////////////////////
3927// Pulled atoms below this line //
3928//////////////////////////////////////////////////////////////////////
3929
3930/**
David Chenc8a43242017-10-17 16:23:28 -07003931 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
3932 *
3933 * Pulled from:
3934 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3935 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003936message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003937 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003938
3939 optional int64 rx_bytes = 2;
3940
3941 optional int64 rx_packets = 3;
3942
3943 optional int64 tx_bytes = 4;
3944
3945 optional int64 tx_packets = 5;
3946}
3947
3948/**
3949 * Pulls bytes transferred via wifi (separated by foreground and background usage).
3950 *
3951 * Pulled from:
3952 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
3953 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003954message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003955 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003956
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003957 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
3958 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003959
3960 optional int64 rx_bytes = 3;
3961
3962 optional int64 rx_packets = 4;
3963
3964 optional int64 tx_bytes = 5;
3965
3966 optional int64 tx_packets = 6;
3967}
3968
3969/**
3970 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
3971 *
3972 * Pulled from:
3973 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3974 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003975message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07003976 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003977
3978 optional int64 rx_bytes = 2;
3979
3980 optional int64 rx_packets = 3;
3981
3982 optional int64 tx_bytes = 4;
3983
3984 optional int64 tx_packets = 5;
3985}
3986
3987/**
3988 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
3989 *
3990 * Pulled from:
3991 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
3992 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08003993message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07003994 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07003995
Yao Chenc40a19d2018-03-15 16:48:25 -07003996 // 1 denotes foreground and 0 denotes background. This is called Set in
3997 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003998 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07003999
4000 optional int64 rx_bytes = 3;
4001
4002 optional int64 rx_packets = 4;
4003
4004 optional int64 tx_bytes = 5;
4005
4006 optional int64 tx_packets = 6;
4007}
4008
4009/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004010 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4011 *
4012 * Pulled from:
4013 * StatsCompanionService
4014 */
4015message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004016 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004017
4018 optional int64 rx_bytes = 2;
4019
4020 optional int64 tx_bytes = 3;
4021}
4022
4023/**
David Chenc8a43242017-10-17 16:23:28 -07004024 * Pulls the kernel wakelock durations. This atom is adapted from
4025 * android/internal/os/KernelWakelockStats.java
4026 *
4027 * Pulled from:
4028 * StatsCompanionService using KernelWakelockReader.
4029 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004030message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004031 optional string name = 1;
4032
4033 optional int32 count = 2;
4034
4035 optional int32 version = 3;
4036
Yangster-maca8a30442018-10-13 23:46:34 -07004037 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004038}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004039
Chenjie Yu05013b32017-11-21 10:21:41 -08004040/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004041 * Pulls low power state information. If power.stats HAL is not available, this
4042 * includes platform and subsystem sleep state information,
4043 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4044 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004045 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004046 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004047 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4048 * as defined in:
4049 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004050 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004051message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004052 // Subsystem name
4053 optional string subsystem_name = 1;
4054 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4055 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004056 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4057 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004058 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004059 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004060 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004061 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004062 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004063}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004064
Chenjie Yu05013b32017-11-21 10:21:41 -08004065/**
Bookatz92da2832018-11-01 18:10:03 -07004066 * Pulls on-device power measurement information.
4067 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4068 * Pulled from:
4069 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4070 */
4071message OnDevicePowerMeasurement {
4072 // Name of the subsystem (to which the rail belongs).
4073 optional string subsystem_name = 1;
4074
4075 // Rail name. The rail lies within the subsystem.
4076 optional string rail_name = 2;
4077
4078 // Time (in ms since boot) at which the rail energy value was measured.
4079 // This may differ slightly from the time that statsd logs this information.
4080 optional uint64 measurement_timestamp_millis = 3;
4081
4082 // Accumulated energy used via the rail since device boot in uWs.
4083 optional uint64 energy_microwatt_secs = 4;
4084}
4085
4086/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004087 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004088 * Pulls the time the cpu spend on the frequency index. Frequency index
4089 * starts from highest to lowest. The value should be monotonically
4090 * increasing since boot. However, if there is a cpu
4091 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004092 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004093message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004094 optional uint32 cluster = 1;
4095 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004096 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004097}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004098
Chenjie Yu05013b32017-11-21 10:21:41 -08004099/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004100 * Pulls Cpu Time Per Uid.
4101 * Note that isolated process uid time should be attributed to host uids.
4102 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004103message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004104 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004105 optional uint64 user_time_micros = 2;
4106 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004107}
4108
4109/**
4110 * Pulls Cpu Time Per Uid per frequency.
4111 * Note that isolated process uid time should be attributed to host uids.
4112 * For each uid, we order the time by descending frequencies.
4113 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004114message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004115 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004116 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004117 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004118}
Hugo Benichi884970e2017-11-14 22:42:46 +09004119
Chenjie Yu05013b32017-11-21 10:21:41 -08004120/**
4121 * Pulls Wifi Controller Activity Energy Info
4122 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004123message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004124 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004125 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004126 // stack reported state
4127 // TODO: replace this with proto enum
4128 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004129 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004130 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004131 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004132 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004133 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004134 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004135 // product of current(mA), voltage(V) and time(ms)
4136 optional uint64 controller_energy_used = 6;
4137}
4138
4139/**
4140 * Pulls Modem Activity Energy Info
4141 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004142message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004143 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004144 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004145 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004146 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004147 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004148 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004149 /**
4150 * Tx power index
4151 * index 0 = tx_power < 0dBm
4152 * index 1 = 0dBm < tx_power < 5dBm
4153 * index 2 = 5dBm < tx_power < 15dBm
4154 * index 3 = 15dBm < tx_power < 20dBm
4155 * index 4 = tx_power > 20dBm
4156 */
4157 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004158 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004159 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004160 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004161 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004162 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004163 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004164 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004165 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004166 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004167 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004168 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004169 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004170 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004171}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004172
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004173/**
4174 * Pulls Bluetooth Activity Energy Info
4175 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4176 */
4177message BluetoothActivityInfo {
4178 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004179 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004180 // bluetooth stack state
4181 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004182 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004183 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004184 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004185 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004186 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004187 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004188 // product of current(mA), voltage(V) and time(ms)
4189 optional uint64 energy_used = 6;
4190}
4191
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004192/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004193 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004194 *
4195 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004196 */
4197message ProcessMemoryState {
4198 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004199 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004200
4201 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004202 // Usually package name, "system" for system server.
4203 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004204 optional string process_name = 2;
4205
Rafal Slawikda51b932018-12-13 16:31:33 +00004206 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004207 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004208
4209 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004210 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004211
4212 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004213 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004214
Rajeev Kumar90235992018-01-29 11:06:48 -08004215 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004216 // Value is read from memory.stat, field total_rss if per-app memory
4217 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004218 optional int64 rss_in_bytes = 6;
4219
4220 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004221 // Value is read from memory.stat, field total_cache if per-app memory
4222 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004223 optional int64 cache_in_bytes = 7;
4224
4225 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004226 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004227 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004228 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004229
Rafal Slawik203c3db2019-09-25 19:53:01 +01004230 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004231 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004232
Rafal Slawik203c3db2019-09-25 19:53:01 +01004233 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4234 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004235
Rafal Slawik203c3db2019-09-25 19:53:01 +01004236 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4237 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004238}
4239
4240/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004241 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004242 *
4243 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4244 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004245 *
4246 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004247 */
4248message ProcessMemoryHighWaterMark {
4249 // The uid if available. -1 means not available.
4250 optional int32 uid = 1 [(is_uid) = true];
4251
Rafal Slawikda51b932018-12-13 16:31:33 +00004252 // The process name.
4253 // Usually package name or process cmdline.
4254 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004255 optional string process_name = 2;
4256
Rafal Slawik239b6802019-09-09 18:46:01 +01004257 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4258 // computed by converting kilobytes to bytes.
4259 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4260
Rafal Slawik3bea8952018-11-15 12:39:33 +00004261 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4262 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004263 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004264}
4265
4266/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004267 * Logs the memory stats for a process.
4268 *
4269 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4270 * and for selected native processes.
4271 */
4272message ProcessMemorySnapshot {
4273 // The uid if available. -1 means not available.
4274 optional int32 uid = 1 [(is_uid) = true];
4275
4276 // The process name.
4277 // Usually package name or process cmdline.
4278 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4279 optional string process_name = 2;
4280
4281 // The pid of the process.
4282 // Allows to disambiguate instances of the process.
4283 optional int32 pid = 3;
4284
4285 // The current OOM score adjustment value.
4286 // Read from ProcessRecord for managed processes.
4287 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4288 optional int32 oom_score_adj = 4;
4289
4290 // The current RSS of the process.
4291 // VmRSS from /proc/pid/status.
4292 optional int32 rss_in_kilobytes = 5;
4293
4294 // The current anon RSS of the process.
4295 // RssAnon from /proc/pid/status.
4296 optional int32 anon_rss_in_kilobytes = 6;
4297
4298 // The current swap size of the process.
4299 // VmSwap from /proc/pid/status.
4300 optional int32 swap_in_kilobytes = 7;
4301
4302 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4303 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4304}
4305
4306/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004307 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004308 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004309message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004310 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004311}
4312
4313/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004314 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004315 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004316message SystemUptime {
4317 // Milliseconds since the system was booted.
4318 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4319 // for external input).
4320 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004321 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004322}
4323
4324/*
4325 * Reads from /proc/uid_concurrent_active_time which has the format:
4326 * active: X (X is # cores)
4327 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4328 * [uid1]: [time-0] [time-1] [time-2] ... ...
4329 * ...
4330 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4331 * The file contains a monotonically increasing count of time for a single boot.
4332 */
4333message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004334 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004335 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004336}
4337
4338/**
4339 * Reads from /proc/uid_concurrent_policy_time which has the format:
4340 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4341 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4342 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4343 * ...
4344 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4345 * The file contains a monotonically increasing count of time for a single boot.
4346 */
4347message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004348 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004349 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004350 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004351}
4352
4353/*
4354 * Pulls free disk space, for data, system partition and temporary directory.
4355 */
4356message DiskSpace {
4357 // available bytes in data partition
4358 optional uint64 data_available_bytes = 1;
4359 // available bytes in system partition
4360 optional uint64 system_available_bytes = 2;
4361 // available bytes in download cache or temp directories
4362 optional uint64 temp_available_bytes = 3;
4363}
Tej Singhbf972d92018-01-10 20:51:13 -08004364
4365/**
4366 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004367 *
4368 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004369 */
4370message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004371 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004372}
4373
4374/**
4375 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004376 * Pulled from:
4377 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004378 */
4379message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004380 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004381}
4382
4383/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004384 * Pulls battery voltage.
4385 * Pulled from:
4386 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4387 */
4388message BatteryVoltage {
4389 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004390 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004391}
4392
4393/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004394 * Pulls battery level (percent full, from 0 to 100).
4395 *
4396 * Pulled from:
4397 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4398 */
4399message BatteryLevel {
4400 // Battery level. Should be in [0, 100].
4401 optional int32 battery_level = 1;
4402}
4403
4404/**
Tej Singhd89137e2018-03-26 14:51:40 -07004405 * Pulls the temperature of various parts of the device.
4406 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004407 *
Maggie White442b6312019-04-05 16:26:44 -07004408 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004409 */
4410message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004411 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004412 optional android.os.TemperatureTypeEnum sensor_location = 1;
4413
4414 // The name of the temperature source. Eg. CPU0
4415 optional string sensor_name = 2;
4416
Tej Singhd89137e2018-03-26 14:51:40 -07004417 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004418 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004419 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004420
4421 // Relative severity of the throttling, see enum definition.
4422 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004423}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004424
4425/**
4426 * Pulls the statistics of calls to Binder.
4427 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004428 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4429 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004430 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004431 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004432 */
4433message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004434 // UID of the process responsible for the binder transaction. It will be set if the process
4435 // executing the binder transaction attribute the transaction to another uid using
4436 // Binder.setThreadWorkSource().
4437 //
4438 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004439 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004440 // UID of the process executing the binder transaction.
4441 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004442 // Fully qualified class name of the API call.
4443 //
4444 // This is a system server class name.
4445 //
4446 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4447 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4448 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4449 // commonly used APIs.
4450 optional string service_class_name = 2;
4451 // Method name of the API call. It can also be a transaction code if we cannot
4452 // resolve it to a name. See Binder#getTransactionName.
4453 //
4454 // This is a system server method name.
4455 optional string service_method_name = 3;
4456 // Total number of API calls.
4457 optional int64 call_count = 4;
4458 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4459 optional bool screen_interactive = 13;
4460 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4461 // call_count will be equal to recorded_call_count.
4462 //
4463 // If recorded_call_count is different than call_count, it means data collection has been
4464 // sampled. All the fields below will be sampled in this case.
4465 optional int64 recorded_call_count = 12;
4466 // Number of exceptions thrown by the API.
4467 optional int64 recorded_exception_count = 5;
4468 // Total latency of all API calls.
4469 // Average can be computed using total_latency_micros / recorded_call_count.
4470 optional int64 recorded_total_latency_micros = 6;
4471 // Maximum latency of one API call.
4472 optional int64 recorded_max_latency_micros = 7;
4473 // Total CPU usage of all API calls.
4474 // Average can be computed using total_cpu_micros / recorded_call_count.
4475 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4476 optional int64 recorded_total_cpu_micros = 8;
4477 // Maximum CPU usage of one API call.
4478 optional int64 recorded_max_cpu_micros = 9;
4479 // Maximum parcel reply size of one API call.
4480 optional int64 recorded_max_reply_size_bytes = 10;
4481 // Maximum parcel request size of one API call.
4482 optional int64 recorded_max_request_size_bytes = 11;
4483}
4484
4485/**
4486 * Pulls the statistics of exceptions during calls to Binder.
4487 *
4488 * Binder stats are cumulative from boot unless somebody reset the data using
4489 * > adb shell dumpsys binder_calls_stats --reset
4490 */
4491message BinderCallsExceptions {
4492 // Exception class name, e.g. java.lang.IllegalArgumentException.
4493 //
4494 // This is an exception class name thrown by the system server.
4495 optional string exception_class_name = 1;
4496 // Total number of exceptions.
4497 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004498}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004499
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004500/**
4501 * Pulls the statistics of message dispatching on HandlerThreads.
4502 *
4503 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4504 * config on the device.
4505 *
4506 * Next tag: 11
4507 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004508message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004509 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004510 optional int32 uid = 1 [(is_uid) = true];
4511
4512 // Fully qualified class name of the handler target class.
4513 //
4514 // This field does not contain PII. This is a system server class name.
4515 optional string handler_class_name = 2;
4516
4517 // The name of the thread that runs the Looper.
4518 //
4519 // This field does not contain PII. This is a system server thread name.
4520 optional string looper_thread_name = 3;
4521
4522 // The name of the dispatched message.
4523 //
4524 // This field does not contain PII. This is a system server constant or class
4525 // name.
4526 optional string message_name = 4;
4527
4528 // Total number of successfully dispatched messages.
4529 optional int64 message_count = 5;
4530
4531 // Total number of messages that failed dispatching.
4532 optional int64 exception_count = 6;
4533
4534 // Total number of processed messages we have data recorded for. If we
4535 // collected data for all the messages, message_count will be equal to
4536 // recorded_message_count.
4537 //
4538 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004539 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004540 optional int64 recorded_message_count = 7;
4541
4542 // Total latency of all processed messages.
4543 // Average can be computed using recorded_total_latency_micros /
4544 // recorded_message_count.
4545 optional int64 recorded_total_latency_micros = 8;
4546
4547 // Total CPU usage of all processed message.
4548 // Average can be computed using recorded_total_cpu_micros /
4549 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004550 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004551 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004552
4553 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4554 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004555
4556 // Max recorded CPU usage of all processed messages.
4557 optional int64 recorded_max_cpu_micros = 11;
4558
4559 // Max recorded latency of all processed messages.
4560 optional int64 recorded_max_latency_micros = 12;
4561
4562 // Total number of messages we tracked the dispatching delay for. If we
4563 // collected data for all the messages, message_count will be equal to
4564 // recorded_delay_message_count.
4565 //
4566 // If recorded_delay_message_count is different than message_count, it means data
4567 // collection has been sampled or/and not all messages specified the target dispatch time.
4568 // The fields below will be sampled in this case.
4569 optional int64 recorded_delay_message_count = 13;
4570
4571 // Total dispatching delay of all processed messages.
4572 // Calculated as a difference between the target dispatching time (Message.when)
4573 // and the actual dispatching time.
4574 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4575 optional int64 recorded_total_delay_millis = 14;
4576
4577 // Max dispatching delay of all processed messages.
4578 // Calculated as a difference between the target dispatching time (Message.when)
4579 // and the actual dispatching time.
4580 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004581}
Tej Singh86dc9db2018-09-06 00:39:57 +00004582
4583/**
4584 * Pulls disk information, such as write speed and latency.
4585 */
4586message DiskStats {
4587 // Time taken to open, write 512B to, and close a file.
4588 // -1 if error performing the check.
4589 optional int64 data_write_latency_millis = 1;
4590
4591 optional bool file_based_encryption = 2;
4592
4593 // Recent disk write speed in kB/s.
4594 // -1 if error querying storageed.
4595 // 0 if data is unavailable.
4596 optional int32 recent_disk_write_speed = 3;
4597}
4598
4599
4600/**
4601 * Free and total bytes of the Data, Cache, and System partition.
4602 */
4603message DirectoryUsage {
4604 enum Directory {
4605 UNKNOWN = 0;
4606 DATA = 1;
4607 CACHE = 2;
4608 SYSTEM = 3;
4609 }
4610 optional Directory directory = 1;
4611 optional int64 free_bytes = 2;
4612 optional int64 total_bytes = 3;
4613}
4614
4615
4616/**
4617 * Size of an application: apk size, data size, and cache size.
4618 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4619 * Information is only reported for apps with the primary user (user 0).
4620 * Sizes are aggregated by package name.
4621 */
4622message AppSize {
4623 // Including uids will involve modifying diskstats logic.
4624 optional string package_name = 1;
4625 // App size in bytes. -1 if unavailable.
4626 optional int64 app_size_bytes = 2;
4627 // App data size in bytes. -1 if unavailable.
4628 optional int64 app_data_size_bytes = 3;
4629 // App cache size in bytes. -1 if unavailable.
4630 optional int64 app_cache_size_bytes = 4;
4631 // Time that the cache file was produced.
4632 // Uses System.currentTimeMillis(), which is wall clock time.
4633 optional int64 cache_time_millis = 5;
4634}
4635
4636
4637/**
4638 * Size of a particular category. Eg: photos, videos.
4639 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4640 */
4641message CategorySize {
4642 enum Category {
4643 UNKNOWN = 0;
4644 APP_SIZE = 1;
4645 APP_DATA_SIZE = 2;
4646 APP_CACHE_SIZE = 3;
4647 PHOTOS = 4;
4648 VIDEOS = 5;
4649 AUDIO = 6;
4650 DOWNLOADS = 7;
4651 SYSTEM = 8;
4652 OTHER = 9;
4653 }
4654 optional Category category = 1;
4655 // Category size in bytes.
4656 optional int64 size_bytes = 2;
4657 // Time that the cache file was produced.
4658 // Uses System.currentTimeMillis(), which is wall clock time.
4659 optional int64 cache_time_millis = 3;
4660}
Tej Singhd6d6d772018-09-05 17:41:25 -07004661
4662/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004663 * Pulls per uid I/O stats. The stats are cumulative since boot.
4664 *
4665 * Read/write bytes are I/O events from a storage device
4666 * Read/write chars are data requested by read/write syscalls, and can be
4667 * satisfied by caching.
4668 *
4669 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4670 */
4671message DiskIo {
4672 optional int32 uid = 1 [(is_uid) = true];
4673 optional int64 fg_chars_read = 2;
4674 optional int64 fg_chars_write = 3;
4675 optional int64 fg_bytes_read = 4;
4676 optional int64 fg_bytes_write = 5;
4677 optional int64 bg_chars_read = 6;
4678 optional int64 bg_chars_write = 7;
4679 optional int64 bg_bytes_read = 8;
4680 optional int64 bg_bytes_write = 9;
4681 optional int64 fg_fsync = 10;
4682 optional int64 bg_fsync= 11;
4683}
4684
4685
4686/**
Tej Singhd6d6d772018-09-05 17:41:25 -07004687 * Pulls the number of fingerprints for each user.
4688 *
Kevin Chyn1741a072019-01-17 11:54:40 -08004689 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07004690 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08004691message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07004692 // The associated user. Eg: 0 for owners, 10+ for others.
4693 // Defined in android/os/UserHandle.java
4694 optional int32 user = 1;
4695 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08004696 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07004697}
Chenjie Yu12e5e672018-09-14 15:54:59 -07004698
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004699/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08004700 * Pulls the number of faces for each user.
4701 *
4702 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
4703 */
4704message NumFacesEnrolled {
4705 // The associated user. Eg: 0 for owners, 10+ for others.
4706 // Defined in android/os/UserHandle.java
4707 optional int32 user = 1;
4708 // Number of faces registered to that user.
4709 optional int32 num_faces_enrolled = 2;
4710}
4711/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08004712 * A mapping of role holder -> role
4713 */
4714message RoleHolder {
4715 // uid of the role holder
4716 optional int32 uid = 1 [(is_uid) = true];
4717
4718 // package name of the role holder
4719 optional string package_name = 2;
4720
4721 // the role held
4722 optional string role = 3;
4723}
4724
Yangsteraf9aee72018-10-12 09:26:16 -07004725message AggStats {
4726 optional int64 min = 1;
4727
4728 optional int64 average = 2;
4729
4730 optional int64 max = 3;
4731}
4732
4733message ProcessStatsStateProto {
4734 optional android.service.procstats.ScreenState screen_state = 1;
4735
4736 optional android.service.procstats.MemoryState memory_state = 2;
4737
4738 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
4739 // and not frameworks/base/core/java/android/app/ActivityManager.java
4740 optional android.service.procstats.ProcessState process_state = 3;
4741
4742 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004743 optional int64 duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004744
4745 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004746 optional int64 realtime_duration_millis = 9;
Yangsteraf9aee72018-10-12 09:26:16 -07004747
4748 // # of samples taken
4749 optional int32 sample_size = 5;
4750
4751 // PSS is memory reserved for this process
4752 optional AggStats pss = 6;
4753
4754 // USS is memory shared between processes, divided evenly for accounting
4755 optional AggStats uss = 7;
4756
4757 // RSS is memory resident for this process
4758 optional AggStats rss = 8;
4759}
4760
4761// Next Tag: 7
4762message ProcessStatsProto {
4763 // Name of process.
4764 optional string process = 1;
4765
4766 // Uid of the process.
4767 optional int32 uid = 2;
4768
4769 // Information about how often kills occurred
4770 message Kill {
4771 // Count of excessive CPU kills
4772 optional int32 cpu = 1;
4773
4774 // Count of kills when cached
4775 optional int32 cached = 2;
4776
4777 // PSS stats during cached kill
4778 optional AggStats cached_pss = 3;
4779 }
4780 optional Kill kill = 3;
4781
4782 // Time and memory spent in various states.
4783 repeated ProcessStatsStateProto states = 5;
4784
4785 // Total time process has been running... screen_state, memory_state, and process_state
4786 // will not be set.
4787 optional ProcessStatsStateProto total_running_state = 6;
4788}
4789
4790message PackageServiceOperationStatsProto {
4791 // Operate enum: Started, Foreground, Bound, Executing
4792 optional android.service.procstats.ServiceOperationState operation = 1;
4793
4794 // Number of times the service was in this operation.
4795 optional int32 count = 2;
4796
4797 // Information about a state the service can be in.
4798 message StateStats {
4799 // Screen state enum.
4800 optional android.service.procstats.ScreenState screen_state = 1;
4801 // Memory state enum.
4802 optional android.service.procstats.MemoryState memory_state = 2;
4803
4804 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07004805 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004806 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004807 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004808 }
4809 repeated StateStats state_stats = 3;
4810}
4811
4812message PackageServiceStatsProto {
4813 // Name of service component.
4814 optional string service_name = 1;
4815
4816 // The operation stats.
4817 // The package_name, package_uid, package_version, service_name will not be set to save space.
4818 repeated PackageServiceOperationStatsProto operation_stats = 2;
4819}
4820
4821message PackageAssociationSourceProcessStatsProto {
4822 // Uid of the process.
4823 optional int32 process_uid = 1;
4824 // Process name.
4825 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08004826 // Package name.
4827 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07004828 // Total count of the times this association appeared.
4829 optional int32 total_count = 3;
4830
4831 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07004832 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004833
4834 // Total count of the times this association became actively impacting its target process.
4835 optional int32 active_count = 5;
4836
4837 // Information on one source in this association.
4838 message StateStats {
4839 // Process state enum.
4840 optional android.service.procstats.ProcessState process_state = 1;
4841 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004842 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004843 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07004844 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004845 }
4846 repeated StateStats active_state_stats = 6;
4847}
4848
4849message PackageAssociationProcessStatsProto {
4850 // Name of the target component.
4851 optional string component_name = 1;
4852 // Information on one source in this association.
4853 repeated PackageAssociationSourceProcessStatsProto sources = 2;
4854}
4855
4856
4857message ProcessStatsPackageProto {
4858 // Name of package.
4859 optional string package = 1;
4860
4861 // Uid of the package.
4862 optional int32 uid = 2;
4863
4864 // Version of the package.
4865 optional int64 version = 3;
4866
4867 // Stats for each process running with the package loaded in to it.
4868 repeated ProcessStatsProto process_stats = 4;
4869
4870 // Stats for each of the package's services.
4871 repeated PackageServiceStatsProto service_stats = 5;
4872
4873 // Stats for each association with the package.
4874 repeated PackageAssociationProcessStatsProto association_stats = 6;
4875}
4876
4877message ProcessStatsSectionProto {
4878 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004879 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07004880
4881 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004882 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07004883
4884 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004885 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07004886
4887 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07004888 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07004889
4890 // System runtime library. e.g. "libdvm.so", "libart.so".
4891 optional string runtime = 5;
4892
4893 // whether kernel reports swapped pss.
4894 optional bool has_swapped_pss = 6;
4895
4896 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
4897 enum Status {
4898 STATUS_UNKNOWN = 0;
4899 STATUS_COMPLETE = 1;
4900 STATUS_PARTIAL = 2;
4901 STATUS_SHUTDOWN = 3;
4902 STATUS_SYSPROPS = 4;
4903 }
4904 repeated Status status = 7;
4905
Chenjie Yub2ecc792019-01-17 10:27:26 -08004906 // Number of pages available of various types and sizes, representation fragmentation.
4907 repeated ProcessStatsAvailablePagesProto available_pages = 10;
4908
Yangsteraf9aee72018-10-12 09:26:16 -07004909 // Stats for each process.
4910 repeated ProcessStatsProto process_stats = 8;
4911
4912 // Stats for each package.
4913 repeated ProcessStatsPackageProto package_stats = 9;
4914}
4915
Chenjie Yub2ecc792019-01-17 10:27:26 -08004916message ProcessStatsAvailablePagesProto {
4917 // Node these pages are in (as per /proc/pagetypeinfo)
4918 optional int32 node = 1;
4919
4920 // Zone these pages are in (as per /proc/pagetypeinfo)
4921 optional string zone = 2;
4922
4923 // Label for the type of these pages (as per /proc/pagetypeinfo)
4924 optional string label = 3;
4925
4926 // Distribution of number of pages available by order size. First entry in array is
4927 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
4928 repeated int32 pages_per_order = 4;
4929}
4930
Chenjie Yu12e5e672018-09-14 15:54:59 -07004931/**
4932 * Pulled from ProcessStatsService.java
4933 */
4934message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07004935 optional ProcessStatsSectionProto proc_stats_section = 1;
4936}
4937
Chenjie Yuf910b7802019-01-11 16:08:20 -08004938/**
4939 * Pulled from ProcessStatsService.java
4940 */
4941message ProcStatsPkgProc {
4942 optional ProcessStatsSectionProto proc_stats_section = 1;
4943}
4944
Chris Wrencdea3b72019-11-22 16:58:17 -05004945// Next Tag: 2
4946message PackageRemoteViewInfoProto {
4947 optional string package_name = 1;
4948 // add per-package additional info here (like channels)
4949}
4950
4951// Next Tag: 2
4952message NotificationRemoteViewsProto {
4953 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
4954}
4955
4956/**
4957 * Pulled from NotificationManagerService.java
4958 */
4959message NotificationRemoteViews {
4960 optional NotificationRemoteViewsProto notification_remote_views = 1;
4961}
4962
Yangsteraf9aee72018-10-12 09:26:16 -07004963message PowerProfileProto {
4964 optional double cpu_suspend = 1;
4965
4966 optional double cpu_idle = 2;
4967
4968 optional double cpu_active = 3;
4969
4970 message CpuCluster {
4971 optional int32 id = 1;
4972 optional double cluster_power = 2;
4973 optional int32 cores = 3;
4974 repeated int64 speed = 4;
4975 repeated double core_power = 5;
4976 }
4977
4978 repeated CpuCluster cpu_cluster = 40;
4979
4980 optional double wifi_scan = 4;
4981
4982 optional double wifi_on = 5;
4983
4984 optional double wifi_active = 6;
4985
4986 optional double wifi_controller_idle = 7;
4987
4988 optional double wifi_controller_rx = 8;
4989
4990 optional double wifi_controller_tx = 9;
4991
4992 repeated double wifi_controller_tx_levels = 10;
4993
4994 optional double wifi_controller_operating_voltage = 11;
4995
4996 optional double bluetooth_controller_idle = 12;
4997
4998 optional double bluetooth_controller_rx = 13;
4999
5000 optional double bluetooth_controller_tx = 14;
5001
5002 optional double bluetooth_controller_operating_voltage = 15;
5003
5004 optional double modem_controller_sleep = 16;
5005
5006 optional double modem_controller_idle = 17;
5007
5008 optional double modem_controller_rx = 18;
5009
5010 repeated double modem_controller_tx = 19;
5011
5012 optional double modem_controller_operating_voltage = 20;
5013
5014 optional double gps_on = 21;
5015
5016 repeated double gps_signal_quality_based = 22;
5017
5018 optional double gps_operating_voltage = 23;
5019
5020 optional double bluetooth_on = 24;
5021
5022 optional double bluetooth_active = 25;
5023
5024 optional double bluetooth_at_cmd = 26;
5025
5026 optional double ambient_display = 27;
5027
5028 optional double screen_on = 28;
5029
5030 optional double radio_on = 29;
5031
5032 optional double radio_scanning = 30;
5033
5034 optional double radio_active = 31;
5035
5036 optional double screen_full = 32;
5037
5038 optional double audio = 33;
5039
5040 optional double video = 34;
5041
5042 optional double flashlight = 35;
5043
5044 optional double memory = 36;
5045
5046 optional double camera = 37;
5047
5048 optional double wifi_batched_scan = 38;
5049
5050 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005051}
Chenjie Yuab530202018-09-26 12:39:20 -07005052
5053/**
5054 * power_profile.xml and other constants for power model calculations.
5055 * Pulled from PowerProfile.java
5056 */
5057message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005058 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005059}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005060
5061/**
arangelovd5db50e2018-10-12 20:24:39 +01005062 * Logs when a user restriction was added or removed.
5063 *
5064 * Logged from:
5065 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5066 */
5067message UserRestrictionChanged {
5068 // The raw string of the user restriction as defined in UserManager.
5069 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5070 optional string restriction = 1;
5071 // Whether the restriction is enabled or disabled.
5072 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005073}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005074
5075/**
5076 * Pulls process user time and system time. Puller takes a snapshot of all pids
5077 * in the system and returns cpu stats for those that are working at the time.
5078 * Dead pids will be dropped. Kernel processes are excluded.
5079 * Min cool-down is 5 sec.
5080 */
5081message ProcessCpuTime {
5082 optional int32 uid = 1 [(is_uid) = true];
5083
5084 optional string process_name = 2;
5085 // Process cpu time in user space, cumulative from boot/process start
5086 optional int64 user_time_millis = 3;
5087 // Process cpu time in system space, cumulative from boot/process start
5088 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005089}
Misha Wagner5a51e002018-10-03 15:04:09 +01005090
5091/**
5092 * Pulls the CPU usage for each thread.
5093 *
5094 * Read from /proc/$PID/task/$TID/time_in_state files.
5095 *
5096 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5097 * time_in_state files not being present on some phones, have not been addressed. These should be
5098 * considered before a public release.
5099 */
5100message CpuTimePerThreadFreq {
5101 // UID that owns the process.
5102 optional int32 uid = 1 [(is_uid) = true];
5103 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005104 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005105 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005106 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005107 // Name of the process taken from `/proc/$PID/cmdline`.
5108 optional string process_name = 4;
5109 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5110 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005111
5112 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5113 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5114 // frequencies are given here as the alternative is sending eight separate atoms. This method
5115 // significantly reduces the amount of data created
5116 optional int32 frequency1_khz = 6;
5117 optional int32 time1_millis = 7;
5118 optional int32 frequency2_khz = 8;
5119 optional int32 time2_millis = 9;
5120 optional int32 frequency3_khz = 10;
5121 optional int32 time3_millis = 11;
5122 optional int32 frequency4_khz = 12;
5123 optional int32 time4_millis = 13;
5124 optional int32 frequency5_khz = 14;
5125 optional int32 time5_millis = 15;
5126 optional int32 frequency6_khz = 16;
5127 optional int32 time6_millis = 17;
5128 optional int32 frequency7_khz = 18;
5129 optional int32 time7_millis = 19;
5130 optional int32 frequency8_khz = 20;
5131 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005132}
Bookatz75ee60422018-11-09 12:27:37 -08005133
5134/**
Bookatz366a4432018-11-20 09:42:33 -08005135 * Pulls information about the device's build.
5136 */
5137message BuildInformation {
5138 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5139 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5140 optional string fingerprint = 1;
5141
5142 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5143 optional string brand = 2;
5144
5145 // Build.PRODUCT. The name of the overall product.
5146 optional string product = 3;
5147
5148 // Build.DEVICE. The name of the industrial design.
5149 optional string device = 4;
5150
5151 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5152 optional string version_release = 5;
5153
5154 // Build.ID. E.g. a label like "M4-rc20".
5155 optional string id = 6;
5156
5157 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5158 // represent this build.
5159 optional string version_incremental = 7;
5160
5161 // Build.TYPE. The type of build, like "user" or "eng".
5162 optional string type = 8;
5163
5164 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5165 optional string tags = 9;
5166}
5167
5168/**
Adam He420947c2019-01-23 15:59:09 -08005169 * Logs information about mismatched caller for content capture.
5170 *
5171 * Logged from:
5172 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5173 */
5174message ContentCaptureCallerMismatchReported {
5175 optional string intended_package = 1;
5176 optional string calling_package = 2;
5177}
5178
5179/**
5180 * Logs information about content capture service events.
5181 *
5182 * Logged from:
5183 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5184 */
5185message ContentCaptureServiceEvents {
5186 // The type of event.
5187 enum Event {
5188 UNKNOWN = 0;
5189 ON_CONNECTED = 1;
5190 ON_DISCONNECTED = 2;
5191 SET_WHITELIST = 3;
5192 SET_DISABLED = 4;
5193 ON_USER_DATA_REMOVED = 5;
5194 }
5195 optional Event event = 1;
5196 // component/package of content capture service.
5197 optional string service_info = 2;
5198 // component/package of target.
5199 // it's a concatenated list of component/package for SET_WHITELIST event
5200 // separated by " ".
5201 optional string target_info = 3;
5202}
5203
5204/**
5205 * Logs information about content capture session events.
5206 *
5207 * Logged from:
5208 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5209 */
5210message ContentCaptureSessionEvents {
5211 // The type of event.
5212 enum Event {
5213 UNKNOWN = 0;
5214 ON_SESSION_STARTED = 1;
5215 ON_SESSION_FINISHED = 2;
5216 SESSION_NOT_CREATED = 3;
5217 }
5218 optional int32 session_id = 1;
5219 optional Event event = 2;
5220 // (n/a on session finished)
5221 optional int32 state_flags = 3;
5222 // component/package of content capture service.
5223 optional string service_info = 4;
5224 // component/package of app.
5225 // (n/a on session finished)
5226 optional string app_info = 5;
5227 optional bool is_child_session = 6;
5228}
5229
5230/**
5231 * Logs information about session being flushed.
5232 *
5233 * Logged from:
5234 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5235 */
5236message ContentCaptureFlushed {
5237 optional int32 session_id = 1;
5238 // component/package of content capture service.
5239 optional string service_info = 2;
5240 // component/package of app.
5241 optional string app_info = 3;
5242 // session start/finish events
5243 optional int32 child_session_started = 4;
5244 optional int32 child_session_finished = 5;
5245 // count of view events.
5246 optional int32 view_appeared_count = 6;
5247 optional int32 view_disappeared_count = 7;
5248 optional int32 view_text_changed_count = 8;
5249
5250 // Flush stats.
5251 optional int32 max_events = 9;
5252 optional int32 idle_flush_freq = 10;
5253 optional int32 text_flush_freq = 11;
5254 optional int32 flush_reason = 12;
5255}
5256
5257/**
Bookatz75ee60422018-11-09 12:27:37 -08005258 * Pulls on-device BatteryStats power use calculations for the overall device.
5259 */
5260message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005261 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5262 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5263 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5264 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005265}
5266
5267/**
5268 * Pulls on-device BatteryStats power use calculations broken down by uid.
5269 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5270 * that is attributed to non-uid items. They must all be included to get the total power use.
5271 */
5272message DeviceCalculatedPowerBlameUid {
5273 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5274 optional int32 uid = 1 [(is_uid) = true];
5275
Bookatz3dbc13a2018-12-21 12:16:51 -08005276 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5277 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5278 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005279}
5280
5281/**
5282 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5283 * drain type.
5284 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5285 * is attributed uids. They must all be included to get the total power use.
5286 */
5287message DeviceCalculatedPowerBlameOther {
5288 // The type of item whose power use is being reported.
5289 enum DrainType {
5290 AMBIENT_DISPLAY = 0;
5291 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5292 BLUETOOTH = 2;
5293 CAMERA = 3;
5294 // Cell-standby
5295 CELL = 4;
5296 FLASHLIGHT = 5;
5297 IDLE = 6;
5298 MEMORY = 7;
5299 // Amount that total computed drain exceeded the drain estimated using the
5300 // battery level changes and capacity.
5301 OVERCOUNTED = 8;
5302 PHONE = 9;
5303 SCREEN = 10;
5304 // Amount that total computed drain was below the drain estimated using the
5305 // battery level changes and capacity.
5306 UNACCOUNTED = 11;
5307 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5308 WIFI = 13;
5309 }
5310 optional DrainType drain_type = 1;
5311
Bookatz3dbc13a2018-12-21 12:16:51 -08005312 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5313 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5314 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005315}
arangelov4e994062018-11-13 16:12:38 +00005316
5317/**
5318 * Logs device policy features.
5319 *
5320 * Logged from:
5321 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5322 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5323 */
5324message DevicePolicyEvent {
5325 // The event id - unique for each event.
5326 optional android.stats.devicepolicy.EventId event_id = 1;
5327 // The admin package name.
5328 optional string admin_package_name = 2;
5329 // A generic integer parameter.
5330 optional int32 integer_value = 3;
5331 // A generic boolean parameter.
5332 optional bool boolean_value = 4;
5333 // A parameter specifying a time period in milliseconds.
5334 optional uint64 time_period_millis = 5;
5335 // A parameter specifying a list of package names, bundle extras or string parameters.
5336 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5337}
shawnlinea5b66b2018-11-13 15:05:29 +08005338
5339/**
5340 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5341 *
5342 * Logged from:
5343 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5344 */
5345message DocsUILaunchReported {
5346 optional android.stats.docsui.LaunchAction launch_action = 1;
5347 optional bool has_initial_uri = 2;
5348 optional android.stats.docsui.MimeType mime_type = 3;
5349 optional android.stats.docsui.Root initial_root = 4;
5350}
5351
5352/**
5353 * Logs root/app visited event in file managers/picker. Call this when the user
5354 * taps on root/app in hamburger menu.
5355 *
5356 * Logged from:
5357 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5358 */
5359message DocsUIRootVisitedReported {
5360 optional android.stats.docsui.ContextScope scope = 1;
5361 optional android.stats.docsui.Root root = 2;
5362}
5363
5364/**
5365 * Logs file operation stats. Call this when a file operation has completed.
5366 *
5367 * Logged from:
5368 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5369 */
5370message DocsUIFileOperationReported {
5371 optional android.stats.docsui.Provider provider = 1;
5372 optional android.stats.docsui.FileOperation file_op = 2;
5373}
5374
5375/**
5376 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5377 * mode.
5378 *
5379 * Logged from:
5380 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5381 */
5382message DocsUIFileOperationCopyMoveModeReported {
5383 optional android.stats.docsui.FileOperation file_op = 1;
5384 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5385}
5386
5387
5388/**
5389 * Logs file sub operation stats. Call this when a file operation has failed.
5390 *
5391 * Logged from:
5392 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5393 */
5394message DocsUIFileOperationFailureReported {
5395 optional android.stats.docsui.Authority authority = 1;
5396 optional android.stats.docsui.SubFileOperation sub_op = 2;
5397}
5398
5399/**
5400* Logs the cancellation of a file operation. Call this when a job is canceled
5401*
5402* Logged from:
5403* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5404*/
5405message DocsUIFileOperationCanceledReported {
5406 optional android.stats.docsui.FileOperation file_op = 1;
5407}
5408
5409/**
5410 * Logs startup time in milliseconds.
5411 *
5412 * Logged from:
5413 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5414 */
5415message DocsUIStartupMsReported {
5416 optional int32 startup_millis = 1;
5417}
5418
5419/**
5420 * Logs the action that was started by user.
5421 *
5422 * Logged from:
5423 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5424 */
5425message DocsUIUserActionReported {
5426 optional android.stats.docsui.UserAction action = 1;
5427}
5428
5429/**
5430 * Logs the invalid type when invalid scoped access is requested.
5431 *
5432 * Logged from:
5433 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5434 */
5435message DocsUIInvalidScopedAccessRequestReported {
5436 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005437}
Ben Murdochbab399f62018-12-06 11:01:38 +00005438
5439/**
shawnlina75e82d2019-01-07 10:31:12 +08005440 * Logs the package name that launches docsui picker mode.
5441 *
5442 * Logged from:
5443 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5444 */
5445message DocsUIPickerLaunchedFromReported {
5446 optional string package_name = 1;
5447}
5448
5449/**
5450 * Logs the search type.
5451 *
5452 * Logged from:
5453 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5454 */
5455message DocsUISearchTypeReported {
5456 optional android.stats.docsui.SearchType search_type = 1;
5457}
5458
5459/**
5460 * Logs the search mode.
5461 *
5462 * Logged from:
5463 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5464 */
5465message DocsUISearchModeReported {
5466 optional android.stats.docsui.SearchMode search_mode = 1;
5467}
5468
5469/**
5470 * Logs the pick result information.
5471 *
5472 * Logged from:
5473 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5474 */
5475message DocsUIPickResultReported {
5476 optional int32 total_action_count = 1;
5477 optional int64 duration_millis = 2;
5478 optional int32 file_count= 3;
5479 optional bool is_searching = 4;
5480 optional android.stats.docsui.Root picked_from = 5;
5481 optional android.stats.docsui.MimeType mime_type = 6;
5482 optional int32 repeatedly_pick_times = 7;
5483}
5484
5485/**
Ben Murdochbab399f62018-12-06 11:01:38 +00005486 * Logs when an app's memory is compacted.
5487 *
5488 * Logged from:
5489 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5490 */
5491message AppCompacted {
5492 // The pid of the process being compacted.
5493 optional int32 pid = 1;
5494
5495 // The name of the process being compacted.
5496 optional string process_name = 2;
5497
5498 // The type of compaction.
5499 enum Action {
5500 UNKNOWN = 0;
5501 SOME = 1;
5502 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005503 PERSISTENT = 3;
5504 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00005505 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005506 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00005507
5508 // Total RSS in kilobytes consumed by the process prior to compaction.
5509 optional int64 before_rss_total_kilobytes = 4;
5510
5511 // File RSS in kilobytes consumed by the process prior to compaction.
5512 optional int64 before_rss_file_kilobytes = 5;
5513
5514 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5515 optional int64 before_rss_anon_kilobytes = 6;
5516
5517 // Swap in kilobytes consumed by the process prior to compaction.
5518 optional int64 before_swap_kilobytes = 7;
5519
5520 // Total RSS in kilobytes consumed by the process after compaction.
5521 optional int64 after_rss_total_kilobytes = 8;
5522
5523 // File RSS in kilobytes consumed by the process after compaction.
5524 optional int64 after_rss_file_kilobytes = 9;
5525
5526 // Anonymous RSS in kilobytes consumed by the process after compaction.
5527 optional int64 after_rss_anon_kilobytes = 10;
5528
5529 // Swap in kilobytes consumed by the process after compaction.
5530 optional int64 after_swap_kilobytes = 11;
5531
5532 // The time taken to perform compaction in milliseconds.
5533 optional int64 time_to_compact_millis = 12;
5534
5535 // The last compaction action performed for this app.
5536 optional Action last_action = 13;
5537
Ben Murdoch01720b82018-12-19 18:03:44 +00005538 // The last time that compaction was attempted on this process in milliseconds
5539 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5540 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00005541
Ben Murdoch885c21b2019-03-15 18:02:04 +00005542 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005543 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00005544
5545 // The process state at the time of compaction.
5546 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005547
5548 // Free ZRAM in kilobytes before compaction.
5549 optional int64 before_zram_free_kilobytes = 17;
5550
5551 // Free ZRAM in kilobytes after compaction.
5552 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00005553}
lifr157fc552018-12-12 16:38:04 +08005554
5555/**
lifrb6b90b62019-03-29 00:40:17 +08005556 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5557 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5558 *
lifr1f74b052019-04-16 22:16:30 +08005559 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5560 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5561 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5562 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005563 */
5564message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08005565 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005566
lifr1f74b052019-04-16 22:16:30 +08005567 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005568
5569 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005570 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005571
lifr1f74b052019-04-16 22:16:30 +08005572 // Only valid for event_type = EVENT_GETADDRINFO.
5573 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005574
lifr1f74b052019-04-16 22:16:30 +08005575 // Flags passed to android_res_nsend() defined in multinetwork.h
5576 // Only valid for event_type = EVENT_RESNSEND.
5577 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005578
lifrad9becc2019-05-20 11:04:41 +08005579 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005580
5581 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08005582 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005583
5584 // Additional pass-through fields opaque to statsd.
5585 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08005586 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08005587
5588 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
5589 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08005590}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005591
5592/**
5593 * Logs when a data stall event occurs.
5594 *
5595 * Log from:
5596 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5597 */
5598message DataStallEvent {
5599 // Data stall evaluation type.
5600 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5601 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5602 optional int32 evaluation_type = 1;
5603 // See definition in data_stall_event.proto.
5604 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5605 // See definition in data_stall_event.proto.
5606 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5607 // See definition in data_stall_event.proto.
5608 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5609 // See definition in data_stall_event.proto.
5610 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5611 // See definition in data_stall_event.proto.
5612 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5613}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005614
5615/*
5616 * Logs when RescueParty resets some set of experiment flags.
5617 *
5618 * Logged from:
5619 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5620 */
5621message RescuePartyResetReported {
5622 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5623 optional int32 rescue_level = 1;
5624}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005625
5626/**
5627 * Logs when signed config is received from an APK, and if that config was applied successfully.
5628 * Logged from:
5629 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5630 */
5631message SignedConfigReported {
5632 enum Type {
5633 UNKNOWN_TYPE = 0;
5634 GLOBAL_SETTINGS = 1;
5635 }
5636 optional Type type = 1;
5637
5638 // The final status of the signed config received.
5639 enum Status {
5640 UNKNOWN_STATUS = 0;
5641 APPLIED = 1;
5642 BASE64_FAILURE_CONFIG = 2;
5643 BASE64_FAILURE_SIGNATURE = 3;
5644 SECURITY_EXCEPTION = 4;
5645 INVALID_CONFIG = 5;
5646 OLD_CONFIG = 6;
5647 SIGNATURE_CHECK_FAILED = 7;
5648 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005649 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005650 }
5651 optional Status status = 2;
5652
5653 // The version of the signed config processed.
5654 optional int32 version = 3;
5655
5656 // The package name that the config was extracted from.
5657 optional string from_package = 4;
5658
5659 enum Key {
5660 NO_KEY = 0;
5661 DEBUG = 1;
5662 PRODUCTION = 2;
5663 }
5664 // Which key was used to verify the config.
5665 optional Key verified_with = 5;
5666}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005667
5668/*
5669 * Logs GNSS Network-Initiated (NI) location events.
5670 *
5671 * Logged from:
5672 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5673 */
5674message GnssNiEventReported {
5675 // The type of GnssNiEvent.
5676 enum EventType {
5677 UNKNOWN = 0;
5678 NI_REQUEST = 1;
5679 NI_RESPONSE = 2;
5680 }
5681 optional EventType event_type = 1;
5682
5683 // An ID generated by HAL to associate NI notifications and UI responses.
5684 optional int32 notification_id = 2;
5685
5686 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005687 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005688
5689 // NI requires notification.
5690 optional bool need_notify = 4;
5691
5692 // NI requires verification.
5693 optional bool need_verify = 5;
5694
5695 // NI requires privacy override, no notification/minimal trace.
5696 optional bool privacy_override = 6;
5697
5698 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
5699 // seconds.
5700 optional int32 timeout = 7;
5701
5702 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005703 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005704
5705 // String representing the requester of the network inititated location request.
5706 optional string requestor_id = 9;
5707
5708 // Notification message text string representing the service(for eg. SUPL-service) who sent the
5709 // network initiated location request.
5710 optional string text = 10;
5711
5712 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005713 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005714
5715 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005716 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005717
5718 // True if SUPL ES is enabled.
5719 optional bool is_supl_es_enabled = 13;
5720
5721 // True if GNSS location is enabled.
5722 optional bool is_location_enabled = 14;
5723
5724 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08005725 optional android.server.location.GnssUserResponseType user_response = 15;
5726}
5727
5728/**
5729 * Logs GNSS non-framework (NFW) location notification.
5730 *
5731 * Logged from:
5732 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
5733 */
5734message GnssNfwNotificationReported {
5735 // Package name of the Android proxy application representing the non-framework entity that
5736 // requested location. Set to empty string if unknown.
5737 optional string proxy_app_package_name = 1;
5738
5739 // Protocol stack that initiated the non-framework location request.
5740 optional android.server.location.NfwProtocolStack protocol_stack = 2;
5741
5742 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
5743 // set to empty string. This field is opaque to the framework and used for logging purposes.
5744 optional string other_protocol_stack_name = 3;
5745
5746 // Source initiating/receiving the location information.
5747 optional android.server.location.NfwRequestor requestor = 4;
5748
5749 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
5750 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
5751 // and used for logging purposes.
5752 optional string requestor_id = 5;
5753
5754 // Indicates whether location information was provided for this request.
5755 optional android.server.location.NfwResponseType response_type = 6;
5756
5757 // True if the device is in user initiated emergency session.
5758 optional bool in_emergency_mode = 7;
5759
5760 // True if cached location is provided.
5761 optional bool is_cached_location = 8;
5762
5763 // True if proxy app permission mismatch between framework and GNSS HAL.
5764 optional bool is_permission_mismatched = 9;
5765}
5766
5767/**
5768 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
5769 *
5770 * Logged from:
5771 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
5772 */
5773message GnssConfigurationReported {
5774 // SUPL host name.
5775 optional string supl_host = 1;
5776
5777 // SUPL port number.
5778 optional int32 supl_port = 2;
5779
5780 // C2K host name.
5781 optional string c2k_host = 3;
5782
5783 // C2K port number.
5784 optional int32 c2k_port = 4;
5785
5786 // The SUPL version requested by Carrier.
5787 optional int32 supl_ver = 5;
5788
5789 // The SUPL mode.
5790 optional android.server.location.SuplMode supl_mode = 6;
5791
5792 // True if NI emergency SUPL restrictions is enabled.
5793 optional bool supl_es = 7;
5794
5795 // LTE Positioning Profile settings
5796 optional android.server.location.LppProfile lpp_profile = 8;
5797
5798 // Positioning protocol on A-Glonass system.
5799 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
5800
5801 // True if emergency PDN is used. Otherwise, regular PDN is used.
5802 optional bool use_emergency_pdn_for_emergency_supl= 10;
5803
5804 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
5805 optional android.server.location.GpsLock gps_lock = 11;
5806
5807 // Number of seconds to extend the emergency session duration post emergency call.
5808 optional int32 es_extension_sec = 12;
5809
5810 // The full list of package names of proxy Android applications representing the non-framework
5811 // location access entities (on/off the device) for which the framework user has granted
5812 // non-framework location access permission. The package names are concatenated in one string
5813 // with spaces as separators.
5814 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08005815}
Jack Yu95b64f32018-12-13 18:26:11 +08005816
5817/**
5818 * Logs when a NFC device's error occurred.
5819 * Logged from:
5820 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5821 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
5822 */
5823message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005824 enum Type {
5825 UNKNOWN = 0;
5826 CMD_TIMEOUT = 1;
5827 ERROR_NOTIFICATION = 2;
5828 AID_OVERFLOW = 3;
5829 }
5830 optional Type type = 1;
5831 // If it's nci cmd timeout, log the timeout command.
5832 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005833
Alex Salod7c3eef2019-01-25 14:43:27 -08005834 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005835}
5836
5837/**
5838 * Logs when a NFC device's state changed event
5839 * Logged from:
5840 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
5841 */
5842message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005843 enum State {
5844 UNKNOWN = 0;
5845 OFF = 1;
5846 ON = 2;
5847 ON_LOCKED = 3; // Secure Nfc enabled.
5848 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
5849 }
5850 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005851}
5852
5853/**
5854 * Logs when a NFC Beam Transaction occurred.
5855 * Logged from:
5856 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
5857 */
5858message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005859 enum Operation {
5860 UNKNOWN = 0;
5861 SEND = 1;
5862 RECEIVE = 2;
5863 }
5864 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005865}
5866
5867/**
5868 * Logs when a NFC Card Emulation Transaction occurred.
5869 * Logged from:
5870 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
5871 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
5872 */
5873message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005874 enum Category {
5875 UNKNOWN = 0;
5876 HCE_PAYMENT = 1;
5877 HCE_OTHER = 2;
5878 OFFHOST = 3;
5879 }
5880 // Transaction belongs to HCE payment or HCE other category, or offhost.
5881 optional Category category = 1;
5882 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
5883 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08005884}
5885
5886/**
5887 * Logs when a NFC Tag event occurred.
5888 * Logged from:
5889 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
5890 */
5891message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08005892 enum Type {
5893 UNKNOWN = 0;
5894 URL = 1;
5895 BT_PAIRING = 2;
5896 PROVISION = 3;
5897 WIFI_CONNECT = 4;
5898 APP_LAUNCH = 5;
5899 OTHERS = 6;
5900 }
5901 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005902}
5903
5904/**
5905 * Logs when Hce transaction triggered
5906 * Logged from:
5907 * system/nfc/src/nfc/nfc/nfc_ncif.cc
5908 */
5909message NfcHceTransactionOccurred {
5910 // The latency period(in microseconds) it took for the first HCE data
5911 // exchange.
5912 optional uint32 latency_micros = 1;
5913}
5914
5915/**
5916 * Logs when SecureElement state event changed
5917 * Logged from:
5918 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5919 */
5920message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08005921 enum State {
5922 UNKNOWN = 0;
5923 INITIALIZED = 1;
5924 DISCONNECTED = 2;
5925 CONNECTED = 3;
5926 HALCRASH = 4;
5927 }
5928 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08005929
Alex Salod7c3eef2019-01-25 14:43:27 -08005930 optional string state_change_reason = 2;
5931 // SIMx or eSEx.
5932 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08005933}
5934
5935/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005936 * Information about a permission grant request
5937 */
5938message PermissionGrantRequestResultReported {
5939 // unique value identifying an API call. A API call might result in multiple of these atoms
5940 optional int64 request_id = 1;
5941
5942 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00005943 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005944
5945 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00005946 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005947
5948 // The permission to be granted
5949 optional string permission_name = 4;
5950
5951 // If the permission was explicitly requested via the API or added by the system
5952 optional bool is_implicit = 5;
5953
5954 enum Result {
5955 UNDEFINED = 0;
5956 // permission request was ignored
5957 IGNORED = 1;
5958 // permission request was ignored because it was user fixed
5959 IGNORED_USER_FIXED = 2;
5960 // permission request was ignored because it was policy fixed
5961 IGNORED_POLICY_FIXED = 3;
5962 // permission was granted by user action
5963 USER_GRANTED = 4;
5964 // permission was automatically granted
5965 AUTO_GRANTED = 5;
5966 // permission was denied by user action
5967 USER_DENIED = 6;
5968 // permission was denied with prejudice by the user
5969 USER_DENIED_WITH_PREJUDICE = 7;
5970 // permission was automatically denied
5971 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07005972 // permission request was ignored because permission is restricted
5973 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01005974 // one time permission was granted by user action
5975 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00005976 // user ignored request by leaving the request screen without choosing any option
5977 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08005978 // user granted the permission after being linked to settings
5979 USER_GRANTED_IN_SETTINGS = 12;
5980 // user denied the permission after being linked to settings
5981 USER_DENIED_IN_SETTINGS = 13;
5982 // user denied the permission with prejudice after being linked to settings
5983 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
5984 // permission was automatically revoked after one-time permission expired
5985 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08005986 }
5987 // The result of the permission grant
5988 optional Result result = 6;
5989}
5990
5991/**
Jack Yu95b64f32018-12-13 18:26:11 +08005992 * Logs when Omapi API used
5993 * Logged from:
5994 * packages/apps/SecureElement/src/com/android/se/Terminal.java
5995 */
5996message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08005997 enum Operation {
5998 UNKNOWN = 0;
5999 OPEN_CHANNEL = 1;
6000 }
6001 optional Operation operation = 1;
6002 // SIMx or eSEx.
6003 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006004
Alex Salod7c3eef2019-01-25 14:43:27 -08006005 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006006}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006007
6008/**
Alex Saloa060aee2019-01-21 14:36:41 -08006009 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6010 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006011 * Logged from:
6012 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6013 */
6014message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006015 optional int64 dispatch_latency_millis = 1;
6016}
6017
6018/**
6019 * Logs AttentionManagerService attention check result.
6020 *
6021 * Logged from:
6022 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6023 */
6024message AttentionManagerServiceResultReported {
6025 // See core/java/android/service/attention/AttentionService.java
6026 enum AttentionCheckResult {
6027 UNKNOWN = 20;
6028 ATTENTION_SUCCESS_ABSENT = 0;
6029 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006030 ATTENTION_FAILURE_UNKNOWN = 2;
6031 ATTENTION_FAILURE_CANCELLED = 3;
6032 ATTENTION_FAILURE_PREEMPTED = 4;
6033 ATTENTION_FAILURE_TIMED_OUT = 5;
6034 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006035 }
6036 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006037}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006038
6039/**
6040 * Logs when an adb connection changes state.
6041 *
6042 * Logged from:
6043 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6044 */
6045message AdbConnectionChanged {
6046 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6047 // previously selected for this system.
6048 optional int64 last_connection_time_millis = 1;
6049
6050 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6051 // to reconnect via adb without user interaction.
6052 optional int64 auth_window_millis = 2;
6053
6054 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6055 optional android.debug.AdbConnectionStateEnum state = 3;
6056
6057 // True if the 'always allow' option was selected for this system.
6058 optional bool always_allow = 4;
6059}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006060
6061/*
6062 * Logs the reported speech DSP status.
6063 *
6064 * Logged from:
6065 * Vendor audio implementation.
6066 */
6067message SpeechDspStatReported {
6068 // The total Speech DSP uptime in milliseconds.
6069 optional int32 total_uptime_millis = 1;
6070 // The total Speech DSP downtime in milliseconds.
6071 optional int32 total_downtime_millis = 2;
6072 optional int32 total_crash_count = 3;
6073 optional int32 total_recover_count = 4;
6074}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006075
6076/**
6077 * Logs USB connector contaminant status.
6078 *
6079 * Logged from: USB Service.
6080 */
6081message UsbContaminantReported {
6082 optional string id = 1;
6083 optional android.service.usb.ContaminantPresenceStatus status = 2;
6084}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006085
6086/**
6087 * This atom is for debugging purpose.
6088 */
6089message DebugElapsedClock {
6090 // Monotically increasing value for each pull.
6091 optional int64 pull_count = 1;
6092 // Time from System.elapsedRealtime.
6093 optional int64 elapsed_clock_millis = 2;
6094 // Time from System.elapsedRealtime.
6095 optional int64 same_elapsed_clock_millis = 3;
6096 // Diff between current elapsed time and elapsed time from previous pull.
6097 optional int64 elapsed_clock_diff_millis = 4;
6098
6099 enum Type {
6100 TYPE_UNKNOWN = 0;
6101 ALWAYS_PRESENT = 1;
6102 PRESENT_ON_ODD_PULLS = 2;
6103 }
6104 // Type of behavior for the pulled data.
6105 optional Type type = 5;
6106}
6107
6108/**
6109 * This atom is for debugging purpose.
6110 */
6111message DebugFailingElapsedClock {
6112 // Monotically increasing value for each pull.
6113 optional int64 pull_count = 1;
6114 // Time from System.elapsedRealtime.
6115 optional int64 elapsed_clock_millis = 2;
6116 // Time from System.elapsedRealtime.
6117 optional int64 same_elapsed_clock_millis = 3;
6118 // Diff between current elapsed time and elapsed time from previous pull.
6119 optional int64 elapsed_clock_diff_millis = 4;
6120}
Steven Wuacef6bb2019-01-23 14:21:17 -05006121
6122/** Logs System UI bubbles event changed.
6123 *
6124 * Logged from:
6125 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6126 */
6127message BubbleUIChanged {
6128
6129 // The app package that is posting the bubble.
6130 optional string package_name = 1;
6131
6132 // The notification channel that is posting the bubble.
6133 optional string notification_channel = 2;
6134
6135 // The notification id associated with the posted bubble.
6136 optional int32 notification_id = 3;
6137
6138 // The position of the bubble within the bubble stack.
6139 optional int32 position = 4;
6140
6141 // The total number of bubbles within the bubble stack.
6142 optional int32 total_number = 5;
6143
6144 // User interactions with the bubble.
6145 enum Action {
6146 UNKNOWN = 0;
6147 POSTED = 1;
6148 UPDATED = 2;
6149 EXPANDED = 3;
6150 COLLAPSED = 4;
6151 DISMISSED = 5;
6152 STACK_DISMISSED = 6;
6153 STACK_MOVED = 7;
6154 HEADER_GO_TO_APP = 8;
6155 HEADER_GO_TO_SETTINGS = 9;
6156 PERMISSION_OPT_IN = 10;
6157 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006158 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006159 SWIPE_LEFT = 13;
6160 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006161 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04006162 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006163 }
6164 optional Action action = 6;
6165
6166 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6167 optional float normalized_x_position = 7;
6168 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006169
6170 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6171 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006172
6173 // Whether the bubble is an on-going one.
6174 optional bool is_ongoing = 10;
6175
6176 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006177 // This is deprecated and the value should be ignored.
6178 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006179}
Kweku Adams8845d012018-12-11 20:06:45 -08006180
6181/**
Steven Wu552f63f2019-02-05 13:41:36 -05006182 * Logs System UI bubbles developer errors.
6183 *
6184 * Logged from:
6185 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6186 */
6187message BubbleDeveloperErrorReported {
6188
6189 // The app package that is posting the bubble.
6190 optional string package_name = 1;
6191
6192 // Bubble developer error type enums.
6193 enum Error {
6194 UNKNOWN = 0;
6195 ACTIVITY_INFO_MISSING = 1;
6196 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6197 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6198 }
6199 optional Error error = 2 [default = UNKNOWN];
6200}
6201
6202/**
Kweku Adams8845d012018-12-11 20:06:45 -08006203 * Logs that a constraint for a scheduled job has changed.
6204 *
6205 * Logged from:
6206 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6207 */
6208message ScheduledJobConstraintChanged {
6209 repeated AttributionNode attribution_node = 1;
6210
6211 // Name of the job.
6212 optional string job_name = 2;
6213
6214 optional com.android.server.job.ConstraintEnum constraint = 3;
6215
6216 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006217 UNKNOWN = 0;
6218 UNSATISFIED = 1;
6219 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006220 }
6221 optional State state = 4;
6222}
Alex Salod7c3eef2019-01-25 14:43:27 -08006223
6224/**
6225 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6226 * returns true.
6227 *
6228 * Logged from:
6229 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6230 */
6231message ScreenTimeoutExtensionReported {
6232 // Describes how many times in a row did the power manager reset the screen off timeout.
6233 optional uint32 consecutive_timeout_extended_count = 1;
6234}
Hui Yu885aca12019-01-10 17:11:34 -08006235
6236/*
6237* Logs number of milliseconds it takes to start a process.
6238* The definition of app process start time is from the app launch time to
6239* the time that Zygote finished forking the app process and loaded the
6240* application package's java classes.
6241
6242* This metric is different from AppStartOccurred which is for foreground
6243* activity only.
6244
6245* ProcessStartTime can report all processes (both foreground and background)
6246* start time.
6247*
6248* Logged from:
6249* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6250*/
6251message ProcessStartTime {
6252 // The uid of the ProcessRecord.
6253 optional int32 uid = 1 [(is_uid) = true];
6254
6255 // The process pid.
6256 optional int32 pid = 2;
6257
6258 // The process name.
6259 // Usually package name, "system" for system server.
6260 // Provided by ActivityManagerService.
6261 optional string process_name = 3;
6262
6263 enum StartType {
6264 UNKNOWN = 0;
6265 WARM = 1;
6266 HOT = 2;
6267 COLD = 3;
6268 }
6269
6270 // The start type.
6271 optional StartType type = 4;
6272
6273 // The elapsed realtime at the start of the process.
6274 optional int64 process_start_time_millis = 5;
6275
6276 // Number of milliseconds it takes to reach bind application.
6277 optional int32 bind_application_delay_millis = 6;
6278
6279 // Number of milliseconds it takes to finish start of the process.
6280 optional int32 process_start_delay_millis = 7;
6281
6282 // hostingType field in ProcessRecord, the component type such as "activity",
6283 // "service", "content provider", "broadcast" or other strings.
6284 optional string hosting_type = 8;
6285
6286 // hostingNameStr field in ProcessRecord. The component class name that runs
6287 // in this process.
6288 optional string hosting_name = 9;
6289}
6290
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006291/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006292 * Track Media Codec usage
6293 * Logged from:
6294 * frameworks/av/media/libstagefright/MediaCodec.cpp
6295 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6296 */
6297message MediametricsCodecReported {
6298 optional int64 timestamp_nanos = 1;
6299 optional string package_name = 2;
6300 optional int64 package_version_code = 3;
6301 optional int64 media_apex_version = 4;
6302
6303 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6304}
6305
6306/**
6307 * Track Media Extractor (pulling video/audio streams out of containers) usage
6308 * Logged from:
6309 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6310 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6311 */
6312message MediametricsExtractorReported {
6313 optional int64 timestamp_nanos = 1;
6314 optional string package_name = 2;
6315 optional int64 package_version_code = 3;
6316 optional int64 media_apex_version = 4;
6317
6318 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6319}
6320
6321/**
6322 * Track how we arbitrate between microphone/input requests.
6323 * Logged from
6324 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6325 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6326 */
6327message MediametricsAudiopolicyReported {
6328 optional int64 timestamp_nanos = 1;
6329 optional string package_name = 2;
6330 optional int64 package_version_code = 3;
6331 optional int64 media_apex_version = 4;
6332
6333 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6334}
6335
6336/**
6337 * Track how we arbitrate between microphone requests.
6338 * Logged from
6339 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6340 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6341 */
6342message MediametricsAudiorecordReported {
6343 optional int64 timestamp_nanos = 1;
6344 optional string package_name = 2;
6345 optional int64 package_version_code = 3;
6346 optional int64 media_apex_version = 4;
6347
6348 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6349}
6350
6351/**
6352 * Track how we arbitrate between microphone/input requests.
6353 * Logged from
6354 * frameworks/av/media/libnblog/ReportPerformance.cpp
6355 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6356 */
6357message MediametricsAudiothreadReported {
6358 optional int64 timestamp_nanos = 1;
6359 optional string package_name = 2;
6360 optional int64 package_version_code = 3;
6361 optional int64 media_apex_version = 4;
6362
6363 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6364}
6365
6366/**
6367 * Track how we arbitrate between microphone/input requests.
6368 * Logged from
6369 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6370 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6371 */
6372message MediametricsAudiotrackReported {
6373 optional int64 timestamp_nanos = 1;
6374 optional string package_name = 2;
6375 optional int64 package_version_code = 3;
6376 optional int64 media_apex_version = 4;
6377
6378 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6379}
6380
6381/**
6382 * Track information about DRM framework performance
6383 * Logged from
6384 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6385 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6386 */
6387message MediametricsMediadrmReported {
6388 optional int64 timestamp_nanos = 1;
6389 optional string package_name = 2;
6390 optional int64 package_version_code = 3;
6391 optional int64 media_apex_version = 4;
6392
6393 // vendor+description tell about which DRM plugin is in use on this device
6394 optional string vendor = 5;
6395 optional string description = 6;
6396 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6397 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6398}
6399
6400/**
6401 * Track information about the widevine DRM plugin performance
6402 * Logged from
6403 * vendor/widevine/libwvdrmengine/cdm/metrics
6404 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6405 */
6406message MediametricsDrmWidevineReported {
6407 optional int64 timestamp_nanos = 1;
6408 optional string package_name = 2;
6409 optional int64 package_version_code = 3;
6410 optional int64 media_apex_version = 4;
6411
6412 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6413}
6414
6415/**
6416 * Track information about recordings (e.g. camcorder)
6417 * Logged from
6418 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6419 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6420 */
6421message MediametricsRecorderReported {
6422 optional int64 timestamp_nanos = 1;
6423 optional string package_name = 2;
6424 optional int64 package_version_code = 3;
6425 optional int64 media_apex_version = 4;
6426
6427 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6428}
6429
6430/**
6431 * Track Media Player usage
6432 * Logged from:
6433 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6434 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6435 */
6436message MediametricsNuPlayerReported {
6437 optional int64 timestamp_nanos = 1;
6438 optional string package_name = 2;
6439 optional int64 package_version_code = 3;
6440 optional int64 media_apex_version = 4;
6441
6442 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6443}
6444
6445/**
Robert Shiha4beed32019-08-19 14:15:23 -07006446 * Track Legacy DRM usage
6447 * Logged from
6448 * frameworks/av/drm/drmserver/DrmManager.cpp
6449 */
6450message MediametricsDrmManagerReported {
6451 optional int64 timestamp_nanos = 1;
6452 optional string package_name = 2;
6453 optional int64 package_version_code = 3;
6454 optional int64 media_apex_version = 4;
6455
6456 enum Method {
6457 METHOD_NOT_FOUND = -1;
6458 GET_CONSTRAINTS = 0;
6459 GET_METADATA = 1;
6460 CAN_HANDLE = 2;
6461 PROCESS_DRM_INFO = 3;
6462 ACQUIRE_DRM_INFO = 4;
6463 SAVE_RIGHTS = 5;
6464 GET_ORIGINAL_MIME_TYPE = 6;
6465 GET_DRM_OBJECT_TYPE = 7;
6466 CHECK_RIGHTS_STATUS = 8;
6467 REMOVE_RIGHTS = 9;
6468 REMOVE_ALL_RIGHTS = 10;
6469 OPEN_CONVERT_SESSION = 11;
6470 OPEN_DECRYPT_SESSION = 12;
6471 }
6472
6473 // plugin_id+description inform which Legacy DRM plugins are still in use on device
6474 optional string plugin_id = 5;
6475 optional string description = 6;
6476 optional Method method = 7;
6477 optional string mime_types = 8;
6478}
6479
6480/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006481 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00006482 * Pulled from: StatsCompanionService
6483*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006484message DangerousPermissionState {
6485 // Name of the permission
6486 optional string permission_name = 1;
6487
6488 // Uid of the package
6489 optional int32 uid = 2 [(is_uid) = true];
6490
6491 // Package requesting the permission
6492 optional string package_name = 3;
6493
6494 // If the permission is granted to the uid
6495 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01006496
6497 // Permission flags as per android.content.pm.PermissionFlags
6498 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006499}
6500
Michael Groover4a0ca942019-01-24 17:41:25 -08006501/**
6502 * Logs when a package is denied access to a device identifier based on the new access requirements.
6503 *
6504 * Logged from:
6505 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6506 */
6507message DeviceIdentifierAccessDenied {
6508 // The name of the package denied access to the requested device identifier.
6509 optional string package_name = 1;
6510
6511 // The name of the device identifier method the package attempted to invoke.
6512 optional string method_name = 2;
6513
6514 // True if the package is preinstalled.
6515 optional bool is_preinstalled = 3;
6516
6517 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08006518 // Starting from Android 11, this boolean is not set and will always be false.
6519 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08006520}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006521
6522/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006523 * Pulls the ongoing mainline install train version code.
6524 * Pulled from StatsCompanionService
6525 */
6526message TrainInfo {
6527 optional int64 train_version_code = 1;
6528
6529 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006530
6531 optional string train_name = 3;
6532
6533 enum Status {
6534 UNKNOWN = 0;
6535 INSTALL_REQUESTED = 1;
6536 INSTALL_STARTED = 2;
6537 INSTALL_STAGED_NOT_READY = 3;
6538 INSTALL_STAGED_READY = 4;
6539 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006540 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6541 // and INSTALL_FAILURE_COMMIT.
6542 INSTALL_FAILURE = 6 [deprecated = true];
6543 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006544 INSTALL_CANCELLED = 7;
6545 INSTALLER_ROLLBACK_REQUESTED = 8;
6546 INSTALLER_ROLLBACK_INITIATED = 9;
6547 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6548 INSTALLER_ROLLBACK_STAGED = 11;
6549 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6550 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6551 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6552 INSTALLER_ROLLBACK_SUCCESS = 15;
6553 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006554 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6555 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6556 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6557 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6558 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6559 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006560 INSTALL_FAILURE_DOWNLOAD = 23;
6561 INSTALL_FAILURE_STATE_MISMATCH = 24;
6562 INSTALL_FAILURE_COMMIT = 25;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006563 }
6564 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006565}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006566
6567/**
6568 * Logs the gesture stage changed event.
6569 *
6570 * Logged from:
6571 * frameworks/base/packages/SystemUI/
6572 */
6573message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006574 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006575}
6576
6577/**
6578 * Logs the feedback type.
6579 *
6580 * Logged from:
6581 * frameworks/base/packages/SystemUI/
6582 */
6583message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006584 // Whether or not the gesture was used.
6585 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006586}
6587
6588/**
6589 * Logs the progress.
6590 *
6591 * Logged from:
6592 * frameworks/base/packages/SystemUI/
6593 */
6594message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006595 // [0,100] progress for the assist gesture.
6596 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006597}
Neil Fullerdb14b482019-02-05 19:44:44 +00006598
6599/*
6600 * Information about the time zone data on a device.
6601 */
6602message TimeZoneDataInfo {
6603 // A version identifier for the data set on device. e.g. "2018i"
6604 optional string tzdb_version = 1;
6605}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006606
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006607/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006608 * Logs the GPU stats global health information.
6609 *
6610 * Logged from:
6611 * frameworks/native/services/gpuservice/gpustats/
6612 */
6613message GpuStatsGlobalInfo {
6614 // Package name of the gpu driver.
6615 optional string driver_package_name = 1;
6616
6617 // Version name of the gpu driver.
6618 optional string driver_version_name = 2;
6619
6620 // Version code of the gpu driver.
6621 optional int64 driver_version_code = 3;
6622
6623 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
6624 optional int64 driver_build_time = 4;
6625
6626 // Total count of the gl driver gets loaded.
6627 optional int64 gl_loading_count = 5;
6628
6629 // Total count of the gl driver fails to be loaded.
6630 optional int64 gl_loading_failure_count = 6;
6631
6632 // Total count of the Vulkan driver gets loaded.
6633 optional int64 vk_loading_count = 7;
6634
6635 // Total count of the Vulkan driver fails to be loaded.
6636 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07006637
6638 // Api version of the system Vulkan driver.
6639 optional int32 vulkan_version = 9;
6640
6641 // Api version of the system CPU Vulkan driver.
6642 optional int32 cpu_vulkan_version = 10;
6643
6644 // Api version of the system GLES driver.
6645 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006646
6647 // Total count of the angle driver gets loaded.
6648 optional int64 angle_loading_count = 12;
6649
6650 // Total count of the angle driver fails to be loaded.
6651 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006652}
6653
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006654/**
6655 * GPU driver loading time info.
6656 */
6657message GpuDriverLoadingTime {
6658 // List of all the driver loading times for this app. The list size is
6659 // capped at 50.
6660 repeated int64 driver_loading_time = 1;
6661}
6662
6663/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006664 * Logs the GPU stats per app health information.
6665 *
6666 * Logged from:
6667 * frameworks/native/services/gpuservice/gpustats/
6668 */
6669message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006670 // Package name of the application that loads the gpu driver. Total number
6671 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006672 optional string app_package_name = 1;
6673
6674 // Version code of the gpu driver this app loads.
6675 optional int64 driver_version_code = 2;
6676
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006677 // gl driver loading time info.
6678 optional GpuDriverLoadingTime gl_driver_loading_time = 3
6679 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006680
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006681 // Vulkan driver loading time info.
6682 optional GpuDriverLoadingTime vk_driver_loading_time = 4
6683 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006684
6685 // Angle driver loading time info.
6686 optional GpuDriverLoadingTime angle_driver_loading_time = 5
6687 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07006688
6689 // CPU Vulkan implementation is in use.
6690 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07006691
6692 // App is not doing pre-rotation correctly.
6693 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08006694
6695 // App creates GLESv1 context.
6696 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006697}
Rafal Slawikd4e87572019-03-12 13:08:38 +00006698
6699/*
6700 * Logs the size of the system ion heap.
6701 *
6702 * Pulled from StatsCompanionService.
6703 */
6704message SystemIonHeapSize {
6705 // Size of the system ion heap in bytes.
6706 optional int64 size_in_bytes = 1;
6707}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006708
Rafal Slawik77987ed2019-06-17 12:28:23 +01006709/*
6710 * Logs the per-process size of the system ion heap.
6711 *
6712 * Pulled from StatsCompanionService.
6713 */
6714message ProcessSystemIonHeapSize {
6715 // The uid if available. -1 means not available.
6716 optional int32 uid = 1 [(is_uid) = true];
6717
6718 // The process name (from /proc/PID/cmdline).
6719 optional string process_name = 2;
6720
6721 // Sum of sizes of all allocations.
6722 optional int32 total_size_in_kilobytes = 3;
6723
6724 // Number of allocations.
6725 optional int32 allocation_count = 4;
6726
6727 // Size of the largest allocation.
6728 optional int32 max_size_in_kilobytes = 5;
6729}
6730
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006731/**
6732 * Push network stack events.
6733 *
6734 * Log from:
6735 * frameworks/base/packages/NetworkStack/
6736 */
6737message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08006738 // The id that indicates the event reported from NetworkStack.
6739 optional int32 event_id = 1;
6740 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08006741 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
6742}
Carmen Agimofa769c152019-03-04 14:39:14 +00006743
6744/**
6745 * Logs the apps that are installed on the external storage.
6746 * Pulled from:
6747 * StatsCompanionService
6748 */
6749message AppsOnExternalStorageInfo {
6750 // The type of the external storage.
6751 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
6752 // The name of the package that is installed on the external storage.
6753 optional string package_name = 2;
6754}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07006755
6756/**
6757 * Logs the settings related to Face.
6758 * Logged from:
6759 * frameworks/base/services/core/java/com/android/server/stats
6760 */
6761message FaceSettings {
6762 // Whether or not face unlock is allowed on Keyguard.
6763 optional bool unlock_keyguard_enabled = 1;
6764 // Whether or not face unlock dismisses the Keyguard.
6765 optional bool unlock_dismisses_keyguard = 2;
6766 // Whether or not face unlock requires attention.
6767 optional bool unlock_attention_required = 3;
6768 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
6769 optional bool unlock_app_enabled = 4;
6770 // Whether or not face unlock always requires user confirmation.
6771 optional bool unlock_always_require_confirmation = 5;
6772 // Whether or not a diverse set of poses are required during enrollment.
6773 optional bool unlock_diversity_required = 6;
6774}
Maggie White442b6312019-04-05 16:26:44 -07006775
6776/**
6777 * Logs cooling devices maintained by the kernel.
6778 *
6779 * Pulled from StatsCompanionService.java
6780 */
6781message CoolingDevice {
6782 // The type of cooling device being reported. Eg. CPU, GPU...
6783 optional android.os.CoolingTypeEnum device_location = 1;
6784 // The name of the cooling device source. Eg. CPU0
6785 optional string device_name = 2;
6786 // Current throttle state of the cooling device. The value can any unsigned
6787 // integer between 0 and max_state defined in its driver. 0 means device is
6788 // not in throttling, higher value means deeper throttling.
6789 optional int32 state = 3;
6790}
Ben Blount763a5d52019-04-10 11:48:58 -07006791
6792/**
6793 * Intelligence has several counter-type events that don't warrant a
6794 * full separate atom. These are primarily API call counters but also include
6795 * counters for feature usage and specific failure modes.
6796 *
6797 * Logged from the Intelligence mainline module.
6798 */
6799message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07006800 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07006801 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07006802 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07006803 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07006804 // How many times the event occured (to report a batch of high frequency events).
6805 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07006806 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07006807 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07006808}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07006809
6810/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07006811 * Logs when Car Power state changed.
6812 *
6813 * Logged from:
6814 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6815 */
6816message CarPowerStateChanged {
6817 // States come from CpmsState in CarPowerManagementService.java.
6818 enum State {
6819 WAIT_FOR_VHAL = 0;
6820 ON = 1;
6821 SHUTDOWN_PREPARE = 2;
6822 WAIT_FOR_FINISH = 3;
6823 SUSPEND = 4;
6824 SIMULATE_SLEEP = 5;
6825 }
6826 optional State state = 1;
6827}
6828
6829/**
6830 * Logs whether GarageMode is entered.
6831 *
6832 * Logged from:
6833 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
6834 */
6835message GarageModeInfo {
6836 // Whether GarageMode is entered.
6837 optional bool is_garage_mode = 1;
6838}
Martijn Coenencd95d462019-04-25 17:09:45 +02006839
6840/**
6841 * Historical app ops data per package.
6842 */
6843message AppOps {
6844 // Uid of the package requesting the op
6845 optional int32 uid = 1 [(is_uid) = true];
6846
6847 // Nmae of the package performing the op
6848 optional string package_name = 2;
6849
6850 // operation id; maps to the OP_* constants in AppOpsManager.java
6851 optional int32 op_id = 3;
6852
6853 // The number of times the op was granted while the app was in the
6854 // foreground (only for trusted requests)
6855 optional int64 trusted_foreground_granted_count = 4;
6856
6857 // The number of times the op was granted while the app was in the
6858 // background (only for trusted requests)
6859 optional int64 trusted_background_granted_count = 5;
6860
6861 // The number of times the op was rejected while the app was in the
6862 // foreground (only for trusted requests)
6863 optional int64 trusted_foreground_rejected_count = 6;
6864
6865 // The number of times the op was rejected while the app was in the
6866 // background (only for trusted requests)
6867 optional int64 trusted_background_rejected_count = 7;
6868
6869 // For long-running operations, total duration of the operation
6870 // while the app was in the foreground (only for trusted requests)
6871 optional int64 trusted_foreground_duration_millis = 8;
6872
6873 // For long-running operations, total duration of the operation
6874 // while the app was in the background (only for trusted requests)
6875 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00006876
6877 // Whether AppOps is guarded by Runtime permission
6878 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02006879}
Hongyi Zhang700137e2019-05-23 21:19:36 -07006880
6881/**
6882 * Location Manager API Usage information(e.g. API under usage,
6883 * API call's parameters).
6884 * Logged from:
6885 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
6886 */
6887message LocationManagerApiUsageReported {
6888
6889 // Indicating if usage starts or usage ends.
6890 optional android.stats.location.UsageState state = 1;
6891
6892 // LocationManagerService's API in use.
6893 // We can identify which API from LocationManager is
6894 // invoking current LMS API by the combination of
6895 // API parameter(e.g. is_listener_null, is_intent_null,
6896 // is_location_request_null)
6897 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
6898
6899 // Name of the package calling the API.
6900 optional string calling_package_name = 3;
6901
6902 // Type of the location provider.
6903 optional android.stats.location.ProviderType provider = 4;
6904
6905 // Quality of the location request
6906 optional android.stats.location.LocationRequestQuality quality = 5;
6907
6908 // The desired interval for active location updates, in milliseconds.
6909 // Bucketized to reduce cardinality.
6910 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
6911
6912 // Minimum distance between location updates, in meters.
6913 // Bucketized to reduce cardinality.
6914 optional android.stats.location.SmallestDisplacementBucket
6915 bucketized_smallest_displacement = 7;
6916
6917 // The number of location updates.
6918 optional int64 num_updates = 8;
6919
6920 // The request expiration time, in millisecond since boot.
6921 // Bucketized to reduce cardinality.
6922 optional android.stats.location.ExpirationBucket
6923 bucketized_expire_in = 9;
6924
6925 // Type of Callback passed in for this API.
6926 optional android.stats.location.CallbackType callback_type = 10;
6927
6928 // The radius of the central point of the alert
6929 // region, in meters. Only for API REQUEST_GEOFENCE.
6930 // Bucketized to reduce cardinality.
6931 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
6932
6933 // Activity Importance of API caller.
6934 // Categorized to 3 types that are interesting from location's perspective.
6935 optional android.stats.location.ActivityImportance activiy_importance = 12;
6936}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01006937
6938/**
6939 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
6940 */
6941message ReviewPermissionsFragmentResultReported {
6942 // unique value identifying a permission group change. A permission group change might result
6943 // in multiple of these atoms
6944 optional int64 change_id = 1;
6945
6946 // UID of package the permission belongs to
6947 optional int32 uid = 2 [(is_uid) = true];
6948
6949 // Name of package the permission belongs to
6950 optional string package_name = 3;
6951
6952 // The permission to be granted
6953 optional string permission_name = 4;
6954
6955 // The result of the permission grant
6956 optional bool permission_granted = 5;
6957}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01006958
6959/**
6960* Information about results of permission upgrade by RuntimePermissionsUpgradeController
6961* Logged from: RuntimePermissionUpdgradeController
6962*/
6963message RuntimePermissionsUpgradeResult {
6964 // Permission granted as result of upgrade
6965 optional string permission_name = 1;
6966
6967 // UID of package granted permission
6968 optional int32 uid = 2 [(is_uid) = true];
6969
6970 // Name of package granted permission
6971 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01006972}
6973
6974/**
6975* Information about a buttons presented in GrantPermissionsActivty and choice made by user
6976*/
6977message GrantPermissionsActivityButtonActions {
6978 // Permission granted as result of upgrade
6979 optional string permission_group_name = 1;
6980
6981 // UID of package granted permission
6982 optional int32 uid = 2 [(is_uid) = true];
6983
6984 // Name of package requesting permission
6985 optional string package_name = 3;
6986
6987 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
6988 // LABEL_ constants in GrantPermissionActivity.java
6989 optional int32 buttons_presented = 4;
6990
6991 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
6992 optional int32 button_clicked = 5;
6993}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01006994
6995/**
6996 * Information about LocationAccessCheck notification presented to user
6997 */
6998message LocationAccessCheckNotificationAction {
6999
7000 // id which identifies single session of user interacting with permission controller
7001 optional int64 session_id = 1;
7002
7003 // Uid of package for which location access check is presented
7004 optional int32 package_uid = 2;
7005
7006 // Name of package for which location access check is presented
7007 optional string package_name = 3;
7008
7009 enum Result {
7010 UNDEFINED = 0;
7011 // notification was presented to the user
7012 NOTIFICATION_PRESENTED = 1;
7013 // notification was declined by the user
7014 NOTIFICATION_DECLINED = 2;
7015 // notification was clicked by the user
7016 NOTIFICATION_CLICKED = 3;
7017 }
7018
7019 // View / interaction recorded
7020 optional Result result = 4;
7021}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007022
7023/**
7024 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7025 */
7026message AppPermissionFragmentActionReported {
7027 // id which identifies single session of user interacting with permission controller
7028 optional int64 session_id = 1;
7029
7030 // unique value identifying a permission group change. A permission group change might result
7031 // in multiple of these atoms
7032 optional int64 change_id = 2;
7033
7034 // UID of package the permission belongs to
7035 optional int32 uid = 3 [(is_uid) = true];
7036
7037 // Name of package the permission belongs to
7038 optional string package_name = 4;
7039
7040 // The permission to be granted
7041 optional string permission_name = 5;
7042
7043 // The result of the permission grant
7044 optional bool permission_granted = 6;
7045}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007046
7047/**
7048* Information about a AppPermissionFragment viewed by user
7049*/
7050message AppPermissionFragmentViewed {
7051 // id which identifies single session of user interacting with permission controller
7052 optional int64 session_id = 1;
7053
7054 // UID of package for which permissions are viewed
7055 optional int32 uid = 2 [(is_uid) = true];
7056
7057 // Name of package for which permissions are viewed
7058 optional string package_name = 3;
7059
7060 // Permission group viewed
7061 optional string permission_group_name = 4;
7062}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007063
7064/**
7065* Information about a AppPermissionsFragment viewed by user
7066*/
7067message AppPermissionsFragmentViewed {
7068 // id which identifies single session of user interacting with permission controller
7069 optional int64 session_id = 1;
7070
7071 // id which identifies single view as every view might have several logging records
7072 // with different package information attached
7073 optional int64 view_id = 2;
7074
7075 // Permission group viewed
7076 optional string permission_group_name = 3;
7077
7078 // UID of package for which permissions are viewed
7079 optional int32 uid = 4 [(is_uid) = true];
7080
7081 // Name of package for which permissions are viewed
7082 optional string package_name = 5;
7083
7084 // Category in which permission is included
7085 enum Category {
7086 UNDEFINED = 0;
7087 ALLOWED = 1;
7088 ALLOWED_FOREGROUND = 2;
7089 DENIED = 3;
7090 }
7091 optional Category category = 6;
7092}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007093
7094/**
7095* Information about a PermissionAppsFragment viewed by user.
7096* Logged from ui/handheld/PermissionAppsFragment.java
7097*/
7098message PermissionAppsFragmentViewed {
7099 // id which identifies single session of user interacting with permission controller
7100 optional int64 session_id = 1;
7101
7102 // id which identifies single view as every view might have several logging records
7103 // with different package information attached
7104 optional int64 view_id = 2;
7105
7106 // Permission group viewed
7107 optional string permission_group_name = 3;
7108
7109 // UID of package for which permissions are viewed
7110 optional int32 uid = 4 [(is_uid) = true];
7111
7112 // Name of package for which permissions are viewed
7113 optional string package_name = 5;
7114
7115 // Category in which app is included
7116 enum Category {
7117 UNDEFINED = 0;
7118 ALLOWED = 1;
7119 ALLOWED_FOREGROUND = 2;
7120 DENIED = 3;
7121 }
7122 optional Category category = 6;
7123}
Tony Make2b1b672019-07-29 16:59:47 +01007124
7125/**
7126 * Logs when there is a smart selection related event.
7127 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7128 * Logged from: TextClassifierEventLogger.java
7129 */
7130message TextSelectionEvent {
7131 // A session ID.
7132 optional string session_id = 1;
7133
7134 // Event type of this event.
7135 optional android.stats.textclassifier.EventType event_type = 2;
7136
Tony Mak9c84bd22019-12-09 07:27:25 +00007137 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007138 optional string model_name = 3;
7139
7140 // Type of widget that was involved in triggering this event.
7141 optional android.stats.textclassifier.WidgetType widget_type = 4;
7142
7143 // Index of this event in a session.
7144 optional int32 event_index = 5;
7145
7146 // Entity type that is involved.
7147 optional string entity_type = 6;
7148
7149 // Relative word index of the start of the selection.
7150 optional int32 relative_word_start_index = 7;
7151
7152 // Relative word (exclusive) index of the end of the selection.
7153 optional int32 relative_word_end_index = 8;
7154
7155 // Relative word index of the start of the smart selection.
7156 optional int32 relative_suggested_word_start_index = 9;
7157
7158 // Relative word (exclusive) index of the end of the smart selection.
7159 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007160
7161 // Name of source package.
7162 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007163}
7164
7165/**
7166 * Logs when there is a smart linkify related event.
7167 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7168 * Logged from: TextClassifierEventLogger.java
7169 */
7170message TextLinkifyEvent {
7171 // A session ID.
7172 optional string session_id = 1;
7173
7174 // Event type of this event.
7175 optional android.stats.textclassifier.EventType event_type = 2;
7176
Tony Mak9c84bd22019-12-09 07:27:25 +00007177 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007178 optional string model_name = 3;
7179
7180 // Type of widget that was involved in triggering this event.
7181 optional android.stats.textclassifier.WidgetType widget_type = 4;
7182
7183 // Index of this event in a session.
7184 optional int32 event_index = 5;
7185
7186 // Entity type that is involved.
7187 optional string entity_type = 6;
7188
7189 // Number of links detected.
7190 optional int32 num_links = 7;
7191
7192 // The total length of all links.
7193 optional int32 linked_text_length = 8;
7194
7195 // Length of input text.
7196 optional int32 text_length = 9;
7197
7198 // Time spent on generating links in ms.
7199 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007200
7201 // Name of source package.
7202 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007203}
7204
7205/**
7206 * Logs when there is a conversation actions related event.
7207 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7208 * Logged from: TextClassifierEventLogger.java
7209 */
7210message ConversationActionsEvent {
7211 // A session ID.
7212 optional string session_id = 1;
7213
7214 // Event type of this event.
7215 optional android.stats.textclassifier.EventType event_type = 2;
7216
Tony Mak9c84bd22019-12-09 07:27:25 +00007217 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007218 optional string model_name = 3;
7219
7220 // Type of widget that was involved in triggering this event.
7221 optional android.stats.textclassifier.WidgetType widget_type = 4;
7222
7223 // The first entity type that is involved.
7224 optional string first_entity_type = 5;
7225
7226 // The second entity type that is involved.
7227 optional string second_entity_type = 6;
7228
7229 // The third entity type that is involved.
7230 optional string third_entity_type = 7;
7231
7232 // The score of the first entity type.
7233 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01007234
7235 // Name of source package.
7236 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00007237
7238 // Name of the annotator model that is involved in this event.
7239 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01007240}
7241
7242/**
7243 * Logs when there is a language detection related event.
7244 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7245 * Logged from: TextClassifierEventLogger.java
7246 */
7247message LanguageDetectionEvent {
7248 // A session ID.
7249 optional string session_id = 1;
7250
7251 // Event type of this event.
7252 optional android.stats.textclassifier.EventType event_type = 2;
7253
Tony Mak9c84bd22019-12-09 07:27:25 +00007254 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007255 optional string model_name = 3;
7256
7257 // Type of widget that was involved in triggering this event.
7258 optional android.stats.textclassifier.WidgetType widget_type = 4;
7259
7260 // Detected language.
7261 optional string language_tag = 5;
7262
7263 // Score of the detected language.
7264 optional float score = 6;
7265
7266 // Position of this action.
7267 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01007268
7269 // Name of source package.
7270 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01007271}
Tianjie Xu167c3db2019-07-22 14:25:14 -07007272
7273/**
7274 * Information about an OTA update attempt by update_engine.
7275 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7276 */
7277message UpdateEngineUpdateAttemptReported {
7278 // The number of attempts for the update engine to apply a given payload.
7279 optional int32 attempt_number = 1;
7280
7281 optional android.stats.otaupdate.PayloadType payload_type = 2;
7282
7283 // The total time in minutes for the update engine to apply a given payload.
7284 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
7285 // it's increased when the system is sleeping.
7286 optional int32 duration_boottime_in_minutes = 3;
7287
7288 // The total time in minutes for the update engine to apply a given payload.
7289 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
7290 // and it's not increased when the system is sleeping.
7291 optional int32 duration_monotonic_in_minutes = 4;
7292
7293 // The size of the payload in MiBs.
7294 optional int32 payload_size_mib = 5;
7295
7296 // The attempt result reported by the update engine for an OTA update.
7297 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
7298
7299 // The error code reported by the update engine after an OTA update attempt
7300 // on A/B devices.
7301 optional android.stats.otaupdate.ErrorCode error_code = 7;
7302
7303 // The build fingerprint of the source system. The value is read from a
7304 // system property when the device takes the update. e.g.
7305 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
7306 optional string source_fingerprint = 8;
7307}
7308
7309/**
7310 * Information about all the attempts the device make before finishing the
7311 * successful update.
7312 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7313 */
7314message UpdateEngineSuccessfulUpdateReported {
7315 // The number of attempts for the update engine to apply the payload for a
7316 // successful update.
7317 optional int32 attempt_count = 1;
7318
7319 optional android.stats.otaupdate.PayloadType payload_type = 2;
7320
7321 optional int32 payload_size_mib = 3;
7322
7323 // The total number of bytes downloaded by update_engine since the last
7324 // successful update.
7325 optional int32 total_bytes_downloaded_mib = 4;
7326
7327 // The ratio in percentage of the over-downloaded bytes compared to the
7328 // total bytes needed to successfully install the update. e.g. 200 if we
7329 // download 200MiB in total for a 100MiB package.
7330 optional int32 download_overhead_percentage = 5;
7331
7332 // The total time in minutes for the update engine to apply the payload for a
7333 // successful update.
7334 optional int32 total_duration_minutes = 6;
7335
7336 // The number of reboot of the device during a successful update.
7337 optional int32 reboot_count = 7;
7338}
Alec Mourie088e762019-07-02 13:10:55 -07007339
7340/**
7341 * Global display pipeline metrics reported by SurfaceFlinger.
7342 * Pulled from:
7343 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7344 */
7345message SurfaceflingerStatsGlobalInfo {
7346 // Total number of frames presented during the tracing period
7347 optional int64 total_frames = 1;
7348 // Total number of frames missed
7349 optional int64 missed_frames = 2;
7350 // Total number of frames that fell back to client composition
7351 optional int64 client_composition_frames = 3;
7352 // Total time the display was turned on
7353 optional int64 display_on_millis = 4;
7354 // Total time that was spent performing animations.
7355 // This is derived from the present-to-present layer histogram
7356 optional int64 animation_millis = 5;
7357}
7358
7359/**
7360 * Per-layer display pipeline metrics reported by SurfaceFlinger.
7361 * The number of layers uploaded will be restricted due to size limitations.
7362 * Pulled from:
7363 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7364 */
7365message SurfaceflingerStatsLayerInfo {
7366 // The layer for this set of metrics
7367 // For now we can infer that the package name is included in the layer
7368 // name.
7369 optional string layer_name = 1;
7370 // Total number of frames presented
7371 optional int64 total_frames = 2;
7372 // Total number of dropped frames while latching a buffer for this layer.
7373 optional int64 dropped_frames = 3;
7374 // Set of timings measured between successive presentation timestamps.
7375 optional FrameTimingHistogram present_to_present = 4
7376 [(android.os.statsd.log_mode) = MODE_BYTES];
7377 // Set of timings measured from when an app queued a buffer for
7378 // presentation, until the buffer was actually presented to the
7379 // display.
7380 optional FrameTimingHistogram post_to_present = 5
7381 [(android.os.statsd.log_mode) = MODE_BYTES];
7382 // Set of timings measured from when a buffer is ready to be presented,
7383 // until the buffer was actually presented to the display.
7384 optional FrameTimingHistogram acquire_to_present = 6
7385 [(android.os.statsd.log_mode) = MODE_BYTES];
7386 // Set of timings measured from when a buffer was latched by
7387 // SurfaceFlinger, until the buffer was presented to the display
7388 optional FrameTimingHistogram latch_to_present = 7
7389 [(android.os.statsd.log_mode) = MODE_BYTES];
7390 // Set of timings measured from the desired presentation to the actual
7391 // presentation time
7392 optional FrameTimingHistogram desired_to_present = 8
7393 [(android.os.statsd.log_mode) = MODE_BYTES];
7394 // Set of timings measured from when an app queued a buffer for
7395 // presentation, until the buffer was ready to be presented.
7396 optional FrameTimingHistogram post_to_acquire = 9
7397 [(android.os.statsd.log_mode) = MODE_BYTES];
7398}
7399
7400/**
7401 * Histogram of frame counts bucketed by time in milliseconds.
7402 * Because of size limitations, we hard-cap the number of buckets, with
7403 * buckets for corresponding to larger milliseconds being less precise.
7404 */
7405message FrameTimingHistogram {
7406 // Timings in milliseconds that describes a set of histogram buckets
7407 repeated int32 time_millis_buckets = 1;
7408 // Number of frames that match to each time_millis, i.e. the bucket
7409 // contents
7410 // It's required that len(time_millis) == len(frame_count)
7411 repeated int64 frame_counts = 2;
7412}
Emilian Peev6729f372019-08-29 09:14:09 -07007413
Emilian Peev6729f372019-08-29 09:14:09 -07007414/**
7415 * Information about camera facing and API level usage.
7416 * Logged from:
7417 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
7418 */
7419message CameraActionEvent {
7420 // Camera session duration
7421 optional int64 duration = 1;
7422
7423 // Camera API level used
7424 optional int32 api_level = 2;
7425
7426 // Name of client package
7427 optional string package_name = 3;
7428
7429 // Camera facing
7430 enum Facing {
7431 UNKNOWN = 0;
7432 BACK = 1;
7433 FRONT = 2;
7434 EXTERNAL = 3;
7435 }
7436 optional Facing facing = 4;
7437}
atrost01a20932019-08-28 15:40:37 +01007438
7439/**
7440 * Logs when a compatibility change is affecting an app.
7441 *
7442 * Logged from:
7443 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
7444 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
7445 */
7446message AppCompatibilityChangeReported {
7447 // The UID of the app being affected by the compatibilty change.
7448 optional int32 uid = 1 [(is_uid) = true];
7449
7450 // The ID of the change affecting the app.
7451 optional int64 change_id = 2;
7452
7453 enum State {
7454 UNKNOWN_STATE = 0;
7455 ENABLED = 1;
7456 DISABLED = 2;
7457 LOGGED = 3;
7458 }
7459
7460 // The state of the change - if logged from gating whether it was enabled or disabled, or just
7461 // logged otherwise.
7462 optional State state = 3;
7463
7464 enum Source {
7465 UNKNOWN_SOURCE = 0;
7466 APP_PROCESS = 1;
7467 SYSTEM_SERVER = 2;
7468 }
7469
7470 // Where it was logged from.
7471 optional Source source = 4;
7472
7473}
Hector Dearman40579f62019-11-01 13:19:30 +00007474
7475/**
7476 * Logged from
7477 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
7478 */
7479message PerfettoUploaded {
7480 enum Event {
7481 PERFETTO_UNDEFINED = 0;
7482 PERFETTO_TRACE_BEGIN = 1;
7483 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
7484 PERFETTO_ON_CONNECT = 3;
7485 PERFETTO_ON_TRACING_DISABLED = 4;
7486 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
7487 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
7488 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
7489 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
7490 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
7491 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
7492 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
7493 PERFETTO_TRIGGER_BEGIN = 12;
7494 PERFETTO_TRIGGER_SUCCESS = 13;
7495 PERFETTO_TRIGGER_FAILURE = 14;
7496 PERFETTO_HIT_GUARDRAILS = 15;
7497 PERFETTO_ON_TIMEOUT = 16;
7498 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
7499 }
7500
7501 // Which stage of the pipeline we are reporting from.
7502 optional Event event = 1;
7503
7504 // UUID matching the one set inside the SystemInfo trace packet.
7505 optional int64 trace_uuid_lsb = 2;
7506 optional int64 trace_uuid_msb = 3;
7507}
Mark Tabrya824a642019-11-05 12:26:12 -08007508
7509/**
7510 * Pulls client metrics on data transferred via Vehicle Maps Service.
7511 * Metrics are keyed by uid + layer.
7512 *
7513 * Pulled from:
7514 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
7515 */
7516message VmsClientStats {
7517 // UID of the VMS client app
7518 optional int32 uid = 1 [(is_uid) = true];
7519
7520 // VMS layer definition
7521 optional int32 layer_type = 2;
7522 optional int32 layer_channel = 3;
7523 optional int32 layer_version = 4;
7524
7525 // Bytes and packets sent by the client for the layer
7526 optional int64 tx_bytes = 5;
7527 optional int64 tx_packets = 6;
7528
7529 // Bytes and packets received by the client for the layer
7530 optional int64 rx_bytes = 7;
7531 optional int64 rx_packets = 8;
7532
7533 // Bytes and packets dropped due to client error
7534 optional int64 dropped_bytes = 9;
7535 optional int64 dropped_packets = 10;
7536}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007537
7538/**
7539 * State of a dangerous permission requested by a package - sampled
7540 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
7541*/
7542message DangerousPermissionStateSampled {
7543 // Name of the permission
7544 optional string permission_name = 1;
7545
7546 // Uid of the package
7547 optional int32 uid = 2 [(is_uid) = true];
7548
7549 // If the permission is granted to the uid
7550 optional bool is_granted = 3;
7551
7552 // Permission flags as per android.content.pm.PermissionFlags
7553 optional int32 permission_flags = 4;
7554}
7555