blob: 4372e2245ee83384229db042c56eb4c9e57bf56b [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";
Will Brockman079fdaa2020-01-12 16:45:03 -050056import "frameworks/base/core/proto/android/stats/sysui/notification_enums.proto";
Tej Singhc477d9c2018-02-05 18:31:39 -080057import "frameworks/base/core/proto/android/telecomm/enums.proto";
Bookatz1a1b0462018-01-12 11:47:03 -080058import "frameworks/base/core/proto/android/telephony/enums.proto";
59import "frameworks/base/core/proto/android/view/enums.proto";
Bookatz11257ca2018-12-05 18:22:39 -080060import "frameworks/base/core/proto/android/wifi/enums.proto";
Tony Make2b1b672019-07-29 16:59:47 +010061import "frameworks/base/core/proto/android/stats/textclassifier/textclassifier_enums.proto";
Tianjie Xu167c3db2019-07-22 14:25:14 -070062import "frameworks/base/core/proto/android/stats/otaupdate/updateengine_enums.proto";
Joe Onorato62c220b2017-11-18 20:32:56 -080063
Yao Chend54f9dd2017-10-17 17:37:48 +000064/**
Stefan Lafonae2df012017-11-14 09:17:21 -080065 * The master atom class. This message defines all of the available
Yao Chend54f9dd2017-10-17 17:37:48 +000066 * raw stats log events from the Android system, also known as "atoms."
67 *
68 * This field contains a single oneof with all of the available messages.
69 * The stats-log-api-gen tool runs as part of the Android build and
70 * generates the android.util.StatsLog class, which contains the constants
71 * and methods that Android uses to log.
72 *
Stefan Lafonae2df012017-11-14 09:17:21 -080073 * This Atom class is not actually built into the Android system.
Yao Chend54f9dd2017-10-17 17:37:48 +000074 * Instead, statsd on Android constructs these messages synthetically,
75 * in the format defined here and in stats_log.proto.
76 */
Stefan Lafonae2df012017-11-14 09:17:21 -080077message Atom {
78 // Pushed atoms start at 2.
David Chenc8a43242017-10-17 16:23:28 -070079 oneof pushed {
Bookatzc1a050a2017-10-10 15:49:28 -070080 // For StatsLog reasons, 1 is illegal and will not work. Must start at 2.
81 BleScanStateChanged ble_scan_state_changed = 2;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070082 ProcessStateChanged process_state_changed = 3;
Bookatzc1a050a2017-10-10 15:49:28 -070083 BleScanResultReceived ble_scan_result_received = 4;
84 SensorStateChanged sensor_state_changed = 5;
Bookatzdb026a22018-01-10 19:01:56 -080085 GpsScanStateChanged gps_scan_state_changed = 6;
Bookatzc1a050a2017-10-10 15:49:28 -070086 SyncStateChanged sync_state_changed = 7;
87 ScheduledJobStateChanged scheduled_job_state_changed = 8;
88 ScreenBrightnessChanged screen_brightness_changed = 9;
Bookatzd6746242017-10-24 18:39:35 -070089 WakelockStateChanged wakelock_state_changed = 10;
Bookatzddccf0a2017-11-28 16:48:14 -080090 LongPartialWakelockStateChanged long_partial_wakelock_state_changed = 11;
91 MobileRadioPowerStateChanged mobile_radio_power_state_changed = 12;
92 WifiRadioPowerStateChanged wifi_radio_power_state_changed = 13;
Chenjie Yubd1a28f2018-07-17 14:55:19 -070093 ActivityManagerSleepStateChanged activity_manager_sleep_state_changed = 14;
94 MemoryFactorStateChanged memory_factor_state_changed = 15;
95 ExcessiveCpuUsageReported excessive_cpu_usage_reported = 16;
96 CachedKillReported cached_kill_reported = 17;
97 ProcessMemoryStatReported process_memory_stat_reported = 18;
Hyunyoung Songc6d6b772018-10-17 13:35:32 -070098 LauncherUIChanged launcher_event = 19;
Bookatzddccf0a2017-11-28 16:48:14 -080099 BatterySaverModeStateChanged battery_saver_mode_state_changed = 20;
100 DeviceIdleModeStateChanged device_idle_mode_state_changed = 21;
101 DeviceIdlingModeStateChanged device_idling_mode_state_changed = 22;
Bookatzc1a050a2017-10-10 15:49:28 -0700102 AudioStateChanged audio_state_changed = 23;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800103 MediaCodecStateChanged media_codec_state_changed = 24;
Bookatzc1a050a2017-10-10 15:49:28 -0700104 CameraStateChanged camera_state_changed = 25;
105 FlashlightStateChanged flashlight_state_changed = 26;
106 UidProcessStateChanged uid_process_state_changed = 27;
107 ProcessLifeCycleStateChanged process_life_cycle_state_changed = 28;
108 ScreenStateChanged screen_state_changed = 29;
Bookatz8c6571b2017-10-24 15:04:41 -0700109 BatteryLevelChanged battery_level_changed = 30;
110 ChargingStateChanged charging_state_changed = 31;
111 PluggedStateChanged plugged_state_changed = 32;
Bookatza66083f2018-09-20 17:24:00 -0700112 InteractiveStateChanged interactive_state_changed = 33;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -0800113 TouchEventReported touch_event_reported = 34;
Bookatz8c6571b2017-10-24 15:04:41 -0700114 WakeupAlarmOccurred wakeup_alarm_occurred = 35;
115 KernelWakeupReported kernel_wakeup_reported = 36;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800116 WifiLockStateChanged wifi_lock_state_changed = 37 [(module) = "wifi"];
117 WifiSignalStrengthChanged wifi_signal_strength_changed = 38 [(module) = "wifi"];
118 WifiScanStateChanged wifi_scan_state_changed = 39 [(module) = "wifi"];
Bookatze5885242017-10-24 20:10:31 -0700119 PhoneSignalStrengthChanged phone_signal_strength_changed = 40;
David Chenc28b2bb2017-10-24 12:52:52 -0700120 SettingChanged setting_changed = 41;
David Chenc8a43242017-10-17 16:23:28 -0700121 ActivityForegroundStateChanged activity_foreground_state_changed = 42;
David Chen21582962017-11-01 17:32:46 -0700122 IsolatedUidChanged isolated_uid_changed = 43;
Hugo Benichi884970e2017-11-14 22:42:46 +0900123 PacketWakeupOccurred packet_wakeup_occurred = 44;
Bookatz7948c872018-09-04 12:58:33 -0700124 WallClockTimeShifted wall_clock_time_shifted = 45;
Bookatz8fcd09a2017-12-18 13:01:10 -0800125 AnomalyDetected anomaly_detected = 46;
Andrei Oneada01ea52019-01-30 15:28:36 +0000126 AppBreadcrumbReported app_breadcrumb_reported = 47 [(allow_from_any_uid) = true];
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800127 AppStartOccurred app_start_occurred = 48;
128 AppStartCanceled app_start_canceled = 49;
129 AppStartFullyDrawn app_start_fully_drawn = 50;
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800130 LmkKillOccurred lmk_kill_occurred = 51 [(module) = "lmkd"];
Chenjie Yu52cacc62017-12-08 18:11:45 -0800131 PictureInPictureStateChanged picture_in_picture_state_changed = 52;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800132 WifiMulticastLockStateChanged wifi_multicast_lock_state_changed = 53 [(module) = "wifi"];
Muhammad Qureshi79f068c2019-12-20 06:55:57 -0800133 LmkStateChanged lmk_state_changed = 54 [(module) = "lmkd"];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800134 AppStartMemoryStateCaptured app_start_memory_state_captured = 55;
Tej Singh1ea42892018-01-19 09:27:00 -0800135 ShutdownSequenceReported shutdown_sequence_reported = 56;
Tej Singh6483ea42018-01-25 17:45:49 -0800136 BootSequenceReported boot_sequence_reported = 57;
Andrei Oneada01ea52019-01-30 15:28:36 +0000137 DaveyOccurred davey_occurred = 58 [(allow_from_any_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -0800138 OverlayStateChanged overlay_state_changed = 59;
Chenjie Yuccfe6452018-01-30 11:33:21 -0800139 ForegroundServiceStateChanged foreground_service_state_changed = 60;
Tej Singhc477d9c2018-02-05 18:31:39 -0800140 CallStateChanged call_state_changed = 61;
Tej Singhdd7bd352018-02-09 19:33:15 -0800141 KeyguardStateChanged keyguard_state_changed = 62;
142 KeyguardBouncerStateChanged keyguard_bouncer_state_changed = 63;
143 KeyguardBouncerPasswordEntered keyguard_bouncer_password_entered = 64;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800144 AppDied app_died = 65;
Tej Singha883b372018-02-15 11:30:01 -0800145 ResourceConfigurationChanged resource_configuration_changed = 66;
Tej Singh5d991e12018-03-09 19:48:11 -0800146 BluetoothEnabledStateChanged bluetooth_enabled_state_changed = 67;
147 BluetoothConnectionStateChanged bluetooth_connection_state_changed = 68;
Bookatz48d362e2018-11-06 15:49:08 -0800148 GpsSignalQualityChanged gps_signal_quality_changed = 69;
Andrew Chantb56388b2018-03-22 21:07:33 -0700149 UsbConnectorStateChanged usb_connector_state_changed = 70;
Andrew Chant28d627e2018-02-22 15:17:05 -0800150 SpeakerImpedanceReported speaker_impedance_reported = 71;
151 HardwareFailed hardware_failed = 72;
152 PhysicalDropDetected physical_drop_detected = 73;
153 ChargeCyclesReported charge_cycles_reported = 74;
Tej Singheee317b2018-03-07 19:28:05 -0800154 MobileConnectionStateChanged mobile_connection_state_changed = 75;
155 MobileRadioTechnologyChanged mobile_radio_technology_changed = 76;
Andrew Chantb56388b2018-03-22 21:07:33 -0700156 UsbDeviceAttached usb_device_attached = 77;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800157 AppCrashOccurred app_crash_occurred = 78;
158 ANROccurred anr_occurred = 79;
159 WTFOccurred wtf_occurred = 80;
160 LowMemReported low_mem_reported = 81;
Howard Rocb767f62018-06-19 19:58:05 -0700161 GenericAtom generic_atom = 82;
jianjin6eada302019-02-28 11:25:57 -0800162 KeyValuePairsAtom key_value_pairs_atom = 83 [(allow_from_any_uid) = true];
Bookatza7020bd2018-08-28 16:29:35 -0700163 VibratorStateChanged vibrator_state_changed = 84;
Yangster-mac96353002018-09-05 11:18:55 -0700164 DeferredJobStatsReported deferred_job_stats_reported = 85;
Tej Singha72344992019-04-17 18:55:08 -0700165 ThermalThrottlingStateChanged thermal_throttling = 86 [deprecated=true];
Kevin Chyn1741a072019-01-17 11:54:40 -0800166 BiometricAcquired biometric_acquired = 87;
167 BiometricAuthenticated biometric_authenticated = 88;
168 BiometricErrorOccurred biometric_error_occurred = 89;
Will Brockmanfbaa7912019-10-24 15:15:09 -0400169 UiEventReported ui_event_reported = 90;
Howard Roa46b6582018-09-18 16:45:02 -0700170 BatteryHealthSnapshot battery_health_snapshot = 91;
171 SlowIo slow_io = 92;
172 BatteryCausedShutdown battery_caused_shutdown = 93;
Yangsteraf9aee72018-10-12 09:26:16 -0700173 PhoneServiceStateChanged phone_service_state_changed = 94;
174 PhoneStateChanged phone_state_changed = 95;
arangelovd5db50e2018-10-12 20:24:39 +0100175 UserRestrictionChanged user_restriction_changed = 96;
Fan Zhang916c13b2018-10-16 22:49:45 -0700176 SettingsUIChanged settings_ui_changed = 97;
Chenjie Yuae9dfac2018-10-25 16:06:56 -0700177 ConnectivityStateChanged connectivity_state_changed = 98;
Chenjie Yu75b3c492018-10-06 21:45:19 -0700178 // TODO: service state change is very noisy shortly after boot, as well
179 // as at other transitions - coming out of doze, device plugged in, etc.
180 // Consider removing this if it becomes a problem
181 ServiceStateChanged service_state_changed = 99;
182 ServiceLaunchReported service_launch_reported = 100;
Tej Singh0d176952019-01-16 19:10:54 -0800183 FlagFlipUpdateOccurred flag_flip_update_occurred = 101;
Yangster-macb89807e2018-11-15 21:10:57 -0800184 BinaryPushStateChanged binary_push_state_changed = 102;
arangelov4e994062018-11-13 16:12:38 +0000185 DevicePolicyEvent device_policy_event = 103;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800186 DocsUIFileOperationCanceledReported docs_ui_file_op_canceled = 104 [(module) = "docsui"];
187 DocsUIFileOperationCopyMoveModeReported docs_ui_file_op_copy_move_mode_reported =
188 105 [(module) = "docsui"];
189 DocsUIFileOperationFailureReported docs_ui_file_op_failure = 106 [(module) = "docsui"];
190 DocsUIFileOperationReported docs_ui_provider_file_op = 107 [(module) = "docsui"];
191 DocsUIInvalidScopedAccessRequestReported docs_ui_invalid_scoped_access_request =
192 108 [(module) = "docsui"];
193 DocsUILaunchReported docs_ui_launch_reported = 109 [(module) = "docsui"];
194 DocsUIRootVisitedReported docs_ui_root_visited = 110 [(module) = "docsui"];
195 DocsUIStartupMsReported docs_ui_startup_ms = 111 [(module) = "docsui"];
196 DocsUIUserActionReported docs_ui_user_action_reported = 112 [(module) = "docsui"];
Bookatzda1798c2018-12-13 14:16:00 -0800197 WifiEnabledStateChanged wifi_enabled_state_changed = 113;
198 WifiRunningStateChanged wifi_running_state_changed = 114;
Ben Murdochbab399f62018-12-06 11:01:38 +0000199 AppCompacted app_compacted = 115;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800200 NetworkDnsEventReported network_dns_event_reported = 116 [(module) = "resolv"];
shawnlin9a1392a2019-04-09 16:21:17 +0800201 DocsUIPickerLaunchedFromReported docs_ui_picker_launched_from_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800202 117 [(module) = "docsui"];
203 DocsUIPickResultReported docs_ui_pick_result_reported = 118 [(module) = "docsui"];
204 DocsUISearchModeReported docs_ui_search_mode_reported = 119 [(module) = "docsui"];
205 DocsUISearchTypeReported docs_ui_search_type_reported = 120 [(module) = "docsui"];
206 DataStallEvent data_stall_event = 121 [(module) = "network_stack"];
Christian Brunschenf86039e2018-12-21 12:26:14 +0000207 RescuePartyResetReported rescue_party_reset_reported = 122;
Mathew Inwoodb375be52019-01-04 11:36:25 +0000208 SignedConfigReported signed_config_reported = 123;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -0800209 GnssNiEventReported gnss_ni_event_reported = 124;
Jack Heab86dbd22018-12-18 15:43:27 -0800210 BluetoothLinkLayerConnectionEvent bluetooth_link_layer_connection_event = 125;
Jack Hed9837c82019-01-09 01:19:13 -0800211 BluetoothAclConnectionStateChanged bluetooth_acl_connection_state_changed = 126;
212 BluetoothScoConnectionStateChanged bluetooth_sco_connection_state_changed = 127;
Felix Lopez Luisd95346a2018-12-12 10:32:32 +0000213 AppDowngraded app_downgraded = 128;
214 AppOptimizedAfterDowngraded app_optimized_after_downgraded = 129;
215 LowStorageStateChanged low_storage_state_changed = 130;
Yu-Han Yang14d5fb42019-01-16 12:42:59 -0800216 GnssNfwNotificationReported gnss_nfw_notification_reported = 131;
217 GnssConfigurationReported gnss_configuration_reported = 132;
Maggie Whitefc1aa592018-11-28 21:55:23 -0800218 UsbPortOverheatEvent usb_port_overheat_event_reported = 133;
Jack Yu95b64f32018-12-13 18:26:11 +0800219 NfcErrorOccurred nfc_error_occurred = 134;
220 NfcStateChanged nfc_state_changed = 135;
221 NfcBeamOccurred nfc_beam_occurred = 136;
222 NfcCardemulationOccurred nfc_cardemulation_occurred = 137;
223 NfcTagOccurred nfc_tag_occurred = 138;
224 NfcHceTransactionOccurred nfc_hce_transaction_occurred = 139;
225 SeStateChanged se_state_changed = 140;
226 SeOmapiReported se_omapi_reported = 141;
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -0800227 BroadcastDispatchLatencyReported broadcast_dispatch_latency_reported = 142;
Alex Saloa060aee2019-01-21 14:36:41 -0800228 AttentionManagerServiceResultReported attention_manager_service_result_reported = 143;
Michael Groover9e7b06e2018-12-28 19:55:51 -0800229 AdbConnectionChanged adb_connection_changed = 144;
Carter Hsub8fd1e92019-01-11 15:24:45 +0800230 SpeechDspStatReported speech_dsp_stat_reported = 145;
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -0800231 UsbContaminantReported usb_contaminant_reported = 146;
Howard Roe103fe22019-01-17 16:52:16 -0800232 WatchdogRollbackOccurred watchdog_rollback_occurred = 147;
Kevin Chyne5a37fb2019-02-08 13:10:36 -0800233 BiometricSystemHealthIssueDetected biometric_system_health_issue_detected = 148;
Steven Wuacef6bb2019-01-23 14:21:17 -0500234 BubbleUIChanged bubble_ui_changed = 149;
Kweku Adams8845d012018-12-11 20:06:45 -0800235 ScheduledJobConstraintChanged scheduled_job_constraint_changed = 150;
Jack Hec27040a2019-01-09 20:54:41 -0800236 BluetoothActiveDeviceChanged bluetooth_active_device_changed = 151;
237 BluetoothA2dpPlaybackStateChanged bluetooth_a2dp_playback_state_changed = 152;
238 BluetoothA2dpCodecConfigChanged bluetooth_a2dp_codec_config_changed = 153;
239 BluetoothA2dpCodecCapabilityChanged bluetooth_a2dp_codec_capability_changed = 154;
240 BluetoothA2dpAudioUnderrunReported bluetooth_a2dp_audio_underrun_reported = 155;
241 BluetoothA2dpAudioOverrunReported bluetooth_a2dp_audio_overrun_reported = 156;
242 BluetoothDeviceRssiReported bluetooth_device_rssi_reported = 157;
243 BluetoothDeviceFailedContactCounterReported bluetooth_device_failed_contact_counter_reported = 158;
244 BluetoothDeviceTxPowerLevelReported bluetooth_device_tx_power_level_reported = 159;
Jack He1021a612019-01-20 21:22:46 -0800245 BluetoothHciTimeoutReported bluetooth_hci_timeout_reported = 160;
246 BluetoothQualityReportReported bluetooth_quality_report_reported = 161;
Jack Heaea26982019-04-04 11:19:48 -0700247 BluetoothDeviceInfoReported bluetooth_device_info_reported = 162;
Jack He1021a612019-01-20 21:22:46 -0800248 BluetoothRemoteVersionInfoReported bluetooth_remote_version_info_reported = 163;
249 BluetoothSdpAttributeReported bluetooth_sdp_attribute_reported = 164;
250 BluetoothBondStateChanged bluetooth_bond_state_changed = 165;
251 BluetoothClassicPairingEventReported bluetooth_classic_pairing_event_reported = 166;
252 BluetoothSmpPairingEventReported bluetooth_smp_pairing_event_reported = 167;
Alex Salod7c3eef2019-01-25 14:43:27 -0800253 ScreenTimeoutExtensionReported screen_timeout_extension_reported = 168;
Hui Yu885aca12019-01-10 17:11:34 -0800254 ProcessStartTime process_start_time = 169;
Philip P. Moltmannb2f0c772019-04-11 14:41:21 -0700255 PermissionGrantRequestResultReported permission_grant_request_result_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800256 170 [(module) = "permissioncontroller"];
Jack He815cdba2019-01-30 17:24:55 -0800257 BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
Michael Groover4a0ca942019-01-24 17:41:25 -0800258 DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
Steven Wu552f63f2019-02-05 13:41:36 -0500259 BubbleDeveloperErrorReported bubble_developer_error_reported = 173;
joshmccloskey8c3322e2019-01-09 18:25:57 -0800260 AssistGestureStageReported assist_gesture_stage_reported = 174;
261 AssistGestureFeedbackReported assist_gesture_feedback_reported = 175;
262 AssistGestureProgressReported assist_gesture_progress_reported = 176;
Philip Quinn0eded622019-01-29 12:46:28 -0800263 TouchGestureClassified touch_gesture_classified = 177;
Andrei Onea4ad6d0c2019-02-08 13:54:12 +0000264 HiddenApiUsed hidden_api_used = 178 [(allow_from_any_uid) = true];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800265 StyleUIChanged style_ui_changed = 179 [(module) = "style"];
Joel Galenson6f41b1062019-04-16 12:22:41 -0700266 PrivacyIndicatorsInteracted privacy_indicators_interacted =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800267 180 [(module) = "permissioncontroller"];
Carmen Agimof6688a352019-01-30 19:36:04 +0000268 AppInstallOnExternalStorageReported app_install_on_external_storage_reported = 181;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800269 NetworkStackReported network_stack_reported = 182 [(module) = "network_stack"];
Carmen Agimof6dcc5032019-03-01 16:20:09 +0000270 AppMovedStorageReported app_moved_storage_reported = 183;
joshmccloskey6f952b22019-03-25 20:59:35 -0700271 BiometricEnrolled biometric_enrolled = 184;
jianjin8f2dee02019-03-29 14:03:08 -0700272 SystemServerWatchdogOccurred system_server_watchdog_occurred = 185;
273 TombStoneOccurred tomb_stone_occurred = 186;
Jack He71426802019-04-02 13:32:52 -0700274 BluetoothClassOfDeviceReported bluetooth_class_of_device_reported = 187;
Ben Blount763a5d52019-04-10 11:48:58 -0700275 IntelligenceEventReported intelligence_event_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800276 188 [(module) = "intelligence"];
Tej Singha72344992019-04-17 18:55:08 -0700277 ThermalThrottlingSeverityStateChanged thermal_throttling_severity_state_changed = 189;
Hai Zhang5d3328d2019-04-13 21:25:06 +0800278 RoleRequestResultReported role_request_result_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800279 190 [(module) = "permissioncontroller"];
Ray Essick8ab04df2019-02-15 11:01:02 -0800280 MediametricsAudiopolicyReported mediametrics_audiopolicy_reported = 191;
281 MediametricsAudiorecordReported mediametrics_audiorecord_reported = 192;
282 MediametricsAudiothreadReported mediametrics_audiothread_reported = 193;
283 MediametricsAudiotrackReported mediametrics_audiotrack_reported = 194;
284 MediametricsCodecReported mediametrics_codec_reported = 195;
285 MediametricsDrmWidevineReported mediametrics_drm_widevine_reported = 196;
286 MediametricsExtractorReported mediametrics_extractor_reported = 197;
287 MediametricsMediadrmReported mediametrics_mediadrm_reported = 198;
288 MediametricsNuPlayerReported mediametrics_nuplayer_reported = 199;
289 MediametricsRecorderReported mediametrics_recorder_reported = 200;
Robert Shiha4beed32019-08-19 14:15:23 -0700290 MediametricsDrmManagerReported mediametrics_drmmanager_reported = 201;
Yuncheol Heod1a85d22019-05-08 17:13:42 -0700291 CarPowerStateChanged car_power_state_changed = 203;
292 GarageModeInfo garage_mode_info = 204;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800293 TestAtomReported test_atom_reported = 205 [(module) = "cts"];
Adam He420947c2019-01-23 15:59:09 -0800294 ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported = 206;
295 ContentCaptureServiceEvents content_capture_service_events = 207;
296 ContentCaptureSessionEvents content_capture_session_events = 208;
297 ContentCaptureFlushed content_capture_flushed = 209;
Hongyi Zhang700137e2019-05-23 21:19:36 -0700298 LocationManagerApiUsageReported location_manager_api_usage_reported = 210;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100299 ReviewPermissionsFragmentResultReported review_permissions_fragment_result_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800300 211 [(module) = "permissioncontroller"];
Stanislav Zholnin247d1b72019-06-06 21:28:44 +0100301 RuntimePermissionsUpgradeResult runtime_permissions_upgrade_result =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800302 212 [(module) = "permissioncontroller"];
Stanislav Zholninbdf620b2019-06-06 22:38:33 +0100303 GrantPermissionsActivityButtonActions grant_permissions_activity_button_actions =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800304 213 [(module) = "permissioncontroller"];
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +0100305 LocationAccessCheckNotificationAction location_access_check_notification_action =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800306 214 [(module) = "permissioncontroller"];
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +0100307 AppPermissionFragmentActionReported app_permission_fragment_action_reported =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800308 215 [(module) = "permissioncontroller"];
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +0100309 AppPermissionFragmentViewed app_permission_fragment_viewed =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800310 216 [(module) = "permissioncontroller"];
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +0100311 AppPermissionsFragmentViewed app_permissions_fragment_viewed =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800312 217 [(module) = "permissioncontroller"];
Stanislav Zholnin32a89c12019-06-04 14:59:21 +0100313 PermissionAppsFragmentViewed permission_apps_fragment_viewed =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800314 218 [(module) = "permissioncontroller"];
315 TextSelectionEvent text_selection_event = 219 [(module) = "textclassifier"];
316 TextLinkifyEvent text_linkify_event = 220 [(module) = "textclassifier"];
317 ConversationActionsEvent conversation_actions_event = 221 [(module) = "textclassifier"];
318 LanguageDetectionEvent language_detection_event = 222 [(module) = "textclassifier"];
Hyunyoung Song2ecb8862019-07-09 09:19:25 -0700319 ExclusionRectStateChanged exclusion_rect_state_changed = 223;
320 BackGesture back_gesture_reported_reported = 224;
Tianjie Xu167c3db2019-07-22 14:25:14 -0700321 UpdateEngineUpdateAttemptReported update_engine_update_attempt_reported = 225;
322 UpdateEngineSuccessfulUpdateReported update_engine_successful_update_reported = 226;
Emilian Peev6729f372019-08-29 09:14:09 -0700323 CameraActionEvent camera_action_event = 227;
atrost01a20932019-08-28 15:40:37 +0100324 AppCompatibilityChangeReported app_compatibility_change_reported =
325 228 [(allow_from_any_uid) = true];
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800326 PerfettoUploaded perfetto_uploaded = 229 [(module) = "perfetto"];
Mark Tabrya824a642019-11-05 12:26:12 -0800327 VmsClientConnectionStateChanged vms_client_connection_state_changed = 230;
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800328 MediaProviderScanEvent media_provider_scan_event = 233 [(module) = "mediaprovider"];
329 MediaProviderDeletionEvent media_provider_deletion_event = 234 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700330 MediaProviderPermissionEvent media_provider_permission_event =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800331 235 [(module) = "mediaprovider"];
332 MediaProviderSchemaChange media_provider_schema_change = 236 [(module) = "mediaprovider"];
Jeff Sharkey6bd21572019-11-15 20:45:33 -0700333 MediaProviderIdleMaintenance media_provider_idle_maintenance =
Muhammad Qureshibcf66062019-12-23 17:55:48 -0800334 237 [(module) = "mediaprovider"];
Kenny Root4eacaaa2020-01-08 20:48:13 -0800335 RebootEscrowRecoveryReported reboot_escrow_recovery_reported = 238;
Keun young Park3e033cb2019-12-18 11:27:35 -0800336 BootTimeEventDuration boot_time_event_duration_reported = 239;
337 BootTimeEventElapsedTime boot_time_event_elapsed_time_reported = 240;
338 BootTimeEventUtcTime boot_time_event_utc_time_reported = 241;
339 BootTimeEventErrorCode boot_time_event_error_code_reported = 242;
Nikita Ioffe41dd57e2020-01-10 16:05:08 +0000340 UserspaceRebootReported userspace_reboot_reported = 243;
Will Brockman079fdaa2020-01-12 16:45:03 -0500341 NotificationReported notification_reported = 244;
342 NotificationPanelReported notification_panel_reported = 245;
343 NotificationChannelModified notification_panel_modified = 246;
Yao Chend54f9dd2017-10-17 17:37:48 +0000344 }
David Chenc8a43242017-10-17 16:23:28 -0700345
David Chen6e3e6cb2018-01-03 16:14:06 -0800346 // Pulled events will start at field 10000.
Rafal Slawikbdd5a502020-01-14 14:14:29 +0000347 // Next: 10071
David Chenc8a43242017-10-17 16:23:28 -0700348 oneof pulled {
David Chen6e3e6cb2018-01-03 16:14:06 -0800349 WifiBytesTransfer wifi_bytes_transfer = 10000;
350 WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
351 MobileBytesTransfer mobile_bytes_transfer = 10002;
352 MobileBytesTransferByFgBg mobile_bytes_transfer_by_fg_bg = 10003;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800353 BluetoothBytesTransfer bluetooth_bytes_transfer = 10006;
David Chen6e3e6cb2018-01-03 16:14:06 -0800354 KernelWakelock kernel_wakelock = 10004;
Chenjie Yuc8b7f222018-01-11 23:25:57 -0800355 SubsystemSleepState subsystem_sleep_state = 10005;
David Chen6e3e6cb2018-01-03 16:14:06 -0800356 CpuTimePerFreq cpu_time_per_freq = 10008;
357 CpuTimePerUid cpu_time_per_uid = 10009;
358 CpuTimePerUidFreq cpu_time_per_uid_freq = 10010;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800359 WifiActivityInfo wifi_activity_info = 10011;
David Chen6e3e6cb2018-01-03 16:14:06 -0800360 ModemActivityInfo modem_activity_info = 10012;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800361 BluetoothActivityInfo bluetooth_activity_info = 10007;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -0800362 ProcessMemoryState process_memory_state = 10013;
Chenjie Yu9d7720b2018-01-24 10:34:48 -0800363 SystemElapsedRealtime system_elapsed_realtime = 10014;
364 SystemUptime system_uptime = 10015;
Chenjie Yu9da105b2018-01-13 12:41:08 -0800365 CpuActiveTime cpu_active_time = 10016;
366 CpuClusterTime cpu_cluster_time = 10017;
Tej Singh86dc9db2018-09-06 00:39:57 +0000367 DiskSpace disk_space = 10018 [deprecated=true];
Tej Singhbf972d92018-01-10 20:51:13 -0800368 RemainingBatteryCapacity remaining_battery_capacity = 10019;
369 FullBatteryCapacity full_battery_capacity = 10020;
Tej Singh40298312018-02-16 00:15:09 -0800370 Temperature temperature = 10021;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +0100371 BinderCalls binder_calls = 10022;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +0100372 BinderCallsExceptions binder_calls_exceptions = 10023;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +0100373 LooperStats looper_stats = 10024;
Tej Singh86dc9db2018-09-06 00:39:57 +0000374 DiskStats disk_stats = 10025;
375 DirectoryUsage directory_usage = 10026;
376 AppSize app_size = 10027;
377 CategorySize category_size = 10028;
Chenjie Yuab530202018-09-26 12:39:20 -0700378 ProcStats proc_stats = 10029;
Bookatz17f0d8a2018-09-13 12:56:32 -0700379 BatteryVoltage battery_voltage = 10030;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800380 NumFingerprintsEnrolled num_fingerprints_enrolled = 10031;
Tej Singhe7726dc2018-09-21 11:42:12 -0700381 DiskIo disk_io = 10032;
Chenjie Yuab530202018-09-26 12:39:20 -0700382 PowerProfile power_profile = 10033;
Chenjie Yuf910b7802019-01-11 16:08:20 -0800383 ProcStatsPkgProc proc_stats_pkg_proc = 10034;
Yangster-mac308ea0c2018-10-22 13:10:25 -0700384 ProcessCpuTime process_cpu_time = 10035;
Misha Wagner5a51e002018-10-03 15:04:09 +0100385 CpuTimePerThreadFreq cpu_time_per_thread_freq = 10037;
Bookatz92da2832018-11-01 18:10:03 -0700386 OnDevicePowerMeasurement on_device_power_measurement = 10038;
Bookatz75ee60422018-11-09 12:27:37 -0800387 DeviceCalculatedPowerUse device_calculated_power_use = 10039;
388 DeviceCalculatedPowerBlameUid device_calculated_power_blame_uid = 10040;
389 DeviceCalculatedPowerBlameOther device_calculated_power_blame_other = 10041;
Rafal Slawik3bea8952018-11-15 12:39:33 +0000390 ProcessMemoryHighWaterMark process_memory_high_water_mark = 10042;
Tej Singhb1dbc8b2018-11-19 15:49:47 -0800391 BatteryLevel battery_level = 10043;
Bookatz366a4432018-11-20 09:42:33 -0800392 BuildInformation build_information = 10044;
Maggie White8735b852019-01-18 11:40:49 -0800393 BatteryCycleCount battery_cycle_count = 10045;
Olivier Gaillard18d452202019-01-22 15:03:41 +0000394 DebugElapsedClock debug_elapsed_clock = 10046;
395 DebugFailingElapsedClock debug_failing_elapsed_clock = 10047;
joshmccloskey5dcb4082019-02-26 15:28:37 -0800396 NumFacesEnrolled num_faces_enrolled = 10048;
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -0800397 RoleHolder role_holder = 10049;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -0800398 DangerousPermissionState dangerous_permission_state = 10050;
Chenjie Yue13f44a2019-02-07 17:51:38 -0800399 TrainInfo train_info = 10051;
Neil Fullerdb14b482019-02-05 19:44:44 +0000400 TimeZoneDataInfo time_zone_data_info = 10052;
Carmen Agimof12dec122019-03-06 16:14:38 +0000401 ExternalStorageInfo external_storage_info = 10053;
Yiwei Zhang5c81b632019-03-01 15:39:46 -0800402 GpuStatsGlobalInfo gpu_stats_global_info = 10054;
403 GpuStatsAppInfo gpu_stats_app_info = 10055;
Rafal Slawikbdd5a502020-01-14 14:14:29 +0000404 SystemIonHeapSize system_ion_heap_size = 10056 [deprecated = true];
Carmen Agimofa769c152019-03-04 14:39:14 +0000405 AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
joshmccloskey34c1f8e2019-04-11 14:06:43 -0700406 FaceSettings face_settings = 10058;
Maggie White442b6312019-04-05 16:26:44 -0700407 CoolingDevice cooling_device = 10059;
Martijn Coenencd95d462019-04-25 17:09:45 +0200408 AppOps app_ops = 10060;
Rafal Slawik77987ed2019-06-17 12:28:23 +0100409 ProcessSystemIonHeapSize process_system_ion_heap_size = 10061;
Alec Mourie088e762019-07-02 13:10:55 -0700410 SurfaceflingerStatsGlobalInfo surfaceflinger_stats_global_info = 10062;
411 SurfaceflingerStatsLayerInfo surfaceflinger_stats_layer_info = 10063;
Rafal Slawik7efcefb2019-09-20 11:16:20 +0100412 ProcessMemorySnapshot process_memory_snapshot = 10064;
Mark Tabrya824a642019-11-05 12:26:12 -0800413 VmsClientStats vms_client_stats = 10065;
Chris Wrencdea3b72019-11-22 16:58:17 -0500414 NotificationRemoteViews notification_remote_views = 10066;
Stanislav Zholninccb82e42019-11-29 18:59:49 +0000415 DangerousPermissionStateSampled dangerous_permission_state_sampled = 10067;
Stan Iliev637ba5e2019-08-16 13:43:08 -0400416 GraphicsStats graphics_stats = 10068;
Stanislav Zholnin606454c2019-11-27 15:31:49 +0000417 RuntimeAppOpsAccess runtime_app_ops_access = 10069;
Rafal Slawikbdd5a502020-01-14 14:14:29 +0000418 IonHeapSize ion_heap_size = 10070;
David Chenc8a43242017-10-17 16:23:28 -0700419 }
yroa1fe77c2018-02-26 14:22:54 -0800420
Bookatz76aafcf2018-09-17 16:17:10 -0700421 // DO NOT USE field numbers above 100,000 in AOSP.
422 // Field numbers 100,000 - 199,999 are reserved for non-AOSP (e.g. OEMs) to use.
423 // Field numbers 200,000 and above are reserved for future use; do not use them at all.
Rafal Slawik203c3db2019-09-25 19:53:01 +0100424
425 reserved 10036;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700426}
427
Yao Chend54f9dd2017-10-17 17:37:48 +0000428/**
Yangster-mac20877162017-12-22 17:19:39 -0800429 * This proto represents a node of an attribution chain.
430 * Note: All attribution chains are represented as a repeated field of type
431 * AttributionNode. It is understood that in such arrays, the order is that
432 * of calls, that is [A, B, C] if A calls B that calls C.
Yao Chend54f9dd2017-10-17 17:37:48 +0000433 */
Yangster-mac20877162017-12-22 17:19:39 -0800434message AttributionNode {
435 // The uid for a given element in the attribution chain.
Yangster-mac7604aea2017-12-11 22:55:49 -0800436 optional int32 uid = 1;
Yangster-mac7604aea2017-12-11 22:55:49 -0800437
Yangster-mac20877162017-12-22 17:19:39 -0800438 // The (optional) string tag for an element in the attribution chain. If the
439 // element has no tag, it is encoded as an empty string.
440 optional string tag = 2;
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700441}
442
Yangster-mac48b3d622018-08-18 12:38:11 -0700443message KeyValuePair {
444 optional int32 key = 1;
445 oneof value {
Howard Ro4078dd42018-09-27 17:41:08 -0700446 int32 value_int = 2;
447 int64 value_long = 3;
448 string value_str = 4;
449 float value_float = 5;
Yangster-mac48b3d622018-08-18 12:38:11 -0700450 }
451}
452
453message KeyValuePairsAtom {
454 optional int32 uid = 1;
455 repeated KeyValuePair pairs = 2;
456}
457
Yao Chend54f9dd2017-10-17 17:37:48 +0000458/*
459 * *****************************************************************************
yrode4ca102017-11-15 22:57:24 -0800460 * Below are all of the individual atoms that are logged by Android via statsd.
Yao Chend54f9dd2017-10-17 17:37:48 +0000461 *
462 * RULES:
463 * - The field ids for each atom must start at 1, and count upwards by 1.
464 * Skipping field ids is not allowed.
465 * - These form an API, so renaming, renumbering or removing fields is
466 * not allowed between android releases. (This is not currently enforced,
467 * but there will be a tool to enforce this restriction).
468 * - The types must be built-in protocol buffer types, namely, no sub-messages
469 * are allowed (yet). The bytes type is also not allowed.
470 * - The CamelCase name of the message type should match the
Stefan Lafonae2df012017-11-14 09:17:21 -0800471 * underscore_separated name as defined in Atom.
Yao Chend54f9dd2017-10-17 17:37:48 +0000472 * - If an atom represents work that can be attributed to an app, there can
Yangster-mac7604aea2017-12-11 22:55:49 -0800473 * be exactly one AttributionChain field. It must be field number 1.
Yao Chend54f9dd2017-10-17 17:37:48 +0000474 * - A field that is a uid should be a string field, tagged with the [xxx]
475 * annotation. The generated code on android will be represented by UIDs,
476 * and those UIDs will be translated in xxx to those strings.
477 *
478 * CONVENTIONS:
Bookatzc1a050a2017-10-10 15:49:28 -0700479 * - Events are past tense. e.g. ScreenStateChanged, not ScreenStateChange.
Yao Chend54f9dd2017-10-17 17:37:48 +0000480 * - If there is a UID, it goes first. Think in an object-oriented fashion.
481 * *****************************************************************************
482 */
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700483
Yao Chend54f9dd2017-10-17 17:37:48 +0000484/**
Tej Singha72344992019-04-17 18:55:08 -0700485 * This atom is deprecated starting in Q. Please use ThermalThrottlingSeverityStateChanged.
Yangster-mace16189a2018-08-26 12:20:16 -0700486 * Logs when the Thermal service HAL notifies the throttling start/stop events.
487 *
488 * Logged from:
489 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
490 */
491message ThermalThrottlingStateChanged {
Maggie White442b6312019-04-05 16:26:44 -0700492 // The type of temperature being reported (CPU, GPU, SKIN, etc)
Yangster-mace16189a2018-08-26 12:20:16 -0700493 optional android.os.TemperatureTypeEnum sensor_type = 1;
494
Maggie White442b6312019-04-05 16:26:44 -0700495 // Throttling state, this field is DEPRECATED
Yangster-mace16189a2018-08-26 12:20:16 -0700496 enum State {
497 UNKNOWN = 0;
Maggie White442b6312019-04-05 16:26:44 -0700498 START = 1; // START indicated that throttling was triggered.
499 STOP = 2; // STOP indicates that throttling was cleared.
Yangster-mace16189a2018-08-26 12:20:16 -0700500 }
Yangster-mace16189a2018-08-26 12:20:16 -0700501 optional State state = 2;
502
503 optional float temperature = 3;
504}
505
506/**
Yao Chend54f9dd2017-10-17 17:37:48 +0000507 * Logs when the screen state changes.
508 *
509 * Logged from:
510 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
511 */
512message ScreenStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -0800513 // New screen state, from frameworks/base/core/proto/android/view/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700514 optional android.view.DisplayStateEnum state = 1 [(state_field_option).option = EXCLUSIVE];
Stefan Lafoncdb1a0e2017-09-27 20:24:15 -0700515}
Yao Chend54f9dd2017-10-17 17:37:48 +0000516
517/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700518 * Logs that the process state of the uid, as determined by ActivityManager
519 * (i.e. the highest process state of that uid's processes) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000520 *
521 * Logged from:
522 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
523 */
Bookatzc1a050a2017-10-10 15:49:28 -0700524message UidProcessStateChanged {
Yangster-macb6b77c62018-10-12 19:33:24 -0700525 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Yao Chend54f9dd2017-10-17 17:37:48 +0000526
Bookatzdb026a22018-01-10 19:01:56 -0800527 // The state, from frameworks/base/core/proto/android/app/enums.proto.
Yangster-macb6b77c62018-10-12 19:33:24 -0700528 optional android.app.ProcessStateEnum state = 2 [(state_field_option).option = EXCLUSIVE];
Yao Chend54f9dd2017-10-17 17:37:48 +0000529}
530
531/**
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700532 * Logs process state change of a process, as per the activity manager.
533 *
534 * Logged from:
535 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
536 */
537message ProcessStateChanged {
538 optional int32 uid = 1;
539 optional string process_name = 2;
540 optional string package_name = 3;
541 // TODO: remove this when validation is done
542 optional int64 version = 5;
543 // The state, from frameworks/base/core/proto/android/app/enums.proto.
544 optional android.app.ProcessStateEnum state = 4;
545}
546
547/**
548 * Logs when ActivityManagerService sleep state is changed.
549 *
550 * Logged from:
551 * frameworks/base/services/core/java/com/android/server/am/ActivityTaskManagerService.java
552 */
553message ActivityManagerSleepStateChanged {
554 // TODO: import frameworks proto
555 enum State {
556 UNKNOWN = 0;
557 ASLEEP = 1;
558 AWAKE = 2;
559 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700560 optional State state = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700561}
562
563/**
564 * Logs when system memory state changes.
565 *
566 * Logged from:
567 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
568 */
569message MemoryFactorStateChanged {
570 // TODO: import frameworks proto
571 enum State {
572 MEMORY_UNKNOWN = 0;
573 NORMAL = 1; // normal.
574 MODERATE = 2; // moderate memory pressure.
575 LOW = 3; // low memory.
576 CRITICAL = 4; // critical memory.
577
578 }
Yangster-macb6b77c62018-10-12 19:33:24 -0700579 optional State factor = 1 [(state_field_option).option = EXCLUSIVE];
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700580}
581
582/**
583 * Logs when app is using too much cpu, according to ActivityManagerService.
584 *
585 * Logged from:
586 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
587 */
588message ExcessiveCpuUsageReported {
589 optional int32 uid = 1;
590 optional string process_name = 2;
591 optional string package_name = 3;
592 // package version. TODO: remove this when validation is done
593 optional int64 version = 4;
594}
595
596/**
597 * Logs when a cached process is killed, along with its pss.
598 *
599 * Logged from:
600 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
601 */
602message CachedKillReported {
603 optional int32 uid = 1;
604 optional string process_name = 2;
605 optional string package_name = 3;
606 // TODO: remove this when validation is done
607 optional int64 version = 5;
608 optional int64 pss = 4;
609}
610
611/**
612 * Logs when memory stats of a process is reported.
613 *
614 * Logged from:
615 * frameworks/base/services/core/java/com/android/server/am/ProcessRecord.java
616 */
617message ProcessMemoryStatReported {
618 optional int32 uid = 1;
619 optional string process_name = 2;
620 optional string package_name = 3;
621 //TODO: remove this when validation is done
622 optional int64 version = 9;
623 optional int64 pss = 4;
624 optional int64 uss = 5;
625 optional int64 rss = 6;
626 enum Type {
627 ADD_PSS_INTERNAL_SINGLE = 0;
628 ADD_PSS_INTERNAL_ALL_MEM = 1;
629 ADD_PSS_INTERNAL_ALL_POLL = 2;
630 ADD_PSS_EXTERNAL = 3;
631 ADD_PSS_EXTERNAL_SLOW = 4;
632 }
633 optional Type type = 7;
Muhammad Qureshidda73202019-03-07 13:54:20 -0800634 optional int64 duration_millis = 8;
Chenjie Yubd1a28f2018-07-17 14:55:19 -0700635}
636
637/**
Bookatzc1a050a2017-10-10 15:49:28 -0700638 * Logs that a process started, finished, crashed, or ANRed.
639 *
640 * Logged from:
641 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
642 */
643message ProcessLifeCycleStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -0700644 optional int32 uid = 1 [(is_uid) = true];
Bookatzc1a050a2017-10-10 15:49:28 -0700645
David Chen0b5c90c2018-01-25 16:51:49 -0800646 // The process name (usually same as the app name).
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800647 optional string process_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700648
Bookatzddccf0a2017-11-28 16:48:14 -0800649 // What lifecycle state the process changed to.
650 // This enum is specific to atoms.proto.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800651 enum State {
652 FINISHED = 0;
653 STARTED = 1;
654 CRASHED = 2;
Bookatzddccf0a2017-11-28 16:48:14 -0800655 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800656 optional State state = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700657}
658
Bookatzc1a050a2017-10-10 15:49:28 -0700659/**
660 * Logs when the ble scan state changes.
661 *
662 * Logged from:
Bookatz17a879d2018-03-28 15:05:28 -0700663 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700664 */
665message BleScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800666 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700667
668 enum State {
669 OFF = 0;
670 ON = 1;
Bookatze5ec0b42018-03-26 13:34:56 -0700671 // RESET indicates all ble stopped. Used when it (re)starts (e.g. after it crashes).
672 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700673 }
674 optional State state = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700675
Bookatze5ec0b42018-03-26 13:34:56 -0700676 // Does the scan have a filter.
677 optional bool is_filtered = 3;
678 // Whether the scan is a CALLBACK_TYPE_FIRST_MATCH scan. Called 'background' scan internally.
679 optional bool is_first_match = 4;
680 // Whether the scan set to piggy-back off the results of other scans (SCAN_MODE_OPPORTUNISTIC).
681 optional bool is_opportunistic = 5;
Bookatzc1a050a2017-10-10 15:49:28 -0700682}
683
684/**
685 * Logs reporting of a ble scan finding results.
686 *
687 * Logged from:
Bookatzae6738e2018-09-13 11:38:56 -0700688 * packages/apps/Bluetooth/src/com/android/bluetooth/gatt/AppScanStats.java
Bookatzc1a050a2017-10-10 15:49:28 -0700689 */
Bookatzae6738e2018-09-13 11:38:56 -0700690// TODO: Consider also tracking per-scanner-id.
Bookatzc1a050a2017-10-10 15:49:28 -0700691message BleScanResultReceived {
Yangster-macafad8c62018-01-05 22:30:49 -0800692 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700693
694 // Number of ble scan results returned.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800695 optional int32 num_results = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700696}
697
698/**
699 * Logs when a sensor state changes.
700 *
701 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700702 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700703 */
704message SensorStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800705 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700706
Bookatzc1a050a2017-10-10 15:49:28 -0700707 // The id (int) of the sensor.
708 optional int32 sensor_id = 2;
709
710 enum State {
711 OFF = 0;
712 ON = 1;
713 }
714 optional State state = 3;
715}
716
Bookatzc1a050a2017-10-10 15:49:28 -0700717/**
718 * Logs when GPS state changes.
719 *
720 * Logged from:
721 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
722 */
723message GpsScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800724 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700725
726 enum State {
727 OFF = 0;
728 ON = 1;
729 }
730 optional State state = 2;
731}
732
Bookatz48d362e2018-11-06 15:49:08 -0800733/**
734 * Logs when GPS signal quality.
735 *
736 * Logged from:
737 * /frameworks/base/location/java/com/android/internal/location/gnssmetrics/GnssMetrics.java
738 */
739message GpsSignalQualityChanged {
740 optional android.server.location.GpsSignalQualityEnum level = 1;
741}
742
Bookatzc1a050a2017-10-10 15:49:28 -0700743
744/**
745 * Logs when a sync manager sync state changes.
746 *
747 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700748 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700749 */
750message SyncStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800751 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700752
David Chen0b5c90c2018-01-25 16:51:49 -0800753 // Name of the sync (as named in the app). Can be chosen at run-time.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800754 optional string sync_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700755
756 enum State {
757 OFF = 0;
758 ON = 1;
759 }
760 optional State state = 3;
761}
762
Yangster-mac96353002018-09-05 11:18:55 -0700763/*
764 * Deferred job stats.
765 *
766 * Logged from:
767 * frameworks/base/services/core/java/com/android/server/job/JobSchedulerService.java
768*/
769message DeferredJobStatsReported {
770 repeated AttributionNode attribution_node = 1;
771
772 // Number of jobs deferred.
773 optional int32 num_jobs_deferred = 2;
774
775 // Time since the last job runs.
776 optional int64 time_since_last_job_millis = 3;
777}
778
Bookatzc1a050a2017-10-10 15:49:28 -0700779/**
780 * Logs when a job scheduler job state changes.
781 *
782 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700783 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700784 */
785message ScheduledJobStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800786 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700787
788 // Name of the job (as named in the app)
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800789 optional string job_name = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700790
791 enum State {
Tej Singhd5747a62018-01-08 20:57:35 -0800792 FINISHED = 0;
793 STARTED = 1;
794 SCHEDULED = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700795 }
796 optional State state = 3;
797
Tej Singh33a412b2018-03-16 18:43:59 -0700798 // The reason a job has stopped.
799 // This is only applicable when the state is FINISHED.
Bookatz235343d2018-03-26 13:03:50 -0700800 // The default value is STOP_REASON_UNKNOWN.
Tej Singh33a412b2018-03-16 18:43:59 -0700801 optional android.app.job.StopReasonEnum stop_reason = 4;
Ben Murdoch741e3352019-05-09 11:27:28 +0100802
803 // The standby bucket of the app that scheduled the job. These match the framework constants
804 // defined in JobSchedulerService.java with the addition of UNKNOWN using -1, as ACTIVE is
805 // already assigned 0.
806 enum Bucket {
807 UNKNOWN = -1;
808 ACTIVE = 0;
809 WORKING_SET = 1;
810 FREQUENT = 2;
811 RARE = 3;
812 NEVER = 4;
813 }
814 optional Bucket standby_bucket = 5 [default = UNKNOWN];
815
816 // The job id (as assigned by the app).
817 optional int32 job_id = 6;
Bookatzc1a050a2017-10-10 15:49:28 -0700818}
819
820/**
821 * Logs when the audio state changes.
822 *
823 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700824 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700825 */
826message AudioStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800827 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700828
829 enum State {
830 OFF = 0;
831 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700832 // RESET indicates all audio stopped. Used when it (re)starts (e.g. after it crashes).
833 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700834 }
835 optional State state = 2;
836}
837
838/**
839 * Logs when the video codec state changes.
840 *
841 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700842 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700843 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -0800844message MediaCodecStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800845 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700846
847 enum State {
848 OFF = 0;
849 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700850 // RESET indicates all mediaCodec stopped. Used when it (re)starts (e.g. after it crashes).
851 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700852 }
853 optional State state = 2;
854}
855
856/**
857 * Logs when the flashlight state changes.
858 *
859 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700860 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700861 */
862message FlashlightStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800863 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700864
865 enum State {
866 OFF = 0;
867 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700868 // RESET indicates all flashlight stopped. Used when it (re)starts (e.g. after it crashes).
869 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700870 }
871 optional State state = 2;
872}
873
874/**
875 * Logs when the camera state changes.
876 *
877 * Logged from:
Bookatz235343d2018-03-26 13:03:50 -0700878 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
Bookatzc1a050a2017-10-10 15:49:28 -0700879 */
880message CameraStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800881 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700882
883 enum State {
884 OFF = 0;
885 ON = 1;
Bookatz235343d2018-03-26 13:03:50 -0700886 // RESET indicates all camera stopped. Used when it (re)starts (e.g. after it crashes).
887 RESET = 2;
Bookatzc1a050a2017-10-10 15:49:28 -0700888 }
889 optional State state = 2;
890}
891
892/**
893 * Logs that the state of a wakelock (per app and per wakelock name) has changed.
Yao Chend54f9dd2017-10-17 17:37:48 +0000894 *
895 * Logged from:
896 * TODO
897 */
Bookatzd6746242017-10-24 18:39:35 -0700898message WakelockStateChanged {
tsaichristineed615642020-01-02 12:53:41 -0800899 repeated AttributionNode attribution_node = 1
900 [(state_field_option).option = PRIMARY_FIELD_FIRST_UID];
Yao Chend54f9dd2017-10-17 17:37:48 +0000901
Bookatz1a1b0462018-01-12 11:47:03 -0800902 // The type (level) of the wakelock; e.g. a partial wakelock or a full wakelock.
903 // From frameworks/base/core/proto/android/os/enums.proto.
tsaichristineed615642020-01-02 12:53:41 -0800904 optional android.os.WakeLockLevelEnum type = 2 [(state_field_option).option = PRIMARY];
905 ;
Bookatzc1a050a2017-10-10 15:49:28 -0700906
907 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
tsaichristineed615642020-01-02 12:53:41 -0800908 optional string tag = 3 [(state_field_option).option = PRIMARY];
Bookatzc1a050a2017-10-10 15:49:28 -0700909
910 enum State {
Yangster-maccfdf3a42017-12-06 13:42:38 -0800911 RELEASE = 0;
912 ACQUIRE = 1;
913 CHANGE_RELEASE = 2;
914 CHANGE_ACQUIRE = 3;
Bookatzc1a050a2017-10-10 15:49:28 -0700915 }
tsaichristineed615642020-01-02 12:53:41 -0800916 optional State state = 4 [(state_field_option).option = EXCLUSIVE];
Bookatzc1a050a2017-10-10 15:49:28 -0700917}
918
919/**
Bookatzc1a050a2017-10-10 15:49:28 -0700920 * Logs when a partial wakelock is considered 'long' (over 1 min).
921 *
922 * Logged from:
923 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
924 */
925message LongPartialWakelockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -0800926 repeated AttributionNode attribution_node = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700927
Yao Chend54f9dd2017-10-17 17:37:48 +0000928 // The wakelock tag (Called tag in the Java API, sometimes name elsewhere).
929 optional string tag = 2;
930
Bookatzc1a050a2017-10-10 15:49:28 -0700931 // TODO: I have no idea what this is.
932 optional string history_tag = 3;
933
934 enum State {
935 OFF = 0;
936 ON = 1;
937 }
938 optional State state = 4;
Yao Chend54f9dd2017-10-17 17:37:48 +0000939}
940
Bookatzc1a050a2017-10-10 15:49:28 -0700941/**
Bookatza66083f2018-09-20 17:24:00 -0700942 * Logs when the device is interactive, according to the PowerManager Notifier.
943 *
944 * Logged from:
945 * frameworks/base/services/core/java/com/android/server/power/Notifier.java
946 */
947message InteractiveStateChanged {
948 enum State {
949 OFF = 0;
950 ON = 1;
951 }
952 optional State state = 1;
953}
954
955/**
Bookatzc1a050a2017-10-10 15:49:28 -0700956 * Logs Battery Saver state change.
957 *
958 * Logged from:
959 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
960 */
961message BatterySaverModeStateChanged {
962 enum State {
963 OFF = 0;
964 ON = 1;
965 }
966 optional State state = 1;
967}
968
969/**
970 * Logs Doze mode state change.
971 *
972 * Logged from:
Bookatzddccf0a2017-11-28 16:48:14 -0800973 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatzc1a050a2017-10-10 15:49:28 -0700974 */
975message DeviceIdleModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800976 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzddccf0a2017-11-28 16:48:14 -0800977}
978
979
980/**
981 * Logs state change of Doze mode including maintenance windows.
982 *
983 * Logged from:
984 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
985 */
986message DeviceIdlingModeStateChanged {
Bookatz8bdae8d2018-01-16 11:24:30 -0800987 optional android.server.DeviceIdleModeEnum state = 1;
Bookatzc1a050a2017-10-10 15:49:28 -0700988}
989
990/**
991 * Logs screen brightness level.
992 *
993 * Logged from:
994 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
995 */
996message ScreenBrightnessChanged {
997 // Screen brightness level. Should be in [-1, 255] according to PowerManager.java.
998 optional int32 level = 1;
Bookatz8c6571b2017-10-24 15:04:41 -0700999}
1000
1001/**
1002 * Logs battery level (percent full, from 0 to 100).
1003 *
1004 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001005 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001006 */
1007message BatteryLevelChanged {
1008 // Battery level. Should be in [0, 100].
1009 optional int32 battery_level = 1;
1010}
1011
1012/**
1013 * Logs change in charging status of the device.
1014 *
1015 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001016 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001017 */
1018message ChargingStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001019 // State of the battery, from frameworks/base/core/proto/android/os/enums.proto.
1020 optional android.os.BatteryStatusEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001021}
1022
1023/**
1024 * Logs whether the device is plugged in, and what power source it is using.
1025 *
1026 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001027 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001028 */
1029message PluggedStateChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001030 // Whether the device is plugged in, from frameworks/base/core/proto/android/os/enums.proto.
1031 optional android.os.BatteryPluggedStateEnum state = 1;
Bookatz8c6571b2017-10-24 15:04:41 -07001032}
1033
Bookatz8c6571b2017-10-24 15:04:41 -07001034/**
1035 * Logs when an app's wakeup alarm fires.
1036 *
1037 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001038 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
Bookatz8c6571b2017-10-24 15:04:41 -07001039 */
1040message WakeupAlarmOccurred {
Yangster-macafad8c62018-01-05 22:30:49 -08001041 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001042
1043 // Name of the wakeup alarm.
1044 optional string tag = 2;
Bookatzcaf2293e2018-09-23 13:07:43 -07001045
1046 // Name of source package (for historical reasons, since BatteryStats tracked it).
1047 optional string package_name = 3;
Ben Murdoch3389f1522019-05-21 15:05:34 +01001048
1049 // These enum values match the STANDBY_BUCKET_XXX constants defined in UsageStatsManager.java.
1050 enum Bucket {
1051 UNKNOWN = 0;
1052 EXEMPTED = 5;
1053 ACTIVE = 10;
1054 WORKING_SET = 20;
1055 FREQUENT = 30;
1056 RARE = 40;
1057 NEVER = 50;
1058 }
1059 // The App Standby bucket of the app that scheduled the alarm at the time the alarm fired.
1060 optional Bucket app_standby_bucket = 4;
Bookatzddccf0a2017-11-28 16:48:14 -08001061}
1062
1063/**
1064 * Logs when an an app causes the mobile radio to change state.
1065 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the mobile radio.
1066 *
1067 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001068 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001069 */
1070message MobileRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001071 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001072
Bookatz1a1b0462018-01-12 11:47:03 -08001073 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1074 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatzddccf0a2017-11-28 16:48:14 -08001075}
1076
1077/**
1078 * Logs when an an app causes the wifi radio to change state.
1079 * Changing from LOW to MEDIUM or HIGH can be considered the app waking the wifi radio.
1080 *
1081 * Logged from:
Bookatz0b028b12018-05-31 16:51:17 -07001082 * frameworks/base/services/core/java/com/android/server/NetworkManagementService.java
Bookatzddccf0a2017-11-28 16:48:14 -08001083 */
1084message WifiRadioPowerStateChanged {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08001085 repeated AttributionNode attribution_node = 1;
Bookatzddccf0a2017-11-28 16:48:14 -08001086
Bookatz1a1b0462018-01-12 11:47:03 -08001087 // Power state, from frameworks/base/core/proto/android/telephony/enums.proto.
1088 optional android.telephony.DataConnectionPowerStateEnum state = 2;
Bookatz8c6571b2017-10-24 15:04:41 -07001089}
1090
1091/**
1092 * Logs kernel wakeup reasons and aborts.
1093 *
1094 * Logged from:
Bookatz56585ca2018-09-07 11:38:45 -07001095 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatz8c6571b2017-10-24 15:04:41 -07001096 */
1097message KernelWakeupReported {
1098 // Name of the kernel wakeup reason (or abort).
1099 optional string wakeup_reason_name = 1;
1100
1101 // Duration (in microseconds) for the wake-up interrupt to be serviced.
David Chen0b5c90c2018-01-25 16:51:49 -08001102 optional int64 duration_micros = 2;
Bookatze5885242017-10-24 20:10:31 -07001103}
1104
1105/**
Bookatzda1798c2018-12-13 14:16:00 -08001106 * Logs when Wifi is toggled on/off.
Bookatza0a1f8a2018-12-17 12:28:32 -08001107 * Note that Wifi may still perform certain functions (e.g. location scanning) even when disabled.
Bookatzda1798c2018-12-13 14:16:00 -08001108 *
1109 * Logged from:
1110 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1111 */
1112message WifiEnabledStateChanged {
1113 enum State {
1114 OFF = 0;
1115 ON = 1;
1116 }
1117 optional State state = 1;
1118}
1119
1120/**
1121 * 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 -08001122 * TODO: Include support for Hotspot, perhaps by using an extra field to denote 'mode'.
1123 * Note that Wifi Scanning is monitored separately in WifiScanStateChanged.
Bookatzda1798c2018-12-13 14:16:00 -08001124 *
1125 * Logged from:
1126 * frameworks/base/services/core/java/com/android/server/am/BatteryStatsService.java
1127 */
1128message WifiRunningStateChanged {
1129 repeated AttributionNode attribution_node = 1;
1130
1131 enum State {
1132 OFF = 0;
1133 ON = 1;
1134 }
1135 optional State state = 2;
1136}
1137
1138/**
Bookatze5885242017-10-24 20:10:31 -07001139 * Logs wifi locks held by an app.
1140 *
1141 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07001142 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07001143 */
1144message WifiLockStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001145 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001146
1147 enum State {
1148 OFF = 0;
1149 ON = 1;
1150 }
1151 optional State state = 2;
Bookatz11257ca2018-12-05 18:22:39 -08001152
1153 // WifiLock type, from frameworks/base/core/proto/android/wifi/enums.proto.
1154 optional android.net.wifi.WifiModeEnum mode = 3;
Bookatze5885242017-10-24 20:10:31 -07001155}
1156
1157/**
1158 * Logs wifi signal strength changes.
1159 *
1160 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001161 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/ClientModeImpl.java
Bookatze5885242017-10-24 20:10:31 -07001162 */
1163message WifiSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08001164 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
1165 optional android.telephony.SignalStrengthEnum signal_strength = 1;
Bookatze5885242017-10-24 20:10:31 -07001166}
1167
1168/**
1169 * Logs wifi scans performed by an app.
1170 *
1171 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001172 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
Bookatze5885242017-10-24 20:10:31 -07001173 */
1174message WifiScanStateChanged {
Yangster-macafad8c62018-01-05 22:30:49 -08001175 repeated AttributionNode attribution_node = 1;
Bookatze5885242017-10-24 20:10:31 -07001176
1177 enum State {
1178 OFF = 0;
1179 ON = 1;
1180 }
1181 optional State state = 2;
1182}
1183
1184/**
Tej Singh4503e102018-01-04 14:35:01 -08001185 * Logs wifi multicast locks held by an app
1186 *
1187 * Logged from:
Bookatz819ea832018-11-28 16:53:31 -08001188 * frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiMulticastLockManager.java
Tej Singh4503e102018-01-04 14:35:01 -08001189 */
1190message WifiMulticastLockStateChanged {
1191 repeated AttributionNode attribution_node = 1;
1192
1193 enum State {
1194 OFF = 0;
1195 ON = 1;
1196 }
1197 optional State state = 2;
Bookatz819ea832018-11-28 16:53:31 -08001198
1199 optional string tag = 3;
Tej Singh4503e102018-01-04 14:35:01 -08001200}
1201
1202/**
Tej Singh1ea42892018-01-19 09:27:00 -08001203 * Logs shutdown reason and duration on next boot.
1204 *
1205 * Logged from:
1206 * frameworks/base/core/java/com/android/server/BootReceiver.java
1207 */
1208message ShutdownSequenceReported {
1209 // True if shutdown is for a reboot. Default: false if we do not know.
1210 optional bool reboot = 1;
1211
1212 // Reason for shutdown. Eg: userrequested. Default: "<EMPTY>".
1213 optional string reason = 2;
1214
1215 // Beginning of shutdown time in ms using wall clock time since unix epoch.
1216 // Default: 0 if no start time received.
David Chen0b5c90c2018-01-25 16:51:49 -08001217 optional int64 start_time_millis = 3;
Tej Singh1ea42892018-01-19 09:27:00 -08001218
1219 // Duration of shutdown in ms. Default: 0 if no duration received.
David Chen0b5c90c2018-01-25 16:51:49 -08001220 optional int64 duration_millis = 4;
Tej Singh1ea42892018-01-19 09:27:00 -08001221}
1222
Tej Singh6483ea42018-01-25 17:45:49 -08001223
1224/**
1225 * Logs boot reason and duration.
1226 *
1227 * Logged from:
1228 * system/core/bootstat/bootstat.cpp
1229 */
1230message BootSequenceReported {
1231 // Reason for bootloader boot. Eg. reboot. See bootstat.cpp for larger list
1232 // Default: "<EMPTY>" if not available.
1233 optional string bootloader_reason = 1;
1234
1235 // Reason for system boot. Eg. bootloader, reboot,userrequested
1236 // Default: "<EMPTY>" if not available.
1237 optional string system_reason = 2;
1238
1239 // End of boot time in ms from unix epoch using system wall clock.
David Chen0b5c90c2018-01-25 16:51:49 -08001240 optional int64 end_time_millis = 3;
Tej Singh6483ea42018-01-25 17:45:49 -08001241
1242 // Total boot duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001243 optional int64 total_duration_millis = 4;
Tej Singh6483ea42018-01-25 17:45:49 -08001244
1245 // Bootloader duration in ms.
David Chen0b5c90c2018-01-25 16:51:49 -08001246 optional int64 bootloader_duration_millis = 5;
Tej Singh6483ea42018-01-25 17:45:49 -08001247
1248 // Time since last boot in ms. Default: 0 if not available.
1249 optional int64 time_since_last_boot = 6;
1250}
1251
Tej Singhc477d9c2018-02-05 18:31:39 -08001252
1253/**
1254 * Logs call state and disconnect cause (if applicable).
1255 *
1256 * Logged from:
1257 * packages/services/Telecomm/src/com/android/server/telecom/Call.java
1258 */
1259message CallStateChanged {
1260 // The state of the call. Eg. DIALING, ACTIVE, ON_HOLD, DISCONNECTED.
1261 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1262 optional android.telecom.CallStateEnum call_state = 1;
1263
1264 // The reason the call disconnected. Eg. ERROR, MISSED, REJECTED, BUSY.
1265 // This value is only applicable when the call_state is DISCONNECTED, and
1266 // should always be UNKNOWN if the call_state is not DISCONNECTED.
1267 // From frameworks/base/core/proto/android/telecomm/enums.proto.
1268 optional android.telecom.DisconnectCauseEnum disconnect_cause = 2;
1269
1270 // True if the call is self-managed, which are apps that use the
1271 // telecom infrastructure to make their own calls.
1272 optional bool self_managed = 3;
1273
1274 // True if call is external. External calls are calls on connected Wear
1275 // devices but show up in Telecom so the user can pull them onto the device.
1276 optional bool external_call = 4;
1277}
1278
Tej Singh1ea42892018-01-19 09:27:00 -08001279/**
Tej Singhdd7bd352018-02-09 19:33:15 -08001280 * Logs keyguard state. The keyguard is the lock screen.
1281 *
1282 * Logged from:
1283 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
1284 */
1285message KeyguardStateChanged {
1286 enum State {
1287 UNKNOWN = 0;
1288 // The keyguard is hidden when the phone is unlocked.
1289 HIDDEN = 1;
1290 // The keyguard is shown when the phone is locked (screen turns off).
1291 SHOWN= 2;
1292 // The keyguard is occluded when something is overlaying the keyguard.
1293 // Eg. Opening the camera while on the lock screen.
1294 OCCLUDED = 3;
1295 }
1296 optional State state = 1;
1297}
1298
1299/**
1300 * Logs keyguard bouncer state. The bouncer is a part of the keyguard, and
1301 * prompts the user to enter a password (pattern, pin, etc).
1302 *
1303 * Logged from:
1304 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java
1305 */
1306
1307message KeyguardBouncerStateChanged {
1308 enum State {
1309 UNKNOWN = 0;
1310 // Bouncer is hidden, either as a result of successfully entering the
1311 // password, screen timing out, or user going back to lock screen.
1312 HIDDEN = 1;
1313 // This is when the user is being prompted to enter the password.
1314 SHOWN = 2;
1315 }
1316 optional State state = 1;
1317}
1318
1319/**
1320 * Logs the result of entering a password into the keyguard bouncer.
1321 *
1322 * Logged from:
1323 * frameworks/base/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainer.java
1324 */
1325message KeyguardBouncerPasswordEntered {
1326 enum BouncerResult {
1327 UNKNOWN = 0;
1328 // The password entered was incorrect.
1329 FAILURE = 1;
1330 // The password entered was correct.
1331 SUCCESS = 2;
1332 }
1333 optional BouncerResult result = 1;
1334}
1335
Tej Singha883b372018-02-15 11:30:01 -08001336/*
1337 * Logs changes to the configuration of the device. The configuration is defined
1338 * in frameworks/base/core/java/android/content/res/Configuration.java
1339 * More documentation is at https://d.android.com/reference/android/content/res/Configuration.html
1340 * Please go there to interpret the possible values each field can be.
1341 *
1342 * Logged from:
1343 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
1344 */
1345message ResourceConfigurationChanged {
1346 // Bit mask of color capabilities of the screen.
1347 // Contains information about the color gamut and hdr mode of the screen.
1348 // See: https://d.android.com/reference/android/content/res/Configuration.html#colorMode
Yangster-maca8a30442018-10-13 23:46:34 -07001349 optional int32 color_mode = 1;
Tej Singha883b372018-02-15 11:30:01 -08001350
1351 // The target screen density being rendered to.
1352 // See: https://d.android.com/reference/android/content/res/Configuration.html#densityDpi
Yangster-maca8a30442018-10-13 23:46:34 -07001353 optional int32 density_dpi = 2;
Tej Singha883b372018-02-15 11:30:01 -08001354
1355 // Current user preference for the scaling factor for fonts,
1356 // relative to the base density scaling.
1357 // See: https://d.android.com/reference/android/content/res/Configuration.html#fontScale
Yangster-maca8a30442018-10-13 23:46:34 -07001358 optional float font_scale = 3;
Tej Singha883b372018-02-15 11:30:01 -08001359
1360 // Flag indicating whether the hard keyboard is hidden.
1361 // See: https://d.android.com/reference/android/content/res/Configuration.html#hardKeyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001362 optional int32 hard_keyboard_hidden = 4;
Tej Singha883b372018-02-15 11:30:01 -08001363
1364 // The type of keyboard attached to the device.
1365 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboard
1366 optional int32 keyboard = 5;
1367
1368 // Flag indicating whether any keyboard is available. Takes soft keyboards into account.
1369 // See: https://d.android.com/reference/android/content/res/Configuration.html#keyboardHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001370 optional int32 keyboard_hidden = 6;
Tej Singha883b372018-02-15 11:30:01 -08001371
1372 // IMSI MCC (Mobile Country Code), corresponding to mcc resource qualifier.
1373 // 0 if undefined.
1374 // See: https://d.android.com/reference/android/content/res/Configuration.html#mcc
1375 optional int32 mcc = 7;
1376
1377 // IMSI MNC (Mobile Network Code), corresponding to mnc resource qualifier.
1378 // 0 if undefined. Note: the actual MNC may be 0, to check for this use the
1379 // MNC_ZERO symbol defined in Configuration.java.
1380 // See: https://d.android.com/reference/android/content/res/Configuration.html#mnc
1381 optional int32 mnc = 8;
1382
1383 // The kind of navigation available on the device.
1384 // See: https://developer.android.com/reference/android/content/res/Configuration.html#navigation
1385 optional int32 navigation = 9;
1386
1387 // Flag indicating whether the navigation is available.
1388 // See: https://d.android.com/reference/android/content/res/Configuration.html#navigationHidden
Yangster-maca8a30442018-10-13 23:46:34 -07001389 optional int32 navigation_hidden = 10;
Tej Singha883b372018-02-15 11:30:01 -08001390
1391 // Overall orientation of the screen.
1392 // See: https://d.android.com/reference/android/content/res/Configuration.html#orientation
1393 optional int32 orientation = 11;
1394
1395 // The current height of the available screen space, in dp units.
1396 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenHeightDp
Yangster-maca8a30442018-10-13 23:46:34 -07001397 optional int32 screen_height_dp = 12;
Tej Singha883b372018-02-15 11:30:01 -08001398
1399 // Bit mask of overall layout of the screen.
1400 // Contains information about screen size, whether the screen is wider/taller
1401 // than normal, whether the screen layout is right-tl-left or left-to-right,
1402 // and whether the screen has a rounded shape.
1403 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenLayout
Yangster-maca8a30442018-10-13 23:46:34 -07001404 optional int32 screen_layout = 13;
Tej Singha883b372018-02-15 11:30:01 -08001405
1406 // Current width of the available screen space, in dp units.
1407 // See: https://d.android.com/reference/android/content/res/Configuration.html#screenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001408 optional int32 screen_width_dp = 14;
Tej Singha883b372018-02-15 11:30:01 -08001409
1410 // The smallest screen size an application will see in normal operation.
1411 // This is the smallest value of both screenWidthDp and screenHeightDp
1412 // in portrait and landscape.
1413 // See: https://d.android.com/reference/android/content/res/Configuration.html#smallestScreenWidthDp
Yangster-maca8a30442018-10-13 23:46:34 -07001414 optional int32 smallest_screen_width_dp = 15;
Tej Singha883b372018-02-15 11:30:01 -08001415
1416 // The type of touch screen attached to the device.
1417 // See: https://d.android.com/reference/android/content/res/Configuration.html#touchscreen
1418 optional int32 touchscreen = 16;
1419
1420 // Bit mask of the ui mode.
1421 // Contains information about the overall ui mode of the device.
1422 // Eg: NORMAL, DESK, CAR, TELEVISION, WATCH, VR_HEADSET
1423 // Also contains information about whether the device is in night mode.
1424 // See: https://d.android.com/reference/android/content/res/Configuration.html#uiMode
Yangster-maca8a30442018-10-13 23:46:34 -07001425 optional int32 ui_mode = 17;
Tej Singha883b372018-02-15 11:30:01 -08001426}
1427
Tej Singheee317b2018-03-07 19:28:05 -08001428
1429/**
1430 * Logs changes in the connection state of the mobile radio.
1431 *
1432 * Logged from:
1433 * frameworks/opt/telephony/src/java/com/android/internal/telephony/dataconnection/DataConnection.java
1434 */
1435message MobileConnectionStateChanged {
1436 // States are from the state machine DataConnection.java.
1437 enum State {
1438 UNKNOWN = 0;
1439 // The connection is inactive, or disconnected.
1440 INACTIVE = 1;
1441 // The connection is being activated, or connecting.
1442 ACTIVATING = 2;
1443 // The connection is active, or connected.
1444 ACTIVE = 3;
1445 // The connection is disconnecting.
1446 DISCONNECTING = 4;
1447 // The connection is disconnecting after creating a connection.
1448 DISCONNECTION_ERROR_CREATING_CONNECTION = 5;
1449 }
1450 optional State state = 1;
1451 // For multi-sim phones, this distinguishes between the sim cards.
1452 optional int32 sim_slot_index = 2;
1453 // Used to identify the connection. Starts at 0 and increments by 1 for
1454 // every new network created. Resets whenever the device reboots.
1455 optional int32 data_connection_id = 3;
1456 // A bitmask for the capabilities of this connection.
1457 // Eg. DEFAULT (internet), MMS, SUPL, DUN, IMS.
1458 // Default value (if we have no information): 0
1459 optional int64 capabilities = 4;
1460 // If this connection has internet.
1461 // This just checks if the DEFAULT bit of capabilities is set.
1462 optional bool has_internet = 5;
1463}
1464
1465/**
1466 * Logs changes in mobile radio technology. eg: LTE, EDGE, CDMA.
1467 *
1468 * Logged from:
1469 * frameworks/opt/telephony/src/java/com/android/internal/telephony/ServiceStateTracker.java
1470 */
1471message MobileRadioTechnologyChanged {
1472 optional android.telephony.NetworkTypeEnum state = 1;
1473 // For multi-sim phones, this distinguishes between the sim cards.
1474 optional int32 sim_slot_index = 2;
1475}
1476
Andrew Chantb56388b2018-03-22 21:07:33 -07001477/**
1478 * Logs the VID and PID of any connected USB devices.
1479 *
1480 * Notes if any Audio, HID (input buttons/mouse/keyboard), or Storage interfaces are present.
1481 *
1482 * Logged by Vendor.
1483 */
1484message UsbDeviceAttached {
1485 optional int32 vid = 1;
1486 optional int32 pid = 2;
1487 optional bool has_audio = 3;
1488 optional bool has_hid = 4;
1489 optional bool has_storage = 5;
Badhri Jagan Sridharan5ec629f2018-11-16 15:39:22 -08001490 enum State {
1491 STATE_DISCONNECTED = 0;
1492 STATE_CONNECTED = 1;
1493 }
1494 optional State state = 6;
Badhri Jagan Sridharanc2c54a22018-12-14 14:41:26 -08001495 optional int64 last_connect_duration_millis = 7;
Andrew Chantb56388b2018-03-22 21:07:33 -07001496}
1497
Tej Singheee317b2018-03-07 19:28:05 -08001498
Tej Singhdd7bd352018-02-09 19:33:15 -08001499/**
Tej Singh5d991e12018-03-09 19:48:11 -08001500 * Logs when Bluetooth is enabled and disabled.
1501 *
1502 * Logged from:
1503 * services/core/java/com/android/server/BluetoothManagerService.java
1504 */
1505message BluetoothEnabledStateChanged {
1506 repeated AttributionNode attribution_node = 1;
1507 // Whether or not bluetooth is enabled on the device.
1508 enum State {
1509 UNKNOWN = 0;
1510 ENABLED = 1;
1511 DISABLED = 2;
1512 }
1513 optional State state = 2;
1514 // The reason for being enabled/disabled.
1515 // Eg. Airplane mode, crash, application request.
1516 optional android.bluetooth.EnableDisableReasonEnum reason = 3;
1517 // If the reason is an application request, this will be the package name.
Yangster-maca8a30442018-10-13 23:46:34 -07001518 optional string pkg_name = 4;
Tej Singh5d991e12018-03-09 19:48:11 -08001519}
1520
1521/**
Jack Hed9837c82019-01-09 01:19:13 -08001522 * Logs when profiles on a Bluetooth device connects and disconnects.
Tej Singh5d991e12018-03-09 19:48:11 -08001523 *
1524 * Logged from:
Jack Hed9837c82019-01-09 01:19:13 -08001525 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
1526 *
1527 * Next Tag: 5
Tej Singh5d991e12018-03-09 19:48:11 -08001528 */
1529message BluetoothConnectionStateChanged {
1530 // The state of the connection.
1531 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1532 optional android.bluetooth.ConnectionStateEnum state = 1;
1533 // An identifier that can be used to match connect and disconnect events.
1534 // Currently is last two bytes of a hash of a device level ID and
1535 // the mac address of the bluetooth device that is connected.
Jack Hed9837c82019-01-09 01:19:13 -08001536 // Deprecated: use obfuscated_id instead, this one is always 0 for Q+
Jack Heac33c992019-04-03 16:08:21 -07001537 optional int32 obfuscated_id = 2 [deprecated = true];
Tej Singh5d991e12018-03-09 19:48:11 -08001538 // The profile that is connected. Eg. GATT, A2DP, HEADSET.
1539 // From android.bluetooth.BluetoothAdapter.java
Jack Hed9837c82019-01-09 01:19:13 -08001540 // Default: 0 when not used
Tej Singh5d991e12018-03-09 19:48:11 -08001541 optional int32 bt_profile = 3;
Jack Hed9837c82019-01-09 01:19:13 -08001542 // An identifier that can be used to match events for this device.
1543 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1544 // Salt: Randomly generated 256 bit value
1545 // Hash algorithm: HMAC-SHA256
1546 // Size: 32 byte
1547 // Default: null or empty if the device identifier is not known
Jack Heac33c992019-04-03 16:08:21 -07001548 optional bytes new_obfuscated_id = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hed9837c82019-01-09 01:19:13 -08001549}
1550
1551/**
1552 * Logs when a Bluetooth device connects and disconnects over ACL
1553 *
1554 * Logged from:
1555 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/AdapterProperties.java
1556 *
1557 * Next Tag: 3
1558 */
1559message BluetoothAclConnectionStateChanged {
1560 // An identifier that can be used to match events for this device.
1561 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1562 // Salt: Randomly generated 256 bit value
1563 // Hash algorithm: HMAC-SHA256
1564 // Size: 32 byte
1565 // Default: null or empty if the device identifier is not known
1566 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1567 // The state of the connection.
1568 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1569 optional android.bluetooth.ConnectionStateEnum state = 2;
1570}
1571
1572/**
1573 * Logs when a Bluetooth device connects and disconnects over SCO
1574 *
1575 * Logged from:
1576 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
1577 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetClientStateMachine.java
1578 *
1579 * Next Tag: 4
1580 */
1581message BluetoothScoConnectionStateChanged {
1582 // An identifier that can be used to match events for this device.
1583 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1584 // Salt: Randomly generated 256 bit value
1585 // Hash algorithm: HMAC-SHA256
1586 // Size: 32 byte
1587 // Default: null or empty if the device identifier is not known
1588 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1589 // The state of the connection.
1590 // Eg: CONNECTING, CONNECTED, DISCONNECTING, DISCONNECTED.
1591 optional android.bluetooth.ConnectionStateEnum state = 2;
1592 // Codec used for this SCO connection
1593 // Default: UNKNOWN
1594 optional android.bluetooth.hfp.ScoCodec codec = 3;
Tej Singh5d991e12018-03-09 19:48:11 -08001595}
1596
Jack Hec27040a2019-01-09 20:54:41 -08001597/**
1598 * Logged when active device of a profile changes
1599 *
1600 * Logged from:
1601 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1602 * packages/apps/Bluetooth/src/com/android/bluetooth/hfp/HeadsetService.java
1603 * packages/apps/Bluetooth/src/com/android/bluetooth/hearingaid/HearingAidService.java
1604 */
1605message BluetoothActiveDeviceChanged {
1606 // The profile whose active device has changed. Eg. A2DP, HEADSET, HEARING_AID
1607 // From android.bluetooth.BluetoothProfile
1608 optional int32 bt_profile = 1;
1609 // An identifier that can be used to match events for this new active device.
1610 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1611 // Salt: Randomly generated 256 bit value
1612 // Hash algorithm: HMAC-SHA256
1613 // Size: 32 byte
1614 // Default: null or empty if there is no active device for this profile
1615 optional bytes obfuscated_id = 2 [(android.os.statsd.log_mode) = MODE_BYTES];
1616}
1617
Jack Heab86dbd22018-12-18 15:43:27 -08001618// Logs when there is an event affecting Bluetooth device's link layer connection.
1619// - This event is triggered when there is a related HCI command or event
1620// - Users of this metrics can deduce Bluetooth device's connection state from these events
1621// - HCI commands are logged before the command is sent, after receiving command status, and after
1622// receiving command complete
1623// - HCI events are logged when they arrive
1624//
1625// Low level log from system/bt
1626//
1627// Bluetooth classic commands:
1628// - CMD_CREATE_CONNECTION
1629// - CMD_DISCONNECT
1630// - CMD_CREATE_CONNECTION_CANCEL
1631// - CMD_ACCEPT_CONNECTION_REQUEST
1632// - CMD_REJECT_CONNECTION_REQUEST
1633// - CMD_SETUP_ESCO_CONNECTION
1634// - CMD_ACCEPT_ESCO_CONNECTION
1635// - CMD_REJECT_ESCO_CONNECTION
1636// - CMD_ENH_SETUP_ESCO_CONNECTION
1637// - CMD_ENH_ACCEPT_ESCO_CONNECTION
1638//
1639// Bluetooth low energy commands:
1640// - CMD_BLE_CREATE_LL_CONN [Only logged on error or when initiator filter policy is 0x00]
1641// - CMD_BLE_CREATE_CONN_CANCEL [Only logged when there is an error]
1642// - CMD_BLE_EXTENDED_CREATE_CONNECTION [Only logged on error or when initiator filter policy is 0x00]
1643// - CMD_BLE_CLEAR_WHITE_LIST
1644// - CMD_BLE_ADD_WHITE_LIST
1645// - CMD_BLE_REMOVE_WHITE_LIST
1646//
1647// Bluetooth classic events:
1648// - EVT_CONNECTION_COMP
1649// - EVT_CONNECTION_REQUEST
1650// - EVT_DISCONNECTION_COMP
1651// - EVT_ESCO_CONNECTION_COMP
1652// - EVT_ESCO_CONNECTION_CHANGED
1653//
1654// Bluetooth low energy meta events:
1655// - BLE_EVT_CONN_COMPLETE_EVT
1656// - BLE_EVT_ENHANCED_CONN_COMPLETE_EVT
1657//
1658// Next tag: 10
1659message BluetoothLinkLayerConnectionEvent {
1660 // An identifier that can be used to match events for this device.
1661 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1662 // Salt: Randomly generated 256 bit value
1663 // Hash algorithm: HMAC-SHA256
1664 // Size: 32 byte
1665 // Default: null or empty if the device identifier is not known
1666 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1667 // Connection handle of this connection if available
1668 // Range: 0x0000 - 0x0EFF (12 bits)
1669 // Default: 0xFFFF if the handle is unknown
1670 optional int32 connection_handle = 2;
1671 // Direction of the link
1672 // Default: DIRECTION_UNKNOWN
1673 optional android.bluetooth.DirectionEnum direction = 3;
1674 // Type of this link
1675 // Default: LINK_TYPE_UNKNOWN
1676 optional android.bluetooth.LinkTypeEnum type = 4;
1677
1678 // Reason metadata for this link layer connection event, rules for interpretation:
1679 // 1. If hci_cmd is set and valid, hci_event can be either EVT_COMMAND_STATUS or
1680 // EVT_COMMAND_COMPLETE, ignore hci_ble_event in this case
1681 // 2. If hci_event is set to EVT_BLE_META, look at hci_ble_event; otherwise, if hci_event is
1682 // set and valid, ignore hci_ble_event
1683
1684 // HCI command associated with this event
1685 // Default: CMD_UNKNOWN
1686 optional android.bluetooth.hci.CommandEnum hci_cmd = 5;
1687 // HCI event associated with this event
1688 // Default: EVT_UNKNOWN
1689 optional android.bluetooth.hci.EventEnum hci_event = 6;
1690 // HCI BLE meta event associated with this event
1691 // Default: BLE_EVT_UNKNOWN
1692 optional android.bluetooth.hci.BleMetaEventEnum hci_ble_event = 7;
1693 // HCI command status code if this is triggerred by hci_cmd
1694 // Default: STATUS_UNKNOWN
1695 optional android.bluetooth.hci.StatusEnum cmd_status = 8;
1696 // HCI reason code associated with this event
1697 // Default: STATUS_UNKNOWN
1698 optional android.bluetooth.hci.StatusEnum reason_code = 9;
1699}
1700
Howard Roe103fe22019-01-17 16:52:16 -08001701/**
1702 * Logs when a module is rolled back by Watchdog.
1703 *
1704 * Logged from: Rollback Manager
1705 */
1706message WatchdogRollbackOccurred {
1707 enum RollbackType {
1708 UNKNOWN = 0;
1709 ROLLBACK_INITIATE = 1;
1710 ROLLBACK_SUCCESS = 2;
1711 ROLLBACK_FAILURE = 3;
Howard Roe4d6fed2019-03-04 16:54:19 -08001712 ROLLBACK_BOOT_TRIGGERED = 4;
Howard Roe103fe22019-01-17 16:52:16 -08001713 }
1714 optional RollbackType rollback_type = 1;
1715
1716 optional string package_name = 2;
1717
1718 optional int32 package_version_code = 3;
Gavin Corkerydd1daba2019-11-27 19:11:13 +00001719
1720 enum RollbackReasonType {
1721 REASON_UNKNOWN = 0;
1722 REASON_NATIVE_CRASH = 1;
1723 REASON_EXPLICIT_HEALTH_CHECK = 2;
1724 REASON_APP_CRASH = 3;
1725 REASON_APP_NOT_RESPONDING = 4;
1726 }
1727 optional RollbackReasonType rollback_reason = 4;
1728
1729 // Set by RollbackPackageHealthObserver to be the package that is failing when a rollback
1730 // is initiated. Empty if the package is unknown.
1731 optional string failing_package_name = 5;
Howard Roe103fe22019-01-17 16:52:16 -08001732}
1733
Jack Hec27040a2019-01-09 20:54:41 -08001734/**
1735 * Logs when there is a change in Bluetooth A2DP playback state
1736 *
1737 * Logged from:
1738 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1739 */
1740message BluetoothA2dpPlaybackStateChanged {
1741 // An identifier that can be used to match events for this device.
1742 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1743 // Salt: Randomly generated 256 bit value
1744 // Hash algorithm: HMAC-SHA256
1745 // Size: 32 byte
1746 // Default: null or empty if the device identifier is not known
1747 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1748 // Current playback state
1749 // Default: PLAYBACK_STATE_UNKNOWN
1750 optional android.bluetooth.a2dp.PlaybackStateEnum playback_state = 2;
1751 // Current audio coding mode
1752 // Default: AUDIO_CODING_MODE_UNKNOWN
1753 optional android.bluetooth.a2dp.AudioCodingModeEnum audio_coding_mode = 3;
1754}
1755
1756/**
1757 * Logs when there is a change in A2DP codec config for a particular remote device
1758 *
1759 * Logged from:
1760 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1761 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1762 */
1763message BluetoothA2dpCodecConfigChanged {
1764 // An identifier that can be used to match events for this device.
1765 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1766 // Salt: Randomly generated 256 bit value
1767 // Hash algorithm: HMAC-SHA256
1768 // Size: 32 byte
1769 // Default: null or empty if the device identifier is not known
1770 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1771 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1772 // Default SOURCE_CODEC_TYPE_INVALID
1773 optional int32 codec_type = 2;
1774 // Codec priroity, the higher the more preferred, -1 for disabled
1775 // Default: CODEC_PRIORITY_DEFAULT
1776 optional int32 codec_priority = 3;
1777 // Sample rate in Hz as defined by various SAMPLE_RATE_* constants in BluetoothCodecConfig
1778 // Default: SAMPLE_RATE_NONE
1779 optional int32 sample_rate = 4;
1780 // Bits per sample as defined by various BITS_PER_SAMPLE_* constants in BluetoothCodecConfig
1781 // Default: BITS_PER_SAMPLE_NONE
1782 optional int32 bits_per_sample = 5;
1783 // Channel mode as defined by various CHANNEL_MODE_* constants in BluetoothCodecConfig
1784 // Default: CHANNEL_MODE_NONE
1785 optional int32 channel_mode = 6;
1786 // Codec specific values
1787 // Default 0
1788 optional int64 codec_specific_1 = 7;
1789 optional int64 codec_specific_2 = 8;
1790 optional int64 codec_specific_3 = 9;
1791 optional int64 codec_specific_4 = 10;
1792}
1793
1794/**
1795 * Logs when there is a change in selectable A2DP codec capability for a paricular remote device
1796 * Each codec's capability is logged separately due to statsd restriction
1797 *
1798 * Logged from:
1799 * frameworks/base/core/java/android/bluetooth/BluetoothCodecConfig.java
1800 * packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpService.java
1801 */
1802message BluetoothA2dpCodecCapabilityChanged {
1803 // An identifier that can be used to match events for this device.
1804 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1805 // Salt: Randomly generated 256 bit value
1806 // Hash algorithm: HMAC-SHA256
1807 // Size: 32 byte
1808 // Default: null or empty if the device identifier is not known
1809 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1810 // Type of codec as defined by various SOURCE_CODEC_TYPE_* constants in BluetoothCodecConfig
1811 // Default SOURCE_CODEC_TYPE_INVALID
1812 optional int32 codec_type = 2;
1813 // Codec priroity, the higher the more preferred, -1 for disabled
1814 // Default: CODEC_PRIORITY_DEFAULT
1815 optional int32 codec_priority = 3;
1816 // A bit field of supported sample rates as defined by various SAMPLE_RATE_* constants
1817 // in BluetoothCodecConfig
1818 // Default: empty and SAMPLE_RATE_NONE for individual item
1819 optional int32 sample_rate = 4;
1820 // A bit field of supported bits per sample as defined by various BITS_PER_SAMPLE_* constants
1821 // in BluetoothCodecConfig
1822 // Default: empty and BITS_PER_SAMPLE_NONE for individual item
1823 optional int32 bits_per_sample = 5;
1824 // A bit field of supported channel mode as defined by various CHANNEL_MODE_* constants in
1825 // BluetoothCodecConfig
1826 // Default: empty and CHANNEL_MODE_NONE for individual item
1827 optional int32 channel_mode = 6;
1828 // Codec specific values
1829 // Default 0
1830 optional int64 codec_specific_1 = 7;
1831 optional int64 codec_specific_2 = 8;
1832 optional int64 codec_specific_3 = 9;
1833 optional int64 codec_specific_4 = 10;
1834}
1835
1836/**
1837 * Logs when A2DP failed to read from PCM source.
1838 * This typically happens when audio HAL cannot supply A2DP with data fast enough for encoding.
1839 *
1840 * Logged from:
1841 * system/bt
1842 */
1843message BluetoothA2dpAudioUnderrunReported {
1844 // An identifier that can be used to match events for this device.
1845 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1846 // Salt: Randomly generated 256 bit value
1847 // Hash algorithm: HMAC-SHA256
1848 // Size: 32 byte
1849 // Default: null or empty if the device identifier is not known
1850 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1851 // Encoding interval in nanoseconds
1852 // Default: 0
1853 optional int64 encoding_interval_nanos = 2;
1854 // Number of bytes of PCM data that could not be read from the source
1855 // Default: 0
1856 optional int32 num_missing_pcm_bytes = 3;
1857}
1858
1859/**
1860 * Logs when A2DP failed send encoded data to the remote device fast enough such that the transmit
1861 * buffer queue is full and we have to drop data
1862 *
1863 * Logged from:
1864 * system/bt
1865 */
1866message BluetoothA2dpAudioOverrunReported {
1867 // An identifier that can be used to match events for this device.
1868 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1869 // Salt: Randomly generated 256 bit value
1870 // Hash algorithm: HMAC-SHA256
1871 // Size: 32 byte
1872 // Default: null or empty if the device identifier is not known
1873 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1874 // Encoding interval in nanoseconds
1875 // Default: 0
1876 optional int64 encoding_interval_nanos = 2;
1877 // Number of buffers dropped in this event
1878 // Each buffer is encoded in one encoding interval and consists of multiple encoded frames
1879 // Default: 0
1880 optional int32 num_dropped_buffers = 3;
1881 // Number of encoded buffers dropped in this event
1882 // Default 0
1883 optional int32 num_dropped_encoded_frames = 4;
1884 // Number of encoded bytes dropped in this event
1885 // Default: 0
1886 optional int32 num_dropped_encoded_bytes = 5;
1887}
1888
1889/**
1890 * Logs when we receive reports regarding a device's RSSI value
1891 *
1892 * Logged from:
1893 * system/bt
1894 */
1895message BluetoothDeviceRssiReported {
1896 // An identifier that can be used to match events for this device.
1897 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1898 // Salt: Randomly generated 256 bit value
1899 // Hash algorithm: HMAC-SHA256
1900 // Size: 32 byte
1901 // Default: null or empty if the device identifier is not known
1902 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1903 // Connection handle of this connection if available
1904 // Range: 0x0000 - 0x0EFF (12 bits)
1905 // Default: 0xFFFF if the handle is unknown
1906 optional int32 connection_handle = 2;
1907 // HCI command status code if this is triggerred by hci_cmd
1908 // Default: STATUS_UNKNOWN
1909 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1910 // BR/EDR
1911 // Range: -128 ≤ N ≤ 127 (signed integer)
1912 // Units: dB
1913 // LE:
1914 // Range: -127 to 20, 127 (signed integer)
1915 // Units: dBm
1916 // Invalid when an out of range value is reported
1917 optional int32 rssi = 4;
1918}
1919
1920/**
1921 * Logs when we receive reports regarding how many consecutive failed contacts for a connection
1922 *
1923 * Logged from:
1924 * system/bt
1925 */
1926message BluetoothDeviceFailedContactCounterReported {
1927 // An identifier that can be used to match events for this device.
1928 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1929 // Salt: Randomly generated 256 bit value
1930 // Hash algorithm: HMAC-SHA256
1931 // Size: 32 byte
1932 // Default: null or empty if the device identifier is not known
1933 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1934 // Connection handle of this connection if available
1935 // Range: 0x0000 - 0x0EFF (12 bits)
1936 // Default: 0xFFFF if the handle is unknown
1937 optional int32 connection_handle = 2;
1938 // HCI command status code if this is triggerred by hci_cmd
1939 // Default: STATUS_UNKNOWN
1940 optional android.bluetooth.hci.StatusEnum cmd_status = 3;
1941 // Number of consecutive failed contacts for a connection corresponding to the Handle
1942 // Range: uint16_t, 0-0xFFFF
1943 // Default: 0xFFFFF
1944 optional int32 failed_contact_counter = 4;
1945}
1946
1947/**
1948 * Logs when we receive reports regarding the tranmit power level used for a specific connection
1949 *
1950 * Logged from:
1951 * system/bt
1952 */
1953message BluetoothDeviceTxPowerLevelReported {
1954 // An identifier that can be used to match events for this device.
1955 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
1956 // Salt: Randomly generated 256 bit value
1957 // Hash algorithm: HMAC-SHA256
1958 // Size: 32 byte
1959 // Default: null or empty if the device identifier is not known
1960 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
1961 // Connection handle of this connection if available
1962 // Range: 0x0000 - 0x0EFF (12 bits)
1963 // Default: 0xFFFF if the handle is unknown
1964 optional int32 connection_handle = 2;
Jack He1021a612019-01-20 21:22:46 -08001965 // HCI command status code if this is triggered by hci_cmd
Jack Hec27040a2019-01-09 20:54:41 -08001966 // Default: STATUS_UNKNOWN
1967 optional android.bluetooth.hci.StatusEnum hci_status = 3;
1968 // Range: -30 ≤ N ≤ 20
1969 // Units: dBm
1970 // Invalid when an out of range value is reported
1971 optional int32 transmit_power_level = 4;
1972}
Jack Heab86dbd22018-12-18 15:43:27 -08001973
Tej Singh5d991e12018-03-09 19:48:11 -08001974/**
Jack He1021a612019-01-20 21:22:46 -08001975 * Logs when Bluetooth controller failed to reply with command status within a timeout period after
1976 * receiving an HCI command from the host
1977 *
1978 * Logged from: system/bt
1979 */
1980message BluetoothHciTimeoutReported {
1981 // HCI command associated with this event
1982 // Default: CMD_UNKNOWN
1983 optional android.bluetooth.hci.CommandEnum hci_command = 1;
1984}
1985
1986/**
1987 * Logs when we receive Bluetooth Link Quality Report event from the controller
1988 * See Android Bluetooth HCI specification for more details
1989 *
1990 * Note: all count and bytes field are counted since last event
1991 *
1992 * Logged from: system/bt
1993 */
1994message BluetoothQualityReportReported {
1995 // Quality report ID
1996 // Original type: uint8_t
1997 // Default: BQR_ID_UNKNOWN
1998 optional android.bluetooth.hci.BqrIdEnum quality_report_id = 1;
1999 // Packet type of the connection
2000 // Original type: uint8_t
2001 // Default: BQR_PACKET_TYPE_UNKNOWN
2002 optional android.bluetooth.hci.BqrPacketTypeEnum packet_types = 2;
2003 // Connection handle of the connection
2004 // Original type: uint16_t
2005 optional int32 connection_handle = 3;
2006 // Performing Role for the connection
2007 // Original type: uint8_t
2008 optional int32 connection_role = 4;
2009 // Current Transmit Power Level for the connection. This value is the same as the controller's
2010 // response to the HCI_Read_Transmit_Power_Level HCI command
2011 // Original type: uint8_t
2012 optional int32 tx_power_level = 5;
2013 // Received Signal Strength Indication (RSSI) value for the connection. This value is an
2014 // absolute receiver signal strength value
2015 // Original type: int8_t
2016 optional int32 rssi = 6;
2017 // Signal-to-Noise Ratio (SNR) value for the connection. It is the average SNR of all the
2018 // channels used by the link currently
2019 // Original type: uint8_t
2020 optional int32 snr = 7;
2021 // Indicates the number of unused channels in AFH_channel_map
2022 // Original type: uint8_t
2023 optional int32 unused_afh_channel_count = 8;
2024 // Indicates the number of the channels which are interfered and quality is bad but are still
2025 // selected for AFH
2026 // Original type: uint8_t
2027 optional int32 afh_select_unideal_channel_count = 9;
2028 // Current Link Supervision Timeout Setting
2029 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2030 // Original type: uint16_t
2031 optional int32 lsto = 10;
2032 // Piconet Clock for the specified Connection_Handle. This value is the same as the controller's
2033 // response to HCI_Read_Clock HCI command with the parameter "Which_Clock" of
2034 // 0x01 (Piconet Clock)
2035 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2036 // Original type: uint32_t
2037 optional int64 connection_piconet_clock = 11;
2038 // The count of retransmission
2039 // Original type: uint32_t
2040 optional int64 retransmission_count = 12;
2041 // The count of no RX
2042 // Original type: uint32_t
2043 optional int64 no_rx_count = 13;
2044 // The count of NAK (Negative Acknowledge)
2045 // Original type: uint32_t
2046 optional int64 nak_count = 14;
2047 // Controller timestamp of last TX ACK
2048 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2049 // Original type: uint32_t
2050 optional int64 last_tx_ack_timestamp = 15;
2051 // The count of Flow-off (STOP)
2052 // Original type: uint32_t
2053 optional int64 flow_off_count = 16;
2054 // Controller timestamp of last Flow-on (GO)
2055 // Unit: N * 0.3125 ms (1 Bluetooth Clock)
2056 // Original type: uint32_t
2057 optional int64 last_flow_on_timestamp = 17;
2058 // Buffer overflow count (how many bytes of TX data are dropped) since the last event
2059 // Original type: uint32_t
2060 optional int64 buffer_overflow_bytes = 18;
2061 // Buffer underflow count (in byte) since last event
2062 // Original type: uint32_t
2063 optional int64 buffer_underflow_bytes = 19;
2064}
2065
2066/**
2067 * Logs when a Bluetooth device's manufacturer information is learnt by the Bluetooth stack
2068 *
2069 * Notes:
2070 * - Each event can be partially filled as we might learn different pieces of device
2071 * information at different time
2072 * - Multiple device info events can be combined to give more complete picture
2073 * - When multiple device info events tries to describe the same information, the
2074 * later one wins
2075 *
2076 * Logged from:
2077 * packages/apps/Bluetooth
2078 */
Jack Heaea26982019-04-04 11:19:48 -07002079message BluetoothDeviceInfoReported {
Jack He1021a612019-01-20 21:22:46 -08002080 // An identifier that can be used to match events for this device.
2081 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2082 // Salt: Randomly generated 256 bit value
2083 // Hash algorithm: HMAC-SHA256
2084 // Size: 32 byte
2085 // Default: null or empty if the device identifier is not known
2086 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2087 // Where is this device info obtained from
2088 optional android.bluetooth.DeviceInfoSrcEnum source_type = 2;
2089 // Name of the data source
2090 // For EXTERNAL: package name of the data source
2091 // For INTERNAL: null for general case, component name otherwise
2092 optional string source_name = 3;
2093 // Name of the manufacturer of this device
2094 optional string manufacturer = 4;
2095 // Model of this device
2096 optional string model = 5;
2097 // Hardware version of this device
2098 optional string hardware_version = 6;
2099 // Software version of this device
2100 optional string software_version = 7;
2101}
2102
2103/**
2104 * Logs when we receive Bluetooth Read Remote Version Information Complete Event from the remote
2105 * device, as documented by the Bluetooth Core HCI specification
2106 * Reference: https://www.bluetooth.com/specifications/bluetooth-core-specification
2107 * Vol 2, Part E, Page 1118
2108 *
2109 * Logged from:
2110 * system/bt
2111 */
2112message BluetoothRemoteVersionInfoReported {
2113 // Connection handle of the connection
2114 // Original type: uint16_t
2115 optional int32 connection_handle = 1;
2116 // HCI command status code
2117 // Default: STATUS_UNKNOWN
2118 optional android.bluetooth.hci.StatusEnum hci_status = 2;
2119 // 1 byte Version of current LMP in the remote controller
2120 optional int32 lmp_version = 3;
2121 // 2 bytes LMP manufacturer code of the remote controller
2122 // https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers
2123 optional int32 lmp_manufacturer_code = 4;
2124 // 4 bytes subversion of the LMP in the remote controller
2125 optional int32 lmp_subversion = 5;
2126}
2127
2128/**
2129 * Logs when certain Bluetooth SDP attributes are discovered
2130 * Constant definitions are from:
2131 * https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
2132 *
2133 * Current logged attributes:
2134 * - BluetoothProfileDescriptorList
2135 * - Supported Features Bitmask
2136 *
2137 * Logged from:
2138 * system/bt
2139 */
2140message BluetoothSdpAttributeReported {
2141 // An identifier that can be used to match events for this device.
2142 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2143 // Salt: Randomly generated 256 bit value
2144 // Hash algorithm: HMAC-SHA256
2145 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2146 // Short form UUIDs used to identify Bluetooth protocols, profiles, and service classes
2147 // Original type: uint16_t
2148 optional int32 protocol_uuid = 2;
2149 // Short form UUIDs used to identify Bluetooth SDP attribute types
2150 // Original type: uint16_t
2151 optional int32 attribute_id = 3;
2152 // Attribute value for the particular attribute
2153 optional bytes attribute_value = 4 [(android.os.statsd.log_mode) = MODE_BYTES];
2154}
2155
2156/**
2157 * Logs when bond state of a Bluetooth device changes
2158 *
2159 * Logged from:
2160 * frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
2161 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2162 */
2163message BluetoothBondStateChanged {
2164 // An identifier that can be used to match events for this device.
2165 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2166 // Salt: Randomly generated 256 bit value
2167 // Hash algorithm: HMAC-SHA256
2168 // Size: 32 byte
2169 // Default: null or empty if the device identifier is not known
2170 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2171 // Preferred transport type to remote dual mode device
2172 // Default: TRANSPORT_AUTO means no preference
2173 optional android.bluetooth.TransportTypeEnum transport = 2;
2174 // The type of this Bluetooth device (Classic, LE, or Dual mode)
2175 // Default: UNKNOWN
2176 optional android.bluetooth.DeviceTypeEnum type = 3;
2177 // Current bond state (NONE, BONDING, BONDED)
2178 // Default: BOND_STATE_UNKNOWN
2179 optional android.bluetooth.BondStateEnum bond_state = 4;
2180 // Bonding sub state
2181 // Default: BOND_SUB_STATE_UNKNOWN
2182 optional android.bluetooth.BondSubStateEnum bonding_sub_state = 5;
2183 // Unbond Reason
2184 // Default: UNBOND_REASON_UNKNOWN
2185 optional android.bluetooth.UnbondReasonEnum unbond_reason = 6;
2186}
2187
2188/**
2189 * Logs there is an event related Bluetooth classic pairing
2190 *
2191 * Logged from:
2192 * system/bt
2193 */
2194message BluetoothClassicPairingEventReported {
2195 // An identifier that can be used to match events for this device.
2196 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2197 // Salt: Randomly generated 256 bit value
2198 // Hash algorithm: HMAC-SHA256
2199 // Size: 32 byte
2200 // Default: null or empty if the device identifier is not known
2201 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2202 // Connection handle of this connection if available
2203 // Range: 0x0000 - 0x0EFF (12 bits)
2204 // Default: 0xFFFF if the handle is unknown
2205 optional int32 connection_handle = 2;
2206 // HCI command associated with this event
2207 // Default: CMD_UNKNOWN
2208 optional android.bluetooth.hci.CommandEnum hci_cmd = 3;
2209 // HCI event associated with this event
2210 // Default: EVT_UNKNOWN
2211 optional android.bluetooth.hci.EventEnum hci_event = 4;
2212 // HCI command status code if this is triggerred by hci_cmd
2213 // Default: STATUS_UNKNOWN
2214 optional android.bluetooth.hci.StatusEnum cmd_status = 5;
2215 // HCI reason code associated with this event
2216 // Default: STATUS_UNKNOWN
2217 optional android.bluetooth.hci.StatusEnum reason_code = 6;
Jack He3b259832019-03-20 03:47:29 -07002218 // A status value related to this specific event
2219 // Default: 0
2220 optional int64 event_value = 7;
Jack He1021a612019-01-20 21:22:46 -08002221}
2222
2223/**
2224 * Logs when there is an event related to Bluetooth Security Manager Protocol (SMP)
2225 *
2226 * Logged from:
2227 * system/bt
2228 */
2229message BluetoothSmpPairingEventReported {
2230 // An identifier that can be used to match events for this device.
2231 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2232 // Salt: Randomly generated 256 bit value
2233 // Hash algorithm: HMAC-SHA256
2234 // Size: 32 byte
2235 // Default: null or empty if the device identifier is not known
2236 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2237 // SMP command sent or received over L2CAP
2238 // Default: CMD_UNKNOWN
2239 optional android.bluetooth.smp.CommandEnum smp_command = 2;
2240 // Whether this command is sent or received
2241 // Default: DIRECTION_UNKNOWN
2242 optional android.bluetooth.DirectionEnum direction = 3;
2243 // SMP failure reason code
2244 // Default: PAIRING_FAIL_REASON_DEFAULT
2245 optional android.bluetooth.smp.PairingFailReasonEnum smp_fail_reason = 4;
2246}
2247
2248/**
Jack He815cdba2019-01-30 17:24:55 -08002249 * Logs when a Bluetooth socket’s connection state changed
2250 *
2251 * Logged from:
2252 * system/bt
2253 */
2254message BluetoothSocketConnectionStateChanged {
2255 // An identifier that can be used to match events for this device.
2256 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2257 // Salt: Randomly generated 256 bit value
2258 // Hash algorithm: HMAC-SHA256
2259 // Size: 32 byte
Jack Hee4ae0e72019-02-07 13:52:45 -08002260 // Default: null or empty if this is a server listener socket
Jack He815cdba2019-01-30 17:24:55 -08002261 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
Jack Hee4ae0e72019-02-07 13:52:45 -08002262 // Temporary port of this socket for the current connection or session only
Jack He815cdba2019-01-30 17:24:55 -08002263 // Default 0 when unknown or don't care
2264 optional int32 port = 2;
2265 // Socket type as mentioned in
2266 // frameworks/base/core/java/android/bluetooth/BluetoothSocket.java
2267 // Default: SOCKET_TYPE_UNKNOWN
2268 optional android.bluetooth.SocketTypeEnum type = 3;
2269 // Socket connection state
2270 // Default: SOCKET_CONNECTION_STATE_UNKNOWN
2271 optional android.bluetooth.SocketConnectionstateEnum state = 4;
2272 // Number of bytes sent to remote device during this connection
2273 optional int64 tx_bytes = 5;
2274 // Number of bytes received from remote device during this connection
2275 optional int64 rx_bytes = 6;
Jack Hee4ae0e72019-02-07 13:52:45 -08002276 // Socket owner's UID
2277 optional int32 uid = 7 [(is_uid) = true];
2278 // Server port of this socket, if any. When both |server_port| and |port| fields are populated,
2279 // |port| must be spawned by |server_port|
2280 // Default 0 when unknown or don't care
2281 optional int32 server_port = 8;
2282 // Whether this is a server listener socket
2283 optional android.bluetooth.SocketRoleEnum is_server = 9;
Jack He815cdba2019-01-30 17:24:55 -08002284}
2285
2286/**
Jack He71426802019-04-02 13:32:52 -07002287 * Logs when Class of Device (CoD) value is learnt for a device during pairing or connection
2288 *
2289 * Logged from:
2290 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/BondStateMachine.java
2291 * packages/apps/Bluetooth/src/com/android/bluetooth/btservice/RemoteDevices.java
2292 *
2293 */
2294message BluetoothClassOfDeviceReported {
2295 // An identifier that can be used to match events for this device.
2296 // Currently, this is a salted hash of the MAC address of this Bluetooth device.
2297 // Salt: Randomly generated 256 bit value
2298 // Hash algorithm: HMAC-SHA256
2299 // Size: 32 byte
2300 // Default: null or empty if this is a server listener socket
2301 optional bytes obfuscated_id = 1 [(android.os.statsd.log_mode) = MODE_BYTES];
2302 // Class of Device (CoD) value including both Major, Minor device class and service class
2303 // Defined in: https://www.bluetooth.com/specifications/assigned-numbers/baseband
2304 // Also defined in: https://developer.android.com/reference/android/bluetooth/BluetoothClass
2305 // Default: 0
2306 optional int32 class_of_device = 2;
2307}
2308
2309/**
Andrew Chant28d627e2018-02-22 15:17:05 -08002310 * Logs when something is plugged into or removed from the USB-C connector.
2311 *
2312 * Logged from:
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002313 * UsbService
Andrew Chant28d627e2018-02-22 15:17:05 -08002314 */
2315message UsbConnectorStateChanged {
2316 enum State {
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002317 STATE_DISCONNECTED = 0;
2318 STATE_CONNECTED = 1;
Andrew Chant28d627e2018-02-22 15:17:05 -08002319 }
2320 optional State state = 1;
Badhri Jagan Sridharan223b3c72018-11-16 16:02:35 -08002321 optional string id = 2;
Badhri Jagan Sridharanfaf62072018-11-16 17:17:03 -08002322 // Last active session in ms.
2323 // 0 when the port is in connected state.
2324 optional int64 last_connect_duration_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002325}
2326
2327/**
2328 * Logs the reported speaker impedance.
2329 *
2330 * Logged from:
2331 * Vendor audio implementation.
2332 */
2333message SpeakerImpedanceReported {
2334 optional int32 speaker_location = 1;
2335 optional int32 impedance = 2;
2336}
2337
2338/**
2339 * Logs the report of a failed hardware.
2340 *
2341 * Logged from:
2342 * Vendor HALs.
2343 *
2344 */
2345message HardwareFailed {
2346 enum HardwareType {
2347 HARDWARE_FAILED_UNKNOWN = 0;
2348 HARDWARE_FAILED_MICROPHONE = 1;
2349 HARDWARE_FAILED_CODEC = 2;
2350 HARDWARE_FAILED_SPEAKER = 3;
2351 HARDWARE_FAILED_FINGERPRINT = 4;
2352 }
2353 optional HardwareType hardware_type = 1;
2354
Maggie White6dcd8572019-01-31 14:11:50 -08002355 /**
2356 * hardware_location allows vendors to differentiate between multiple instances of
Andrew Chant28d627e2018-02-22 15:17:05 -08002357 * the same hardware_type. The specific locations are vendor defined integers,
2358 * referring to board-specific numbering schemes.
2359 */
2360 optional int32 hardware_location = 2;
2361
Maggie White6dcd8572019-01-31 14:11:50 -08002362 /**
2363 * failure_code is specific to the HardwareType of the failed hardware.
2364 * It should use one of the enum values defined below.
Andrew Chant28d627e2018-02-22 15:17:05 -08002365 */
Maggie White6dcd8572019-01-31 14:11:50 -08002366 enum HardwareErrorCode {
2367 UNKNOWN = 0;
2368 COMPLETE = 1;
2369 SPEAKER_HIGH_Z = 2;
2370 SPEAKER_SHORT = 3;
2371 FINGERPRINT_SENSOR_BROKEN = 4;
2372 FINGERPRINT_TOO_MANY_DEAD_PIXELS = 5;
Maggie Whiteb76cebc2019-02-05 15:21:29 -08002373 DEGRADE = 6;
Andrew Chant28d627e2018-02-22 15:17:05 -08002374 }
2375 optional int32 failure_code = 3;
2376}
2377
2378/**
2379 * Log an event when the device has been physically dropped.
2380 * Reported from the /vendor partition.
2381 */
2382message PhysicalDropDetected {
2383 // Confidence that the event was actually a drop, 0 -> 100
2384 optional int32 confidence_pctg = 1;
2385 // Peak acceleration of the drop, in 1/1000s of a g.
2386 optional int32 accel_peak_thousandths_g = 2;
Andrew Chantb56388b2018-03-22 21:07:33 -07002387 // Duration of freefall in ms
2388 optional int32 freefall_time_millis = 3;
Andrew Chant28d627e2018-02-22 15:17:05 -08002389}
2390
2391/**
2392 * Log bucketed battery charge cycles.
2393 *
2394 * Each bucket represents cycles of the battery past
Maggie White38c9d322018-11-20 10:07:52 -08002395 * a given charge point. For example, if 10 cycle buckets are
2396 * initialized, bucket 1 is the lowest 1/10th of the battery,
2397 * and bucket 10 is 100%.
Andrew Chant28d627e2018-02-22 15:17:05 -08002398 *
2399 * Logged from:
2400 * /sys/class/power_supply/bms/cycle_count, via Vendor.
2401 */
2402message ChargeCyclesReported {
2403 optional int32 cycle_bucket_1 = 1;
2404 optional int32 cycle_bucket_2 = 2;
2405 optional int32 cycle_bucket_3 = 3;
2406 optional int32 cycle_bucket_4 = 4;
2407 optional int32 cycle_bucket_5 = 5;
2408 optional int32 cycle_bucket_6 = 6;
2409 optional int32 cycle_bucket_7 = 7;
2410 optional int32 cycle_bucket_8 = 8;
Maggie White38c9d322018-11-20 10:07:52 -08002411 optional int32 cycle_bucket_9 = 9;
2412 optional int32 cycle_bucket_10 = 10;
Andrew Chant28d627e2018-02-22 15:17:05 -08002413}
2414
2415/**
Howard Roa46b6582018-09-18 16:45:02 -07002416 * Log battery health snapshot.
2417 *
2418 * Resistance, Voltage, Open Circuit Voltage, Temperature, and Charge Level
2419 * are snapshotted periodically over 24hrs.
2420 */
2421message BatteryHealthSnapshot {
2422 enum BatterySnapshotType {
2423 UNKNOWN = 0;
2424 MIN_TEMP = 1; // Snapshot at min batt temp over 24hrs.
2425 MAX_TEMP = 2; // Snapshot at max batt temp over 24hrs.
2426 MIN_RESISTANCE = 3; // Snapshot at min batt resistance over 24hrs.
2427 MAX_RESISTANCE = 4; // Snapshot at max batt resistance over 24hrs.
2428 MIN_VOLTAGE = 5; // Snapshot at min batt voltage over 24hrs.
2429 MAX_VOLTAGE = 6; // Snapshot at max batt voltage over 24hrs.
2430 MIN_CURRENT = 7; // Snapshot at min batt current over 24hrs.
2431 MAX_CURRENT = 8; // Snapshot at max batt current over 24hrs.
2432 MIN_BATT_LEVEL = 9; // Snapshot at min battery level (SoC) over 24hrs.
2433 MAX_BATT_LEVEL = 10; // Snapshot at max battery level (SoC) over 24hrs.
2434 AVG_RESISTANCE = 11; // Snapshot at average battery resistance over 24hrs.
2435 }
2436 optional BatterySnapshotType type = 1;
2437 // Temperature, in 1/10ths of degree C.
Yangster-maca8a30442018-10-13 23:46:34 -07002438 optional int32 temperature_deci_celsius = 2;
Howard Roa46b6582018-09-18 16:45:02 -07002439 // Voltage Battery Voltage, in microVolts.
2440 optional int32 voltage_micro_volt = 3;
2441 // Current Battery current, in microAmps.
2442 optional int32 current_micro_amps = 4;
2443 // OpenCircuitVoltage Battery Open Circuit Voltage, in microVolts.
2444 optional int32 open_circuit_micro_volt = 5;
2445 // Resistance Battery Resistance, in microOhms.
2446 optional int32 resistance_micro_ohm = 6;
2447 // Level Battery Level, as % of full.
2448 optional int32 level_percent = 7;
2449}
2450
2451/**
2452 * Log slow I/O operations on the primary storage.
2453 */
2454message SlowIo {
2455 // Classifications of IO Operations.
2456 enum IoOperation {
2457 UNKNOWN = 0;
2458 READ = 1;
2459 WRITE = 2;
2460 UNMAP = 3;
2461 SYNC = 4;
2462 }
2463 optional IoOperation operation = 1;
2464
2465 // The number of slow IO operations of this type over 24 hours.
2466 optional int32 count = 2;
2467}
2468
2469/**
2470 * Log battery caused shutdown with the last recorded voltage.
2471 */
2472message BatteryCausedShutdown {
2473 // The last recorded battery voltage prior to shutdown.
2474 optional int32 last_recorded_micro_volt = 1;
2475}
2476
2477/**
Tej Singha72344992019-04-17 18:55:08 -07002478 * Logs when ThermalService receives throttling events.
2479 *
2480 * Logged from:
2481 * frameworks/base/services/core/java/com/android/server/stats/StatsCompanionService.java
2482 */
2483message ThermalThrottlingSeverityStateChanged {
2484 // The type of temperature being reported (CPU, GPU, SKIN, etc)
2485 optional android.os.TemperatureTypeEnum sensor_type = 1;
2486
2487 // The name of the temperature source. Eg. CPU0
2488 optional string sensor_name = 2;
2489
2490 // Temperature in tenths of a degree C.
2491 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
2492 optional int32 temperature_deci_celsius = 3;
2493
2494 // Relative severity of the throttling, see enum definition.
2495 optional android.os.ThrottlingSeverityEnum severity = 4;
2496}
2497
2498/**
Tej Singhbb8554a2018-01-26 11:59:14 -08002499 * Logs the duration of a davey (jank of >=700ms) when it occurs
2500 *
2501 * Logged from:
2502 * frameworks/base/libs/hwui/JankTracker.cpp
2503 */
2504message DaveyOccurred {
David Chen77ef6712018-02-23 18:23:42 -08002505 // The UID that logged this atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002506 optional int32 uid = 1 [(is_uid) = true];
David Chen77ef6712018-02-23 18:23:42 -08002507
Tej Singhbb8554a2018-01-26 11:59:14 -08002508 // Amount of time it took to render the frame. Should be >=700ms.
David Chen77ef6712018-02-23 18:23:42 -08002509 optional int64 jank_duration_millis = 2;
Tej Singhbb8554a2018-01-26 11:59:14 -08002510}
2511
2512/**
Bookatze5885242017-10-24 20:10:31 -07002513 * Logs phone signal strength changes.
2514 *
2515 * Logged from:
David Chenc28b2bb2017-10-24 12:52:52 -07002516 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
Bookatze5885242017-10-24 20:10:31 -07002517 */
2518message PhoneSignalStrengthChanged {
Bookatz1a1b0462018-01-12 11:47:03 -08002519 // Signal strength, from frameworks/base/core/proto/android/telephony/enums.proto.
2520 optional android.telephony.SignalStrengthEnum signal_strength = 1;
David Chenc28b2bb2017-10-24 12:52:52 -07002521}
2522
Yangster4ccebea2018-10-09 17:09:02 -07002523
2524/**
2525 * Logs when the phone state, sim state or signal strength changes
2526 *
2527 * Logged from:
2528 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
2529 */
2530message PhoneServiceStateChanged {
2531 optional android.telephony.ServiceStateEnum state = 1;
2532 optional android.telephony.SimStateEnum sim_state = 2;
2533 optional android.telephony.SignalStrengthEnum signal_strength = 3;
2534}
2535
2536/**
2537 * Logs when the phone becomes on or off.
2538 *
2539 * Logged from:
2540 * frameworks/base/core/java/com/android/internal/os/TelephonyRegistry.java
2541 */
2542message PhoneStateChanged {
2543 enum State {
2544 OFF = 0;
2545 ON = 1;
2546 }
2547 optional State state = 1;
2548}
2549
Hyunyoung Song2ecb8862019-07-09 09:19:25 -07002550message BackGesture {
2551 enum BackType {
2552 DEFAULT_BACK_TYPE = 0;
2553 COMPLETED = 1;
2554 COMPLETED_REJECTED = 2; // successful because coming from rejected area
2555 INCOMPLETE_EXCLUDED = 3; // would have been successful but in the exclusion area
2556 INCOMPLETE = 4;
2557 }
2558 optional BackType type = 1;
2559
2560 optional int32 y_coordinate = 2; // y coordinate for ACTION_DOWN event
2561 enum WindowHorizontalLocation {
2562 DEFAULT_LOCATION = 0;
2563 LEFT = 1;
2564 RIGHT = 2;
2565 }
2566 optional WindowHorizontalLocation x_location = 3;
2567}
2568
2569message ExclusionRectStateChanged {
2570 optional string component_name = 1; // if not available, simply packageName
2571 optional int32 requested_height = 2; // px
2572 optional int32 rejected_height = 3; // px
2573
2574 enum WindowHorizontalLocation {
2575 DEFAULT_LOCATION = 0;
2576 LEFT = 1;
2577 RIGHT = 2;
2578 }
2579 optional WindowHorizontalLocation x_location = 4;
2580 optional bool landscape = 5;
2581 optional bool splitscreen = 6;
2582 optional int32 duration_millis = 7;
2583}
2584
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002585message LauncherUIChanged {
Yao Chen8c433862018-10-24 14:09:20 -07002586 optional android.stats.launcher.LauncherAction action = 1;
2587 optional android.stats.launcher.LauncherState src_state = 2;
2588 optional android.stats.launcher.LauncherState dst_state = 3;
2589 optional android.stats.launcher.LauncherExtension extension = 4 [(log_mode) = MODE_BYTES];
Hyunyoung Songc6d6b772018-10-17 13:35:32 -07002590 optional bool is_swipe_up_enabled = 5;
2591}
2592
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002593message StyleUIChanged {
2594 optional android.stats.style.Action action = 1;
2595 optional int32 color_package_hash = 2;
2596 optional int32 font_package_hash = 3;
2597 optional int32 shape_package_hash = 4;
2598 optional int32 clock_package_hash = 5;
2599 optional int32 launcher_grid = 6;
2600 optional int32 wallpaper_category_hash = 7;
2601 optional int32 wallpaper_id_hash = 8;
Kunhung Li286c52f2019-05-21 20:10:43 +08002602 optional int32 color_preference = 9;
2603 optional android.stats.style.LocationPreference location_preference = 10;
Hyunyoung Song80adf6be2019-01-30 09:59:30 -08002604}
2605
David Chenc28b2bb2017-10-24 12:52:52 -07002606/**
Fan Zhang916c13b2018-10-16 22:49:45 -07002607 * Logs when Settings UI has changed.
2608 *
2609 * Logged from:
2610 * packages/apps/Settings
2611 */
2612message SettingsUIChanged {
2613 /**
Fan Zhang916c13b2018-10-16 22:49:45 -07002614 * Where this SettingsUIChange event comes from. For example, if
2615 * it's a PAGE_VISIBLE event, where the page is opened from.
2616 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002617 optional android.app.settings.PageId attribution = 1;
Fan Zhang916c13b2018-10-16 22:49:45 -07002618
2619 /**
2620 * What the UI action is.
2621 */
Fan Zhangf837b8e2018-10-23 12:38:30 -07002622 optional android.app.settings.Action action = 2;
Fan Zhang916c13b2018-10-16 22:49:45 -07002623
2624 /**
2625 * Where the action is happening
2626 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002627 optional android.app.settings.PageId page_id = 3;
Fan Zhang916c13b2018-10-16 22:49:45 -07002628
2629 /**
2630 * What preference changed in this event.
2631 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002632 optional string changed_preference_key = 4;
Fan Zhang916c13b2018-10-16 22:49:45 -07002633
2634 /**
2635 * The new value of the changed preference.
2636 */
Fan Zhangff2332b2018-12-06 15:16:41 -08002637 optional int64 changed_preference_int_value = 5;
Fan Zhang916c13b2018-10-16 22:49:45 -07002638}
2639
2640/**
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002641 * Logs basic timing information about touch events.
2642 * Reported at most every 5 minutes while device is being interacted with.
2643 *
2644 * Logged from:
2645 * frameworks/native/services/inputflinger
2646 */
2647message TouchEventReported {
2648 /**
2649 * The fields latency_{min|max|mean|stdev} represent minimum, maximum, mean,
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002650 * and the standard deviation of the time spent processing touchscreen events
2651 * in the kernel and inputflinger. The units are microseconds.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002652 *
Siarhei Vishniakou20d23c02019-08-15 19:32:34 -05002653 * On supported devices, the starting point is taken during the hard interrupt inside the
2654 * kernel touch driver. On all other devices, the starting point is taken inside
2655 * the kernel's input event subsystem upon receipt of the input event.
2656 * The ending point is taken inside InputDispatcher, just after the input event
2657 * is sent to the app.
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002658 */
2659 // Minimum value
2660 optional float latency_min_micros = 1;
2661 // Maximum value
2662 optional float latency_max_micros = 2;
2663 // Average value
2664 optional float latency_mean_micros = 3;
2665 // Standard deviation
2666 optional float latency_stdev_micros = 4;
Siarhei Vishniakouca954f92019-03-22 16:41:14 -07002667 // Number of touch events (input_event) in this report
2668 optional int32 count = 5;
Siarhei Vishniakou3ddecff2018-11-08 19:57:13 -08002669}
2670
2671/**
Philip Quinn0eded622019-01-29 12:46:28 -08002672 * Logs gesture classification and timing information for touch events.
2673 *
2674 * Logged from:
2675 * frameworks/base/core/java/android/view/GestureDetector.java
2676 * frameworks/base/core/java/android/view/View.java
2677 */
2678message TouchGestureClassified {
2679 // The source of the classification (e.g. Java class name).
2680 optional string source = 1;
2681
2682 enum Classification {
2683 UNKNOWN_CLASSIFICATION = 0;
2684 SINGLE_TAP = 1;
2685 DOUBLE_TAP = 2;
2686 LONG_PRESS = 3;
2687 DEEP_PRESS = 4;
2688 SCROLL = 5;
2689 }
2690 // The classification of the gesture.
2691 optional Classification classification = 2;
2692
2693 // The interval from the start of a touch event stream until the
2694 // classification was made.
2695 optional int32 latency_millis = 3;
2696
2697 // The distance from the location of the first touch event to the
2698 // location of the touch event when the classification was made.
2699 optional float displacement_px = 4;
2700}
2701
2702/**
David Chenc28b2bb2017-10-24 12:52:52 -07002703 * Logs that a setting was updated.
2704 * Logged from:
David Chenbd789912018-03-16 17:19:55 -07002705 * frameworks/base/packages/SettingsProvider/src/com/android/providers/settings/SettingsState.java
David Chenc28b2bb2017-10-24 12:52:52 -07002706 * The tag and is_default allow resetting of settings to default values based on the specified
2707 * tag. See Settings#putString(ContentResolver, String, String, String, boolean) for more details.
2708 */
2709message SettingChanged {
2710 // The name of the setting.
2711 optional string setting = 1;
2712
2713 // The change being imposed on this setting. May represent a number, eg "3".
2714 optional string value = 2;
2715
2716 // The new value of this setting. For most settings, this is same as value. For some settings,
2717 // value is +X or -X where X represents an element in a set. For example, if the previous value
2718 // is A,B,C and value is -B, then new_value is A,C and prev_value is A,B,C.
2719 // The +/- feature is currently only used for location_providers_allowed.
2720 optional string new_value = 3;
2721
2722 // The previous value of this setting.
2723 optional string prev_value = 4;
2724
2725 // The tag used with the is_default for resetting sets of settings. This is generally null.
2726 optional string tag = 5;
2727
Bookatz90867622018-01-31 15:05:57 -08002728 // True if this setting with tag should be resettable.
2729 optional bool is_default = 6;
David Chenc28b2bb2017-10-24 12:52:52 -07002730
David Chenbd789912018-03-16 17:19:55 -07002731 // The associated user (for multi-user feature). Defined in android/os/UserHandle.java
David Chenc28b2bb2017-10-24 12:52:52 -07002732 optional int32 user = 7;
David Chenbd789912018-03-16 17:19:55 -07002733
2734 enum ChangeReason {
2735 UPDATED = 1; // Updated can be an insertion or an update.
2736 DELETED = 2;
2737 }
2738 optional ChangeReason reason = 8;
David Chenc28b2bb2017-10-24 12:52:52 -07002739}
Chenjie Yub3dda412017-10-24 13:41:59 -07002740
Chenjie Yu05013b32017-11-21 10:21:41 -08002741/**
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002742 * Logs activity going to foreground or background
2743 *
2744 * Logged from:
2745 * frameworks/base/services/core/java/com/android/server/am/ActivityRecord.java
2746 */
2747message ActivityForegroundStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07002748 optional int32 uid = 1 [(is_uid) = true];
Yangster-mac20877162017-12-22 17:19:39 -08002749 optional string pkg_name = 2;
2750 optional string class_name = 3;
2751
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002752 enum State {
2753 BACKGROUND = 0;
2754 FOREGROUND = 1;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002755 }
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002756 optional State state = 4;
Chenjie Yu3d4f6042017-10-27 15:39:34 -07002757}
David Chenc8a43242017-10-17 16:23:28 -07002758
2759/**
Felix Lopez Luisd95346a2018-12-12 10:32:32 +00002760 * Logs when a volume entered low Storage state.
2761 * Logged from:
2762 * frameworks/base/services/core/java/com/android/server/storage/DeviceStorageMonitorService.java
2763 */
2764message LowStorageStateChanged {
2765 // Volume that ran out of storage.
2766 optional string volume_description = 1;
2767
2768 enum State {
2769 UNKNOWN = 0;
2770 OFF = 1;
2771 ON = 2;
2772 }
2773 optional State state = 2;
2774}
2775
2776/**
2777 * Logs when an app is downgraded.
2778 * Logged from:
2779 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2780 */
2781message AppDowngraded {
2782 optional string package_name = 1;
2783 // Size of the package (all data) before being downgraded.
2784 optional int64 size_in_bytes_before = 2;
2785 // Size of the package (all data) after being downgraded.
2786 optional int64 size_in_bytes_after = 3;
2787
2788 optional bool aggressive = 4;
2789}
2790
2791/**
2792 * Logs when an app is optimized after being downgraded.
2793 * Logged from:
2794 * frameworks/base/services/core/java/com/android/server/pm/BackgroundDexOptService.java
2795 */
2796message AppOptimizedAfterDowngraded {
2797 optional string package_name = 1;
2798}
2799
2800/**
Carmen Agimof6688a352019-01-30 19:36:04 +00002801 * Logs whenever an app is installed on external storage.
2802 * Logged from:
2803 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
2804 */
2805message AppInstallOnExternalStorageReported {
2806 // The type of external storage.
2807 optional android.stats.storage.ExternalStorageType storage_type = 1;
2808 // The name of the package that is installed on the sd card.
2809 optional string package_name = 2;
2810}
2811
2812/**
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002813 * Logs when an app crashes.
David Chen9e3808c2017-11-20 17:25:34 -08002814 * Logged from:
2815 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2816 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002817message AppCrashOccurred {
Yao Chenc40a19d2018-03-15 16:48:25 -07002818 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002819
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002820 optional string event_type = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002821
2822 // The name of the process.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002823 // system_server if it is not by an app
David Chen9e3808c2017-11-20 17:25:34 -08002824 optional string process_name = 3;
2825
2826 // The pid if available. -1 means not available.
David Chen6e3e6cb2018-01-03 16:14:06 -08002827 optional sint32 pid = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002828
2829 optional string package_name = 5;
2830
2831 enum InstantApp {
2832 UNAVAILABLE = 0;
2833 FALSE = 1;
2834 TRUE = 2;
2835 }
2836 optional InstantApp is_instant_app = 6;
2837
2838 enum ForegroundState {
2839 UNKNOWN = 0;
2840 BACKGROUND = 1;
2841 FOREGROUND = 2;
2842 }
2843 optional ForegroundState foreground_state = 7;
Yang Lu732d6382018-11-05 07:53:12 -08002844
2845 optional android.server.ErrorSource error_source = 8;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002846}
David Chen9e3808c2017-11-20 17:25:34 -08002847
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002848/**
2849 * Logs when a WTF (What a Terrible Failure) happened.
2850 * Logged from:
2851 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2852 */
2853message WTFOccurred {
2854 optional int32 uid = 1 [(is_uid) = true];
David Chen9e3808c2017-11-20 17:25:34 -08002855
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002856 optional string tag = 2;
David Chen9e3808c2017-11-20 17:25:34 -08002857
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002858 // The name of the process.
2859 // system_server if it is not by an app
2860 optional string process_name = 3;
David Chen6e3e6cb2018-01-03 16:14:06 -08002861
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002862 // The pid if available. -1 means not available.
2863 optional sint32 pid = 4;
Yang Lu732d6382018-11-05 07:53:12 -08002864
2865 optional android.server.ErrorSource error_source = 5;
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002866}
2867
2868/**
2869 * Logs when system server reports low memory.
2870 * Logged from:
2871 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
2872 */
2873message LowMemReported {
2874}
2875
2876/**
2877 * Logs when an app ANR (App Not Responding) occurs.
2878 * Logged from:
2879 * frameworks/base/services/core/java/com/android/server/am/AppErrors.java
2880 */
2881message ANROccurred {
2882 optional int32 uid = 1 [(is_uid) = true];
2883
2884 optional string process_name = 2;
2885
2886 optional string short_component_name = 3;
2887
2888 optional string reason = 4;
Chenjie Yuf17bf62f2018-04-02 14:22:19 -07002889
2890 enum InstantApp {
2891 UNAVAILABLE = 0;
2892 FALSE = 1;
2893 TRUE = 2;
2894 }
2895 optional InstantApp is_instant_app = 5;
2896
2897 enum ForegroundState {
2898 UNKNOWN = 0;
2899 BACKGROUND = 1;
2900 FOREGROUND = 2;
2901 }
2902 optional ForegroundState foreground_state = 6;
Yang Lu732d6382018-11-05 07:53:12 -08002903
2904 optional android.server.ErrorSource error_source = 7;
2905
2906 optional string package_name = 8;
David Chen9e3808c2017-11-20 17:25:34 -08002907}
2908
Bookatza7020bd2018-08-28 16:29:35 -07002909/**
2910 * Logs when the vibrator state changes.
2911 * Logged from:
2912 * frameworks/base/services/core/java/com/android/server/VibratorService.java
2913 */
2914message VibratorStateChanged {
2915 repeated AttributionNode attribution_node = 1;
2916
2917 enum State {
2918 OFF = 0;
2919 ON = 1;
2920 }
2921 optional State state = 2;
2922
2923 // Duration (in milliseconds) requested to keep the vibrator on.
2924 // Only applicable for State == ON.
2925 optional int64 duration_millis = 3;
2926}
2927
David Chen0a368b22017-12-06 16:28:16 -08002928/*
2929 * Allows other apps to push events into statsd.
2930 * Logged from:
2931 * frameworks/base/core/java/android/util/StatsLog.java
2932 */
David Chen0b5c90c2018-01-25 16:51:49 -08002933message AppBreadcrumbReported {
David Chen0a368b22017-12-06 16:28:16 -08002934 // The uid of the application that sent this custom atom.
Yao Chenc40a19d2018-03-15 16:48:25 -07002935 optional int32 uid = 1 [(is_uid) = true];
David Chen0a368b22017-12-06 16:28:16 -08002936
2937 // An arbitrary label chosen by the developer. For Android P, the label should be in [0, 16).
2938 optional int32 label = 2;
2939
2940 // Allows applications to easily use a custom event as start/stop boundaries (ie, define custom
2941 // predicates for the metrics).
2942 enum State {
2943 UNKNOWN = 0;
2944 UNSPECIFIED = 1; // For events that are known to not represent START/STOP.
2945 STOP = 2;
2946 START = 3;
2947 }
2948 optional State state = 3;
2949}
2950
David Chen9e3808c2017-11-20 17:25:34 -08002951/**
Bookatz7948c872018-09-04 12:58:33 -07002952 * Logs the wall-clock time when a significant wall-clock time shift occurs.
2953 * For example, this could be due to the user manually changing the time.
2954 *
2955 * Logged from:
2956 * frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
2957 */
2958message WallClockTimeShifted {
2959 // New wall-clock time in milliseconds, according to System.currentTimeMillis().
2960 optional int64 wall_clock_timestamp_millis = 1;
2961}
2962
2963/**
Bookatz8fcd09a2017-12-18 13:01:10 -08002964 * Logs when statsd detects an anomaly.
2965 *
2966 * Logged from:
2967 * frameworks/base/cmds/statsd/src/anomaly/AnomalyTracker.cpp
2968 */
2969message AnomalyDetected {
2970 // Uid that owns the config whose anomaly detection alert fired.
Yao Chenc40a19d2018-03-15 16:48:25 -07002971 optional int32 config_uid = 1 [(is_uid) = true];
Bookatz8fcd09a2017-12-18 13:01:10 -08002972
Yangster-mac94e197c2018-01-02 16:03:03 -08002973 // Id of the config whose anomaly detection alert fired.
2974 optional int64 config_id = 2;
Bookatz8fcd09a2017-12-18 13:01:10 -08002975
Yangster-mac94e197c2018-01-02 16:03:03 -08002976 // Id of the alert (i.e. name of the anomaly that was detected).
2977 optional int64 alert_id = 3;
Bookatz8fcd09a2017-12-18 13:01:10 -08002978}
2979
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002980message AppStartOccurred {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002981 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07002982 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002983
2984 // The app package name.
2985 optional string pkg_name = 2;
2986
2987 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08002988 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00002989 WARM = 1;
2990 HOT = 2;
2991 COLD = 3;
2992 }
2993 // The transition type.
2994 optional TransitionType type = 3;
2995
2996 // The activity name.
2997 optional string activity_name = 4;
2998
2999 // The name of the calling app. Empty if not set.
3000 optional string calling_pkg_name = 5;
3001
3002 // Whether the app is an instant app.
3003 optional bool is_instant_app = 6;
3004
3005 // Device uptime when activity started.
David Chen0b5c90c2018-01-25 16:51:49 -08003006 optional int64 activity_start_millis = 7;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003007
Bookatz80d11a02018-01-16 10:46:35 -08003008 optional android.app.AppTransitionReasonEnum reason = 8;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003009
David Chen0b5c90c2018-01-25 16:51:49 -08003010 optional int32 transition_delay_millis = 9;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003011 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003012 optional int32 starting_window_delay_millis = 10;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003013 // -1 if not set.
David Chen0b5c90c2018-01-25 16:51:49 -08003014 optional int32 bind_application_delay_millis = 11;
3015 optional int32 windows_drawn_delay_millis = 12;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003016
3017 // Empty if not set.
3018 optional string launch_token = 13;
3019
Calin Juravle759fbda2018-02-20 19:52:30 +00003020 // The compiler filter used when when the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003021 optional int32 package_optimization_compilation_filter = 14;
Calin Juravle759fbda2018-02-20 19:52:30 +00003022
3023 // The reason why the package was optimized.
Calin Juravlea86783b2018-03-21 14:25:59 -07003024 optional int32 package_optimization_compilation_reason = 15;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003025}
3026
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003027message AppStartCanceled {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003028 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003029 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003030
3031 // The app package name.
3032 optional string pkg_name = 2;
3033
3034 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003035 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003036 WARM = 1;
3037 HOT = 2;
3038 COLD = 3;
3039 }
3040 // The transition type.
3041 optional TransitionType type = 3;
3042
3043 // The activity name.
3044 optional string activity_name = 4;
3045}
3046
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003047message AppStartFullyDrawn {
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003048 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003049 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003050
3051 // The app package name.
3052 optional string pkg_name = 2;
3053
3054 enum TransitionType {
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003055 UNKNOWN = 0;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003056 WITH_BUNDLE = 1;
3057 WITHOUT_BUNDLE = 2;
3058 }
3059 // The transition type.
3060 optional TransitionType type = 3;
3061
3062 // The activity name.
3063 optional string activity_name = 4;
3064
3065 optional bool transition_process_running = 5;
3066
3067 // App startup time (until call to Activity#reportFullyDrawn()).
David Chen0b5c90c2018-01-25 16:51:49 -08003068 optional int64 app_startup_time_millis = 6;
Olivier Gaillardaed7f122017-12-12 14:26:22 +00003069}
3070
Bookatz8fcd09a2017-12-18 13:01:10 -08003071/**
Chenjie Yu52cacc62017-12-08 18:11:45 -08003072 * Logs a picture-in-picture action
3073 * Logged from:
3074 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3075 * frameworks/base/services/core/java/com/android/server/am/ActivityStackSupervisor.java
3076 * frameworks/base/packages/SystemUI/src/com/android/systemui/pip/phone/PipTouchHandler.java
3077 */
3078message PictureInPictureStateChanged {
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003079 // -1 if it is not available
Yao Chenc40a19d2018-03-15 16:48:25 -07003080 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu52cacc62017-12-08 18:11:45 -08003081
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003082 optional string short_name = 2;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003083
Chenjie Yu52cacc62017-12-08 18:11:45 -08003084 enum State {
3085 ENTERED = 1;
3086 EXPANDED_TO_FULL_SCREEN = 2;
3087 MINIMIZED = 3;
3088 DISMISSED = 4;
3089 }
Chenjie Yuae9fdf042018-02-15 10:19:32 -08003090 optional State state = 3;
Chenjie Yu52cacc62017-12-08 18:11:45 -08003091}
3092
3093/**
Chenjie Yue8904192017-12-08 19:12:57 -08003094 * Logs overlay action
3095 * Logged from:
3096 * services/core/java/com/android/server/wm/Session.java
3097 */
3098message OverlayStateChanged {
tsaichristine10978642019-09-10 14:12:49 -07003099 optional int32 uid = 1 [(state_field_option).option = PRIMARY, (is_uid) = true];
Chenjie Yue8904192017-12-08 19:12:57 -08003100
tsaichristine10978642019-09-10 14:12:49 -07003101 optional string package_name = 2 [(state_field_option).option = PRIMARY];
Chenjie Yue8904192017-12-08 19:12:57 -08003102
3103 optional bool using_alert_window = 3;
3104
3105 enum State {
3106 ENTERED = 1;
3107 EXITED = 2;
3108 }
tsaichristine10978642019-09-10 14:12:49 -07003109 optional State state = 4 [(state_field_option).option = EXCLUSIVE];
Chenjie Yue8904192017-12-08 19:12:57 -08003110}
3111
Chenjie Yuccfe6452018-01-30 11:33:21 -08003112/*
3113 * Logs foreground service starts and stops.
3114 * Note that this is not when a service starts or stops, but when it is
3115 * considered foreground.
3116 * Logged from
3117 * //frameworks/base/services/core/java/com/android/server/am/ActiveServices.java
3118 */
3119message ForegroundServiceStateChanged {
Yao Chenc40a19d2018-03-15 16:48:25 -07003120 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuccfe6452018-01-30 11:33:21 -08003121 // package_name + "/" + class_name
3122 optional string short_name = 2;
3123
3124 enum State {
3125 ENTER = 1;
3126 EXIT = 2;
3127 }
3128 optional State state = 3;
3129}
3130
Chenjie Yue8904192017-12-08 19:12:57 -08003131/**
Chenjie Yubbcbc602018-02-05 16:51:52 -08003132 * Logs creation or removal of an isolated uid. Isolated uid's are temporary uid's to sandbox risky
3133 * behavior in its own uid. However, the metrics of these isolated uid's almost always should be
3134 * attributed back to the parent (host) uid. One example is Chrome.
3135 *
3136 * Logged from:
3137 * frameworks/base/core/java/com/android/internal/os/BatteryStatsImpl.java
3138 */
3139message IsolatedUidChanged {
3140 // The host UID. Generally, we should attribute metrics from the isolated uid to the host uid.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08003141 // NOTE: DO NOT annotate uid field in this atom. This atom is specially handled in statsd.
Bookatz3c648862018-05-25 13:32:43 -07003142 // This field is ignored when event == REMOVED.
Chenjie Yubbcbc602018-02-05 16:51:52 -08003143 optional int32 parent_uid = 1;
3144
3145 optional int32 isolated_uid = 2;
3146
3147 // We expect an isolated uid to be removed before if it's used for another parent uid.
3148 enum Event {
3149 REMOVED = 0;
3150 CREATED = 1;
3151 }
3152 optional Event event = 3;
3153}
3154
3155/*
3156 * Logs the reception of an incoming network packet causing the main system to wake up for
3157 * processing that packet. These events are notified by the kernel via Netlink NFLOG to Netd
3158 * and processed by WakeupController.cpp.
3159 */
3160message PacketWakeupOccurred {
3161 // The uid owning the socket into which the packet was delivered, or -1 if the packet was
3162 // delivered nowhere.
Yao Chenc40a19d2018-03-15 16:48:25 -07003163 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003164 // The interface name on which the packet was received.
3165 optional string iface = 2;
3166 // The ethertype value of the packet.
3167 optional int32 ethertype = 3;
3168 // String representation of the destination MAC address of the packet.
3169 optional string destination_hardware_address = 4;
3170 // String representation of the source address of the packet if this was an IP packet.
3171 optional string source_ip = 5;
3172 // String representation of the destination address of the packet if this was an IP packet.
3173 optional string destination_ip = 6;
3174 // The value of the protocol field if this was an IPv4 packet or the value of the Next Header
3175 // field if this was an IPv6 packet. The range of possible values is the same for both IP
3176 // families.
3177 optional int32 ip_next_header = 7;
3178 // The source port if this was a TCP or UDP packet.
3179 optional int32 source_port = 8;
3180 // The destination port if this was a TCP or UDP packet.
3181 optional int32 destination_port = 9;
3182}
3183
3184/*
3185 * Logs the memory stats for an app on startup.
3186 * Logged from:
3187 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3188 */
3189message AppStartMemoryStateCaptured {
3190 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003191 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003192
3193 // The process name.
3194 optional string process_name = 2;
3195
3196 // The activity name.
3197 optional string activity_name = 3;
3198
3199 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003200 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003201
3202 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003203 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003204
3205 // RSS
3206 optional int64 rss_in_bytes = 6;
3207
3208 // CACHE
3209 optional int64 cache_in_bytes = 7;
3210
3211 // SWAP
3212 optional int64 swap_in_bytes = 8;
3213}
3214
3215/*
3216 * Logs the change in Low Memory Killer Daemon (LMKD) state which is used as start/stop boundaries
3217 * for LMK event.
3218 * Logged from:
3219 * system/core/lmkd/lmkd.c
3220 */
3221message LmkStateChanged {
3222 enum State {
3223 UNKNOWN = 0;
3224 START = 1;
3225 STOP = 2;
3226 }
3227 optional State state = 1;
3228}
3229
3230/*
3231 * Logs the event when Low Memory Killer Daemon (LMKD) kills a process to reduce memory pressure.
3232 * Logged from:
3233 * system/core/lmkd/lmkd.c
3234 */
3235message LmkKillOccurred {
3236 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07003237 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yubbcbc602018-02-05 16:51:52 -08003238
3239 // The process name.
3240 optional string process_name = 2;
3241
3242 // oom adj score.
Yangster-maca8a30442018-10-13 23:46:34 -07003243 optional int32 oom_adj_score = 3;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003244
3245 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003246 optional int64 page_fault = 4;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003247
3248 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07003249 optional int64 page_major_fault = 5;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003250
3251 // RSS
3252 optional int64 rss_in_bytes = 6;
3253
3254 // CACHE
3255 optional int64 cache_in_bytes = 7;
3256
3257 // SWAP
3258 optional int64 swap_in_bytes = 8;
Jim Blackler8593d1f2018-11-21 15:24:48 +00003259
3260 // The elapsed real time of start of the process.
3261 optional int64 process_start_time_nanos = 9;
Suren Baghdasaryan1fbaa1f2019-03-04 11:09:31 -08003262
3263 // Min oom adj score considered by lmkd.
3264 optional int32 min_oom_score = 10;
Chenjie Yubbcbc602018-02-05 16:51:52 -08003265}
3266
Rajeev Kumar51b54602018-03-01 12:18:26 -08003267/*
3268 * Logs when the ActivityManagerService detects that an app died.
3269 *
3270 * Logged from:
3271 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
3272 */
3273message AppDied {
3274 // timestamp(elapsedRealtime) of record creation
Yangster-macb6b77c62018-10-12 19:33:24 -07003275 optional uint64 timestamp_millis = 1 [(state_field_option).option = EXCLUSIVE];
Rajeev Kumar51b54602018-03-01 12:18:26 -08003276}
3277
Howard Ro21a039c2018-08-06 14:55:47 -07003278/**
3279 * An atom for generic metrics logging. Available from Android Q.
3280 */
3281message GenericAtom {
3282 // The uid of the application that sent this custom atom.
3283 optional int32 uid = 1 [(is_uid) = true];
3284
3285 // An event_id indicates the type of event.
Howard Ro9a862de2018-10-11 16:03:33 -07003286 optional android.stats.EventType event_id = 2;
Howard Ro21a039c2018-08-06 14:55:47 -07003287}
3288
Tej Singhd6d6d772018-09-05 17:41:25 -07003289/**
Will Brockmanfbaa7912019-10-24 15:15:09 -04003290 * Atom for simple logging of user interaction and impression events, such as "the user touched
3291 * this button" or "this dialog was displayed".
3292 * Keep the UI event stream clean: don't use for system or background events.
3293 * Log using the UiEventLogger wrapper - don't write with the StatsLog API directly.
Will Brockman079fdaa2020-01-12 16:45:03 -05003294 *
3295 * Logged from:
3296 * frameworks/base/services/core/java/com/android/server/
3297 * frameworks/base/packages/SystemUI/src/com/android/systemui/
Will Brockmanfbaa7912019-10-24 15:15:09 -04003298 */
3299message UiEventReported {
3300 // The event_id.
3301 optional int32 event_id = 1;
3302 // The event's source or target uid and package, if applicable.
3303 // For example, the package posting a notification, or the destination package of a share.
3304 optional int32 uid = 2 [(is_uid) = true];
3305 optional string package_name = 3;
3306}
3307
3308/**
Will Brockman079fdaa2020-01-12 16:45:03 -05003309 * Reports a notification was created or updated.
3310 *
3311 * Logged from:
3312 * frameworks/base/services/core/java/com/android/server/notification/
3313 */
3314message NotificationReported {
3315 // The event_id (as for UiEventReported).
3316 optional int32 event_id = 1;
3317 // The notifying app's uid and package.
3318 optional int32 uid = 2 [(is_uid) = true];
3319 optional string package_name = 3;
3320 // A small system-assigned identifier for the notification.
3321 // Locally probably-unique, but expect collisions across users and/or days.
3322 optional int32 instance_id = 4;
3323 // The app-assigned notification ID and tag
3324 optional int32 notification_id = 5;
3325 optional string notification_tag = 6;
3326 optional string channel_id = 7; // App-assigned channel ID
3327
3328 // Grouping information
3329 optional string group_id = 8; // Group the notification currently belongs to
3330 optional int32 group_instance_id = 9; // Instance_id of the group-summary notification
3331 optional bool is_group_summary = 10; // Tags the group-summary notification
3332
3333 // Attributes
3334 optional string category = 11; // App-assigned notification category (API-defined strings)
3335 optional int32 style = 12; // App-assigned notification style
3336 optional int32 num_people = 13; // Number of Person records attached to the notification
3337
3338 // Ordering, importance and interruptiveness
3339
3340 optional int32 position = 14; // Position in NotificationManager's list
3341
3342 optional android.stats.sysui.NotificationImportance importance = 15;
3343 optional int32 alerting = 16; // Bitfield, 1=buzz 2=beep 4=blink
3344
3345 enum NotificationImportanceExplanation {
3346 IMPORTANCE_EXPLANATION_UNKNOWN = 0;
3347 IMPORTANCE_EXPLANATION_APP = 1; // App-specified channel importance.
3348 IMPORTANCE_EXPLANATION_USER = 2; // User-specified channel importance.
3349 IMPORTANCE_EXPLANATION_ASST = 3; // Notification Assistant override.
3350 IMPORTANCE_EXPLANATION_SYSTEM = 4; // System override.
3351 // Like _APP, but based on pre-channels priority signal.
3352 IMPORTANCE_EXPLANATION_APP_PRE_CHANNELS = 5;
3353 }
3354
3355 optional NotificationImportanceExplanation importance_source = 17;
3356 optional android.stats.sysui.NotificationImportance importance_initial = 18;
3357 optional NotificationImportanceExplanation importance_initial_source = 19;
3358 optional android.stats.sysui.NotificationImportance importance_asst = 20;
3359 optional int32 assistant_hash = 21;
3360 optional float assistant_ranking_score = 22;
3361}
3362
3363message Notification {
3364 // The notifying app's uid and package.
3365 optional int32 uid = 1 [(is_uid) = true];
3366 optional string package_name = 2;
3367 // A small system-assigned identifier for the notification.
3368 optional int32 instance_id = 3;
3369
3370 // Grouping information.
3371 optional int32 group_instance_id = 4;
3372 optional bool is_group_summary = 5;
3373
3374 // The section of the shade that the notification is in.
3375 // See NotificationSectionsManager.PriorityBucket.
3376 enum NotificationSection {
3377 SECTION_UNKNOWN = 0;
3378 SECTION_PEOPLE = 1;
3379 SECTION_ALERTING = 2;
3380 SECTION_SILENT = 3;
3381 }
3382 optional NotificationSection section = 6;
3383}
3384
3385message NotificationList {
3386 repeated Notification notifications = 1; // An ordered sequence of notifications.
3387}
3388
3389/**
3390 * Reports a notification panel was displayed, e.g. from the lockscreen or status bar.
3391 *
3392 * Logged from:
3393 * frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/notification/
3394 */
3395message NotificationPanelReported {
3396 // The event_id (as for UiEventReported).
3397 optional int32 event_id = 1;
3398 optional int32 num_notifications = 2;
3399 // The notifications in the panel, in the order that they appear there.
3400 optional NotificationList notifications = 3 [(log_mode) = MODE_BYTES];
3401}
3402
3403/**
3404 * Reports a notification channel, or channel group, was created, updated, or deleted.
3405 *
3406 * Logged from:
3407 * frameworks/base/services/core/java/com/android/server/notification/
3408 */
3409message NotificationChannelModified {
3410 // The event_id (as for UiEventReported).
3411 optional int32 event_id = 1;
3412 // The notifying app's uid and package.
3413 optional int32 uid = 2 [(is_uid) = true];
3414 optional string package_name = 3;
3415 // App-assigned notification channel ID or channel-group ID
3416 optional string channel_id = 4;
3417 // Previous importance setting, if applicable
3418 optional android.stats.sysui.NotificationImportance old_importance = 5;
3419 // New importance setting
3420 optional android.stats.sysui.NotificationImportance importance = 6;
3421}
3422
3423
3424/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003425 * Logs when a biometric acquire event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003426 *
3427 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003428 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003429 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003430message BiometricAcquired {
3431 // Biometric modality that was acquired.
3432 optional android.hardware.biometrics.ModalityEnum modality = 1;
3433 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java.
3434 optional int32 user = 2;
3435 // If this acquire is for a crypto operation. e.g. Secure purchases, unlock password storage.
3436 optional bool is_crypto = 3;
3437 // Action that the device is performing. Acquired messages are only expected for enroll and
3438 // authenticate. Other actions may indicate an error.
3439 optional android.hardware.biometrics.ActionEnum action = 4;
3440 // The client that this acquisition was received for.
3441 optional android.hardware.biometrics.ClientEnum client = 5;
3442 // Acquired constants, e.g. ACQUIRED_GOOD. See constants defined by <Biometric>Manager.
3443 optional int32 acquire_info = 6;
3444 // Vendor-specific acquire info. Valid only if acquire_info == ACQUIRED_VENDOR.
3445 optional int32 acquire_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003446 // Dictates if this message should trigger additional debugging.
3447 optional bool debug = 8;
Tej Singhd6d6d772018-09-05 17:41:25 -07003448}
3449
3450/**
Kevin Chyn1741a072019-01-17 11:54:40 -08003451 * Logs when a biometric authentication event occurs.
Tej Singhd6d6d772018-09-05 17:41:25 -07003452 *
3453 * Logged from:
Kevin Chyn1741a072019-01-17 11:54:40 -08003454 * frameworks/base/services/core/java/com/android/server/biometrics
Tej Singhd6d6d772018-09-05 17:41:25 -07003455 */
Kevin Chyn1741a072019-01-17 11:54:40 -08003456message BiometricAuthenticated {
3457 // Biometric modality that was used.
3458 optional android.hardware.biometrics.ModalityEnum modality = 1;
3459 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3460 optional int32 user = 2;
3461 // If this authentication is for a crypto operation. e.g. Secure purchases, unlock password
3462 // storage.
3463 optional bool is_crypto = 3;
3464 // The client that this acquisition was received for.
3465 optional android.hardware.biometrics.ClientEnum client = 4;
Kevin Chyndb77e132019-01-29 13:30:41 -08003466 // If authentication requires user confirmation. See BiometricPrompt's
3467 // setRequireConfirmation(bool) method.
3468 optional bool require_confirmation = 5;
Tej Singhd6d6d772018-09-05 17:41:25 -07003469
Kevin Chyn1741a072019-01-17 11:54:40 -08003470 enum State {
Tej Singhd6d6d772018-09-05 17:41:25 -07003471 UNKNOWN = 0;
Kevin Chyn1741a072019-01-17 11:54:40 -08003472 REJECTED = 1;
3473 PENDING_CONFIRMATION = 2;
3474 CONFIRMED = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003475 }
Kevin Chyn1741a072019-01-17 11:54:40 -08003476
3477 // State of the current auth attempt.
Kevin Chyndb77e132019-01-29 13:30:41 -08003478 optional State state = 6;
Kevin Chyn1741a072019-01-17 11:54:40 -08003479 // Time it took to authenticate. For BiometricPrompt where setRequireConfirmation(false) is
3480 // specified and supported by the biometric modality, this is from the first ACQUIRED_GOOD to
3481 // AUTHENTICATED. for setRequireConfirmation(true), this is from PENDING_CONFIRMATION to
3482 // CONFIRMED.
Kevin Chyndb77e132019-01-29 13:30:41 -08003483 optional int64 latency_millis = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003484 // Dictates if this message should trigger additional debugging.
3485 optional bool debug = 8;
Kevin Chyn1741a072019-01-17 11:54:40 -08003486}
3487
3488/**
3489 * Logs when a biometric error occurs.
3490 *
3491 * Logged from:
3492 * frameworks/base/services/core/java/com/android/server/biometrics
3493 */
3494message BiometricErrorOccurred {
3495 // Biometric modality that was used.
3496 optional android.hardware.biometrics.ModalityEnum modality = 1;
3497 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3498 optional int32 user = 2;
3499 // If this error is for a crypto operation. e.g. Secure purchases, unlock password storage.
3500 optional bool is_crypto = 3;
3501 // Action that the device is performing.
3502 optional android.hardware.biometrics.ActionEnum action = 4;
3503 // The client that this acquisition was received for.
3504 optional android.hardware.biometrics.ClientEnum client = 5;
3505 // Error constants. See constants defined by <Biometric>Manager. Enums won't work since errors
3506 // are unique to modality.
3507 optional int32 error_info = 6;
3508 // Vendor-specific error info. Valid only if acquire_info == ACQUIRED_VENDOR. These are defined
3509 // by the vendor and not specified by the HIDL interface.
3510 optional int32 error_info_vendor = 7;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003511 // Dictates if this message should trigger additional debugging.
3512 optional bool debug = 8;
Kevin Chyn7fca2362019-06-20 17:20:42 -07003513 // Time spent during the authentication attempt.
3514 optional int64 latency_millis = 9;
Kevin Chyn1741a072019-01-17 11:54:40 -08003515}
3516
3517/**
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003518 * Logs when a system health issue is detected.
Kevin Chyn1741a072019-01-17 11:54:40 -08003519 * Logged from:
3520 * frameworks/base/services/core/java/com/android/server/biometrics
3521 */
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003522message BiometricSystemHealthIssueDetected {
Kevin Chyn1741a072019-01-17 11:54:40 -08003523 // Biometric modality.
3524 optional android.hardware.biometrics.ModalityEnum modality = 1;
Kevin Chyne5a37fb2019-02-08 13:10:36 -08003525 // Type of issue detected.
3526 optional android.hardware.biometrics.IssueEnum issue = 2;
joshmccloskey1fad0f62019-04-01 13:32:53 -07003527 // Dictates if this message should trigger additional debugging.
3528 optional bool debug = 3;
Tej Singhd6d6d772018-09-05 17:41:25 -07003529}
Howard Ro688ae182018-09-25 00:09:36 -07003530
joshmccloskey6f952b22019-03-25 20:59:35 -07003531/**
3532 * Logs when a biometric enrollment occurs.
3533 *
3534 * Logged from:
3535 * frameworks/base/services/core/java/com/android/server/biometrics
3536 */
3537message BiometricEnrolled {
3538 // Biometric modality that was used.
3539 optional android.hardware.biometrics.ModalityEnum modality = 1;
3540 // The associated user. Eg: 0 for owners, 10+ for others. Defined in android/os/UserHandle.java
3541 optional int32 user = 2;
3542 // The amount of time the enrollment took in milliseconds.
3543 optional int64 latency_millis = 3;
3544 // Whether or not the enrollment was successful.
3545 optional bool success = 4;
3546}
3547
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003548/*
Tej Singh0d176952019-01-16 19:10:54 -08003549 * Logs when a flag flip update occurrs. Used for mainline modules that update via flag flips.
Yangster-macb89807e2018-11-15 21:10:57 -08003550 */
Tej Singh0d176952019-01-16 19:10:54 -08003551message FlagFlipUpdateOccurred {
3552 // If the event is from a flag config package, specify the package name.
3553 optional string flag_flip_package_name = 1;
3554
3555 // The order id of the package
3556 optional int64 order_id = 2;
Yangster-macb89807e2018-11-15 21:10:57 -08003557}
3558
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003559/**
3560 * Potential experiment ids that goes with a train install.
3561 */
3562message TrainExperimentIds {
3563 repeated int64 experiment_id = 1;
3564}
3565
Yangster-macb89807e2018-11-15 21:10:57 -08003566/*
3567 * Logs when a binary push state changes.
Chenjie Yu8366c712019-01-16 20:48:30 -08003568 * Logged by the installer via public api.
Yangster-macb89807e2018-11-15 21:10:57 -08003569 */
3570message BinaryPushStateChanged {
Chenjie Yu8366c712019-01-16 20:48:30 -08003571 // Name of the train.
3572 optional string train_name = 1;
3573 // Version code for a "train" of packages that need to be installed atomically
3574 optional int64 train_version_code = 2;
3575 // After installation of this package, device requires a restart.
3576 optional bool requires_staging = 3;
3577 // Rollback should be enabled for this install.
3578 optional bool rollback_enabled = 4;
3579 // Requires low latency monitoring if possible.
3580 optional bool requires_low_latency_monitor = 5;
3581
Yangster-macb89807e2018-11-15 21:10:57 -08003582 enum State {
Chenjie Yu8366c712019-01-16 20:48:30 -08003583 UNKNOWN = 0;
3584 INSTALL_REQUESTED = 1;
3585 INSTALL_STARTED = 2;
3586 INSTALL_STAGED_NOT_READY = 3;
3587 INSTALL_STAGED_READY = 4;
3588 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07003589 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
3590 // and INSTALL_FAILURE_COMMIT.
3591 INSTALL_FAILURE = 6 [deprecated = true];
3592 // This enum is for installs that are manually cancelled via the Manual Update UI.
Chenjie Yu8366c712019-01-16 20:48:30 -08003593 INSTALL_CANCELLED = 7;
3594 INSTALLER_ROLLBACK_REQUESTED = 8;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08003595 INSTALLER_ROLLBACK_INITIATED = 9;
3596 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
3597 INSTALLER_ROLLBACK_STAGED = 11;
3598 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
3599 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
3600 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
3601 INSTALLER_ROLLBACK_SUCCESS = 15;
3602 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07003603 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
3604 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
3605 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
3606 INSTALL_STAGED_CANCEL_REQUESTED = 20;
3607 INSTALL_STAGED_CANCEL_SUCCESS = 21;
3608 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07003609 INSTALL_FAILURE_DOWNLOAD = 23;
3610 INSTALL_FAILURE_STATE_MISMATCH = 24;
3611 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003612 REBOOT_TRIGGERED = 26;
Yangster-macb89807e2018-11-15 21:10:57 -08003613 }
Chenjie Yu8366c712019-01-16 20:48:30 -08003614 optional State state = 6;
Chenjie Yu6b1667c2019-01-18 10:09:33 -08003615 // Possible experiment ids for monitoring this push.
3616 optional TrainExperimentIds experiment_ids = 7 [(log_mode) = MODE_BYTES];
3617 // user id
3618 optional int32 user_id = 8;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08003619 optional int32 reason = 9;
Yangster-macb89807e2018-11-15 21:10:57 -08003620}
3621
Tej Singhc9203082019-05-03 13:42:23 -07003622/* Test atom, is not logged anywhere */
3623message TestAtomReported {
3624 repeated AttributionNode attribution_node = 1;
3625 optional int32 int_field = 2;
3626 optional int64 long_field = 3;
3627 optional float float_field = 4;
3628 optional string string_field = 5;
3629 optional bool boolean_field = 6;
3630 enum State {
3631 UNKNOWN = 0;
3632 OFF = 1;
3633 ON = 2;
3634 }
3635 optional State state = 7;
3636 optional TrainExperimentIds bytes_field = 8 [(android.os.statsd.log_mode) = MODE_BYTES];
3637}
3638
Maggie Whitefc1aa592018-11-28 21:55:23 -08003639/** Represents USB port overheat event. */
3640message UsbPortOverheatEvent {
3641 /* Temperature of USB port at USB plug event, in 1/10ths of degree C. */
3642 optional int32 plug_temperature_deci_c = 1;
3643
3644 /* Maximum temperature of USB port during overheat event, in 1/10ths of degree C. */
3645 optional int32 max_temperature_deci_c = 2;
3646
3647 /* Time between USB plug event and overheat threshold trip, in seconds. */
3648 optional int32 time_to_overheat_secs = 3;
3649
3650 /* Time between overheat threshold trip and hysteresis, in seconds. */
3651 optional int32 time_to_hysteresis_secs = 4;
3652
3653 /* Time between hysteresis and active mitigation ending, in seconds. */
3654 optional int32 time_to_inactive_secs = 5;
3655};
3656
Maggie White8735b852019-01-18 11:40:49 -08003657/**
3658 * Logs total effective full charge and discharge cycles on a battery.
3659 * Here are some examples of one effective cycle:
3660 * 1) the battery charges from 0% to 100% and drains back to 0%,
3661 * 2) charging from 50% to 100% and draining back to 50% twice.
3662 * Pulled from:
3663 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
3664 */
3665message BatteryCycleCount {
3666 /* Number of total charge and discharge cycles on the system battery. */
3667 optional int32 cycle_count = 1;
3668}
3669
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003670/**
Carmen Agimof12dec122019-03-06 16:14:38 +00003671 * Logs that external storage is mounted and information about it, the storage type (sd card/usb/
3672 * others), its type (public or private) and the size in bytes.
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003673 * Pulled from:
3674 * StatsCompanionService
3675 */
3676
Carmen Agimof12dec122019-03-06 16:14:38 +00003677message ExternalStorageInfo {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003678
Carmen Agimof12dec122019-03-06 16:14:38 +00003679 enum VolumeType {
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003680 UNKNOWN = 0;
Carmen Agimof12dec122019-03-06 16:14:38 +00003681 PUBLIC = 1;
3682 PRIVATE = 2;
3683 OTHER = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003684 }
3685
Carmen Agimof12dec122019-03-06 16:14:38 +00003686 // The type of external storage.
3687 optional android.stats.storage.ExternalStorageType storage_type = 1;
3688 // Type of the volume: TYPE_PUBLIC if portable and TYPE_PRIVATE if internal.
3689 optional VolumeType volume_type = 2;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003690 // Total size of the sd card in bytes.
Carmen Agimof12dec122019-03-06 16:14:38 +00003691 optional int64 size_bytes = 3;
Carmen Agimof35f7f6f2019-02-05 18:19:21 +00003692}
3693
Yangster-macb89807e2018-11-15 21:10:57 -08003694/*
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003695 * Logs when a connection becomes available and lost.
3696 * Logged in StatsCompanionService.java
3697 */
3698message ConnectivityStateChanged {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003699 // Id of the network.
3700 optional int32 net_id = 1;
3701
3702 enum State {
3703 UNKNOWN = 0;
3704 CONNECTED = 1;
3705 DISCONNECTED = 2;
3706 }
3707 // Connected state of a network.
3708 optional State state = 2;
3709}
3710
3711/**
3712 * Logs when a service starts and stops.
3713 * Logged from:
3714 * services/core/java/com/android/server/am/ActiveServices.java
3715 */
3716message ServiceStateChanged {
3717
3718 optional int32 uid = 1 [(is_uid) = true];
3719
3720 optional string package_name = 2;
3721
3722 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003723
3724 enum State {
Chenjie Yu75b3c492018-10-06 21:45:19 -07003725 START = 1;
3726 STOP = 2;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003727 }
Chenjie Yu75b3c492018-10-06 21:45:19 -07003728
3729 optional State state = 4;
3730}
3731
3732/**
3733 * Logs when a service is launched.
3734 * Logged from:
3735 * services/core/java/com/android/server/am/ActiveServices.java
3736 */
3737message ServiceLaunchReported {
3738
3739 optional int32 uid = 1 [(is_uid) = true];
3740
3741 optional string package_name = 2;
3742
3743 optional string service_name = 3;
Chenjie Yuae9dfac2018-10-25 16:06:56 -07003744}
Howard Ro688ae182018-09-25 00:09:36 -07003745
Andrei Onea4ad6d0c2019-02-08 13:54:12 +00003746/**
3747 * Logs when a hidden API is used.
3748 *
3749 * Logged from:
3750 * libcore/libart/src/main/java/dalvik/system/VMRuntime.java
3751 */
3752message HiddenApiUsed {
3753 // The uid of the app making the hidden access.
3754 optional int32 uid = 1 [(is_uid) = true];
3755
3756 // Signature of the method or field accessed.
3757 optional string signature = 2;
3758
3759 enum AccessMethod {
3760 NONE = 0;
3761 REFLECTION = 1;
3762 JNI = 2;
3763 LINKING = 3;
3764 }
3765
3766 // Type of access.
3767 optional AccessMethod access_method = 3;
3768
3769 // Whether the access was prevented or not.
3770 optional bool access_denied = 4;
3771}
3772
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003773/**
3774 * Logs user interaction with the Privacy Indicators added in Q. In particular:
3775 * - When user sees privacy chip
3776 * - When user clicks privacy chip
3777 * - How does the user exit the Privacy Dialog
3778 * Logged from:
Fabian Kozynskibfd6d852019-02-15 15:08:16 -05003779 * packages/SystemUI/src/com/android/systemui/qs/QuickStatusBarHeader.java
3780 */
3781message PrivacyIndicatorsInteracted {
3782
3783 enum Type {
3784 UNKNOWN = 0;
3785 CHIP_VIEWED = 1;
3786 CHIP_CLICKED = 2;
3787 DIALOG_PRIVACY_SETTINGS = 3;
3788 DIALOG_DISMISS = 4;
3789 DIALOG_LINE_ITEM = 5;
3790 }
3791
3792 optional Type type = 1 [(state_field_option).option = EXCLUSIVE];
3793
3794 // Used if the type is LINE_ITEM
3795 optional string package_name = 2;
3796}
3797
Carmen Agimof6dcc5032019-03-01 16:20:09 +00003798/**
3799 * Logs information about a package that is moved from the internal to external storage and vice
3800 * versa.
3801 * It logs the package name, the type of the external storage where the package is installed
3802 * (if moved to external storage, or UNKNOWN if moved to internal storage),
3803 * and the move type: if it's from internal to external or the other way around.
3804 *
3805 * Logged from:
3806 frameworks/base/services/core/java/com/android/server/pm/PackageManagerService.java
3807 */
3808message AppMovedStorageReported {
3809 enum MoveType {
3810 UNKNOWN = 0;
3811 TO_EXTERNAL = 1;
3812 TO_INTERNAL = 2;
3813 }
3814 // The type of the external storage.
3815 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
3816 // The type of move.
3817 optional MoveType move_type = 2;
3818 // The name of the package that was moved.
3819 optional string package_name = 3;
3820}
3821
jianjin8f2dee02019-03-29 14:03:08 -07003822/**
3823 * Logs when system server watchdog occurs.
3824 * Logged from:
3825 * frameworks/base/services/core/java/com/android/server/Watchdog.java
3826 */
3827message SystemServerWatchdogOccurred {
3828 optional string subject = 1;
3829}
3830
3831/**
3832 * Logs when new file added to tombstones.
3833 * Logged from:
3834 * frameworks/base/core/java/com/android/server/BootReceiver.java
3835 */
3836message TombStoneOccurred {
3837}
3838
Hai Zhang5d3328d2019-04-13 21:25:06 +08003839/*
3840 * Information about a role request
3841 *
3842 * Logged from:
3843 * packages/apps/PermissionController/src/com/android/packageinstaller/role/ui/RequestRoleFragment.java
3844 */
3845message RoleRequestResultReported {
3846 // UID of application requesting the role
3847 optional int32 requesting_uid = 1;
3848
3849 // Package name of application requesting the role
3850 optional string requesting_package_name = 2;
3851
3852 // The role to be granted
3853 optional string role_name = 3;
3854
3855 // The count of applications qualifying for the role
3856 optional int32 qualifying_count = 4;
3857
3858 // UID of application current granted the role
3859 optional int32 current_uid = 5;
3860
3861 // Package name of application current granted the role
3862 optional string current_package_name = 6;
3863
3864 // UID of another application that user chose to grant the role to, instead of the requesting
3865 // application
3866 optional int32 granted_another_uid = 7;
3867
3868 // Package name of another application that user chose to grant the role to, instead of the
3869 // requesting application
3870 optional string granted_another_package_name = 8;
3871
3872 enum Result {
3873 UNDEFINED = 0;
3874 // role request was ignored
3875 IGNORED = 1;
3876 // role request was ignored because it's already granted
3877 IGNORED_ALREADY_GRANTED = 2;
3878 // role request was ignored because the application isn't qualified
3879 IGNORED_NOT_QUALIFIED = 3;
3880 // role request was ignored because user said it should be always denied
3881 IGNORED_USER_ALWAYS_DENIED = 4;
3882 // role was granted by user action
3883 USER_GRANTED = 5;
3884 // role was denied by user action
3885 USER_DENIED = 6;
3886 // role was denied by user granting another application the role
3887 USER_DENIED_GRANTED_ANOTHER = 7;
3888 // role was denied and set to be always denied by the user
3889 USER_DENIED_WITH_ALWAYS = 8;
3890 }
3891 // The result of the role request
3892 optional Result result = 9;
3893}
3894
Mark Tabrya824a642019-11-05 12:26:12 -08003895/**
3896 * Logs when a Vehicle Maps Service client's connection state has changed
3897 *
3898 * Logged from:
3899 * packages/services/Car/service/src/com/android/car/stats/VmsClientLog.java
3900 */
3901message VmsClientConnectionStateChanged {
3902 // The UID of the VMS client app
3903 optional int32 uid = 1 [(is_uid) = true];
3904
3905 enum State {
3906 UNKNOWN = 0;
3907 // Attempting to connect to the client
3908 CONNECTING = 1;
3909 // Client connection established
3910 CONNECTED = 2;
3911 // Client connection closed unexpectedly
3912 DISCONNECTED = 3;
3913 // Client connection closed by VMS
3914 TERMINATED = 4;
3915 // Error establishing the client connection
3916 CONNECTION_ERROR = 5;
3917 }
3918
3919 optional State state = 2;
3920}
3921
Jeff Sharkey6bd21572019-11-15 20:45:33 -07003922/**
3923 * Logs when MediaProvider has successfully finished scanning a storage volume.
3924 *
3925 * Logged from:
3926 * packages/providers/MediaProvider/src/com/android/providers/media/scan/ModernMediaScanner.java
3927 */
3928message MediaProviderScanEvent {
3929 enum Reason {
3930 // Scan triggered due to unknown reason
3931 UNKNOWN = 0;
3932 // Scan triggered due to storage volume being mounted
3933 MOUNTED = 1;
3934 // Scan triggered due to explicit user action or app request
3935 DEMAND = 2;
3936 // Scan triggered due to idle maintenance
3937 IDLE = 3;
3938 }
3939
3940 // Volume type that this event pertains to
3941 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3942 // Reason why this scan was triggered
3943 optional Reason reason = 2;
3944 // Total number of files scanned
3945 optional int64 item_count = 3;
3946 // Duration of scan, normalized per file
3947 optional float normalized_duration_millis = 4;
3948 // Number of database inserts, normalized per file
3949 optional float normalized_insert_count = 5;
3950 // Number of database updates, normalized per file
3951 optional float normalized_update_count = 6;
3952 // Number of database deletes, normalized per file
3953 optional float normalized_delete_count = 7;
3954}
3955
3956/**
3957 * Logs when an app has asked MediaProvider to delete media belonging to the user.
3958 *
3959 * Logged from:
3960 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
3961 */
3962message MediaProviderDeletionEvent {
3963 // Volume type that this event pertains to
3964 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3965 // Device timestamp when this deletion event occurred
3966 optional int64 timestamp_millis = 2;
3967 // App that requested deletion
3968 optional string package_name = 3;
3969 // Number of items that were deleted
3970 optional int32 item_count = 4;
3971}
3972
3973/**
3974 * Logs when an app has asked MediaProvider to grant them access to media belonging to the user.
3975 *
3976 * Logged from:
3977 * packages/providers/MediaProvider/src/com/android/providers/media/PermissionActivity.java
3978 */
3979message MediaProviderPermissionEvent {
3980 enum Result {
3981 UNKNOWN = 0;
3982 USER_GRANTED = 1;
3983 AUTO_GRANTED = 2;
3984 USER_DENIED = 3;
3985 USER_DENIED_WITH_PREJUDICE = 4;
3986 AUTO_DENIED = 5;
3987 }
3988
3989 // Volume type that this event pertains to
3990 optional android.stats.mediaprovider.VolumeType volume_type = 1;
3991 // Device timestamp when this permission event occurred
3992 optional int64 timestamp_millis = 2;
3993 // App that requested permission
3994 optional string package_name = 3;
3995 // Number of items that were requested
3996 optional int32 item_count = 4;
3997 // Result of this request
3998 optional Result result = 5;
3999}
4000
4001/**
4002 * Logs when MediaProvider has finished upgrading or downgrading its database schema.
4003 *
4004 * Logged from:
4005 * packages/providers/MediaProvider/src/com/android/providers/media/DatabaseHelper.java
4006 */
4007message MediaProviderSchemaChange {
4008 // Volume type that this event pertains to
4009 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4010 // Old database version code
4011 optional int32 version_from = 2;
4012 // New database version code
4013 optional int32 version_to = 3;
4014 // Total number of files in database
4015 optional int64 item_count = 4;
4016 // Duration of schema change, normalized per file
4017 optional float normalized_duration_millis = 5;
4018}
4019
4020/**
4021 * Logs when MediaProvider has finished an idle maintenance job.
4022 *
4023 * Logged from:
4024 * packages/providers/MediaProvider/src/com/android/providers/media/MediaProvider.java
4025 */
4026message MediaProviderIdleMaintenance {
4027 // Volume type that this event pertains to
4028 optional android.stats.mediaprovider.VolumeType volume_type = 1;
4029
4030 // Total number of files in database
4031 optional int64 item_count = 2;
4032 // Duration of idle maintenance, normalized per file
4033 optional float normalized_duration_millis = 3;
4034 // Number of thumbnails found to be stale, normalized per file
4035 optional float normalized_stale_thumbnails = 4;
4036 // Number of items found to be expired, normalized per file
4037 optional float normalized_expired_media = 5;
4038}
4039
Keun young Park3e033cb2019-12-18 11:27:35 -08004040/**
4041 * Represents boot time event with duration in ms.
4042 *
4043 * Logged from: bootstat and various system server components. Check each enums for details.
4044 */
4045message BootTimeEventDuration {
4046 enum DurationEvent {
4047 UNKNOWN = 0;
4048 // Bootloader time excluding BOOTLOADER_UI_WAIT + boot complete time. Logged from bootstat.
4049 ABSOLUTE_BOOT_TIME = 1;
4050 // Bootloader's 1st stage execution time.
4051 // Logged from bootstat.
4052 BOOTLOADER_FIRST_STAGE_EXEC = 2;
4053 // Bootloader's 1st stage loading time.
4054 // Logged from bootstat.
4055 BOOTLOADER_FIRST_STAGE_LOAD = 3;
4056 // Bootloader's kernel loading time.
4057 // Logged from bootstat.
4058 BOOTLOADER_KERNEL_LOAD = 4;
4059 // Bootloader's 2nd stage execution time.
4060 // Logged from bootstat.
4061 BOOTLOADER_SECOND_STAGE_EXEC = 5;
4062 // Bootloader's 2nd stage loading time.
4063 // Logged from bootstat.
4064 BOOTLOADER_SECOND_STAGE_LOAD = 6;
4065 // Duration for Bootloader to show unlocked device's warning UI. This should not happen
4066 // for locked device.
4067 // Logged from bootstat.
4068 BOOTLOADER_UI_WAIT = 7;
4069 // Total time spend in bootloader. This is the sum of all BOOTLOADER_* listed above.
4070 // Logged from bootstat.
4071 BOOTLOADER_TOTAL = 8;
4072 // Shutdown duration inside init for the reboot before the current boot up.
4073 // Logged from f/b/services/.../BootReceiver.java.
4074 SHUTDOWN_DURATION = 9;
4075 // Total time for mounting of disk devices during bootup.
4076 // Logged from f/b/services/.../BootReceiver.java.
4077 MOUNT_DEFAULT_DURATION = 10;
4078 // Total time for early stage mounting of disk devices during bootup.
4079 // Logged from f/b/services/.../BootReceiver.java.
4080 MOUNT_EARLY_DURATION = 11;
4081 // Total time for late stage mounting of disk devices during bootup.
4082 // Logged from f/b/services/.../BootReceiver.java.
4083 MOUNT_LATE_DURATION = 12;
4084 // Average time to scan non-system app after OTA
4085 // Logged from f/b/services/.../PackageManagerService.java
4086 OTA_PACKAGE_MANAGER_INIT_TIME = 13;
4087 // Time to initialize Package manager after OTA
4088 // Logged from f/b/services/.../PackageManagerService.java
4089 OTA_PACKAGE_MANAGER_DATA_APP_AVG_SCAN_TIME = 14;
4090 // Time to scan all system app from Package manager after OTA
4091 // Logged from f/b/services/.../PackageManagerService.java
4092 OTA_PACKAGE_MANAGER_SYSTEM_APP_AVG_SCAN_TIME = 15;
4093 // Init's total time for cold boot stage.
4094 // Logged from bootstat.
4095 COLDBOOT_WAIT = 16;
4096 // Init's total time for initializing selinux.
4097 // Logged from bootstat.
4098 SELINUX_INIT = 17;
4099 // Time since last factory reset.
4100 // Logged from bootstat.
4101 FACTORY_RESET_TIME_SINCE_RESET = 18;
4102 }
4103
4104 // Type of the event.
4105 optional DurationEvent event = 1;
4106 // Duration of the event in ms.
4107 optional int64 duration_millis = 2;
4108}
4109
4110/**
4111 * Represents the start of specific boot time event during bootup in ms. This is usually a time
4112 * since boot-up.
4113 *
4114 * Logged from: bootstat and various system server components. Check each enums for details.
4115 */
4116message BootTimeEventElapsedTime {
4117 enum ElapsedTimeEvent {
4118 UNKNOWN = 0;
4119 // Time when init starts 1st stage. Logged from bootstat.
4120 ANDROID_INIT_STAGE_1 = 1;
4121 // Time when sys.boot_completed prop is set.
4122 // Logged from bootstat.
4123 BOOT_COMPLETE = 2;
4124 // BOOT_COMPLETE for encrypted device.
4125 BOOT_COMPLETE_ENCRYPTION = 3;
4126 // BOOT_COMPLETE for device with no encryption.
4127 BOOT_COMPLETE_NO_ENCRYPTION = 4;
4128 // Adjusted BOOT_COMPLETE for encrypted device extracting decryption time.
4129 BOOT_COMPLETE_POST_DESCRYPT = 5;
4130 // BOOT_COMPLETE after factory reset.
4131 FACTORY_RESET_BOOT_COMPLETE = 6;
4132 // BOOT_COMPLETE_NO_ENCRYPTION after factory reset.
4133 FACTORY_RESET_BOOT_COMPLETE_NO_ENCRYPTION = 7;
4134 // BOOT_COMPLETE_POST_DESCRYPT after factory reset.
4135 FACTORY_RESET_BOOT_COMPLETE_POST_DESCRYPT = 8;
4136 // BOOT_COMPLETE after OTA.
4137 OTA_BOOT_COMPLETE = 9;
4138 // BOOT_COMPLETE_NO_ENCRYPTION after OTA.
4139 OTA_BOOT_COMPLETE_NO_ENCRYPTION = 10;
4140 // BOOT_COMPLETE_POST_DESCRYPT after OTA.
4141 OTA_BOOT_COMPLETE_POST_DESCRYPT = 11;
4142 // Time when the system starts sending LOCKED_BOOT_COMPLETED broadcast.
4143 // Logged from f/b/services/.../UserController.java
4144 FRAMEWORK_LOCKED_BOOT_COMPLETED = 12;
4145 // Time when the system starts sending BOOT_COMPLETED broadcast.
4146 // Logged from f/b/services/.../UserController.java
4147 FRAMEWORK_BOOT_COMPLETED = 13;
4148 // Time when the package manager starts init.
4149 // Logged from f/b/services/.../SystemServer.java
4150 PACKAGE_MANAGER_INIT_START = 14;
4151 // Time when package manager is ready
4152 // Logged from f/b/services/.../SystemServer.java
4153 PACKAGE_MANAGER_INIT_READY = 15;
4154 // Represents the time when user has entered unlock credential for system with user pin.
4155 // Logged from bootstat.
4156 POST_DECRYPT = 16;
4157 // Represents the start of zygote's init.
4158 // Logged from zygote itself.
4159 ZYGOTE_INIT_START = 17;
4160 // Represents the start of secondary zygote's init.
4161 // TODO: add logging to zygote
4162 SECONDARY_ZYGOTE_INIT_START = 18;
4163 // Represents the start of system server's init.
4164 // Logged from f/b/services/.../SystemServer.java
4165 SYSTEM_SERVER_INIT_START = 19;
4166 // Represents the completion of system server's init.
4167 // Logged from f/b/services/.../SystemServer.java
4168 SYSTEM_SERVER_READY = 20;
4169 // Represents the start of launcher during boot-up.
4170 // TODO: add logging
4171 LAUNCHER_START = 21;
4172 // Represents the completion of launcher's initial rendering. User can use other apps from
4173 // launcher from this point.
4174 // TODO: add logging
4175 LAUNCHER_SHOWN = 22;
4176 }
4177
4178 // Type of the event.
4179 optional ElapsedTimeEvent event = 1;
4180 // Time since bootup for the event.
4181 // It should be acquired from SystemClock elapsedRealtime() call or equivalent.
4182 optional int64 time_millis = 2;
4183}
4184
4185/**
4186 * Boot time events with UTC time.
4187 *
4188 * Logged from: bootstat and various system server components. Check each enums for details.
4189 */
4190message BootTimeEventUtcTime {
4191 enum UtcTimeEvent {
4192 UNKNOWN = 0;
4193 // Time of the bootstat's marking of 1st boot after the last factory reset.
4194 // Logged from bootstat.
4195 FACTORY_RESET_RESET_TIME = 1;
4196 // The time when bootstat records FACTORY_RESET_* events. This is close to
4197 // BOOT_COMPLETE time for the current bootup.
4198 // Logged from bootstat.
4199 FACTORY_RESET_CURRENT_TIME = 2;
4200 // DUplicate of FACTORY_RESET_RESET_TIME added for debugging purpose.
4201 // Logged from bootstat.
4202 FACTORY_RESET_RECORD_VALUE = 3;
4203 }
4204
4205 // Type of the event.
4206 optional UtcTimeEvent event = 1;
4207 // UTC time for the event.
4208 optional int64 utc_time_secs = 2;
4209}
4210
4211/**
4212 * Boot time events representing specific error code during bootup.
4213 * Meaning of error code can be different per each event type.
4214 *
4215 * Logged from: bootstat and various system server components. Check each enums for details.
4216 */
4217message BootTimeEventErrorCode {
4218 enum ErrorCodeEvent {
4219 UNKNOWN = 0;
4220 // Linux error code for time() call to get the current UTC time.
4221 // Logged from bootstat.
4222 FACTORY_RESET_CURRENT_TIME_FAILURE = 1;
4223 // Represents UmountStat before the reboot for the current boot up. Error codes defined
4224 // as UMOUNT_STAT_* from init/reboot.cpp.
4225 // Logged from f/b/services/.../BootReceiver.java.
4226 SHUTDOWN_UMOUNT_STAT = 2;
Keun young Parkdf1534d2020-01-13 18:55:31 -08004227 // Reprepsents fie system mounting error code of /data partition for the current boot.
4228 // Error codes defined as combination of FsStatFlags from system/core/fs_mgr/fs_mgr.cpp.
Keun young Park3e033cb2019-12-18 11:27:35 -08004229 // Logged from f/b/services/.../BootReceiver.java.
Keun young Parkdf1534d2020-01-13 18:55:31 -08004230 FS_MGR_FS_STAT_DATA_PARTITION = 3;
Keun young Park3e033cb2019-12-18 11:27:35 -08004231 }
4232
4233 // Type of the event.
4234 optional ErrorCodeEvent event = 1;
4235 // error code defined per each event type.
4236 // For example, this can have a value of FsStatFlags.FS_STAT_FULL_MOUNT_FAILED for the event of
4237 // FS_MGR_FS_STAT.
4238 optional int32 error_code = 2;
4239}
4240
Chenjie Yubbcbc602018-02-05 16:51:52 -08004241//////////////////////////////////////////////////////////////////////
4242// Pulled atoms below this line //
4243//////////////////////////////////////////////////////////////////////
4244
4245/**
David Chenc8a43242017-10-17 16:23:28 -07004246 * Pulls bytes transferred via wifi (Sum of foreground and background usage).
4247 *
4248 * Pulled from:
4249 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4250 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004251message WifiBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004252 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004253
4254 optional int64 rx_bytes = 2;
4255
4256 optional int64 rx_packets = 3;
4257
4258 optional int64 tx_bytes = 4;
4259
4260 optional int64 tx_packets = 5;
4261}
4262
4263/**
4264 * Pulls bytes transferred via wifi (separated by foreground and background usage).
4265 *
4266 * Pulled from:
4267 * StatsCompanionService (using BatteryStats to get which interfaces are wifi)
4268 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004269message WifiBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004270 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004271
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004272 // 1 denotes foreground and 0 denotes background. This is called Set in NetworkStats.
4273 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004274
4275 optional int64 rx_bytes = 3;
4276
4277 optional int64 rx_packets = 4;
4278
4279 optional int64 tx_bytes = 5;
4280
4281 optional int64 tx_packets = 6;
4282}
4283
4284/**
4285 * Pulls bytes transferred via mobile networks (Sum of foreground and background usage).
4286 *
4287 * Pulled from:
4288 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4289 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004290message MobileBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004291 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004292
4293 optional int64 rx_bytes = 2;
4294
4295 optional int64 rx_packets = 3;
4296
4297 optional int64 tx_bytes = 4;
4298
4299 optional int64 tx_packets = 5;
4300}
4301
4302/**
4303 * Pulls bytes transferred via mobile networks (separated by foreground and background usage).
4304 *
4305 * Pulled from:
4306 * StatsCompanionService (using BatteryStats to get which interfaces are mobile data)
4307 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004308message MobileBytesTransferByFgBg {
Yao Chenc40a19d2018-03-15 16:48:25 -07004309 optional int32 uid = 1 [(is_uid) = true];
David Chenc8a43242017-10-17 16:23:28 -07004310
Yao Chenc40a19d2018-03-15 16:48:25 -07004311 // 1 denotes foreground and 0 denotes background. This is called Set in
4312 // NetworkStats.
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004313 optional bool is_foreground = 2;
David Chenc8a43242017-10-17 16:23:28 -07004314
4315 optional int64 rx_bytes = 3;
4316
4317 optional int64 rx_packets = 4;
4318
4319 optional int64 tx_bytes = 5;
4320
4321 optional int64 tx_packets = 6;
4322}
4323
4324/**
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004325 * Pulls bytes transferred via bluetooth. It is pulled from Bluetooth controller.
4326 *
4327 * Pulled from:
4328 * StatsCompanionService
4329 */
4330message BluetoothBytesTransfer {
Yao Chenc40a19d2018-03-15 16:48:25 -07004331 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004332
4333 optional int64 rx_bytes = 2;
4334
4335 optional int64 tx_bytes = 3;
4336}
4337
4338/**
David Chenc8a43242017-10-17 16:23:28 -07004339 * Pulls the kernel wakelock durations. This atom is adapted from
4340 * android/internal/os/KernelWakelockStats.java
4341 *
4342 * Pulled from:
4343 * StatsCompanionService using KernelWakelockReader.
4344 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004345message KernelWakelock {
David Chenc8a43242017-10-17 16:23:28 -07004346 optional string name = 1;
4347
4348 optional int32 count = 2;
4349
4350 optional int32 version = 3;
4351
Yangster-maca8a30442018-10-13 23:46:34 -07004352 optional int64 time_micros = 4;
David Chenc8a43242017-10-17 16:23:28 -07004353}
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004354
Chenjie Yu05013b32017-11-21 10:21:41 -08004355/**
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004356 * Pulls low power state information. If power.stats HAL is not available, this
4357 * includes platform and subsystem sleep state information,
4358 * PowerStatePlatformSleepState, PowerStateVoter or PowerStateSubsystemSleepState
4359 * as defined in:
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004360 * hardware/interfaces/power/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004361 * hardware/interfaces/power/1.1/types.hal
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004362 * If power.stats HAL is available, this includes PowerEntityStateResidencyResult
4363 * as defined in:
4364 * hardware/interfaces/power/stats/1.0/types.hal
Chenjie Yu5305e1d2017-10-31 13:49:36 -07004365 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004366message SubsystemSleepState {
Chenjie Yubbcbc602018-02-05 16:51:52 -08004367 // Subsystem name
4368 optional string subsystem_name = 1;
4369 // For PlatformLowPowerStats (hal 1.0), this is the voter name, which could be empty.
4370 // For SubsystemLowPowerStats (hal 1.1), this is the sleep state name.
Benjamin Schwartz51329b72018-12-06 10:48:03 -08004371 // For PowerEntityStateResidencyResult (hal power/stats/1.0) this is the
4372 // powerEntityStateName from the corresponding PowerEntityStateInfo.
Chenjie Yubbcbc602018-02-05 16:51:52 -08004373 optional string subname = 2;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004374 // The number of times it entered, or voted for entering the sleep state
Chenjie Yubbcbc602018-02-05 16:51:52 -08004375 optional uint64 count = 3;
Chenjie Yuc8b7f222018-01-11 23:25:57 -08004376 // The length of time spent in, or spent voting for, the sleep state
David Chen0b5c90c2018-01-25 16:51:49 -08004377 optional uint64 time_millis = 4;
David Chen21582962017-11-01 17:32:46 -07004378}
Chenjie Yu7f8def92017-11-03 09:33:15 -07004379
Chenjie Yu05013b32017-11-21 10:21:41 -08004380/**
Bookatz92da2832018-11-01 18:10:03 -07004381 * Pulls on-device power measurement information.
4382 * Data defined by hardware/interfaces/power/stats/1.0/types.hal.
4383 * Pulled from:
4384 * frameworks/base/cmds/statsd/src/external/PowerStatsPuller.cpp
4385 */
4386message OnDevicePowerMeasurement {
4387 // Name of the subsystem (to which the rail belongs).
4388 optional string subsystem_name = 1;
4389
4390 // Rail name. The rail lies within the subsystem.
4391 optional string rail_name = 2;
4392
4393 // Time (in ms since boot) at which the rail energy value was measured.
4394 // This may differ slightly from the time that statsd logs this information.
4395 optional uint64 measurement_timestamp_millis = 3;
4396
4397 // Accumulated energy used via the rail since device boot in uWs.
4398 optional uint64 energy_microwatt_secs = 4;
4399}
4400
4401/**
Chenjie Yu7f8def92017-11-03 09:33:15 -07004402 * Pulls Cpu time per frequency.
Chenjie Yu1ee9b742018-01-10 16:02:57 -08004403 * Pulls the time the cpu spend on the frequency index. Frequency index
4404 * starts from highest to lowest. The value should be monotonically
4405 * increasing since boot. However, if there is a cpu
4406 * hotplug event, the value would be reset as well.
Chenjie Yu7f8def92017-11-03 09:33:15 -07004407 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004408message CpuTimePerFreq {
Chenjie Yu7f8def92017-11-03 09:33:15 -07004409 optional uint32 cluster = 1;
4410 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004411 optional uint64 time_millis = 3;
Chenjie Yu7f8def92017-11-03 09:33:15 -07004412}
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004413
Chenjie Yu05013b32017-11-21 10:21:41 -08004414/**
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004415 * Pulls Cpu Time Per Uid.
4416 * Note that isolated process uid time should be attributed to host uids.
4417 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004418message CpuTimePerUid {
Yao Chenc40a19d2018-03-15 16:48:25 -07004419 optional int32 uid = 1 [(is_uid) = true];
Misha Wagner6bc6c912018-11-16 13:19:54 +00004420 optional uint64 user_time_micros = 2;
4421 optional uint64 sys_time_micros = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004422}
4423
4424/**
4425 * Pulls Cpu Time Per Uid per frequency.
4426 * Note that isolated process uid time should be attributed to host uids.
4427 * For each uid, we order the time by descending frequencies.
4428 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004429message CpuTimePerUidFreq {
Yao Chenc40a19d2018-03-15 16:48:25 -07004430 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004431 optional uint32 freq_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004432 optional uint64 time_millis = 3;
Chenjie Yue33bc3b2017-11-06 17:56:44 -08004433}
Hugo Benichi884970e2017-11-14 22:42:46 +09004434
Chenjie Yu05013b32017-11-21 10:21:41 -08004435/**
4436 * Pulls Wifi Controller Activity Energy Info
4437 */
Chenjie Yu5caaa9d2018-03-06 15:48:54 -08004438message WifiActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004439 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004440 optional uint64 timestamp_millis = 1;
Chenjie Yu05013b32017-11-21 10:21:41 -08004441 // stack reported state
4442 // TODO: replace this with proto enum
4443 optional int32 stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004444 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004445 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004446 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004447 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004448 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004449 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004450 // product of current(mA), voltage(V) and time(ms)
4451 optional uint64 controller_energy_used = 6;
4452}
4453
4454/**
4455 * Pulls Modem Activity Energy Info
4456 */
Chenjie Yu31d14d72017-12-12 17:54:33 -08004457message ModemActivityInfo {
Chenjie Yu05013b32017-11-21 10:21:41 -08004458 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004459 optional uint64 timestamp_millis = 1;
Yangster-maca8a30442018-10-13 23:46:34 -07004460 // sleep time in millis.
David Chen0b5c90c2018-01-25 16:51:49 -08004461 optional uint64 sleep_time_millis = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004462 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004463 optional uint64 controller_idle_time_millis = 3;
Chenjie Yu05013b32017-11-21 10:21:41 -08004464 /**
4465 * Tx power index
4466 * index 0 = tx_power < 0dBm
4467 * index 1 = 0dBm < tx_power < 5dBm
4468 * index 2 = 5dBm < tx_power < 15dBm
4469 * index 3 = 15dBm < tx_power < 20dBm
4470 * index 4 = tx_power > 20dBm
4471 */
4472 // tx time in ms at power level 0
David Chen0b5c90c2018-01-25 16:51:49 -08004473 optional uint64 controller_tx_time_pl0_millis = 4;
Chenjie Yu05013b32017-11-21 10:21:41 -08004474 // tx time in ms at power level 1
David Chen0b5c90c2018-01-25 16:51:49 -08004475 optional uint64 controller_tx_time_pl1_millis = 5;
Chenjie Yu05013b32017-11-21 10:21:41 -08004476 // tx time in ms at power level 2
David Chen0b5c90c2018-01-25 16:51:49 -08004477 optional uint64 controller_tx_time_pl2_millis = 6;
Chenjie Yu05013b32017-11-21 10:21:41 -08004478 // tx time in ms at power level 3
David Chen0b5c90c2018-01-25 16:51:49 -08004479 optional uint64 controller_tx_time_pl3_millis = 7;
Chenjie Yu05013b32017-11-21 10:21:41 -08004480 // tx time in ms at power level 4
David Chen0b5c90c2018-01-25 16:51:49 -08004481 optional uint64 controller_tx_time_pl4_millis = 8;
Chenjie Yu05013b32017-11-21 10:21:41 -08004482 // rx time in ms at power level 5
David Chen0b5c90c2018-01-25 16:51:49 -08004483 optional uint64 controller_rx_time_millis = 9;
Chenjie Yu05013b32017-11-21 10:21:41 -08004484 // product of current(mA), voltage(V) and time(ms)
Chen Xu7322e4a2019-09-07 15:51:22 -07004485 optional uint64 energy_used = 10 [deprecated=true];
Joe Onorato62c220b2017-11-18 20:32:56 -08004486}
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004487
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004488/**
4489 * Pulls Bluetooth Activity Energy Info
4490 * Note: BluetoothBytesTransfer is pulled at the same time from the controller.
4491 */
4492message BluetoothActivityInfo {
4493 // timestamp(wall clock) of record creation
David Chen0b5c90c2018-01-25 16:51:49 -08004494 optional uint64 timestamp_millis = 1;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004495 // bluetooth stack state
4496 optional int32 bluetooth_stack_state = 2;
Yangster-maca8a30442018-10-13 23:46:34 -07004497 // tx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004498 optional uint64 controller_tx_time_millis = 3;
Yangster-maca8a30442018-10-13 23:46:34 -07004499 // rx time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004500 optional uint64 controller_rx_time_millis = 4;
Yangster-maca8a30442018-10-13 23:46:34 -07004501 // idle time in millis
David Chen0b5c90c2018-01-25 16:51:49 -08004502 optional uint64 controller_idle_time_millis = 5;
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004503 // product of current(mA), voltage(V) and time(ms)
4504 optional uint64 energy_used = 6;
4505}
4506
Rajeev Kumar508a9bf2018-01-18 15:49:11 -08004507/*
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004508 * Logs the memory stats for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004509 *
4510 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService).
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004511 */
4512message ProcessMemoryState {
4513 // The uid if available. -1 means not available.
Yao Chenc40a19d2018-03-15 16:48:25 -07004514 optional int32 uid = 1 [(is_uid) = true];
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004515
4516 // The process name.
Rafal Slawikda51b932018-12-13 16:31:33 +00004517 // Usually package name, "system" for system server.
4518 // Provided by ActivityManagerService.
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004519 optional string process_name = 2;
4520
Rafal Slawikda51b932018-12-13 16:31:33 +00004521 // Current OOM score adjustment. Value read from ProcessRecord.
Yangster-maca8a30442018-10-13 23:46:34 -07004522 optional int32 oom_adj_score = 3;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004523
4524 // # of page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004525 optional int64 page_fault = 4;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004526
4527 // # of major page-faults
Yangster-maca8a30442018-10-13 23:46:34 -07004528 optional int64 page_major_fault = 5;
Rajeev Kumar8a9fa052018-01-25 19:03:09 -08004529
Rajeev Kumar90235992018-01-29 11:06:48 -08004530 // RSS
Rafal Slawik203c3db2019-09-25 19:53:01 +01004531 // Value is read from memory.stat, field total_rss if per-app memory
4532 // cgroups are enabled. Otherwise, value from /proc/pid/stat.
Rajeev Kumar90235992018-01-29 11:06:48 -08004533 optional int64 rss_in_bytes = 6;
4534
4535 // CACHE
Rafal Slawikda51b932018-12-13 16:31:33 +00004536 // Value is read from memory.stat, field total_cache if per-app memory
4537 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004538 optional int64 cache_in_bytes = 7;
4539
4540 // SWAP
Rafal Slawikda51b932018-12-13 16:31:33 +00004541 // Value is read from memory.stat, field total_swap if per-app memory
Rafal Slawik203c3db2019-09-25 19:53:01 +01004542 // cgroups are enabled. Otherwise, 0.
Rajeev Kumar90235992018-01-29 11:06:48 -08004543 optional int64 swap_in_bytes = 8;
Rafal Slawikaaf60892018-09-12 13:04:30 +01004544
Rafal Slawik203c3db2019-09-25 19:53:01 +01004545 // Deprecated: use ProcessMemoryHighWaterMark atom instead. Always -1.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004546 optional int64 rss_high_watermark_in_bytes = 9 [deprecated = true];
Rafal Slawik272a8162018-11-01 15:12:28 +00004547
Rafal Slawik203c3db2019-09-25 19:53:01 +01004548 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4549 optional int64 start_time_nanos = 10 [deprecated = true];
Ioannis Ilkos466ad6c2019-06-18 17:42:00 +01004550
Rafal Slawik203c3db2019-09-25 19:53:01 +01004551 // Deprecated: use ProcessMemorySnapshot atom instead. Always -1.
4552 optional int32 anon_rss_and_swap_in_kilobytes = 11 [deprecated = true];
Rafal Slawik08621582018-10-15 14:53:07 +01004553}
4554
4555/*
Rafal Slawik3bea8952018-11-15 12:39:33 +00004556 * Logs the memory high-water mark for a process.
Rafal Slawikda51b932018-12-13 16:31:33 +00004557 *
4558 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerServie)
4559 * and for selected native processes.
Rafal Slawik44b88142018-12-15 16:48:09 +00004560 *
4561 * Pulling this atom resets high-water mark counters for all processes.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004562 */
4563message ProcessMemoryHighWaterMark {
4564 // The uid if available. -1 means not available.
4565 optional int32 uid = 1 [(is_uid) = true];
4566
Rafal Slawikda51b932018-12-13 16:31:33 +00004567 // The process name.
4568 // Usually package name or process cmdline.
4569 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
Rafal Slawik3bea8952018-11-15 12:39:33 +00004570 optional string process_name = 2;
4571
Rafal Slawik239b6802019-09-09 18:46:01 +01004572 // Deprecated: use rss_high_water_mark_in_kilobytes instead. This field is
4573 // computed by converting kilobytes to bytes.
4574 optional int64 rss_high_water_mark_in_bytes = 3 [deprecated = true];
4575
Rafal Slawik3bea8952018-11-15 12:39:33 +00004576 // RSS high-water mark. Peak RSS usage of the process. Read from the VmHWM field in
4577 // /proc/PID/status.
Rafal Slawik239b6802019-09-09 18:46:01 +01004578 optional int32 rss_high_water_mark_in_kilobytes = 4;
Rafal Slawik3bea8952018-11-15 12:39:33 +00004579}
4580
4581/*
Rafal Slawik7efcefb2019-09-20 11:16:20 +01004582 * Logs the memory stats for a process.
4583 *
4584 * Pulled from StatsCompanionService for all managed processes (from ActivityManagerService)
4585 * and for selected native processes.
4586 */
4587message ProcessMemorySnapshot {
4588 // The uid if available. -1 means not available.
4589 optional int32 uid = 1 [(is_uid) = true];
4590
4591 // The process name.
4592 // Usually package name or process cmdline.
4593 // Provided by ActivityManagerService or read from /proc/PID/cmdline.
4594 optional string process_name = 2;
4595
4596 // The pid of the process.
4597 // Allows to disambiguate instances of the process.
4598 optional int32 pid = 3;
4599
4600 // The current OOM score adjustment value.
4601 // Read from ProcessRecord for managed processes.
4602 // Placeholder -1001 (OOM_SCORE_ADJ_MIN - 1, outside of allowed range) for native ones.
4603 optional int32 oom_score_adj = 4;
4604
4605 // The current RSS of the process.
4606 // VmRSS from /proc/pid/status.
4607 optional int32 rss_in_kilobytes = 5;
4608
4609 // The current anon RSS of the process.
4610 // RssAnon from /proc/pid/status.
4611 optional int32 anon_rss_in_kilobytes = 6;
4612
4613 // The current swap size of the process.
4614 // VmSwap from /proc/pid/status.
4615 optional int32 swap_in_kilobytes = 7;
4616
4617 // The sum of rss_in_kilobytes and swap_in_kilobytes.
4618 optional int32 anon_rss_and_swap_in_kilobytes = 8;
4619}
4620
4621/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004622 * Elapsed real time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004623 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004624message SystemElapsedRealtime {
David Chen0b5c90c2018-01-25 16:51:49 -08004625 optional uint64 time_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004626}
4627
4628/*
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004629 * Up time from SystemClock.
Chenjie Yu9da105b2018-01-13 12:41:08 -08004630 */
Chenjie Yu9d7720b2018-01-24 10:34:48 -08004631message SystemUptime {
4632 // Milliseconds since the system was booted.
4633 // This clock stops when the system enters deep sleep (CPU off, display dark, device waiting
4634 // for external input).
4635 // It is not affected by clock scaling, idle, or other power saving mechanisms.
David Chen0b5c90c2018-01-25 16:51:49 -08004636 optional uint64 uptime_millis = 1;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004637}
4638
4639/*
4640 * Reads from /proc/uid_concurrent_active_time which has the format:
4641 * active: X (X is # cores)
4642 * [uid0]: [time-0] [time-1] [time-2] ... (# entries = # cores)
4643 * [uid1]: [time-0] [time-1] [time-2] ... ...
4644 * ...
4645 * Time-N means the CPU time a UID spent running concurrently with N other processes.
4646 * The file contains a monotonically increasing count of time for a single boot.
4647 */
4648message CpuActiveTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004649 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004650 optional uint64 time_millis = 2;
Chenjie Yu9da105b2018-01-13 12:41:08 -08004651}
4652
4653/**
4654 * Reads from /proc/uid_concurrent_policy_time which has the format:
4655 * policy0: X policy4: Y (there are X cores on policy0, Y cores on policy4)
4656 * [uid0]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4657 * [uid1]: [time-0-0] [time-0-1] ... [time-1-0] [time-1-1] ...
4658 * ...
4659 * Time-X-Y means the time a UID spent on clusterX running concurrently with Y other processes.
4660 * The file contains a monotonically increasing count of time for a single boot.
4661 */
4662message CpuClusterTime {
Yao Chenc40a19d2018-03-15 16:48:25 -07004663 optional int32 uid = 1 [(is_uid) = true];
Chenjie Yuec676612018-03-07 09:19:17 -08004664 optional int32 cluster_index = 2;
David Chen0b5c90c2018-01-25 16:51:49 -08004665 optional uint64 time_millis = 3;
Chenjie Yu937d7422018-01-10 16:37:53 -08004666}
4667
4668/*
4669 * Pulls free disk space, for data, system partition and temporary directory.
4670 */
4671message DiskSpace {
4672 // available bytes in data partition
4673 optional uint64 data_available_bytes = 1;
4674 // available bytes in system partition
4675 optional uint64 system_available_bytes = 2;
4676 // available bytes in download cache or temp directories
4677 optional uint64 temp_available_bytes = 3;
4678}
Tej Singhbf972d92018-01-10 20:51:13 -08004679
4680/**
4681 * Pulls battery coulomb counter, which is the remaining battery charge in uAh.
Tej Singh9876a3b2019-01-11 14:28:35 -08004682 *
4683 * Pulled from StatsCompanionService.java
Tej Singhbf972d92018-01-10 20:51:13 -08004684 */
4685message RemainingBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004686 optional int32 charge_micro_ampere_hour = 1;
Tej Singhbf972d92018-01-10 20:51:13 -08004687}
4688
4689/**
4690 * Pulls battery capacity, which is the battery capacity when full in uAh.
Tej Singh40298312018-02-16 00:15:09 -08004691 * Pulled from:
4692 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
Tej Singhbf972d92018-01-10 20:51:13 -08004693 */
4694message FullBatteryCapacity {
Yangster-maca8a30442018-10-13 23:46:34 -07004695 optional int32 capacity_micro_ampere_hour = 1;
Tej Singh40298312018-02-16 00:15:09 -08004696}
4697
4698/**
Bookatz17f0d8a2018-09-13 12:56:32 -07004699 * Pulls battery voltage.
4700 * Pulled from:
4701 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4702 */
4703message BatteryVoltage {
4704 // The voltage of the battery, in millivolts.
Yangster-maca8a30442018-10-13 23:46:34 -07004705 optional int32 voltage_millivolt = 1;
Bookatz17f0d8a2018-09-13 12:56:32 -07004706}
4707
4708/**
Tej Singhb1dbc8b2018-11-19 15:49:47 -08004709 * Pulls battery level (percent full, from 0 to 100).
4710 *
4711 * Pulled from:
4712 * frameworks/base/cmds/statsd/src/external/ResourceHealthManagerPuller.cpp
4713 */
4714message BatteryLevel {
4715 // Battery level. Should be in [0, 100].
4716 optional int32 battery_level = 1;
4717}
4718
4719/**
Tej Singhd89137e2018-03-26 14:51:40 -07004720 * Pulls the temperature of various parts of the device.
4721 * The units are tenths of a degree Celsius. Eg: 30.3C is reported as 303.
Tej Singh40298312018-02-16 00:15:09 -08004722 *
Maggie White442b6312019-04-05 16:26:44 -07004723 * Pulled from StatsCompanionService.java
Tej Singh40298312018-02-16 00:15:09 -08004724 */
4725message Temperature {
Tej Singhb6070b92018-12-19 19:00:12 -08004726 // The type of temperature being reported. Eg. CPU, GPU, SKIN, BATTERY, BCL_.
Tej Singh40298312018-02-16 00:15:09 -08004727 optional android.os.TemperatureTypeEnum sensor_location = 1;
4728
4729 // The name of the temperature source. Eg. CPU0
4730 optional string sensor_name = 2;
4731
Tej Singhd89137e2018-03-26 14:51:40 -07004732 // Temperature in tenths of a degree C.
Tej Singhb6070b92018-12-19 19:00:12 -08004733 // For BCL, it is decimillivolt, decimilliamps, and percentage * 10.
Yangster-maca8a30442018-10-13 23:46:34 -07004734 optional int32 temperature_deci_celsius = 3;
Maggie White442b6312019-04-05 16:26:44 -07004735
4736 // Relative severity of the throttling, see enum definition.
4737 optional android.os.ThrottlingSeverityEnum severity = 4;
yroa1fe77c2018-02-26 14:22:54 -08004738}
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004739
4740/**
4741 * Pulls the statistics of calls to Binder.
4742 *
Olivier Gaillardd25f7a82018-09-12 14:28:48 +01004743 * Binder stats will be reset every time the data is pulled. It means it can only be pulled by one
4744 * config on the device.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004745 *
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004746 * Next tag: 15
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004747 */
4748message BinderCalls {
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004749 // UID of the process responsible for the binder transaction. It will be set if the process
4750 // executing the binder transaction attribute the transaction to another uid using
4751 // Binder.setThreadWorkSource().
4752 //
4753 // If not set, the value will be -1.
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004754 optional int32 uid = 1 [(is_uid) = true];
Olivier Gaillard720ec5b2018-10-30 17:32:56 +00004755 // UID of the process executing the binder transaction.
4756 optional int32 direct_caller_uid = 14;
Olivier Gaillard9ea238d2018-07-24 10:26:31 +01004757 // Fully qualified class name of the API call.
4758 //
4759 // This is a system server class name.
4760 //
4761 // TODO(gaillard): figure out if binder call stats includes data from isolated uids, if a uid
4762 // gets recycled and we have isolated uids, we might attribute the data incorrectly.
4763 // TODO(gaillard): there is a high dimensions cardinality, figure out if we should drop the less
4764 // commonly used APIs.
4765 optional string service_class_name = 2;
4766 // Method name of the API call. It can also be a transaction code if we cannot
4767 // resolve it to a name. See Binder#getTransactionName.
4768 //
4769 // This is a system server method name.
4770 optional string service_method_name = 3;
4771 // Total number of API calls.
4772 optional int64 call_count = 4;
4773 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4774 optional bool screen_interactive = 13;
4775 // Total number of API calls we have data recorded for. If we collected data for all the calls,
4776 // call_count will be equal to recorded_call_count.
4777 //
4778 // If recorded_call_count is different than call_count, it means data collection has been
4779 // sampled. All the fields below will be sampled in this case.
4780 optional int64 recorded_call_count = 12;
4781 // Number of exceptions thrown by the API.
4782 optional int64 recorded_exception_count = 5;
4783 // Total latency of all API calls.
4784 // Average can be computed using total_latency_micros / recorded_call_count.
4785 optional int64 recorded_total_latency_micros = 6;
4786 // Maximum latency of one API call.
4787 optional int64 recorded_max_latency_micros = 7;
4788 // Total CPU usage of all API calls.
4789 // Average can be computed using total_cpu_micros / recorded_call_count.
4790 // Total can be computed using total_cpu_micros / recorded_call_count * call_count.
4791 optional int64 recorded_total_cpu_micros = 8;
4792 // Maximum CPU usage of one API call.
4793 optional int64 recorded_max_cpu_micros = 9;
4794 // Maximum parcel reply size of one API call.
4795 optional int64 recorded_max_reply_size_bytes = 10;
4796 // Maximum parcel request size of one API call.
4797 optional int64 recorded_max_request_size_bytes = 11;
4798}
4799
4800/**
4801 * Pulls the statistics of exceptions during calls to Binder.
4802 *
4803 * Binder stats are cumulative from boot unless somebody reset the data using
4804 * > adb shell dumpsys binder_calls_stats --reset
4805 */
4806message BinderCallsExceptions {
4807 // Exception class name, e.g. java.lang.IllegalArgumentException.
4808 //
4809 // This is an exception class name thrown by the system server.
4810 optional string exception_class_name = 1;
4811 // Total number of exceptions.
4812 optional int64 exception_count = 2;
Olivier Gaillard00bfb1b2018-07-10 11:25:09 +01004813}
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004814
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004815/**
4816 * Pulls the statistics of message dispatching on HandlerThreads.
4817 *
4818 * Looper stats will be reset every time the data is pulled. It means it can only be pulled by one
4819 * config on the device.
4820 *
4821 * Next tag: 11
4822 */
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004823message LooperStats {
Marcin Oczeretkoec758722018-09-12 12:53:47 +01004824 // The uid that made a call to the System Server and caused the message to be enqueued.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004825 optional int32 uid = 1 [(is_uid) = true];
4826
4827 // Fully qualified class name of the handler target class.
4828 //
4829 // This field does not contain PII. This is a system server class name.
4830 optional string handler_class_name = 2;
4831
4832 // The name of the thread that runs the Looper.
4833 //
4834 // This field does not contain PII. This is a system server thread name.
4835 optional string looper_thread_name = 3;
4836
4837 // The name of the dispatched message.
4838 //
4839 // This field does not contain PII. This is a system server constant or class
4840 // name.
4841 optional string message_name = 4;
4842
4843 // Total number of successfully dispatched messages.
4844 optional int64 message_count = 5;
4845
4846 // Total number of messages that failed dispatching.
4847 optional int64 exception_count = 6;
4848
4849 // Total number of processed messages we have data recorded for. If we
4850 // collected data for all the messages, message_count will be equal to
4851 // recorded_message_count.
4852 //
4853 // If recorded_message_count is different than message_count, it means data
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004854 // collection has been sampled. The fields below will be sampled in this case.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004855 optional int64 recorded_message_count = 7;
4856
4857 // Total latency of all processed messages.
4858 // Average can be computed using recorded_total_latency_micros /
4859 // recorded_message_count.
4860 optional int64 recorded_total_latency_micros = 8;
4861
4862 // Total CPU usage of all processed message.
4863 // Average can be computed using recorded_total_cpu_micros /
4864 // recorded_message_count. Total can be computed using
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004865 // recorded_total_cpu_micros / recorded_message_count * message_count.
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004866 optional int64 recorded_total_cpu_micros = 9;
Marcin Oczeretko3e6494e2018-09-10 18:06:52 +01004867
4868 // True if the screen was interactive PowerManager#isInteractive at the end of the call.
4869 optional bool screen_interactive = 10;
Marcin Oczeretkoc06331a2018-10-02 13:00:38 +01004870
4871 // Max recorded CPU usage of all processed messages.
4872 optional int64 recorded_max_cpu_micros = 11;
4873
4874 // Max recorded latency of all processed messages.
4875 optional int64 recorded_max_latency_micros = 12;
4876
4877 // Total number of messages we tracked the dispatching delay for. If we
4878 // collected data for all the messages, message_count will be equal to
4879 // recorded_delay_message_count.
4880 //
4881 // If recorded_delay_message_count is different than message_count, it means data
4882 // collection has been sampled or/and not all messages specified the target dispatch time.
4883 // The fields below will be sampled in this case.
4884 optional int64 recorded_delay_message_count = 13;
4885
4886 // Total dispatching delay of all processed messages.
4887 // Calculated as a difference between the target dispatching time (Message.when)
4888 // and the actual dispatching time.
4889 // Average can be computed using recorded_total_delay_millis / recorded_delay_message_count.
4890 optional int64 recorded_total_delay_millis = 14;
4891
4892 // Max dispatching delay of all processed messages.
4893 // Calculated as a difference between the target dispatching time (Message.when)
4894 // and the actual dispatching time.
4895 optional int64 recorded_max_delay_millis = 15;
Marcin Oczeretkod8cc8592018-08-22 16:07:36 +01004896}
Tej Singh86dc9db2018-09-06 00:39:57 +00004897
4898/**
4899 * Pulls disk information, such as write speed and latency.
4900 */
4901message DiskStats {
4902 // Time taken to open, write 512B to, and close a file.
4903 // -1 if error performing the check.
4904 optional int64 data_write_latency_millis = 1;
4905
4906 optional bool file_based_encryption = 2;
4907
4908 // Recent disk write speed in kB/s.
4909 // -1 if error querying storageed.
4910 // 0 if data is unavailable.
4911 optional int32 recent_disk_write_speed = 3;
4912}
4913
4914
4915/**
4916 * Free and total bytes of the Data, Cache, and System partition.
4917 */
4918message DirectoryUsage {
4919 enum Directory {
4920 UNKNOWN = 0;
4921 DATA = 1;
4922 CACHE = 2;
4923 SYSTEM = 3;
4924 }
4925 optional Directory directory = 1;
4926 optional int64 free_bytes = 2;
4927 optional int64 total_bytes = 3;
4928}
4929
4930
4931/**
4932 * Size of an application: apk size, data size, and cache size.
4933 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4934 * Information is only reported for apps with the primary user (user 0).
4935 * Sizes are aggregated by package name.
4936 */
4937message AppSize {
4938 // Including uids will involve modifying diskstats logic.
4939 optional string package_name = 1;
4940 // App size in bytes. -1 if unavailable.
4941 optional int64 app_size_bytes = 2;
4942 // App data size in bytes. -1 if unavailable.
4943 optional int64 app_data_size_bytes = 3;
4944 // App cache size in bytes. -1 if unavailable.
4945 optional int64 app_cache_size_bytes = 4;
4946 // Time that the cache file was produced.
4947 // Uses System.currentTimeMillis(), which is wall clock time.
4948 optional int64 cache_time_millis = 5;
4949}
4950
4951
4952/**
4953 * Size of a particular category. Eg: photos, videos.
4954 * Reads from a cached file produced daily by DiskStatsLoggingService.java.
4955 */
4956message CategorySize {
4957 enum Category {
4958 UNKNOWN = 0;
4959 APP_SIZE = 1;
4960 APP_DATA_SIZE = 2;
4961 APP_CACHE_SIZE = 3;
4962 PHOTOS = 4;
4963 VIDEOS = 5;
4964 AUDIO = 6;
4965 DOWNLOADS = 7;
4966 SYSTEM = 8;
4967 OTHER = 9;
4968 }
4969 optional Category category = 1;
4970 // Category size in bytes.
4971 optional int64 size_bytes = 2;
4972 // Time that the cache file was produced.
4973 // Uses System.currentTimeMillis(), which is wall clock time.
4974 optional int64 cache_time_millis = 3;
4975}
Tej Singhd6d6d772018-09-05 17:41:25 -07004976
4977/**
Tej Singhe7726dc2018-09-21 11:42:12 -07004978 * Pulls per uid I/O stats. The stats are cumulative since boot.
4979 *
4980 * Read/write bytes are I/O events from a storage device
4981 * Read/write chars are data requested by read/write syscalls, and can be
4982 * satisfied by caching.
4983 *
4984 * Pulled from StatsCompanionService, which reads proc/uid_io/stats.
4985 */
4986message DiskIo {
4987 optional int32 uid = 1 [(is_uid) = true];
4988 optional int64 fg_chars_read = 2;
4989 optional int64 fg_chars_write = 3;
4990 optional int64 fg_bytes_read = 4;
4991 optional int64 fg_bytes_write = 5;
4992 optional int64 bg_chars_read = 6;
4993 optional int64 bg_chars_write = 7;
4994 optional int64 bg_bytes_read = 8;
4995 optional int64 bg_bytes_write = 9;
4996 optional int64 fg_fsync = 10;
4997 optional int64 bg_fsync= 11;
4998}
4999
5000
5001/**
Tej Singhd6d6d772018-09-05 17:41:25 -07005002 * Pulls the number of fingerprints for each user.
5003 *
Kevin Chyn1741a072019-01-17 11:54:40 -08005004 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
Tej Singhd6d6d772018-09-05 17:41:25 -07005005 */
joshmccloskey5dcb4082019-02-26 15:28:37 -08005006message NumFingerprintsEnrolled {
Tej Singhd6d6d772018-09-05 17:41:25 -07005007 // The associated user. Eg: 0 for owners, 10+ for others.
5008 // Defined in android/os/UserHandle.java
5009 optional int32 user = 1;
5010 // Number of fingerprints registered to that user.
joshmccloskey5dcb4082019-02-26 15:28:37 -08005011 optional int32 num_fingerprints_enrolled = 2;
Tej Singhd6d6d772018-09-05 17:41:25 -07005012}
Chenjie Yu12e5e672018-09-14 15:54:59 -07005013
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005014/**
joshmccloskey5dcb4082019-02-26 15:28:37 -08005015 * Pulls the number of faces for each user.
5016 *
5017 * Pulled from StatsCompanionService, which queries <Biometric>Manager.
5018 */
5019message NumFacesEnrolled {
5020 // The associated user. Eg: 0 for owners, 10+ for others.
5021 // Defined in android/os/UserHandle.java
5022 optional int32 user = 1;
5023 // Number of faces registered to that user.
5024 optional int32 num_faces_enrolled = 2;
5025}
5026/**
Philip P. Moltmann70b42ae2019-01-29 16:24:19 -08005027 * A mapping of role holder -> role
5028 */
5029message RoleHolder {
5030 // uid of the role holder
5031 optional int32 uid = 1 [(is_uid) = true];
5032
5033 // package name of the role holder
5034 optional string package_name = 2;
5035
5036 // the role held
5037 optional string role = 3;
5038}
5039
Yangsteraf9aee72018-10-12 09:26:16 -07005040message AggStats {
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005041 // These are all in byte resolution.
5042 optional int64 min = 1 [deprecated = true];
5043 optional int64 average = 2 [deprecated = true];
5044 optional int64 max = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005045
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005046 // These are all in kilobyte resolution. Can fit in int32, so smaller on the wire than the above
5047 // int64 fields.
5048 optional int32 mean_kb = 4;
5049 optional int32 max_kb = 5;
Yangsteraf9aee72018-10-12 09:26:16 -07005050}
5051
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005052// A reduced subset of process states; reducing the number of possible states allows more
5053// aggressive device-side aggregation of statistics and hence reduces metric upload size.
5054enum ProcessStateAggregated {
5055 PROCESS_STATE_UNKNOWN = 0;
5056 // Persistent system process.
5057 PROCESS_STATE_PERSISTENT = 1;
5058 // Top activity; actually any visible activity.
5059 PROCESS_STATE_TOP = 2;
5060 // Process binding to top or a foreground service.
5061 PROCESS_STATE_BOUND_TOP_OR_FGS = 3;
5062 // Processing running a foreground service.
5063 PROCESS_STATE_FGS = 4;
5064 // Important foreground process (ime, wallpaper, etc).
5065 PROCESS_STATE_IMPORTANT_FOREGROUND = 5;
5066 // Important background process.
5067 PROCESS_STATE_BACKGROUND = 6;
5068 // Process running a receiver.
5069 PROCESS_STATE_RECEIVER = 7;
5070 // All kinds of cached processes.
5071 PROCESS_STATE_CACHED = 8;
5072}
5073
5074// Next tag: 13
Yangsteraf9aee72018-10-12 09:26:16 -07005075message ProcessStatsStateProto {
5076 optional android.service.procstats.ScreenState screen_state = 1;
5077
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005078 optional android.service.procstats.MemoryState memory_state = 2 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005079
5080 // this enum list is from frameworks/base/core/java/com/android/internal/app/procstats/ProcessStats.java
5081 // and not frameworks/base/core/java/android/app/ActivityManager.java
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005082 optional android.service.procstats.ProcessState process_state = 3 [deprecated = true];
5083
5084 optional ProcessStateAggregated process_state_aggregated = 10;
Yangsteraf9aee72018-10-12 09:26:16 -07005085
5086 // Millisecond uptime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005087 optional int64 duration_millis = 4 [deprecated = true];
5088 // Same as above, but with minute resolution so it fits into an int32.
5089 optional int32 duration_minutes = 11;
Yangsteraf9aee72018-10-12 09:26:16 -07005090
5091 // Millisecond elapsed realtime duration spent in this state
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005092 optional int64 realtime_duration_millis = 9 [deprecated = true];
5093 // Same as above, but with minute resolution so it fits into an int32.
5094 optional int32 realtime_duration_minutes = 12;
Yangsteraf9aee72018-10-12 09:26:16 -07005095
5096 // # of samples taken
5097 optional int32 sample_size = 5;
5098
5099 // PSS is memory reserved for this process
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005100 optional AggStats pss = 6 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005101
5102 // USS is memory shared between processes, divided evenly for accounting
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005103 optional AggStats uss = 7 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005104
5105 // RSS is memory resident for this process
5106 optional AggStats rss = 8;
5107}
5108
5109// Next Tag: 7
5110message ProcessStatsProto {
5111 // Name of process.
5112 optional string process = 1;
5113
5114 // Uid of the process.
5115 optional int32 uid = 2;
5116
5117 // Information about how often kills occurred
5118 message Kill {
5119 // Count of excessive CPU kills
5120 optional int32 cpu = 1;
5121
5122 // Count of kills when cached
5123 optional int32 cached = 2;
5124
5125 // PSS stats during cached kill
5126 optional AggStats cached_pss = 3;
5127 }
Richard Gaywooda8fe1b42019-12-05 11:31:02 +00005128 optional Kill kill = 3 [deprecated = true];
Yangsteraf9aee72018-10-12 09:26:16 -07005129
5130 // Time and memory spent in various states.
5131 repeated ProcessStatsStateProto states = 5;
5132
5133 // Total time process has been running... screen_state, memory_state, and process_state
5134 // will not be set.
5135 optional ProcessStatsStateProto total_running_state = 6;
5136}
5137
5138message PackageServiceOperationStatsProto {
5139 // Operate enum: Started, Foreground, Bound, Executing
5140 optional android.service.procstats.ServiceOperationState operation = 1;
5141
5142 // Number of times the service was in this operation.
5143 optional int32 count = 2;
5144
5145 // Information about a state the service can be in.
5146 message StateStats {
5147 // Screen state enum.
5148 optional android.service.procstats.ScreenState screen_state = 1;
5149 // Memory state enum.
5150 optional android.service.procstats.MemoryState memory_state = 2;
5151
5152 // duration in milliseconds.
Yangster-maca8a30442018-10-13 23:46:34 -07005153 optional int64 duration_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005154 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005155 optional int64 realtime_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005156 }
5157 repeated StateStats state_stats = 3;
5158}
5159
5160message PackageServiceStatsProto {
5161 // Name of service component.
5162 optional string service_name = 1;
5163
5164 // The operation stats.
5165 // The package_name, package_uid, package_version, service_name will not be set to save space.
5166 repeated PackageServiceOperationStatsProto operation_stats = 2;
5167}
5168
5169message PackageAssociationSourceProcessStatsProto {
5170 // Uid of the process.
5171 optional int32 process_uid = 1;
5172 // Process name.
5173 optional string process_name = 2;
Chenjie Yub2ecc792019-01-17 10:27:26 -08005174 // Package name.
5175 optional string package_name = 7;
Yangsteraf9aee72018-10-12 09:26:16 -07005176 // Total count of the times this association appeared.
5177 optional int32 total_count = 3;
5178
5179 // Millisecond uptime total duration this association was around.
Yangster-maca8a30442018-10-13 23:46:34 -07005180 optional int64 total_duration_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005181
5182 // Total count of the times this association became actively impacting its target process.
5183 optional int32 active_count = 5;
5184
5185 // Information on one source in this association.
5186 message StateStats {
5187 // Process state enum.
5188 optional android.service.procstats.ProcessState process_state = 1;
5189 // Millisecond uptime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005190 optional int64 duration_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005191 // Millisecond elapsed realtime duration spent in this state
Yangster-maca8a30442018-10-13 23:46:34 -07005192 optional int64 realtime_duration_mmillis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005193 }
5194 repeated StateStats active_state_stats = 6;
5195}
5196
5197message PackageAssociationProcessStatsProto {
5198 // Name of the target component.
5199 optional string component_name = 1;
5200 // Information on one source in this association.
5201 repeated PackageAssociationSourceProcessStatsProto sources = 2;
5202}
5203
5204
5205message ProcessStatsPackageProto {
5206 // Name of package.
5207 optional string package = 1;
5208
5209 // Uid of the package.
5210 optional int32 uid = 2;
5211
5212 // Version of the package.
5213 optional int64 version = 3;
5214
5215 // Stats for each process running with the package loaded in to it.
5216 repeated ProcessStatsProto process_stats = 4;
5217
5218 // Stats for each of the package's services.
5219 repeated PackageServiceStatsProto service_stats = 5;
5220
5221 // Stats for each association with the package.
5222 repeated PackageAssociationProcessStatsProto association_stats = 6;
5223}
5224
5225message ProcessStatsSectionProto {
5226 // Elapsed realtime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005227 optional int64 start_realtime_millis = 1;
Yangsteraf9aee72018-10-12 09:26:16 -07005228
5229 // Elapsed realtime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005230 optional int64 end_realtime_millis = 2;
Yangsteraf9aee72018-10-12 09:26:16 -07005231
5232 // CPU uptime at start of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005233 optional int64 start_uptime_millis = 3;
Yangsteraf9aee72018-10-12 09:26:16 -07005234
5235 // CPU uptime at end of report.
Yangster-maca8a30442018-10-13 23:46:34 -07005236 optional int64 end_uptime_millis = 4;
Yangsteraf9aee72018-10-12 09:26:16 -07005237
5238 // System runtime library. e.g. "libdvm.so", "libart.so".
5239 optional string runtime = 5;
5240
5241 // whether kernel reports swapped pss.
5242 optional bool has_swapped_pss = 6;
5243
5244 // Data completeness. e.g. "complete", "partial", shutdown", or "sysprops".
5245 enum Status {
5246 STATUS_UNKNOWN = 0;
5247 STATUS_COMPLETE = 1;
5248 STATUS_PARTIAL = 2;
5249 STATUS_SHUTDOWN = 3;
5250 STATUS_SYSPROPS = 4;
5251 }
5252 repeated Status status = 7;
5253
Chenjie Yub2ecc792019-01-17 10:27:26 -08005254 // Number of pages available of various types and sizes, representation fragmentation.
5255 repeated ProcessStatsAvailablePagesProto available_pages = 10;
5256
Yangsteraf9aee72018-10-12 09:26:16 -07005257 // Stats for each process.
5258 repeated ProcessStatsProto process_stats = 8;
5259
5260 // Stats for each package.
5261 repeated ProcessStatsPackageProto package_stats = 9;
5262}
5263
Chenjie Yub2ecc792019-01-17 10:27:26 -08005264message ProcessStatsAvailablePagesProto {
5265 // Node these pages are in (as per /proc/pagetypeinfo)
5266 optional int32 node = 1;
5267
5268 // Zone these pages are in (as per /proc/pagetypeinfo)
5269 optional string zone = 2;
5270
5271 // Label for the type of these pages (as per /proc/pagetypeinfo)
5272 optional string label = 3;
5273
5274 // Distribution of number of pages available by order size. First entry in array is
5275 // order 0, second is order 1, etc. Each order increase is a doubling of page size.
5276 repeated int32 pages_per_order = 4;
5277}
5278
Chenjie Yu12e5e672018-09-14 15:54:59 -07005279/**
5280 * Pulled from ProcessStatsService.java
5281 */
5282message ProcStats {
Yangsteraf9aee72018-10-12 09:26:16 -07005283 optional ProcessStatsSectionProto proc_stats_section = 1;
5284}
5285
Chenjie Yuf910b7802019-01-11 16:08:20 -08005286/**
5287 * Pulled from ProcessStatsService.java
5288 */
5289message ProcStatsPkgProc {
5290 optional ProcessStatsSectionProto proc_stats_section = 1;
5291}
5292
Chris Wrencdea3b72019-11-22 16:58:17 -05005293// Next Tag: 2
5294message PackageRemoteViewInfoProto {
5295 optional string package_name = 1;
5296 // add per-package additional info here (like channels)
5297}
5298
5299// Next Tag: 2
5300message NotificationRemoteViewsProto {
5301 repeated PackageRemoteViewInfoProto package_remote_view_info = 1;
5302}
5303
5304/**
5305 * Pulled from NotificationManagerService.java
5306 */
5307message NotificationRemoteViews {
5308 optional NotificationRemoteViewsProto notification_remote_views = 1;
5309}
5310
Yangsteraf9aee72018-10-12 09:26:16 -07005311message PowerProfileProto {
5312 optional double cpu_suspend = 1;
5313
5314 optional double cpu_idle = 2;
5315
5316 optional double cpu_active = 3;
5317
5318 message CpuCluster {
5319 optional int32 id = 1;
5320 optional double cluster_power = 2;
5321 optional int32 cores = 3;
5322 repeated int64 speed = 4;
5323 repeated double core_power = 5;
5324 }
5325
5326 repeated CpuCluster cpu_cluster = 40;
5327
5328 optional double wifi_scan = 4;
5329
5330 optional double wifi_on = 5;
5331
5332 optional double wifi_active = 6;
5333
5334 optional double wifi_controller_idle = 7;
5335
5336 optional double wifi_controller_rx = 8;
5337
5338 optional double wifi_controller_tx = 9;
5339
5340 repeated double wifi_controller_tx_levels = 10;
5341
5342 optional double wifi_controller_operating_voltage = 11;
5343
5344 optional double bluetooth_controller_idle = 12;
5345
5346 optional double bluetooth_controller_rx = 13;
5347
5348 optional double bluetooth_controller_tx = 14;
5349
5350 optional double bluetooth_controller_operating_voltage = 15;
5351
5352 optional double modem_controller_sleep = 16;
5353
5354 optional double modem_controller_idle = 17;
5355
5356 optional double modem_controller_rx = 18;
5357
5358 repeated double modem_controller_tx = 19;
5359
5360 optional double modem_controller_operating_voltage = 20;
5361
5362 optional double gps_on = 21;
5363
5364 repeated double gps_signal_quality_based = 22;
5365
5366 optional double gps_operating_voltage = 23;
5367
5368 optional double bluetooth_on = 24;
5369
5370 optional double bluetooth_active = 25;
5371
5372 optional double bluetooth_at_cmd = 26;
5373
5374 optional double ambient_display = 27;
5375
5376 optional double screen_on = 28;
5377
5378 optional double radio_on = 29;
5379
5380 optional double radio_scanning = 30;
5381
5382 optional double radio_active = 31;
5383
5384 optional double screen_full = 32;
5385
5386 optional double audio = 33;
5387
5388 optional double video = 34;
5389
5390 optional double flashlight = 35;
5391
5392 optional double memory = 36;
5393
5394 optional double camera = 37;
5395
5396 optional double wifi_batched_scan = 38;
5397
5398 optional double battery_capacity = 39;
Chenjie Yu12e5e672018-09-14 15:54:59 -07005399}
Chenjie Yuab530202018-09-26 12:39:20 -07005400
5401/**
5402 * power_profile.xml and other constants for power model calculations.
5403 * Pulled from PowerProfile.java
5404 */
5405message PowerProfile {
Yangsteraf9aee72018-10-12 09:26:16 -07005406 optional PowerProfileProto power_profile = 1;
Howard Ro9a862de2018-10-11 16:03:33 -07005407}
Chenjie Yub35b5f72018-10-13 23:25:11 -07005408
5409/**
arangelovd5db50e2018-10-12 20:24:39 +01005410 * Logs when a user restriction was added or removed.
5411 *
5412 * Logged from:
5413 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5414 */
5415message UserRestrictionChanged {
5416 // The raw string of the user restriction as defined in UserManager.
5417 // Allowed values are defined in UserRestrictionsUtils#USER_RESTRICTIONS.
5418 optional string restriction = 1;
5419 // Whether the restriction is enabled or disabled.
5420 optional bool enabled = 2;
Howard Ro183c2bd2018-10-18 13:52:10 -07005421}
Yangster-mac308ea0c2018-10-22 13:10:25 -07005422
5423/**
5424 * Pulls process user time and system time. Puller takes a snapshot of all pids
5425 * in the system and returns cpu stats for those that are working at the time.
5426 * Dead pids will be dropped. Kernel processes are excluded.
5427 * Min cool-down is 5 sec.
5428 */
5429message ProcessCpuTime {
5430 optional int32 uid = 1 [(is_uid) = true];
5431
5432 optional string process_name = 2;
5433 // Process cpu time in user space, cumulative from boot/process start
5434 optional int64 user_time_millis = 3;
5435 // Process cpu time in system space, cumulative from boot/process start
5436 optional int64 system_time_millis = 4;
Rafal Slawikbf67d072018-10-23 11:07:54 +01005437}
Misha Wagner5a51e002018-10-03 15:04:09 +01005438
5439/**
5440 * Pulls the CPU usage for each thread.
5441 *
5442 * Read from /proc/$PID/task/$TID/time_in_state files.
5443 *
5444 * TODO(mishaw): This is an experimental atom. Issues with big/little CPU frequencies, and
5445 * time_in_state files not being present on some phones, have not been addressed. These should be
5446 * considered before a public release.
5447 */
5448message CpuTimePerThreadFreq {
5449 // UID that owns the process.
5450 optional int32 uid = 1 [(is_uid) = true];
5451 // ID of the process.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005452 optional int32 process_id = 2;
Misha Wagner5a51e002018-10-03 15:04:09 +01005453 // ID of the thread.
Misha Wagnerdfa548c2018-11-16 11:18:00 +00005454 optional int32 thread_id = 3;
Misha Wagner5a51e002018-10-03 15:04:09 +01005455 // Name of the process taken from `/proc/$PID/cmdline`.
5456 optional string process_name = 4;
5457 // Name of the thread taken from `/proc/$PID/task/$TID/comm`
5458 optional string thread_name = 5;
Misha Wagnerfde69582018-11-28 13:26:32 +00005459
5460 // Report eight different frequencies, and how much time is spent in each frequency. Frequencies
5461 // are given in KHz, and time is given in milliseconds since the thread started. All eight
5462 // frequencies are given here as the alternative is sending eight separate atoms. This method
5463 // significantly reduces the amount of data created
5464 optional int32 frequency1_khz = 6;
5465 optional int32 time1_millis = 7;
5466 optional int32 frequency2_khz = 8;
5467 optional int32 time2_millis = 9;
5468 optional int32 frequency3_khz = 10;
5469 optional int32 time3_millis = 11;
5470 optional int32 frequency4_khz = 12;
5471 optional int32 time4_millis = 13;
5472 optional int32 frequency5_khz = 14;
5473 optional int32 time5_millis = 15;
5474 optional int32 frequency6_khz = 16;
5475 optional int32 time6_millis = 17;
5476 optional int32 frequency7_khz = 18;
5477 optional int32 time7_millis = 19;
5478 optional int32 frequency8_khz = 20;
5479 optional int32 time8_millis = 21;
Misha Wagner5a51e002018-10-03 15:04:09 +01005480}
Bookatz75ee60422018-11-09 12:27:37 -08005481
5482/**
Bookatz366a4432018-11-20 09:42:33 -08005483 * Pulls information about the device's build.
5484 */
5485message BuildInformation {
5486 // Build.FINGERPRINT. A string that uniquely identifies this build. Do not parse.
5487 // E.g. may be composed of the brand, product, device, release, id, incremental, type, and tags.
5488 optional string fingerprint = 1;
5489
5490 // Build.BRAND. The consumer-visible brand with which the product/hardware will be associated.
5491 optional string brand = 2;
5492
5493 // Build.PRODUCT. The name of the overall product.
5494 optional string product = 3;
5495
5496 // Build.DEVICE. The name of the industrial design.
5497 optional string device = 4;
5498
5499 // Build.VERSION.RELEASE. The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas".
5500 optional string version_release = 5;
5501
5502 // Build.ID. E.g. a label like "M4-rc20".
5503 optional string id = 6;
5504
5505 // Build.VERSION.INCREMENTAL. The internal value used by the underlying source control to
5506 // represent this build.
5507 optional string version_incremental = 7;
5508
5509 // Build.TYPE. The type of build, like "user" or "eng".
5510 optional string type = 8;
5511
5512 // Build.TAGS. Comma-separated tags describing the build, like "unsigned,debug".
5513 optional string tags = 9;
5514}
5515
5516/**
Adam He420947c2019-01-23 15:59:09 -08005517 * Logs information about mismatched caller for content capture.
5518 *
5519 * Logged from:
5520 * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java
5521 */
5522message ContentCaptureCallerMismatchReported {
5523 optional string intended_package = 1;
5524 optional string calling_package = 2;
5525}
5526
5527/**
5528 * Logs information about content capture service events.
5529 *
5530 * Logged from:
5531 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5532 */
5533message ContentCaptureServiceEvents {
5534 // The type of event.
5535 enum Event {
5536 UNKNOWN = 0;
5537 ON_CONNECTED = 1;
5538 ON_DISCONNECTED = 2;
5539 SET_WHITELIST = 3;
5540 SET_DISABLED = 4;
5541 ON_USER_DATA_REMOVED = 5;
5542 }
5543 optional Event event = 1;
5544 // component/package of content capture service.
5545 optional string service_info = 2;
5546 // component/package of target.
5547 // it's a concatenated list of component/package for SET_WHITELIST event
5548 // separated by " ".
5549 optional string target_info = 3;
5550}
5551
5552/**
5553 * Logs information about content capture session events.
5554 *
5555 * Logged from:
5556 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5557 */
5558message ContentCaptureSessionEvents {
5559 // The type of event.
5560 enum Event {
5561 UNKNOWN = 0;
5562 ON_SESSION_STARTED = 1;
5563 ON_SESSION_FINISHED = 2;
5564 SESSION_NOT_CREATED = 3;
5565 }
5566 optional int32 session_id = 1;
5567 optional Event event = 2;
5568 // (n/a on session finished)
5569 optional int32 state_flags = 3;
5570 // component/package of content capture service.
5571 optional string service_info = 4;
5572 // component/package of app.
5573 // (n/a on session finished)
5574 optional string app_info = 5;
5575 optional bool is_child_session = 6;
5576}
5577
5578/**
5579 * Logs information about session being flushed.
5580 *
5581 * Logged from:
5582 * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java
5583 */
5584message ContentCaptureFlushed {
5585 optional int32 session_id = 1;
5586 // component/package of content capture service.
5587 optional string service_info = 2;
5588 // component/package of app.
5589 optional string app_info = 3;
5590 // session start/finish events
5591 optional int32 child_session_started = 4;
5592 optional int32 child_session_finished = 5;
5593 // count of view events.
5594 optional int32 view_appeared_count = 6;
5595 optional int32 view_disappeared_count = 7;
5596 optional int32 view_text_changed_count = 8;
5597
5598 // Flush stats.
5599 optional int32 max_events = 9;
5600 optional int32 idle_flush_freq = 10;
5601 optional int32 text_flush_freq = 11;
5602 optional int32 flush_reason = 12;
5603}
5604
5605/**
Bookatz75ee60422018-11-09 12:27:37 -08005606 * Pulls on-device BatteryStats power use calculations for the overall device.
5607 */
5608message DeviceCalculatedPowerUse {
Bookatz3dbc13a2018-12-21 12:16:51 -08005609 // Power used by the device in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5610 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5611 // Currently, this is from BatteryStatsHelper.getComputedPower() (not getTotalPower()).
5612 optional int64 computed_power_nano_amp_secs = 1;
Bookatz75ee60422018-11-09 12:27:37 -08005613}
5614
5615/**
5616 * Pulls on-device BatteryStats power use calculations broken down by uid.
5617 * This atom should be complemented by DeviceCalculatedPowerBlameOther, which contains the power use
5618 * that is attributed to non-uid items. They must all be included to get the total power use.
5619 */
5620message DeviceCalculatedPowerBlameUid {
5621 // Uid being blamed. Note: isolated uids have already been mapped to host uid.
5622 optional int32 uid = 1 [(is_uid) = true];
5623
Bookatz3dbc13a2018-12-21 12:16:51 -08005624 // Power used by this uid in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5625 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5626 optional int64 power_nano_amp_secs = 2;
Bookatz75ee60422018-11-09 12:27:37 -08005627}
5628
5629/**
5630 * Pulls on-device BatteryStats power use calculations that are not due to a uid, broken down by
5631 * drain type.
5632 * This atom should be complemented by DeviceCalculatedPowerBlameUid, which contains the blame that
5633 * is attributed uids. They must all be included to get the total power use.
5634 */
5635message DeviceCalculatedPowerBlameOther {
5636 // The type of item whose power use is being reported.
5637 enum DrainType {
5638 AMBIENT_DISPLAY = 0;
5639 // reserved 1; reserved "APP"; // Logged instead in DeviceCalculatedPowerBlameUid.
5640 BLUETOOTH = 2;
5641 CAMERA = 3;
5642 // Cell-standby
5643 CELL = 4;
5644 FLASHLIGHT = 5;
5645 IDLE = 6;
5646 MEMORY = 7;
5647 // Amount that total computed drain exceeded the drain estimated using the
5648 // battery level changes and capacity.
5649 OVERCOUNTED = 8;
5650 PHONE = 9;
5651 SCREEN = 10;
5652 // Amount that total computed drain was below the drain estimated using the
5653 // battery level changes and capacity.
5654 UNACCOUNTED = 11;
5655 // reserved 12; reserved "USER"; // Entire drain for a user. This is NOT supported.
5656 WIFI = 13;
5657 }
5658 optional DrainType drain_type = 1;
5659
Bookatz3dbc13a2018-12-21 12:16:51 -08005660 // Power used by this item in nAs (i.e. nanocoulombs (nC)), as computed by BatteryStats, since
5661 // BatteryStats last reset (i.e. roughly since device was last significantly charged).
5662 optional int64 power_nano_amp_secs = 2;
Rafal Slawik3bea8952018-11-15 12:39:33 +00005663}
arangelov4e994062018-11-13 16:12:38 +00005664
5665/**
5666 * Logs device policy features.
5667 *
5668 * Logged from:
5669 * frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
5670 * packages/apps/ManagedProvisioning/src/com/android/managedprovisioning/
5671 */
5672message DevicePolicyEvent {
5673 // The event id - unique for each event.
5674 optional android.stats.devicepolicy.EventId event_id = 1;
5675 // The admin package name.
5676 optional string admin_package_name = 2;
5677 // A generic integer parameter.
5678 optional int32 integer_value = 3;
5679 // A generic boolean parameter.
5680 optional bool boolean_value = 4;
5681 // A parameter specifying a time period in milliseconds.
5682 optional uint64 time_period_millis = 5;
5683 // A parameter specifying a list of package names, bundle extras or string parameters.
5684 optional android.stats.devicepolicy.StringList string_list_value = 6 [(log_mode) = MODE_BYTES];
5685}
shawnlinea5b66b2018-11-13 15:05:29 +08005686
5687/**
5688 * Logs when DocumentsUI is started, and how. Call this when DocumentsUI first starts up.
5689 *
5690 * Logged from:
5691 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5692 */
5693message DocsUILaunchReported {
5694 optional android.stats.docsui.LaunchAction launch_action = 1;
5695 optional bool has_initial_uri = 2;
5696 optional android.stats.docsui.MimeType mime_type = 3;
5697 optional android.stats.docsui.Root initial_root = 4;
5698}
5699
5700/**
5701 * Logs root/app visited event in file managers/picker. Call this when the user
5702 * taps on root/app in hamburger menu.
5703 *
5704 * Logged from:
5705 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5706 */
5707message DocsUIRootVisitedReported {
5708 optional android.stats.docsui.ContextScope scope = 1;
5709 optional android.stats.docsui.Root root = 2;
5710}
5711
5712/**
5713 * Logs file operation stats. Call this when a file operation has completed.
5714 *
5715 * Logged from:
5716 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5717 */
5718message DocsUIFileOperationReported {
5719 optional android.stats.docsui.Provider provider = 1;
5720 optional android.stats.docsui.FileOperation file_op = 2;
5721}
5722
5723/**
5724 * Logs file operation stats. Call this when a copy/move operation has completed with a specific
5725 * mode.
5726 *
5727 * Logged from:
5728 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5729 */
5730message DocsUIFileOperationCopyMoveModeReported {
5731 optional android.stats.docsui.FileOperation file_op = 1;
5732 optional android.stats.docsui.CopyMoveOpMode mode = 2;
5733}
5734
5735
5736/**
5737 * Logs file sub operation stats. Call this when a file operation has failed.
5738 *
5739 * Logged from:
5740 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5741 */
5742message DocsUIFileOperationFailureReported {
5743 optional android.stats.docsui.Authority authority = 1;
5744 optional android.stats.docsui.SubFileOperation sub_op = 2;
5745}
5746
5747/**
5748* Logs the cancellation of a file operation. Call this when a job is canceled
5749*
5750* Logged from:
5751* package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5752*/
5753message DocsUIFileOperationCanceledReported {
5754 optional android.stats.docsui.FileOperation file_op = 1;
5755}
5756
5757/**
5758 * Logs startup time in milliseconds.
5759 *
5760 * Logged from:
5761 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5762 */
5763message DocsUIStartupMsReported {
5764 optional int32 startup_millis = 1;
5765}
5766
5767/**
5768 * Logs the action that was started by user.
5769 *
5770 * Logged from:
5771 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5772 */
5773message DocsUIUserActionReported {
5774 optional android.stats.docsui.UserAction action = 1;
5775}
5776
5777/**
5778 * Logs the invalid type when invalid scoped access is requested.
5779 *
5780 * Logged from:
5781 * package/app/DocumentsUI/src/com/android/documentsui/ScopedAccessMetrics.java
5782 */
5783message DocsUIInvalidScopedAccessRequestReported {
5784 optional android.stats.docsui.InvalidScopedAccess type = 1;
Rafal Slawikda51b932018-12-13 16:31:33 +00005785}
Ben Murdochbab399f62018-12-06 11:01:38 +00005786
5787/**
shawnlina75e82d2019-01-07 10:31:12 +08005788 * Logs the package name that launches docsui picker mode.
5789 *
5790 * Logged from:
5791 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5792 */
5793message DocsUIPickerLaunchedFromReported {
5794 optional string package_name = 1;
5795}
5796
5797/**
5798 * Logs the search type.
5799 *
5800 * Logged from:
5801 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5802 */
5803message DocsUISearchTypeReported {
5804 optional android.stats.docsui.SearchType search_type = 1;
5805}
5806
5807/**
5808 * Logs the search mode.
5809 *
5810 * Logged from:
5811 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5812 */
5813message DocsUISearchModeReported {
5814 optional android.stats.docsui.SearchMode search_mode = 1;
5815}
5816
5817/**
5818 * Logs the pick result information.
5819 *
5820 * Logged from:
5821 * package/app/DocumentsUI/src/com/android/documentsui/Metrics.java
5822 */
5823message DocsUIPickResultReported {
5824 optional int32 total_action_count = 1;
5825 optional int64 duration_millis = 2;
5826 optional int32 file_count= 3;
5827 optional bool is_searching = 4;
5828 optional android.stats.docsui.Root picked_from = 5;
5829 optional android.stats.docsui.MimeType mime_type = 6;
5830 optional int32 repeatedly_pick_times = 7;
5831}
5832
5833/**
Ben Murdochbab399f62018-12-06 11:01:38 +00005834 * Logs when an app's memory is compacted.
5835 *
5836 * Logged from:
5837 * frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
5838 */
5839message AppCompacted {
5840 // The pid of the process being compacted.
5841 optional int32 pid = 1;
5842
5843 // The name of the process being compacted.
5844 optional string process_name = 2;
5845
5846 // The type of compaction.
5847 enum Action {
5848 UNKNOWN = 0;
5849 SOME = 1;
5850 FULL = 2;
Ben Murdoch35c14202019-04-09 11:00:53 +01005851 PERSISTENT = 3;
5852 BFGS = 4;
Ben Murdochbab399f62018-12-06 11:01:38 +00005853 }
Ben Murdoch01720b82018-12-19 18:03:44 +00005854 optional Action action = 3;
Ben Murdochbab399f62018-12-06 11:01:38 +00005855
5856 // Total RSS in kilobytes consumed by the process prior to compaction.
5857 optional int64 before_rss_total_kilobytes = 4;
5858
5859 // File RSS in kilobytes consumed by the process prior to compaction.
5860 optional int64 before_rss_file_kilobytes = 5;
5861
5862 // Anonymous RSS in kilobytes consumed by the process prior to compaction.
5863 optional int64 before_rss_anon_kilobytes = 6;
5864
5865 // Swap in kilobytes consumed by the process prior to compaction.
5866 optional int64 before_swap_kilobytes = 7;
5867
5868 // Total RSS in kilobytes consumed by the process after compaction.
5869 optional int64 after_rss_total_kilobytes = 8;
5870
5871 // File RSS in kilobytes consumed by the process after compaction.
5872 optional int64 after_rss_file_kilobytes = 9;
5873
5874 // Anonymous RSS in kilobytes consumed by the process after compaction.
5875 optional int64 after_rss_anon_kilobytes = 10;
5876
5877 // Swap in kilobytes consumed by the process after compaction.
5878 optional int64 after_swap_kilobytes = 11;
5879
5880 // The time taken to perform compaction in milliseconds.
5881 optional int64 time_to_compact_millis = 12;
5882
5883 // The last compaction action performed for this app.
5884 optional Action last_action = 13;
5885
Ben Murdoch01720b82018-12-19 18:03:44 +00005886 // The last time that compaction was attempted on this process in milliseconds
5887 // since boot, not including sleep (see SystemClock.uptimeMillis()).
5888 optional int64 last_compact_timestamp_ms_since_boot = 14;
Ben Murdochbab399f62018-12-06 11:01:38 +00005889
Ben Murdoch885c21b2019-03-15 18:02:04 +00005890 // The "setAdj" (i.e. previous) oom_score_adj at the time of compaction.
Ben Murdoch01720b82018-12-19 18:03:44 +00005891 optional int32 oom_score_adj = 15;
Ben Murdochbab399f62018-12-06 11:01:38 +00005892
5893 // The process state at the time of compaction.
5894 optional android.app.ProcessStateEnum process_state = 16 [default = PROCESS_STATE_UNKNOWN];
Ben Murdochfdc55932019-01-30 10:43:15 +00005895
5896 // Free ZRAM in kilobytes before compaction.
5897 optional int64 before_zram_free_kilobytes = 17;
5898
5899 // Free ZRAM in kilobytes after compaction.
5900 optional int64 after_zram_free_kilobytes = 18;
Ben Murdochbab399f62018-12-06 11:01:38 +00005901}
lifr157fc552018-12-12 16:38:04 +08005902
5903/**
lifrb6b90b62019-03-29 00:40:17 +08005904 * Logs a DNS lookup operation initiated by the system resolver on behalf of an application
5905 * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName().
5906 *
lifr1f74b052019-04-16 22:16:30 +08005907 * The NetworkDnsEventReported message represents the entire lookup operation, which may
5908 * result one or more queries to the recursive DNS resolvers. Those are individually logged
5909 * in DnsQueryEvents to enable computing error rates and network latency and timeouts
5910 * broken up by query type, transport, network interface, etc.
lifr157fc552018-12-12 16:38:04 +08005911 */
5912message NetworkDnsEventReported {
lifr1f74b052019-04-16 22:16:30 +08005913 optional android.stats.dnsresolver.EventType event_type = 1;
lifr157fc552018-12-12 16:38:04 +08005914
lifr1f74b052019-04-16 22:16:30 +08005915 optional android.stats.dnsresolver.ReturnCode return_code = 2;
lifrb6b90b62019-03-29 00:40:17 +08005916
5917 // The latency in microseconds of the entire DNS lookup operation.
lifr157fc552018-12-12 16:38:04 +08005918 optional int32 latency_micros = 3;
lifrb6b90b62019-03-29 00:40:17 +08005919
lifr1f74b052019-04-16 22:16:30 +08005920 // Only valid for event_type = EVENT_GETADDRINFO.
5921 optional int32 hints_ai_flags = 4;
lifrb6b90b62019-03-29 00:40:17 +08005922
lifr1f74b052019-04-16 22:16:30 +08005923 // Flags passed to android_res_nsend() defined in multinetwork.h
5924 // Only valid for event_type = EVENT_RESNSEND.
5925 optional int32 res_nsend_flags = 5;
lifrb6b90b62019-03-29 00:40:17 +08005926
lifrad9becc2019-05-20 11:04:41 +08005927 optional android.stats.dnsresolver.NetworkType network_type = 6;
lifrb6b90b62019-03-29 00:40:17 +08005928
5929 // The DNS over TLS mode on a specific netId.
lifr1f74b052019-04-16 22:16:30 +08005930 optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7;
lifrb6b90b62019-03-29 00:40:17 +08005931
5932 // Additional pass-through fields opaque to statsd.
5933 // The DNS resolver Mainline module can add new fields here without requiring an OS update.
lifr1f74b052019-04-16 22:16:30 +08005934 optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES];
lifr2b9fab72019-07-20 15:28:28 +08005935
5936 // The sample rate of DNS stats (to statsd) is 1/sampling_rate_denom.
5937 optional int32 sampling_rate_denom = 9;
lifr157fc552018-12-12 16:38:04 +08005938}
Chiachang Wangf6bedc22019-01-14 11:54:32 +08005939
5940/**
5941 * Logs when a data stall event occurs.
5942 *
5943 * Log from:
5944 * frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5945 */
5946message DataStallEvent {
5947 // Data stall evaluation type.
5948 // See frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java
5949 // Refer to the definition of DATA_STALL_EVALUATION_TYPE_*.
5950 optional int32 evaluation_type = 1;
5951 // See definition in data_stall_event.proto.
5952 optional com.android.server.connectivity.ProbeResult validation_result = 2;
5953 // See definition in data_stall_event.proto.
5954 optional android.net.NetworkCapabilitiesProto.Transport network_type = 3;
5955 // See definition in data_stall_event.proto.
5956 optional com.android.server.connectivity.WifiData wifi_info = 4 [(log_mode) = MODE_BYTES];
5957 // See definition in data_stall_event.proto.
5958 optional com.android.server.connectivity.CellularData cell_info = 5 [(log_mode) = MODE_BYTES];
5959 // See definition in data_stall_event.proto.
5960 optional com.android.server.connectivity.DnsEvent dns_event = 6 [(log_mode) = MODE_BYTES];
5961}
Christian Brunschenf86039e2018-12-21 12:26:14 +00005962
5963/*
5964 * Logs when RescueParty resets some set of experiment flags.
5965 *
5966 * Logged from:
5967 * frameworks/base/services/core/java/com/android/server/RescueParty.java
5968 */
5969message RescuePartyResetReported {
5970 // The rescue level of this reset. A value of 0 indicates missing or unknown level information.
5971 optional int32 rescue_level = 1;
5972}
Mathew Inwoodb375be52019-01-04 11:36:25 +00005973
5974/**
5975 * Logs when signed config is received from an APK, and if that config was applied successfully.
5976 * Logged from:
5977 * frameworks/base/services/core/java/com/android/server/signedconfig/SignedConfigService.java
5978 */
5979message SignedConfigReported {
5980 enum Type {
5981 UNKNOWN_TYPE = 0;
5982 GLOBAL_SETTINGS = 1;
5983 }
5984 optional Type type = 1;
5985
5986 // The final status of the signed config received.
5987 enum Status {
5988 UNKNOWN_STATUS = 0;
5989 APPLIED = 1;
5990 BASE64_FAILURE_CONFIG = 2;
5991 BASE64_FAILURE_SIGNATURE = 3;
5992 SECURITY_EXCEPTION = 4;
5993 INVALID_CONFIG = 5;
5994 OLD_CONFIG = 6;
5995 SIGNATURE_CHECK_FAILED = 7;
5996 NOT_APPLICABLE = 8;
Mathew Inwood610d0962019-01-15 11:50:28 +00005997 SIGNATURE_CHECK_FAILED_PROD_KEY_ABSENT = 9;
Mathew Inwoodb375be52019-01-04 11:36:25 +00005998 }
5999 optional Status status = 2;
6000
6001 // The version of the signed config processed.
6002 optional int32 version = 3;
6003
6004 // The package name that the config was extracted from.
6005 optional string from_package = 4;
6006
6007 enum Key {
6008 NO_KEY = 0;
6009 DEBUG = 1;
6010 PRODUCTION = 2;
6011 }
6012 // Which key was used to verify the config.
6013 optional Key verified_with = 5;
6014}
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006015
6016/*
6017 * Logs GNSS Network-Initiated (NI) location events.
6018 *
6019 * Logged from:
6020 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6021 */
6022message GnssNiEventReported {
6023 // The type of GnssNiEvent.
6024 enum EventType {
6025 UNKNOWN = 0;
6026 NI_REQUEST = 1;
6027 NI_RESPONSE = 2;
6028 }
6029 optional EventType event_type = 1;
6030
6031 // An ID generated by HAL to associate NI notifications and UI responses.
6032 optional int32 notification_id = 2;
6033
6034 // A type which distinguishes different categories of NI request, such as VOICE, UMTS_SUPL etc.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006035 optional android.server.location.GnssNiType ni_type = 3;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006036
6037 // NI requires notification.
6038 optional bool need_notify = 4;
6039
6040 // NI requires verification.
6041 optional bool need_verify = 5;
6042
6043 // NI requires privacy override, no notification/minimal trace.
6044 optional bool privacy_override = 6;
6045
6046 // Timeout period to wait for user response. Set to 0 for no timeout limit. Specified in
6047 // seconds.
6048 optional int32 timeout = 7;
6049
6050 // Default response when timeout.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006051 optional android.server.location.GnssUserResponseType default_response = 8;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006052
6053 // String representing the requester of the network inititated location request.
6054 optional string requestor_id = 9;
6055
6056 // Notification message text string representing the service(for eg. SUPL-service) who sent the
6057 // network initiated location request.
6058 optional string text = 10;
6059
6060 // requestorId decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006061 optional android.server.location.GnssNiEncodingType requestor_id_encoding = 11;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006062
6063 // Notification message text decoding scheme.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006064 optional android.server.location.GnssNiEncodingType text_encoding = 12;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006065
6066 // True if SUPL ES is enabled.
6067 optional bool is_supl_es_enabled = 13;
6068
6069 // True if GNSS location is enabled.
6070 optional bool is_location_enabled = 14;
6071
6072 // GNSS NI responses which define the response in NI structures.
Yu-Han Yang14d5fb42019-01-16 12:42:59 -08006073 optional android.server.location.GnssUserResponseType user_response = 15;
6074}
6075
6076/**
6077 * Logs GNSS non-framework (NFW) location notification.
6078 *
6079 * Logged from:
6080 * frameworks/base/services/core/java/com/android/server/location/GnssLocationProvider.java
6081 */
6082message GnssNfwNotificationReported {
6083 // Package name of the Android proxy application representing the non-framework entity that
6084 // requested location. Set to empty string if unknown.
6085 optional string proxy_app_package_name = 1;
6086
6087 // Protocol stack that initiated the non-framework location request.
6088 optional android.server.location.NfwProtocolStack protocol_stack = 2;
6089
6090 // Name of the protocol stack if protocol_stack field is set to OTHER_PROTOCOL_STACK. Otherwise,
6091 // set to empty string. This field is opaque to the framework and used for logging purposes.
6092 optional string other_protocol_stack_name = 3;
6093
6094 // Source initiating/receiving the location information.
6095 optional android.server.location.NfwRequestor requestor = 4;
6096
6097 // Identity of the endpoint receiving the location information. For example, carrier name, OEM
6098 // name, SUPL SLP/E-SLP FQDN, chipset vendor name, etc. This field is opaque to the framework
6099 // and used for logging purposes.
6100 optional string requestor_id = 5;
6101
6102 // Indicates whether location information was provided for this request.
6103 optional android.server.location.NfwResponseType response_type = 6;
6104
6105 // True if the device is in user initiated emergency session.
6106 optional bool in_emergency_mode = 7;
6107
6108 // True if cached location is provided.
6109 optional bool is_cached_location = 8;
6110
6111 // True if proxy app permission mismatch between framework and GNSS HAL.
6112 optional bool is_permission_mismatched = 9;
6113}
6114
6115/**
6116 * Logs GNSS configuration as defined in IGnssConfiguration.hal.
6117 *
6118 * Logged from:
6119 * frameworks/base/services/core/java/com/android/server/location/GnssConfiguration.java
6120 */
6121message GnssConfigurationReported {
6122 // SUPL host name.
6123 optional string supl_host = 1;
6124
6125 // SUPL port number.
6126 optional int32 supl_port = 2;
6127
6128 // C2K host name.
6129 optional string c2k_host = 3;
6130
6131 // C2K port number.
6132 optional int32 c2k_port = 4;
6133
6134 // The SUPL version requested by Carrier.
6135 optional int32 supl_ver = 5;
6136
6137 // The SUPL mode.
6138 optional android.server.location.SuplMode supl_mode = 6;
6139
6140 // True if NI emergency SUPL restrictions is enabled.
6141 optional bool supl_es = 7;
6142
6143 // LTE Positioning Profile settings
6144 optional android.server.location.LppProfile lpp_profile = 8;
6145
6146 // Positioning protocol on A-Glonass system.
6147 optional android.server.location.GlonassPosProtocol a_glonass_pos_protocol_select = 9;
6148
6149 // True if emergency PDN is used. Otherwise, regular PDN is used.
6150 optional bool use_emergency_pdn_for_emergency_supl= 10;
6151
6152 // Configurations of how GPS functionalities should be locked when user turns off GPS On setting.
6153 optional android.server.location.GpsLock gps_lock = 11;
6154
6155 // Number of seconds to extend the emergency session duration post emergency call.
6156 optional int32 es_extension_sec = 12;
6157
6158 // The full list of package names of proxy Android applications representing the non-framework
6159 // location access entities (on/off the device) for which the framework user has granted
6160 // non-framework location access permission. The package names are concatenated in one string
6161 // with spaces as separators.
6162 optional string enabled_proxy_app_package_name_list = 13;
Yu-Han Yang8a1b51d2018-12-26 22:18:31 -08006163}
Jack Yu95b64f32018-12-13 18:26:11 +08006164
6165/**
6166 * Logs when a NFC device's error occurred.
6167 * Logged from:
6168 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6169 * packages/apps/Nfc/src/com/android/nfc/cardemulation/AidRoutingManager.java
6170 */
6171message NfcErrorOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006172 enum Type {
6173 UNKNOWN = 0;
6174 CMD_TIMEOUT = 1;
6175 ERROR_NOTIFICATION = 2;
6176 AID_OVERFLOW = 3;
6177 }
6178 optional Type type = 1;
6179 // If it's nci cmd timeout, log the timeout command.
6180 optional uint32 nci_cmd = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006181
Alex Salod7c3eef2019-01-25 14:43:27 -08006182 optional uint32 error_ntf_status_code = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006183}
6184
6185/**
6186 * Logs when a NFC device's state changed event
6187 * Logged from:
6188 * packages/apps/Nfc/src/com/android/nfc/NfcService.java
6189 */
6190message NfcStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006191 enum State {
6192 UNKNOWN = 0;
6193 OFF = 1;
6194 ON = 2;
6195 ON_LOCKED = 3; // Secure Nfc enabled.
6196 CRASH_RESTART = 4; // NfcService watchdog timeout restart.
6197 }
6198 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006199}
6200
6201/**
6202 * Logs when a NFC Beam Transaction occurred.
6203 * Logged from:
6204 * packages/apps/Nfc/src/com/android/nfc/P2pLinkManager.java
6205 */
6206message NfcBeamOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006207 enum Operation {
6208 UNKNOWN = 0;
6209 SEND = 1;
6210 RECEIVE = 2;
6211 }
6212 optional Operation operation = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006213}
6214
6215/**
6216 * Logs when a NFC Card Emulation Transaction occurred.
6217 * Logged from:
6218 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostEmulationManager.java
6219 * packages/apps/Nfc/src/com/android/nfc/cardemulation/HostNfcFEmulationManager.java
6220 */
6221message NfcCardemulationOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006222 enum Category {
6223 UNKNOWN = 0;
6224 HCE_PAYMENT = 1;
6225 HCE_OTHER = 2;
6226 OFFHOST = 3;
6227 }
6228 // Transaction belongs to HCE payment or HCE other category, or offhost.
6229 optional Category category = 1;
6230 // SeName from transaction: SIMx, eSEx, HCE, HCEF.
6231 optional string se_name = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006232}
6233
6234/**
6235 * Logs when a NFC Tag event occurred.
6236 * Logged from:
6237 * packages/apps/Nfc/src/com/android/nfc/NfcDispatcher.java
6238 */
6239message NfcTagOccurred {
Alex Salod7c3eef2019-01-25 14:43:27 -08006240 enum Type {
6241 UNKNOWN = 0;
6242 URL = 1;
6243 BT_PAIRING = 2;
6244 PROVISION = 3;
6245 WIFI_CONNECT = 4;
6246 APP_LAUNCH = 5;
6247 OTHERS = 6;
6248 }
6249 optional Type type = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006250}
6251
6252/**
6253 * Logs when Hce transaction triggered
6254 * Logged from:
6255 * system/nfc/src/nfc/nfc/nfc_ncif.cc
6256 */
6257message NfcHceTransactionOccurred {
6258 // The latency period(in microseconds) it took for the first HCE data
6259 // exchange.
6260 optional uint32 latency_micros = 1;
6261}
6262
6263/**
6264 * Logs when SecureElement state event changed
6265 * Logged from:
6266 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6267 */
6268message SeStateChanged {
Alex Salod7c3eef2019-01-25 14:43:27 -08006269 enum State {
6270 UNKNOWN = 0;
6271 INITIALIZED = 1;
6272 DISCONNECTED = 2;
6273 CONNECTED = 3;
6274 HALCRASH = 4;
6275 }
6276 optional State state = 1;
Jack Yu95b64f32018-12-13 18:26:11 +08006277
Alex Salod7c3eef2019-01-25 14:43:27 -08006278 optional string state_change_reason = 2;
6279 // SIMx or eSEx.
6280 optional string terminal = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006281}
6282
6283/**
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006284 * Information about a permission grant request
6285 */
6286message PermissionGrantRequestResultReported {
6287 // unique value identifying an API call. A API call might result in multiple of these atoms
6288 optional int64 request_id = 1;
6289
6290 // UID of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006291 optional int32 uid = 2 [(is_uid) = true];
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006292
6293 // Name of package requesting the permission grant
Stanislav Zholnine8d073b2019-11-25 17:49:21 +00006294 optional string package_name = 3;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006295
6296 // The permission to be granted
6297 optional string permission_name = 4;
6298
6299 // If the permission was explicitly requested via the API or added by the system
6300 optional bool is_implicit = 5;
6301
6302 enum Result {
6303 UNDEFINED = 0;
6304 // permission request was ignored
6305 IGNORED = 1;
6306 // permission request was ignored because it was user fixed
6307 IGNORED_USER_FIXED = 2;
6308 // permission request was ignored because it was policy fixed
6309 IGNORED_POLICY_FIXED = 3;
6310 // permission was granted by user action
6311 USER_GRANTED = 4;
6312 // permission was automatically granted
6313 AUTO_GRANTED = 5;
6314 // permission was denied by user action
6315 USER_DENIED = 6;
6316 // permission was denied with prejudice by the user
6317 USER_DENIED_WITH_PREJUDICE = 7;
6318 // permission was automatically denied
6319 AUTO_DENIED = 8;
Svet Ganovd8eb8b22019-04-05 18:52:08 -07006320 // permission request was ignored because permission is restricted
6321 IGNORED_RESTRICTED_PERMISSION = 9;
Stanislav Zholnin066aefb2019-10-17 18:40:33 +01006322 // one time permission was granted by user action
6323 USER_GRANTED_ONE_TIME = 10;
Stanislav Zholnin8fde4fb2019-12-06 19:06:08 +00006324 // user ignored request by leaving the request screen without choosing any option
6325 USER_IGNORED = 11;
Evan Severson7c1cc8a2019-12-17 14:36:17 -08006326 // user granted the permission after being linked to settings
6327 USER_GRANTED_IN_SETTINGS = 12;
6328 // user denied the permission after being linked to settings
6329 USER_DENIED_IN_SETTINGS = 13;
6330 // user denied the permission with prejudice after being linked to settings
6331 USER_DENIED_WITH_PREJUDICE_IN_SETTINGS = 14;
6332 // permission was automatically revoked after one-time permission expired
6333 AUTO_ONE_TIME_PERMISSION_REVOKED = 15;
Philip P. Moltmanne0cf4e62019-01-29 14:22:48 -08006334 }
6335 // The result of the permission grant
6336 optional Result result = 6;
6337}
6338
6339/**
Jack Yu95b64f32018-12-13 18:26:11 +08006340 * Logs when Omapi API used
6341 * Logged from:
6342 * packages/apps/SecureElement/src/com/android/se/Terminal.java
6343 */
6344message SeOmapiReported {
Alex Salod7c3eef2019-01-25 14:43:27 -08006345 enum Operation {
6346 UNKNOWN = 0;
6347 OPEN_CHANNEL = 1;
6348 }
6349 optional Operation operation = 1;
6350 // SIMx or eSEx.
6351 optional string terminal = 2;
Jack Yu95b64f32018-12-13 18:26:11 +08006352
Alex Salod7c3eef2019-01-25 14:43:27 -08006353 optional string package_name = 3;
Jack Yu95b64f32018-12-13 18:26:11 +08006354}
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006355
6356/**
Alex Saloa060aee2019-01-21 14:36:41 -08006357 * Logs the dispatch latency of a broadcast during processing of BOOT_COMPLETED.
6358 * The dispatch latency is the dispatchClockTime - enqueueClockTime.
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006359 * Logged from:
6360 * frameworks/base/services/core/java/com/android/server/am/BroadcastQueue.java
6361 */
6362message BroadcastDispatchLatencyReported {
Alex Saloa060aee2019-01-21 14:36:41 -08006363 optional int64 dispatch_latency_millis = 1;
6364}
6365
6366/**
6367 * Logs AttentionManagerService attention check result.
6368 *
6369 * Logged from:
6370 * frameworks/base/services/core/java/com/android/server/attention/AttentionManagerService.java
6371 */
6372message AttentionManagerServiceResultReported {
6373 // See core/java/android/service/attention/AttentionService.java
6374 enum AttentionCheckResult {
6375 UNKNOWN = 20;
6376 ATTENTION_SUCCESS_ABSENT = 0;
6377 ATTENTION_SUCCESS_PRESENT = 1;
Alex Salodd028ba2019-04-17 13:33:49 -07006378 ATTENTION_FAILURE_UNKNOWN = 2;
6379 ATTENTION_FAILURE_CANCELLED = 3;
6380 ATTENTION_FAILURE_PREEMPTED = 4;
6381 ATTENTION_FAILURE_TIMED_OUT = 5;
6382 ATTENTION_FAILURE_CAMERA_PERMISSION_ABSENT = 6;
Alex Saloa060aee2019-01-21 14:36:41 -08006383 }
6384 optional AttentionCheckResult attention_check_result = 1 [default = UNKNOWN];
Ng Zhi An7ff7fdb2019-01-16 15:35:51 -08006385}
Michael Groover9e7b06e2018-12-28 19:55:51 -08006386
6387/**
6388 * Logs when an adb connection changes state.
6389 *
6390 * Logged from:
6391 * frameworks/base/services/core/java/com/android/server/adb/AdbDebuggingManager.java
6392 */
6393message AdbConnectionChanged {
6394 // The last time this system connected via adb, or 0 if the 'always allow' option was not
6395 // previously selected for this system.
6396 optional int64 last_connection_time_millis = 1;
6397
6398 // The time in ms within which a subsequent connection from an 'always allow' system is allowed
6399 // to reconnect via adb without user interaction.
6400 optional int64 auth_window_millis = 2;
6401
6402 // The state of the adb connection from frameworks/base/core/proto/android/debug/enums.proto.
6403 optional android.debug.AdbConnectionStateEnum state = 3;
6404
6405 // True if the 'always allow' option was selected for this system.
6406 optional bool always_allow = 4;
6407}
Carter Hsub8fd1e92019-01-11 15:24:45 +08006408
6409/*
6410 * Logs the reported speech DSP status.
6411 *
6412 * Logged from:
6413 * Vendor audio implementation.
6414 */
6415message SpeechDspStatReported {
6416 // The total Speech DSP uptime in milliseconds.
6417 optional int32 total_uptime_millis = 1;
6418 // The total Speech DSP downtime in milliseconds.
6419 optional int32 total_downtime_millis = 2;
6420 optional int32 total_crash_count = 3;
6421 optional int32 total_recover_count = 4;
6422}
Badhri Jagan Sridharan129c7292019-01-14 21:18:25 -08006423
6424/**
6425 * Logs USB connector contaminant status.
6426 *
6427 * Logged from: USB Service.
6428 */
6429message UsbContaminantReported {
6430 optional string id = 1;
6431 optional android.service.usb.ContaminantPresenceStatus status = 2;
6432}
Olivier Gaillard18d452202019-01-22 15:03:41 +00006433
6434/**
6435 * This atom is for debugging purpose.
6436 */
6437message DebugElapsedClock {
6438 // Monotically increasing value for each pull.
6439 optional int64 pull_count = 1;
6440 // Time from System.elapsedRealtime.
6441 optional int64 elapsed_clock_millis = 2;
6442 // Time from System.elapsedRealtime.
6443 optional int64 same_elapsed_clock_millis = 3;
6444 // Diff between current elapsed time and elapsed time from previous pull.
6445 optional int64 elapsed_clock_diff_millis = 4;
6446
6447 enum Type {
6448 TYPE_UNKNOWN = 0;
6449 ALWAYS_PRESENT = 1;
6450 PRESENT_ON_ODD_PULLS = 2;
6451 }
6452 // Type of behavior for the pulled data.
6453 optional Type type = 5;
6454}
6455
6456/**
6457 * This atom is for debugging purpose.
6458 */
6459message DebugFailingElapsedClock {
6460 // Monotically increasing value for each pull.
6461 optional int64 pull_count = 1;
6462 // Time from System.elapsedRealtime.
6463 optional int64 elapsed_clock_millis = 2;
6464 // Time from System.elapsedRealtime.
6465 optional int64 same_elapsed_clock_millis = 3;
6466 // Diff between current elapsed time and elapsed time from previous pull.
6467 optional int64 elapsed_clock_diff_millis = 4;
6468}
Steven Wuacef6bb2019-01-23 14:21:17 -05006469
6470/** Logs System UI bubbles event changed.
6471 *
6472 * Logged from:
6473 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles
6474 */
6475message BubbleUIChanged {
6476
6477 // The app package that is posting the bubble.
6478 optional string package_name = 1;
6479
6480 // The notification channel that is posting the bubble.
6481 optional string notification_channel = 2;
6482
6483 // The notification id associated with the posted bubble.
6484 optional int32 notification_id = 3;
6485
6486 // The position of the bubble within the bubble stack.
6487 optional int32 position = 4;
6488
6489 // The total number of bubbles within the bubble stack.
6490 optional int32 total_number = 5;
6491
6492 // User interactions with the bubble.
6493 enum Action {
6494 UNKNOWN = 0;
6495 POSTED = 1;
6496 UPDATED = 2;
6497 EXPANDED = 3;
6498 COLLAPSED = 4;
6499 DISMISSED = 5;
6500 STACK_DISMISSED = 6;
6501 STACK_MOVED = 7;
6502 HEADER_GO_TO_APP = 8;
6503 HEADER_GO_TO_SETTINGS = 9;
6504 PERMISSION_OPT_IN = 10;
6505 PERMISSION_OPT_OUT = 11;
Steven Wua62cb6a2019-02-15 17:12:51 -05006506 PERMISSION_DIALOG_SHOWN = 12;
Steven Wuacef6bb2019-01-23 14:21:17 -05006507 SWIPE_LEFT = 13;
6508 SWIPE_RIGHT = 14;
Steven Wua254dab2019-01-29 11:30:39 -05006509 STACK_EXPANDED = 15;
Steven Wu1684f2d52019-04-11 14:10:42 -04006510 FLYOUT = 16;
Steven Wuacef6bb2019-01-23 14:21:17 -05006511 }
6512 optional Action action = 6;
6513
6514 // Normalized screen position of the bubble stack. The range is between 0 and 1.
6515 optional float normalized_x_position = 7;
6516 optional float normalized_y_position = 8;
Steven Wu45e38ae2019-03-25 16:16:59 -04006517
6518 // Whether the bubble is unread. If it is unread, a dot is shown in the bubble stack icon.
6519 optional bool is_unread = 9;
Steven Wu8ba8ca92019-04-11 10:47:42 -04006520
6521 // Whether the bubble is an on-going one.
6522 optional bool is_ongoing = 10;
6523
6524 // Whether the bubble is produced by an app running in foreground.
Mady Mellordaa0a662019-06-24 16:42:35 -07006525 // This is deprecated and the value should be ignored.
6526 optional bool is_foreground = 11 [deprecated = true];
Steven Wuacef6bb2019-01-23 14:21:17 -05006527}
Kweku Adams8845d012018-12-11 20:06:45 -08006528
6529/**
Steven Wu552f63f2019-02-05 13:41:36 -05006530 * Logs System UI bubbles developer errors.
6531 *
6532 * Logged from:
6533 * frameworks/base/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
6534 */
6535message BubbleDeveloperErrorReported {
6536
6537 // The app package that is posting the bubble.
6538 optional string package_name = 1;
6539
6540 // Bubble developer error type enums.
6541 enum Error {
6542 UNKNOWN = 0;
6543 ACTIVITY_INFO_MISSING = 1;
6544 ACTIVITY_INFO_NOT_RESIZABLE = 2;
6545 DOCUMENT_LAUNCH_NOT_ALWAYS = 3;
6546 }
6547 optional Error error = 2 [default = UNKNOWN];
6548}
6549
6550/**
Kweku Adams8845d012018-12-11 20:06:45 -08006551 * Logs that a constraint for a scheduled job has changed.
6552 *
6553 * Logged from:
6554 * frameworks/base/services/core/java/com/android/server/job/controllers/JobStatus.java
6555 */
6556message ScheduledJobConstraintChanged {
6557 repeated AttributionNode attribution_node = 1;
6558
6559 // Name of the job.
6560 optional string job_name = 2;
6561
6562 optional com.android.server.job.ConstraintEnum constraint = 3;
6563
6564 enum State {
Kweku Adamse8db3ab2019-02-27 14:30:34 -08006565 UNKNOWN = 0;
6566 UNSATISFIED = 1;
6567 SATISFIED = 2;
Kweku Adams8845d012018-12-11 20:06:45 -08006568 }
6569 optional State state = 4;
6570}
Alex Salod7c3eef2019-01-25 14:43:27 -08006571
6572/**
6573 * Logs PowerManagerService screen timeout resets (extensions) that happen when an attention check
6574 * returns true.
6575 *
6576 * Logged from:
6577 * frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java
6578 */
6579message ScreenTimeoutExtensionReported {
6580 // Describes how many times in a row did the power manager reset the screen off timeout.
6581 optional uint32 consecutive_timeout_extended_count = 1;
6582}
Hui Yu885aca12019-01-10 17:11:34 -08006583
6584/*
6585* Logs number of milliseconds it takes to start a process.
6586* The definition of app process start time is from the app launch time to
6587* the time that Zygote finished forking the app process and loaded the
6588* application package's java classes.
6589
6590* This metric is different from AppStartOccurred which is for foreground
6591* activity only.
6592
6593* ProcessStartTime can report all processes (both foreground and background)
6594* start time.
6595*
6596* Logged from:
6597* frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
6598*/
6599message ProcessStartTime {
6600 // The uid of the ProcessRecord.
6601 optional int32 uid = 1 [(is_uid) = true];
6602
6603 // The process pid.
6604 optional int32 pid = 2;
6605
6606 // The process name.
6607 // Usually package name, "system" for system server.
6608 // Provided by ActivityManagerService.
6609 optional string process_name = 3;
6610
6611 enum StartType {
6612 UNKNOWN = 0;
6613 WARM = 1;
6614 HOT = 2;
6615 COLD = 3;
6616 }
6617
6618 // The start type.
6619 optional StartType type = 4;
6620
6621 // The elapsed realtime at the start of the process.
6622 optional int64 process_start_time_millis = 5;
6623
6624 // Number of milliseconds it takes to reach bind application.
6625 optional int32 bind_application_delay_millis = 6;
6626
6627 // Number of milliseconds it takes to finish start of the process.
6628 optional int32 process_start_delay_millis = 7;
6629
6630 // hostingType field in ProcessRecord, the component type such as "activity",
6631 // "service", "content provider", "broadcast" or other strings.
6632 optional string hosting_type = 8;
6633
6634 // hostingNameStr field in ProcessRecord. The component class name that runs
6635 // in this process.
6636 optional string hosting_name = 9;
6637}
6638
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006639/**
Ray Essick8ab04df2019-02-15 11:01:02 -08006640 * Track Media Codec usage
6641 * Logged from:
6642 * frameworks/av/media/libstagefright/MediaCodec.cpp
6643 * frameworks/av/services/mediaanalytics/statsd_codec.cpp
6644 */
6645message MediametricsCodecReported {
6646 optional int64 timestamp_nanos = 1;
6647 optional string package_name = 2;
6648 optional int64 package_version_code = 3;
6649 optional int64 media_apex_version = 4;
6650
6651 optional android.stats.mediametrics.CodecData codec_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6652}
6653
6654/**
6655 * Track Media Extractor (pulling video/audio streams out of containers) usage
6656 * Logged from:
6657 * frameworks/av/media/libstagefright/RemoteMediaExtractor.cpp
6658 * frameworks/av/services/mediaanalytics/statsd_extractor.cpp
6659 */
6660message MediametricsExtractorReported {
6661 optional int64 timestamp_nanos = 1;
6662 optional string package_name = 2;
6663 optional int64 package_version_code = 3;
6664 optional int64 media_apex_version = 4;
6665
6666 optional android.stats.mediametrics.ExtractorData extractor_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6667}
6668
6669/**
6670 * Track how we arbitrate between microphone/input requests.
6671 * Logged from
6672 * frameworks/av/services/audiopolicy/service/AudioPolicyInterfaceImpl.cpp
6673 * frameworks/av/services/mediaanalytics/statsd_audiopolicy.cpp
6674 */
6675message MediametricsAudiopolicyReported {
6676 optional int64 timestamp_nanos = 1;
6677 optional string package_name = 2;
6678 optional int64 package_version_code = 3;
6679 optional int64 media_apex_version = 4;
6680
6681 optional android.stats.mediametrics.AudioPolicyData audiopolicy_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6682}
6683
6684/**
6685 * Track how we arbitrate between microphone requests.
6686 * Logged from
6687 * frameworks/av/media/libaudioclient/AudioRecord.cpp
6688 * frameworks/av/services/mediaanalytics/statsd_audiorecord.cpp
6689 */
6690message MediametricsAudiorecordReported {
6691 optional int64 timestamp_nanos = 1;
6692 optional string package_name = 2;
6693 optional int64 package_version_code = 3;
6694 optional int64 media_apex_version = 4;
6695
6696 optional android.stats.mediametrics.AudioRecordData audiorecord_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6697}
6698
6699/**
6700 * Track how we arbitrate between microphone/input requests.
6701 * Logged from
6702 * frameworks/av/media/libnblog/ReportPerformance.cpp
6703 * frameworks/av/services/mediaanalytics/statsd_audiothread.cpp
6704 */
6705message MediametricsAudiothreadReported {
6706 optional int64 timestamp_nanos = 1;
6707 optional string package_name = 2;
6708 optional int64 package_version_code = 3;
6709 optional int64 media_apex_version = 4;
6710
6711 optional android.stats.mediametrics.AudioThreadData audiothread_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6712}
6713
6714/**
6715 * Track how we arbitrate between microphone/input requests.
6716 * Logged from
6717 * frameworks/av/media/libaudioclient/AudioTrack.cpp
6718 * frameworks/av/services/mediaanalytics/statsd_audiotrack.cpp
6719 */
6720message MediametricsAudiotrackReported {
6721 optional int64 timestamp_nanos = 1;
6722 optional string package_name = 2;
6723 optional int64 package_version_code = 3;
6724 optional int64 media_apex_version = 4;
6725
6726 optional android.stats.mediametrics.AudioTrackData audiotrack_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6727}
6728
6729/**
6730 * Track information about DRM framework performance
6731 * Logged from
6732 * frameworks/av/drm/libmediadrm/DrmHal.cpp
6733 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6734 */
6735message MediametricsMediadrmReported {
6736 optional int64 timestamp_nanos = 1;
6737 optional string package_name = 2;
6738 optional int64 package_version_code = 3;
6739 optional int64 media_apex_version = 4;
6740
6741 // vendor+description tell about which DRM plugin is in use on this device
6742 optional string vendor = 5;
6743 optional string description = 6;
6744 // from frameworks/av/drm/libmediadrm/protos/metrics.proto
6745 optional bytes framework_stats = 7 [(android.os.statsd.log_mode) = MODE_BYTES];
6746}
6747
6748/**
6749 * Track information about the widevine DRM plugin performance
6750 * Logged from
6751 * vendor/widevine/libwvdrmengine/cdm/metrics
6752 * frameworks/av/services/mediaanalytics/statsd_drm.cpp
6753 */
6754message MediametricsDrmWidevineReported {
6755 optional int64 timestamp_nanos = 1;
6756 optional string package_name = 2;
6757 optional int64 package_version_code = 3;
6758 optional int64 media_apex_version = 4;
6759
6760 optional bytes vendor_specific_stats = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6761}
6762
6763/**
6764 * Track information about recordings (e.g. camcorder)
6765 * Logged from
6766 * frameworks/av/media/libmediaplayerservice/StagefrightRecorder.cpp
6767 * frameworks/av/services/mediaanalytics/statsd_recorder.cpp
6768 */
6769message MediametricsRecorderReported {
6770 optional int64 timestamp_nanos = 1;
6771 optional string package_name = 2;
6772 optional int64 package_version_code = 3;
6773 optional int64 media_apex_version = 4;
6774
6775 optional android.stats.mediametrics.RecorderData recorder_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6776}
6777
6778/**
6779 * Track Media Player usage
6780 * Logged from:
6781 * frameworks/av/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp
6782 * frameworks/av/services/mediaanalytics/statsd_nuplayer.cpp
6783 */
6784message MediametricsNuPlayerReported {
6785 optional int64 timestamp_nanos = 1;
6786 optional string package_name = 2;
6787 optional int64 package_version_code = 3;
6788 optional int64 media_apex_version = 4;
6789
6790 optional android.stats.mediametrics.NuPlayerData nuplayer_data = 5 [(android.os.statsd.log_mode) = MODE_BYTES];
6791}
6792
6793/**
Robert Shiha4beed32019-08-19 14:15:23 -07006794 * Track Legacy DRM usage
6795 * Logged from
6796 * frameworks/av/drm/drmserver/DrmManager.cpp
6797 */
6798message MediametricsDrmManagerReported {
6799 optional int64 timestamp_nanos = 1;
6800 optional string package_name = 2;
6801 optional int64 package_version_code = 3;
6802 optional int64 media_apex_version = 4;
6803
6804 enum Method {
6805 METHOD_NOT_FOUND = -1;
6806 GET_CONSTRAINTS = 0;
6807 GET_METADATA = 1;
6808 CAN_HANDLE = 2;
6809 PROCESS_DRM_INFO = 3;
6810 ACQUIRE_DRM_INFO = 4;
6811 SAVE_RIGHTS = 5;
6812 GET_ORIGINAL_MIME_TYPE = 6;
6813 GET_DRM_OBJECT_TYPE = 7;
6814 CHECK_RIGHTS_STATUS = 8;
6815 REMOVE_RIGHTS = 9;
6816 REMOVE_ALL_RIGHTS = 10;
6817 OPEN_CONVERT_SESSION = 11;
6818 OPEN_DECRYPT_SESSION = 12;
6819 }
6820
6821 // plugin_id+description inform which Legacy DRM plugins are still in use on device
6822 optional string plugin_id = 5;
6823 optional string description = 6;
6824 optional Method method = 7;
6825 optional string mime_types = 8;
6826}
6827
6828/**
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006829 * State of a dangerous permission requested by a package
Stanislav Zholninccb82e42019-11-29 18:59:49 +00006830 * Pulled from: StatsCompanionService
6831*/
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006832message DangerousPermissionState {
6833 // Name of the permission
6834 optional string permission_name = 1;
6835
6836 // Uid of the package
6837 optional int32 uid = 2 [(is_uid) = true];
6838
6839 // Package requesting the permission
6840 optional string package_name = 3;
6841
6842 // If the permission is granted to the uid
6843 optional bool is_granted = 4;
Stanislav Zholnin75c3fd12019-05-21 13:10:51 +01006844
6845 // Permission flags as per android.content.pm.PermissionFlags
6846 optional int32 permission_flags = 5;
Philip P. Moltmannf21a3502019-01-30 09:53:04 -08006847}
6848
Michael Groover4a0ca942019-01-24 17:41:25 -08006849/**
6850 * Logs when a package is denied access to a device identifier based on the new access requirements.
6851 *
6852 * Logged from:
6853 * frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
6854 */
6855message DeviceIdentifierAccessDenied {
6856 // The name of the package denied access to the requested device identifier.
6857 optional string package_name = 1;
6858
6859 // The name of the device identifier method the package attempted to invoke.
6860 optional string method_name = 2;
6861
6862 // True if the package is preinstalled.
6863 optional bool is_preinstalled = 3;
6864
6865 // True if the package is privileged.
Sooraj Sasindran22b53f42019-11-27 15:57:33 -08006866 // Starting from Android 11, this boolean is not set and will always be false.
6867 optional bool is_priv_app = 4 [deprecated = true];
Michael Groover4a0ca942019-01-24 17:41:25 -08006868}
Chenjie Yue13f44a2019-02-07 17:51:38 -08006869
6870/**
Chenjie Yue13f44a2019-02-07 17:51:38 -08006871 * Pulls the ongoing mainline install train version code.
6872 * Pulled from StatsCompanionService
6873 */
6874message TrainInfo {
6875 optional int64 train_version_code = 1;
6876
6877 optional TrainExperimentIds train_experiment_id = 2;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006878
6879 optional string train_name = 3;
6880
6881 enum Status {
6882 UNKNOWN = 0;
6883 INSTALL_REQUESTED = 1;
6884 INSTALL_STARTED = 2;
6885 INSTALL_STAGED_NOT_READY = 3;
6886 INSTALL_STAGED_READY = 4;
6887 INSTALL_SUCCESS = 5;
Tej Singh403fe472019-04-30 12:54:21 -07006888 // Replaced by INSTALL_FAILURE_DOWNLOAD, INSTALL_FAILURE_STATE_MISMATCH,
6889 // and INSTALL_FAILURE_COMMIT.
6890 INSTALL_FAILURE = 6 [deprecated = true];
6891 // This enum is for installs that are manually cancelled via the Manual Update UI.
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006892 INSTALL_CANCELLED = 7;
6893 INSTALLER_ROLLBACK_REQUESTED = 8;
6894 INSTALLER_ROLLBACK_INITIATED = 9;
6895 INSTALLER_ROLLBACK_INITIATED_FAILURE = 10;
6896 INSTALLER_ROLLBACK_STAGED = 11;
6897 INSTALLER_ROLLBACK_STAGED_FAILURE = 12;
6898 INSTALLER_ROLLBACK_BOOT_TRIGGERED = 13;
6899 INSTALLER_ROLLBACK_BOOT_TRIGGERED_FAILURE = 14;
6900 INSTALLER_ROLLBACK_SUCCESS = 15;
6901 INSTALLER_ROLLBACK_FAILURE = 16;
Howard Ro174ed562019-04-07 22:17:58 -07006902 INSTALLER_ROLLBACK_STAGED_CANCEL_REQUESTED = 17;
6903 INSTALLER_ROLLBACK_STAGED_CANCEL_SUCCESS = 18;
6904 INSTALLER_ROLLBACK_STAGED_CANCEL_FAILURE = 19;
6905 INSTALL_STAGED_CANCEL_REQUESTED = 20;
6906 INSTALL_STAGED_CANCEL_SUCCESS = 21;
6907 INSTALL_STAGED_CANCEL_FAILURE = 22;
Tej Singh403fe472019-04-30 12:54:21 -07006908 INSTALL_FAILURE_DOWNLOAD = 23;
6909 INSTALL_FAILURE_STATE_MISMATCH = 24;
6910 INSTALL_FAILURE_COMMIT = 25;
Jonathan Nguyen5886a712020-01-16 10:34:21 -08006911 REBOOT_TRIGGERED = 26;
Muhammad Qureshif4ca8242019-03-01 09:20:15 -08006912 }
6913 optional Status status = 4;
Chenjie Yue13f44a2019-02-07 17:51:38 -08006914}
joshmccloskey8c3322e2019-01-09 18:25:57 -08006915
6916/**
6917 * Logs the gesture stage changed event.
6918 *
6919 * Logged from:
6920 * frameworks/base/packages/SystemUI/
6921 */
6922message AssistGestureStageReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006923 optional android.hardware.sensor.assist.AssistGestureStageEnum gesture_stage = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006924}
6925
6926/**
6927 * Logs the feedback type.
6928 *
6929 * Logged from:
6930 * frameworks/base/packages/SystemUI/
6931 */
6932message AssistGestureFeedbackReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006933 // Whether or not the gesture was used.
6934 optional android.hardware.sensor.assist.AssistGestureFeedbackEnum feedback_type = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006935}
6936
6937/**
6938 * Logs the progress.
6939 *
6940 * Logged from:
6941 * frameworks/base/packages/SystemUI/
6942 */
6943message AssistGestureProgressReported {
joshmccloskey99f39012019-02-20 14:45:08 -08006944 // [0,100] progress for the assist gesture.
6945 optional int32 progress = 1;
joshmccloskey8c3322e2019-01-09 18:25:57 -08006946}
Neil Fullerdb14b482019-02-05 19:44:44 +00006947
6948/*
6949 * Information about the time zone data on a device.
6950 */
6951message TimeZoneDataInfo {
6952 // A version identifier for the data set on device. e.g. "2018i"
6953 optional string tzdb_version = 1;
6954}
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006955
Yiwei Zhang4fb92892019-03-04 14:29:25 -08006956/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08006957 * Logs the GPU stats global health information.
6958 *
6959 * Logged from:
6960 * frameworks/native/services/gpuservice/gpustats/
6961 */
6962message GpuStatsGlobalInfo {
6963 // Package name of the gpu driver.
6964 optional string driver_package_name = 1;
6965
6966 // Version name of the gpu driver.
6967 optional string driver_version_name = 2;
6968
6969 // Version code of the gpu driver.
6970 optional int64 driver_version_code = 3;
6971
6972 // Build time of the gpu driver in UTC as seconds since January 1, 1970.
6973 optional int64 driver_build_time = 4;
6974
6975 // Total count of the gl driver gets loaded.
6976 optional int64 gl_loading_count = 5;
6977
6978 // Total count of the gl driver fails to be loaded.
6979 optional int64 gl_loading_failure_count = 6;
6980
6981 // Total count of the Vulkan driver gets loaded.
6982 optional int64 vk_loading_count = 7;
6983
6984 // Total count of the Vulkan driver fails to be loaded.
6985 optional int64 vk_loading_failure_count = 8;
Yiwei Zhang63852d2a2019-05-06 19:31:20 -07006986
6987 // Api version of the system Vulkan driver.
6988 optional int32 vulkan_version = 9;
6989
6990 // Api version of the system CPU Vulkan driver.
6991 optional int32 cpu_vulkan_version = 10;
6992
6993 // Api version of the system GLES driver.
6994 optional int32 gles_version = 11;
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07006995
6996 // Total count of the angle driver gets loaded.
6997 optional int64 angle_loading_count = 12;
6998
6999 // Total count of the angle driver fails to be loaded.
7000 optional int64 angle_loading_failure_count = 13;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007001}
7002
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007003/**
7004 * GPU driver loading time info.
7005 */
7006message GpuDriverLoadingTime {
7007 // List of all the driver loading times for this app. The list size is
7008 // capped at 50.
7009 repeated int64 driver_loading_time = 1;
7010}
7011
7012/**
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007013 * Logs the GPU stats per app health information.
7014 *
7015 * Logged from:
7016 * frameworks/native/services/gpuservice/gpustats/
7017 */
7018message GpuStatsAppInfo {
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007019 // Package name of the application that loads the gpu driver. Total number
7020 // of different packages is capped at 100.
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007021 optional string app_package_name = 1;
7022
7023 // Version code of the gpu driver this app loads.
7024 optional int64 driver_version_code = 2;
7025
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007026 // gl driver loading time info.
7027 optional GpuDriverLoadingTime gl_driver_loading_time = 3
7028 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007029
Yiwei Zhang4fb92892019-03-04 14:29:25 -08007030 // Vulkan driver loading time info.
7031 optional GpuDriverLoadingTime vk_driver_loading_time = 4
7032 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhanga0f5fef2019-05-08 16:30:47 -07007033
7034 // Angle driver loading time info.
7035 optional GpuDriverLoadingTime angle_driver_loading_time = 5
7036 [(android.os.statsd.log_mode) = MODE_BYTES];
Yiwei Zhang7c709302019-05-09 15:00:46 -07007037
7038 // CPU Vulkan implementation is in use.
7039 optional bool cpu_vulkan_in_use = 6;
Yiwei Zhanga7638612019-07-03 17:34:12 -07007040
7041 // App is not doing pre-rotation correctly.
7042 optional bool false_prerotation = 7;
Yiwei Zhangf02cf6b2019-12-20 14:51:07 -08007043
7044 // App creates GLESv1 context.
7045 optional bool gles_1_in_use = 8;
Yiwei Zhang5c81b632019-03-01 15:39:46 -08007046}
Rafal Slawikd4e87572019-03-12 13:08:38 +00007047
7048/*
7049 * Logs the size of the system ion heap.
7050 *
7051 * Pulled from StatsCompanionService.
7052 */
7053message SystemIonHeapSize {
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007054 // Deprecated due to limited support of ion stats in debugfs.
7055 // Use `IonHeapSize` instead.
7056 option deprecated = true;
7057
Rafal Slawikd4e87572019-03-12 13:08:38 +00007058 // Size of the system ion heap in bytes.
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007059 // Read from debugfs.
Rafal Slawikd4e87572019-03-12 13:08:38 +00007060 optional int64 size_in_bytes = 1;
7061}
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007062
Rafal Slawik77987ed2019-06-17 12:28:23 +01007063/*
Rafal Slawikbdd5a502020-01-14 14:14:29 +00007064 * Logs the total size of the ion heap.
7065 *
7066 * Pulled from StatsCompanionService.
7067 */
7068message IonHeapSize {
7069 // Total size of all ion heaps in kilobytes.
7070 // Read from: /sys/kernel/ion/total_heaps_kb.
7071 optional int32 total_size_kb = 1;
7072}
7073
7074/*
Rafal Slawik77987ed2019-06-17 12:28:23 +01007075 * Logs the per-process size of the system ion heap.
7076 *
7077 * Pulled from StatsCompanionService.
7078 */
7079message ProcessSystemIonHeapSize {
7080 // The uid if available. -1 means not available.
7081 optional int32 uid = 1 [(is_uid) = true];
7082
7083 // The process name (from /proc/PID/cmdline).
7084 optional string process_name = 2;
7085
7086 // Sum of sizes of all allocations.
7087 optional int32 total_size_in_kilobytes = 3;
7088
7089 // Number of allocations.
7090 optional int32 allocation_count = 4;
7091
7092 // Size of the largest allocation.
7093 optional int32 max_size_in_kilobytes = 5;
7094}
7095
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007096/**
7097 * Push network stack events.
7098 *
7099 * Log from:
7100 * frameworks/base/packages/NetworkStack/
7101 */
7102message NetworkStackReported {
Chiachang Wang729d2672019-03-27 17:33:52 +08007103 // The id that indicates the event reported from NetworkStack.
7104 optional int32 event_id = 1;
7105 // The data for the reported events.
Chiachang Wang0e88ebf2019-03-21 10:18:07 +08007106 optional android.stats.connectivity.NetworkStackEventData network_stack_event = 2 [(log_mode) = MODE_BYTES];
7107}
Carmen Agimofa769c152019-03-04 14:39:14 +00007108
7109/**
7110 * Logs the apps that are installed on the external storage.
7111 * Pulled from:
7112 * StatsCompanionService
7113 */
7114message AppsOnExternalStorageInfo {
7115 // The type of the external storage.
7116 optional android.stats.storage.ExternalStorageType external_storage_type = 1;
7117 // The name of the package that is installed on the external storage.
7118 optional string package_name = 2;
7119}
joshmccloskey34c1f8e2019-04-11 14:06:43 -07007120
7121/**
7122 * Logs the settings related to Face.
7123 * Logged from:
7124 * frameworks/base/services/core/java/com/android/server/stats
7125 */
7126message FaceSettings {
7127 // Whether or not face unlock is allowed on Keyguard.
7128 optional bool unlock_keyguard_enabled = 1;
7129 // Whether or not face unlock dismisses the Keyguard.
7130 optional bool unlock_dismisses_keyguard = 2;
7131 // Whether or not face unlock requires attention.
7132 optional bool unlock_attention_required = 3;
7133 // Whether or not face unlock is allowed for apps (through BiometricPrompt).
7134 optional bool unlock_app_enabled = 4;
7135 // Whether or not face unlock always requires user confirmation.
7136 optional bool unlock_always_require_confirmation = 5;
7137 // Whether or not a diverse set of poses are required during enrollment.
7138 optional bool unlock_diversity_required = 6;
7139}
Maggie White442b6312019-04-05 16:26:44 -07007140
7141/**
7142 * Logs cooling devices maintained by the kernel.
7143 *
7144 * Pulled from StatsCompanionService.java
7145 */
7146message CoolingDevice {
7147 // The type of cooling device being reported. Eg. CPU, GPU...
7148 optional android.os.CoolingTypeEnum device_location = 1;
7149 // The name of the cooling device source. Eg. CPU0
7150 optional string device_name = 2;
7151 // Current throttle state of the cooling device. The value can any unsigned
7152 // integer between 0 and max_state defined in its driver. 0 means device is
7153 // not in throttling, higher value means deeper throttling.
7154 optional int32 state = 3;
7155}
Ben Blount763a5d52019-04-10 11:48:58 -07007156
7157/**
7158 * Intelligence has several counter-type events that don't warrant a
7159 * full separate atom. These are primarily API call counters but also include
7160 * counters for feature usage and specific failure modes.
7161 *
7162 * Logged from the Intelligence mainline module.
7163 */
7164message IntelligenceEventReported {
Ben Blount3658fa72019-04-22 17:31:40 -07007165 // The event type.
Ben Blount763a5d52019-04-10 11:48:58 -07007166 optional android.stats.intelligence.EventType event_id = 1;
Ben Blount3658fa72019-04-22 17:31:40 -07007167 // Success, failure.
Ben Blount763a5d52019-04-10 11:48:58 -07007168 optional android.stats.intelligence.Status status = 2;
Ben Blount3658fa72019-04-22 17:31:40 -07007169 // How many times the event occured (to report a batch of high frequency events).
7170 optional int32 count = 3;
Ben Blounte3223f3d2019-05-02 22:49:03 -07007171 // How long the event took (sum of durations if count > 1)
Ben Blount3658fa72019-04-22 17:31:40 -07007172 optional int64 duration_millis = 4;
Ben Blount763a5d52019-04-10 11:48:58 -07007173}
Andrew T Nguyenee615d62019-05-01 14:40:19 -07007174
7175/**
Yuncheol Heod1a85d22019-05-08 17:13:42 -07007176 * Logs when Car Power state changed.
7177 *
7178 * Logged from:
7179 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7180 */
7181message CarPowerStateChanged {
7182 // States come from CpmsState in CarPowerManagementService.java.
7183 enum State {
7184 WAIT_FOR_VHAL = 0;
7185 ON = 1;
7186 SHUTDOWN_PREPARE = 2;
7187 WAIT_FOR_FINISH = 3;
7188 SUSPEND = 4;
7189 SIMULATE_SLEEP = 5;
7190 }
7191 optional State state = 1;
7192}
7193
7194/**
7195 * Logs whether GarageMode is entered.
7196 *
7197 * Logged from:
7198 * packages/services/Car/service/src/com/android/car/CarStatsLog.java
7199 */
7200message GarageModeInfo {
7201 // Whether GarageMode is entered.
7202 optional bool is_garage_mode = 1;
7203}
Martijn Coenencd95d462019-04-25 17:09:45 +02007204
7205/**
7206 * Historical app ops data per package.
7207 */
7208message AppOps {
7209 // Uid of the package requesting the op
7210 optional int32 uid = 1 [(is_uid) = true];
7211
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007212 // Name of the package performing the op
Martijn Coenencd95d462019-04-25 17:09:45 +02007213 optional string package_name = 2;
7214
7215 // operation id; maps to the OP_* constants in AppOpsManager.java
7216 optional int32 op_id = 3;
7217
7218 // The number of times the op was granted while the app was in the
7219 // foreground (only for trusted requests)
7220 optional int64 trusted_foreground_granted_count = 4;
7221
7222 // The number of times the op was granted while the app was in the
7223 // background (only for trusted requests)
7224 optional int64 trusted_background_granted_count = 5;
7225
7226 // The number of times the op was rejected while the app was in the
7227 // foreground (only for trusted requests)
7228 optional int64 trusted_foreground_rejected_count = 6;
7229
7230 // The number of times the op was rejected while the app was in the
7231 // background (only for trusted requests)
7232 optional int64 trusted_background_rejected_count = 7;
7233
7234 // For long-running operations, total duration of the operation
7235 // while the app was in the foreground (only for trusted requests)
7236 optional int64 trusted_foreground_duration_millis = 8;
7237
7238 // For long-running operations, total duration of the operation
7239 // while the app was in the background (only for trusted requests)
7240 optional int64 trusted_background_duration_millis = 9;
Stanislav Zholnin42d710e2019-11-28 13:11:54 +00007241
7242 // Whether AppOps is guarded by Runtime permission
7243 optional bool is_runtime_permission = 10;
Martijn Coenencd95d462019-04-25 17:09:45 +02007244}
Hongyi Zhang700137e2019-05-23 21:19:36 -07007245
7246/**
7247 * Location Manager API Usage information(e.g. API under usage,
7248 * API call's parameters).
7249 * Logged from:
7250 * frameworks/base/services/core/java/com/android/server/LocationManagerService.java
7251 */
7252message LocationManagerApiUsageReported {
7253
7254 // Indicating if usage starts or usage ends.
7255 optional android.stats.location.UsageState state = 1;
7256
7257 // LocationManagerService's API in use.
7258 // We can identify which API from LocationManager is
7259 // invoking current LMS API by the combination of
7260 // API parameter(e.g. is_listener_null, is_intent_null,
7261 // is_location_request_null)
7262 optional android.stats.location.LocationManagerServiceApi api_in_use = 2;
7263
7264 // Name of the package calling the API.
7265 optional string calling_package_name = 3;
7266
7267 // Type of the location provider.
7268 optional android.stats.location.ProviderType provider = 4;
7269
7270 // Quality of the location request
7271 optional android.stats.location.LocationRequestQuality quality = 5;
7272
7273 // The desired interval for active location updates, in milliseconds.
7274 // Bucketized to reduce cardinality.
7275 optional android.stats.location.LocationRequestIntervalBucket bucketized_interval = 6;
7276
7277 // Minimum distance between location updates, in meters.
7278 // Bucketized to reduce cardinality.
7279 optional android.stats.location.SmallestDisplacementBucket
7280 bucketized_smallest_displacement = 7;
7281
7282 // The number of location updates.
7283 optional int64 num_updates = 8;
7284
7285 // The request expiration time, in millisecond since boot.
7286 // Bucketized to reduce cardinality.
7287 optional android.stats.location.ExpirationBucket
7288 bucketized_expire_in = 9;
7289
7290 // Type of Callback passed in for this API.
7291 optional android.stats.location.CallbackType callback_type = 10;
7292
7293 // The radius of the central point of the alert
7294 // region, in meters. Only for API REQUEST_GEOFENCE.
7295 // Bucketized to reduce cardinality.
7296 optional android.stats.location.GeofenceRadiusBucket bucketized_radius = 11;
7297
7298 // Activity Importance of API caller.
7299 // Categorized to 3 types that are interesting from location's perspective.
7300 optional android.stats.location.ActivityImportance activiy_importance = 12;
7301}
Stanislav Zholnin3d215df12019-06-05 16:48:20 +01007302
7303/**
7304 * Information about a permission grant or denial made by user inside ReviewPermissionsFragment
7305 */
7306message ReviewPermissionsFragmentResultReported {
7307 // unique value identifying a permission group change. A permission group change might result
7308 // in multiple of these atoms
7309 optional int64 change_id = 1;
7310
7311 // UID of package the permission belongs to
7312 optional int32 uid = 2 [(is_uid) = true];
7313
7314 // Name of package the permission belongs to
7315 optional string package_name = 3;
7316
7317 // The permission to be granted
7318 optional string permission_name = 4;
7319
7320 // The result of the permission grant
7321 optional bool permission_granted = 5;
7322}
Stanislav Zholnin247d1b72019-06-06 21:28:44 +01007323
7324/**
7325* Information about results of permission upgrade by RuntimePermissionsUpgradeController
7326* Logged from: RuntimePermissionUpdgradeController
7327*/
7328message RuntimePermissionsUpgradeResult {
7329 // Permission granted as result of upgrade
7330 optional string permission_name = 1;
7331
7332 // UID of package granted permission
7333 optional int32 uid = 2 [(is_uid) = true];
7334
7335 // Name of package granted permission
7336 optional string package_name = 3;
Stanislav Zholninbdf620b2019-06-06 22:38:33 +01007337}
7338
7339/**
7340* Information about a buttons presented in GrantPermissionsActivty and choice made by user
7341*/
7342message GrantPermissionsActivityButtonActions {
7343 // Permission granted as result of upgrade
7344 optional string permission_group_name = 1;
7345
7346 // UID of package granted permission
7347 optional int32 uid = 2 [(is_uid) = true];
7348
7349 // Name of package requesting permission
7350 optional string package_name = 3;
7351
7352 // Buttons presented in the dialog - bit flags, bit numbers are in accordance with
7353 // LABEL_ constants in GrantPermissionActivity.java
7354 optional int32 buttons_presented = 4;
7355
7356 // Button clicked by user - same as bit flags in buttons_presented with only single bit set
7357 optional int32 button_clicked = 5;
7358}
Stanislav Zholnin375e2ab2019-05-29 13:07:35 +01007359
7360/**
7361 * Information about LocationAccessCheck notification presented to user
7362 */
7363message LocationAccessCheckNotificationAction {
7364
7365 // id which identifies single session of user interacting with permission controller
7366 optional int64 session_id = 1;
7367
7368 // Uid of package for which location access check is presented
7369 optional int32 package_uid = 2;
7370
7371 // Name of package for which location access check is presented
7372 optional string package_name = 3;
7373
7374 enum Result {
7375 UNDEFINED = 0;
7376 // notification was presented to the user
7377 NOTIFICATION_PRESENTED = 1;
7378 // notification was declined by the user
7379 NOTIFICATION_DECLINED = 2;
7380 // notification was clicked by the user
7381 NOTIFICATION_CLICKED = 3;
7382 }
7383
7384 // View / interaction recorded
7385 optional Result result = 4;
7386}
Stanislav Zholnin3e0f9bc2019-05-23 19:03:55 +01007387
7388/**
7389 * Information about a permission grant or revoke made by user inside AppPermissionFragment
7390 */
7391message AppPermissionFragmentActionReported {
7392 // id which identifies single session of user interacting with permission controller
7393 optional int64 session_id = 1;
7394
7395 // unique value identifying a permission group change. A permission group change might result
7396 // in multiple of these atoms
7397 optional int64 change_id = 2;
7398
7399 // UID of package the permission belongs to
7400 optional int32 uid = 3 [(is_uid) = true];
7401
7402 // Name of package the permission belongs to
7403 optional string package_name = 4;
7404
7405 // The permission to be granted
7406 optional string permission_name = 5;
7407
7408 // The result of the permission grant
7409 optional bool permission_granted = 6;
7410}
Stanislav Zholninc9dda9e2019-06-02 20:50:13 +01007411
7412/**
7413* Information about a AppPermissionFragment viewed by user
7414*/
7415message AppPermissionFragmentViewed {
7416 // id which identifies single session of user interacting with permission controller
7417 optional int64 session_id = 1;
7418
7419 // UID of package for which permissions are viewed
7420 optional int32 uid = 2 [(is_uid) = true];
7421
7422 // Name of package for which permissions are viewed
7423 optional string package_name = 3;
7424
7425 // Permission group viewed
7426 optional string permission_group_name = 4;
7427}
Stanislav Zholnindc3e2b32019-06-06 18:10:14 +01007428
7429/**
7430* Information about a AppPermissionsFragment viewed by user
7431*/
7432message AppPermissionsFragmentViewed {
7433 // id which identifies single session of user interacting with permission controller
7434 optional int64 session_id = 1;
7435
7436 // id which identifies single view as every view might have several logging records
7437 // with different package information attached
7438 optional int64 view_id = 2;
7439
7440 // Permission group viewed
7441 optional string permission_group_name = 3;
7442
7443 // UID of package for which permissions are viewed
7444 optional int32 uid = 4 [(is_uid) = true];
7445
7446 // Name of package for which permissions are viewed
7447 optional string package_name = 5;
7448
7449 // Category in which permission is included
7450 enum Category {
7451 UNDEFINED = 0;
7452 ALLOWED = 1;
7453 ALLOWED_FOREGROUND = 2;
7454 DENIED = 3;
7455 }
7456 optional Category category = 6;
7457}
Stanislav Zholnin32a89c12019-06-04 14:59:21 +01007458
7459/**
7460* Information about a PermissionAppsFragment viewed by user.
7461* Logged from ui/handheld/PermissionAppsFragment.java
7462*/
7463message PermissionAppsFragmentViewed {
7464 // id which identifies single session of user interacting with permission controller
7465 optional int64 session_id = 1;
7466
7467 // id which identifies single view as every view might have several logging records
7468 // with different package information attached
7469 optional int64 view_id = 2;
7470
7471 // Permission group viewed
7472 optional string permission_group_name = 3;
7473
7474 // UID of package for which permissions are viewed
7475 optional int32 uid = 4 [(is_uid) = true];
7476
7477 // Name of package for which permissions are viewed
7478 optional string package_name = 5;
7479
7480 // Category in which app is included
7481 enum Category {
7482 UNDEFINED = 0;
7483 ALLOWED = 1;
7484 ALLOWED_FOREGROUND = 2;
7485 DENIED = 3;
7486 }
7487 optional Category category = 6;
7488}
Tony Make2b1b672019-07-29 16:59:47 +01007489
7490/**
7491 * Logs when there is a smart selection related event.
7492 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7493 * Logged from: TextClassifierEventLogger.java
7494 */
7495message TextSelectionEvent {
7496 // A session ID.
7497 optional string session_id = 1;
7498
7499 // Event type of this event.
7500 optional android.stats.textclassifier.EventType event_type = 2;
7501
Tony Mak9c84bd22019-12-09 07:27:25 +00007502 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007503 optional string model_name = 3;
7504
7505 // Type of widget that was involved in triggering this event.
7506 optional android.stats.textclassifier.WidgetType widget_type = 4;
7507
7508 // Index of this event in a session.
7509 optional int32 event_index = 5;
7510
7511 // Entity type that is involved.
7512 optional string entity_type = 6;
7513
7514 // Relative word index of the start of the selection.
7515 optional int32 relative_word_start_index = 7;
7516
7517 // Relative word (exclusive) index of the end of the selection.
7518 optional int32 relative_word_end_index = 8;
7519
7520 // Relative word index of the start of the smart selection.
7521 optional int32 relative_suggested_word_start_index = 9;
7522
7523 // Relative word (exclusive) index of the end of the smart selection.
7524 optional int32 relative_suggested_word_end_index = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007525
7526 // Name of source package.
7527 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007528}
7529
7530/**
7531 * Logs when there is a smart linkify related event.
7532 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7533 * Logged from: TextClassifierEventLogger.java
7534 */
7535message TextLinkifyEvent {
7536 // A session ID.
7537 optional string session_id = 1;
7538
7539 // Event type of this event.
7540 optional android.stats.textclassifier.EventType event_type = 2;
7541
Tony Mak9c84bd22019-12-09 07:27:25 +00007542 // Name of the annotator model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007543 optional string model_name = 3;
7544
7545 // Type of widget that was involved in triggering this event.
7546 optional android.stats.textclassifier.WidgetType widget_type = 4;
7547
7548 // Index of this event in a session.
7549 optional int32 event_index = 5;
7550
7551 // Entity type that is involved.
7552 optional string entity_type = 6;
7553
7554 // Number of links detected.
7555 optional int32 num_links = 7;
7556
7557 // The total length of all links.
7558 optional int32 linked_text_length = 8;
7559
7560 // Length of input text.
7561 optional int32 text_length = 9;
7562
7563 // Time spent on generating links in ms.
7564 optional int64 latency_millis = 10;
Tony Mak98b59f02019-08-07 11:50:58 +01007565
7566 // Name of source package.
7567 optional string package_name = 11;
Tony Make2b1b672019-07-29 16:59:47 +01007568}
7569
7570/**
7571 * Logs when there is a conversation actions related event.
7572 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7573 * Logged from: TextClassifierEventLogger.java
7574 */
7575message ConversationActionsEvent {
7576 // A session ID.
7577 optional string session_id = 1;
7578
7579 // Event type of this event.
7580 optional android.stats.textclassifier.EventType event_type = 2;
7581
Tony Mak9c84bd22019-12-09 07:27:25 +00007582 // Name of the actions model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007583 optional string model_name = 3;
7584
7585 // Type of widget that was involved in triggering this event.
7586 optional android.stats.textclassifier.WidgetType widget_type = 4;
7587
7588 // The first entity type that is involved.
7589 optional string first_entity_type = 5;
7590
7591 // The second entity type that is involved.
7592 optional string second_entity_type = 6;
7593
7594 // The third entity type that is involved.
7595 optional string third_entity_type = 7;
7596
7597 // The score of the first entity type.
7598 optional float score = 8;
Tony Mak98b59f02019-08-07 11:50:58 +01007599
7600 // Name of source package.
7601 optional string package_name = 9;
Tony Mak9c84bd22019-12-09 07:27:25 +00007602
7603 // Name of the annotator model that is involved in this event.
7604 optional string annotator_model_name = 10;
Tony Make2b1b672019-07-29 16:59:47 +01007605}
7606
7607/**
7608 * Logs when there is a language detection related event.
7609 * See frameworks/base/core/java/android/view/textclassifier/TextClassifierEvent.java
7610 * Logged from: TextClassifierEventLogger.java
7611 */
7612message LanguageDetectionEvent {
7613 // A session ID.
7614 optional string session_id = 1;
7615
7616 // Event type of this event.
7617 optional android.stats.textclassifier.EventType event_type = 2;
7618
Tony Mak9c84bd22019-12-09 07:27:25 +00007619 // Name of the language detection model that is involved in this event.
Tony Make2b1b672019-07-29 16:59:47 +01007620 optional string model_name = 3;
7621
7622 // Type of widget that was involved in triggering this event.
7623 optional android.stats.textclassifier.WidgetType widget_type = 4;
7624
7625 // Detected language.
7626 optional string language_tag = 5;
7627
7628 // Score of the detected language.
7629 optional float score = 6;
7630
7631 // Position of this action.
7632 optional int32 action_index = 7;
Tony Mak98b59f02019-08-07 11:50:58 +01007633
7634 // Name of source package.
7635 optional string package_name = 8;
Tony Make2b1b672019-07-29 16:59:47 +01007636}
Tianjie Xu167c3db2019-07-22 14:25:14 -07007637
7638/**
7639 * Information about an OTA update attempt by update_engine.
7640 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7641 */
7642message UpdateEngineUpdateAttemptReported {
7643 // The number of attempts for the update engine to apply a given payload.
7644 optional int32 attempt_number = 1;
7645
7646 optional android.stats.otaupdate.PayloadType payload_type = 2;
7647
7648 // The total time in minutes for the update engine to apply a given payload.
7649 // The time is calculated by calling clock_gettime() / CLOCK_BOOTTIME; and
7650 // it's increased when the system is sleeping.
7651 optional int32 duration_boottime_in_minutes = 3;
7652
7653 // The total time in minutes for the update engine to apply a given payload.
7654 // The time is calculated by calling clock_gettime() / CLOCK_MONOTONIC_RAW;
7655 // and it's not increased when the system is sleeping.
7656 optional int32 duration_monotonic_in_minutes = 4;
7657
7658 // The size of the payload in MiBs.
7659 optional int32 payload_size_mib = 5;
7660
7661 // The attempt result reported by the update engine for an OTA update.
7662 optional android.stats.otaupdate.AttemptResult attempt_result = 6;
7663
7664 // The error code reported by the update engine after an OTA update attempt
7665 // on A/B devices.
7666 optional android.stats.otaupdate.ErrorCode error_code = 7;
7667
7668 // The build fingerprint of the source system. The value is read from a
7669 // system property when the device takes the update. e.g.
7670 // Android/aosp_sailfish/sailfish:10/QP1A.190425.004/5507117:userdebug/test-keys
7671 optional string source_fingerprint = 8;
7672}
7673
7674/**
7675 * Information about all the attempts the device make before finishing the
7676 * successful update.
7677 * Logged from platform/system/update_engine/metrics_reporter_android.cc
7678 */
7679message UpdateEngineSuccessfulUpdateReported {
7680 // The number of attempts for the update engine to apply the payload for a
7681 // successful update.
7682 optional int32 attempt_count = 1;
7683
7684 optional android.stats.otaupdate.PayloadType payload_type = 2;
7685
7686 optional int32 payload_size_mib = 3;
7687
7688 // The total number of bytes downloaded by update_engine since the last
7689 // successful update.
7690 optional int32 total_bytes_downloaded_mib = 4;
7691
7692 // The ratio in percentage of the over-downloaded bytes compared to the
7693 // total bytes needed to successfully install the update. e.g. 200 if we
7694 // download 200MiB in total for a 100MiB package.
7695 optional int32 download_overhead_percentage = 5;
7696
7697 // The total time in minutes for the update engine to apply the payload for a
7698 // successful update.
7699 optional int32 total_duration_minutes = 6;
7700
7701 // The number of reboot of the device during a successful update.
7702 optional int32 reboot_count = 7;
7703}
Alec Mourie088e762019-07-02 13:10:55 -07007704
7705/**
Kenny Root4eacaaa2020-01-08 20:48:13 -08007706 * Reported when the RebootEscrow HAL has attempted to recover the escrowed
7707 * key to indicate whether it was successful or not.
7708 *
7709 * Logged from:
7710 * frameworks/base/services/core/java/com/android/server/locksettings/RebootEscrowManager.java
7711 */
7712message RebootEscrowRecoveryReported {
7713 optional bool successful = 1;
7714}
7715
7716/**
Alec Mourie088e762019-07-02 13:10:55 -07007717 * Global display pipeline metrics reported by SurfaceFlinger.
7718 * Pulled from:
7719 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7720 */
7721message SurfaceflingerStatsGlobalInfo {
7722 // Total number of frames presented during the tracing period
7723 optional int64 total_frames = 1;
7724 // Total number of frames missed
7725 optional int64 missed_frames = 2;
7726 // Total number of frames that fell back to client composition
7727 optional int64 client_composition_frames = 3;
7728 // Total time the display was turned on
7729 optional int64 display_on_millis = 4;
7730 // Total time that was spent performing animations.
7731 // This is derived from the present-to-present layer histogram
7732 optional int64 animation_millis = 5;
7733}
7734
7735/**
7736 * Per-layer display pipeline metrics reported by SurfaceFlinger.
7737 * The number of layers uploaded will be restricted due to size limitations.
7738 * Pulled from:
7739 * frameworks/native/services/surfaceflinger/TimeStats/TimeStats.cpp
7740 */
7741message SurfaceflingerStatsLayerInfo {
7742 // The layer for this set of metrics
7743 // For now we can infer that the package name is included in the layer
7744 // name.
7745 optional string layer_name = 1;
7746 // Total number of frames presented
7747 optional int64 total_frames = 2;
7748 // Total number of dropped frames while latching a buffer for this layer.
7749 optional int64 dropped_frames = 3;
7750 // Set of timings measured between successive presentation timestamps.
7751 optional FrameTimingHistogram present_to_present = 4
7752 [(android.os.statsd.log_mode) = MODE_BYTES];
7753 // Set of timings measured from when an app queued a buffer for
7754 // presentation, until the buffer was actually presented to the
7755 // display.
7756 optional FrameTimingHistogram post_to_present = 5
7757 [(android.os.statsd.log_mode) = MODE_BYTES];
7758 // Set of timings measured from when a buffer is ready to be presented,
7759 // until the buffer was actually presented to the display.
7760 optional FrameTimingHistogram acquire_to_present = 6
7761 [(android.os.statsd.log_mode) = MODE_BYTES];
7762 // Set of timings measured from when a buffer was latched by
7763 // SurfaceFlinger, until the buffer was presented to the display
7764 optional FrameTimingHistogram latch_to_present = 7
7765 [(android.os.statsd.log_mode) = MODE_BYTES];
7766 // Set of timings measured from the desired presentation to the actual
7767 // presentation time
7768 optional FrameTimingHistogram desired_to_present = 8
7769 [(android.os.statsd.log_mode) = MODE_BYTES];
7770 // Set of timings measured from when an app queued a buffer for
7771 // presentation, until the buffer was ready to be presented.
7772 optional FrameTimingHistogram post_to_acquire = 9
7773 [(android.os.statsd.log_mode) = MODE_BYTES];
7774}
7775
7776/**
7777 * Histogram of frame counts bucketed by time in milliseconds.
7778 * Because of size limitations, we hard-cap the number of buckets, with
7779 * buckets for corresponding to larger milliseconds being less precise.
7780 */
7781message FrameTimingHistogram {
7782 // Timings in milliseconds that describes a set of histogram buckets
7783 repeated int32 time_millis_buckets = 1;
7784 // Number of frames that match to each time_millis, i.e. the bucket
7785 // contents
7786 // It's required that len(time_millis) == len(frame_count)
7787 repeated int64 frame_counts = 2;
7788}
Emilian Peev6729f372019-08-29 09:14:09 -07007789
Emilian Peev6729f372019-08-29 09:14:09 -07007790/**
7791 * Information about camera facing and API level usage.
7792 * Logged from:
7793 * frameworks/base/services/core/java/com/android/server/camera/CameraServiceProxy.java
7794 */
7795message CameraActionEvent {
7796 // Camera session duration
7797 optional int64 duration = 1;
7798
7799 // Camera API level used
7800 optional int32 api_level = 2;
7801
7802 // Name of client package
7803 optional string package_name = 3;
7804
7805 // Camera facing
7806 enum Facing {
7807 UNKNOWN = 0;
7808 BACK = 1;
7809 FRONT = 2;
7810 EXTERNAL = 3;
7811 }
7812 optional Facing facing = 4;
7813}
atrost01a20932019-08-28 15:40:37 +01007814
7815/**
7816 * Logs when a compatibility change is affecting an app.
7817 *
7818 * Logged from:
7819 * frameworks/base/core/java/android/app/AppCompatCallbacks.java and
7820 * frameworks/base/services/core/java/com/android/server/compat/PlatformCompat.java
7821 */
7822message AppCompatibilityChangeReported {
7823 // The UID of the app being affected by the compatibilty change.
7824 optional int32 uid = 1 [(is_uid) = true];
7825
7826 // The ID of the change affecting the app.
7827 optional int64 change_id = 2;
7828
7829 enum State {
7830 UNKNOWN_STATE = 0;
7831 ENABLED = 1;
7832 DISABLED = 2;
7833 LOGGED = 3;
7834 }
7835
7836 // The state of the change - if logged from gating whether it was enabled or disabled, or just
7837 // logged otherwise.
7838 optional State state = 3;
7839
7840 enum Source {
7841 UNKNOWN_SOURCE = 0;
7842 APP_PROCESS = 1;
7843 SYSTEM_SERVER = 2;
7844 }
7845
7846 // Where it was logged from.
7847 optional Source source = 4;
7848
7849}
Hector Dearman40579f62019-11-01 13:19:30 +00007850
7851/**
7852 * Logged from
7853 * external/perfetto/src/perfetto_cmd/perfetto_cmd.cc
7854 */
7855message PerfettoUploaded {
7856 enum Event {
7857 PERFETTO_UNDEFINED = 0;
7858 PERFETTO_TRACE_BEGIN = 1;
7859 PERFETTO_BACKGROUND_TRACE_BEGIN = 2;
7860 PERFETTO_ON_CONNECT = 3;
7861 PERFETTO_ON_TRACING_DISABLED = 4;
7862 PERFETTO_UPLOAD_DROPBOX_BEGIN = 5;
7863 PERFETTO_UPLOAD_DROPBOX_SUCCESS = 6;
7864 PERFETTO_UPLOAD_DROPBOX_FAILURE = 7;
7865 PERFETTO_UPLOAD_INCIDENT_BEGIN = 8;
7866 PERFETTO_UPLOAD_INCIDENT_SUCCESS = 9;
7867 PERFETTO_UPLOAD_INCIDENT_FAILURE = 10;
7868 PERFETTO_FINALIZE_TRACE_AND_EXIT = 11;
7869 PERFETTO_TRIGGER_BEGIN = 12;
7870 PERFETTO_TRIGGER_SUCCESS = 13;
7871 PERFETTO_TRIGGER_FAILURE = 14;
7872 PERFETTO_HIT_GUARDRAILS = 15;
7873 PERFETTO_ON_TIMEOUT = 16;
7874 PERFETTO_NOT_UPLOADING_EMPTY_TRACE = 17;
7875 }
7876
7877 // Which stage of the pipeline we are reporting from.
7878 optional Event event = 1;
7879
7880 // UUID matching the one set inside the SystemInfo trace packet.
7881 optional int64 trace_uuid_lsb = 2;
7882 optional int64 trace_uuid_msb = 3;
7883}
Mark Tabrya824a642019-11-05 12:26:12 -08007884
7885/**
7886 * Pulls client metrics on data transferred via Vehicle Maps Service.
7887 * Metrics are keyed by uid + layer.
7888 *
7889 * Pulled from:
7890 * packages/services/Car/service/src/com/android/car/stats/CarStatsService.java
7891 */
7892message VmsClientStats {
7893 // UID of the VMS client app
7894 optional int32 uid = 1 [(is_uid) = true];
7895
7896 // VMS layer definition
7897 optional int32 layer_type = 2;
7898 optional int32 layer_channel = 3;
7899 optional int32 layer_version = 4;
7900
7901 // Bytes and packets sent by the client for the layer
7902 optional int64 tx_bytes = 5;
7903 optional int64 tx_packets = 6;
7904
7905 // Bytes and packets received by the client for the layer
7906 optional int64 rx_bytes = 7;
7907 optional int64 rx_packets = 8;
7908
7909 // Bytes and packets dropped due to client error
7910 optional int64 dropped_bytes = 9;
7911 optional int64 dropped_packets = 10;
7912}
Stanislav Zholninccb82e42019-11-29 18:59:49 +00007913
7914/**
7915 * State of a dangerous permission requested by a package - sampled
7916 * Pulled from: StatsCompanionService.java with data obtained from PackageManager API
7917*/
7918message DangerousPermissionStateSampled {
7919 // Name of the permission
7920 optional string permission_name = 1;
7921
7922 // Uid of the package
7923 optional int32 uid = 2 [(is_uid) = true];
7924
7925 // If the permission is granted to the uid
7926 optional bool is_granted = 3;
7927
7928 // Permission flags as per android.content.pm.PermissionFlags
7929 optional int32 permission_flags = 4;
7930}
7931
Stan Iliev637ba5e2019-08-16 13:43:08 -04007932/**
7933 * HWUI renders pipeline type: GL (0) or Vulkan (1).
7934 */
7935enum PipelineType {
7936 GL = 0;
7937 VULKAN = 1;
7938}
7939
7940/**
7941 * HWUI stats for a given app.
7942 */
7943message GraphicsStats {
7944 // The package name of the app
7945 optional string package_name = 1;
7946
7947 // The version code of the app
7948 optional int64 version_code = 2;
7949
7950 // The start & end timestamps in UTC as
7951 // milliseconds since January 1, 1970
7952 // Compatible with java.util.Date#setTime()
7953 optional int64 stats_start = 3;
7954
7955 optional int64 stats_end = 4;
7956
7957 // HWUI renders pipeline type: GL or Vulkan.
7958 optional PipelineType pipeline = 5;
7959
7960 // Distinct frame count.
7961 optional int32 total_frames = 6;
7962
7963 // Number of "missed vsync" events.
7964 optional int32 missed_vsync_count = 7;
7965
7966 // Number of frames in triple-buffering scenario (high input latency)
7967 optional int32 high_input_latency_count = 8;
7968
7969 // Number of "slow UI thread" events.
7970 optional int32 slow_ui_thread_count = 9;
7971
7972 // Number of "slow bitmap upload" events.
7973 optional int32 slow_bitmap_upload_count = 10;
7974
7975 // Number of "slow draw" events.
7976 optional int32 slow_draw_count = 11;
7977
7978 // Number of frames that missed their deadline (aka, visibly janked)
7979 optional int32 missed_deadline_count = 12;
7980
7981 // The frame time histogram for the package
7982 optional FrameTimingHistogram cpu_histogram = 13
7983 [(android.os.statsd.log_mode) = MODE_BYTES];
7984
7985 // The gpu frame time histogram for the package
7986 optional FrameTimingHistogram gpu_histogram = 14
7987 [(android.os.statsd.log_mode) = MODE_BYTES];
7988
7989 // UI mainline module version.
7990 optional int64 version_ui_module = 15;
7991
7992 // If true, these are HWUI stats for up to a 24h period for a given app from today.
7993 // If false, these are HWUI stats for a 24h period for a given app from the last complete
7994 // day (yesterday). Stats from yesterday stay constant, while stats from today may change as
7995 // more apps are running / rendering.
7996 optional bool is_today = 16;
7997}
Stanislav Zholnin606454c2019-11-27 15:31:49 +00007998
7999/**
8000 * Message related to dangerous (runtime) app ops access
8001 */
8002message RuntimeAppOpsAccess {
8003 // Uid of the package accessing app op
8004 optional int32 uid = 1 [(is_uid) = true];
8005
8006 // Name of the package accessing app op
8007 optional string package_name = 2;
8008
8009 // operation id; maps to the OP_* constants in AppOpsManager.java
8010 optional int32 op_id = 3;
8011
8012 // feature id; provided by developer when accessing related API, limited at 50 chars by API.
8013 // Features must be provided through manifest using <feature> tag available in R and above.
8014 optional string feature_id = 4;
8015
8016 // message related to app op access, limited to 600 chars by API
8017 optional string message = 5;
8018
8019 enum SamplingStrategy {
8020 DEFAULT = 0;
8021 UNIFORM = 1;
8022 RARELY_USED = 2;
8023 }
8024
8025 // sampling strategy used to collect this message
8026 optional SamplingStrategy sampling_strategy = 6;
8027}
8028
Nikita Ioffe41dd57e2020-01-10 16:05:08 +00008029/*
8030 * Logs userspace reboot outcome and duration.
8031 *
8032 * Logged from:
8033 * frameworks/base/core/java/com/android/server/BootReceiver.java
8034 */
8035message UserspaceRebootReported {
8036 // Possible outcomes of userspace reboot.
8037 enum Outcome {
8038 // Default value in case platform failed to determine the outcome.
8039 OUTCOME_UNKNOWN = 0;
8040 // Userspace reboot succeeded (i.e. boot completed without a fall back to hard reboot).
8041 SUCCESS = 1;
8042 // Userspace reboot shutdown sequence was aborted.
8043 FAILED_SHUTDOWN_SEQUENCE_ABORTED = 2;
8044 // Remounting userdata into checkpointing mode failed.
8045 FAILED_USERDATA_REMOUNT = 3;
8046 // Device didn't finish booting before timeout and userspace reboot watchdog issued a hard
8047 // reboot.
8048 FAILED_USERSPACE_REBOOT_WATCHDOG_TRIGGERED = 4;
8049 }
8050 // Outcome of userspace reboot. Always set.
8051 optional Outcome outcome = 1;
8052 // Duration of userspace reboot in case it has a successful outcome.
8053 // Duration is measured as time between userspace reboot was initiated and until boot completed
8054 // (e.g. sys.boot_completed=1).
8055 optional int64 duration_millis = 2;
8056 // State of primary user's (user0) credential encryption storage.
8057 enum UserEncryptionState {
8058 // Default value.
8059 USER_ENCRYPTION_STATE_UNKNOWN = 0;
8060 // Credential encrypted storage is unlocked.
8061 UNLOCKED = 1;
8062 // Credential encrypted storage is locked.
8063 LOCKED = 2;
8064 }
8065 // State of primary user's encryption storage at the moment boot completed. Always set.
8066 optional UserEncryptionState user_encryption_state = 3;
8067}